aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/.arch-inventory3
-rw-r--r--src/.gdbinit29
-rw-r--r--src/ChangeLog29202
-rw-r--r--src/ChangeLog.1028326
-rw-r--r--src/ChangeLog.unicode4732
-rw-r--r--src/Makefile.in308
-rw-r--r--src/abbrev.c19
-rw-r--r--src/alloc.c578
-rw-r--r--src/alloca.c517
-rw-r--r--src/buffer.c142
-rw-r--r--src/buffer.h32
-rw-r--r--src/bytecode.c17
-rw-r--r--src/callint.c54
-rw-r--r--src/callproc.c485
-rw-r--r--src/casefiddle.c162
-rw-r--r--src/casetab.c88
-rw-r--r--src/category.c220
-rw-r--r--src/category.h23
-rw-r--r--src/ccl.c559
-rw-r--r--src/ccl.h33
-rw-r--r--src/character.c1041
-rw-r--r--src/character.h667
-rw-r--r--src/charset.c3229
-rw-r--r--src/charset.h1323
-rw-r--r--src/chartab.c1045
-rw-r--r--src/cm.c216
-rw-r--r--src/cm.h118
-rw-r--r--src/cmds.c21
-rw-r--r--src/coding.c12642
-rw-r--r--src/coding.h994
-rw-r--r--src/composite.c152
-rw-r--r--src/composite.h54
-rw-r--r--src/config.in19
-rw-r--r--src/data.c274
-rw-r--r--src/dired.c1
-rw-r--r--src/dispextern.h167
-rw-r--r--src/dispnew.c391
-rw-r--r--src/disptab.h10
-rw-r--r--src/doc.c2
-rw-r--r--src/doprnt.c2
-rw-r--r--src/dosfns.c2
-rw-r--r--src/editfns.c187
-rw-r--r--src/emacs.c84
-rw-r--r--src/eval.c21
-rw-r--r--src/fileio.c606
-rw-r--r--src/filelock.c4
-rw-r--r--src/floatfns.c9
-rw-r--r--src/fns.c889
-rw-r--r--src/font.c3858
-rw-r--r--src/font.h509
-rw-r--r--src/fontset.c2460
-rw-r--r--src/fontset.h79
-rw-r--r--src/frame.c704
-rw-r--r--src/frame.h147
-rw-r--r--src/fringe.c31
-rw-r--r--src/ftfont.c1008
-rw-r--r--src/ftxfont.c437
-rw-r--r--src/gtkutil.c199
-rw-r--r--src/image.c70
-rw-r--r--src/indent.c123
-rw-r--r--src/indent.h32
-rw-r--r--src/insdel.c72
-rw-r--r--src/intervals.c2
-rw-r--r--src/intervals.h2
-rw-r--r--src/keyboard.c1250
-rw-r--r--src/keyboard.h43
-rw-r--r--src/keymap.c479
-rw-r--r--src/keymap.h1
-rw-r--r--src/lisp.h622
-rw-r--r--src/lread.c800
-rw-r--r--src/m/ibms390x.h17
-rw-r--r--src/m/sh3el.h9
-rw-r--r--src/macfns.c153
-rw-r--r--src/macgui.h2
-rw-r--r--src/macmenu.c6
-rw-r--r--src/macterm.c270
-rw-r--r--src/macterm.h7
-rw-r--r--src/makefile.w32-in144
-rw-r--r--src/marker.c11
-rw-r--r--src/minibuf.c41
-rw-r--r--src/msdos.c34
-rw-r--r--src/prefix-args.c1
-rw-r--r--src/print.c184
-rw-r--r--src/process.c300
-rw-r--r--src/process.h2
-rw-r--r--src/puresize.h2
-rw-r--r--src/regex.c795
-rw-r--r--src/regex.h11
-rw-r--r--src/s/cygwin.h6
-rw-r--r--src/s/darwin.h6
-rw-r--r--src/s/hpux.h10
-rw-r--r--src/s/ms-w32.h4
-rw-r--r--src/scroll.c52
-rw-r--r--src/search.c200
-rw-r--r--src/sound.c1
-rw-r--r--src/syntax.c996
-rw-r--r--src/syntax.h43
-rw-r--r--src/sysdep.c723
-rw-r--r--src/syssignal.h1
-rw-r--r--src/term.c2923
-rw-r--r--src/termchar.h203
-rw-r--r--src/termhooks.h513
-rw-r--r--src/terminal.c566
-rw-r--r--src/termopts.h5
-rw-r--r--src/w16select.c2
-rw-r--r--src/w32.c14
-rw-r--r--src/w32bdf.c8
-rw-r--r--src/w32console.c160
-rw-r--r--src/w32fns.c430
-rw-r--r--src/w32font.c1382
-rw-r--r--src/w32inevt.c4
-rw-r--r--src/w32inevt.h2
-rw-r--r--src/w32menu.c19
-rw-r--r--src/w32proc.c13
-rw-r--r--src/w32select.c170
-rw-r--r--src/w32term.c1064
-rw-r--r--src/w32term.h33
-rw-r--r--src/w32xfns.c41
-rw-r--r--src/widget.c4
-rw-r--r--src/window.c123
-rw-r--r--src/window.h4
-rw-r--r--src/xdisp.c1571
-rw-r--r--src/xfaces.c1140
-rw-r--r--src/xfns.c779
-rw-r--r--src/xfont.c915
-rw-r--r--src/xftfont.c586
-rw-r--r--src/xmenu.c78
-rw-r--r--src/xrdb.c23
-rw-r--r--src/xselect.c65
-rw-r--r--src/xsmfns.c9
-rw-r--r--src/xterm.c1343
-rw-r--r--src/xterm.h22
132 files changed, 68750 insertions, 52122 deletions
diff --git a/src/.arch-inventory b/src/.arch-inventory
index c21e38d47d..fe99529135 100644
--- a/src/.arch-inventory
+++ b/src/.arch-inventory
@@ -3,10 +3,7 @@ source ^\.(gdbinit|dbxinit)$
# Auto-generated files, which ignore
precious ^(config\.stamp|config\.h|epaths\.h|buildobj\.lst)$
-precious ^(TAGS-LISP)$
-precious ^(buildobj\.lst)$
backup ^(stamp-oldxmenu|prefix-args|temacs|emacs|emacs-[0-9.]*)$
-backup ^(bootstrap-emacs)$
# arch-tag: 277cc7ae-b3f5-44af-abf1-84c073164543
diff --git a/src/.gdbinit b/src/.gdbinit
index ad7b666f18..a54f9d7b28 100644
--- a/src/.gdbinit
+++ b/src/.gdbinit
@@ -754,7 +754,7 @@ define xchartable
print (struct Lisp_Char_Table *) $ptr
printf "Purpose: "
xprintsym $->purpose
- printf " %d extra slots", ($->size & 0x1ff) - 388
+ printf " %d extra slots", ($->size & 0x1ff) - 68
echo \n
end
document xchartable
@@ -992,13 +992,36 @@ document xprintsym
Print argument as a symbol.
end
+define xcoding
+ set $tmp = (struct Lisp_Hash_Table *) ((Vcoding_system_hash_table & $valmask) | gdb_data_seg_bits)
+ set $tmp = (struct Lisp_Vector *) (($tmp->key_and_value & $valmask) | gdb_data_seg_bits)
+ set $name = $tmp->contents[$arg0 * 2]
+ print $name
+ pr
+ print $tmp->contents[$arg0 * 2 + 1]
+ pr
+end
+document xcoding
+ Print the name and attributes of coding system that has ID (argument).
+end
+
+define xcharset
+ set $tmp = (struct Lisp_Hash_Table *) ((Vcharset_hash_table & $valmask) | gdb_data_seg_bits)
+ set $tmp = (struct Lisp_Vector *) (($tmp->key_and_value & $valmask) | gdb_data_seg_bits)
+ p $tmp->contents[$arg0->hash_index * 2]
+ pr
+end
+document xcharset
+ Print the name of charset that has ID (argument).
+end
+
define xbacktrace
set $bt = backtrace_list
while $bt
xgettype (*$bt->function)
if $type == Lisp_Symbol
xprintsym (*$bt->function)
- printf " (0x%x)\n", $bt->args
+ printf " (0x%x)\n", *$bt->args
else
printf "0x%x ", *$bt->function
if $type == Lisp_Vectorlike
@@ -1115,7 +1138,7 @@ end
tbreak init_sys_modes
commands
silent
- xgetptr Vinitial_window_system
+ xgetptr Vwindow_system
set $tem = (struct Lisp_Symbol *) $ptr
xgetptr $tem->xname
set $tem = (struct Lisp_String *) $ptr
diff --git a/src/ChangeLog b/src/ChangeLog
index 4160a53e9d..e2ff82ff97 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,1281 +1,3 @@
-2007-10-08 Martin Rudalics <[email protected]>
-
- * keyboard.c (kbd_buffer_get_event): Break loop waiting for input
- when there's an unread command event.
-
- * frame.c (focus_follows_mouse): Moved here from frame.el to allow
- window autoselection act appropriately when leaving selected frame.
- (syms_of_frame): Initialize focus_follows_mouse.
- * frame.h (focus_follows_mouse): Extern it.
- * macterm.c (XTread_socket): When focus_follows_mouse is nil
- make SELECT_WINDOW_EVENT only if we don't leave the selected
- frame.
- * msdos.c (dos_rawgetc): Likewise.
- * w32term.c (w32_read_socket): Likewise.
- * xterm.c (handle_one_xevent): Likewise.
- * xdisp.c (syms_of_xdisp): In doc-string of
- mouse-autoselect-window mention focus-follows-mouse.
-
-2007-10-08 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.c (mac_load_query_font): Fix missing return value.
- [USE_CG_DRAWING] (mac_define_fringe_bitmap, mac_destroy_fringe_bitmap):
- Add BLOCK_INPUT.
-
-2007-10-08 Richard Stallman <[email protected]>
-
- * xdisp.c (get_window_cursor_type): Implement documented behavior
- for cursor-in-non-selected-windows = t.
-
-2007-10-08 Jason Rumney <[email protected]>
-
- * w32.c (w32_get_resource): Always close registry keys.
-
-2007-10-08 Jason Rumney <[email protected]>
-
- * makefile.w32-in (LIBS): Add COMCTL32.
-
- * w32fns.c (globals_of_w32fns): Init common controls.
-
-2007-10-08 Richard Stallman <[email protected]>
-
- * image.c (our_memory_buffer): Renamed from omfib_buffer.
-
-2007-10-08 Richard Stallman <[email protected]>
-
- * buffer.c (Foverlays_at): Doc fix.
-
-2007-10-08 Stefan Monnier <[email protected]>
-
- * fns.c (Fplist_put): Preserve uneven tail data.
-
-2007-10-08 Peter O'Gorman <[email protected]> (tiny change)
-
- * termhooks.h (enum event_kind): Remove trailing comma.
-
- * frame.h (enum): Remove trailing comma.
-
-2007-10-08 Dhuvra Krishnamurthy <[email protected]> (tiny change)
-
- * w32proc.c (delete_child): Don't terminate threads of zombies.
-
-2007-10-08 Martin Rudalics <[email protected]>
-
- * keyboard.h (struct kboard): New elt Vlast_repeatable_command.
-
- * keyboard.c (syms_of_keyboard): Set up new Lisp variable
- last-repeatable-command.
- (init_kboard): Initialize Vlast_repeatable_command.
- (command_loop_1): Set it to real_this_command unless that was
- bound to an input event.
- (mark_kboards): Mark it.
-
-2007-10-08 Richard Stallman <[email protected]>
-
- * eval.c (condition-case): Doc fix.
-
-2007-10-08 Masatake YAMATO <[email protected]>
-
- * xfaces.c (tty_supports_face_attributes_p): Fix code
- for LFACE_INVERSE_INDEX and LFACE_BACKGROUND_INDEX; code
- was copied and not edited.
-
-2007-10-09 Stefan Monnier <[email protected]>
-
- Add new `input-decode-map' keymap and use it for temrinal
- escape sequences.
- * keyboard.h (struct kboard): Add Vinput_decode_map.
- Remove Vlocal_key_translation_map.
- * keyboard.c (read_key_sequence): Add support for input-decode-map.
- (init_kboard): Init input-decode-map.
- Replace local-key-translation-map back with key-translation-map.
- (syms_of_keyboard): Declare input-decode-map.
- Remove local-key-translation-map. Update docstrings.
- (mark_kboards): Mark Vinput_decode_map.
- Don't mark Vlocal_key_translation_map.
- * keymap.c (Fdescribe_buffer_bindings): Describe input-decode-map.
- Replace local-key-translation-map back with key-translation-map.
- * term.c (term_get_fkeys_1, CONDITIONAL_REASSIGN):
- Bind in input-decode-map rather than function-key-map.
-
- * lisp.h (XSETPSEUDOVECTOR): Don't set the tag anymore.
- This was made redundant by the previous introduction of XSETPVECTYPE.
-
-2007-10-09 Richard Stallman <[email protected]>
-
- * image.c (free_bitmap_record): Rename from Free_Bitmap_Record.
-
-2007-09-29 Richard Stallman <[email protected]>
-
- * eval.c (internal_condition_case_2, internal_condition_case_1)
- (internal_condition_case): Reenable abort if x_catching_errors ()
- to see if that really happens and why.
-
-2007-10-06 Andreas Schwab <[email protected]>
-
- * fileio.c (Fwrite_region): Ignore EINVAL error from fsync.
-
-2007-10-04 Juanma Barranquero <[email protected]>
-
- * image.c (syms_of_image) <image-types>: Fix typo in docstring.
-
-2007-10-03 Stefan Monnier <[email protected]>
-
- * frame.h (struct frame): Don't try to GC-mark menu_bar_items_used.
-
-2007-10-02 Stefan Monnier <[email protected]>
-
- * window.h (struct window):
- * window.c (struct save_window_data, struct saved_window):
- * termhooks.h (struct terminal):
- * process.h (struct Lisp_Process):
- * frame.h (struct frame):
- * buffer.h (struct buffer):
- * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table)
- (struct Lisp_Bool_Vector, struct Lisp_Subr, struct Lisp_Hash_Table):
- The size field of (pseudo)vectors is now unsigned.
- (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG): Simplify accordingly.
-
- * lisp.h (struct Lisp_Hash_Table): Move non-traced elements at the end.
- Turn `count' into an integer.
-
- * fns.c (make_hash_table, hash_put, hash_remove, hash_clear)
- (sweep_weak_table, sweep_weak_hash_tables, Fhash_table_count):
- * print.c (print_object) <HASH_TABLE_P>: `count' is an int.
- * alloc.c (allocate_hash_table): Use ALLOCATE_PSEUDOVECTOR.
- (mark_object) <HASH_TABLE_P>: Use mark_vectorlike.
-
- * alloc.c (allocate_pseudovector): New fun.
- (ALLOCATE_PSEUDOVECTOR): New macro.
- (allocate_window, allocate_terminal, allocate_frame)
- (allocate_process): Use it.
- (mark_vectorlike): New function.
- (mark_object) <FRAMEP, WINDOWP, BOOL_VECTOR_P, VECTORP>: Use it.
- (mark_terminals): Use it.
- (Fmake_bool_vector, Fmake_char_table, make_sub_char_table)
- (Fmake_byte_code): Use XSETPVECTYPE.
-
- * frame.c (Fframe_parameters): Minor simplification.
-
- * insdel.c (adjust_markers_for_insert): Generalize assertion checks.
-
- * marker.c (Fmarker_buffer): Make test for odd case into a failure.
-
- * buffer.c (Fget_buffer_create, init_buffer_once):
- * lread.c (defsubr):
- * window.c (Fcurrent_window_configuration): Use XSETPVECTYPE.
-
- * lisp.h (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG): Don't let them be
- defined differently in the m/*.h files.
- (XCHAR_TABLE, XBOOL_VECTOR): Add assertion checking.
- (XSETPVECTYPE): New macro.
- (XSETPSEUDOVECTOR): Use it.
-
- * buffer.c (syms_of_buffer) <local-abbrev-table>: Move from abbrev.c.
- (DEFVAR_PER_BUFFER, defvar_per_buffer): Move from lisp.h and lread.c.
-
- * lisp.h (defvar_per_buffer, DEFVAR_PER_BUFFER):
- * lread.c (defvar_per_buffer):
- * abbrev.c (syms_of_abbrev) <local-abbrev-tabl>: Move to buffer.c.
-
- * window.c (candidate_window_p): Only consider as visible frames that
- are on the same terminal.
-
- * m/ibms390x.h (MARKBIT): Remove unused macro.
-
-2007-10-01 Juanma Barranquero <[email protected]>
-
- * lread.c (Fload): Fix typo in docstring.
-
-2007-10-01 Micha,Ak(Bl Cadilhac <[email protected]>
-
- * floatfns.c (Fexpt): Manually check for overflows, so that a power
- of a non-zero value can't yield zero.
-
-2007-09-29 Stefan Monnier <[email protected]>
-
- * term.c (term_clear_mouse_face, term_mouse_highlight)
- (tty_write_glyphs_with_face): Only define is HAVE_GPM.
-
- * print.c (safe_debug_print): Use XHASH.
-
- * lisp.h (DECL_ALIGN, USE_LSB_TAG): Move logic to before definition of
- Lisp elements such as tags.
- (XHASH): New macro.
- (EQ): Use it.
- (SREF, SSET, STRING_COPYIN): Use SDATA.
- (VOID_TO_LISP, CVOID_TO_LISP, LISP_TO_VOID, LISP_TO_CVOID): Remove.
-
- * alloc.c (mark_terminal): Remove left-over declaration.
- (enum mem_type): Replace all vector subtypes -> MEM_TYPE_VECTORLIKE.
- (allocate_vectorlike): Remove type argument. Adjust callers.
- (live_vector_p, mark_maybe_pointer, valid_lisp_object_p):
- Only handle the one remaining MEM_TYPE_VECTORLIKE.
-
- * alloc.c (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): New macros
- to avoid unnecessary BLOCK_INPUTs when SYNC_INPUT is used.
- (xmalloc, xrealloc, xfree, lisp_malloc, lisp_free, lisp_align_malloc)
- (lisp_align_free, make_interval, allocate_string, allocate_string_data)
- (make_float, Fcons, allocate_vectorlike, Fmake_symbol, allocate_misc):
- Use them.
-
- * xfaces.c (load_face_font, free_realized_face, clear_face_gcs):
- Don't let signal handlers run when a GC is freed but not yet NULL'ed.
- (x_free_gc): Remove BLOCK_INPUT since it's now redundant.
-
-2007-09-28 Dan Nicolaescu <[email protected]>
-
- * Makefile.in (lisp, shortlisp): Delete server.elc, it is not
- loaded by default.
-
-2007-09-28 Stefan Monnier <[email protected]>
-
- * term.c (Fgpm_mouse_start): Don't signal an error if already activated
- on this tty.
- (Fgpm_mouse_stop): Only deactivate if it was activated on this tty.
-
- * term.c (mouse_face_window): Rename from Qmouse_face_window.
- Update all users.
- (handle_one_term_event): Use Gpm_DrawPointer.
- (Fgpm_mouse_start): Rename from Fterm_open_connection.
- Signal errors instead of returning nil. Always return nil.
- (Fgpm_mouse_stop): Rename from Fterm_close_connection.
- Make it a noop if gpm-mouse was not activated.
- (syms_of_term): Update names.
-
-2007-09-27 Stefan Monnier <[email protected]>
-
- * sysdep.c (narrow_foreground_group, widen_foreground_group): Static.
- (init_sys_modes): Check that gpm_tty is the current tty.
-
- * alloc.c (allocate_terminal): Set the vector size to only count the
- lisp fields. Initialize those to nil.
- (mark_object): Don't treat terminals specially.
- (mark_terminal): Remove.
- (mark_terminals): Use mark_object instead.
-
- * termhooks.h (struct terminal): Move all Lisp_Object fields traced by
- the GC to the beginning.
-
- * indent.h:
- * indent.c: Use EMACS_INT for ints coming from Elisp data.
-
- * indent.c (Fmove_to_column): Use EMACS_INT for buffer positions.
-
-2007-09-25 Jason Rumney <[email protected]>
-
- * frame.c (make_terminal_frame): Remove special case for WINDOWSNT.
-
- * w32console.c (create_w32cons_output): Remove.
-
- * term.c (init_tty): Call init_sys_modes on WINDOWSNT also.
-
- * sysdep.c (init_sys_modes): Use set_terminal_modes_hook.
- (reset_sys_modes): Use reset_terminal_modes_hook.
-
-2007-09-24 Stefan Monnier <[email protected]>
-
- * eval.c (do_autoload): Don't output any message.
-
-2007-09-24 Juri Linkov <[email protected]>
-
- * emacs.c (standard_args): Change priority of "--no-splash"
- from 40 to 3. Add "--no-desktop" with the same priority.
-
-2007-09-23 Dmitry Antipov <[email protected]>
-
- * alloc.c (gc_sweep): Check cons cell mark bits word by word
- and optimize the case where they are all 1.
-
-2007-09-23 Johannes Weiner <[email protected]>
-
- * lisp.h (abs): Define if not defined.
- * keyboard.c, sound.c, w32term.c, xfaces.c, xterm.c:
- Don't define `abs', since it's defined in lisp.h.
-
-2007-09-22 Eli Zaretskii <[email protected]>
-
- * term.c (DEV_TTY): New macro. Provide a definition for
- MS-Windows.
- (FRAME_TERMCAP_P) [WINDOWSNT]: Don't define to zero.
- (Fcontrolling_tty_p, Fresume_tty, dissociate_if_controlling_tty)
- (init_tty): Use DEV_TTY instead of "/dev/tty".
- [WINDOWSNT]: No need to protect from NAME arg being null.
-
-2007-09-21 Dan Nicolaescu <[email protected]>
-
- * term.c (Fsuspend_tty): Run suspend-tty-functions before cleaning
- up the tty state.
-
-2007-09-21 Stefan Monnier <[email protected]>
-
- * termhooks.h (term_gpm): Delete. Use gpm_tty's NULLness instead.
- (gpm_tty): Change its type.
- * term.c (term_gpm): Delete. Use gpm_tty's NULLness instead.
- (gpm_tty): Change its type and initialize it.
- (Fterm_open_connection): Check the frame is indeed a tty.
- Use the new gpm_tty.
- (Fterm_close_connection): Use the new gpm_tty.
- * keyboard.c (tty_read_avail_input): Use the new gpm_tty.
- * sysdep.c (init_sys_modes): term_gpm -> gpm_tty.
-
-2007-09-21 Juanma Barranquero <[email protected]>
-
- * w32term.c (x_draw_glyph_string): Use strike_through_color, not
- underline_color, to draw strike-through.
-
-2007-09-21 Stefan Monnier <[email protected]>
-
- * lisp.h (allocate_terminal): Declare.
-
- * window.c (candidate_window_p): Consider frames that are being placed
- by the user as somewhere between visible and iconified.
- (window_loop): Prefer windows on the current frame.
- (Fselect_window): Move the use of select-frame to the beginning so we
- can just delegate all the work (it'll call us back anyway).
-
- * frame.c (Qdisplay_environment_variable):
- * frame.h (Qdisplay_environment_variable): Delete.
-
- * .gdbinit (xbacktrace): Print the arg's address rather than the value
- of the first arg, since that value may be a union.
-
- * callproc.c (child_setup, getenv_internal): Use the frame's `display'
- parameter rather than Qdisplay_environment_variable. If all else
- fails, look for DISPLAY in initial-environment.
-
-2007-09-21 Glenn Morris <[email protected]>
-
- * Makefile.in (emacstool): Remove target.
- (lisp, shortlisp): Remove termdev.elc.
-
-2007-09-21 Markus Triska <[email protected]>
-
- * xterm.c (x_delete_display): Compile session management conditionally.
-
-2007-09-20 Stefan Monnier <[email protected]>
-
- * callproc.c (getenv_internal_1): New function.
- (getenv_internal): Use it.
- (Fgetenv_internal): Use it. Accept an env-list as optional arg.
-
- * terminal.c (get_terminal): Don't accept ints to represent terminals.
- (Fterminal_name, Fterminal_parameters, Fterminal_parameter)
- (Fset_terminal_parameter): Work with dead terminals as well.
- (Fmodify_terminal_parameters): Remove.
-
- * terminal.c (get_terminal): Handle terminals.
- Make sure the terminal returned is live.
- (create_terminal): Use allocate_terminal.
- (mark_terminals): Move to alloc.c.
- (delete_terminal): Use terminal->name as liveness status.
- NULL out fields after freeing their contents.
- Don't deallocate the object.
- (Fframe_terminal): Use FRAME_TERMINAL. Return the terminal object
- rather than an int.
- (Fterminal_live_p): Accept non-integer arguments.
- (Fterminal_list): Return terminal objects rather than an ints.
-
- * alloc.c (enum mem_type): New member for `terminal' objects.
- (allocate_terminal): New function.
- (mark_maybe_pointer, valid_lisp_object_p, mark_object):
- Handle terminals.
- (mark_terminal): New fun.
- (mark_terminals): Move from terminal.c.
-
- * term.c (get_tty_terminal): Don't treat output_initial specially.
- (Fsuspend_tty, Fresume_tty): Use terminal objects rather than ints.
- (delete_tty): Use terminal->name as liveness status.
-
- * termhooks.h (struct terminal): Make it into a pseudovector.
- Remove `deleted' replaced by checking `name's nullness.
-
- * print.c (print_object): Handle terminals.
-
- * lisp.h (enum pvec_type): New `terminal' pseudovector.
- (XTERMINAL, XSETTERMINAL, TERMINALP, GC_TERMINALP): New macros.
-
- * frame.c (make_terminal_frame):
- * keyboard.c (tty_read_avail_input):
- * w32term.c (x_delete_terminal):
- * xfns.c (Fx_create_frame, x_create_tip_frame):
- * xterm.c (x_delete_terminal): Use terminal->name as liveness status.
-
-2007-09-20 Glenn Morris <[email protected]>
-
- * process.c (Fmake_network_process): Doc fix.
-
-2007-09-19 Jason Rumney <[email protected]>
-
- * dispextern.h (w32_init_fringe, mac_init_fringe): Declare rif argument.
-
-2007-09-19 Micha,Ak(Bl Cadilhac <[email protected]>
-
- * coding.c (detect_eol_type, detect_eol_type_in_2_octet_form):
- Fix a C warning regarding variable constness.
-
- * xterm.c (handle_one_xevent): Fix a C warning.
-
-2007-09-18 Jason Rumney <[email protected]>
-
- * w32fns.c (Fx_focus_frame): Rename from Fw32_focus_frame.
-
-2007-09-17 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (gdpy_def): New variable.
- (xg_initialize): Initialize gdpy_def.
- (xg_display_close): If no other display exists, set gdpy_def to a
- new connection.
-
-2007-09-16 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (xg_get_image_for_pixmap): Always create a GdkPixbuf
- when we have no file name for the icon.
- (xg_tool_bar_expose_callback): Remove.
- (xg_create_tool_bar): Don't connect expose signal to
- xg_tool_bar_expose_callback.
- (xg_get_file_with_chooser): Move GCPRO1 after declarations.
-
-2007-09-16 Andreas Schwab <[email protected]>
-
- * alloc.c (reset_malloc_hooks): Set the hooks to the previous
- values instead of zapping them.
-
-2007-09-14 Glenn Morris <[email protected]>
-
- * fringe.c (init_fringe_bitmap) <swap_nibble>: Move to file scope.
- * gtkutil.c (xg_separator_p) <separator_names>: Move to file scope.
- * image.c (our_memory_fill_input_buffer) <buffer>: Move to file
- scope and rename to omfib_buffer for clarity.
- (gif_load) <interlace_start, interlace_increment>: Move to file scope.
-
-2007-09-14 Kenichi Handa <[email protected]>
-
- * xterm.c (handle_one_xevent): Skip decoding if nbytes is zero.
-
-2007-09-13 Jason Rumney <[email protected]>
-
- * fringe.c (w32_init_fringe, mac_init_fringe): Add rif argument.
-
- * w32term.c (w32_term_init): Pass rif to w32_init_fringe.
-
- * macterm.c (mac_initialize): Don't call mac_init_fringe here.
- (mac_term_init): Call here instead, passing rif.
-
-2007-09-13 Glenn Morris <[email protected]>
-
- * s/hpux.h: No longer define `static' as nothing.
-
-2007-09-13 Johan Bockg,Ae(Brd <[email protected]>
-
- * callint.c (Fcall_interactively): Remove unused var `fun'.
-
-2007-09-12 Romain Francoise <[email protected]>
-
- * window.c (prefer_window_split_horizontally, display_buffer):
- Revert 2007-09-08 change.
-
-2007-09-12 Glenn Morris <[email protected]>
-
- * alloca.c: Remove file.
- * Makefile.in (alloca): Do not undef.
- (allocaobj, alloca.o): Remove.
- (otherobj): Remove allocaobj.
- * keyboard.c (command_loop_1): Remove #ifdef C_ALLOCA block.
- * regex.c (C_ALLOCA): Remove all references and code that was only
- used when this was defined.
- * search.c (boyer_moore): Remove #ifdef C_ALLOCA block.
- * xmenu.c (xmenu_show): Remove #ifdef C_ALLOCA block.
- * m/ibms390x.h, m/sh3el.h (C_ALLOCA): Remove references to this.
-
- * Makefile.in (SOURCES, unlock, relock): Delete.
-
- * gtkutil.c (cnt): Rename to menu_grab_callback_cnt for clarity.
- (menu_grab_callback): All uses changed.
-
- * xselect.c (cnt): Rename to x_reply_selection_request_cnt for clarity.
- (x_reply_selection_request): All uses changed.
-
-2007-09-11 Stefan Monnier <[email protected]>
-
- * lread.c (load_warn_old_style_backquotes): Change message to look
- better when it appears in the middle of byte-compiler messages.
-
-2007-09-10 Dan Nicolaescu <[email protected]>
-
- * s/darwin.h (MULTI_KBOARD): Only define for Carbon.
-
- * xterm.c (x_create_terminal): Add comment.
-
- * term.c (clear_tty_hooks, set_tty_hooks): Add comments.
-
-2007-09-10 Richard Stallman <[email protected]>
-
- * xterm.c (x_term_init): Give error if can't open DISPLAY_NAME.
-
-2007-09-10 Micha,Ak(Bl Cadilhac <[email protected]>
-
- * lisp.h (struct Lisp_Subr): Rename `prompt' field to `intspec'.
- (DEFUN): Document `intspec', use it instead of `prompt'.
-
- * eval.c (Fcommandp): Change `->prompt' to `->intspec'.
-
- * data.c (Finteractive_form): If the interactive specification starts
- with a `(', use it as a Lisp form.
-
- * fileio.c (Fset_file_modes): Add an interactive spec that reads a file
- name and file modes.
-
- * callint.c (Fcall_interactively): Comment fixes.
-
-2007-09-10 Stefan Monnier <[email protected]>
-
- * callint.c (Fcall_interactively): Use Finteractive_form also for subrs
- and compiled functions.
-
-2007-09-08 Fredrik Axelsson <[email protected]>
-
- * window.c (prefer_window_split_horizontally): New variable.
- (display_buffer): Consider splitting window horizontally depending
- on prefer_window_split_horizontally.
-
-2007-09-08 Eli Zaretskii <[email protected]>
-
- * sysdep.c [WINDOWSNT]: Don't include sysselect.h.
-
-2007-09-07 Stefan Monnier <[email protected]>
-
- * s/cygwin.h (GC_MARK_STACK): Enable conservative stack marking.
-
- * frame.c (x_set_frame_parameters): Check number is positive before
- using XFASTINT.
-
- * window.c (freeze_window_start): Don't presume selected_window holds
- a window object.
- (Fdisplay_buffer): Remove `register' since `buffer' needs to be gcpro'd.
-
-2007-09-07 Angelo Graziosi <[email protected]> (tiny change)
-
- * term.c (dissociate_if_controlling_tty): Call setsid on CYGWIN.
-
-2007-09-07 Stefan Monnier <[email protected]>
-
- * window.c (Vsplit_window_preferred_function): New var.
- (Fdisplay_buffer): Use it.
- (syms_of_window): Export, and initialize it.
-
-2007-09-06 Pixel <[email protected]> (tiny change)
-
- * image.c (gif_load): Fix bug: Handle nonexistent colormap.
-
-2007-09-06 Glenn Morris <[email protected]>
-
- * gtkutil.c (menu_grab_callback) <cnt>:
- * xselect.c (x_reply_selection_request) <cnt>: Move static
- variable to file scope.
-
-2007-09-06 Stefan Monnier <[email protected]>
-
- * xdisp.c (redisplay_internal): Make sure Elisp code always sees
- consistent values of selected_frame and selected_window.
-
-2007-09-04 Jason Rumney <[email protected]>
-
- * w32console.c (initialize_w32_display): Zero unused hooks.
-
-2007-09-04 Dan Nicolaescu <[email protected]>
-
- * term.c (Vsuspend_tty_functions, Vresume_tty_functions)
- (syms_of_term, Fsuspend_tty, Fresume_tty): Undo previous change.
-
-2007-09-04 Jason Rumney <[email protected]>
-
- * term.c (init_tty) [WINDOWSNT]: Add hooks that are not accessible
- in w32console.c. Set up input. Remove XXX comments that have been
- confirmed as correct.
-
- * s/ms-w32.h (MULTI_KBOARD): Define.
-
- * w32console.c (one_and_only_w32cons): Remove.
- (initialize_w32_display): Take terminal argument.
-
- * term.c (init_tty) [WINDOWSNT]: Pass terminal to
- initialize_w32_display.
- (init_tty) [MULTI_KBOARD]: Include this code on WINDOWSNT too.
-
- * termhooks.h (enum event_kind) <HORIZ_WHEEL_EVENT>: New event.
-
- * keyboard.c (discard_mouse_events): Discard it.
- (make_lispy_event): Translate it to a lisp event.
- (lispy_wheel_names): Add wheel-left and right events.
- (syms_of_keyboard): Enlarge wheel_syms.
-
- * w32fns.c (w32_wnd_proc) <WM_DROPFILES>: Merge with WM_MOUSEWHEEL.
- <WM_MOUSEHWHEEL>: Pass new system message to lisp.
-
- * w32term.h (WM_MOUSEHWHEEL): Define if system headers don't.
-
- * w32term.c (construct_mouse_wheel): Make HORIZ_WHEEL_EVENT
- from WM_MOUSEHWHEEL.
- (w32_read_socket) <WM_MOUSEHWHEEL>: Treat as WM_MOUSEWHEEL.
-
- * w32fns.c (x_create_tip_frame) [MULTI_KBOARD]: Get keyboard from
- terminal.
-
- * w32term.c (w32_create_terminal) [MULTI_KBOARD]: Create a new
- keyboard for the terminal.
-
-2007-09-04 Dan Nicolaescu <[email protected]>
-
- * term.c (Vsuspend_tty_hook): Rename from Vsuspend_tty_functions.
- (Vresume_tty_hook): Rename from Vresume_tty_functions.
- (syms_of_term): Rename suspend-tty-functions to suspend-tty-hook
- and resume-tty-function to resume-tty-hook.
- (Fsuspend_tty, Fresume_tty): Use new names.
-
-2007-09-02 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (update_frame_tool_bar): Handle stock name as a named icon
- if it starts with "n:".
-
-2007-08-31 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (update_frame_tool_bar): Initialize wbutton to NULL.
-
-2007-08-31 Stefan Monnier <[email protected]>
-
- * frame.h:
- * frame.c (Qterm_environment_variable): Remove.
- (syms_of_frame): Don't init and staticpro it.
-
- * callproc.c (getenv_internal): Remove special case for $TERM.
-
- * callproc.c (Vinitial_environment): New variable.
- (set_initial_environment): Initialize it.
- (syms_of_callproc): Declare it.
- (child_setup): Don't mess with TERM via Qterm_environment_variable; the
- TERM under which a process runs is never related to the TERM in which
- Emacs is running.
-
-2007-08-29 Dan Nicolaescu <[email protected]>
-
- * config.in (HAVE_WINDOW_SYSTEM): Don't undef MULTI_KBOARD here...
- * s/darwin.h: ... do it here.
-
-2007-08-29 Stefan Monnier <[email protected]>
-
- * lisp.h (set_initial_environment): Rename from set_global_environment.
-
- * Makefile.in (${etc}DOC): Re-add a ${EXEEXT} which seems to have been
- removed by mistake on the multi-tty branch.
-
- * frame.c (make_terminal_frame): Yet Another Int/Lisp_Object Mixup.
- (Fmodify_frame_parameters): Return a value.
-
- * image.c (png_load): Comment-out var only used in commented-out code.
-
- * term.c (mark_ttys): Don't bother checking top_frame (incorrectly)
- before passing it to mark_object.
-
- * xfaces.c (internal_resolve_face_name): Return a value.
- (internal_resolve_face_name, resolve_face_name_error): Comment out.
-
- * xfns.c (check_x_display_info): Yet Another Int/Lisp_Object Mixup.
- (x_icon): Comment-out var only used in commented-out code.
-
-2007-08-29 Romain Francoise <[email protected]>
-
- * keyboard.c (Fset_input_mode): Don't call `Fset_quit_char' if
- QUIT hasn't been provided.
-
-2007-08-29 Dan Nicolaescu <[email protected]>
-
- * callproc.c (child_setup, getenv_internal): Use the
- display-environment-variable and term-environment-variable frame
- params.
- (set_initial_environment): Initialise Vprocess_environment.
-
- * config.in: Disable multi-keyboard support on a mac.
-
- * frame.c (Qterm_environment_variable)
- (Qdisplay_environment_variable): New variables.
- (syms_of_frame): Intern and staticpro them.
- (Fmake_terminal_frame): Disable output method test.
-
- * frame.h: Declare them here.
-
- * macfns.c (x_set_mouse_color): Get rif from the frame.
- (x_set_tool_bar_lines): Don't use updating_frame.
- (mac_window): Add 2 new parameters for consistency with other systems.
- (Fx_create_frame): Fix doc string. Rename the parameter. Set the
- frame parameters following what is done in X11 and w32. Don't use
- FRAME_MAC_DISPLAY_INFO.
- (Fx_open_connection, start_hourglass): Remove window-system check.
- (x_create_tip_frame): Get the keyboard from the terminal.
-
- * macmenu.c: Reorder includes.
- (Fx_popup_menu): Use terminal specific mouse_position_hook.
-
- * macterm.c (XTset_terminal_modes, XTreset_terminal_modes): Add a
- terminal parameter.
- (x_clear_frame): Add a frame parameter.
- (note_mouse_movement): Get rif from the frame.
- (mac_term_init): Initialize the terminal.
- (mac_initialize): Make static and move terminal initialization ...
- (mac_create_terminal): ... to this new function.
-
- * macterm.h (struct mac_display_info): Add terminal.
- (mac_initialize): Delete declaration.
-
- * puresize.h (BASE_PURESIZE): Increase base value to 1164000.
-
- * sysdep.c: Comment out text after #endif.
-
- * term.c (init_tty): Only use terminal->kboard when MULTI_KBOARD
- is defined. Better initialize ttys in windows. Use terminal
- specific mouse_position_hook.
-
- * termhooks.h (union display_info): Add mac_display_info.
-
- * w32fns.c (Fx_create_frame): Use kboard from the terminal.
- Set the default minibuffer frame, window_system and the rest of the
- frame parameters following what is done in X11.
-
- * w32term.c (w32_initialize): Make static.
-
- * xselect.c (x_handle_selection_clear): Only access
- terminal->kboard when MULTI_KBOARD is defined.
-
- * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Define here.
- (SYSTEM_PURESIZE_EXTRA): Only define on Carbon.
-
-2007-08-29 Jason Rumney <[email protected]>
-
- * frame.c (Fdelete_frame): Only get kboard when MULTI_KBOARD defined.
- (make_terminal_frame) [WINDOWSNT]: Initialize terminal.
-
- * fringe.c (w32_init_fringe w32_reset_fringes) [HAVE_NTGUI]:
- (mac_init_fringe) [MAC_OS]: Get rif from selected_frame.
-
- * keyboard.c (restore_kboard_configuration): Only define when
- MULTI_KBOARD defined.
-
- * makefile.w32-in: Update dependancies from Makefile.in
- (OBJ1): Add terminal.$(O)
-
- * term.c (dissociate_if_controlling_tty) [WINDOWSNT]:
- Don't define function body.
- (init_tty) [WINDOWSNT]: Use selected_frame for initializing.
-
- * termhooks.h (display_info) [WINDOWSNT]: Add w32.
-
- * w32.c (request_sigio, unrequest_sigio): Remove.
-
- * w32console.c (w32con_move_cursor, w32con_clear_to_end)
- (w32con_clear_frame, w32con_clear_end_of_line)
- (w32con_ins_del_lines, w32con_insert_glyphs, w32con_write_glyphs)
- (w32con_delete_glyphs, w32con_set_terminal_window)
- (scroll_line, w32_sys_ring_bell): Add frame arg.
- (w32con_set_terminal_modes, w32con_reset_terminal_modes):
- Add terminal arg.
- (PICK_FRAME): Remove.
- (w32con_write_glyphs): Use frame specific terminal coding.
- (one_and_only_w32cons): New global variable.
- (initialize_w32_display): Use it for storing hooks.
- (create_w32cons_output): New function.
-
- * w32inevt.c, w32inevt.h (w32_console_read_socket): Make first
- arg a frame.
-
- * w32fns.c (x_create_tip_frame): Set terminal and ref count.
- Set window_system.
- (x_set_tool_bar_lines): Don't use updating_frame.
- (Fx_create_frame): Set terminal and ref count.
- (Fx_open_connection): Remove window-system check.
-
- * w32menu.c (Fx_popup_menu): Use terminal specific mouse_position_hook.
-
- * w32term.c (w32_term_init): Call add_keyboard_wait_descriptor.
- (w32_set_terminal_modes, w32_reset_terminal_modes): Add terminal arg.
- (x_clear_frame, x_delete_glyphs, w32_ring_bell, x_ins_del_lines):
- Add frame arg.
- (x_delete_terminal, w32_create_terminal): New functions.
- (w32_term_init): Create a terminal.
- (w32_initialize): Move terminal specific initialization to
- w32_create_terminal.
-
- * w32term.h (x_output): Remove foreground_pixel and background_pixel.
- (w32_clear_rect, w32_clear_area): Use background from frame.
- (w32_display_info): Add terminal.
- (w32_sys_ring_bell, x_delete_display): Declare here.
-
- * xdisp.c (display_menu_bar) [HAVE_NTGUI]: Check frame type.
-
- * s/ms-w32.h (SYSTEM_PURESIZE_EXTRA): Bump to 50k.
-
-2007-08-29 Kalle Olavi Niemitalo <[email protected]> (tiny change)
-
- * keyboard.c (interrupt_signal, handle_interrupt, Fset_quit_char):
- Fix get_named_tty calls for the controlling tty.
-
-2007-08-29 ARISAWA Akihiro <[email protected]> (tiny change)
-
- * term.c (dissociate_if_controlling_tty)[USG]: Fix parse error.
-
-2007-08-29 Yoshiaki Kasahara <[email protected]> (tiny change)
-
- * term.c (tty_insert_glyphs): Add missing first parameter.
-
-2007-08-29 Karoly Lorentey <[email protected]>
-
- * buffer.c (Fbuffer_list, Fbury_buffer):
- Take frame->buried_buffer_list into account.
-
- * cm.c (current_tty): New variable, for cmputc().
- (cmputc): Use it.
- (cmcheckmagic): Add tty parameter, look up terminal streams there.
- (calccost): Add tty parameter. Use emacs_tputs() instead of tputs().
- (cmgoto): Add tty parameter. Pass it on to calccost().
- Use emacs_tputs() instead of tputs().
-
- * cm.h (emacs_tputs): New macro to set current_tty, and then call
- tputs().
- (current_tty): New variable, for cmputc().
- (cmcheckmagic, cmputc, cmgoto): Add prototypes.
-
- * eval.c (unwind_to_catch): Don't call x_fully_uncatch_errors.
- (internal_condition_case, internal_condition_case_1)
- (internal_condition_case_2): Don't abort when x_catching_errors.
-
- * fns.c (Fyes_or_no_p): Don't try to open an X dialog on tty terminals.
- (Fy_or_n_p): Likewise. Use temporarily_switch_to_single_kboard to
- prevent crashes caused by bogus longjmps in read_char.
-
- * keymap.h (Fset_keymap_parent): Add EXFUN.
-
- * macterm.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL)
- * w32term.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL):
- Remove redundant definition.
-
- * macfns.c (x_set_mouse_color, x_make_gc):
- Use FRAME_BACKGROUND_PIXEL and FRAME_FOREGROUND_PIXEL.
-
- * w32term.c (x_free_frame_resources):
- Use FRAME_BACKGROUND_PIXEL and FRAME_FOREGROUND_PIXEL.
- (w32_initialize): Use the accessor macros for terminal characteristics.
-
- * macterm.c (mac_initialize): Use Fset_input_interrupt_mode.
- Use the accessor macros for terminal characteristics.
- * msdos.c (internal_terminal_init): Use the accessor macros for
- terminal characteristics.
- (ScreenVisualBell, internal_terminal_init):
- Use FRAME_BACKGROUND_PIXEL and FRAME_FOREGROUND_PIXEL.
-
- * termopts.h (no_redraw_on_reenter): Declare.
-
- * alloc.c (emacs_blocked_malloc): Disable mallopt call.
- (mark_terminals, mark_ttys): Declare.
- (Fgarbage_collect): Call them.
- (mark_object): Mark buried_buffer_list.
-
- * prefix-args.c: Include stdlib.h for exit.
-
- * syssignal.h: Add comment.
-
- * indent.c: Include stdio.h.
-
- * window.h (Vinitial_window_system): Declare.
- (Vwindow_system): Delete declaration.
-
- * fontset.c (Finternal_char_font): Use FRAME_RIF.
-
- * image.c (lookup_image): Don't initialize `c' until the xasserts
- have been run.
-
- * gtkutil.c (xg_create_frame_widgets): Use FRAME_BACKGROUND_PIXEL and
- FRAME_FOREGROUND_PIXEL.
-
- * print.c (print_preprocess): Don't lose print_depth levels while
- iterating.
-
- * widget.c (update_from_various_frame_slots):
- Use FRAME_BACKGROUND_PIXEL and FRAME_FOREGROUND_PIXEL.
-
- * window.c (set_window_buffer): Don't call clear_mouse_face on tty
- frames.
- (window_internal_height): Remove bogus make_number call.
- (init_window_once): Call make_terminal_frame with two zero parameters.
-
- * fileio.c (Fread_file_name): Update comment.
-
- * callint.c (Fcall_interactively):
- Use temporarily_switch_to_single_kboard instead of single_kboard_state.
- Make sure it is correctly unwound.
-
- * xsmfns.c (x_session_close): New function.
-
- * coding.h (terminal_coding, safe_terminal_coding, keyboard_coding):
- Delete declarations.
-
- * xterm.h: Remove declaration for x_fully_uncatch_errors.
- (x_output): Remove background_pixel and foreground_pixel fields.
- (x_display_info): Add new field TERMINAL. Remove KBOARD field.
- (x_delete_device):
- (x_session_close): Declare.
-
- * lread.c: Include setjmp.h. Update declaration of `read_char'.
- (read_filtered_event): Call `read_char' with a local
- `wrong_kboard_jmpbuf'.
-
- * minibuf.c (read_minibuf): Call temporarily_switch_to_single_kboard.
- Don't call single_kboard_state. Use FRAME_RIF.
-
- * process.c (Fmake_network_process): Don't unrequest_sigio on modern
- systems.
-
- * lisp.h (set_process_environment): Rename to `set_global_environment'.
- (Fframe_with_environment, Fset_input_meta_mode)
- (Fset_quit_char): EXFUN.
- (x_create_device, tty_output, terminal, tty_display_info): Declare.
- (init_sys_modes, reset_sys_modes): Update prototypes.
- (init_all_sys_modes, reset_all_sys_modes): New prototypes.
-
- * keyboard.h (struct kboard): Add new fields Vlocal_function_key_map,
- Vlocal_key_translation_map, and Vkeyboard_translate_table.
- (Vfunction_key_map, Vkeyboard_translate_table, single_kboard_state):
- Delete declarations.
- (Vfunction_key_map, Vkey_translation_map, push_kboard, pop_kboard)
- (temporarily_switch_to_single_kboard, tty_read_avail_input):
- New declarations.
-
- * emacs.c (main): Don't call init_sys_modes(), the new term_init()
- already does that during init_display(). Call syms_of_keymap
- before syms_of_keyboard. Call `syms_of_terminal'.
- Call set_initial_environment, not set_process_environment.
- (shut_down_emacs): Call reset_all_sys_modes() instead of
- reset_sys_modes().
-
- * xfaces.c (x_free_gc): Protect xassert with GLYPH_DEBUG.
- (internal_resolve_face_name, resolve_face_name_error): New functions.
- (resolve_face_name): Protect against loops and errors thrown by Fget.
- (realize_default_face): Don't use FRAME_FONT unless frame is an X frame.
- (Ftty_supports_face_attributes_p): Update tty_capable_p call.
-
- * scroll.c: Replace CURTTY() with local variables throughout the
- file (where applicable).
- (calculate_scrolling, calculate_direct_scrolling)
- (scrolling_1, scroll_cost): Use the accessor macros for terminal
- characteristics.
-
- * keymap.c (Vfunction_key_map): Remove.
- (Fdescribe_buffer_bindings): Update references to Vfunction_key_map.
- (syms_of_keymap): Remove DEFVAR for Vfunction_key_map.
- (Vkey_translation_map): Remove.
- (syms_of_keymap): Remove DEFVAR for key-translation-map.
- (Fdescribe_buffer_bindings):
- (read_key_sequence, init_kboard, syms_of_keyboard, mark_kboards):
- Update for terminal-local key-translation-map.
-
- * Makefile.in (callproc.o): Update dependencies.
- (lisp, shortlisp): Add termdev.elc.
- (obj): Add terminal.o.
- (terminal.o): Add dependencies.
- [HAVE_CARBON]: Make terminal.o depend on macgui.h.
- (data.o, fns.o): Add termhooks.h dependency.
- (SOME_MACHINE_LISP): Add dnd.elc.
- (minibuf.o): Fix typo.
- Update dependencies.
-
- * data.c (do_symval_forwarding, store_symval_forwarding)
- (find_symbol_value): Use the selected frame's keyboard, not
- current_kboard.
-
- * .gdbinit (init_sys_modes): Use Vinitial_window_system instead of
- Vwindow_system.
-
- * xmenu.c (Fx_menu_bar_open) [USE_X_TOOLKIT, USE_GTK]: Rename from
- Fmenu_bar_open.
- (syms_of_xmenu): Update defsubr.
- (mouse_position_for_popup, Fx_popup_menu)
- (Fx_popup_dialog, x_activate_menubar, update_frame_menubar)
- (set_frame_menubar, free_frame_menubar)
- (create_and_show_popup_menu, xmenu_show, )
- (create_and_show_dialog, xdialog_show, xmenu_show): Abort if not
- an X frame.
-
- * xselect.c (x_own_selection): Abort if not an X frame.
- (some_frame_on_display): Check if it is an X frame.
- (x_handle_selection_clear): Deal with MULTI_KBOARD.
-
- * coding.c: Include frame.h and termhooks.h.
- (terminal_coding, keyboard_coding): Delete.
- (Fset_terminal_coding_system_internal):
- (Fset_keyboard_coding_system_internal):
- (Fkeyboard_coding_system):
- (Fterminal_coding_system): Add a terminal parameter.
- Get terminal_coding from the terminal.
- (init_coding_once): Don't call setup_coding_system here.
-
- * dispextern.h (set_scroll_region, turn_off_insert)
- (turn_off_highlight, background_highlight, clear_end_of_line_raw)
- (tty_clear_end_of_line, tty_setup_colors)
- (delete_tty, updating_frame)
- (produce_special_glyphs, produce_glyphs, write_glyphs)
- (insert_glyphs): Remove.
- (raw_cursor_to, clear_to_end, tty_turn_off_insert)
- (tty_turn_off_highlight, get_tty_size): Add declaration.
- (tabs_safe_p, init_baud_rate, get_tty_terminal): Update prototypes.
-
- * frame.h (enum output_method): Add output_initial.
- (struct x_output): Delete.
- (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL):
- Access foreground_pixel and background_pixel directly from the frame.
- (tty_display): Delete.
- (struct frame): Add buried_buffer_list, foreground_pixel,
- background_pixel and terminal. Delete kboard
- (union output_data): Add tty.
- (FRAME_KBOARD): Get the kboard from the terminal.
- (FRAME_INITIAL_P): New macro.
- (Qtty, Qtty_type, Qterminal, Qterminal_live_p, Qenvironment)
- (Qterm_environment_variable, Qdisplay_environment_variable)
- (make_terminal_frame, Qburied_buffer_list, Qwindow_system):
- New declarations.
-
- * termchar.h (tty_output, tty_display_info): New structures.
- (tty_list): Declare.
- (FRAME_TTY, CURTTY): New macros.
- (must_write_spaces, min_padding_speed, fast_clear_end_of_line)
- (line_ins_del_ok, char_ins_del_ok, scroll_region_ok)
- (scroll_region_cost, memory_below_frame, fast_clear_end_of_line)
- (dont_calculate_costs, no_redraw_on_reenter): Remove declarations.
-
- * callproc.c: Include frame.h and termhooks.h, for terminal
- parameters.
- (add_env): New function.
- (child_setup): Use it.
- (child_setup, getenv_internal): Handle the new Vprocess_environment.
- (getenv_internal): Fix get_terminal_param call.
- (Fgetenv_internal, egetenv): Update doc.
- (syms_of_callproc): Initialize Vprocess_environment to nil.
- Register and initialize them. Remove obsolete defvars. Update doc
- strings.
- (child_setup): Handle Vlocal_environment_variables.
- (getenv_internal): Add terminal parameter.
- Handle Vlocal_environment_variables.
- (Fgetenv_internal): Add terminal parameter.
- (child_setup, getenv_internal, Fgetenv_internal): Store the local
- environment in a frame (not terminal) parameter. Update doc strings.
- (set_initial_environment): Rename from set_global_environment.
- Store Emacs environment in initial frame parameter.
-
- * xdisp.c (redisplay_internal): Update references to
- `previous_terminal_frame'.
- (display_mode_line, Fformat_mode_line): Replace calls to
- `push_frame_kboard' with `push_kboard'.
- (get_glyph_string_clip_rects): Add extra parentheses and
- braces to prevent compiler warnings.
- (calc_pixel_width_or_height): Add xassert to check that the
- frame is alive. Don't call `lookup_image' on a termcap frame.
- (message2_nolog, message3_nolog, redisplay_internal)
- (set_vertical_scroll_bar, redisplay_window, check_x_display_info)
- (x_set_scroll_bar_foreground, x_set_scroll_bar_background)
- (Fx_create_frame, Fxw_display_color_p, Fx_display_grayscale_p)
- (Fx_display_pixel_width, Fx_display_pixel_height)
- (Fx_display_planes, Fx_display_color_cells)
- (Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
- (Fx_display_screens, Fx_display_mm_height, Fx_display_mm_width)
- (Fx_display_backing_store, Fx_display_visual_class)
- (Fx_display_save_under, Fx_close_connection, x_create_tip_frame):
- Use FRAME_TERMINAL_P, FRAME_WINDOW_P, FRAME_TTY and FRAME_RIF.
-
- * xfns.c (x_set_foreground_color x_set_background_color)
- (x_set_mouse_color, x_set_cursor_color, x_make_gc):
- Use FRAME_BACKGROUND_PIXEL and FRAME_FOREGROUND_PIXEL.
- (Fx_create_frame, x_create_tip_frame, build_string, x_window)
- (Fx_create_frame, x_create_tip_frame): Don't create frames on a
- terminal that is being deleted.
- (Fx_create_frame): Use `store_frame_param' to set `window-system'
- frame parameter, and make sure it overrides any user-supplied setting.
- (Fx_close_connection, Fx_synchronize): Unify argument names with
- the rest of the DEFUNs.
-
- * dispnew.c (Fsend_string_to_terminal): Update call to
- `get_tty_terminal'.
- (Fredraw_frame, Fsend_string_to_terminal)
- (Fsend_string_to_terminal, init_display): Use FRAME_RIF,
- FRAME_TERMCAP_P and FRAME_TTY.
- (window_change_signal): Don't believe width/height values that are
- impossibly small.
- (Vinitial_window_system): Rename from Vwindow_system.
- (termscript, Wcm, rif): Delete.
-
- * termhooks.h (struct terminal): New struct containing the
- previously global text display hooks and new members NAME,
- DELETED and PARAM_ALIST.
- (FRAME_TERMINAL, TERMINAL_TERMINAL_CODING)
- (TERMINAL_KEYBOARD_CODING, TERMINAL_ACTIVE_P, FRAME_WINDOW_P)
- (FRAME_RIF): New macros.
- (get_terminal_param, get_device): New declarations.
- (termscript): Delete declaration.
-
- * xterm.c (x_initialize): Use Fset_input_interrupt_mode.
- (XTflash, x_free_frame_resources, x_scroll_bar_create)
- (x_scroll_bar_set_handle): Use FRAME_BACKGROUND_PIXEL and
- FRAME_FOREGROUND_PIXEL.
- (x_fully_uncatch_errors): Disable definition.
- (x_scroll_bar_expose): Fix reference to foreground pixel.
- (XTread_socket): Disable loop on all X displays.
- (x_delete_terminal): Don't set terminal->deleted and let
- delete_terminal delete the frames on the terminal.
- (x_delete_display): Doc update to reflect changes in
- delete_terminal.
- (x_display_info) <terminal>: Move member earlier in the struct.
- (deleting_tty): Remove old variable.
- (Fsuspend_tty): Call clear_tty_hooks.
- (Fresume_tty, init_tty): Call set_tty_hooks.
- (Ftty_display_color_p, Ftty_display_color_cells): Don't throw
- errors on X frames.
- (x_catch_errors_unwind): Abort if x_error_message is NULL.
- (handle_one_xevent): Initialize `f' to NULL.
- (x_delete_terminal, x_create_terminal): New functions.
- (XTset_terminal_modes, XTreset_terminal_modes)
- (XTread_socket, x_connection_closed, x_term_init)
- (x_term_init, x_delete_display): Add terminal parameter.
- (x_term_init) [!HAVE_GTK_MULTIDISPLAY]: Refuse to create secondary
- X connections.
-
- * frame.c (Fframep): Deal with output_initial.
- (Qbuffer_predicate, Qbuffer_list, Qburied_buffer_list, Qtty)
- (Qtty_type, Qwindow_system, Qenvironment)
- (Qterm_environment_variable, Qdisplay_environment_variable): New vars.
- (x_set_screen_gamma, store_frame_param): Fix compilation errors.
- (make_terminal_frame): Don't create frames on a terminal that is
- being deleted.
- (make_terminal_frame): Use FRAME_BACKGROUND_PIXEL and
- FRAME_FOREGROUND_PIXEL.
- (store_frame_param): Check for found_for_frame before calling XFRAME.
- (Fmake_terminal_frame): Handle NULL tty names correctly.
- (syms_of_frame): Enhance doc string of `default-frame-alist'.
- (Fdelete_frame): Remove unused variable `count'.
- (Qenvironment): New variable.
- (Fdelete_frame): Don't allow other frames to refer to a deleted
- frame in their 'environment parameter.
- (Fframe_with_environment): New function.
- (syms_of_frame): Defsubr it. Initialize and staticpro Qenvironment.
- (get_future_frame_param): New function.
- (Fmake_terminal_frame): Use it.
- (x_set_frame_parameters, x_set_screen_gamma): Use FRAME_RIF.
-
- * sysdep.c (init_sys_modes, reset_sys_modes): Update for renames.
- * sysdep.c (reset_sys_modes): Update for renames.
-
- * keyboard.c (tty_read_avail_input): New function.
- (Fset_input_interrupt_mode, Fset_output_flow_control): New functions.
- (syms_of_keyboard): Defsubr them.
- (Fset_input_meta_mode, Fset_quit_char): New functions.
- (Fset_input_mode): Split to above functions.
-
- (read_char_minibuf_menu_prompt): Add wrong_kboard_jmpbuf
- parameter. Use it in call to `read_char'.
- (read_char): Declare. Update call to `read_char_minibuf_menu_prompt'.
- Set wrong_kboard_jmpbuf correctly in recursive calls.
- Use current_kboard to access Vkeyboard_translate_table.
- Enhance comment before extra longjmp to wrong_kboard_jmpbuf.
- Add wrong_kboard_jmpbuf parameter to allow for recursive calls.
- Update longjmp invocations. Remember the original current_kboard,
- and longjmp to `wrong_kboard_jmpbuf' when a filter, timer or sentinel
- changes it. Comment out unnecessary calls to
- `record_single_kboard_state' and `any_kboard_state'.
- Update recursive calls.
- (wrong_kboard_jmpbuf): Remove global variable.
- (read_key_sequence): Remove unused variable wrong_kboard_jmpbuf.
- Handle deleted interrupted_kboards correctly; that is a legal
- case. Add `wrong_kboard_jmpbuf' local variable. Update setjmp
- and read_char calls. Abort if interrupted_kboard died in read_char.
- (any_kboard_state, single_kboard_state)
- (push_frame_kboard): Remove function.
- (pop_kboard): Switch out of single_kboard mode if the kboard has
- been deleted. Remove unused variable. Help debugging by not
- changing current_kboard unnecessarily. Set current_kboard to the
- kboard of the selected frame when the stored kboard object has
- been deleted before pop_kboard.
- (temporarily_switch_to_single_kboard): Change first parameter to a
- frame pointer. Throw an error when caller wants to change kboards
- while in single_kboard mode. Don't push_kboard if we weren't in
- single kboard state. Don't pop_kboard if we popped into any
- kboard state.
- (restore_kboard_configuration): Abort if pop_kboard changed the
- kboard in single_kboard mode. Call pop_kboard only after setting
- up single_kboard mode.
- (Frecursive_edit): Switch to single_kboard mode only in nested
- command loops.
- (cmd_error, command_loop, command_loop_1, timer_check):
- Comment out unnecessary call to `any_kboard_state' and
- `record_single_kboard_state'.
- (delete_kboard): Exit single_kboard mode if we have just deleted
- that kboard. Use FRAME_KBOARD.
- (interrupt_signal): Use `Fkill_emacs' to exit Emacs, not
- `fatal_error_signal'.
- (record_single_kboard_state): Don't push_kboard if we weren't in
- single kboard state. Don't pop_kboard if we popped into any
- kboard state.
- (push_frame_kboard): Rename to push_kboard.
- (kbd_buffer_get_event): Use FRAME_TERMINAL.
- (read_avail_input): Read input from all terminals.
- (mark_kboards): Also mark Vkeyboard_translate_table.
- (kbd_buffer_store_event_hold): Simplify condition.
- (read_key_sequence): Reinitialize fkey and keytran at each replay.
- (Vkeyboard_translate_table): Move to struct kboard.
- (init_kboard): Initialize Vkeyboard_translate_table.
- (syms_of_keyboard): Use DEFVAR_KBOARD to define
- Vkeyboard_translate_table. Update doc strings. Update docs of
- local-function-key-map and function-key-map.
-
- * terminal.c: New file.
-
- * term.c: Include errno.h.
- (Vring_bell_function, device_list, initial_device)
- (next_device_id, ring_bell, update_begin, update_end)
- (set_terminal_window, cursor_to, raw_cursor_to)
- (clear_to_end, clear_frame, clear_end_of_line)
- (write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
- (Fdisplay_name, create_device, delete_device): Move to terminal.c.
- (syms_of_term): Move their initialization to terminal.c.
- (get_tty_terminal, Fdisplay_tty_type, Ftty_display_color_p)
- (Ftty_display_color_cells)
- (Ftty_no_underline, Fsuspend_tty, Fresume_tty, create_tty_output)
- (clear_tty_hooks, set_tty_hooks)
- (init_tty, maybe_fatal): New functions.
- (Ftty_type): Return nil if terminal is not on a tty instead of
- throwing an error. Doc update.
- (syms_of_term) <Vsuspend_tty_functions, Vresume_tty_functions>:
- Doc update. Initialize new subrs and variables.
- (delete_tty): Use terminal->deleted.
- (tty_set_terminal_modes): Rename from set_terminal_modes.
- (tty_reset_terminal_modes): Rename from reset_terminal_modes.
- (set_scroll_region): Rename to `tty_set_scroll_region'.
- (turn_on_insert): Rename to `tty_turn_on_insert'.
- (turn_off_insert): Rename to `tty_turn_off_insert'.
- (turn_off_highlight): Rename to `tty_turn_off_highlight'.
- (turn_on_highlight): Rename to `tty_turn_on_highlight'.
- (toggle_highligh): Rename to `tty_toggle_highlight'.
- (background_highlight): Rename to `tty_background_highlight'.
- (highlight_if_desired): Rename to `tty_highlight_if_desired'.
- (tty_ring_bell, tty_update_end, tty_set_terminal_window)
- (tty_set_scroll_region, tty_background_highlight)
- (tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
- (tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
- (tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
- (term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty):
- Add static modifier.
- (tty_reset_terminal_modes, tty_set_terminal_window)
- (tty_set_scroll_region, tty_background_highlight)
- (tty_highlight_if_desired, tty_cursor_to)
- (tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
- (tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
- (tty_delete_glyphs, tty_ins_del_lines, turn_on_face): Update for
- renames.
-
2007-08-28 Jan Dj,Ad(Brv <[email protected]>
* keyboard.c: Qrtl is new.
@@ -1483,7 +205,8 @@
For consistency, run after_insert_file_functions iff something
got inserted. Move signal_after_change and update_compositions
after code running after_insert_file_functions. Make sure that
- undo_list doesn't record intermediate steps of the decoding process.
+ undo_list doesn't record intermediate steps of the decoding
+ process.
2007-08-07 YAMAMOTO Mitsuharu <[email protected]>
@@ -1672,8 +395,8 @@
2007-07-17 Glenn Morris <[email protected]>
* abbrev.c (abbrev_check_chars): New function.
- (Fdefine_global_abbrev, Fdefine_mode_abbrev):
- Call abbrev_check_chars to check abbrev characters are word
+ (Fdefine_global_abbrev, Fdefine_mode_abbrev): Call
+ abbrev_check_chars to check abbrev characters are word
constituents. Doc fix.
2007-07-17 Stefan Monnier <[email protected]>
@@ -1704,10 +427,6 @@
customizable variable. Rather explicitly check whether the
height of the window that shall be splitted is at least as large
as split_height_threshold.
- (Fwindow_full_width_p): New defun.
- (syms_of_window): Defsubr it.
-
- * window.h: Add EXFUN for Fwindow_full_width_p.
2007-07-14 Jason Rumney <[email protected]>
@@ -2422,14 +1141,27921 @@
* gtkutil.c (xg_update_menubar, create_menus): Create empty
submenu for menu bar items.
-See ChangeLog.10 for earlier changes.
+2007-04-24 Chong Yidong <[email protected]>
+
+ * Branch for 22.1.
+
+2007-04-24 Chong Yidong <[email protected]>
+
+ * xdisp.c (redisplay_window): Use BEG_UNCHANGED and END_UNCHANGED
+ values of the actual window.
+
+2007-04-23 Richard Stallman <[email protected]>
+
+ * process.c (Fstart_process): Doc fix.
+
+2007-04-23 Eli Zaretskii <[email protected]>
+
+ * process.c (Fstart_process): Doc fix.
+
+2007-04-22 Richard Stallman <[email protected]>
+
+ * abbrev.c (Fdefine_abbrev): Doc fix.
+
+ * keymap.c (Fdefine_key): Minor doc fix.
+
+2007-04-21 Glenn Morris <[email protected]>
+
+ * keymap.c (Fdefine_key): Fix info ref in doc string.
+
+2007-04-20 Glenn Morris <[email protected]>
+
+ * sysdep.c (init_system_name): Don't accept localhost.localdomain.
+
+2007-04-19 Juanma Barranquero <[email protected]>
+
+ * minibuf.c (Fminibuffer_contents, Fminibuffer_contents_no_properties)
+ (Fminibuffer_completion_contents, Fdelete_minibuffer_contents):
+ Doc fixes.
+
+2007-04-16 Chong Yidong <[email protected]>
+
+ * dispnew.c (adjust_frame_glyphs_for_frame_redisplay):
+ Set garbaged flag in presence of window margins.
+ (showing_window_margins_p): New function.
+
+ * xdisp.c (cursor_row_p): Only end row on newline if it's a
+ display string. Suggested by Lennart Borgman.
+
+2007-04-16 YAMAMOTO Mitsuharu <[email protected]>
+
+ * alloc.c (mem_insert): Set min_heap_address and max_heap_address
+ if they are not yet initialized.
+
+2007-04-15 Chong Yidong <[email protected]>
+
+ * xdisp.c (redisplay_window): When deciding whether or not to
+ recenter, don't use the reset values of BEG_UNCHANGED and
+ END_UNCHANGED.
+
+2007-04-13 Kim F. Storm <[email protected]>
+
+ * buffer.c (Fkill_buffer): gcpro BUF during kill_buffer_processes
+ and check that buffer is still alive upon return.
+
+2007-04-13 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.c [!TARGET_API_MAC_CARBON]: Include Displays.h.
+ (mac_screen_config_changed): New variable.
+ (mac_handle_dm_notification, init_dm_notification_handler)
+ (mac_get_screen_info): New functions.
+ [MAC_OS8] (main): Call init_dm_notification_handler.
+ (mac_initialize) [MAC_OSX]: Likewise.
+ (XTread_socket): Call mac_get_screen_info if screen config changed.
+ (mac_initialized): Make static.
+ (mac_initialize_display_info): Remove function.
+ (mac_term_init): Call mac_get_screen_info. Add partial contents of
+ mac_initialize_display_info.
+
+2007-04-12 YAMAMOTO Mitsuharu <[email protected]>
+
+ * mac.c (xrm_get_preference_database, Fmac_get_preference)
+ [TARGET_API_MAC_CARBON]: Use CFPreferencesAppSynchronize.
+
+ * macterm.c [TARGET_API_MAC_CARBON] (mac_post_mouse_moved_event):
+ Use GetGlobalMouse instead of GetMouse and LocalToGlobal.
+ (mac_initialize_display_info) [MAC_OSX]: Use CGRectZero.
+ (mac_initialize_display_info) [!MAC_OSX]: dpyinfo->height and
+ dpyinfo->width are those of whole screen.
+
+2007-04-10 Chong Yidong <[email protected]>
+
+ * xdisp.c (note_mode_line_or_margin_highlight): Don't decrement
+ glyph pointer before start of glyph row.
+
+2007-04-09 YAMAMOTO Mitsuharu <[email protected]>
+
+ * s/darwin.h (__restrict, struct kboard): Remove outdated workarounds.
+ (C_SWITCH_SYSTEM): Remove `-I../mac/src'.
+
+2007-04-09 Martin Rudalics <[email protected]>
+
+ * indent.c (Fmove_to_column): Set next_boundary with correct start pt.
+
+2007-04-08 Richard Stallman <[email protected]>
+
+ * xdisp.c (syms_of_xdisp) <message-log-max>: Default 100.
+
+2007-04-07 Chong Yidong <[email protected]>
+
+ * editfns.c (Ftranspose_regions): Validate interval before setting
+ text properties.
+
+2007-04-03 Eli Zaretskii <[email protected]>
+
+ * emacs.c (main): Fix instructions for building Emacs for profiling.
+
+2007-04-03 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c (xg_update_menubar): Call g_list_next after moving
+ menu bar item.
+
+2007-04-02 Juanma Barranquero <[email protected]>
+
+ * print.c (Fprin1_to_string): Use macro SPECPDL_INDEX.
+
+2007-04-01 Chong Yidong <[email protected]>
+
+ * keymap.c (Fcommand_remapping): New optional argument.
+ (where_is_internal): Use new keymaps argument.
+ (Fkey_binding): Caller changed.
+
+ * keyboard.c (command_loop_1): Caller changed.
+
+2007-03-31 Eli Zaretskii <[email protected]>
+
+ * window.c (Fget_lru_window): Doc fix.
+
+2007-03-30 Chong Yidong <[email protected]>
+
+ * undo.c (Fprimitive_undo): Give clearer error message when trying
+ to change text properties outside accessible part of buffer.
+
+2007-03-29 Kim F. Storm <[email protected]>
+
+ * process.c (wait_reading_process_output) [HAVE_PTYS]:
+ When EIO happens, clear channel from descriptor masks before raising
+ SIGCHLD signal to avoid busy loop between read and sigchld_handler.
+ (sigchld_handler): Remove sleep (2007-03-11 & 2007-03-26 changes).
+
+2007-03-29 Juanma Barranquero <[email protected]>
+
+ * buffer.c (Fset_buffer_major_mode): Check that BUFFER is valid.
+
+ * process.c (Fformat_network_address): Return nil when the
+ argument vector contains invalid values.
+
+2007-03-28 YAMAMOTO Mitsuharu <[email protected]>
+
+ * gmalloc.c [HAVE_GTK_AND_PTHREAD]: Define USE_PTHREAD.
+ [USE_PTHREAD]: Include pthread.h.
+ (malloc_init_once_control, _malloc_mutex) [USE_PTHREAD]: New variables.
+ (malloc_initialize_1): New function created from __malloc_initialize.
+ (__malloc_initialize): Use it.
+ (LOCK, UNLOCK): New macros to make malloc etc. thread safe.
+ (_malloc_internal, _free_internal, _realloc_internal): Use them.
+
+ * lread.c (readchar): Extend BLOCK_INPUT block to ferror/clearerr.
+
+2007-03-27 Juanma Barranquero <[email protected]>
+
+ * process.c (Fformat_network_address): Make args array big enough
+ to format IPv6 addresses.
+
+2007-03-27 Glenn Morris <[email protected]>
+
+ * m/hp800.h: Restore HP-UX support (removed 2007-01-29).
+
+2007-03-26 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macfns.c (Fx_display_mm_height, Fx_display_mm_width): Scale whole
+ screen size in pixels by millimeters per pixel of main display.
+
+ * macselect.c (get_scrap_target_type_list, x_own_selection):
+ Move assignments outside predicate macros.
+ (Vselection_converter_alist): Doc fix.
+
+ * macterm.c (create_text_encoding_info_alist): Move assignments
+ outside predicate macros.
+ (mac_initialize_display_info) [MAC_OSX]: dpyinfo->height and
+ dpyinfo->width are those of whole screen.
+
+2007-03-26 Sam Steingold <[email protected]>
+
+ * process.c (sigchld_handler): Delay by 1ms instead of 1s to
+ alleviate sluggishness (the original problem is still fixed).
+
+2007-03-25 Kim F. Storm <[email protected]>
+
+ * intervals.c (merge_properties): Use explicit loop instead of
+ Fplist_member to avoid QUIT. Don't use Fcdr.
+ (intervals_equal): Likewise. Rewrite loop to perform length check
+ on the fly rather than calling Flength. Don't use Fcar.
+
+2007-03-24 Eli Zaretskii <[email protected]>
+
+ * editfns.c (Fgoto_char): Doc fix.
+
+ * indent.c (Findent_to): Doc fix.
+
+2007-03-24 Chong Yidong <[email protected]>
+
+ * editfns.c (Ftranspose_regions): Use set_text_properties_1
+ instead of Fset_text_properties to avoid GC. Signal after change.
+
+2007-03-24 Eli Zaretskii <[email protected]>
+
+ * xfns.c (Fx_show_tip): Doc fix.
+
+ * macfns.c (Fx_show_tip): Doc fix.
+
+ * w32fns.c (Fx_show_tip): Doc fix.
+
+2007-03-23 Kim F. Storm <[email protected]>
+
+ * intervals.c (merge_properties, intervals_equal):
+ Use Fplist_member instead of Fmemq to find properties.
+
+2007-03-23 Glenn Morris <[email protected]>
+
+ * unexhp9k800.c: Restore file with clarified legal status.
+ * m/sr2k.h: Restore since dependency unexhp9k800.c is restored.
+
+2007-03-22 Chong Yidong <[email protected]>
+
+ * widget.c (EmacsFrameSetCharSize): Catch X errors.
+
+2007-03-22 Kenichi Handa <[email protected]>
+
+ * fileio.c (Fcopy_file): Call barf_or_query_if_file_exists with
+ non-encoded file name.
+ (Frename_file): Likewise.
+ (Fadd_name_to_file): Likewise.
+ (Fmake_symbolic_link): Likewise.
+
+2007-03-20 YAMAMOTO Mitsuharu <[email protected]>
+
+ * Makefile.in (alloca.o, gtkutil.o): Depend on systime.h.
+ (dired.o, editfns.o, fileio.o, msdos.o): Depend on atimer.h.
+ (dosfns.o, window.o, fns.o, macselect.o): Depend on atimer.h and
+ systime.h.
+ (term.o, print.o, lread.o): Depend on blockinput.h, atimer.h, and
+ systime.h.
+ (macfns.o): Remove duplicate dependency on systime.h.
+
+ * dispnew.c (Fopen_termscript): Add BLOCK_INPUT around fclose.
+ (Fsend_string_to_terminal): Add BLOCK_INPUT around fwrite.
+
+ * fileio.c (do_auto_save_unwind): Add BLOCK_INPUT around fclose.
+ (Fdo_auto_save): Add BLOCK_INPUT around fwrite.
+
+ * keyboard.c (record_char): Add BLOCK_INPUT around fwrite.
+ (Fopen_dribble_file): Add BLOCK_INPUT around fclose.
+
+ * lread.c: Include blockinput.h.
+ (readchar, Fget_file_char): Add BLOCK_INPUT around getc.
+ (unreadchar): Add BLOCK_INPUT around ungetc.
+ (load_unwind): Add BLOCK_INPUT around fclose.
+
+ * print.c: Include blockinput.h.
+ (Fredirect_debugging_output): Add BLOCK_INPUT around fclose.
+
+ * process.c (Fmake_network_process) [HAVE_GETADDRINFO]:
+ Clear immediate_quit before calling freeaddrinfo.
+ Add BLOCK_INPUT around freeaddrinfo.
+
+ * term.c: Include blockinput.h.
+ (write_glyphs, insert_glyphs): Add BLOCK_INPUT around fwrite.
+
+2007-03-19 Richard Stallman <[email protected]>
+
+ * keyboard.c (NUM_RECENT_KEYS): Bump up to 300.
+
+ * buffer.c (syms_of_buffer): Doc fix.
+
+2007-03-18 Chong Yidong <[email protected]>
+
+ * image.c (pbm_load): Signal error for invalid image size.
+
+2007-03-18 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.c (note_mouse_movement): Don't return immediately for
+ LeaveNotify case.
+
+ * macmenu.c (popup_activated_flag): New variable.
+ (x_activate_menubar, mac_menu_show): Set it during menu tracking.
+ (popup_activated): New function.
+
+ * xdisp.c (redisplay_internal, note_mouse_highlight):
+ Check popup_activated for MAC_OS.
+
+2007-03-17 Juanma Barranquero <[email protected]>
+
+ * buffer.c (syms_of_buffer) <buffer-display-table>: Doc fix.
+ Reported by Nikolaj Schumacher <[email protected]>.
+
+2007-03-17 Richard Stallman <[email protected]>
+
+ * dired.c (file_name_completion): gcpro NAME.
+
+2007-03-17 Chong Yidong <[email protected]>
+
+ * xdisp.c (try_window_id): Increment matrix positions if the
+ buffer's byte count has increased, but not the character count.
+
+2007-03-12 Andreas Schwab <[email protected]>
+
+ * lisp.h: Declare check_obarray.
+
+ * process.c (Fdelete_process): Properly handle deletion of first
+ element of deleted_pid_list.
+ (create_process): Declare pid as pid_t.
+
+2007-03-12 Kim F. Storm <[email protected]>
+
+ * process.c (sigchld_handler): Change type of pid to pid_t.
+ Scan deleted_pid_list explicitly to avoid using Fmember which don't
+ know about mark bits and make_fixnum_or_float which may malloc.
+ Reported by Andreas Schwab.
+
+ * keyboard.c (read_key_sequence): Store original event into keybuf
+ when replaying sequence with local keymap(s) from string.
+
+2007-03-12 Glenn Morris <[email protected]>
+
+ * editfns.c (Fdecode_time, Fencode_time): Doc fix ("daylight
+ savings" to "daylight saving").
+
+2007-03-11 Sam Steingold <[email protected]>
+
+ * process.c (sigchld_handler): Sleep before wait3 to avoid a busyloop.
+
+2007-03-11 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macfns.c (Fx_server_vendor): Change vendor string to "Apple Inc.".
+
+2007-03-10 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.c [USE_CARBON_EVENTS] (mac_handle_mouse_event):
+ Ignore mouse wheel movement on title bar or tool bar.
+
+2007-03-10 Chong Yidong <[email protected]>
+
+ * keyboard.c (help_form_saved_window_configs): New var.
+ (read_char_help_form_unwind): New function.
+ (read_char): Don't restore window configuration if a mouse click
+ arrives while the help form is being displayed.
+
+2007-03-10 Kim F. Storm <[email protected]>
+
+ * xdisp.c (redisplay_window): Don't automatically select a new window
+ start for a contination line during mouse-click.
+
+2007-03-09 Jan Dj,Ad(Brv <[email protected]>
+
+ * xterm.c (handle_one_xevent): Ignore buttons > 3 for the tool bar.
+
+2007-03-09 Juanma Barranquero <[email protected]>
+
+ * keymap.c (Fdescribe_buffer_bindings): Check that BUFFER is valid.
+
+2007-03-08 Richard Stallman <[email protected]>
+
+ * keyboard.c (syms_of_keyboard): Doc fix.
+
+2007-03-08 Chong Yidong <[email protected]>
+
+ * minibuf.c (Ftry_completion): Don't short circuit if
+ completion-ignore-case is non-nil.
+
+2007-03-07 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macfns.c (mac_set_scroll_bar_width, mac_frame_parm_handlers):
+ Undo 2006-03-06 changes.
+
+ * macterm.c (XTset_vertical_scroll_bar) [MAC_OSX]: Don't show scroll
+ bar if its width is smaller than that of Aqua small scroll bar.
+
+2007-03-07 Stefan Monnier <[email protected]>
+
+ * minibuf.c (read_minibuf): Bind inhibit-read-only a bit longer so as
+ to handle correctly prompts with read-only property.
+
+2007-03-06 Jan Dj,Ad(Brv <[email protected]>
+
+ * sound.c (wav_play): Check header->data_length to see how much we
+ shall read.
+ (alsa_period_size): Convert ALSA period size in frames to bytes.
+ (alsa_write): Return if frames is zero.
+
+2007-03-06 Kenichi Handa <[email protected]>
+
+ * xselect.c (Vselection_coding_system): Documentation improved.
+
+2007-03-05 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.c (x_scroll_bar_create, XTread_socket): Replace #if
+ USE_TOOLKIT_SCROLL_BARS with #ifdef USE_TOOLKIT_SCROLL_BARS.
+ (x_set_window_size): Call SET_FRAME_GARBAGED. Clear window if
+ internal border width has changed.
+
+ * macterm.h (struct mac_output): New member `internal_border_width'.
+
+2007-03-04 Richard Stallman <[email protected]>
+
+ * window.c (Fdisplay_buffer): Doc fix.
+
+2007-03-03 Glenn Morris <[email protected]>
+
+ * Makefile.in: Don't clear out LIB_X11_LIB, since XFT_LIBS does
+ not include -lX11 on Solaris.
+
+2007-03-02 Stuart D. Herring <[email protected]>
+
+ * keymap.c (Fkey_binding): Don't consider one-element lists as events.
+
+2007-03-01 Kenichi Handa <[email protected]>
+
+ * process.c (send_process_object): Check the process status and
+ signal an error if something is wrong.
+
+2007-02-28 Chong Yidong <[email protected]>
+
+ * insdel.c (Fcombine_after_change_execute): Return nil if
+ combine_after_change_buffer has been invalidated.
+
+2007-02-25 Dan Nicolaescu <[email protected]>
+
+ * m/xtensa.h: New file.
+
+2007-02-24 Nick Roberts <[email protected]>
+
+ * .gdbinit (xprintstr): Ensure GDB (> 6.6) prints symbol name
+ as strings and not character arrays.
+
+2007-02-24 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.c [USE_TOOLKIT_SCROLL_BARS] (x_scroll_bar_handle_drag)
+ (x_set_toolkit_scroll_bar_thumb): Add bar->min_handle as margin to
+ scroll bar handle size in order to avoid `scroll backward' problem.
+ (x_scroll_bar_create, XTset_vertical_scroll_bar)
+ [USE_TOOLKIT_SCROLL_BARS]: Initialize bar->min_handle.
+
+ * macterm.h (struct scroll_bar) [USE_TOOLKIT_SCROLL_BARS]:
+ New member `min_handle'.
+
+2007-02-23 Kim F. Storm <[email protected]>
+
+ * print.c (print): Reset print_number_index if Vprint_number_table
+ is nil.
+
+2007-02-23 Eli Zaretskii <[email protected]>
+
+ * w32.c (stat, get_long_basename, is_unc_volume): Use _mbspbrk
+ instead of strpbrk.
+
+2007-02-23 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macmenu.c (mac_menu_show): Call unbind_to early. Use variable
+ `menu_item_selection' as in W32 version.
+ [TARGET_API_MAC_CARBON] (mac_handle_dialog_event): Add explicit
+ braces to avoid ambiguous `else'.
+
+ * macterm.c (mac_display_info_for_display): Remove function.
+ (mac_flush_display_optional) [USE_CG_DRAWING]: New function.
+ (x_redisplay_interface) [USE_CG_DRAWING]: Set it as handler for
+ flush_display_optional.
+ [USE_TOOLKIT_SCROLL_BARS] (x_scroll_bar_handle_press):
+ New argument MOUSE_POS. All uses changed. Set bar->dragging to
+ negative integer if scroll bar handle is pressed.
+ [USE_TOOLKIT_SCROLL_BARS] (x_scroll_bar_handle_release):
+ Negative bar->dragging means scroll bar handle is not dragged.
+ [USE_TOOLKIT_SCROLL_BARS] (x_scroll_bar_handle_drag): Get initial
+ offset of scroll bar handle from negative bar->dragging.
+ (XTread_socket) [USE_TOOLKIT_SCROLL_BARS]: Modifiers for scroll
+ bar click is compared against mapped one. Set down/up_modifier
+ for scroll bar click event with control key.
+
+ * macterm.h (x_display_info_for_display): Remove extern.
+ (SCROLL_BAR_UNPACK, SET_SCROLL_BAR_CONTROL_HANDLE): Don't limit
+ value to be unpacked to 32-bit on LP64 model.
+
+2007-02-23 Kenichi Handa <[email protected]>
+
+ * process.c (send_process_object_unwind): New function.
+ (send_process_object): New function.
+ (Fprocess_send_region): Call send_process_object.
+ (Fprocess_send_string): Likewise.
+
+2007-02-22 Jason Rumney <[email protected]>
+
+ * w32menu.c (w32_menu_show): Mark the frame's menu as inactive
+ when popup menu finishes.
+
+ * w32fns.c (menubar_in_use): New flag.
+ (w32_wnd_proc) <WM_INITMENU, WM_EXITMENULOOP, WM_TIMER, WM_COMMAND>:
+ Use it.
+
+ * w32menu.c (Fx_popup_menu): Don't free menu strings here.
+ (w32_menu_show): Do it here instead.
+
+ * w32fns.c (w32_wnd_proc) <WM_INITMENU>: Set menubar_active frame
+ parameter.
+
+ * w32menu.c (current_popup_menu): Make available globally.
+ (menubar_selection_callback): Free menu strings before pushing the
+ menu event into the keyboard buffer. Remove menu_command_in_progress.
+
+ * w32fns.c (current_popup_menu): Use from w32menu.c.
+ (w32_wnd_proc) <WM_EXITMENULOOP, WM_TIMER>: Use menubar_active
+ and current_popup_menu to determine whether a menubar menu has
+ been cancelled.
+
+ * w32term.h (w32_output): Remove menu_command_in_progress.
+
+2007-02-22 Kim F. Storm <[email protected]>
+
+ * dispnew.c (update_frame, update_single_window): Set force_p here if
+ redisplay_dont_pause is set or Vredisplay_preemption_period is nil...
+ (update_window, update_frame_1): ... instead of here.
+ (update_text_area): Clear mouse face on header lines.
+
+2007-02-21 Kim F. Storm <[email protected]>
+
+ * minibuf.c (Fassoc_string): Doc fix. Allow symbol for KEY too.
+
+2007-02-21 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.c (WINDOW_RESOURCE, TERM_WINDOW_RESOURCE): Remove macros.
+ [USE_MAC_TSM] (mac_handle_text_input_event): Remove unused variable
+ `mapped_modifiers'.
+ (XTread_socket) [MAC_OS_X_VERSION_MAX_ALLOWED >= 1020]: Use Keyboard
+ Layout Services routines to get current Unicode keyboard layout.
+
+2007-02-20 Chong Yidong <[email protected]>
+
+ * frame.c (x_set_screen_gamma): Apply gamma value to the frame's
+ bgcolor.
+
+2007-02-19 Kim F. Storm <[email protected]>
+
+ * minibuf.c (Fassoc_string): Allow symbols as keys.
+
+ * w32term.c (w32_set_scroll_bar_thumb): Don't resize scroll-bar
+ handle while dragging, except when we get close to eob.
+ Fix position and size calculations so we don't scroll backwards
+ just by clicking on the handle.
+
+2007-02-17 YAMAMOTO Mitsuharu <[email protected]>
+
+ * Makefile.in (${emacsapp}Contents/Resources/Emacs.rsrc)
+ [HAVE_CARBON]: Remove target.
+ (macosx-app) [HAVE_CARBON]: Don't depend on it.
+
+2007-02-17 Juanma Barranquero <[email protected]>
+
+ * callproc.c (syms_of_callproc) <doc-directory>:
+ <configure-info-directory>:
+ (Fgetenv_internal): Fix typos in docstrings.
+
+ * doc.c (Fsubstitute_command_keys): Fix typo in docstring.
+
+2007-02-16 Andreas Schwab <[email protected]>
+
+ * frame.c (Fmodify_frame_parameters): Return a value.
+
+ * editfns.c (Fformat): Add support for '+' flag.
+ * doprnt.c (doprnt1): Likewise. Fix overflow checking.
+
+2007-02-14 Chong Yidong <[email protected]>
+
+ * s/umips.h: Unused file removed.
+
+2007-02-14 Juanma Barranquero <[email protected]>
+
+ * xfaces.c (Fcolor_distance): Don't continue checking a color for
+ errors after it has been correctly parsed as an RGB list.
+
+2007-02-14 Jan Dj,Ad(Brv <[email protected]>
+
+ * xterm.c (do_ewmh_fullscreen): Also check for _NET_WM_STATE_FULLSCREEN.
+
+2007-02-13 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macfns.c (Fx_focus_frame): Move current process to foreground if
+ it is not.
+ [TARGET_API_MAC_CARBON] (Fx_file_dialog): Replace #if MAC_OSX with
+ #ifdef MAC_OSX.
+ (Fmac_set_font_panel_visible_p) [USE_MAC_FONT_PANEL]: Rename from
+ Fmac_set_font_panel_visibility. All uses changed. Rename argument
+ VISIBLE to FLAG.
+
+ * macterm.c (MakeMeTheFrontProcess) [MAC_OSX]: Remove function.
+ (mac_initialize) [MAC_OSX]: Call SetFrontProcess instead of
+ MakeMeTheFrontProcess.
+
+2007-02-12 Chong Yidong <[email protected]>
+
+ * frame.c (x_set_screen_gamma): Clear face cache.
+
+2007-02-11 Juanma Barranquero <[email protected]>
+
+ * buffer.c (Fgenerate_new_buffer_name, Fbuffer_modified_tick):
+ Reflow docstrings.
+
+2007-02-10 Eli Zaretskii <[email protected]>
+
+ * window.c (Fwindow_height, Fwindow_hscroll)
+ (Fwindow_redisplay_end_trigger, Fwindow_point, Fwindow_start)
+ (Fwindow_end, Fwindow_display_table, Fwindow_text_height):
+ Document the effect of WINDOW arg being nil.
+
+2007-02-08 Kim F. Storm <[email protected]>
+
+ * minibuf.c (read_minibuf): Fix 2007-01-30 change.
+ Use Qlambda as interim value of Vminibuffer_completing_file_name.
+ (Fcompleting_read): Use non-filename maps if value is Qlambda (or Qnil).
+ (syms_of_minibuf) <minibuffer-completing-file-name>: Document lambda.
+
+2007-02-07 Juanma Barranquero <[email protected]>
+
+ * makefile.w32-in ($(TRES)): Use literal "../nt/emacs.rc" instead
+ of $(ALL_DEPS).
+
+2007-02-07 Eli Zaretskii <[email protected]>
+
+ * makefile.w32-in ($(TRES)): Depend on stamp_BLD, since $(TRES) is
+ put into $(BLD).
+
+2007-02-06 Chong Yidong <[email protected]>
+
+ * frame.c (Fmodify_frame_parameters): Don't bind
+ Qinhibit_default_face_x_resources, which has no effect.
+ (Qinhibit_default_face_x_resources): Symbol deleted.
+
+2007-02-03 Eli Zaretskii <[email protected]>
+
+ * indent.c (Fmove_to_column): Document that the argument COLUMN is
+ taken from prefix numeric argument.
+
+2007-02-03 Juanma Barranquero <[email protected]>
+
+ * lread.c (syms_of_lread) <load-history>: Doc fix.
+
+2007-01-29 Andreas Seltenreich <[email protected]> (tiny change)
+
+ * xterm.c [!USE_TOOLKIT_SCROLL_BARS] (x_scroll_bar_expose):
+ Use the foreground color of the scroll-bar face when drawing
+ the scroll-bar's border.
+
+2007-02-02 Jan Dj,Ad(Brv <[email protected]>
+
+ * xterm.c (do_ewmh_fullscreen): Check that what != NULL before
+ calling wm_supports.
+
+2007-02-01 Juanma Barranquero <[email protected]>
+
+ * lread.c (syms_of_lread) <user-init-file>: Doc fix.
+ Wording by Eli Zaretskii.
+
+2007-01-31 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c (update_frame_tool_bar): Initialize h/vmargin to 0.
+
+2007-01-30 Richard Stallman <[email protected]>
+
+ * minibuf.c (read_minibuf):
+ Save and clear Vminibuffer_completing_file_name.
+ (read_minibuf_unwind): Restore it.
+ (Vminibuffer_completion_table, Qminibuffer_completion_table)
+ (Vminibuffer_completion_predicate, Qminibuffer_completion_predicate)
+ (Vminibuffer_completion_confirm, Qminibuffer_completion_confirm)
+ (Vminibuffer_completing_file_name): Definitions moved up.
+
+2007-01-29 Chong Yidong <[email protected]>
+
+ * m/hp800.h: Restore, removing HP-UX support.
+
+2007-01-29 Jan Dj,Ad(Brv <[email protected]>
+
+ * Makefile.in: Use a variable, XFT_LIBS, instead #define LIB_X11_LIB.
+
+2007-01-28 Richard Stallman <[email protected]>
+
+ * minibuf.c (Ftry_completion, Fall_completions)
+ (Fcompleting_read, Ftest_completion):
+ Rename arg ALIST or TABLE to COLLECTION.
+
+2007-01-27 Chong Yidong <[email protected]>
+
+ * unexhp9k800.c: Remove due to lack of legal papers.
+
+ * m/sr2k.h, m/hp800.h: Remove due to dependence on above.
+
+2007-01-27 Eli Zaretskii <[email protected]>
+
+ * keyboard.c (Fthis_command_keys, Fthis_command_keys_vector): Doc fix.
+
+ * minibuf.c (Fcompleting_read): Doc fix.
+
+2007-01-26 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c (xg_initialize): Call XftInit if HAVE_XFT.
+
+ * Makefile.in: Use XFT_LIBS if defined.
+
+2007-01-26 YAMAMOTO Mitsuharu <[email protected]>
+
+ * alloc.c (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Use
+ BLOCK_INPUT/UNBLOCK_INPUT.
+
+ * blockinput.h (interrupt_input_blocked): Declare volatile.
+
+ * keyboard.c (interrupt_input_blocked): Declare volatile.
+
+ * syssignal.h (SIGNAL_THREAD_CHECK): Use pthread_equal.
+
+2007-01-24 Kim F. Storm <[email protected]>
+
+ * keymap.c (describe_map): Don't consider prefix keys to be shadowed.
+
+2007-01-23 Juanma Barranquero <[email protected]>
+
+ * editfns.c (Finsert_char): Doc fix.
+ (Fget_internal_run_time, Fdecode_time): Fix typos in docstrings.
+
+2007-01-22 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macselect.c [TARGET_API_MAC_CARBON] (mac_do_receive_drag):
+ Don't pass keyboard modifiers to mac_store_drag_event, but put
+ them as kEventParamKeyModifiers Apple event parameter.
+
+2007-01-21 Chong Yidong <[email protected]>
+
+ * xdisp.c (try_window): Revert previous change.
+
+ * dispnew.c (update_text_area): Revert 2006-09-17 change.
+ Always redraw non-mode-line rows with mouse-face.
+
+2007-01-20 Chong Yidong <[email protected]>
+
+ * xdisp.c (try_window): Clear mouse-face highlights first.
+
+ * window.c (set_window_buffer): Revert 2006-11-22 change.
+
+2007-01-20 Eli Zaretskii <[email protected]>
+
+ * .gdbinit (ppt, xtype, xmisctype, xint, xptr, xmarker, xframe)
+ (xbuffer, xcons, xcar, xcdr): Fix doc strings.
+
+2007-01-20 Chong Yidong <[email protected]>
+
+ * keyboard.c (read_key_sequence): Extract local map only if the
+ given position is in an accessible buffer region.
+
+2007-01-19 Nick Roberts <[email protected]>
+
+ * .gdbinit: Reformat documentation so that first sentence
+ displays properly with "help user-defined" (like apropos).
+
+2007-01-18 Bruno Haible <[email protected]> (tiny change)
+
+ * epaths.in: Move PATH_DOC from local/info to local/share/info.
+
+2007-01-15 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macmenu.c (create_and_show_dialog) [TARGET_API_MAC_CARBON]:
+ Create movable modal window instead of movable alert window.
+ (create_and_show_dialog) [!MAC_OSX]: Use DeactivateControl instead
+ of DisableControl.
+
+ * macselect.c (Fmac_resume_apple_event): Set error number when
+ descriptor type of reply is non-null.
+
+2007-01-14 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macmenu.c (create_and_show_dialog) [TARGET_API_MAC_CARBON]:
+ Use DisableControl for disabled items. Set default button to first
+ enabled one. Use icon of application in execution.
+
+2007-01-13 Eli Zaretskii <[email protected]>
+
+ * process.c (Fdelete_process, Fprocess_id, sigchld_handler):
+ Copy PID into EMACS_INT to avoid GCC warnings.
+
+ * fns.c (maybe_resize_hash_table): Copy new size of hash table
+ into EMACS_INT to avoid GCC warnings.
+
+ * editfns.c (Fuser_uid, Fuser_real_uid): Copy values returned by
+ geteuid and getuid into EMACS_INT to avoid GCC warnings.
+
+ * dired.c (Ffile_attributes): Fix last change.
+
+2007-01-12 Eli Zaretskii <[email protected]>
+
+ * dired.c (Ffile_attributes): Copy some members of `struct stat'
+ into int's to avoid GCC warnings about limited range of short in
+ arguments to FIXNUM_OVERFLOW_P.
+
+2007-01-12 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macmenu.c (HAVE_DIALOGS): Define if TARGET_API_MAC_CARBON.
+ (mac_handle_dialog_event, install_dialog_event_handler)
+ (create_and_show_dialog) [TARGET_API_MAC_CARBON]: New functions.
+ (DIALOG_LEFT_MARGIN, DIALOG_TOP_MARGIN, DIALOG_RIGHT_MARGIN)
+ (DIALOG_BOTTOM_MARGIN, DIALOG_MIN_INNER_WIDTH)
+ (DIALOG_MAX_INNER_WIDTH, DIALOG_BUTTON_BUTTON_HORIZONTAL_SPACE)
+ (DIALOG_BUTTON_BUTTON_VERTICAL_SPACE, DIALOG_BUTTON_MIN_WIDTH)
+ (DIALOG_TEXT_MIN_HEIGHT, DIALOG_TEXT_BUTTONS_VERTICAL_SPACE)
+ (DIALOG_ICON_WIDTH, DIALOG_ICON_HEIGHT, DIALOG_ICON_LEFT_MARGIN)
+ (DIALOG_ICON_TOP_MARGIN) [TARGET_API_MAC_CARBON]: New macros.
+ (mac_dialog) [TARGET_API_MAC_CARBON]: Remove function.
+ (mac_dialog_show) [TARGET_API_MAC_CARBON]: Use create_and_show_dialog.
+
+ * macterm.c (x_free_frame_resources) [USE_CG_DRAWING]:
+ Call mac_prepare_for_quickdraw.
+ (quit_char, make_ctrl_char) [TARGET_API_MAC_CARBON]: Move externs
+ outside #ifdef MAC_OSX.
+ (mac_quit_char_key_p) [TARGET_API_MAC_CARBON]: Move function
+ outside #ifdef MAC_OSX.
+ (mac_check_bundle) [MAC_OSX]: Remove unused function.
+
+ * macterm.h (mac_quit_char_key_p): Move extern outside #ifdef MAC_OSX.
+ (HOURGLASS_WIDTH, HOURGLASS_HEIGHT): Parenthesize definitions.
+
+2007-01-11 Jan Dj,Ad(Brv <[email protected]>
+
+ * alloc.c (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Use pthread_equal,
+ block/unblock SIGIO.
+
+2007-01-10 Stefan Monnier <[email protected]>
+
+ * editfns.c (Fformat): Allow integer-format to work with floats of size
+ larger than most-positive-fixnum (but still smaller than MAXINT).
+
+ * dired.c (Ffile_attributes): Use floats for large uids/gids.
+
+2007-01-09 Eli Zaretskii <[email protected]>
+
+ * emacs.c (syms_of_emacs) <path-separator>: Doc fix.
+
+2007-01-09 YAMAMOTO Mitsuharu <[email protected]>
+
+ * callproc.c (Fcall_process_region) [HAVE_MKSTEMP]: Add BLOCK_INPUT
+ around mkstemp.
+
+ * image.c (XDrawLine) [MAC_OS]: Remove macro.
+ (XCreateGC_pixmap) [!HAVE_NTGUI]: Likewise.
+ (x_disable_image) [!HAVE_NTGUI]: Use XCreateGC instead of
+ XCreateGC_pixmap.
+
+ * macgui.h (Display): Typedef to opaque type.
+
+ * macmenu.c (mac_dialog_modal_filter) [MAC_OSX]: New function.
+ (Fx_popup_dialog) [MAC_OSX]: Use standard alert if called from
+ Fmessage_box, Fyes_or_no_p, or Fy_or_n_p.
+ [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030] (menu_quit_handler):
+ Use mac_quit_char_key_p.
+
+ * macterm.c (XDrawLine): Rename from mac_draw_line_to_pixmap.
+ (XCreateGC): Change type of 2nd argument to void *.
+ (XFreeGC) [USE_CG_DRAWING && MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]:
+ Fix last change.
+ (mac_to_emacs_modifiers): Change return type to int.
+ [USE_CARBON_EVENTS] (mac_event_to_emacs_modifiers): Likewise.
+ (mac_mapped_modifiers): New function.
+ (XTread_socket): Use it.
+ [USE_TSM] (mac_handle_text_input_event): Likewise.
+ (do_window_update) [USE_CG_DRAWING]: Call mac_prepare_for_quickdraw.
+ (mac_quit_char_modifiers, mac_quit_char_keycode) [MAC_OSX]:
+ Remove variables.
+ (mac_determine_quit_char_modifiers, init_quit_char_handler)
+ [MAC_OSX]: Remove functions.
+ (make_ctrl_char) [MAC_OSX]: Add extern.
+ (mac_quit_char_key_p) [MAC_OSX]: New function.
+ (mac_initialize) [MAC_OSX]: Don't call init_quit_char_handler.
+
+ * macterm.h (FONT_MAX_WIDTH): Remove unused macro.
+ (XCreateGC): Change type in extern.
+ (XDrawLine): Rename from mac_draw_line_to_pixmap.
+ (mac_quit_char_key_p) [MAC_OSX]: Add extern.
+
+2007-01-08 Jan Dj,Ad(Brv <[email protected]>
+
+ * keyboard.c (init_keyboard): Initialize interrupt_input_blocked and
+ interrupt_input_pending.
+
+ * xterm.h (x_display_info): New: net_supported_atoms,
+ nr_net_supported_atoms and net_supported_window.
+
+ * xterm.c (last_user_time): New variable.
+ (handle_one_xevent): Set last_user_time from events that have Time.
+ Set net_supported_window to 0 when reparented.
+ (wm_supports): New function.
+ (do_ewmh_fullscreen): Use wm_supports to check for _NET_WM_STATE.
+ (x_term_init): Initialize net_supported_atoms, nr_net_supported_atoms
+ and net_supported_window.
+
+2007-01-05 Kim F. Storm <[email protected]>
+
+ * indent.c (Fvertical_motion): Fix it overshoot check for overlay
+ strings without embedded newlines immediately followed by newline.
+
+2007-01-05 YAMAMOTO Mitsuharu <[email protected]>
+
+ * editfns.c (Fformat_time_string, Fdecode_time, Fencode_time)
+ (Fcurrent_time_string, Fcurrent_time_zone): Add BLOCK_INPUT around
+ gmtime/localtime/emacs_memftimeu/mktime.
+
+ * mac.c (Fmac_set_file_creator): Use MAC_EMACS_CREATOR_CODE
+ instead of 'EMAx'.
+ [!MAC_OSX] (sys_open, sys_creat, sys_fopen): Likewise.
+
+ * macgui.h (struct _XGC) [USE_CG_DRAWING
+ && MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]: New members cg_fore_color
+ and cg_back_color.
+
+ * macmenu.c (Vshow_help_function) [TARGET_API_MAC_CARBON]: Add extern.
+ (restore_show_help_function, menu_target_item_handler)
+ [TARGET_API_MAC_CARBON]: New functions.
+ (install_menu_target_item_handler): New function.
+ (add_menu_item) [TARGET_API_MAC_CARBON]: Set help string as menu
+ item property.
+
+ * macterm.c (CG_SET_FILL_COLOR_MAYBE_WITH_CGCOLOR)
+ (CG_SET_FILL_COLOR_WITH_GC_FOREGROUND)
+ (CG_SET_FILL_COLOR_WITH_GC_BACKGROUND)
+ (CG_SET_STROKE_COLOR_MAYBE_WITH_CGCOLOR)
+ (CG_SET_STROKE_COLOR_WITH_GC_FOREGROUND): New macros.
+ (mac_cg_color_space_rgb) [USE_CG_DRAWING]: New variable.
+ (mac_cg_color_black) [USE_CG_DRAWING
+ && MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]: New variable.
+ (init_cg_color) [USE_CG_DRAWING]: New function.
+ (mac_draw_line, mac_draw_rectangle) [USE_CG_DRAWING]: Use
+ CG_SET_STROKE_COLOR_WITH_GC_FOREGROUND instead of CG_SET_STROKE_COLOR.
+ (mac_erase_rectangle, mac_clear_window, mac_draw_cg_image)
+ (mac_fill_rectangle, mac_draw_image_string_cg) [USE_CG_DRAWING]:
+ Use CG_SET_FILL_COLOR_WITH_GC_FOREGROUND or
+ CG_SET_FILL_COLOR_WITH_GC_BACKGROUND instead of CG_SET_FILL_COLOR.
+ (mac_draw_string_common) [MAC_OSX && USE_ATSUI]: Likewise.
+ (XCreateGC, XFreeGC, XSetForeground, XSetBackground) [USE_CG_DRAWING
+ && MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]: Use gc->cg_fore_color and/or
+ gc->cg_back_color.
+ (install_drag_handler, remove_drag_handler): Make extern.
+ (install_menu_target_item_handler): Add extern.
+ (install_window_handler): Call install_menu_target_item_handler.
+ [MAC_OS8] (main): Use MAC_EMACS_CREATOR_CODE instead of 'EMAx'.
+ (mac_initialize) [USE_CG_DRAWING]: Call init_cg_color.
+
+ * macterm.h (MAC_EMACS_CREATOR_CODE): New enumerator.
+
+2007-01-04 Juanma Barranquero <[email protected]>
+
+ * window.c (Fwindow_end): Fix use of >= operator.
+
+2007-01-03 Richard Stallman <[email protected]>
+
+ * window.c (Fwindow_end): Check BUF_OVERLAY_MODIFF like BUF_MODIFF.
+
+2007-01-02 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.h (xg_menu_item_cb_data_): Remove highlight_id and
+ unhighlight_id.
+
+ * gtkutil.c (menuitem_highlight_callback): Invoked widget is the
+ parent of the menu item. Get menu item widget from event.
+ (xg_create_one_menuitem, xg_update_menu_item): highlight_id and
+ unhighlight_id has been removed.
+ (create_menus): Connect enter/leave-notify-event to the menu instead
+ of individual items.
+
+2006-12-31 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c (update_frame_tool_bar): Connect create-menu-proxy with
+ xg_tool_bar_menu_proxy.
+ (xg_tool_bar_menu_proxy): New function.
+ (xg_tool_bar_proxy_callback): New function.
+
+2006-12-30 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c (xg_tool_bar_button_cb): Save last modifier on widget.
+ (xg_tool_bar_callback): Remove check for button.
+ (update_frame_tool_bar): Put an event box in the tool bar and a button
+ in the event box. Attach enter/leave-notify-event to the event box.
+
+2006-12-30 Richard Stallman <[email protected]>
+
+ * keymap.c (Fdefine_key): Doc fix.
+
+2006-12-29 Kim F. Storm <[email protected]>
+
+ * frame.h (struct frame): New member minimize_tool_bar_window_p.
+
+ * xdisp.c (auto_resize_tool_bars_p): Replace with ...
+ (Vauto_resize_tool_bars): ... this.
+ (syms_of_xdisp): DEFVAR_LISP and initialize it. Update doc string
+ to describe new value `grow-only', and use of C-l.
+ (display_tool_bar_line): Only use default face for border below
+ toolbar if not grow-only (to get acceptable visual appearence).
+ Explicitly set visible_height for empty toolbar lines.
+ (redisplay_tool_bar): Handle `grow-only' setting. Check and clear
+ minimize_tool_bar_window_p flag.
+
+ * window.c (Frecenter): Set minimize_tool_bar_window_p flag
+ when called without arg to redraw with minimum toolbar height.
+ Update doc string.
+
+2006-12-29 Jason Rumney <[email protected]>
+
+ * s/ms-w32.h (tzname): Do not define in msvc8.
+ (utime): Do not define in msvc8.
+
+ * regex.c (regerror): Change parameter name err_code.
+
+2006-12-26 Richard Stallman <[email protected]>
+
+ * search.c (Fsearch_forward): Doc fix.
+
+ * callint.c (Finteractive): Doc fix.
+
+2006-12-25 Kim F. Storm <[email protected]>
+
+ * s/ms-w32.h (BROKEN_DATAGRAM_SOCKETS): Define it.
+
+2006-12-23 Eli Zaretskii <[email protected]>
+
+ * keyboard.c (some_mouse_moved): Fix last change.
+
+2006-12-22 Eli Zaretskii <[email protected]>
+
+ * callproc.c (syms_of_callproc) <shell-file-name>: Doc fix.
+
+2006-12-22 Mark Davies <[email protected]>
+
+ * m/amdx86-64.h, m/hp800.h: Add support for NetBSD.
+ * m/sh3el.h: New file.
+
+2006-12-22 Eli Zaretskii <[email protected]>
+
+ * makefile.w32-in (emacs, temacs): Depend on stamp_BLD instead of
+ $(BLD).
+ ($(OBJ0) $(OBJ1) $(WIN32OBJ)): New dependency on stamp_BLD.
+ (bootstrap-temacs): Pass $(XMFLAGS) to sub-make.
+ ($(OBJ0) $(OBJ1) $(WIN32OBJ)): Add lastfile.$(O) and firstfile.$(O).
+ (clean): Delete stamp_BLD.
+
+2006-12-22 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macfns.c (mac_update_title_bar) [TARGET_API_MAC_CARBON]:
+ Call mac_update_proxy_icon also when buffer modification flag changed.
+ [TARGET_API_MAC_CARBON] (mac_update_proxy_icon): Don't update alias,
+ but compare FSRef/FSSpec of resolved alias.
+
+2006-12-21 Kim F. Storm <[email protected]>
+
+ * w32.c (_sys_wait_accept): Fix handle leak.
+
+2006-12-20 Jan Dj,Ad(Brv <[email protected]>
+
+ * sound.c: Include <alsa/asoundlib.h> if ALSA_SUBDIR_INCLUDE is
+ defined.
+
+2006-12-20 Kim F. Storm <[email protected]>
+
+ * s/ms-w32.h (BROKEN_NON_BLOCKING_CONNECT): Define it.
+
+2006-12-19 Juanma Barranquero <[email protected]>
+
+ * keyboard.c (syms_of_keyboard) <double-click-time>:
+ * mac.c (Fmac_code_convert_string):
+ * search.c (Fsearch_forward): Doc fixes.
+
+2006-12-19 Kim F. Storm <[email protected]>
+
+ Rework 2006-12-04 change. A SIGUSR1 (SIGUSR2) signal now generates
+ a sigusr1 event instead of [signal usr1] sequence, and signal events
+ are now supposed to be handled via special-event-map.
+
+ * keyboard.c (kbd_buffer_store_event_hold): Undo 2006-12-04 change.
+ (make_lispy_event): Don't generate Qsignal prefix for code 0.
+ Abort if signal code is unknown.
+ (store_user_signal_events): Don't make Qsignal prefix (code 0).
+ (Qsignal): Move declaration back to process.c.
+ (syms_of_keyboard): Don't intern or staticpro it here.
+
+ * process.c (Qsignal): Declare here.
+ (syms_of_process): Intern or staticpro it.
+
+ * emacs.c (main): Rename user signals to sigusr1 and sigusr2.
+
+ * .gdbinit: Pass on SIGUSR1 and SIGUSR2 to Emacs.
+
+2006-12-19 Juanma Barranquero <[email protected]>
+
+ * buffer.c (syms_of_buffer) <buffer-display-table>:
+ <scroll-up-aggressively, scroll-down-aggressively>: Doc fixes.
+
+2006-12-17 Richard Stallman <[email protected]>
+
+ * fileio.c (Fread_file_name_internal): Pass Vread_file_name_predicate
+ to Ffile_name_completion.
+
+ * dired.c (file_name_completion): New arg PREDICATE. Some cleanup.
+ (Ffile_name_completion): New arg PREDICATE.
+
+2006-12-17 Juanma Barranquero <[email protected]>
+
+ * buffer.c (Fkill_buffer): Doc fix.
+ (syms_of_buffer) <kill-buffer-query-functions>: Doc fix.
+
+2006-12-16 Juanma Barranquero <[email protected]>
+
+ * minibuf.c (Ftry_completion): Check that obarray buckets are symbols.
+
+2006-12-16 Eli Zaretskii <[email protected]>
+
+ * w32fns.c (w32-window-exists-p): New function.
+ (syms_of_w32fns): Defsubr it.
+
+ * prefix-args.c [STDC_HEADERS]: Include stdlib.h.
+
+2006-12-16 Juanma Barranquero <[email protected]>
+
+ * minibuf.c (Ftry_completion): Use `check_obarray' if ALIST is a vector.
+
+2006-12-15 Eli Zaretskii <[email protected]>
+
+ * emacs.c (USAGE3): Clarify documentation of --color.
+
+2006-12-15 YAMAMOTO Mitsuharu <[email protected]>
+
+ * mac.c (wakeup_from_rne_enabled_p) [TARGET_API_MAC_CARBON]:
+ New variable.
+ (ENABLE_WAKEUP_FROM_RNE, DISABLE_WAKEUP_FROM_RNE): New macros.
+ [!MAC_OSX] (select): Use them.
+ [MAC_OSX] (select_and_poll_event, sys_select): Likewise.
+ (mac_wakeup_from_rne) [TARGET_API_MAC_CARBON]: New function.
+
+ * macfns.c (mac_atsu_font_face_attributes) [USE_ATSUI]: Add extern.
+ (Fmac_atsu_font_face_attributes) [USE_ATSUI]: New function.
+ (syms_of_macfns) [USE_ATSUI]: Defsubr it.
+
+ * macselect.c [TARGET_API_MAC_CARBON] (mac_do_receive_drag):
+ Use mac_wakeup_from_rne instead of mac_post_mouse_moved_event.
+
+ * macterm.c (mac_query_char_extents) [USE_ATSUI]: Don't call
+ ATSUGetGlyphBounds if not necessary.
+ (Vmac_atsu_font_table) [USE_ATSUI]: Remove variable.
+ (syms_of_macterm) [USE_ATSUI]: Don't defvar it.
+ (fm_get_style_from_font, atsu_find_font_from_family_name)
+ (atsu_find_font_family_name, mac_atsu_font_face_attributes)
+ [USE_ATSUI]: New functions.
+ (init_font_name_table) [USE_ATSUI]: Use atsu_find_font_family_name.
+ (mac_load_query_font) [USE_ATSUI]: Use atsu_find_font_from_family_name.
+ Don't get metrics for Latin-1 right half characters.
+ (mac_load_query_font): Don't load font if space width is not positive.
+ [TARGET_API_MAC_CARBON] (mac_store_event_ref_as_apple_event):
+ Use mac_wakeup_from_rne instead of mac_post_mouse_moved_event.
+ (XTread_socket): Call SelectWindow when unfocused frame is clicked.
+
+ * macterm.h (mac_wakeup_from_rne) [TARGET_API_MAC_CARBON]: Add extern.
+
+2006-12-15 Kim F. Storm <[email protected]>
+
+ * keyboard.c (ignore_mouse_drag_p): New global var.
+ (some_mouse_moved): Return 0 if it is non-zero.
+ (make_lispy_event): Generate click event on mouse up if
+ ignore_mouse_drag_p is non-zero, even if mouse moved.
+ Clear ignore_mouse_drag_p on mouse down/up.
+
+ * xdisp.c (redisplay_window): Set ignore_mouse_drag_p if tool-bar
+ is resized to avoid generating a mouse drag event.
+
+2006-12-14 Juanma Barranquero <[email protected]>
+
+ * w32fns.c (w32_wnd_proc): Force non-tooltip frames to respect the
+ minimum tracking size. Remove non-working old hack to do the same.
+
+2006-12-14 YAMAMOTO Mitsuharu <[email protected]>
+
+ * emacs.c (handle_user_signal): Move function to keyboard.c.
+ (main): Use add_user_signal for SIGUSR1 and SIGUSR2.
+
+ * keyboard.c (make_lispy_event): Use find_user_signal_name.
+ (read_avail_input): Store pending user signal events.
+ (struct user_signal_info): New struct.
+ (user_signals): New variable.
+ (add_user_signal, store_user_signal_events)
+ (find_user_signal_name): New functions.
+ (handle_user_signal): Move function from emacs.c. Don't store
+ USER_SIGNAL_EVENT here, but increment number of pending signals.
+
+ * keyboard.h (add_user_signals): Add extern.
+
+2006-12-11 Juanma Barranquero <[email protected]>
+
+ * buffer.c (syms_of_buffer) <cursor-in-non-selected-windows>:
+ <default-scroll-up-aggressively, default-scroll-down-aggressively>:
+ <line-spacing, left-margin>: Doc fixes.
+
+ * xdisp.c (syms_of_xdisp) <mode-line-inverse-video>: Doc fix.
+
+2006-12-10 Kim F. Storm <[email protected]>
+
+ * xdisp.c (show_mouse_face): Never use text cursor in tool-bar.
+
+2006-12-10 Juanma Barranquero <[email protected]>
+
+ * abbrev.c (syms_of_abbrev) <last-abbrev-text>:
+ * buffer.c (syms_of_buffer) <default-major-mode>:
+ * keymap.c (Flookup_key):
+ * lread.c (Feval_buffer, Feval_region):
+ * macterm.c (syms_of_macterm) <x-use-underline-position-properties>:
+ <x-underline-at-descent-line, mac-emulate-three-button-mouse>:
+ * marker.c (Fmarker_insertion_type):
+ * minibuf.c (syms_of_minibuf) <minibuffer-completion-table>:
+ * msdos.c (syms_of_msdos) <delete-exited-processes>:
+ * w32term.c (syms_of_w32term) <x-use-underline-position-properties>:
+ <x-underline-at-descent-line>:
+ * xdisp.c (format-mode-line):
+ * xterm.c (syms_of_xterm) <x-use-underline-position-properties>:
+ <x-underline-at-descent-line>: Doc fixes.
+
+2006-12-10 Andreas Schwab <[email protected]>
+
+ * systime.h (EMACS_GET_TIME): Remove check for
+ HAVE_STRUCT_TIMEZONE which is never defined.
+
+2006-12-10 Alan Mackenzie <[email protected]>
+
+ * syntax.c (Fpartial_parse_sexp): Correct Docco: Elt 8 of the
+ result is now neither the last elt nor optional for OLDSTATE.
+
+2006-12-09 Eli Zaretskii <[email protected]>
+
+ * process.c (Fsignal_process): Doc fix. Use XFLOAT_DATA to
+ extract the process ID from a Lisp float.
+
+2006-12-09 Chong Yidong <[email protected]>
+
+ * xterm.c (XTframe_raise_lower): Comment out _NET_ACTIVE_WINDOW code.
+
+2006-12-08 Eli Zaretskii <[email protected]>
+
+ * frame.h (PIX_TYPE): Redefine as `unsigned long', for 64-bit
+ platforms where long is 64-bit.
+
+ * msdos.h (PIX_TYPE): Redefine as `unsigned long'.
+
+2006-12-08 NAKAJI Hiroyuki <[email protected]> (tiny change)
+
+ * m/amdx86-64.h: Add support for Solaris 10 on x86-64.
+
+2006-12-08 Kenichi Handa <[email protected]>
+
+ * xterm.c (x_query_font): Use xstricmp instead off strcasecmp.
+
+2006-12-08 Juanma Barranquero <[email protected]>
+
+ * emacs.c (syms_of_emacs) <system-type>: Doc fix.
+
+2006-12-07 Kim F. Storm <[email protected]>
+
+ * process.c (parse_signal): Use xstricmp instead of strcasecmp.
+ (Fsignal_process): Don't use strncasecmp.
+
+2006-12-05 Glenn Morris <[email protected]>
+
+ * abbrev.c (Qforce): New Lisp_Object.
+ (Fdefine_abbrev): Do not overwrite non-system abbrevs with system
+ abbrevs, unless 'force is applied.
+ (syms_of_abbrev): Add Qforce.
+
+2006-12-04 Kim F. Storm <[email protected]>
+
+ * process.c (parse_signal): Rename macro from handle_signal.
+ (Fsignal_process): Also accept lower-case variants of signal
+ names (to align with signal names generated by Emacs itself).
+
+ * emacs.c (handle_USR1_signal, handle_USR2_signal): Replace by...
+ (handle_user_signal): ... this, which generates two USER_SIGNAL_EVENTs
+ first with code == 0 [signal] and one with code == sig number.
+ (main): Use it as handler for SIGUR1 and SIGUSR2.
+
+ * keyboard.c (kbd_buffer_store_event_hold): Don't throw-on-input
+ if first event in [signal xxx] sequence.
+ (lispy_user_signals, Qusr1_signal, Qusr2_signal): Remove.
+ (syms_of_keyboard): Don't intern and staticpro them.
+ (Qsignal): Declare here.
+ (syms_of_keyboard): Intern and staticpro it.
+ (make_lispy_event): Use it. Intern symbols on the fly for other
+ USER_SIGNAL_EVENTs events.
+
+ * process.c (Qsignal): Declare extern.
+ (syms_of_process): Don't intern/staticpro it here.
+
+ * process.c (read_process_output): Abort if carryover < 0.
+
+2006-12-04 YAMAMOTO Mitsuharu <[email protected]>
+
+ * config.in: Regenerate.
+
+ * fileio.c [__NetBSD__]: Don't define `unix'.
+ (Funix_sync, syms_of_fileio): Use `#ifdef HAVE_SYNC' instead of
+ `#ifdef unix'.
+
+2006-12-04 Glenn Morris <[email protected]>
+
+ * Makefile.in (version): New variable, set by configure.
+ (bootstrapclean, mostlyclean): Also remove emacs-${version}.
+
+2006-12-03 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c (update_frame_tool_bar): Handle modifying a toolbar item
+ without an image.
+
+2006-12-01 Eli Zaretskii <[email protected]>
+
+ * w32fns.c (Fw32_shell_execute): Doc fix.
+
+2006-11-30 Chong Yidong <[email protected]>
+
+ * xdisp.c (move_it_to): Correctly count tab glyphs for continued
+ lines ending in tab.
+
+2006-11-30 Jan Dj,Ad(Brv <[email protected]>
+
+ * xterm.c (x_raise_frame): Move setting of _NET_ACTIVE_WINDOW
+ property ...
+ (XTframe_raise_lower): ... to here.
+
+2006-11-30 Kenichi Handa <[email protected]>
+
+ * regex.c (regex_compile): Fix previous change.
+
+2006-11-29 Juanma Barranquero <[email protected]>
+
+ * sound.c (Fplay_sound_internal): Remove spurious newline in docstring.
+
+2006-11-28 Chong Yidong <[email protected]>
+
+ * config.in: Regenerate.
+
+2006-11-28 Kenichi Handa <[email protected]>
+
+ * regex.c (regex_compile): Don't call SET_LIST_BIT with a
+ multibyte character.
+
+2006-11-27 Chong Yidong <[email protected]>
+
+ * s/aix4-2.h: Undefine _NO_PROTO. Suggested by Joe Buehler.
+
+2006-11-27 Kim F. Storm <[email protected]>
+
+ * window.c (set_window_buffer): Refactor recent changes.
+
+2006-11-27 Jason Rumney <[email protected]>
+
+ * w32term.c (w32_msg_worker): Declare correctly.
+ (w32_initialize): Don't cast w32_msg_worker.
+
+ * w32fns.c (w32_msg_worker): Define as WINAPI and arg as void pointer.
+
+2006-11-26 Chong Yidong <[email protected]>
+
+ * m/amdx86-64.h: Look for standard libs in /usr/lib64 only if that
+ directory exists.
+
+2006-11-25 Eli Zaretskii <[email protected]>
+
+ * w16select.c (Fw16_set_clipboard_data): Fix the call to sit_for
+ as per the calling sequence change on 2006-07-11.
+
+2006-11-25 Chong Yidong <[email protected]>
+
+ * window.c (set_window_buffer): Use BLOCK_INPUT.
+
+2006-11-24 Juanma Barranquero <[email protected]>
+
+ * fns.c (substring_both): Add missing address operator.
+
+2006-11-24 Stefan Monnier <[email protected]>
+
+ * fns.c: Use AREF/ASIZE macros.
+ (concat): Provide the full ANSI prototype.
+
+2006-11-24 Juanma Barranquero <[email protected]>
+
+ * buffer.c (syms_of_buffer) <buffer-undo-list>: Doc fix.
+
+2006-11-23 William Smith <[email protected]> (tiny change)
+
+ * strftime.c (HAVE_SYS__MBSTATE_T_H): Fix typo.
+
+2006-11-22 Alfred M. Szmidt <[email protected]> (tiny change)
+
+ * s/openbsd.h (LD_SWITCH_SYSTEM): Remove /usr/pkg/lib and
+ /usr/pkg/lib from the library search path.
+ (LD_SWITCH_X_DEFAULT): New macro.
+
+2006-11-22 Chong Yidong <[email protected]>
+
+ * window.c (set_window_buffer): Clear mouse highlight if it is in
+ this window.
+
+2006-11-21 Chong Yidong <[email protected]>
+
+ * xfaces.c (realize_default_face): Check if the default font name
+ exists on this display before trying to use it.
+
+2006-11-21 Richard Stallman <[email protected]>
+
+ * fileio.c: Break line before &&, not after.
+
+2006-11-20 Eli Zaretskii <[email protected]>
+
+ * fns.c (concat) [!__GNUC__]: Add prototype.
+
+2006-11-20 Kenichi Handa <[email protected]>
+
+ * fileio.c (Fread_file_name_internal): Use SBYTES (not SCHARS) to
+ check the tailing slash of a filename.
+
+2006-11-20 KOBAYASHI Yasuhiro <[email protected]> (tiny change)
+
+ * indent.c (Fvertical_motion): Include composition in the case of
+ overshoot expected.
+
+2006-11-19 Andreas Schwab <[email protected]>
+
+ * xfaces.c (Fdisplay_supports_face_attributes_p): Initialize supports.
+
+ * xmenu.c (Fx_popup_menu): Initialize selection.
+
+2006-11-18 Andreas Schwab <[email protected]>
+
+ * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Update call to mark_memory.
+
+2006-11-17 Tetsurou Okazaki <[email protected]> (tiny change)
+
+ * xterm.c (do_ewmh_fullscreen): Declare variable before XSETFRAME
+ to avoid gcc 2.96 error.
+
+2006-11-17 NIIMI Satoshi <[email protected]> (tiny change)
+
+ * search.c (simple_search): In the loop of backward searching,
+ check also the byte position against the limit.
+
+2006-11-14 Romain Francoise <[email protected]>
+
+ * minibuf.c (Fcompleting_read): Fix typo in docstring.
+
+2006-11-14 Kenichi Handa <[email protected]>
+
+ * coding.c (code_convert_region): Initialize coding->heading_ascii.
+ (decode_coding_string, code_convert_region): Likewise.
+
+2006-11-14 YAMAMOTO Mitsuharu <[email protected]>
+
+ * config.in: Regenerate.
+
+ * macfns.c (Fx_display_mm_height, Fx_display_mm_width)
+ [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
+ && MAC_OS_X_VERSION_MIN_REQUIRED == 1020]: Check if
+ CGDisplayScreenSize is available.
+
+ * macmenu.c (menu_quit_handler, install_menu_quit_handler):
+ Replace `#ifdef HAVE_CANCELMENUTRACKING' with
+ `#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030'.
+ (install_menu_quit_handler) [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
+ && MAC_OS_X_VERSION_MIN_REQUIRED == 1020]: Check if
+ CancelMenuTracking is available.
+
+ * macterm.c [USE_CG_TEXT_DRAWING] (mac_draw_image_string_cg)
+ [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
+ && MAC_OS_X_VERSION_MIN_REQUIRED == 1020]: Check if
+ CGContextShowGlyphsWithAdvances is available.
+
+2006-11-13 Jason Rumney <[email protected]>
+
+ * s/ms-w32.h: Define HAVE_INET_SOCKETS.
+
+2006-11-13 Nozomu Ando <[email protected]>
+
+ * alloc.c (mark_memory): New argument OFFSET. All uses changed.
+ Fix address calculations for case END < START.
+ (mark_stack): Impose Lisp_Object alignment on jmp_buf.
+
+2006-11-12 Juanma Barranquero <[email protected]>
+
+ * coding.c (Fencode_sjis_char, Fencode_big5_char):
+ Improve argument/docstring consistency.
+
+ * editfns.c (Fmessage): Doc fixes.
+
+ * process.c (syms_of_process) <delete-exited-processes>: Doc fix.
+
+2006-11-12 Chong Yidong <[email protected]>
+
+ * xmenu.c (popup_activated): Define outside HAVE_MENUS.
+
+2006-11-12 Romain Francoise <[email protected]>
+
+ * xselect.c (selection-coding-system): Fix docstring.
+
+2006-11-12 Juanma Barranquero <[email protected]>
+
+ * category.c (Fchar_category_set): Improve arg/docstring consistency.
+
+ * data.c (Flogxor):
+ * fns.c (Frandom, Flength, Fsafe_length, Fstring_bytes)
+ (Fstring_equal, Fcompare_strings, Fstring_lessp, Fcopy_sequence)
+ (Fstring_make_unibyte): Fix typos in docstrings.
+
+2006-11-10 Jan Dj,Ad(Brv <[email protected]>
+
+ * xterm.h (struct x_display_info): Fix indentation.
+
+ * xterm.c (do_ewmh_fullscreen, XTfullscreen_hook): New functions.
+ (x_check_fullscreen): Call do_ewmh_fullscreen.
+ (x_initialize): Set fullscreen_hook to XTfullscreen_hook.
+
+ * frame.c (x_set_fullscreen): Call fullscreen_hook if set.
+
+ * term.c: Define fullscreen_hook.
+ (syms_of_term): Initialize fullscreen_hook to NULL.
+
+ * termhooks.h: Add fullscreen_hook.
+
+2006-11-08 Juanma Barranquero <[email protected]>
+
+ * bytecode.c (Fbyte_code):
+ * data.c (Fmakunbound): Use SYMBOL_CONSTANT_P macro.
+
+2006-11-06 Juanma Barranquero <[email protected]>
+
+ * lread.c (syms_of_lread):
+ * xsmfns.c (syms_of_xsmfns): Fix typo in docstring.
+
+2006-11-06 Martin Rudalics <[email protected]>
+
+ * macmenu.c (Fmenu_or_popup_active_p): Define outside HAVE_MENUS.
+
+ * w32menu.c (Fmenu_or_popup_active_p): Define outside HAVE_MENUS.
+ Return nil if building without menus.
+
+ * xmenu.c (Fmenu_or_popup_active_p): Define outside HAVE_MENUS.
+ Return nil if building without menus.
+
+2006-11-05 Mark Davies <[email protected]> (tiny change)
+
+ * s/netbsd.h (POSIX_SIGNALS): Define.
+
+2006-11-05 Martin Rudalics <[email protected]>
+
+ * macmenu.c (Fmenu_or_popup_active_p): New function.
+ (syms_of_macmenu): Defsubr it.
+
+ * w32menu.c (Fmenu_or_popup_active_p): New function.
+ (syms_of_w32menu): Defsubr it.
+ (popup_activated_flag, popup_activated): Remove.
+
+ * xdisp.c (note_mouse_highlight) [HAVE_NTGUI]: Don't bother to
+ check popup_activated.
+
+ * xmenu.c (Fmenu_or_popup_active_p): New function.
+ (syms_of_xmenu): Defsubr it.
+
+2006-11-05 YAMAMOTO Mitsuharu <[email protected]>
+
+ * unexmacosx.c (malloc_cookie): Remove unused variable.
+ (region_list_head, region_list_tail, lca, nlc, infile_lc_highest_addr)
+ (text_seg_lowest_offset, mh, curr_header_offset, infd, outfd)
+ (emacs_zone, data_segment_old_fileoff, data_segment_scp)
+ (num_unexec_regions, unexec_regions): Make variables static.
+ (print_regions, find_emacs_zone_regions): Make static.
+ (unexec_region_info): New typedef.
+ (unexec_regions): Change type from vm_range_t[] to unexec_region_info[].
+ All uses changed.
+ (unexec_regions_recorder): Subtract size of trailing null pages from
+ filesize. Show filesize.
+ (unexec_regions_merge): Don't merge if null pages of preceding region
+ is not too small. Use long format in printf.
+ (copy_segment, copy_data_segment): Show filesize.
+ (copy_data_segment): Write filesize bytes of region data.
+ Adjust filesize in segment command accordingly.
+ (dump_it): Use long format in printf.
+
+2006-11-05 Juanma Barranquero <[email protected]>
+
+ * dosfns.c (Finsert_startup_screen):
+ * fns.c (Ffeaturep, syms_of_fns):
+ * frame.c (syms_of_frame): Fix typos in docstrings.
+
+ * unexcw.c (unexec): Fix typo in output message.
+
+2006-11-04 Ralf Angeli <[email protected]>
+
+ * w32fns.c (w32_createwindow): Remove code for handling -geometry
+ command line option and `initial-frame-alist' which is superfluous
+ after the last change to `w32_createwindow'.
+
+2006-11-04 Slawomir Nowaczyk <[email protected]> (tiny change)
+
+ * w32proc.c (sys_wait): Only wait for processes with fd<0.
+ Others should be handled by sys_select instead. Fixes problems
+ with (progn (start-process "" nil "ls") (call-process "ls")).
+
+2006-11-04 Giorgos Keramidas <[email protected]> (tiny change)
+
+ * xmenu.c (Fmenu_bar_open): Declare variable before BLOCK_INPUT to
+ avoid gcc 2.95 error.
+
+2006-11-04 Chong Yidong <[email protected]>
+
+ * gtkutil.c (update_frame_tool_bar): If icon image is invalid and
+ wicon is null, insert an empty button.
+
+2006-11-03 Jan Dj,Ad(Brv <[email protected]>
+
+ * xterm.c (x_raise_frame): Send _NET_ACTIVE_WINDOW when raising the
+ window.
+
+2006-11-02 Juanma Barranquero <[email protected]>
+
+ * emacs.c (Fkill_emacs): Fix typo in docstring.
+
+2006-11-02 Nozomu Ando <[email protected]>
+
+ * unexmacosx.c (mach_header, segment_command, vm_region, section)
+ [_LP64]: New defines.
+ (VM_REGION_BASIC_INFO_COUNT, VM_REGION_BASIC_INFO, LC_SEGMENT)
+ (MH_MAGIC) [_LP64]: Redefine.
+ (delta): Remove variable.
+ (curr_file_offset, pagesize): New variables.
+ (ROUNDUP_TO_PAGE_BOUNDARY): New macro.
+ (data_segment_old_fileoff): Initialize explicitly.
+ (print_region, unexec_regions_recorder, print_load_command_name)
+ (copy_segment, copy_data_segment): Use long format in printf.
+ (MAX_UNEXEC_REGIONS): Increase to 400.
+ (unexec_regions_recorder): Don't warn too many regions here.
+ (find_emacs_zone_regions): Warn too many regions here.
+ (print_load_command_name) [_LP64]: Show correct load command name.
+ (copy_segment, copy_data_segment): Use variable `curr_file_offset'.
+ Show starting virtual memory address. Don't show ending file offset.
+ (copy_symtab, copy_dysymtab, copy_twolevelhints): New argument DELTA.
+ (dump_it): Use new local variable `linkedit_delta' and pass to them.
+ Error if trying to handle multiple DATA segments.
+ (unexec): Initialize variable `pagesize'.
+
+2006-11-01 Juanma Barranquero <[email protected]>
+
+ * eval.c (Fcatch): Doc fix.
+
+2006-10-31 YAMAMOTO Mitsuharu <[email protected]>
+
+ * image.c [MAC_OS] (image_load_qt_1, xpm_scan, xpm_make_color_table_v)
+ (xpm_put_color_table_v, xpm_get_color_table_v, xpm_make_color_table_h)
+ (xpm_put_color_table_h, xpm_get_color_table_h, xpm_str_to_color_key)
+ (xpm_load_image): Add const qualifier to arguments.
+ [MAC_OS] (xpm_color_key_strings): Make static const.
+
+ * mac.c (create_apple_event_from_event_ref)
+ (create_apple_event_from_drag_ref, skip_white_space, parse_comment)
+ (parse_include_file, parse_binding, parse_component)
+ (parse_resource_name, parse_value, parse_resource_line)
+ (xrm_merge_string_database, xrm_get_resource)
+ (xrm_get_preference_database): Add const qualifier to arguments.
+ [MAC_OSX] (sys_select): Make variable `context' static const.
+
+ * macfns.c (mac_color_map): Make static const.
+ (mac_color_map_lookup): Add const qualifier to arguments.
+
+ * macmenu.c (install_menu_quit_handler): Make variable `typesList'
+ static const.
+ (name_is_separator): Add const qualifier to arguments.
+
+ * macselect.c (init_service_handler): Make variable `specs' static
+ const.
+
+ * macterm.c (mac_create_bitmap_from_bitmap_data): Make variable
+ `swap_nibbles' static const.
+ (atsu_get_text_layout_with_text_ptr): Make variables `lengths',
+ `tags', `sizes', `values' static const.
+ (mac_draw_string_common): Make variables `context' static.
+ Make variables `tags', `sizes', and `values' static const.
+ (pcm_get_status, x_detect_focus_change, x_scroll_bar_handle_click)
+ (xlfdpat_create, xlfdpat_block_match_1, xlfdpat_match)
+ (mac_to_x_fontname, parse_x_font_name, add_mac_font_name)
+ (mac_do_list_fonts, is_fully_specified_xlfd, do_grow_window)
+ (mac_store_event_ref_as_apple_event, mac_make_rdb): Add const
+ qualifier to arguments.
+ (xlfd_scalable_fields, keycode_to_xkeysym_table)
+ (fn_keycode_to_keycode_table): Make static const.
+ (mac_load_query_font): Make variables `tags', `sizes', `values',
+ `types', and `selectors' static const.
+ (mac_handle_command_event, mac_handle_window_event):
+ Make variables `names' and `types' static const.
+ (init_command_handler, install_window_handler): Make variables
+ `specs*' static const.
+ (mac_handle_font_event, mac_handle_text_input_event)
+ (mac_store_service_event): Make variables `names' and `types'
+ const. Make variables `names_*' and `types_*' static const.
+
+ * macterm.h (create_apple_event_from_event_ref)
+ (create_apple_event_from_drag_ref, xrm_merge_string_database)
+ (xrm_get_resource, xrm_get_preference_database): Add const
+ qualifier to arguments in externs.
+
+2006-10-31 Kenichi Handa <[email protected]>
+
+ * xfns.c (xic_create_xfontset): Fix previous change.
+
+2006-10-30 Chong Yidong <[email protected]>
+
+ * s/openbsd.h (LD_SWITCH_SYSTEM): Add /usr/pkg/lib and
+ /usr/pkg/lib to library search path.
+
+2006-10-29 Mark Davies <[email protected]> (tiny change)
+
+ * ralloc.c (relinquish): Use a long for excess space counter to
+ handle 64-bit case correctly.
+
+2006-10-29 Jeramey Crawford <[email protected]>
+
+ * m/amdx86-64.h: Add defines for OpenBSD x86-64.
+
+2006-10-29 Juanma Barranquero <[email protected]>
+
+ * window.c (Fdisplay_buffer): Fix typo in docstring.
+
+2006-10-27 Ben North <[email protected]> (tiny change)
+
+ * w32term.c (x_draw_glyph_string_foreground): Set background mode
+ to TRANSPARENT before using overstrike to simulate bold faces.
+
+ * xfaces.c (best_matching_font): Fix logic to decide whether to
+ use overstriking to simulate bold-face (it was reversed).
+
+2006-10-23 Kim F. Storm <[email protected]>
+
+ * xdisp.c (remember_mouse_glyph): Do nothing if glyphs are not
+ initialized.
+
+ * keyboard.c (read_char): Make an element (t . EVENT) in
+ unread-command-events add EVENT to the current command's key sequence.
+ (syms_of_keyboard) <unread-command-events>: Update doc.
+
+2006-10-21 Richard Stallman <[email protected]>
+
+ * minibuf.c (Vread_expression_map): Define here.
+ (Qread_expression_history): New variable.
+ (syms_of_minibuf): Initialize them.
+ (Feval_minibuffer): Use Vread_expression_map and
+ Qread_expression_history.
+
+2006-10-21 Kenichi Handa <[email protected]>
+
+ * xfns.c (xic_create_fontsetname): If ADSTYLE field is not a wild
+ card, change it to "*".
+ (xic_create_xfontset): Call XCreateFontSet for each single
+ fontname in fontsetname.
+
+2006-10-19 Chong Yidong <[email protected]>
+
+ * callint.c (callint_message): Convert to a Lisp string.
+ (syms_of_callint): Initialize it.
+ (callint_message_size): Var deleted.
+ (Fcall_interactively): Use Fformat instead of doprnt to construct
+ prompt string.
+
+2006-10-19 YAMAMOTO Mitsuharu <[email protected]>
+
+ * xdisp.c (display_mode_line): Clear enabled_p flag on mode-line row.
+
+2006-10-19 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macfns.c (Vmac_carbon_version_string) [TARGET_API_MAC_CARBON]:
+ New variable.
+ (syms_of_macfns) [TARGET_API_MAC_CARBON]: Defvar it.
+
+2006-10-19 Jan Dj,Ad(Brv <[email protected]>
+
+ * xselect.c (x_handle_selection_request): If the converted_selection
+ is nil or XCDR (converted_selection) is nil, decline the request.
+
+2006-10-16 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c (get_utf8_string): Remove warnings with casts.
+ (xg_tool_bar_button_cb): Ditto.
+ (xg_tool_bar_callback): Ditto.
+
+2006-10-16 YAMAMOTO Mitsuharu <[email protected]>
+
+ * dispnew.c (adjust_frame_glyphs_for_frame_redisplay): Remove unused
+ variable ch_dim.
+ (adjust_frame_glyphs_for_window_redisplay): Likewise. Don't allocate
+ menu bar window matrices on non-X systems.
+
+ * mac.c (Fmac_get_preference, Fmac_code_convert_string): Add GCPROs.
+
+ * macterm.c (mac_query_char_extents): Don't return glyph ID if layout
+ adjustment is needed.
+ (mac_load_query_font): Check if width and height are positive.
+
+2006-10-14 Richard Stallman <[email protected]>
+
+ * sysdep.c (init_sys_modes): Delete DEFVAR_LISP in the wrong place.
+
+2006-10-13 Chong Yidong <[email protected]>
+
+ * xdisp.c (decode_mode_spec): Ignore %c and %l constructs in frame
+ title.
+
+2006-10-12 Chong Yidong <[email protected]>
+
+ * keymap.c (Fkey_binding): Check Lisp_Object types before doing
+ XCAR and XINT.
+
+2006-10-12 Romain Francoise <[email protected]>
+
+ * image.c (xbm_read_bitmap_data): Delete extra semicolon.
+
+2006-10-10 Stefan Monnier <[email protected]>
+
+ * eval.c: Include xterm.h for x_fully_uncatch_errors and friends.
+
+ * dispextern.h: Declare x_create_bitmap_from_xpm_data.
+
+ * xterm.c (x_check_expected_move): Remove unused var `count'.
+
+ * xmenu.c (syms_of_xmenu): Use Ffset rather than Fdefalias, since
+ Fdefalias is not declared in any *.h file.
+
+2006-10-09 Chong Yidong <[email protected]>
+
+ * dispnew.c (sit_for): Sit forever if TIMEOUT is t.
+
+ * keyboard.c (command_loop_1): Handle non-number values of
+ `minibuffer-message-timeout'.
+ (Fexecute_extended_command): Fix typo.
+
+ * minibuf.c (temp_echo_area_glyphs): Sit for
+ `minibuffer-message-timeout' seconds.
+
+2006-10-08 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.c (mac_draw_image_string, mac_draw_image_string_16):
+ Add argument OVERSTRIKE_P.
+ (mac_draw_string_common, mac_draw_image_string_cg): Likewise.
+ Support overstrike.
+ (mac_draw_string, mac_draw_string_16): Remove functions.
+ (x_draw_glyph_string_foreground): Use overstrike when needed.
+ (x_draw_composite_glyph_string_foreground): Likewise.
+ Use mac_draw_image_string_16 instead of mac_draw_string_16.
+ (mac_load_query_font): Rename from XLoadQueryFont. Take argument
+ F instead of DPY. All uses changed. Don't save/restore font.
+
+2006-10-07 Ralf Angeli <[email protected]>
+
+ * w32fns.c (w32_createwindow): Honour left and top positions if
+ supplied explicitly.
+
+2006-10-06 Kim F. Storm <[email protected]>
+
+ * xdisp.c (pos_visible_p): Fix value when EOB is visible.
+
+2006-10-05 Chong Yidong <[email protected]>
+
+ * frame.c (Qinhibit_face_set_after_frame_default): New var.
+ (syms_of_frame): Initialize it.
+ (x_set_frame_parameters): Avoid resetting :font attributes to the
+ new-frame defaults.
+
+2006-10-03 Stefan Monnier <[email protected]>
+
+ * lisp.h (clear_regexp_cache): Declare.
+
+ * search.c (compile_pattern): Only check `cp->syntax_table' if needed.
+ (compile_pattern_1): Remember `used_syntax' in `cp->syntax_table'.
+ (clear_regexp_cache): Only flush those regexps which depend on
+ a syntax-table.
+
+ * regex.c (regex_compile): Set the new `used_syntax' bit.
+
+ * regex.h: Remove file local variables.
+ (struct re_pattern_buffer): New field `used_syntax'.
+
+2006-10-03 Kim F. Storm <[email protected]>
+
+ * process.c (list_processes_1): Run sentinels before removing dead
+ processes. Also remove `closed' network connections.
+
+2006-10-01 Stefan Monnier <[email protected]>
+
+ * xdisp.c (handle_fontified_prop): Don't fontify at EOB.
+
+2006-09-30 Eli Zaretskii <[email protected]>
+
+ * config.in: Regenerated.
+
+2006-09-29 Juri Linkov <[email protected]>
+
+ * buffer.c (syms_of_buffer): Reorder coding systems in the
+ docstring of %z to the real order displayed in the modeline.
+
+2006-09-28 Stefan Monnier <[email protected]>
+
+ * keymap.c (Fdefine_key): Yet another int/Lisp_Object mixup (YAILOM).
+
+2006-09-26 Chong Yidong <[email protected]>
+
+ * indent.c (Fvertical_motion): Do move back if the Lisp string
+ being displayed contains newlines.
+
+2006-09-26 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.c (mac_compute_glyph_string_overhangs, XLoadQueryFont)
+ [USE_CG_DRAWING]: Call mac_prepare_for_quickdraw before QDTextBounds.
+
+2006-09-26 Kenichi Handa <[email protected]>
+
+ * keymap.c (Fsingle_key_description): For an invalid char, return
+ "Invalid char code NNNNN".
+
+2006-09-25 Chong Yidong <[email protected]>
+
+ * callint.c (Fcall_interactively): Doc fix.
+
+2006-09-25 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.c (x_underline_at_descent_line): New variable.
+ (syms_of_macterm): DEFVAR_BOOL it.
+ (x_draw_glyph_string): Use it.
+ (XLoadQueryFont): Calculate min_bounds.descent and max_bounds.descent.
+
+2006-09-25 Kenichi Handa <[email protected]>
+
+ * keymap.c (Fsingle_key_description): Return unique names for
+ generic characters.
+
+2006-09-24 Richard Stallman <[email protected]>
+
+ * search.c (compile_pattern_1): Don't BLOCK_INPUT.
+
+2006-09-24 Eli Zaretskii <[email protected]>
+
+ * makefile.w32-in ($(BLD)/fns.$(O), $(BLD)/w32proc.$(O)):
+ Depend on nt/inc/langinfo.h and nt/inc/nl_types.h.
+
+ * w32proc.c (nl_langinfo): New function.
+
+ * w32fns.c (w32-pass-alt-to-system, w32-alt-is-meta)
+ (w32-pass-lwindow-to-system, w32-enable-num-lock)
+ (w32-enable-caps-lock, w32-scroll-lock-modifier)
+ (w32-lwindow-modifier, w32-rwindow-modifier)
+ (w32-apps-modifier, w32-mouse-button-tolerance): Doc fix.
+
+2006-09-23 Juanma Barranquero <[email protected]>
+
+ * minibuf.c (Finternal_complete_buffer, Fread_minibuffer)
+ (Fdisplay_completion_list): Fix typos in docstrings.
+
+2006-09-23 Romain Francoise <[email protected]>
+
+ * s/gnu-linux.h (MAIL_USE_FLOCK): Check for HAVE_LIBLOCKFILE too.
+
+2006-09-23 Kenichi Handa <[email protected]>
+
+ * keymap.c (Fmap_keymap): Docstring mentions about generic character.
+
+2006-09-22 Stefan Monnier <[email protected]>
+
+ * regex.c (analyse_first): For eight-bit-control chars, mark both the
+ char's value and its leading byte in the fastmap.
+ (re_search_2): When fast-scanning without translation, be careful to
+ check that we only match the leading byte of a multibyte char.
+
+ * charset.h (PREV_CHAR_BOUNDARY): Make it work from within a char's
+ byte sequence.
+ (AT_CHAR_BOUNDARY): New macro.
+
+2006-09-22 Kenichi Handa <[email protected]>
+
+ * fns.c (optimize_sub_char_table): Don't optimize a sub-char-table
+ whose default value is non-nil.
+
+2006-09-22 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c (xg_get_file_with_chooser): Only show C-l help for
+ Gtk+ versions < 2.10.
+
+ * xfns.c (syms_of_xfns): Fix typo in help text for
+ x-gtk-file-dialog-help-text.
+
+2006-09-21 Kim F. Storm <[email protected]>
+
+ * fns.c (Fmemq): Refill doc string.
+ (Fmemql): New defun, like memq but using eql.
+ (syms_of_fns): Defsubr it.
+
+2006-09-20 Kim F. Storm <[email protected]>
+
+ * xdisp.c (pos_visible_p): CHARPOS < 0 means return info for
+ last visible glyph in window.
+
+ * window.c (Fset_window_hscroll, Fwindow_line_height):
+ Doc fix. Use "off-window" instead of "off-screen".
+ (Fpos_visible_in_window_p): Likewise.
+ If POS is t, return info for last visible glyph in window.
+
+2006-09-19 Chong Yidong <[email protected]>
+
+ * search.c (struct regexp_cache): New entry syntax_table.
+ (compile_pattern_1): Set it.
+ (syms_of_search): Initialize it.
+ (compile_pattern): Require the syntax_table entry of the cache
+ element to match the current syntax table entry.
+
+2006-09-19 Stefan Monnier <[email protected]>
+
+ * window.c (Fwindow_end): Fix recent change.
+
+2006-09-19 Kim F. Storm <[email protected]>
+
+ * window.c (Fset_window_hscroll, Fpos_visible_in_window_p):
+ Doc fix. Use "off-screen" instead of "invisible".
+ (Fwindow_line_height): Make line numbers 0-based. Make line arg
+ optional; if nil, use current cursor row. Handle text terminals
+ properly. Return nil if non-interactive or pseudo-window.
+
+2006-09-19 Stefan Monnier <[email protected]>
+
+ * keymap.c: Include alloca.h if available.
+ (Fkey_binding): Only use AREF after checking it's a vector.
+ Remove unused var `window'.
+
+2006-09-19 YAMAMOTO Mitsuharu <[email protected]>
+
+ * emacs.c (shut_down_emacs) [!subprocesses]: Don't set
+ inhibit_sentinels.
+
+ * mac.c [!MAC_OSX] (select): Fix argument name.
+
+ * macmenu.c (enum mac_menu_kind, min_menu_id): New enumerator and
+ menu ID for Apple menu.
+ (menubar_selection_callback): Remove function.
+ (find_and_call_menu_selection): New function from xmenu.c.
+ (x_activate_menubar): Use it.
+ (set_frame_menubar): Don't use f->output_data.mac->menubar_active.
+
+ * macterm.c (menubar_selection_callback): Remove extern.
+ (M_APPLE): Change to 234.
+ (do_apple_menu) [!TARGET_API_MAC_CARBON]: Make non-static.
+ (do_menu_choice): Remove function.
+
+ * macterm.h (struct mac_output): Remove member menubar_active.
+ (do_menu_choice): Remove extern.
+ (do_apple_menu) [!TARGET_API_MAC_CARBON]: Add extern.
+
+2006-09-18 Jan Dj,Ad(Brv <[email protected]>
+
+ * xfns.c (syms_of_xfns): Rename x_gtk_show_chooser_help_text to
+ x_gtk_file_dialog_help_text.
+
+ * gtkutil.c (xg_uses_old_file_dialog): Rename x-use-old-gtk-file-dialog
+ to x-gtk-use-old-file-dialog.
+ (xg_get_file_with_chooser): Rename x_gtk_show_chooser_help_text to
+ x_gtk_file_dialog_help_text.
+
+ * xfns.c (syms_of_xfns): Ditto.
+
+2006-09-18 Kim F. Storm <[email protected]>
+
+ * window.c (Fwindow_line_visibility): Remove.
+ (Fwindow_line_height): New defun replacing it.
+ (syms_of_window): Defsubr it.
+
+2006-09-18 YAMAMOTO Mitsuharu <[email protected]>
+
+ * mac.c (SELECT_USE_CFSOCKET) [MAC_OSX]: Set default to 1.
+ [MAC_OSX] (sys_select) [SELECT_USE_CFSOCKET]: Fix pointer type.
+
+2006-09-17 Jay Belanger <[email protected]>
+
+ * gmalloc.c:
+ * md5.c:
+ * md5.h:
+ * strftime.c: Replace "GNU Library General Public License" by "GNU
+ General Public License" throughout.
+
+2006-09-17 Kim F. Storm <[email protected]>
+
+ * dispnew.c (update_text_area): Undo 2000-07-18 change.
+ Always redrawing whole row if line has mouse-face in it causes
+ excessive flickering of the mode line.
+
+2006-09-17 Chong Yidong <[email protected]>
+
+ * search.c (clear_regexp_cache): New function.
+
+ * syntax.c (Fmodify_syntax_entry): Clear regexp cache.
+
+2006-09-16 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c (xg_get_file_with_chooser):
+ Check x-gtk-show-chooser-help-text before adding the help text.
+
+ * xfns.c (syms_of_xfns): New variable: x-gtk-show-chooser-help-text.
+
+ * gtkutil.c (get_utf8_string): Try harder to convert to UTF8. Gtk+
+ will simply crash if we fail.
+
+2006-09-16 Richard Stallman <[email protected]>
+
+ * regex.c (re_compile_pattern): Set gl_state.current_syntax_table.
+
+2006-09-15 Kim F. Storm <[email protected]>
+
+ * window.c (Fwindow_line_visibility): New defun for line-move-partial.
+ (syms_of_window): Defsubr it.
+ (Fwindow_end): Use window's buffer rather than current buffer.
+
+2006-09-15 Jay Belanger <[email protected]>
+
+ * COPYING: Replace "Library Public License" by "Lesser Public
+ License" throughout.
+
+2006-09-15 David Kastrup <[email protected]>
+
+ * Makefile.in (keymap.o): Add "keymap.h" and "window.h" dependencies.
+
+ * keymap.c: include "window.h".
+ (Fcommand_remapping): New optional POSITION argument.
+ (Fkey_binding): New optional POSITION argument. Completely rework
+ handling of mouse clicks to get the same order of keymaps as
+ `read-key-sequence' and heed POSITION. Also temporarily switch
+ buffers to location of mouse click and back.
+
+ * keyboard.c (command_loop_1): Adjust call of `Fcommand_remapping'
+ for additional argument.
+ (parse_menu_item): Adjust call of `Fkey_binding' for additional
+ argument.
+ (read_key_sequence): If there are both `local-map' and `keymap'
+ text properties at some buffer position, heed both.
+
+ * keymap.h: Declare additional optional arguments of
+ `Fcommand_remapping' and `Fkey_binding'.
+
+2006-09-15 Juanma Barranquero <[email protected]>
+
+ * indent.c (Fcurrent_column, Findent_to): Fix typos in docstring.
+
+2006-09-14 Andreas Schwab <[email protected]>
+
+ * print.c: Whitespace fixup.
+
+2006-09-14 Kim F. Storm <[email protected]>
+
+ * xdisp.c (produce_image_glyph): Automatically crop wide images at
+ right window edge so we can draw the cursor on the same row to
+ avoid confusing redisplay by placing the cursor outside the visible
+ window area.
+
+2006-09-13 YAMAMOTO Mitsuharu <[email protected]>
+
+ * xterm.c (x_initialize): Don't install Xt event timer here.
+ (x_timeout_atimer_activated_flag): New var.
+ (x_activate_timeout_atimer): New function to install Xt timer.
+ (x_send_scroll_bar_event, x_process_timeouts): Use it.
+
+ * xmenu.c (x_menu_set_in_use, popup_activate_callback)
+ (create_and_show_popup_menu, create_and_show_dialog): Use it.
+
+ * xterm.h (x_activate_timeout_atimer): Add prototype.
+
+2006-09-13 Richard Stallman <[email protected]>
+
+ * print.c (print_string): When printcharfun is t,
+ copy string contents and call strout on the copy.
+
+ * keyboard.c (read_char): If end_time specified, don't put the
+ event into this_command_keys.
+ (read_key_sequence): If Voverriding_terminal_local_map is specified,
+ don't check Voverriding_local_map at all.
+
+2006-09-12 Stefan Monnier <[email protected]>
+
+ * textprop.c (Fnext_property_change, Fnext_single_property_change)
+ (Fprevious_property_change, Fprevious_single_property_change):
+ Avoid changing limit, so we can correctly catch the case where the
+ property is constant up to limit.
+
+2006-09-12 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macfns.c (mac_window) [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]:
+ * macterm.c (XTread_socket) [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]:
+ Undo 2006-09-08 change.
+
+2006-09-11 Chong Yidong <[email protected]>
+
+ * keymap.c (Fkey_binding): Use string position for string objects.
+
+2006-09-11 Kim F. Storm <[email protected]>
+
+ * keymap.c (Fkey_binding): Fix last change.
+
+ * editfns.c (Fmessage): Recommend using (message "%s" ...).
+
+2006-09-10 Chong Yidong <[email protected]>
+
+ * keymap.c (Fkey_binding): Check for local keymap for mouse click
+ events.
+
+2006-09-10 Kim F. Storm <[email protected]>
+
+ * keyboard.c (Finput_pending_p): Check Vunread_input_method_events
+ and Vunread_post_input_method_events.
+
+ * dispnew.c (Fredisplay): Document return value.
+
+2006-09-10 Jan Dj,Ad(Brv <[email protected]>
+
+ * xfns.c (Fx_close_connection): Call xg_display_close when USE_GTK.
+
+ * gtkutil.c (xg_display_close): Always change default display if needed,
+ check for < Gtk+ version 2.10 before calling gdk_display_close.
+
+2006-09-10 YAMAMOTO Mitsuharu <[email protected]>
+
+ * mac.c [MAC_OSX] (sys_select): Check argument `nfds' more rigidly.
+ Make variable `ofds' static. Remove variable `maxfd'.
+
+ * macfns.c (Fx_file_dialog): Remove unused variable `f'.
+ Call check_mac.
+
+ * macmenu.c (Vmenu_updating_frame, syms_of_macmenu):
+ * w32menu.c (Vmenu_updating_frame, syms_of_w32menu):
+ Apply 2006-09-08 change for xmenu.c.
+
+ * xfns.c (Fx_file_dialog): Call check_x.
+
+2006-09-10 Kim F. Storm <[email protected]>
+
+ * xdisp.c (get_window_cursor_type): Use hollow cursor on
+ non-transparent images.
+
+2006-09-09 Eli Zaretskii <[email protected]>
+
+ * editfns.c (Fsystem_name): Mention "host" in the doc string.
+ (syms_of_editfns) <system-name>: Likewise.
+
+2006-09-08 Martin Rudalics <[email protected]>
+
+ * xdisp.c (mouse_autoselect_window): Remove.
+ (Vmouse_autoselect_window): New variable. DEFVAR_LISP it.
+
+ * dispextern.h (mouse_autoselect_window): Remove extern.
+ (Vmouse_autoselect_window): Add extern.
+
+ * macterm.c (XTread_socket): Test Vmouse_autoselect_window
+ instead of mouse_autoselect_window.
+
+ * msdos.c (dos_rawgetc): Likewise.
+
+ * w32term.c (w32_read_socket): Likewise.
+
+ * xterm.c (handle_one_xevent): Likewise.
+
+2006-09-08 Richard Stallman <[email protected]>
+
+ * xdisp.c (Vmenu_updating_frame): Define here.
+ (syms_of_xdisp): DEFVAR it here.
+ (update_menu_bar): Always return hooks_run.
+ Set Vmenu_updating_frame.
+
+ * xdisp.c (redisplay_internal): Test Vinhibit_redisplay
+ before calculating SELECTED_FRAME.
+
+ * xmenu.c (Vmenu_updating_frame): Don't define here.
+ (syms_of_xmenu): Don't DEFVAR it here.
+
+ * xterm.c (x_error_quitter): For BadName error, just return.
+
+ * eval.c (find_handler_clause): Give up on debugger if INPUT_BLOCKED_P.
+
+ * casetab.c (init_casetab_once): Call set_case_table.
+
+ * emacs.c (shut_down_emacs): Set inhibit_sentinels.
+
+ * process.c (inhibit_sentinels): New variable.
+ (exec_sentinel): Test inhibit_sentinels.
+ (init_process): Initialize it.
+
+ * process.h (inhibit_sentinels): Add decl.
+
+ * search.c (looking_at_1, string_match_1, search_command):
+ Make syntax table's canon table point to eqv table.
+
+2006-09-08 Andreas Schwab <[email protected]>
+
+ * print.c (strout): Fix whitespace.
+
+2006-09-08 Kim F. Storm <[email protected]>
+
+ * xterm.c (x_draw_glyph_string): Fix 2006-08-24 change.
+
+2006-09-08 YAMAMOTO Mitsuharu <[email protected]>
+
+ * mac.c [!MAC_OSX]: Don't include keyboard.h.
+ [!MAC_OSX] (select): Try detect_input_pending before ReceiveNextEvent
+ in the same BLOCK_INPUT block, in case that some input has already
+ been read asynchronously. Pretend to be interrupted by a signal
+ if some input is available.
+ [MAC_OSX] (select_and_poll_event, sys_select): Likewise.
+ (SELECT_POLLING_PERIOD_USEC) [SELECT_USE_CFSOCKET]: Change to 100000.
+ Now used for ReceiveNextEvent timeout instead of select timeout.
+ (EVENT_CLASS_SOCK) [SELECT_USE_CFSOCKET]: Remove macro.
+ [SELECT_USE_CFSOCKET] (socket_callback): Add non-blocking connect
+ support. Quit event loop.
+ [MAC_OSX] (sys_select) [SELECT_USE_CFSOCKET]: Add non-blocking
+ connect support. Reuse previously allocated CFRunLoopSource.
+ (Fmac_process_hi_command) [TARGET_API_MAC_CARBON]: New function.
+ (syms_of_mac) [TARGET_API_MAC_CARBON]: Defsubr it.
+
+ * macfns.c (mac_window) [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]:
+ Specify kWindowAsyncDragAttribute.
+
+ * macterm.c (mac_handle_origin_change, mac_handle_size_change)
+ (mac_get_ideal_size): New functions.
+ (x_set_offset, x_set_window_size, x_make_frame_visible)
+ (do_zoom_window, mac_handle_window_event, XTread_socket): Use them.
+ (install_window_handler, mac_handle_window_event)
+ [USE_CARBON_EVENTS]: Handle kEventWindowGetIdealSize and
+ kEventWindowBoundsChanged.
+ (XTread_socket) [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]: Don't call
+ DragWindow.
+
+2006-09-07 Andreas Schwab <[email protected]>
+
+ * m/ibms390x.h (START_FILES, LIB_STANDARD): Override to
+ use lib64 instead of lib.
+
+2006-09-06 Stefan Monnier <[email protected]>
+
+ * Makefile.in: Avoid double quotes when possible.
+
+2006-09-06 Kenichi Handa <[email protected]>
+
+ * editfns.c (Fformat_time_string): Use make_unibyte_string to make
+ a Lisp string from the result of emacs_memftimeu call.
+
+2006-09-06 Kim F. Storm <[email protected]>
+
+ * xdisp.c (pos_visible_p): Remove exact_mode_line_heights_p arg;
+ so calculate heights even when pos-visible-in-window-p is called
+ with partially = t. Don't overshoot last_visible_y in move_it_to.
+ Return row height and row number in new rowh and vpos args.
+ (cursor_row_fully_visible_p): First line is always "fully visible".
+ (try_window): Don't clear matrix if vscrolled.
+
+ * lisp.h (pos_visible_p): Update prototype.
+
+ * window.c (Fpos_visible_in_window_p): Adapt to new pos_visible_p.
+ Return row height and row number for partially visible rows.
+ Modify return value to a 2 element list for fully visible rows and
+ 6 for partially visible row.
+ (window_scroll_pixel_based): Use pos_visible_p directly instead of
+ Fpos_visible_in_window_p. Fix auto vscrolling for partially
+ visible lines. Only vscroll backwards if already vscrolled
+ forwards. Unconditionally vscroll forwards if PT is first (and
+ only) line. Set new window start instead of scrolling at
+ start/end of tall line.
+
+2006-09-05 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.c (install_window_handler, mac_handle_window_event)
+ [USE_CARBON_EVENTS]: Handle kEventWindowClose.
+ [USE_MAC_TSM] (mac_handle_text_input_event): Set modifiers for
+ ASCII keystroke event.
+
+2006-09-04 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c (xg_get_file_with_chooser): Don't mention specific keys in
+ the file chooser message. Only call gtk_file_chooser_set_current_name
+ when action is SAVE.
+
+2006-09-04 Andreas Schwab <[email protected]>
+
+ * Makefile.in: Double all single and back quotes in C-style
+ comments to help fontifier.
+
+2006-09-03 Jason Rumney <[email protected]>
+
+ * w32.c (shutdown_handler): New function to exit cleanly on shutdown.
+ (globals_of_w32): Register it as a signal handler.
+
+2006-09-02 Juri Linkov <[email protected]>
+
+ * marker.c (Fmarker_position): Doc fix.
+
+2006-09-03 Eli Zaretskii <[email protected]>
+
+ * window.c (syms_of_window) <split-height-threshold>:
+ <window-min-height, window-min-width>: Doc fix.
+
+2006-09-02 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c (xg_get_file_with_chooser): Change file chooser message
+ for writing files. Call gtk_file_chooser_set_current_name to keep
+ default filename.
+
+ * minibuf.c (Finternal_complete_buffer): Move after DEFUN:s it calls.
+
+2006-09-02 Jindrich Makovicka <[email protected]> (tiny change)
+
+ * fns.c (concat) [__GNUC__]: Declare with
+ `__attribute__((noinline))'.
+
+ * eval.c (apply1, call2) [__GNUC__]: Declare with
+ `__attribute__((noinline))'.
+
+2006-09-02 Stuart D. Herring <[email protected]>
+
+ * minibuf.c (Finternal_complete_buffer): New function.
+ (syms_of_minibuf): Defsubr it.
+ (Fread_buffer): Use it, instead of Vbuffer_alist.
+
+2006-09-01 Martin Rudalics <[email protected]>
+
+ * buffer.h (struct buffer_text): New field chars_modiff.
+ (CHARS_MODIFF, BUF_CHARS_MODIFF): New macros.
+ * buffer.c (Fbuffer_chars_modified_tick): New function returning
+ value of BUF_CHARS_MODIFF.
+ (syms_of_buffer): Defsubr it.
+ (Fget_buffer_create): Initialize BUF_CHARS_MODIFF.
+ * insdel.c (modify_region): New argument preserve_chars_modiff.
+ Set CHARS_MODIFF to MODIFF provided preserve_chars_modiff is zero.
+ (insert_1_both, insert_from_string_1, insert_from_buffer_1)
+ (adjust_after_replace, adjust_after_replace_noundo)
+ (replace_range, replace_range_2, del_range_2): Reset CHARS_MODIFF.
+ * lisp.h (modify_region): Add fourth argument in extern.
+ * casefiddle.c (casify_region): Call modify_region with fourth
+ argument zero to assert that CHARS_MODIFF is updated.
+ * editfns.c (Fsubst_char_in_region, Ftranslate_region_internal)
+ (Ftranspose_regions): Likewise.
+ * textprop.c (Fadd_text_properties, Fset_text_properties)
+ (Fremove_text_properties, Fremove_list_of_text_properties):
+ Call modify_region with fourth argument 1 to avoid that
+ CHARS_MODIFF is updated.
+
+2006-08-31 Richard Stallman <[email protected]>
+
+ * editfns.c (Fformat): Don't sign-extend for %o or %x.
+
+2006-08-29 Chong Yidong <[email protected]>
+
+ * indent.c (Fvertical_motion): Don't move back if we were
+ displaying a Lisp string, either.
+
+2006-08-28 Kim F. Storm <[email protected]>
+
+ * xdisp.c (get_window_cursor_type) [!HAVE_WINDOW_SYSTEM]:
+ Don't attempt to replace cursor on image glyphs.
+
+2006-08-28 Kenichi Handa <[email protected]>
+
+ * coding.c (Fdetect_coding_region, Fdetect_coding_string):
+ Fix docstring about ISO-2022 control characters.
+
+2006-08-28 Kim F. Storm <[email protected]>
+
+ * xdisp.c (get_window_cursor_type): Replace BOX cursor on images
+ with a hollow box cursor if image is larger than 32x32 (or the default
+ frame font if that is bigger). Replace any other cursor on images
+ with hollow box cursor, as redisplay doesn't support bar and hbar
+ cursors on images.
+
+2006-08-27 YAMAMOTO Mitsuharu <[email protected]>
+
+ * alloc.c (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Undo previous
+ change. Move mutex lock/unlock operations inside BLOCK_INPUT.
+
+ * dired.c (directory_files_internal_unwind, directory_files_internal)
+ (file_name_completion): Add BLOCK_INPUT around opendir/closedir.
+
+ * image.c [MAC_OS] (image_load_qt_1): Use ComponentResult instead
+ of OSErr.
+
+ * keyboard.c (in_sighandler): Remove variable.
+ (Fcurrent_idle_time): Add missing `doc:'.
+ (input_available_signal, init_keyboard): Undo previous change.
+
+ * keyboard.h (in_sighandler): Remove extern.
+
+ * mac.c (create_apple_event_from_event_ref, select)
+ (Fmac_get_file_creator, Fmac_get_file_type, Fmac_set_file_creator)
+ (Fmac_set_file_type, cfstring_create_normalized)
+ (mac_get_system_locale, select_and_poll_event, sys_select):
+ Use OSStatus instead of OSErr.
+
+ * macfns.c [TARGET_API_MAC_CARBON] (mac_update_proxy_icon):
+ Don't use FRAME_FILE_NAME. Use (FS)UpdateAlias.
+ (Fx_create_frame): Apply 2006-07-03 for xfns.c.
+
+ * macselect.c (get_scrap_from_symbol, clear_scrap, put_scrap_string)
+ (put_scrap_private_timestamp, scrap_has_target_type, get_scrap_string)
+ (get_scrap_private_timestamp, get_scrap_target_type_list)
+ (x_own_selection, x_get_foreign_selection)
+ (Fx_disown_selection_internal, Fx_selection_owner_p)
+ (Fx_selection_exists_p): Use OSStatus instead of OSErr.
+
+ * macterm.c (mac_draw_string_common, mac_query_char_extents)
+ (x_iconify_frame, XLoadQueryFont, install_window_handler)
+ (mac_handle_command_event, init_command_handler, init_menu_bar):
+ Use OSStatus instead of OSErr.
+ (x_free_frame_resources) [TARGET_API_MAC_CARBON]: Don't use
+ FRAME_FILE_NAME.
+ (x_query_font): Apply 2006-08-04 change for xterm.c.
+ (Qhi_command): Rename from Qhicommand. All uses changed.
+
+ * macterm.h (struct mac_output) [TARGET_API_MAC_CARBON]: Remove member
+ file_name.
+ (FRAME_FILE_NAME): Remove macro.
+ (install_window_handler, create_apple_event_from_event_ref):
+ Return OSStatus instead of OSErr.
+
+2006-08-26 Kim F. Storm <[email protected]>
+
+ * buffer.c (Fset_buffer_multibyte):
+ * editfns.c (Fcurrent_time, Fget_internal_run_time):
+ * macfns.c (Fxw_color_values):
+ * w32fns.c (Fxw_color_values):
+ * xfns.c (Fxw_color_values): Simplify; use list3.
+
+ * fileio.c (Fmake_directory_internal, Fdelete_directory)
+ (Fdelete_file): Simplify; use list1.
+ (Frename_file, Fadd_name_to_file, Fmake_symbolic_link):
+ Simplify; remove NO_ARG_ARRAY stuff, use list2.
+
+2006-08-25 Richard Stallman <[email protected]>
+
+ * buffer.c (Fswitch_to_buffer): Fix previous change.
+
+2006-08-25 Kim F. Storm <[email protected]>
+
+ * keyboard.c (Fcurrent_idle_time): Simplify.
+
+2006-08-25 Richard Stallman <[email protected]>
+
+ * fns.c (sxhash_string): Rotate properly; don't lose bits.
+
+2006-08-24 Francesc Rocher <[email protected]>
+
+ * xdisp.c (overline_margin): New variable.
+ (x_produce_glyphs): Use it.
+ (syms_of_xdisp): DEFVAR_INT it.
+
+ * xterm.c (x_underline_at_descent_line): New variable.
+ (syms_of_xterm): DEFVAR_BOOL it.
+ (x_draw_glyph_string): Use it.
+ Draw underline and overline up to the end of line if the face
+ extends to the end of line.
+
+ * macterm.c: Likewise.
+
+ * w32term.c: Likewise.
+
+2006-08-24 Nick Roberts <[email protected]>
+
+ * buffer.c (Fswitch_to_buffer): Move buffer to front of
+ buffer-alist if necessary.
+
+2006-08-22 Kim F. Storm <[email protected]>
+
+ * xdisp.c (update_tool_bar): Redisplay toolbar also when only
+ number of items changes.
+
+2006-08-22 Stefan Monnier <[email protected]>
+
+ * buffer.c (Fset_buffer_multibyte): Record proper undo entry.
+
+2006-08-21 Jan Dj,Ad(Brv <[email protected]>
+
+ * keyboard.c: Clarify difference between in_sighandler and
+ handling_signal.
+
+2006-08-21 Kim F. Storm <[email protected]>
+
+ * macterm.c (x_draw_stretch_glyph_string):
+ * w32term.c (x_draw_stretch_glyph_string):
+ * xterm.c (x_draw_stretch_glyph_string): It is ok to draw a
+ stretch glyph in left marginal areas on header and mode lines.
+
+2006-08-21 Kenichi Handa <[email protected]>
+
+ * keyboard.c (syms_of_keyboard): Docstring of
+ Vunread_post_input_method_events and Vunread_input_method_events
+ fixed.
+
+2006-08-20 Chong Yidong <[email protected]>
+
+ * keyboard.c (show_help_echo): Preserve mouse movement flag if
+ tracking mouse.
+
+2006-08-20 Richard Stallman <[email protected]>
+
+ * xfaces.c (load_pixmap): Add quotes in error message.
+
+ * keyboard.c (Fcurrent_idle_time): New function.
+ (syms_of_keyboard): defsubr it.
+
+2006-08-18 Nick Roberts <[email protected]>
+
+ * window.c (Fset_window_fringes): Do nothing on a tty.
+ (Fwindow_fringes): Put ? operator after the line break.
+
+2006-08-16 Andreas Schwab <[email protected]>
+
+ * print.c (debug_output_compilation_hack): Fix return type.
+
+2006-08-16 Richard Stallman <[email protected]>
+
+ * print.c (debug_output_compilation_hack): New function.
+
+2006-08-16 Kenichi Handa <[email protected]>
+
+ * fileio.c (choose_write_coding_system): Use LF for end-of-line
+ in auto-saving.
+
+2006-08-15 Chong Yidong <[email protected]>
+
+ * keyboard.c (read_char): Don't change idle timer state at all if
+ end_time is supplied.
+
+2006-08-15 Kenichi Handa <[email protected]>
+
+ * coding.c (ONE_MORE_BYTE_CHECK_MULTIBYTE): New arg RET. If SRC
+ is exhausted, return with RET.
+ (detect_coding_emacs_mule, detect_coding_iso2022)
+ (detect_coding_sjis, detect_coding_big5, detect_coding_utf_8)
+ (detect_coding_utf_16, detect_coding_ccl): Adjusted for the above
+ change.
+
+2006-08-14 Chong Yidong <[email protected]>
+
+ * keyboard.c (read_char): Don't reset idle timers if a time limit
+ is supplied.
+
+2006-08-14 Kim F. Storm <[email protected]>
+
+ * .gdbinit (pitx): Print iterator position.
+ Limit stack dump in case iterator is not initialized.
+
+2006-08-12 Eli Zaretskii <[email protected]>
+
+ * frame.c (Fmouse_position, Fmouse_pixel_position)
+ (Fset_mouse_position, Fset_mouse_pixel_position): Doc fix.
+
+2006-08-11 Jan Dj,Ad(Brv <[email protected]>
+
+ * xselect.c (Fx_register_dnd_atom): New function.
+ (syms_of_xselect): Defsubr it.
+ (x_handle_dnd_message): Check that message_type is in
+ dpyinfo->x_dnd_atoms before generating lisp event.
+
+ * xterm.h (struct x_display_info): Add x_dnd_atoms* to keep track
+ of drag and drop Atoms.
+
+ * xterm.c (x_term_init): Initialize dpyinfo->x_dnd_atoms*.
+
+2006-08-10 Jan Dj,Ad(Brv <[email protected]>
+
+ * keyboard.c: Define in_sighandler.
+ (input_available_signal): Set in_sighandler.
+ (init_keyboard): Initialize in_sighandler.
+
+ * keyboard.h: Declare in_sighandler.
+
+ * alloc.c (UNBLOCK_INPUT_ALLOC, BLOCK_INPUT_ALLOC): Use in_sighandler
+ to check if mutex should be locked or not.
+
+2006-08-09 Richard Stallman <[email protected]>
+
+ * keyboard.c (keyremap_step): No-op if fkey->parent = nil.
+ (read_key_sequence): Always start fkey.start and fkey.end at 0,
+ and likewise for keytran.
+
+2006-08-09 Kenichi Handa <[email protected]>
+
+ * coding.c (syms_of_coding): Improve the docstring
+ of file-coding-system-alist.
+
+2006-08-07 Andreas Schwab <[email protected]>
+
+ * puresize.h (BASE_PURESIZE): Increase to 1120000.
+
+2006-08-06 Chong Yidong <[email protected]>
+
+ * buffer.c (Vchange_major_mode_hook, Qchange_major_mode_hook): New vars.
+ (Fkill_all_local_variables): Use it.
+ (syms_of_buffer): Defvar it.
+
+2006-08-05 Eli Zaretskii <[email protected]>
+
+ * w32.c (w32_valid_pointer_p): New function.
+
+ * w32.h: Add prototype for w32_valid_pointer_p.
+
+ * alloc.c: Include w32.h.
+ (valid_lisp_object_p) [WINDOWSNT]: Call w32_valid_pointer_p to do
+ the job.
+
+ * keyboard.c (kbd_buffer_get_event): Return Qnil when current time
+ is exactly equal to end_time, not only when it is past that.
+
+2006-08-04 Chong Yidong <[email protected]>
+
+ * keyboard.c (read_char): Rebalance specpdl after receiving jump.
+
+ * process.c: Reapply 2006-08-01 change.
+
+2006-08-04 Eli Zaretskii <[email protected]>
+
+ * w32fns.c (w32_query_font): Fix last change: use stricmp.
+
+2006-08-04 Stefan Monnier <[email protected]>
+
+ * editfns.c (Fsubst_char_in_region): Redo the setup work after running
+ the before-change-functions since they may have altered the buffer.
+
+2006-08-04 Ralf Angeli <[email protected]>
+
+ * w32fns.c (w32_createwindow): Handle -geometry command line option
+ and the geometry settings in the Registry.
+
+2006-08-04 Kenichi Handa <[email protected]>
+
+ * w32fns.c (w32_query_font): Compare names by ignoring case.
+
+ * xterm.c (x_query_font): Compare names by ignoring case.
+
+2006-08-03 Jason Rumney <[email protected]>
+
+ * w32menu.c (w32_menu_show, w32_dialog_show): Call Fsignal to quit
+ when no option selected.
+
+2006-08-03 Chong Yidong <[email protected]>
+
+ * process.c: Revert last change.
+
+2006-08-01 Kim F. Storm <[email protected]>
+
+ * process.c (wait_reading_process_output_unwind): New function.
+ Restores waiting_for_user_input_p to saved value.
+ (wait_reading_process_output): Unwind protect waiting_for_user_input_p
+ instead of save/restore old value on stack.
+
+2006-07-30 Thien-Thi Nguyen <[email protected]>
+
+ * editfns.c: Undo 2006-06-27 change.
+
+2006-07-29 Eli Zaretskii <[email protected]>
+
+ * coding.c (Ffind_operation_coding_system): Revert the change from
+ 2006-05-29.
+
+ * alloc.c [WINDOWSNT]: Include fcntl.h, to fix last change.
+
+2006-07-28 Richard Stallman <[email protected]>
+
+ * xfaces.c (lookup_named_face, Fdisplay_supports_face_attributes_p):
+ Add conditional aborts for clarity.
+
+ * xdisp.c (update_menu_bar): New arg HOOKS_RUN. Callers changed.
+ Used to avoid running the hooks over and over for each frame.
+ (prepare_menu_bars): Pass value from update_menu_bar
+ as HOOKS_RUN of next call.
+
+ * keyboard.c (safe_run_hooks_1): Don't crash if Vrun_hooks is nil.
+
+2006-07-28 Kim F. Storm <[email protected]>
+
+ * alloc.c (valid_pointer_p): New function (from valid_lisp_object_p).
+ (valid_lisp_object_p): Use it to check for valid SUBRP obj.
+
+2006-07-26 Chong Yidong <[email protected]>
+
+ * keyboard.c (read_char): New arg END_TIME specifying timeout.
+ All callers changed. Turn off echoing if END_TIME is non-NULL.
+ (kbd_buffer_get_event): New arg END_TIME.
+
+ * lread.c (read_filtered_event): New arg SECONDS to wait until.
+ (Fread_char, Fread_event, Fread_char_exclusive): New arg SECONDS.
+
+ * lisp.h: Update read-char, read-event, and read_filtered_event
+ prototypes.
+
+ * keyboard.h: Include systime.h. Update read_char prototype.
+
+2006-07-25 YAMAMOTO Mitsuharu <[email protected]>
+
+ * alloc.c (find_string_data_in_pure): New function.
+ (make_pure_string): Use it to reuse existing string data if possible.
+
+ * puresize.h (BASE_PURESIZE): Decrease to 1102000.
+
+2006-07-22 Stefan Monnier <[email protected]>
+
+ * keymap.c (Fdefine_key): If the key binding definition looks like an
+ XEmacs-style key sequence, convert it to Emacs's format.
+
+2006-07-22 Ralf Angeli <[email protected]>
+
+ * w32fns.c (w32_createwindow): If `left' and/or `top' frame
+ parameters are bound to some values, use that instead of
+ CW_USEDEFAULT.
+
+2006-07-21 Eli Zaretskii <[email protected]>
+
+ * w32.c (convert_time): Use explicit long double constants to
+ ensure long double arithmetics is used throughout.
+
+2006-07-20 YAMAMOTO Mitsuharu <[email protected]>
+
+ * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp): New vars.
+ (init_alloc_once): Initialize them.
+ (pure_alloc): Allocate non-Lisp objects from the end of pure storage
+ without alignment.
+
+ * puresize.h (BASE_PURESIZE): Decrease to 1141000.
+
+2006-07-18 Francis Litterio <[email protected]>
+
+ * w32term.c (x_calc_absolute_position): Fix frame positioning
+ with negative X/Y coordinates.
+
+2006-07-18 Dan Nicolaescu <[email protected]>
+
+ * xterm.c (x_connection_closed, x_error_quitter): Mark as NO_RETURN.
+
+ * textprop.c (text_read_only): Likewise.
+
+ * lread.c (end_of_file_error): Likewise.
+
+ * lisp.h (circular_list_error, memory_full, buffer_memory_full):
+ Likewise.
+
+ * eval.c (unwind_to_catch): Likewise.
+
+ * buffer.h (buffer_slot_type_mismatch): Likewise.
+
+2006-07-18 Kim F. Storm <[email protected]>
+
+ Cleanup Fsignal calls that never returns; now only use it for Qquit.
+
+ * eval.c (xsignal): New func. Like Fsignal, but marked no-return.
+ (xsignal0, xsignal1, xsignal2, xsignal3): New no-return functions.
+ (signal_error): New no-return function (from xfaces.c).
+ (Fthrow): Use xsignal2 instead of Fsignal + abort.
+ (error): Use xsignal1 instead of Fsignal + abort.
+ (FletX, Flet, grow_specpdl): Use signal_error.
+ (Feval, Ffuncall, funcall_lambda): Use xsignal1, xsignal2.
+
+ * alloc.c (buffer_memory_full, memory_full): Use xsignal. Remove loop.
+ (list1): New function.
+
+ * lisp.h (list1): Add EXFUN.
+ (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error):
+ Add prototypes. Mark them as no-return.
+
+ * buffer.c (Fbuffer_local_value, Fbarf_if_buffer_read_only):
+ Use xsignal1.
+
+ * callint.c (check_mark): Use xsignal0.
+
+ * casefiddle.c (casify_object): wrong_type_argument is no-return.
+
+ * cmds.c (Fforward_char, Fdelete_char): Use xsignal0.
+
+ * coding.c (Fcheck_coding_system): Use xsignal1. Remove loop.
+ (Fdefine_coding_system_internal): Use xsignal1.
+
+ * data.c (circular_list_error): Use xsignal.
+ (wrong_type_argument): Use xsignal2. Don't care about return value.
+ (args_out_of_range, args_out_of_range_3): Use xsignal2, xsignal3.
+ Remove loop around Fsignal.
+ (indirect_variable, Fsymbol_value, set_internal, Fdefault_value)
+ (indirect_function, Findirect_function, Fstring_to_number)
+ (Fmakunbound, Ffmakunbound, Fsymbol_function, Ffset): Use xsignal1.
+ (arith_driver, float_arith_driver, Frem, Fmod, arith_error):
+ Use xsignal0.
+
+ * doc.c (Fdocumentation): Use xsignal1.
+
+ * editfns.c (region_limit, Fget_internal_run_time): Use xsignal0.
+
+ * fileio.c (report_file_error): Use xsignal.
+ (barf_or_query_if_file_exists, Fcopy_file, Fdelete_file)
+ (Finsert_file_contents): Use xsignal2.
+ (syms_of_fileio): Use list2, list3.
+
+ * floatfns.c (arith_error, range_error, domain_error): Use xsignal2.
+ (range_error2, domain_error2): Use xsignal3.
+ (rounding_driver, fmod_float): Use xsignal0.
+ (float_error): Use xsignal1.
+ (matherr): Use xsignal.
+
+ * fns.c (Flength): wrong_type_argument is no-return.
+ (hashfn_user_defined, Fmake_hash_table): Use signal_error.
+ (Fmd5): Use xsignal1.
+
+ * frame.c (x_set_line_spacing, x_set_screen_gamma): Use signal_error.
+
+ * keyboard.c (recursive_edit_1): Use xsignal1.
+
+ * keymap.c (Fmap_keymap): Use xsignal1.
+
+ * lread.c (Fload): Use xsignal2, signal_error.
+ (end_of_file_error): Use xsignal0, xsignal1.
+ (read0): Use xsignal1.
+ (invalid_syntax): New error function marked no-return.
+ (read_integer, read1, read_list): Use it.
+
+ * macselect.c (x_get_local_selection): Use signal_error.
+
+ * msdos.c (Fmsdos_set_mouse_buttons): Use xsignal2.
+
+ * search.c (compile_pattern_1): Use xsignal1.
+ (signal_failure): Remove (was only called once).
+ (search_command): Use xsignal1 instead of signal_failure.
+
+ * syntax.c (scan_lists): Use xsignal3.
+
+ * textprop.c (text_read_only): Use xsignal0, xsignal1.
+
+ * unexsol.c (unexec): Use xsignal.
+
+ * window.c (window_scroll_pixel_based, window_scroll_line_based):
+ Use xsignal0.
+
+ * xfaces.c (signal_error): Move to eval.c.
+ (resolve_face_name): Use xsignal1.
+
+ * xfns.c (x_decode_color): Use signal_error.
+
+ * xselect.c (x_get_local_selection, copy_multiple_data)
+ (x_get_window_property_as_lisp_data)
+ (lisp_data_to_selection_data, CHECK_CUT_BUFFER)
+ (Fx_get_cut_buffer_internal): Use signal_error.
+
+2006-07-18 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.c (XTread_socket): Undo previous change.
+
+2006-07-18 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.c (keycode_to_xkeysym): Remove function. All uses now
+ directly lookup keycode_to_xkeysym_table.
+ [USE_MAC_TSM] (mac_handle_text_input_event): Don't construct
+ ASCII_KEYSTROKE_EVENT for non-zero keycode_to_xkeysym_table entries.
+ (XTread_socket): Use character codes to construct keypad key events.
+ (mac_initialize_display_info) [MAC_OSX]: Use CGDisplaySamplesPerPixel.
+ (x_delete_display): Apply 2006-07-04 change for xterm.c.
+
+2006-07-17 Richard Stallman <[email protected]>
+
+ * keyboard.c (Vcommand_error_function): New variable.
+ (syms_of_keyboard): Defvar it.
+ (cmd_error_internal): Simplify, and handle Vcommand_error_function.
+
+ * dispnew.c (init_display): Mention DISPLAY as well as TERM in err msg.
+
+2006-07-17 Kim F. Storm <[email protected]>
+
+ * xdisp.c (handle_single_display_spec): Ensure the right value of
+ it->position is saved by push_it.
+ (pop_it): Restore it->object for GET_FROM_BUFFER and GET_FROM_STRING.
+ (reseat_1): Don't setup it->object twice.
+ (set_iterator_to_next): No need to set it->object after pop_it.
+ (move_it_to): Explicitly check to see if last move reached to_charpos.
+
+2006-07-17 Thien-Thi Nguyen <[email protected]>
+
+ * xdisp.c (display_mode_line): Preserve match data.
+
+2006-07-14 Kim F. Storm <[email protected]>
+
+ * w32.c (pfn_WSACreateEvent, pfn_WSACloseEvent): New func ptrs.
+ (init_winsock): Load them. Use ws2_32.dll.
+ (sys_listen): Undo last change. Just set FILE_LISTEN flag.
+ (sys_accept): Undo last change. Instead, set child status to
+ STATUS_READ_ACKNOWLEDGED and reset char_avail event so next
+ sys_select will wakeup the reader thread.
+ (_sys_wait_accept): New function used by reader thread to wait for
+ an incoming connection on a server socket.
+
+ * w32.h (_sys_read_ahead, _sys_wait_accept): Add prototypes.
+
+ * w32proc.c (reader_thread): Use _sys_wait_accept to wait on a
+ server socket (FILE_LISTEN flag).
+
+2006-07-14 Jan Dj,Ad(Brv <[email protected]>
+
+ * sound.c (alsa_init): Call snd_pcm_close after successful snd_pcm_open.
+
+2006-07-14 Kim F. Storm <[email protected]>
+
+ * w32.c: Fix high cpu load for server sockets.
+ (pfn_WSAEventSelect): New function ptr.
+ (init_winsock): Load it.
+ (sys_listen): Set FILE_LISTEN flag. Set event mask for socket's
+ char_avail event object to FD_ACCEPT.
+ (sys_accept): Check FILE_LISTEN flag. Set event mask on new
+ socket's char_avail event object to FD_READ|FD_CLOSE.
+
+ * w32.h (FILE_LISTEN): New filedesc flag value.
+
+2006-07-13 Kim F. Storm <[email protected]>
+
+ * bytecode.c (Fbyte_code): Use CAR, CDR for Bcar, Bcdr.
+ Use CAR_SAFE, CDR_SAFE for Bcar_safe, Bcdr_safe.
+ Simplify loops and use CAR for Bnth and Belt.
+
+ * data.c (Findirect_function): Optimize for no indirection.
+
+ * eval.c (Fthrow): Remove loop around Fsignal.
+ (Feval, Fapply, Ffuncall): Optimize for no function indirection.
+ Use original function name in all signaled errors.
+ Simplify Fsignal calls (no return).
+ (funcall_lambda): Simplify Fsignal calls (no return).
+
+2006-07-13 Andreas Schwab <[email protected]>
+
+ * syntax.c (scan_sexps_forward): Use EMACS_INT for out_bytepos and
+ out_charpos.
+
+2006-07-13 Kenichi Handa <[email protected]>
+
+ * editfns.c (Fformat): Fix calculation of text property positions
+ of format string.
+
+2006-07-12 Kim F. Storm <[email protected]>
+
+ * lisp.h (CHECK_TYPE): New macro for generic type checking.
+ (CAR_SAFE, CDR_SAFE): New macros.
+ (ARRAYP, CHECK_ARRAY): New macros.
+ (CHECK_VECTOR_OR_STRING, CHECK_SUBR): New macros.
+ (CHECK_WINDOW_CONFIGURATION): New macro.
+ (CHECK_LIST_CONS, CHECK_LIST_END): New checks for list traversal.
+ (CHECK_STRING_OR_BUFFER, CHECK_HASH_TABLE, CHECK_LIST)
+ (CHECK_STRING, CHECK_STRING_CAR, CHECK_CONS, CHECK_SYMBOL)
+ (CHECK_CHAR_TABLE, CHECK_VECTOR, CHECK_VECTOR_OR_CHAR_TABLE)
+ (CHECK_BUFFER, CHECK_WINDOW, CHECK_LIVE_WINDOW, CHECK_PROCESS)
+ (CHECK_NUMBER, CHECK_NATNUM, CHECK_MARKER, CHECK_OVERLAY)
+ (CHECK_NUMBER_COERCE_MARKER, CHECK_FLOAT, CHECK_NUMBER_OR_FLOAT)
+ (CHECK_NUMBER_OR_FLOAT_COERCE_MARKER): Use CHECK_TYPE.
+
+ * category.h (CHECK_CATEGORY, CHECK_CATEGORY_SET):
+ * frame.h (CHECK_FRAME, CHECK_LIVE_FRAME): Use CHECK_TYPE.
+
+ * callint.c (Fcall_interactively):
+ * casefiddle.c (casify_object):
+ * editfns.c (general_insert_function):
+ * fns.c (Flength, Felt, Ffillarray):
+ * data.c (Fcar, Fcdr): Remove loop around wrong_type_argument.
+
+ * data.c (wrong_type_argument): Remove loop around Fsignal.
+ (Farrayp, Fsequencep): Use ARRAYP.
+ (Fcar): Use CAR.
+ (Fcar_safe): Use CAR_SAFE.
+ (Fcdr): Use CDR.
+ (Fcdr_safe): Use CDR_SAFE.
+ (Fsetcar, Fsetcdr): Use CHECK_CONS.
+ (Fsubr_arity, Fsubr_name): Use CHECK_SUBR.
+ (Faset): Use CHECK_ARRAY.
+
+ * fns.c (Felt): Use CHECK_ARRAY.
+ (concat): Use CHECK_NUMBER.
+ (Fsubstring, substring_both): Use CHECK_VECTOR_OR_STRING.
+ (Fmemq): Use CHECK_LIST.
+ (Fassq, Fassoc, Frassq, Frassoc): Use CAR.
+ (assq_no_quit): Use CAR_SAFE.
+ (Fnthcdr, Fmember, Fdelq, Fdelete, Fnreverse, Fnconc):
+ Use CHECK_LIST_CONS.
+ (Freverse, Fplist_get, Flax_plist_get): Use CHECK_LIST_END.
+
+ * bytecode.c (Fbyte_code): Use CHECK_VECTOR.
+
+ * casetab.c (check_case_table):
+ * category.c (check_category_table):
+ * marker.c (Fcopy_marker):
+ * syntax.c (check_syntax_table):
+ * xfaces.c (load_pixmap): Use CHECK_TYPE.
+
+ * fns.c (Fcopy_sequence, concat):
+ * fringe.c (Fdefine_fringe_bitmap):
+ * lread.c (check_obarray): Cleanup wrong_type_argument use.
+
+ * keyboard.c (access_keymap_keyremap): Use ARRAYP.
+
+ * keymap.c (Fdefine_key, Flookup_key):
+ * macros.c (Fstart_kbd_macro): Use CHECK_VECTOR_OR_STRING.
+
+ * mac.c (Fmac_get_preference): Use CHECK_LIST_END.
+
+ * search.c (Fset_match_data): Use CHECK_LIST.
+
+ * sunfns.c (sun_item_create): Use CHECK_LIST_CONS.
+
+ * window.c (Fwindow_configuration_frame, Fset_window_configuration):
+ (compare_window_configurations): Use CHECK_WINDOW_CONFIGURATION.
+
+2006-07-12 YAMAMOTO Mitsuharu <[email protected]>
+
+ * Makefile.in (dired.o, editfns.o, fileio.o): Depend on blockinput.h.
+
+ * dired.c: Include blockinput.h.
+ (Ffile_attributes): Add BLOCK_INPUT around getpwuid/getgrgid.
+
+ * editfns.c: Include blockinput.h.
+ (Fuser_login_name, Fuser_full_name): Add BLOCK_INPUT around
+ getpwuid/getpwnam.
+
+ * fileio.c: Include blockinput.h.
+ (Fexpand_file_name, search_embedded_absfilename): Add BLOCK_INPUT
+ around getpwnam.
+ (search_embedded_absfilename): Remove spurious xfree.
+
+2006-07-11 Kim F. Storm <[email protected]>
+
+ * dispnew.c (sit_for): Reduce number of args from 5 to 3.
+ Now just one TIMEOUT arg that can be a Lisp float or Lisp int.
+ Combine args DISPLAY and INITIAL_DISPLAY into one arg DO_DISPLAY.
+ Signal error if TIMEOUT is not a number.
+ Undo 2006-06-14 change for non-preemptive display if TIMEOUT < 0.
+ The rework of sit_for args also fixes several incorrect Qt args
+ which should have been 1.
+ (Fredisplay): Pass 1 instead of Qt to swallow_events and
+ detect_input_pending_run_timers.
+
+ * lisp.h (sit_for): Update prototype.
+ (Fredisplay): Add EXFUN.
+
+ * dispextern.h (sit_for): Remove prototype.
+
+ * callint.c (Fcall_interactively):
+ * minibuf.c (temp_echo_area_glyphs):
+ * keyboard.c (command_loop_1, read_char, Fexecute_extended_command):
+ * fileio.c (Fdo_auto_save): Update/simplify sit_for calls.
+
+2006-07-11 Stefan Monnier <[email protected]>
+
+ * syntax.c (forw_comment): Also use EMACS_INT for buffer positions.
+
+2006-07-11 Kim F. Storm <[email protected]>
+
+ * dispnew.c (Fredisplay): Add FORCE argument to force redisplay when
+ input is available. Fix test for redisplay_dont_pause non-nil.
+ Specbind redisplay-dont-pause to t if FORCE non-nil.
+
+2006-07-10 Chong Yidong <[email protected]>
+
+ * puresize.h (BASE_PURESIZE): Increment to 1211000.
+
+ * dispnew.c (Fredisplay): New function, equivalent to (sit-for 0).
+ (Fsit_for): Function deleted.
+
+ * keyboard.c (command_loop_1, Fexecute_extended_command):
+ Call sit_for instead of Fsit_for.
+
+ * minibuf.c (temp_echo_area_glyphs): Likewise.
+
+2006-07-09 Stefan Monnier <[email protected]>
+
+ * syntax.c (Fforward_comment): Revert the reversion.
+ (back_comment, scan_lists): Also use EMACS_INT for buffer positions.
+
+2006-07-09 John Paul Wallington <[email protected]>
+
+ * syntax.c (Fforward_comment): Revert previous change.
+
+2006-07-09 Kim F. Storm <[email protected]>
+
+ * window.c (Fforce_window_update): Doc fix.
+
+2006-07-08 Stephen Gildea <[email protected]>
+
+ * fileio.c (do_auto_save_make_dir): Make the auto-save-list-file
+ directory unreadable for better user privacy.
+
+2006-07-07 Stefan Monnier <[email protected]>
+
+ * syntax.c (Fforward_comment): Fix int-32 vs EMACS_INT-64 mixup.
+
+ * lread.c (read_filtered_event): Remove `register' qualifier because it
+ causes compilation problem with gcc-4.0.2-20051125 on amd64.
+ (readevalloop): Remove unused var `bpos'.
+ Yet another int/Lisp_Object mixup (YAILOM).
+
+2006-07-07 Eli Zaretskii <[email protected]>
+
+ * keyboard.c (Fexecute_extended_command): Mention the argument
+ PREFIXARG in the doc string.
+
+2006-07-07 Kim F. Storm <[email protected]>
+
+ * fringe.c (Fdefine_fringe_bitmap): Doc fix.
+
+2006-07-05 Chong Yidong <[email protected]>
+
+ * insdel.c (prepare_to_modify_buffer): For an indirect buffer, do
+ clash detection using the base buffer.
+
+ * puresize.h (BASE_PURESIZE): Increment to 1210500.
+
+2006-07-04 Kim F. Storm <[email protected]>
+
+ * xterm.c (x_delete_display): Don't free or derefence NULL pointers.
+
+2006-07-04 Kenichi Handa <[email protected]>
+
+ * fontset.c (Fset_overriding_fontspec_internal): Check if we need
+ to update Voverriding_fontspec_alist.
+
+2006-07-03 Richard Stallman <[email protected]>
+
+ * xfns.c (Fx_create_frame): Move unwind_create_frame setup down.
+
+ * xfaces.c (Fface_attribute_relative_p): Doc fix.
+
+ * textprop.c (Fget_char_property_and_overlay): Doc fix.
+
+ * eval.c (Fdefvaralias): Doc fix.
+
+2006-07-03 Kim F. Storm <[email protected]>
+
+ * dispnew.c (sit_for): Fix preempt condition.
+
+2006-07-02 Stefan Monnier <[email protected]>
+
+ * lread.c (read_filtered_event): Treat select-window just like
+ switch-frame.
+
+2006-07-02 Kim F. Storm <[email protected]>
+
+ * xdisp.c (display_tool_bar_line): Skip glyphs which are too big
+ to ever fit the tool-bar,
+ (MAX_FRAME_TOOL_BAR_HEIGHT): New macro.
+ (tool_bar_lines_needed): Use unused mode-line row as temp_row.
+ (redisplay_tool_bar): Only clear desired matrix if we actually
+ change the tool-bar window height. Only try to make the tool-bar
+ window bigger if there is actually room for it.
+
+2006-06-30 Ralf Angeli <[email protected]>
+
+ * w32term.c (x_make_frame_visible): Use SystemParametersInfo with
+ SPI_GETWORKAREA to find the dimensions of the screen work area,
+ and adjust vertical position of the frame in order to avoid being
+ covered by the task bar.
+
+ * w32fns.c (w32_createwindow): Use CW_USEDEFAULT instead of
+ f->left_pos and SH_SHOW instead of f->top_pos in the call to
+ CreateWindow. Record the actual position in f->left_pos and
+ f->top_pos.
+
+2006-06-30 John Paul Wallington <[email protected]>
+
+ * w32console.c (syms_of_ntterm) <w32-use-full-screen-buffer>:
+ Doc fix - default value has changed.
+
+2006-06-28 YAMAMOTO Mitsuharu <[email protected]>
+
+ * mac.c [!TARGET_API_MAC_CARBON]: Don't include FixMath.h or Scrap.h.
+
+ * macfns.c (Fx_create_frame): Apply 2006-06-24 change for xfns.c.
+
+ * macgui.h (USE_MAC_TSM) [TARGET_API_MAC_CARBON]: Set default to 1.
+
+ * macterm.c (Qeql): Add extern.
+ (x_set_mouse_pixel_position) [MAC_OSX]: Use CGWarpMouseCursorPosition.
+ (fm_style_face_attributes_alist) [USE_ATSUI]: New variable.
+ (syms_of_macterm) [USE_ATSUI]: Initialize and staticpro it.
+ Change keys of Vmac_atsu_font_table from strings to numbers.
+ (fm_style_to_face_attributes) [USE_ATSUI]: New function.
+ (init_font_name_table) [USE_ATSUI]: Use it.
+ (saved_ts_script_language_on_focus) [USE_MAC_TSM]: New variable.
+ (syms_of_macterm) [USE_MAC_TSM]: Initialize and staticpro it.
+ [USE_MAC_TSM] (mac_tsm_resume): Restore script and language codes
+ only when saved_ts_script_language_on_focus coincides with
+ Vmac_ts_script_language_on_focus.
+ [USE_MAC_TSM] (mac_tsm_suspend): Save value of
+ Vmac_ts_script_language_on_focus to saved_ts_script_language_on_focus.
+ (XTread_socket) [USE_MAC_TSM]: Add Mac OS Classic support.
+ [USE_MAC_TSM] (mac_handle_text_input_event, init_tsm): Likewise.
+
+2006-06-27 Chong Yidong <[email protected]>
+
+ * editfns.c (Fdelete_field, Ffield_string, Ffield_beginning)
+ (Ffield_string_no_properties, Ffield_end): Mention
+ args-out-of-range error condition in docstring.
+
+2006-06-27 Kim F. Storm <[email protected]>
+
+ * xdisp.c (handle_composition_prop): Set stop_charpos before push_it.
+
+2006-06-25 Kim F. Storm <[email protected]>
+
+ * s/gnu-linux.h (SIGNALS_VIA_CHARACTERS): Define for Linux kernel
+ version 2.4 and later.
+
+2006-06-24 Chong Yidong <[email protected]>
+
+ * xfns.c (Fx_create_frame): Set font parameter directly instead of
+ using x_default_parameter, since x_get_args clears the parm alist.
+
+2006-06-24 Eli Zaretskii <[email protected]>
+
+ * dired.c (directory_files_internal) [WINDOWSNT]: Find files
+ case-insensitively.
+
+2006-06-24 Aidan Kehoe <[email protected]>
+
+ * lread.c (read_escape): When an unknown Unicode code point is
+ encountered as a string or character escape, signal an error.
+
+2006-06-23 Kim F. Storm <[email protected]>
+
+ * .gdbinit (pitx): Dump iterator stack.
+
+ * xdisp.c (handle_composition_prop): Push iterator on stack.
+ (set_iterator_to_next): Pop iterator at end of composition.
+
+2006-06-23 Martin Rudalics <[email protected]>
+
+ * fileio.c (Frename_file) [DOS_NT]: Don't try to move directory to
+ itself on DOS_NT platforms, if the old and new names are identical
+ but for the letter-case.
+
+2006-06-21 Kim F. Storm <[email protected]>
+
+ * dispextern.h (struct it): Add `position' member to iterator stack.
+ Rename `pos' member to `current'. Rearrange and add comments.
+
+ * xdisp.c (handle_stop): Set it->ignore_overlay_strings_at_pos_p
+ if we get any overlays.
+ (set_cursor_from_row): Don't clobber `end' if we rescan from
+ start_string.
+ (push_it, pop_it): Save it->position.
+
+2006-06-19 Richard Stallman <[email protected]>
+
+ * window.c (size_window): New arg FIRST_ONLY. All callers changed.
+ (adjust_window_trailing_edge): Specially compute FIRST_PARALLEL
+ for the case of a top-level window and the following minibuffer.
+ Don't exit because of no `next' when there is a parent.
+ Use the FIRST_ONLY feature when resizing following windows.
+
+ * syntax.c (init_syntax_once): Give most control chars' syntax Spunct.
+
+2006-06-17 Kim F. Storm <[email protected]>
+
+ * dispnew.c (update_frame): Check for input pending on entry.
+ (update_window, update_frame_1): Break loop if input is detected.
+
+2006-06-16 Francis Litterio <[email protected]>
+
+ * xterm.c (x_check_expected_move, handle_one_xevent)
+ (x_set_offset, x_check_fullscreen): Extensive changes to make
+ frame positioning deterministic under X.
+
+ * xterm.h (x_output): Add members left_before_move and
+ top_before_move. Removed members expected_left and expected_top.
+
+2006-06-16 Kim F. Storm <[email protected]>
+
+ * dispextern.h (struct it): Add union to iterator stack to save
+ image, composition, and stretch specific paramters.
+
+ * xdisp.c (next_overlay_string): Fix assert.
+ (push_it, pop_it): Handle composition and stretch specific values.
+ Only handle it->slice in image (for now).
+ (back_to_previous_visible_line_start): Continue search if newline is
+ part of a compisition. Simplify.
+ (reseat_1): Set it->object to buffer.
+ (set_iterator_to_next): Set it->object to string or buffer, when
+ setting it->method to GET_FROM_STRING or GET_FROM_BUFFER.
+ (next_element_from_composition): Set it->object to buffer if not
+ from string.
+ (set_cursor_from_row): Only save start of string if not already
+ done to handle multiple strings in a row.
+
+ * .gdbinit (pitx): Show composition parameters.
+ (pgx, pg): New commands to print a glyph structure.
+ (pgi, pgn): New commands to print specific/next glyph.
+ (pgrowx, pgrow): New commands to print all glyphs in a row.
+
+2006-06-16 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macfns.c (Fx_display_mm_height, Fx_display_mm_width)
+ [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]: Use CGDisplayScreenSize.
+
+ * macterm.c (do_app_resume, do_app_suspend): Remove functions.
+ (mac_tsm_resume, mac_tsm_suspend) [USE_MAC_TSM]: New functions.
+ (mac_handle_window_event, XTread_socket) [USE_MAC_TSM]: Use them.
+ (Vmac_ts_script_language_on_focus) [USE_MAC_TSM]: New variable.
+ (syms_of_macterm) [USE_MAC_TSM]: Defvar it.
+ (saved_ts_language, saved_ts_component) [USE_MAC_TSM]: New variables.
+ (mac_initialize_display_info) [MAC_OSX]: Use Quartz Display
+ Services functions to get size of main display in pixels.
+
+2006-06-14 Chong Yidong <[email protected]>
+
+ * xdisp.c (back_to_previous_visible_line_start):
+ Reset it->continuation_lines_width.
+
+2006-06-14 Richard Stallman <[email protected]>
+
+ * eval.c (Fdefconst): Mark variable as risky.
+
+ * callproc.c (Fcall_process): Doc fix.
+
+ * window.c (adjust_window_trailing_edge): Don't break out of the loop
+ because there's no next window, if there are parallel windows.
+ Do break out when WINDOW is nil.
+
+2006-06-14 Kim F. Storm <[email protected]>
+
+ * dispextern.h (IT_STACK_SIZE): New macro specifying size of
+ iterator stack (instead of hardcoded number). Increase from 2 to
+ 4 to make room for propertized overlay strings before and after a
+ display string, image or composition.
+ (struct it): Add image_id and method members to iterator stack.
+
+ * xdisp.c (init_from_display_pos): Don't set it->method and
+ overlay_string_index after pop_it. Add asserts.
+ (handle_stop): Look for overlay strings around a display string,
+ image, or composition. Handle properties on those strings.
+ (next_overlay_string): Don't set string, pos or method after pop_it.
+ (get_overlay_strings_1): Split from get_overlay_strings; don't
+ modify it if no overlay strings are found.
+ (get_overlay_strings): Use get_overlay_strings_1. Always set
+ it->string and it->method.
+ (push_it): Push it->image_id and it->method. Push it->object
+ instead of it->string if method is GET_FROM_IMAGE.
+ (pop_it): Pop it->image_id and it->method. Ppo it->object
+ instead of it->string if method is GET_FROM_IMAGE.
+ Reset it->current.string_pos if popped it->string is nil.
+ (reseat_1): Remove comment dated 19 May 2003. It expressed doubt
+ whether a given change was correct; but the change is correct.
+ Clear it->string_from_display_prop_p.
+ (set_iterator_to_next): Rely on it->method and it->image_id from
+ iterator stack, instead of setting them explicitly after pop_it.
+
+ * dispnew.c (sit_for): Undo 2006-06-01 change. Instead, a
+ negative time forces redisplay even when input is available.
+ (Fsit_for): Doc fix.
+
+2006-06-13 Kim F. Storm <[email protected]>
+
+ * dispnew.c: Modify preemptive redisplay to be based on periodic
+ checks for input.
+ (PERIODIC_PREEMPTION_CHECKING): Define to 1 iff EMACS_HAS_USECS.
+ (Vredisplay_preemption_period): New variable.
+ (syms_of_display): DEFVAR_LISP and initialize it.
+ (preemption_period, preemption_next_check): New variables.
+ (update_frame, update_single_window): Initialize them based on
+ Vredisplay_preemption_period if !force_p.
+ (update_window, update_frame_1): Use them to determine when to
+ check for input.
+
+2006-06-03 Aidan Kehoe <[email protected]>
+
+ * lread.c (read_escape): Provide a Unicode character escape
+ syntax; \u followed by exactly four or \U followed by exactly
+ eight hex digits in a comment or string is read as a Unicode
+ character with that code point.
+
+2006-06-09 Eli Zaretskii <[email protected]>
+
+ * window.c (window_scroll_pixel_based): Signal "Beginning of
+ buffer" when scroll-down at the beginning of an empty buffer.
+
+2006-06-06 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.c [USE_MAC_TSM] (mac_handle_text_input_event):
+ Exclude 0x7f from ASCII range.
+
+2006-06-05 Jason Rumney <[email protected]>
+
+ * w32term.c (w32_set_scroll_bar_thumb, x_scroll_bar_create)
+ (w32_set_vertical_scroll_bar, w32_scroll_bar_handle_click)
+ (x_scroll_bar_report_motion): Remove workarounds for
+ versions of Windows NT < 3.51.
+ [!SIF_ALL]: Remove.
+ (pfnSetScrollInfo, pfnGetScrollInfo): Remove.
+ (w32_initialize): Don't dynamically load Get/SetScrollInfo.
+
+2006-06-04 David Kastrup <[email protected]>
+
+ * dispnew.c: Mention `redisplay-dont-pause' in doc string of
+ `sit-for'.
+
+2006-06-03 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macfns.c (x_set_icon_name): Apply 2006-06-02 change for xfns.c.
+
+ * macgui.h (USE_MAC_TSM): Set default to 1 on Mac OS X.
+
+ * macterm.c (tsm_document_id) [USE_MAC_TSM]: New variable.
+ (Qtext_input, Qupdate_active_input_area, Qunicode_for_key_event)
+ [USE_MAC_TSM]: Likewise.
+ (syms_of_macterm) [USE_MAC_TSM]: Intern and staticpro them.
+ (Qbefore_string) [USE_MAC_TSM]: Add extern.
+ (do_app_resume, do_app_suspend) [USE_MAC_TSM]: Call
+ ActivateTSMDocument/DeactivateTSMDocument.
+ (mac_store_event_ref_as_apple_event): Call mac_post_mouse_moved_event.
+ (mac_handle_window_event) [USE_MAC_TSM]: Handle
+ kEventWindowFocusAcquired/kEventWindowFocusRelinquish.
+ (mac_handle_text_input_event) [USE_MAC_TSM]: New function.
+ (install_window_handler) [USE_MAC_TSM]: Install it. Register
+ kEventWindowFocusAcquired/kEventWindowFocusRelinquish.
+ (keycode_to_xkeysym_table): Add entry for f16.
+ (XTread_socket) [USE_MAC_TSM]: Set/reset read_socket_inev
+ before/after passing keystroke event to toolbox dispatcher.
+ (init_tsm) [USE_MAC_TSM]: New function.
+ (mac_initialize) [USE_MAC_TSM]: Call it.
+ (Vmac_ts_active_input_overlay) [USE_MAC_TSM]: New defvar.
+
+ * macterm.h (EVENT_PARAM_TEXT_INPUT_SEQUENCE_NUMBER): New enumerator.
+
+2006-06-02 John Paul Wallington <[email protected]>
+
+ * xfns.c (x_set_name_internal): Set icon to `text', derived from
+ name, when frame's icon_name isn't a string rather than only when
+ it is nil.
+
+2006-06-03 Eli Zaretskii <[email protected]>
+
+ * w32fns.c (x_set_icon_name): Don't use arg if it's not a string
+ and not nil.
+
+2006-06-02 Chong Yidong <[email protected]>
+
+ * xfns.c (x_set_icon_name): No-op if arg is non-nil and not a
+ string.
+
+2006-06-02 YAMAMOTO Mitsuharu <[email protected]>
+
+ * xdisp.c (next_element_from_composition): Set it->object to
+ it->string if composition is coming from string.
+ (set_cursor_from_row): Don't return 0 unless row displays a
+ continued line.
+ (dump_glyph): Dump composite glyph.
+
+2006-06-02 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c (menu_nav_ended): Check that menubar_widget is not NULL.
+
+2006-06-01 Richard Stallman <[email protected]>
+
+ * window.c (Fsplit_window): Doc fix.
+
+2006-06-01 Micha,Ak(Bl Cadilhac <[email protected]>
+
+ * process.c (deleted_pid_list): New variable to store the pids
+ of deleted processes. Declare it only if SIGCHLD is defined.
+ (init_process): Initialize it.
+ (syms_of_process): Staticpro it.
+ (Fdelete_process): Add pid of the deleted process to it. Check after
+ the addition and before the kill if the process is already stopped,
+ in which case it is deleted from the list and not killed.
+ (sigchld_handler): Define it only if SIGCHLD is. Search the process
+ that signaled Emacs in `deleted_pid_list' before `Vprocess_alist'.
+ Original idea by Stefan Monnier.
+
+2006-06-01 Kim F. Storm <[email protected]>
+
+ * dispnew.c (sit_for): Perform redisplay even if input is pending
+ when redisplay-dont-pause is non-nil.
+
+2006-06-01 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.c (mac_handle_visibility_change): Set buf.arg to Qnil.
+ (XTread_socket): Remove obsolete comment.
+
+2006-06-01 Jan Dj,Ad(Brv <[email protected]>
+
+ * xmenu.c (syms_of_xmenu): Make accelerate-menu an alias for
+ menu-bar-open.
+
+2006-06-01 Jan Dj,Ad(Brv <[email protected]>
+
+ * xmenu.c (Fmenu_bar_open, syms_of_xmenu): Change menu-bar-start to
+ menu-bar-open.
+
+ * gtkutil.c (menu_nav_ended): Change x-menu-bar-start to menu-bar-open.
+
+2006-05-31 Juri Linkov <[email protected]>
+
+ * minibuf.c (Vhistory_add_new_input): New variable.
+ (read_minibuf): Use it.
+ (syms_of_minibuf) <history-add-new-input>: New Lisp variable.
+ (syms_of_minibuf) <history-delete-duplicates>: Doc fix.
+
+2006-05-31 Kim F. Storm <[email protected]>
+
+ * process.c (select_wrapper): Add wrapper around select to work around
+ "incomplete backtrace" bug in gdb 5.3, when emacs is stopped inside
+ select called from wait_reading_process_output.
+
+2006-05-30 Andreas Schwab <[email protected]>
+
+ * xmenu.c (Fmenu_bar_start): Return a value.
+
+2006-05-30 Richard Stallman <[email protected]>
+
+ * coding.c (Ffind_operation_coding_system): Doc fix.
+
+2006-05-30 Eli Zaretskii <[email protected]>
+
+ * w32term.c (x_draw_hollow_cursor): Fix last change.
+
+2006-05-29 Kim F. Storm <[email protected]>
+
+ * w32term.c (x_draw_stretch_glyph_string): Fix last change.
+
+2006-05-29 Eli Zaretskii <[email protected]>
+
+ * coding.c (Ffind_operation_coding_system): Doc fix.
+
+2006-05-29 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macfns.c [USE_MAC_FONT_PANEL] (Fmac_set_font_panel_visibility):
+ Call mac_set_font_info_for_selection if font panel is made visible.
+
+ * macterm.c (font_panel_shown_p) [USE_MAC_FONT_PANEL]: New variable.
+ (mac_font_panel_visible_p, mac_show_hide_font_panel)
+ [USE_MAC_FONT_PANEL]: New functions.
+ [USE_MAC_FONT_PANEL] (mac_set_font_info_for_selection):
+ Return immediately if font panel is not visible.
+
+ * macterm.h (mac_font_panel_visible_p, mac_show_hide_font_panel):
+ Add externs.
+
+2006-05-29 Dan Nicolaescu <[email protected]>
+
+ * search.c (matcher_overflow): Mark as NO_RETURN.
+
+ * xterm.c (x_connection_closed): Likewise.
+
+ * sysdep.c (croak): Likewise.
+
+ * sound.c (sound_perror, alsa_sound_perror): Likewise.
+
+ * lisp.h (die, nsberror): Likewise.
+
+2006-05-29 Jan Dj,Ad(Brv <[email protected]>
+
+ * sound.c (alsa_open, alsa_configure, alsa_write):
+ Move assignment to err out of if-statement.
+
+ * gtkutil.c (menu_nav_ended): New function.
+ (create_menus): Connect menu_nav_ended to "selection-done" to fix
+ grabs.
+
+ * xmenu.c (Fmenu_bar_start): New function for USE_GTK and USE_X_TOOLKIT.
+
+2006-05-28 Dan Nicolaescu <[email protected]>
+
+ * charset.h (invalid_character): Mark as NO_RETURN.
+
+2006-05-29 Kenichi Handa <[email protected]>
+
+ * coding.c (Ffind_operation_coding_system): Call a function by
+ safe_call1 instead of call1.
+
+2006-05-28 Stefan Monnier <[email protected]>
+
+ * window.c (struct saved_window): Add `dedicated'.
+ (Fset_window_configuration, save_window_save): Save/restore the
+ `dedicated' flag.
+
+2006-05-28 Kim F. Storm <[email protected]>
+
+ * xdisp.c (set_cursor_from_row): If cursor cannot be set in row,
+ don't update w->cursor and return 0. Return 1 on success.
+ (try_cursor_movement): Repeat set_cursor_from_row on successive rows
+ until it succeeds.
+
+ * dispextern.h (set_cursor_from_row): Update prototype.
+
+2006-05-28 Kim F. Storm <[email protected]>
+
+ * xdisp.c (get_phys_cursor_geometry): Return computed x and y through
+ parameters. Adjust x and width in case cursor in on a partially
+ visible stretch glyph on the left edge.
+ (erase_phys_cursor): Don't erase into left fringe/margin in case
+ previous cursor glyph is a partially visible stretch glyph on left.
+
+ * dispextern.h (get_phys_cursor_geometry): Update prototype.
+
+ * xterm.c (x_draw_stretch_glyph_string): Fix problems with invisible
+ cursor and erasing cursor on partially visible stretch glyph on left.
+ (x_draw_hollow_cursor): Compute x via get_phys_cursor_geometry.
+
+ * macterm.c: Likewise.
+
+ * w32term.c: Likewise.
+
+2006-05-27 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macselect.c (mac_handle_apple_event):
+ Return errAEEventNotHandled if key binding is not found.
+
+2006-05-26 Eli Zaretskii <[email protected]>
+
+ * emacs.c (main) [PROFILING]: Enable also for __MINGW32__.
+ [__MINGW32__]: MinGW-specific declaration of `etext'.
+
+ * w32heap.c (etext, edata): Remove unused definitions.
+
+2006-05-26 Chong Yidong <[email protected]>
+
+ * fileio.c (Fcopy_file): Delete argument MUSTBENEW.
+ Incorporate the exclusive file-opening functionality into the behavior
+ when OK-IF-ALREADY-EXISTS is nil.
+ (Frename_file): Call Fcopy_file without MUSTBENEW argument.
+
+2006-05-26 Jan Dj,Ad(Brv <[email protected]>
+
+ * sound.c (alsa_configure): Move get period/buffer_size after
+ setting hwparams.
+
+2006-05-26 Kenichi Handa <[email protected]>
+
+ * coding.c (Ffind_operation_coding_system): Allow (FILENAME
+ . BUFFER) in TARGET.
+
+2006-05-25 Chong Yidong <[email protected]>
+
+ * image.c (png_load): Don't call fclose on NULL.
+
+2006-05-25 Luc Teirlinck <[email protected]>
+
+ * fns.c (Fyes_or_no_p):
+ * callint.c (Fcall_interactively): Fread_from_minibuffer now takes
+ only seven args.
+
+2006-05-25 Juri Linkov <[email protected]>
+
+ * lisp.h (Fread_from_minibuffer): Decrement number of args.
+
+ * minibuf.c (read_minibuf): Remove arg KEEP_ALL. Callers changed.
+ (Fread_from_minibuffer): Remove arg KEEP_ALL. Callers changed.
+
+ * buffer.c (mode-line-format): Fix docstring.
+
+2006-05-25 Richard Stallman <[email protected]>
+
+ * emacs.c (main, Fdump_emacs): Don't test __linux or __linux__.
+
+2006-05-24 Luc Teirlinck <[email protected]>
+
+ * puresize.h (BASE_PURESIZE): Increase to 1210000.
+
+2006-05-24 Alan Mackenzie <[email protected]>
+
+ * lread.c (Vload_history): Enhance doc-string to say that the file
+ is the absolute truename of the loaded file.
+
+ * lread.c (Vafter_load_alist): doc-string: state that an element
+ now has a regexp to match file names, not a file name as such.
+
+ * lread.c (readevalloop): Call file-truename on the name for
+ load-history, except at preloading time.
+
+ * lread.c (Fload): At preloading time, preserve the extension of
+ the filename which goes into load-history. New var hist_file_name.
+
+ * lread.c (Fload): Do eval-after-load stuff by calling the lisp
+ function do-after-load-evaluation.
+
+2006-05-24 YAMAMOTO Mitsuharu <[email protected]>
+
+ * mac.c (ae_attr_table): New variable.
+ (syms_of_mac): Intern and staticpro its elements.
+ (mac_aelist_to_lisp): Also convert Apple event attributes.
+ (mac_ae_put_lisp): New function.
+ (create_apple_event_from_event_ref) [MAC_OSX]: Use typeUTF8Text.
+
+ * macfns.c (Fx_server_version): Use gestaltSystemVersionMajor etc.
+
+ * macselect.c (Qemacs_suspension_id): New variable.
+ (syms_of_macselect): Intern and staticpro it.
+ (struct suspended_ae_info): New struct.
+ (deferred_apple_events, defer_apple_events)
+ (Fmac_process_deferred_apple_events): Use it.
+ (suspended_apple_events): New variable.
+ (mac_handle_apple_event_1): New function.
+ (mac_handle_apple_event): Use it. Don't process previously
+ suspended events.
+ (cleanup_suspended_apple_events, get_suspension_id)
+ (cleanup_all_suspended_apple_events): New functions.
+ (init_apple_event_handler): Call cleanup_all_suspended_apple_events
+ at exit.
+ (Fmac_cleanup_expired_apple_events, Fmac_ae_set_reply_parameter)
+ (Fmac_resume_apple_event): New defuns.
+ (syms_of_macselect): Defsubr them.
+
+ * macterm.c (fn_keycode_to_keycode_table, XTread_socket) [MAC_OSX]:
+ Fix last change. Don't map `fn' modifier if pressed with F1 ... F12.
+
+ * macterm.h (TYPE_FILE_NAME): Change from macro to enumerator.
+ (KEY_EMACS_SUSPENSION_ID_ATTR): New enumerator.
+ (keyReplyRequestedAttr) [MAC_OS_X_VERSION_MAX_ALLOWED < 1030]: Likewise.
+ (gestaltSystemVersionMajor, gestaltSystemVersionMinor)
+ (gestaltSystemVersionBugFix) [MAC_OS_X_VERSION_MAX_ALLOWED < 1040]:
+ Likewise.
+ (typeUTF8Text, kEventParamWindowMouseLocation)
+ [MAC_OSX && MAC_OS_X_VERSION_MAX_ALLOWED < 1020]: Likewise.
+ (x_get_focus_frame, mac_ae_put_lisp): Add externs.
+
+2006-05-23 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.c (fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
+ (fn_keycode_to_keycode_table) [MAC_OSX]: New variable.
+ (mac_set_unicode_keystroke_event) [TARGET_API_MAC_CARBON]: New function.
+ (XTread_socket) [TARGET_API_MAC_CARBON]: Use it.
+ (XTread_socket) [MAC_OSX]: Try 'uchr' Unicode keyboard-layout
+ resource to backtranslate key with modifiers.
+ (XTread_socket): Don't set read_socket_inev around AEProcessAppleEvent.
+
+2006-05-23 Jan Dj,Ad(Brv <[email protected]>
+
+ * xterm.c: Remove declarations already in xterm.h.
+
+ * xterm.h: Add extern declarations for x_clear_errors,
+ x_fully_uncatch_errors, x_catching_errors and
+ x_alloc_lighter_color_for_widget. Remove duplicated declarations.
+
+2006-05-21 Richard Stallman <[email protected]>
+
+ * xfaces.c (best_matching_font): Abort for best == NULL
+ before we start to use it.
+
+ * buffer.c (syms_of_buffer, Fmake_overlay): Doc fixes.
+
+2006-05-20 Kim F. Storm <[email protected]>
+
+ * xfaces.c (best_matching_font): Fix crash in 2006-05-17 change.
+
+2006-05-20 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.c (convert_fn_keycode): Fix last change.
+
+2006-05-19 Eli Zaretskii <[email protected]>
+
+ * w32.c (init_environment): Perform the processing of environment
+ variables on a copy of default variables and their values, not on
+ the original. Simplify code that calls ExpandEnvironmentStrings
+ and make buf1[] and buf2[] more visible for easier debugging.
+
+2006-05-19 YAMAMOTO Mitsuharu <[email protected]>
+
+ * frame.c (x_set_border_width): Remove #ifndef MAC_OS.
+
+ * image.c [MAC_OS] (gif_load): Allocate Lisp string first.
+
+ * macfns.c (Fx_focus_frame): Don't check dpyinfo->x_focus_frame.
+
+ * macterm.c (XTread_socket) [TARGET_API_MAC_CARBON && MAC_OSX]:
+ Forward keyUp events to toolbox_dispatcher.
+
+ * window.c (foreach_window): Check WINDOWP (FRAME_ROOT_WINDOW (f)).
+
+2006-05-18 Jan Dj,Ad(Brv <[email protected]>
+
+ * config.in: Regenerated (HAVE_ALSA).
+
+ * sound.c (alsa_sound_perror, alsa_open, alsa_period_size)
+ (alsa_configure, alsa_close, alsa_choose_format, alsa_write)
+ (snd_error_quiet, alsa_init): New functions.
+ (vox_init): Return 0 if unable to open device.
+ (Fplay_sound_internal): Test for alsa first and use vox (oss) as
+ a fallback.
+ (struct sound_device): Add period_size.
+ (wav_play, au_play): Use period_size if set.
+
+ * Makefile.in (CFLAGS_SOUND): New flags for ALSA.
+ (ALL_CFLAGS): Add CFLAGS_SOUND.
+
+2006-05-18 Kenichi Handa <[email protected]>
+
+ * callproc.c (Fcall_process): Reject encoding arguments by
+ ascii-incompatible coding systems (e.g. utf-16).
+
+ * coding.c (Qascii_incompatible): New variable.
+ (syms_of_coding): Setup Qascii_incompatible.
+ (setup_coding_system): Be sure to initialize coding->common_flags.
+ Check `ascii-incompatible' property of the coding system.
+
+ * coding.h (CODING_ASCII_INCOMPATIBLE_MASK): New macro.
+
+2006-05-18 Kim F. Storm <[email protected]>
+
+ * xdisp.c (display_tool_bar_line): Restore entire tool-bar
+ geometry when backtracking in case last image doesn't fit on line.
+
+2006-05-18 MIYOSHI Masanori <[email protected]> (tiny change)
+
+ * xdisp.c (display_tool_bar_line): Don't adjust tool-bar height by
+ more than height of one frame default line.
+
+2006-05-17 Richard Stallman <[email protected]>
+
+ * xfaces.c (better_font_p): Any font beats no font.
+ (best_matching_font): Simplify based on above change.
+
+ * buffer.c (Fprevious_overlay_change, Fnext_overlay_change): Doc fixes.
+
+2006-05-16 Kim F. Storm <[email protected]>
+
+ * xterm.c (handle_one_xevent): Check that f is not NULL before
+ calling x_kill_gs_process.
+
+2006-05-14 Richard Stallman <[email protected]>
+
+ * textprop.c (Fnext_single_char_property_change)
+ (Fprevious_single_char_property_change): Don't allow returning
+ value beyond LIMIT in any cases.
+ (Fnext_char_property_change, Fprevious_char_property_change): Doc fix.
+
+ * intervals.c (get_local_map): Abort if POSITION outside BEGV, ZV.
+
+2006-05-14 Jan Dj,Ad(Brv <[email protected]>
+
+ * xterm.c (handle_one_xevent): Check that f is not NULL before
+ calling _XEditResCheckMessages.
+
+2006-05-14 Kim F. Storm <[email protected]>
+
+ * xterm.c (handle_one_xevent): Fix crash in 2006-03-24 change.
+
+2006-05-13 Eli Zaretskii <[email protected]>
+
+ * frame.c (x_set_border_width): Fix error message to say "frame",
+ not "window".
+
+ * Makefile.in (SOME_MACHINE_LISP): Add fringe.elc.
+
+2006-05-12 Chong Yidong <[email protected]>
+
+ * intervals.c (set_point_both): Fix mixup before before and after
+ in variable names.
+
+ * editfns.c (Fline_beginning_position): Inhibit point-motion hooks
+ while setting point temporarily.
+
+2006-05-11 Richard Stallman <[email protected]>
+
+ * lread.c (readevalloop): Abort if START non-nil for non-buffer input.
+
+2006-05-11 Kim F. Storm <[email protected]>
+
+ * xdisp.c (redisplay_tool_bar): Handle large tool-bar-border values.
+
+2006-05-11 Kenichi Handa <[email protected]>
+
+ * fileio.c (Finsert_file_contents): Fix for the case of IO error
+ while handling replace operation.
+
+2006-05-10 Kenichi Handa <[email protected]>
+
+ * xfaces.c (realize_default_face) [HAVE_X_WINDOWS]: If the font
+ chosen for the default face was different from the frame font,
+ adjust the frame font.
+
+2006-05-10 YAMAMOTO Mitsuharu <[email protected]>
+
+ * image.c (Qduration) [MAC_OS]: Undo previous change.
+ (syms_of_image) [MAC_OS]: Likewise.
+ [MAC_OS] (gif_load): Emulate Graphic Control Extension block.
+
+ * macfns.c (x_to_mac_color): Fix shift amount change.
+ (mac_set_font) [USE_MAC_FONT_PANEL]: Use x_get_focus_frame.
+ [USE_MAC_FONT_PANEL] (Fmac_set_font_panel_visibility): Doc fix.
+
+ * macselect.c (Vmac_service_selection) [MAC_OSX]: Rename from
+ Vmac_services_selection. All uses changed.
+ (mac_store_service_event): Rename from mac_store_services_event in
+ extern and calls.
+
+ * macterm.c (Qservice) [MAC_OSX]: Rename from Qservices. All uses
+ changed.
+ [MAC_OSX] (mac_store_service_event): Rename from
+ mac_store_services_event. All callers changed.
+ [USE_MAC_FONT_PANEL] (mac_set_font_info_for_selection): Add args
+ FACE_ID and C. All callers changed.
+ (x_free_frame_resources) [USE_MAC_FONT_PANEL]: Call
+ mac_set_font_info_for_selection when focus frame is destroyed.
+ (XTread_socket): Revert to FrontNonFloatingWindow/FrontWindow.
+
+ * macterm.h (mac_set_font_info_for_selection): Add 2nd and 3rd
+ args in extern.
+
+2006-05-09 Chong Yidong <[email protected]>
+
+ * keymap.c (describe_map): Avoid generating duplicate entries if
+ the shadowed binding has the same definition.
+
+2006-05-09 Kenichi Handa <[email protected]>
+
+ * keymap.c (push_key_description): Handle invalid character key.
+
+2006-05-08 Kenichi Handa <[email protected]>
+
+ * callproc.c (Fcall_process): Use system_eol_type for encoding
+ arguments if eol_type is not yet decided.
+
+ * coding.h (system_eol_type): Extern it.
+
+ * coding.c (setup_coding_system): For invalid coding-system, set
+ coding->eol_type to CODING_EOL_UNDECIDED.
+ (encode_coding): Cancel previous change.
+ (shrink_encoding_region): Likewise.
+ (code_convert_region1): Likewise.
+ (code_convert_string1): Likewise.
+ (code_convert_string_norecord): Likewise.
+
+ * fileio.c (choose_write_coding_system): Use system_eol_type for
+ encoding if eol_type is not yet decided.
+
+ * process.c (setup_process_coding_systems): Use system_eol_type
+ for encoding if eol_type is not yet decided.
+ (read_process_output): Likewise.
+ (send_process): Likewise.
+
+2006-05-07 Juanma Barranquero <[email protected]>
+
+ * minibuf.c (syms_of_minibuf) <history-length>: Fix typo in doc.
+
+2006-05-07 YAMAMOTO Mitsuharu <[email protected]>
+
+ * mac.c (Fmac_clear_font_name_table): Move defun to macfns.c.
+ (syms_of_mac): Likewise for defsubr.
+
+ * macfns.c (mac_set_font): New function.
+ (mac_frame_parm_handlers, syms_of_macfns): Replace x_set_font with it.
+ (mac_window) [TARGET_API_MAC_CARBON && MAC_OSX]: Specify
+ kWindowToolbarButtonAttribute when creating window.
+ (Fmac_clear_font_name_table): Move from macfns.c.
+ (syms_of_macfns): Likewise for defsubr.
+ [USE_MAC_FONT_PANEL] (Fmac_set_font_panel_visibility): New defun.
+ (syms_of_macfns) [USE_MAC_FONT_PANEL]: Defsubr it.
+
+ * macgui.h (USE_MAC_FONT_PANEL): Define to 1 if USE_ATSUI is set
+ and build is done on Mac OS X 10.2 and later.
+
+ * macselect.c (mac_do_receive_drag): Remove unused variable `index'.
+ (mac_store_services_event): Change return type in extern.
+
+ * macterm.c (XLoadQueryFont) [USE_ATSUI]: Set font->mac_fontnum to
+ FMFontFamily value.
+ [USE_MAC_FONT_PANEL] (mac_set_font_info_for_selection): New function.
+ (x_new_focus_frame) [USE_MAC_FONT_PANEL]: Use it.
+ (QCfamily, QCweight, QCslant, Qnormal, Qbold, Qitalic): Add extern.
+ (QWindow) [MAC_OSX]: Likewise.
+ (Qfont) [USE_MAC_FONT_PANEL]: Likewise.
+ (Vmac_atsu_font_table) [USE_ATSUI]: New variable.
+ (syms_of_macterm) [USE_ATSUI]: Defvar it.
+ (Qtoolbar_switch_mode) [MAC_OSX]: New variable.
+ (Qpanel_closed, Qselection) [USE_MAC_FONT_PANEL]: Likewise.
+ (syms_of_macterm): Intern and staticpro them.
+ (init_font_name_table) [USE_ATSUI]: Add data to Vmac_atsu_font_table.
+ [TARGET_API_MAC_CARBON] (mac_store_event_ref_as_apple_event):
+ New function.
+ [USE_CARBON_EVENTS] (mac_handle_command_event): Use it.
+ [MAC_OSX] (mac_store_services_event): Likewise.
+ [USE_CARBON_EVENTS] (mac_handle_window_event) [MAC_OSX]: Handle
+ kEventWindowToolbarSwitchMode event.
+ (install_window_handler) [USE_CARBON_EVENTS && MAC_OSX]: Register it.
+ [MAC_OSX] (mac_store_services_event): Change return type to OSStatus.
+ [USE_MAC_FONT_PANEL] (mac_handle_font_event): New function.
+ (install_window_handler) [USE_MAC_FONT_PANEL]: Install it.
+ (XTread_socket): Select window on mouse click if x_focus_frame is NULL.
+
+ * macterm.h (mac_set_font_info_for_selection): Add extern.
+
+2006-05-06 YAMAMOTO Mitsuharu <[email protected]>
+
+ * image.c (Qduration) [MAC_OS]: New variable.
+ (syms_of_image) [MAC_OS]: Intern and staticpro it.
+ [MAC_OS] (gif_load): Save image extension data in img->data.lisp_val.
+ [MAC_OSX] (image_load_quartz2d): Use cfstring_create_with_utf8_cstring
+ instead of cfstring_create_with_string.
+
+2006-05-06 Kim F. Storm <[email protected]>
+
+ * .gdbinit (xframe): Print frame name.
+ (xlist): New command to print a list (max 10 elements).
+ (xpr): Print lisp object of any type.
+ (pitx): Print it->pixel_width.
+
+2006-05-05 Kenichi Handa <[email protected]>
+
+ * xdisp.c (handle_composition_prop): Fix for the case of empty
+ composition component.
+
+2006-05-05 YAMAMOTO Mitsuharu <[email protected]>
+
+ * keyboard.c (make_lispy_event) [MAC_OS]: Get Apple event info
+ from event->arg.
+
+ * termhooks.h (enum event_kind) [MAC_OS]: Update comment for
+ MAC_APPLE_EVENT.
+
+ * macterm.h (mac_make_lispy_event_code): Remove extern.
+ (mac_post_mouse_moved_event): Add extern.
+ (mac_aelist_to_lisp, mac_aedesc_to_lisp): Change arg 1 to
+ `const AEDesc *' in externs.
+ (create_apple_event_from_drag_ref) [TARGET_API_MAC_CARBON]: New extern.
+
+ * mac.c (mac_aelist_to_lisp, mac_aedesc_to_lisp): Change arg 1 to
+ `const AEDesc *'.
+ [TARGET_API_MAC_CARBON] (create_apple_event): New function.
+ [TARGET_API_MAC_CARBON] (create_apple_event_from_event_ref): Use it.
+ Use xrealloc instead of repeated xmalloc/xfree.
+ [TARGET_API_MAC_CARBON] (create_apple_event_from_drag_ref):
+ New function.
+
+ * macmenu.c (restore_menu_items, cleanup_popup_menu): Return a value.
+
+ * macselect.c: Update copyright year.
+ (mac_store_apple_event): Change return type to void in extern.
+ (mac_handle_apple_event): Don't get return value from
+ mac_store_apple_event.
+ [TARGET_API_MAC_CARBON] (Vmac_dnd_known_types): New variable.
+ (syms_of_macselect) [TARGET_API_MAC_CARBON]: Defvar it.
+ [TARGET_API_MAC_CARBON] (mac_do_track_drag): Move function from
+ macterm.c. Use Vmac_dnd_known_types as acceptable flavors.
+ [TARGET_API_MAC_CARBON] (mac_do_receive_drag): Likewise. New
+ implementation using create_apple_event_from_drag_ref.
+ [TARGET_API_MAC_CARBON] (mac_do_track_dragUPP)
+ (mac_do_receive_dragUPP): Move variables from macterm.c.
+ (install_drag_handler, remove_drag_handler): New functions.
+
+ * macterm.c (XTread_socket) [TARGET_API_MAC_CARBON]: Try window
+ path select also for proxy icon click.
+ [TARGET_API_MAC_CARBON] (mac_post_mouse_moved_event): New function.
+ [USE_TOOLKIT_SCROLL_BARS] (scroll_bar_timer_callback): Use it.
+ (xlfdpat_create): Remove unused label `error' and trailing sentences.
+ (mac_do_track_drag, mac_do_receive_drag): Move functions to macselect.c.
+ (mac_do_track_dragUPP, mac_do_receive_dragUPP): Move variables to
+ macselect.c.
+ (install_drag_handler, remove_drag_handler): Add extern.
+ (mac_store_apple_event): Change return type to void. All uses changed.
+ Create Lisp object from Apple event and store it into input event.
+ (mac_make_lispy_event_code): Remove function.
+ [TARGET_API_MAC_CARBON] (mac_store_drag_event): New function.
+ (install_window_handler): Call install_drag_handler.
+ (remove_window_handler): Call remove_drag_handler.
+
+2006-05-03 Richard Stallman <[email protected]>
+
+ * sound.c (Fplay_sound_internal): Dynamically allocate
+ current_sound_device and current_sound.
+ (sound_cleanup): Free them.
+
+ * minibuf.c (read_minibuf): Don't use read_minibuf_noninteractive
+ when inside a keyboard macro.
+
+2006-05-02 Andreas Schwab <[email protected]>
+
+ * xmenu.c (restore_menu_items): Return a value.
+
+2006-05-01 Martin Rudalics <[email protected]>
+
+ * syntax.c (Fforward_comment): Detect generic comment at beginning of
+ buffer when moving backwards.
+
+2006-05-01 YAMAMOTO Mitsuharu <[email protected]>
+
+ * dispnew.c (update_window): Don't set changed_p when mode/header
+ line is updated.
+
+ * xdisp.c (prepare_menu_bars) [MAC_OS]: Call mac_update_title_bar.
+ (get_glyph_face_and_encoding, get_char_face_and_encoding):
+ Don't distinguish known faces from others.
+
+ * mac.c (mac_coerce_file_name_ptr): Try typeFSRef if coercion
+ through typeFileURL failed.
+
+ * macfns.c (mac_update_title_bar): New function.
+ [TARGET_API_MAC_CARBON] (mac_update_proxy_icon): New function.
+ (show_hourglass, hide_hourglass) [USE_CG_DRAWING]:
+ Call mac_prepare_for_quickdraw.
+
+ * macgui.h (USE_ATSUI): Set default to 1 if MAC_OSX is defined.
+ (USE_CG_DRAWING): Don't define if compiled on Mac OS X 10.1.
+ (enum pcm_status): New enum.
+ (XCHARSTRUCTROW_CHAR_VALID_P, XCHARSTRUCTROW_SET_CHAR_VALID)
+ (XCharStructRow): Remove. Now validity is represented by
+ non-negativeness of sum of ascent and descent.
+ (struct MacFontStruct): Change type of member `rows'.
+ (struct _XGC) [USE_CG_DRAWING]: Add member `clip_rects'.
+
+ * macterm.c (mac_draw_line, mac_draw_line_to_pixmap):
+ Adjust endpoints of strictly horizontal/vertical lines.
+ (mac_set_clip_rectangles) [USE_CG_DRAWING]: Set clip_rects.
+ (pcm_init, pcm_get_status): New functions.
+ (x_per_char_metric, XLoadQueryFont): Use them instead of
+ XCharStructRow and related macros.
+ (x_draw_relief_rect): Don't adjust arguments of mac_draw_line.
+ (x_free_frame_resources) [TARGET_API_MAC_CARBON]: Free FRAME_FILE_NAME.
+ (XTread_socket) [TARGET_API_MAC_CARBON]: Handle proxy icon drag
+ and window path pop-up menu on title bar.
+ (mac_use_core_graphics) [USE_CG_DRAWING]: Set default to 1.
+
+ * macterm.h (mac_update_title_bar): Add extern.
+ (struct mac_output) [TARGET_API_MAC_CARBON]: New member `file_name'.
+ (FRAME_FILE_NAME): New macro.
+
+ * unexmacosx.c (unexec): Error if trying unexec from dumped executable.
+
+2006-04-30 Richard Stallman <[email protected]>
+
+ * keymap.c (Fdefine_key): Improve error message
+ when KEY begins with a non-prefix key.
+
+2006-04-30 Martin Rudalics <[email protected]>
+
+ * syntax.c (Fforward_comment): Don't forget to break out of the loop
+ when we skipped backward over a generic comment.
+
+2006-04-27 Nick Roberts <[email protected]>
+
+ * .gdbinit (pp1, pv1): Only print value as expression is now
+ printed out by gud-print.
+ (pv1): Correct doc string.
+
+2006-04-26 Stefan Monnier <[email protected]>
+
+ * keymap.c (store_in_keymap): Change `def' arg to not be `register'.
+ Seems to trigger a bug in gcc-amd64 4.0.2 20051125 (Red Hat 4.0.2-8):
+ keymap.c:895: error: address of register variable `def' requested.
+
+2006-04-26 Jason Rumney <[email protected]>
+
+ * w32term.c (construct_mouse_wheel): Handle negative coordinates.
+
+ * w32fns.c (w32_wnd_proc) <WM_LBUTTONDOWN, WM_RBUTTONDOWN>:
+ <WM_LBUTTONUP, WM_RBUTTONUP>: Call signal_user_input in the cases
+ where we preempt mouse_button_timer.
+
+2006-04-25 Miles Bader <[email protected]>
+
+ * editfns.c (Ffield_beginning, find_field): Undo change of 2006-04-23.
+
+2006-04-24 Stefan Monnier <[email protected]>
+
+ * process.h: Include headers for pid_t.
+
+2006-04-24 Kim F. Storm <[email protected]>
+
+ * xdisp.c (fill_stretch_glyph_string): Set s->nchars = 1 for code which
+ does last_glyph=s->first_glyph+s->nchars-1, e.g. if stretch has relief.
+ (produce_stretch_glyph): Assume that face box height and width is
+ already included in stretch glyph size so caller doesn't have to
+ consider the extra space otherwise added (fixes problem in ses.el).
+
+ * frame.c (x_set_font): Clear f->n_tool_bar_rows and current frame
+ matrices to force recalculation of tool-bar height after font change.
+
+ * xdisp.c (tool_bar_lines_needed): New local `temp_row' for clarity.
+ Clear it when done, so we don't accidentally draw a second copy of
+ the tool-bar after resetting f->n_tool_bar_rows.
+ (redisplay_tool_bar): Update tool-bar-lines frame parameter whenever
+ we recalculate f->n_tool_bar_rows.
+
+2006-04-23 Lars Hansen <[email protected]>
+
+ * editfns.c (find_field): Fix comment.
+ (Ffield_beginning): Fix bug when POS is at field beginning.
+
+2006-04-22 Eli Zaretskii <[email protected]>
+
+ * puresize.h (BASE_PURESIZE): Increase to 1205000.
+
+2006-04-21 Kim F. Storm <[email protected]>
+
+ * xdisp.c (redisplay_window): Fix last change. Don't recenter if
+ window start is at BEGV.
+
+ * dispextern.h (struct image): New member `corners'.
+ (TOP_CORNER, LEFT_CORNER, BOT_CORNER, RIGHT_CORNER): New macros.
+
+ * image.c (four_corners_best): New arg CORNERS specifies what pixels
+ to look at in case image has margin.
+ (x_create_bitmap_mask): Pass NULL for CORNERS to four_corners_best.
+ (image_background, image_background_transparent)
+ (x_build_heuristic_mask): Pass img->corners to four_corners_best.
+ (gif_load): Set img->corners according to image's margin spec.
+ Use img->corners values directly where applicable.
+ Save image extension data in img->data.lisp_val.
+ (gif_clear_image): New function to free img->data.lisp_val.
+ (gif_type): Use it instead of generic x_clear_image.
+ (Fimage_extension_data): New defun.
+ (syms_of_image): Defsubr it.
+
+2006-04-21 John Sullivan <[email protected]> (tiny change)
+
+ * window.c (Fdisplay_buffer): Doc fix.
+
+2006-04-21 Eli Zaretskii <[email protected]>
+
+ * s/ms-w32.h (SYSTEM_PURESIZE_EXTRA): Increase to 25000.
+
+2006-04-21 YAMAMOTO Mitsuharu <[email protected]>
+
+ * image.c [MAC_OS] (xpm_load_image): Fill in background field
+ while we have ximg handy.
+
+ * macmenu.c (restore_menu_items, save_menu_items): New functions
+ from xmenu.c.
+ (set_frame_menubar, digest_single_submenu): Apply 2006-04-18
+ changes for xmenu.c.
+
+ * macterm.c (x_per_char_metric): Return NULL if glyph width is 0.
+ (add_mac_font_name): New function.
+ (init_font_name_table): Use it. Adopt the first found font from
+ those having the same family name.
+
+2006-04-21 Nick Roberts <[email protected]>
+
+ * xdisp.c (note_mouse_highlight): Use build_string.
+
+2006-04-20 Lars Hansen <[email protected]>
+
+ * textprop.c (Fremove_list_of_text_properties):
+ Ensure modify_region is called only when buffer is modified and that
+ signal_after_change is allways called in that case.
+
+ * print.c (PRINTFINISH): Call signal_after_change.
+
+2006-04-20 Kim F. Storm <[email protected]>
+
+ * xdisp.c (redisplay_window): Fix last change.
+
+ * xdisp.c (redisplay_window): If current window start is not at the
+ beginning of a line, select a new window start if buffer is modified
+ and window start is in the modified region, but the first change is
+ before window start.
+
+2006-04-18 Richard Stallman <[email protected]>
+
+ * xmenu.c (restore_menu_items, save_menu_items): New fns.
+ (set_frame_menubar): Use save_menu_items. Save updated vector in
+ the frame before unwinding it. Don't use unuse_menu_items.
+ Don't use discard_menu_items.
+ (digest_single_submenu): Abort if an item is not in a pane.
+ (init_menu_items): Put the error check at the top.
+
+ * keymap.c (describe_map): Make "shadowed" warning more verbose.
+
+ * window.c (adjust_window_trailing_edge): Correctly distinguish
+ series vs parallel cases, even when window has no parent.
+
+ * abbrev.c (record_symbol): New function.
+ (Finsert_abbrev_table_description): Sort the abbrevs alphabetically.
+
+2006-04-18 YAMAMOTO Mitsuharu <[email protected]>
+
+ * image.c (x_create_bitmap_from_data) [MAC_OS]: Don't check return
+ value of xmalloc.
+
+ * mac.c (mac_coerce_file_name_ptr, mac_coerce_file_name_desc)
+ (create_apple_event_from_event_ref, xrm_get_preference_database)
+ (cfstring_create_normalized): Don't check return value of xmalloc.
+
+ * macselect.c (get_scrap_target_type_list, defer_apple_events)
+ (copy_scrap_flavor_data, mac_handle_service_event): Don't check
+ return value of xmalloc/xrealloc.
+
+ * macterm.c (XCreateGC, x_per_char_metric, xlfdpat_create)
+ (init_font_name_table, init_font_name_table, mac_do_list_fonts)
+ (XLoadQueryFont, mac_store_apple_event): Don't check return value
+ of xmalloc.
+
+2006-04-17 Kim F. Storm <[email protected]>
+
+ * window.c (coordinates_in_window): On the vertical border,
+ calculate the row number measured from the top of the window, not
+ the top of the frame.
+ (window_loop): Test w->dedicated with !NILP instead of EQ Qt.
+ (window_scroll_pixel_based): Fix off-by-one bug in 2002-12-23 change.
+
+2006-04-16 Eli Zaretskii <[email protected]>
+
+ * s/ms-w32.h (SYSTEM_PURESIZE_EXTRA): Reduce to 24000.
+
+2006-04-16 Romain Francoise <[email protected]>
+
+ * puresize.h (BASE_PURESIZE): Decrement back to 1200000.
+
+2006-04-16 Andreas Schwab <[email protected]>
+
+ * puresize.h (PURESIZE_RATIO): Reduce to 10/6.
+
+2006-04-15 Romain Francoise <[email protected]>
+
+ * puresize.h (BASE_PURESIZE): Increment to 1210000.
+
+2006-04-13 Micha,Ak(Bl Cadilhac <[email protected]>
+
+ * print.c (Fprin1_to_string): Mention in the `doc' that the
+ behavior is modified by `print-level' and `print-length'.
+
+2006-04-13 Kenichi Handa <[email protected]>
+
+ * coding.c (setup_coding_system): If eol-type is not yet decided
+ and system_eol_type is not LF, set CODING_REQUIRE_ENCODING_MASK.
+ If coding_system is nil, return 0.
+ (code_convert_region1): Even if coding_system is nil, don't skip
+ conversion if system_eol_type is not LF.
+ (code_convert_string1): Likewise.
+ (code_convert_string_norecord): Likewise.
+
+2006-04-13 Kenichi Handa <[email protected]>
+
+ * coding.c (setup_coding_system): Fix previous change.
+ (encode_coding): If eol_type is not yet decided, use system_eol_type.
+ (shrink_encoding_region): If eol_type is not yet decided and
+ system_eol_type is not LF, don't shrink.
+
+2006-04-13 Nick Roberts <[email protected]>
+
+ * xdisp.c (note_mouse_highlight): Add help echo for dragging vertical
+ line.
+
+2006-04-12 Richard Stallman <[email protected]>
+
+ * keyboard.c (read_key_sequence): Explicitly avoid keybuf[-1].
+
+ * process.c (conv_lisp_to_sockaddr): If FAMILY unknown, just return.
+ (Fprocess_send_eof): Abort if fail to open null device.
+
+2006-04-12 YAMAMOTO Mitsuharu <[email protected]>
+
+ * fns.c [HAVE_MENUS && MAC_OS]: Include macterm.h.
+
+ * image.c [MAC_OS] (xpm_load_image): Add parentheses around
+ assignment used as truth value. Add explicit braces to avoid
+ ambiguous `else'.
+ [MAC_OS] (gif_load): Remove unused variable `gcpro1'.
+
+ * lisp.h (syms_of_fontset, Fset_fontset_font): Put extern and
+ EXFUN in #ifdef HAVE_WINDOW_SYSTEM.
+ (syms_of_xfns, syms_of_xsmfns, syms_of_xselect, syms_of_xterm):
+ Put externs in #ifdef HAVE_X_WINDOWS.
+ (syms_of_macfns, syms_of_macselect, syms_of_macterm)
+ (syms_of_macmenu, syms_of_mac) [MAC_OS]: Add externs.
+ (init_mac_osx_environment) [MAC_OSX]: Add extern.
+
+ * mac.c (init_process): Remove undef.
+ (select) [MAC_OSX]: Undefine before including sysselect.h.
+ (posix_pathname_to_fsspec, fsspec_to_posix_pathname) [MAC_OSX]:
+ Remove functions and prototypes.
+ (parse_value): Add parentheses around + inside shift.
+ (path_from_vol_dir_name): Make static.
+ (get_temp_dir_name): Remove unused variables `cpb' and `dir_name'.
+ [!MAC_OSX] (get_path_to_system_folder): Likewise.
+ (Fmac_get_file_creator, Fmac_get_file_type): Remove unused
+ variable `cCode'.
+ (Fmac_coerce_ae_data): Remove unused variables `fref' and `fs'.
+ (Fmac_get_preference): Add explicit braces to avoid ambiguous `else'.
+
+ * macfns.c (x_to_mac_color): Remove unused variable `tail'.
+ (x_set_mouse_color): Remove unused variable `dpy'.
+ (Fx_create_frame): Remove unused variable `x_frame_count'.
+ (Fx_server_version): Add explicit braces to avoid ambiguous `else'.
+ (x_sync): Move from macterm.c.
+ (Fx_file_dialog): Remove unused variable `default_filter_index'.
+
+ * macmenu.c (min_menu_id): Make element type explicit.
+
+ * macselect.c (get_flavor_type_from_symbol): Remove unused
+ variable `val'.
+ (get_scrap_private_timestamp, x_get_foreign_selection)
+ (copy_scrap_flavor_data): Add explicit braces to avoid ambiguous `else'.
+ (Fmac_process_deferred_apple_events): Remove unused variables
+ `keyword', `reply', `apple_event', `count', and `err'.
+
+ * macterm.c: Don't include gnu.h.
+ (x_io_error_quitter, x_draw_image_foreground_1): Remove prototypes.
+ (x_sync): Move to macfns.c.
+ [USE_CG_DRAWING] (mac_define_fringe_bitmap): Remove unused
+ variable `mask_bits'.
+ (mac_compute_glyph_string_overhangs): Avoid ambiguous `else'.
+ (x_draw_image_glyph_string): Remove unused variable `pixmap'.
+ (x_mac_to_emacs_modifiers): Remove function.
+ (XTset_vertical_scroll_bar, mac_handle_visibility_change)
+ (x_make_frame_visible, xlfdpat_create, mac_handle_command_event):
+ Add explicit braces to avoid ambiguous `else'.
+ (x_make_frame_visible): Remove unused variables `type',
+ `original_top', and `original_left'.
+ (mac_do_list_fonts, XTread_socket): Add parentheses around && within ||.
+ (x_load_font): Remove unused variables `full_name', and `value'.
+ (do_get_menus, do_init_managers, do_check_ram_size) [!MAC_OS8]:
+ Remove functions.
+ (do_zoom_window): Reorganize variables with respect to conditionals.
+ (init_command_handler): Remove unused variable `err'.
+ [MAC_OSX] (mac_check_bundle): Remove unused variable `child'.
+
+ * macterm.h (x_set_mouse_position, x_set_mouse_pixel_position)
+ (x_make_frame_invisible, x_iconify_frame, x_free_frame_resources)
+ (x_destroy_window, x_wm_set_size_hint, x_delete_display, XFreeGC)
+ (do_menu_choice, have_menus_p, x_real_positions)
+ (x_set_menu_bar_lines, x_pixel_width, x_pixel_height, x_char_width)
+ (x_char_height, x_sync, x_set_tool_bar_lines, x_activate_menubar)
+ (free_frame_menubar): Add externs.
+
+ * unexmacosx.c: Include config.h before using HAVE_MALLOC_MALLOC_H.
+ (malloc, realloc, free): Add undefs.
+ (read_load_commands): Remove unused variable `n' and `j'.
+ (copy_data_segment): Remove unused variable `r'.
+
+ * xdisp.c (get_glyph_string_clip_rects): Add parentheses around &&
+ within ||. Add explicit braces to avoid ambiguous `else'.
+ (dump_glyph_row): Remove label for `inverse_p' from legend.
+
+ * xfaces.c (Finternal_merge_in_global_face, try_font_list):
+ Add explicit braces to avoid ambiguous `else'.
+
+2006-04-11 Micha,Ak(Bl Cadilhac <[email protected]>
+
+ * dispnew.c (init_display): Don't init X display if the user asked
+ for a non-X display.
+
+2006-04-12 Kenichi Handa <[email protected]>
+
+ * coding.c (setup_coding_system): Use system_eol_type for default
+ coding->eol_type.
+
+2006-04-11 Dan Nicolaescu <[email protected]>
+
+ * lisp.h (wrong_type_argument): Mark as NO_RETURN.
+
+ * data.c (wrong_type_argument): Try to avoid compiler warnings due
+ to the fact the function is now marked as NO_RETURN.
+
+2006-04-10 Eli Zaretskii <[email protected]>
+
+ * s/ms-w32.h (pid_t) [_MSC_VER]: New typedef.
+
+2006-04-10 Romain Francoise <[email protected]>
+
+ * xrdb.c (gethomedir): Use xstrdup.
+
+2006-04-10 Andreas Schwab <[email protected]>
+
+ * xrdb.c (gethomedir): Make sure to always return a pointer that
+ can be passed to free.
+
+2006-04-09 Richard Stallman <[email protected]>
+
+ * lisp.h (Fkill_emacs): Undo previous change.
+
+2006-04-08 Richard Stallman <[email protected]>
+
+ * search.c (boyer_moore): Test ch >= 0400, not >.
+
+2006-04-09 Dan Nicolaescu <[email protected]>
+
+ * puresize.h (pure_write_error): Mark as NO_RETURN.
+
+ * lisp.h (args_out_of_range, args_out_of_range_3, Fkill_emacs):
+ Likewise.
+
+2006-04-08 Eli Zaretskii <[email protected]>
+
+ * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Ignore mouse movements
+ if a menu is active on this frame.
+
+2006-04-08 Dan Nicolaescu <[email protected]>
+
+ * lisp.h (report_file_error): Mark as NO_RETURN.
+
+2006-04-08 Eli Zaretskii <[email protected]>
+
+ * alloc.c [STDC_HEADERS]: Include stddef.h.
+
+ * lisp.h (PSEUDOVECSIZE): Fix last change.
+
+2006-04-08 Stefan Monnier <[email protected]>
+
+ * process.h (struct Lisp_Process): Replace Lisp_Objects `pid',
+ `raw_status_high', and `raw_status_low' with plain integers, and move
+ them to the end of the structure.
+
+ * alloc.c (allocate_process): Use PSEUDOVECSIZE to initialize the
+ pseudovector's size field so only the Lisp_Object fields get GC'd.
+
+ * process.c (update_status, make_process, Fdelete_process)
+ (Fprocess_status, list_processes_1, start_process_unwind)
+ (create_process, Fmake_network_process, server_accept_connection)
+ (wait_reading_process_output, send_process, Fprocess_running_child_p)
+ (process_send_signal, proc_encode_coding_system, Fprocess_send_eof)
+ (sigchld_handler, status_notify): Adjust to new non-Lisp fields for
+ `pid' and `raw_status'.
+ (Fprocess_id, Fsignal_process): Same, and additionally use floats when
+ representing PIDs that are larger than most-positive-fixnum.
+
+ * keymap.c (describe_map): Only use XINT if we checked INTEGERP.
+
+ * lisp.h (OFFSETOF, PSEUDOVECSIZE): New macros.
+
+2006-04-08 Eli Zaretskii <[email protected]>
+
+ * w32fns.c (Fx_show_tip): Add 3 to the 5th arg of SetWindowPos.
+
+2006-04-03 Paul Eggert <[email protected]>
+
+ * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): New macro, identical to
+ ../lib-src/b2m.c and ../lib-src/editfns.c.
+ (Fcurrent_time_string): Use it.
+ Document that the year might not consume 4 columns if it's outside
+ the range 1000-9999.
+ Check for asctime failure.
+ Don't assume that the output string length is always exactly 24.
+
+2006-04-03 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.c (XTread_socket): Initialize variable `f' before its use.
+
+2006-04-03 Kenichi Handa <[email protected]>
+
+ * image.c: Include "charset.h" and "coding.h".
+ (x_find_image_file): Return an encoded file name.
+
+2006-04-01 Eli Zaretskii <[email protected]>
+
+ * configure: Regenerated.
+
+2006-03-31 Kenichi Handa <[email protected]>
+
+ * xfns.c (xg_set_icon): Delete superfluous UNGCPRO.
+
+2006-03-30 Dan Nicolaescu <[email protected]>
+
+ * xdisp.c (syms_of_xdisp): Fix variable name.
+
+2006-03-30 Kenichi Handa <[email protected]>
+
+ * xterm.c (x_term_init): Delete superfluous UNGCPRO.
+
+2006-03-29 Juanma Barranquero <[email protected]>
+
+ * keyboard.c (process_tool_bar_item): Reorder dummy args.
+
+2006-03-29 Stefan Monnier <[email protected]>
+
+ * keyboard.c (tool_bar_items): Use map_keymap.
+ (process_tool_bar_item): Add dummy args to fit the required interface.
+
+2006-03-25 Eli Zaretskii <[email protected]>
+
+ * .gdbinit (pr, pp, pp1, pv, pv1): Force print_output_debug_flag
+ to zero before calling debug_print or safe_debug_print.
+
+ * print.c (print_output_debug_flag): New global variable.
+ (Fexternal_debugging_output) [WINDOWSNT]: Don't call
+ OutputDebugString if print_output_debug_flag is zero.
+
+2006-03-24 Paul Eggert <[email protected]>
+
+ * editfns.c (TM_YEAR_BASE): Move up, so the changes below can use it.
+ (Fdecode_time, Fencode_time): Use TM_YEAR_BASE instead of 1900.
+ (Fdecode_time): Cast tm_year to EMACS_INT.
+ (Fcurrent_time_string): Report an invalid time specification if
+ the argument is invalid. Also, check for out-of-range time stamps.
+
+2006-03-24 Kim F. Storm <[email protected]>
+
+ * xterm.c (handle_one_xevent):
+ * w32term.c (w32_read_socket):
+ * macterm.c (XTread_socket): Don't let key-press clear mouse face
+ on in toolbar window if mouse-highlight is an integer.
+
+ * fns.c (sxhash_list): Include last non-nil CDR in hash.
+
+2006-03-24 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macmenu.c (enum mac_menu_kind): New enum.
+ (min_menu_id): New variable.
+ (POPUP_SUBMENU_ID, MIN_POPUP_SUBMENU_ID, MIN_MENU_ID)
+ (MIN_SUBMENU_ID): Remove defines. All uses are replaced with
+ min_menu_id and enumerators in enum mac_menu_kind.
+ (fill_menu, dispose_menus, install_menu_quit_handler): New arg KIND.
+ All uses changed. Add range check for menu ID.
+ (fill_menubar): Add range check for menu ID.
+ [HAVE_CANCELMENUTRACKING] (menu_quit_handler): Check error code of
+ GetEventParameter.
+ (set_frame_menubar, mac_menu_show): Call install_menu_quit_handler
+ for each menu kind.
+
+2006-03-22 Kim F. Storm <[email protected]>
+
+ * xdisp.c: Undo 2006-03-21 change.
+
+ * term.c: Define aliases for append_glyph and produce_stretch_glyph
+ when `static' is defined to avoid name clash with those in xdisp.c.
+
+ * process.c (Faccept_process_output): Fix to comply with lisp
+ reference. Change arg "timeout" to "seconds" and allow both
+ integer and float value. Change arg "timeout-msec" to "millisec"
+ and interpret" as milliseconds rather than microseconds. Fix doc
+ string accordingly.
+
+2006-03-21 Ken Raeburn <[email protected]>
+
+ * xdisp.c (store_next_glyph): Rename from append_glyph.
+ (generate_stretch_glyph): Rename from produce_stretch_glyph.
+ All callers changed accordingly.
+
+2006-03-21 Jan Dj,Ad(Brv <[email protected]>
+
+ * xterm.c: x_session_initialized new variable.
+ (x_term_init): Use x_session_initialized to check if
+ x_session_initialize should be called.
+ (x_initialize): Initialize x_session_initialized.
+
+2006-03-21 Kim F. Storm <[email protected]>
+
+ * fringe.c (draw_fringe_bitmap): Don't calculate default overlay arrow
+ bitmap here, but ...
+ (update_window_fringes): ... here, so we can test if it has changed.
+
+2006-03-20 Andreas Schwab <[email protected]>
+
+ * dispnew.c (init_display): Check DISPLAY here.
+
+ * emacs.c (main): Don't check here.
+
+ * xterm.c (x_display_ok): Don't use DISPLAY env var.
+
+2006-03-20 Stefan Monnier <[email protected]>
+
+ * window.c (window_scroll_pixel_based): Yet another int/Lisp_Object
+ mixup (YAILOM).
+
+2006-03-20 Eli Zaretskii <[email protected]>
+
+ * emacs.c (main): Fix last change.
+
+2006-03-20 Kenichi Handa <[email protected]>
+
+ * fileio.c (Fwrite_region): Set visit_file to Qnil before GCPRO it.
+
+ * keymap.c (map_keymap): Set tail to Qnil before GCPRO it.
+
+ * xfns.c (xg_set_icon): Remove unnecessary GCPRO.
+
+ * xterm.c (x_term_init): Remove unnecessary GCPRO.
+
+2006-03-19 Kim F. Storm <[email protected]>
+
+ * xdisp.c (set_cursor_from_row): Fix cursor property on overlay string,
+ so it doesn't associate overlay string with following glyph by default.
+ Allow integer property value to specify explicit number of buffer
+ positions associate with overlay string.
+
+2006-03-18 Chong Yidong <[email protected]>
+
+ * xterm.c (x_display_ok): Fix minor bug and compilation warnings.
+
+2006-03-18 Nozomu Ando <[email protected]>
+
+ * m/pmax.h (BROKEN_NOCOMBRELOC) [__NetBSD__]: Define.
+ (LIB_STANDARD, START_FILES) [__NetBSD__]: Don't define.
+ (START_FILES, RUN_TIME_REMAP, UNEXEC) [__NetBSD__, __OpenBSD__]:
+ Don't redefine.
+
+ * m/mips.h: Don't use unexmips on NetBSD.
+ (LIBS_MACHINE): Move definition lower, so it doesn't use
+ LD_SWITCH_MACHINE, START_FILES, LIB_STANDARD, LIBS_TERMCAP,
+ C_SWITCH_MACHINE, and C_DEBUG_SWITCH.
+
+ * unexelf.c [BROKEN_NOCOMBRELOC]: Include assert.h.
+ (unexec) [BROKEN_NOCOMBRELOC]: Handle platforms whose nocombreloc
+ option is broken (e.g., MIPS/NetBSD).
+
+2006-03-18 Craig McDaniel <[email protected]> (tiny change)
+
+ * sheap.c (STATIC_HEAP_SIZE): Enlarge STATIC_HEAP_SIZE to 12MB.
+ Remove the HAVE_X_WINDOWS conditional.
+
+2006-03-18 Vivek Dasmohapatra <[email protected]> (tiny change)
+
+ * emacs.c (main): If user asks for a display that is unavailable,
+ simulate -nw.
+
+ * xterm.c (x_display_ok): New function.
+
+ * xterm.h: Add prototype for x_display_ok.
+
+2006-03-18 Eli Zaretskii <[email protected]>
+
+ * w32fns.c (Fw32_select_font): Doc fix.
+
+2006-03-16 YAMAMOTO Mitsuharu <[email protected]>
+
+ * image.c [MAC_OS] (XPutPixel, XGetPixel)
+ [!WORDS_BIG_ENDIAN && USE_CG_DRAWING]: Don't use specialized
+ version when depth is 32.
+ (mac_create_cg_image_from_image) [MAC_OS && USE_CG_DRAWING]:
+ New function.
+ (prepare_image_for_display) [MAC_OS && USE_CG_DRAWING]: Use it.
+ (x_clear_image_1) [MAC_OS && USE_CG_DRAWING]: Release CGImage.
+
+ * macterm.c (XCreatePixmap) [!WORDS_BIG_ENDIAN && USE_CG_DRAWING]:
+ Create GWorld in ARGB pixel format.
+ (mac_copy_area, mac_copy_area_with_mask) [USE_CG_DRAWING]:
+ Remove functions.
+ (x_draw_image_foreground) [USE_CG_DRAWING]: Use mac_draw_cg_image
+ instead of mac_copy_area/mac_copy_area_with_mask.
+
+2006-03-15 Kim F. Storm <[email protected]>
+
+ * xdisp.c (extend_face_to_end_of_line): Always add space glyph to
+ empty row. Fixes memory corruption revealed by 2006-03-02 change.
+ (display_tool_bar_line): Skip empty tool-bar line if HEIGHT < 0.
+ (tool_bar_lines_needed): Fix tool-bar display in case the tool-bar
+ width is exactly the same as the window width. Don't count a final
+ empty tool-bar line (pass HEIGHT = -1 to display_tool_bar_line).
+
+2006-03-15 Juanma Barranquero <[email protected]>
+
+ * fringe.c (w32_init_fringe, w32_reset_fringes): Revert to being
+ conditional on HAVE_NTGUI, not WINDOWS_NT.
+
+2006-03-15 YAMAMOTO Mitsuharu <[email protected]>
+
+ * dispextern.h (mac_init_fringe) [MAC_OS]: Add prototype.
+
+ * fringe.c (mac_init_fringe) [MAC_OS]: New function.
+
+ * macterm.c (mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
+ (max_fringe_bmp, fringe_bmp) [USE_CG_DRAWING]: New variables.
+ (mac_define_fringe_bitmap, mac_destroy_fringe_bitmap)
+ (mac_draw_cg_image) [USE_CG_DRAWING]: New functions.
+ (mac_draw_bitmap) [USE_CG_DRAWING]: Remove function.
+ (x_draw_fringe_bitmap) [USE_CG_DRAWING]: Use mac_draw_cg_image
+ instead of mac_draw_bitmap.
+ (x_redisplay_interface) [USE_CG_DRAWING]: Set handlers for
+ define_fringe_bitmap and destroy_fringe_bitmap.
+
+2006-03-14 Chong Yidong <[email protected]>
+
+ * xterm.c (x_uncatch_errors): Block input for entire function.
+
+2006-03-12 Jason Rumney <[email protected]>
+
+ * w32fns.c (Fx_create_frame): Remove call to
+ Qface_set_after_frame_default (from xfns.c 2003-05-26).
+
+ * w32menu.c (Fx_popup_menu): Call w32_free_menu_strings when
+ finished with the menu.
+
+ * w32term.c: Sync 2005-10-24 xterm.c changes.
+ (last_mouse_glyph_frame): New var.
+ (note_mouse_movement): Say mouse moved if current frame differs
+ from last_mouse_glyph_frame, and update last_mouse_glyph_frame.
+ (w32_mouse_position): Set last_mouse_glyph_frame.
+ Remove OLD_REDISPLAY_CODE block.
+
+2006-03-12 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macgui.h [USE_ATSUI && MAC_OSX]: Define USE_CG_TEXT_DRAWING to 1.
+
+ * macterm.h (struct mac_output) [USE_CG_DRAWING]: New member cg_context.
+ (mac_prepare_for_quickdraw) [USE_CG_DRAWING]: Add prototype.
+
+ * mac.c (sys_select) [USE_CG_DRAWING]: Call mac_prepare_for_quickdraw.
+
+ * macfns.c (x_create_tip_frame): Apply 2006-03-11 change for xfns.c.
+
+ * macterm.c (mac_draw_rectangle, x_draw_glyph_string_foreground)
+ (x_draw_composite_glyph_string_foreground)
+ (x_draw_image_foreground): Undo previous changes.
+ (x_draw_hollow_cursor): Likewise. Subtract 1 from the last
+ argument of mac_draw_rectangle.
+ (CG_SET_FILL_COLOR, CG_SET_STROKE_COLOR): New macros.
+ (mac_draw_string_common, mac_draw_image_string_cg): Use them.
+ (FRAME_CG_CONTEXT) [USE_CG_DRAWING]: New macro.
+ (mac_begin_cg_clip, mac_end_cg_clip, mac_prepare_for_quickdraw)
+ [USE_CG_DRAWING]: New functions.
+ (mac_draw_line, mac_erase_rectangle, mac_clear_window)
+ (mac_fill_rectangle, mac_draw_rectangle, mac_draw_string_common)
+ (mac_draw_image_string_cg) [USE_CG_DRAWING]: Add Quartz 2D drawing part.
+ (mac_draw_bitmap, mac_invert_rectangle, mac_draw_string_common)
+ (mac_copy_area, mac_scroll_area, x_scroll_bar_create)
+ (x_scroll_bar_remove, XTset_vertical_scroll_bar, x_set_window_size)
+ (XTread_socket) [USE_CG_DRAWING]: Call mac_prepare_for_quickdraw.
+
+2006-03-12 L$,1 q(Brentey K,Aa(Broly <[email protected]>
+
+ * xfns.c (x_icon): Disable redundant call to `x_wm_set_window_state'.
+
+2006-03-11 Jason Rumney <[email protected]>
+
+ * w32fns.c (signal_user_input): New function.
+ (post_character_message): Use it for keyboard input.
+ (w32_msg_pump): Use it for mouse input.
+
+2006-03-11 Luc Teirlinck <[email protected]>
+
+ * window.c: Rename preserve_y to window_scroll_pixel_based_preserve_y.
+ (window_scroll_pixel_based, syms_of_window): Adapt to above change.
+
+2006-03-11 Eli Zaretskii <[email protected]>
+
+ * w32fns.c (w32_wnd_proc): Ignore middle and extra button events
+ if a menu is already active (the menubar_active flag is on).
+
+2006-03-11 David Ponce <[email protected]>
+
+ * xfns.c (x_create_tip_frame): Preserve received parms by copying them.
+
+2006-03-11 Eli Zaretskii <[email protected]>
+
+ * w32term.c: Add x_fully_uncatch_errors and x_catching_errors to
+ the list of unused display error handling functions.
+
+ * eval.c (unwind_to_catch): Call x_fully_uncatch_errors only if
+ HAVE_X_WINDOWS.
+ (internal_condition_case, internal_condition_case_1)
+ (internal_condition_case_2): Call x_catching_errors only if
+ HAVE_X_WINDOWS.
+
+ * vm-limit.c [HAVE_GETRLIMIT]: Don't define unconditionally.
+ Don't include sys/resource.h unless defined.
+
+2006-03-11 Richard Stallman <[email protected]>
+
+ * keymap.c (describe_map): Shorten string to indicate shadowed binding.
+
+ * vm-limit.c (get_lim_data, lim_data, data_space_start):
+ Move from mem-limits.h.
+ (enum warnlevel): New data type.
+ (check_memory_limits): Rewrite the logic about warnings.
+ Use standard `struct rlimit'. Check return values for nonsense.
+ (memory_warnings): Always clear lim_data.
+
+ * mem-limits.h (get_lim_data, lim_data, data_space_start):
+ Move to vm-limit.c.
+
+ * xterm.c (x_fully_uncatch_errors, x_catching_errors): New functions.
+
+ * eval.c (unwind_to_catch): Call x_fully_uncatch_errors.
+ (internal_condition_case_1, internal_condition_case_2):
+ Abort if within unclosed x_catch_errors.
+
+2006-03-11 Romain Francoise <[email protected]>
+
+ * process.c (Vprocess_adaptive_read_buffering): Doc fix.
+
+2006-03-11 Giorgos Keramidas <[email protected]> (tiny change)
+
+ * lisp.h: Remove duplicate prototypes. Make the prototype of
+ getloadavg be conditioned on HAVE_GETLOADAVG being undefined.
+
+2006-03-11 Eli Zaretskii <[email protected]>
+
+ * xterm.c (x_draw_hollow_cursor): Subtract 1 from the last
+ argument of XDrawRectangle.
+
+ * xdisp.c (get_phys_cursor_geometry): Don't decrease height by 1.
+
+ * macterm.c (mac_draw_rectangle): Don't add 1 to width and height.
+ (x_draw_glyph_string_foreground)
+ (x_draw_composite_glyph_string_foreground)
+ (x_draw_image_foreground): Don't subtract 1 from width and height
+ arguments to mac_draw_rectangle.
+ (x_draw_hollow_cursor): Add 1 to w->phys_cursor_width.
+
+2006-03-10 Kim F. Storm <[email protected]>
+
+ * alloc.c (USE_POSIX_MEMALIGN): Fix last change.
+
+2006-03-09 Stefan Monnier <[email protected]>
+
+ * alloc.c (USE_POSIX_MEMALIGN): New macro.
+ (ABLOCKS_BASE, lisp_align_malloc, lisp_align_free): Use it.
+
+2006-03-09 Kenichi Handa <[email protected]>
+
+ * coding.c (DECODE_EMACS_MULE_COMPOSITION_CHAR): Fix decoding
+ ASCII component of a composition.
+
+2006-03-08 Luc Teirlinck <[email protected]>
+
+ * window.c: Declare preserve_y as a static global variable.
+ (window_scroll_pixel_based): No longer declare preserve_y;
+ it is global now.
+ (syms_of_window): Set preserve_y to -1.
+
+2006-03-08 YAMAMOTO Mitsuharu <[email protected]>
+
+ * image.c [MAC_OS] (XPutPixel): Set alpha channel bits if pixmap
+ depth is 32.
+ [MAC_OS] (XGetPixel): Strip off alpha channel bits if pixmap
+ depth is 32.
+
+2006-03-06 Chong Yidong <[email protected]>
+
+ * xdisp.c (handle_invisible_prop): Don't update it->position with
+ a buffer position if we're in a display string.
+
+2006-03-06 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.h (MAC_AQUA_VERTICAL_SCROLL_BAR_WIDTH)
+ (MAC_AQUA_SMALL_VERTICAL_SCROLL_BAR_WIDTH): New defines.
+
+ * macfns.c (x_default_scroll_bar_color_parameter)
+ (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
+ Remove unnecessary prototypes.
+ (x_set_scroll_bar_default_width):
+ Use MAC_AQUA_VERTICAL_SCROLL_BAR_WIDTH.
+ (mac_set_scroll_bar_width): New function.
+ (mac_frame_parm_handlers): Set it as handler for scroll-bar-width.
+
+ * macterm.c (get_control_part_bounds): Fix type of return value.
+ (x_set_toolkit_scroll_bar_thumb, x_scroll_bar_create)
+ (XTset_vertical_scroll_bar) [USE_TOOLKIT_SCROLL_BARS]: Don't show
+ scroll bar if it is not tall enough to display scroll bar thumb.
+ [USE_CARBON_EVENTS] (mac_convert_event_ref)
+ (mac_handle_command_event, mac_handle_window_event)
+ (mac_handle_mouse_event): Check error code of GetEventParameter.
+ (convert_fn_keycode) [MAC_OSX]: Likewise.
+
+2006-03-05 Andreas Schwab <[email protected]>
+
+ * xselect.c (x_catch_errors_unwind): Fix missing return value.
+
+2006-03-02 Kim F. Storm <[email protected]>
+
+ * frame.h (struct frame): New member n_tool_bar_rows.
+
+ * xdisp.c: Minimize the unpleasent visual impact of the requirement
+ that non-toolkit tool-bars must occupy an integral number of screen
+ lines, by distributing the rows evenly over the tool-bar screen area.
+ (Vtool_bar_border): New variable.
+ (syms_of_xdisp): DEFVAR_LISP it.
+ (display_tool_bar_line): Add HEIGHT arg for desired row height.
+ Make tool-bar row the desired height. Use default face for border
+ below tool-bar.
+ (tool_bar_lines_needed): Add N_ROWS arg. Use it to return number of
+ actual tool-bar rows.
+ (redisplay_tool_bar): Calculate f->n_tool_bar_rows initially.
+ Adjust the height of the tool-bar rows to fill tool-bar screen area.
+ (redisplay_tool_bar): Calculate f->n_tool_bar_rows when tool-bar area
+ is resized.
+
+2006-03-01 Luc Teirlinck <[email protected]>
+
+ * search.c (Fregexp_quote): Do not precede a literal `]' with two
+ backslashes to try to make clear that it has a literal meaning; it
+ does not do that. (It could close a character alternative
+ containing a backslash.)
+
+2006-02-28 Chong Yidong <[email protected]>
+
+ * xselect.c (x_catch_errors_unwind): New function.
+ (x_reply_selection_request): Put x_uncatch_errors in an unwind.
+ (Fx_get_atom_name): Call x_uncatch_errors earlier.
+
+ * window.c (Qscroll_up, Qscroll_down): New syms.
+ (window_scroll_pixel_based): Make preserve_y static to avoid
+ getting point stuck when scrolling 1 line.
+
+2006-02-26 Chong Yidong <[email protected]>
+
+ * xterm.h, xterm.c (x_uncatch_errors): Delete unneccessary argument.
+
+ * xterm.c (x_load_font, x_term_init, XTmouse_position)
+ (handle_one_xevent, x_connection_closed, x_list_fonts):
+ No arg for x_uncatch_errors.
+
+ * xselect.c (x_own_selection, x_decline_selection_request)
+ (x_reply_selection_request, x_get_foreign_selection)
+ (Fx_get_atom_name, Fx_send_client_event): Likewise.
+
+ * xfns.c (x_real_positions, x_set_mouse_color, Fx_focus_frame):
+ Likewise.
+
+2006-02-26 Luc Teirlinck <[email protected]>
+
+ * lread.c: Declare Vload_file_rep_suffixes instead of
+ deleted variable default_suffixes.
+ (Fget_load_suffixes): New function.
+ (Fload): Use Fget_load_suffixes and Vload_file_rep_suffixes.
+ No longer use deleted variable default_suffixes. Update docstring.
+ (syms_of_lread): defsubr Sget_load_suffixes.
+ Expand `load-suffixes' docstring.
+ Delete default_suffixes and DEFVAR_LISP the new variable
+ `load-file-rep-suffixes'.
+
+ * w32.c (check_windows_init_file): Use Fget_load_suffixes instead
+ of Vload_suffixes.
+
+ * lisp.h: EXFUN Fget_load_suffixes.
+ Extern Vload_file_rep_suffixes.
+
+ * eval.c (specpdl_ptr): Remove volatile qualifier for consistency
+ with lisp.h.
+
+2006-02-26 Stefan Monnier <[email protected]>
+
+ * lisp.h (struct specbinding, specpdl_ptr): Remove the volatile
+ qualifier which was trying to avoid the bug that was fixed by
+ yesterday's changes to xterm.c.
+
+2006-02-25 Chong Yidong <[email protected]>
+
+ * xterm.h (x_catch_errors) Return value changed to void.
+ (x_uncatch_errors): Delete unused count argument.
+
+ * xterm.c (x_catch_errors): Don't use record_unwind_protect, since
+ it can be called in a signal handler.
+ (x_catch_errors_unwind): Function deleted.
+ (x_uncatch_errors): Deallocate last x_error_message_stack struct.
+ (x_check_errors): Call x_uncatch_errors before signalling error.
+
+ (x_load_font, x_term_init, XTmouse_position, handle_one_xevent)
+ (x_connection_closed, x_list_fonts): Use new versions of
+ x_catch_errors and x_uncatch_errors.
+
+ * xselect.c (x_own_selection, x_decline_selection_request)
+ (x_reply_selection_request, x_get_foreign_selection)
+ (Fx_get_atom_name, Fx_send_client_event): Likewise.
+
+ * xfns.c (x_real_positions, x_set_mouse_color, Fx_focus_frame):
+ Likewise.
+
+ * eval.c (record_unwind_protect): Add an assertion.
+
+2006-02-25 Stefan Monnier <[email protected]>
+
+ * process.c (Fmake_network_process): Init the process's mark.
+
+2006-02-25 Kim F. Storm <[email protected]>
+
+ * buffer.c (modify_overlay): Force redisplay if we modify an
+ overlay at the end of the buffer.
+
+2006-02-24 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c (xg_get_image_for_pixmap): If x_find_image_file returns
+ nil the image file has been removed, in that case use the (cached)
+ pixmap.
+
+2006-02-24 Kenichi Handa <[email protected]>
+
+ * fileio.c (Finsert_file_contents): When a text is replaced
+ partially, be sure to set point before the inserted characters.
+
+2006-02-23 Zhang Wei <[email protected]> (tiny change)
+
+ * xfns.c (Fx_file_dialog): Return a decoded file name.
+
+2006-02-23 YAMAMOTO Mitsuharu <[email protected]>
+
+ * dispnew.c (update_text_area): Avoid needless redraw of rightmost
+ glyph whose face is extended to the text area end.
+
+ * macterm.c (x_set_toolkit_scroll_bar_thumb): Don't set control
+ values if control is not visible or values are not changed.
+
+2006-02-22 Stefan Monnier <[email protected]>
+
+ * window.c (Fwindow_list): Check `window' before doing XWINDOW.
+ The default `window' should not be "on a different frame".
+
+2006-02-22 Kim F. Storm <[email protected]>
+
+ * indent.c (Fvertical_motion): Only try to move back if we can.
+
+2006-02-22 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macgui.h (struct _XGC) [!MAC_OSX || !USE_ATSUI]: New member
+ n_clip_rects.
+
+ * macmenu.c (digest_single_submenu): Apply 2006-02-19 change for
+ xmenu.c.
+
+ * macterm.c (GC_CLIP_REGION): Remove macro.
+ (mac_begin_clip, mac_end_clip): Take arg GC instead of REGION.
+ All uses changed. Don't do clipping if n_clip_rects is zero.
+ (mac_set_clip_rectangles): Use xassert instead of abort.
+ Set n_clip_rects. Don't make clip_region empty when number of
+ clipping rectangles is zero.
+ (mac_reset_clip_rectangles): Set n_clip_rects directly instead of
+ calling mac_set_clip_rectangles.
+ (x_set_toolkit_scroll_bar_thumb): Temporarily hide scroll bar to
+ avoid multiple redraws.
+
+2006-02-22 Kim F. Storm <[email protected]>
+
+ * fringe.c (draw_fringe_bitmap): Fix overlay-arrow display.
+
+2006-02-21 Kim F. Storm <[email protected]>
+
+ * fringe.c (syms_of_fringe) <fringe-bitmaps>: Doc fix.
+
+2006-02-21 Zhang Wei <[email protected]>
+
+ * xfns.c (Fx_file_dialog, Motif and GTK): DECODE_FILE before
+ returning it.
+
+2006-02-21 Giorgos Keramidas <[email protected]> (tiny change)
+
+ * fringe.c (horizontal_bar_bits): Rename from `horisontal_bar_bits'.
+ (standard_bitmaps): Use it.
+
+2006-02-21 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.c (mac_draw_string_common): Remove arg MODE. New arg
+ BG_WIDTH. All uses changed. Draw background if BG_WIDTH is not zero.
+ (mac_draw_image_string, mac_draw_image_string_16): New arg BG_WIDTH.
+ [USE_CG_TEXT_DRAWING] (mac_draw_image_string_cg): Rename from
+ mac_draw_string_cg. New arg BG_WIDTH. All uses changed.
+ Draw background if BG_WIDTH is not zero. Use float constants as
+ divisors instead of double. Use alloca instead of xmalloc/xfree.
+ (x_draw_glyph_string_background, x_draw_glyph_string_foreground)
+ [!MAC_OS8 || USE_ATSUI]: Background may be drawn using
+ mac_draw_image_string* functions.
+ (XLoadQueryFont) [MAC_OS8 && USE_ATSUI]: Don't adjust heights of
+ some fonts when srcCopy text transfer mode might be used.
+ (mac_begin_clip, mac_end_clip): Check if region is empty.
+ (mac_set_clip_rectangles): When resetting clip region, make it
+ empty instead of disposing of it.
+
+2006-02-20 Kim F. Storm <[email protected]>
+
+ * Makefile.in: Add fringe.elc to WINDOW_SUPPORT.
+
+ * buffer.h (struct buffer): New members fringe_indicator_alist and
+ fringe_cursor_alist.
+
+ * buffer.c (init_buffer_once): Set dummy default values for
+ fringe-indicator-alist and fringe-cursor-alist. The proper
+ default values are set by pre-loading fringe.el.
+ (syms_of_buffer): defvar_per_buffer new fringe-indicator-alist and
+ fringe-cursor-alist buffer-local variables and defvar_lisp_nopro
+ corresponding default- variables.
+
+ * fringe.c (enum fringe_bitmap_type): Remove. Change all uses
+ to use `int'.
+ (NO_FRINGE_BITMAP, UNDEF_FRINGE_BITMAP, MAX_STANDARD_FRINGE_BITMAPS):
+ Define explicitly.
+ (Qtruncation, Qcontinuation, Qempty_line, Qtop_bottom)
+ (Qhollow_small): New variables.
+ (syms_of_fringe): Intern and staticpro them.
+ (question_mark_bits): Rename from unknown_bits.
+ (left_curly_arrow_bits): Rename from continuation_bits.
+ (right_curly_arrow_bits): Rename from continued_bits.
+ (left_triangle_bits): Rename from ov_bits.
+ (right_triangle_bits): Add.
+ (filled_rectangle_bits): Rename from filled_box_cursor_bits.
+ (hollow_rectangle_bits): Rename from hollow_box_cursor_bits.
+ (filled_square_bits): Add.
+ (vertical_bar_bits): Rename from bar_cursor_bits.
+ (horizontal_bar_bits): Rename from hbar_cursor_bits.
+ (empty_line_bits): Rename from zv_bits.
+ (standard_bitmaps): Update to use new names.
+ (draw_fringe_bitmap_1): Make static.
+ (get_logical_cursor_bitmap, get_logical_fringe_bitmap): New functions
+ to map from logical cursors and indicators to physical bitmaps.
+ (draw_fringe_bitmap): Resolve fringe cursor and overlay-arrow
+ bitmaps using symbol names instead of bitmap numbers.
+ (update_window_fringes): Use logical indicator symbol names
+ instead of bitmap numbers for logical. Add bitmap cache.
+ (LEFT_FRINGE, RIGHT_FRINGE): New helper macros.
+
+2006-02-20 Chong Yidong <[email protected]>
+
+ * regex.c: Revert 2006-02-19 change.
+ (xmalloc, xrealloc): Define these when not linked to Emacs.
+ Redefine malloc -> xmalloc, realloc -> xrealloc as in Emacs case.
+
+2006-02-19 Luc Teirlinck <[email protected]>
+
+ * regex.c (extend_range_table_work_area): Fix typo.
+
+2006-02-19 Richard M. Stallman <[email protected]>
+
+ * xterm.c (x_catch_errors): Use xmalloc.
+
+ * regex.c (extend_range_table_work_area): Call xmalloc and xrealloc.
+ (regex_compile): Likewise.
+ (regcomp): Use xmalloc.
+
+ * gtkutil.c (malloc_widget_value): Use xmalloc.
+
+ * vm-limit.c [HAVE_GETRLIMIT]: Include sys/resource.h.
+ (check_memory_limits) [HAVE_GETRLIMIT]: Use getrlimit.
+
+ * xmenu.c (digest_single_submenu): When pane_string is empty,
+ do initialize save_wv.
+
+2006-02-19 YAMAMOTO Mitsuharu <[email protected]>
+
+ * xdisp.c (update_menu_bar) [MAC_OS]: Don't set
+ w->update_mode_line if arg F is not the selected frame.
+
+ * macmenu.c (popup_activated_flag, submenu_id)
+ (next_menubar_widget_id): Remove variables.
+ (initialize_frame_menubar): Remove function.
+ (pop_down_menu, mac_menu_show): Simplify save value.
+ (dispose_menus): New function.
+ (pop_down_menu, fill_menubar): Use it.
+ (fill_submenu): Remove function. All uses changed to fill_menu.
+ (add_menu_item): Remove args SUBMENU and FORCE_DISABLE. New arg
+ POS. Don't call SetMenuItemHierarchicalID here.
+ (fill_menu): Add arg SUBMENU_ID. Return submenu_id that is to be
+ used next. Call SetMenuItemHierarchicalID here.
+ (fill_menubar): Add arg DEEP_P. All uses changed. Clean up menu
+ objects if needed. Reuse existing menu bar titles if possible.
+ (set_frame_menubar): Don't clean up menu objects here.
+
+2006-02-18 Chong Yidong <[email protected]>
+
+ * window.c (window_min_size_1): Ensure room for the scroll bar and
+ fringes.
+
+2006-02-17 Romain Francoise <[email protected]>
+
+ * puresize.h (BASE_PURESIZE): Increment to 1200000.
+
+2006-02-17 Stefan Monnier <[email protected]>
+
+ * alloc.c (Fmake_symbol): Comment-out left-over assert from before the
+ addition of the BLOCK_INPUTs.
+
+2006-02-17 Juanma Barranquero <[email protected]>
+
+ * window.c (Fset_window_scroll_bars): Doc fix.
+
+2006-02-17 Kenichi Handa <[email protected]>
+
+ * xdisp.c (display_mode_element): Call display_string with correct
+ PREC arg (which must be a number of characters, not column width).
+
+2006-02-15 YAMAMOTO Mitsuharu <[email protected]>
+
+ * frame.c (x_get_arg): Clear out PARAM in ALIST also on Mac.
+
+ * macfns.c (x_set_menu_bar_lines): Menu bar is always shown on Mac.
+
+ * macmenu.c (set_frame_menubar): Don't call DrawMenuBar.
+
+2006-02-14 Richard M. Stallman <[email protected]>
+
+ * frame.c (x_get_arg): Clear out all occurrences of PARAM in ALIST.
+
+ * m/ibms390x.h: New file.
+
+2006-02-14 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c (xg_tool_bar_detach_callback): Set show-arrow to the
+ value of x-gtk-whole-detached-tool-bar.
+ (xg_tool_bar_attach_callback): Set show-arrow to TRUE.
+
+ * xfns.c (syms_of_xfns): New variable: x-gtk-whole-detached-tool-bar.
+
+2006-02-14 Jan Dj,Ad(Brv <[email protected]>
+
+ * xterm.c (x_x_to_emacs_modifiers): Make non-static.
+
+ * xterm.h: Declare x_x_to_emacs_modifiers.
+
+ * gtkutil.c (xg_tool_bar_button_cb): New function.
+ (xg_tool_bar_callback): Call x_x_to_emacs_modifiers to
+ store modifiers in event.
+ (update_frame_tool_bar): Connect button-release-event to
+ xg_tool_bar_button_cb.
+
+2006-02-13 Richard M. Stallman <[email protected]>
+
+ * .gdbinit (xwindow): Update the code to show the window box.
+
+2006-02-13 Jan Dj,Ad(Brv <[email protected]>
+
+ * xterm.c (note_mouse_movement): Check for NULL FRAME_X_OUTPUT (frame).
+
+2006-02-12 Richard M. Stallman <[email protected]>
+
+ * cmds.c (internal_self_insert): Handle weird auto-fill-function.
+
+2006-02-11 Eli Zaretskii <[email protected]>
+
+ * keyboard.c (Venable_disabled_menus_and_buttons): New variable.
+ (syms_of_keyboard): DEVFAR_LISP and initialize it.
+ (parse_tool_bar_item, parse_menu_item): If that variable is
+ non-nil, don't disable menu items and tool-bar buttons.
+
+2006-02-11 Juanma Barranquero <[email protected]>
+
+ * doc.c (Fsubstitute_command_keys): Doc fix.
+
+2006-02-10 Thien-Thi Nguyen <[email protected]>
+
+ * data.c (Findirect_function): Rewrite docstring.
+ Fix omission bug: Declare new arg NOERROR.
+
+2006-02-10 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macfns.c (x_set_mouse_color): Don't call rif->define_frame_cursor
+ if window_desc is not set yet.
+ (Fx_create_frame): Remove variable x_frame_name. Apply 2005-12-07
+ and 2006-01-26 changes for xfns.c. Call x_iconify_frame if frame
+ parameter `visibility' is `icon'.
+ (Fx_create_frame, x_create_tip_frame): Use "fontset-standard"
+ instead of "fontset-mac".
+ (Fx_focus_frame): New defun.
+ (syms_of_macfns): Defsubr it.
+
+ * macterm.c (mac_define_frame_cursor): Don't change pointer shape
+ for unfocused frame.
+ (x_raise_frame): Call BringToFront instead of SelectWindow.
+ (x_lower_frame): Use NULL instead of nil.
+ (x_make_frame_visible): Don't call SelectWindow.
+ (XTread_socket): Increment handling_signal at the start, decrement
+ it at the end.
+ [USE_CG_TEXT_DRAWING] (init_cg_text_anti_aliasing_threshold): Use
+ CFPreferencesGetAppIntegerValue instead of Fmac_get_preference.
+
+2006-02-10 Kim F. Storm <[email protected]>
+
+ * data.c (Findirect_function): Add NOERROR arg. All callers changed
+ to pass Qnil for NOERROR.
+
+ * keymap.c (current_minor_maps_error): Remove.
+ (current_minor_maps): Pass Qt for NOERROR to Findirect_function
+ instead of using internal_condition_case_1+current_minor_maps_error.
+
+2006-02-09 Jan Dj,Ad(Brv <[email protected]>
+
+ * xterm.c (handle_one_xevent): Must note mouse movement even for nil
+ frames for GTK, in that case it is the tool bar. This is so that
+ highlighted text get reset properly.
+
+2006-02-09 Juanma Barranquero <[email protected]>
+
+ * alloc.c (Fmake_bool_vector, Fpurecopy): Doc fixes.
+
+2006-02-08 Jan Dj,Ad(Brv <[email protected]>
+
+ * window.c (adjust_window_trailing_edge): Check that shrinking
+ does not set a window to size zero or less.
+
+2006-02-08 Miles Bader <[email protected]>
+
+ * editfns.c (Fconstrain_to_field): Use Fget_char_property instead
+ of Fget_text_property (other field functions work with overlays as
+ well as text-properties).
+
+2006-02-07 Kenichi Handa <[email protected]>
+
+ * dispextern.h (unibyte_display_via_language_environment): Extern it.
+
+ * xterm.h (unibyte_display_via_language_environment):
+ * w32term.h (unibyte_display_via_language_environment):
+ * macterm.h (unibyte_display_via_language_environment): Delete extern.
+
+2006-02-07 Kenichi Handa <[email protected]>
+
+ * term.c (append_glyph): Refer to it->char_to_display instead of it->c.
+ (produce_glyphs): Set the character to print in
+ it->char_to_display. Handle unibyte-display-via-language-environment.
+ (produce_stretch_glyph): Set character to print in it->char_to_display.
+
+2006-02-06 Kenichi Handa <[email protected]>
+
+ * lread.c (openp): Initialize encoded_fn before GCPRO it.
+
+2006-02-05 Ken Raeburn <[email protected]>
+
+ * editfns.c (Fconstrain_to_field): Fix int/Lisp_Object mixup.
+
+ * lisp.h (XPNTR) [!NO_UNION_TYPE && !HAVE_SHM && !DATA_SEG_BITS]:
+ Cast bitfield value to EMACS_INT, to suppress gcc warning.
+
+ * xrdb.c (malloc, realloc, free) [emacs]: Undefine macros before
+ defining.
+
+2006-02-03 Kim F. Storm <[email protected]>
+
+ * xdisp.c: Cache last merged escape glyph face.
+ (last_escape_glyph_frame, last_escape_glyph_face_id)
+ (last_escape_glyph_merged_face_id): New variables.
+ (get_next_display_element): Use/update them.
+ (redisplay_internal): Reset them before redisplay.
+
+ * xdisp.c (set_iterator_to_next): Optimize 2004-12-13 fix.
+ Only recheck faces after displaying ellipsis.
+
+2006-02-02 Kenichi Handa <[email protected]>
+
+ * coding.c (decode_composition_emacs_mule): Fix handling of
+ incorrect format data.
+
+2006-01-31 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c (update_frame_tool_bar): Use new tool bar function
+ gtk_toolbar_insert() so we can have tool bars of different sizes.
+
+2006-01-30 Luc Teirlinck <[email protected]>
+
+ * data.c (Flistp): Doc fix.
+
+2006-01-30 Juanma Barranquero <[email protected]>
+
+ * window.c (Fother_window, Fwindow_vscroll, Fset_window_vscroll):
+ Fix typos in docstrings.
+
+2006-01-28 Luc Teirlinck <[email protected]>
+
+ * data.c (Fcar, Fcdr): Add links to Elisp manual to the docstrings.
+
+2006-01-27 Chong Yidong <[email protected]>
+
+ * alloc.c (make_interval, allocate_string)
+ (allocate_string_data, make_float, Fcons, allocate_vectorlike)
+ (Fmake_symbol, allocate_misc): Use BLOCK_INPUT when accessing
+ global variables.
+
+2006-01-27 Eli Zaretskii <[email protected]>
+
+ * dired.c (DIRENTRY_NONEMPTY) [__CYGWIN__]: Don't use d_ino; use
+ the MSDOS definition.
+
+2006-01-26 Richard M. Stallman <[email protected]>
+
+ * alloc.c (check_pure_size): Make overflow message an "error message".
+
+ * keymap.c (Fmap_keymap): Doc fix.
+
+ * xfns.c (Fx_create_frame): Put all specified parms into f->param_alist
+ unless they were cleared out.
+
+ * frame.c (x_get_arg): "Clear out" the parm in ALIST if found there.
+
+2006-01-26 L$,1 q(Brentey K,Aa(Broly <[email protected]>
+
+ * editfns.c (Fconstrain_to_field): Fix behaviour on field boundaries.
+ (find_field): Set before_field to after_field when pos is at BEGV.
+ (Fline_beginning_position, Fline_end_position):
+ Clarify confusing doc string.
+
+ * cmds.c (Fbeginning_of_line, Fend_of_line): Clarify confusing doc
+ string.
+
+2006-01-26 Kenichi Handa <[email protected]>
+
+ * callproc.c (Fcall_process): GCPRO error_file. Encode infile,
+ current_dir, and error_file. On reporting an error, decode them
+ back.
+
+2006-01-24 Stefan Monnier <[email protected]>
+
+ * regex.c (IMMEDIATE_QUIT_CHECK): Use it with SYNC_INPUT as well.
+ (re_match_2_internal) <on_failure_jump, on_failure_jump_smart>:
+ Don't check for quit, since any loop will go through fail or jump.
+
+2006-01-24 Chong Yidong <[email protected]>
+
+ * alloc.c (allocate_string_data): Update next_free immediately, to
+ reduce risk of memory clobberage.
+
+2006-01-24 L$,1 q(Brentey K,Aa(Broly <[email protected]>
+
+ * xdisp.c (handle_invisible_prop): Set it->position to fix cursor
+ display when point moves across an ellipsis. If there are
+ adjacent invisible texts, don't lose the second one's ellipsis.
+ (x_produce_glyphs): Doc fix.
+
+2006-01-23 Stefan Monnier <[email protected]>
+
+ * xterm.c (x_catch_errors_unwind): Yet another int/Lisp_Object mixup.
+
+2006-01-23 Kim F. Storm <[email protected]>
+
+ * xdisp.c (handle_single_display_spec): Fix handling of space
+ property on char from string: set *position rather than
+ it->current.pos.
+ (produce_stretch_glyph): Reduce width of stretch glyphs so they
+ don't get wider than the window (unless truncate-lines is on).
+
+2006-01-22 Stefan Monnier <[email protected]>
+
+ * xterm.c: Avoid allocating Lisp data from a signal handler.
+ (x_error_message): New var to replace x_error_message_string.
+ (x_error_catcher, x_catch_errors, x_catch_errors_unwind)
+ (x_check_errors, x_had_errors_p, x_clear_errors, x_error_handler)
+ (syms_of_xterm): Use it instead of x_error_message_string.
+
+ * alloc.c (lisp_align_free): Add an assertion.
+ (make_interval, allocate_string, make_float, Fcons, Fmake_symbol)
+ (allocate_misc): If ENABLE_CHECKING is on, check we're not called from
+ a signal handler.
+
+2006-01-21 Luc Teirlinck <[email protected]>
+
+ * dired.c (syms_of_dired) <completion-ignored-extensions>: Doc fix.
+
+2006-01-21 Romain Francoise <[email protected]>
+
+ * xdisp.c (get_window_cursor_type): Fix last change.
+ Update copyright year.
+
+2006-01-20 Eli Zaretskii <[email protected]>
+
+ * lread.c (Fload): Don't leak the file descriptor returned by
+ openp if we are going to signal an error.
+
+ * w32.c (sys_close): If FD is outside [0..MAXDESC) limits, pass it
+ directly to _close.
+ (sys_dup): Protect against new_fd larger than fd_info[] can handle.
+ (sys_read): If FD is outside [0..MAXDESC) limits, pass it directly
+ to _read.
+ (sys_write): If FD is outside [0..MAXDESC) limits, pass it
+ directly to _write.
+
+ * .gdbinit: Don't dereference Vsystem_type's Lisp_Symbol pointer
+ if it is NULL.
+
+2006-01-20 Kenichi Handa <[email protected]>
+
+ * puresize.h (BASE_PURESIZE): Increment to 1190000.
+
+2006-01-19 Chong Yidong <[email protected]>
+
+ * xdisp.c (get_window_cursor_type): Use cursor type specified by
+ the selected buffer for the echo area too.
+
+2006-01-19 Richard M. Stallman <[email protected]>
+
+ * keymap.c (Fmap_keymap): Doc fix.
+
+ * s/irix6-5.h (GC_SETJMP_WORKS, GC_MARK_STACK): New definitions.
+
+ * keyboard.c (echo_char): Don't omit the space between first two
+ echoed chars.
+
+ * minibuf.c (read_minibuf): Fix previous change.
+
+2006-01-19 Kenichi Handa <[email protected]>
+
+ * xterm.c (handle_one_xevent): Handle keysyms 0x1000000..0x10000FF.
+
+2006-01-17 Richard M. Stallman <[email protected]>
+
+ * frame.c (x_frame_get_and_record_arg): Don't record Qunbound
+ value in f->param_alist.
+
+2006-01-15 Andreas Schwab <[email protected]>
+
+ * search.c (Freplace_match): Use UPPERCASEP instead of !NOCASEP.
+
+2006-01-13 Richard M. Stallman <[email protected]>
+
+ * Makefile.in: Define new macro WINDOW_SUPPORT.
+ (lisp): Use it.
+ (SOME_MACHINE_LISP): Add conditionally loaded files.
+
+2006-01-12 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.c [USE_ATSUI] (atsu_get_text_layout_with_text_ptr)
+ [MAC_OS_X_VERSION_MAX_ALLOWED >= 1020]: Specify kATSLineUseQDRendering.
+ (XLoadQueryFont) [USE_ATSUI]: Display diacritical marks in
+ decomposed form.
+
+ * process.c [HAVE_INTTYPES_H]: Include inttypes.h.
+ (ifflag_table): Fix typo (IFF_OACTIV -> IFF_OACTIVE).
+ (Fnetwork_interface_info): Use HAVE_STRUCT_IFREQ_IFR_NETMASK
+ macro. Also try member ifr_addr when getting netmask.
+
+2006-01-10 Stefan Monnier <[email protected]>
+
+ * fileio.c (Fexpand_file_name): Remove redundant tests.
+ Fix elimination of // so that it doesn't prevent elimination of an
+ immediately following /. or /..
+
+2006-01-09 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c (xg_toggle_notify_cb): New function.
+ (xg_toggle_visibility_cb): Move setting of x_gtk_show_hidden_files to
+ xg_toggle_notify_cb.
+ (xg_get_file_with_chooser): Add callback to xg_toggle_notify_cb when
+ parameter value changes so the toggle button gets updated.
+
+2006-01-06 Nick Roberts <[email protected]>
+
+ * .gdbinit: Fix typo.
+
+2006-01-05 Eli Zaretskii <[email protected]>
+
+ * .gdbinit: Fix last change.
+
+2006-01-05 Kim F. Storm <[email protected]>
+
+ * process.c (Fmake_network_process): Use AF_INET instead of
+ AF_UNSPEC when AF_INET6 is not defined.
+
+2006-01-05 YAMAMOTO Mitsuharu <[email protected]>
+
+ * mac.c (mac_coerce_file_name_ptr, mac_coerce_file_name_desc):
+ Don't check that the other type is known file-related one.
+
+ * macfns.c (Fx_server_version): Use gestaltSystemVersionMajor,
+ gestaltSystemVersionMinor, and gestaltSystemVersionBugFix on Mac
+ OS X 10.4 and later.
+
+2006-01-04 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c (xg_get_image_for_pixmap): If the image is from a file,
+ let GTK do all image processing. Importing Emacs own pixmaps to GTK
+ looks bad for inactive tool bar items with some Gnome themes.
+
+2006-01-04 Eli Zaretskii <[email protected]>
+
+ * .gdbinit: Avoid a warning message when x_error_quitter is not
+ compiled in.
+
+ * process.c [WINDOWSNT]: Undef AF_INET6 to disable IPv6 support
+ for w32.
+
+2006-01-04 Kim F. Storm <[email protected]>
+
+ * process.c: Add IPv6 support.
+ (Qipv4, Qipv6): New vars.
+ (syms_of_process): Intern and staticpro them.
+ (Fformat_network_address): Handle 9 or 8 element vector as IPv6 address
+ with or without port number. Handle 4 element vector as IPv4 address
+ without port number.
+ (conv_sockaddr_to_lisp, get_lisp_to_sockaddr_size)
+ (conv_lisp_to_sockaddr): Handle IPv6 addresses.
+ (Fmake_network_process): Use :family 'ipv4 and 'ipv6 to explicitly
+ request that address family only. :family nil or omitted means to
+ determine address family from the specified :host and :service.
+ (ifflag_table): Add missing OpenBSD IFF_ flags.
+ (server_accept_connection): Handle IPv6 addresses.
+ (init_process): Add (:family ipv4) and (:family ipv6) sub-features.
+
+ * .gdbinit: Undo last change. Instead, look at Vsystem_type to
+ determine which breakpoints to set.
+
+2006-01-03 Stefan Monnier <[email protected]>
+
+ * keymap.c (describe_map_compare): Yet another int/Lisp_Object mixup.
+
+ * window.h (Fwindow_minibuffer_p): Declare (for use in minibuf.c).
+
+2006-01-03 Romain Francoise <[email protected]>
+
+ * emacs.c (main): Update copyright year.
+
+2006-01-03 Ken Raeburn <[email protected]>
+
+ * callproc.c (delete_temp_file): Bind file-name-handler-alist to
+ nil for the call to internal_delete_file.
+
+2006-01-01 Ken Raeburn <[email protected]>
+
+ * callproc.c (Fcall_process_region): Bind file-name-handler-alist
+ to nil for the call to Fwrite_region.
+
+2005-12-31 Richard M. Stallman <[email protected]>
+
+ * minibuf.c (read_minibuf): Clear out all other minibuffer windows.
+
+2005-12-31 Eli Zaretskii <[email protected]>
+
+ * emacs.c (gdb_pvec_type): A dummy variable for GDB's sake.
+
+2005-12-30 Luc Teirlinck <[email protected]>
+
+ * textprop.c (set_text_properties): Reword description of return value.
+ Return Qnil if caller wants to remove all text properties from a
+ string and the string already has no intervals.
+
+2005-12-30 Stefan Monnier <[email protected]>
+
+ * term.c (visible_cursor): New boolean var.
+ (set_terminal_modes, tty_show_cursor): Use "vs" or "ve" depending on
+ visible_cursor.
+ (syms_of_term): Export the new var as "visible-cursor".
+
+2005-12-30 Eli Zaretskii <[email protected]>
+
+ * .gdbinit: Tell users not to worry about GDB warnings that some
+ functions do not exist in the binary.
+
+2005-12-30 Andreas Schwab <[email protected]>
+
+ * process.c (Fnetwork_interface_info): Correctly terminate the
+ loop over ifflag_table.
+
+2005-12-29 Richard M. Stallman <[email protected]>
+
+ * lread.c (readevalloop): Test for reading a whole buffer
+ before actually reading anything. Handle all cases, including
+ START = END = nil and an already-narrowed buffer.
+ Convert END to a marker if it is a number.
+
+ * keymap.c (describe_map): Put sparse map elements into an array,
+ sort them, then output a sequence of identical bindings on one line.
+ (struct describe_map_elt): New data type.
+ (describe_map_compare): New function.
+
+2005-12-28 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c (xg_get_file_with_chooser): Change message shown
+ in file chooser.
+
+2005-12-27 Richard M. Stallman <[email protected]>
+
+ * lread.c (readevalloop): Set PT and ZV in the proper buffer,
+ not the current one.
+
+ * minibuf.c (Fminibuffer_message): Doc fix.
+ (read_minibuf): Set current_buffer->enable_multibyte_characters sooner.
+
+ * eval.c (do_autoload): Ignore elements of Vautoload_queue
+ where car is not symbol.
+
+2005-12-27 Kenichi Handa <[email protected]>
+
+ * charset.c (lisp_string_width): Check multibyteness of STRING.
+
+2005-12-27 Jan Dj,Ad(Brv <[email protected]>
+
+ * xfns.c (x_show_hidden_files): New variable.
+ (syms_of_xfns): Defvar it.
+
+ * gtkutil.c (xg_toggle_visibility_cb): New function.
+ (xg_get_file_with_chooser): Add toggle hidden files and a message
+ to the new file chooser dialog. Show hidden files if
+ x_show_hidden_files is non-zero.
+
+2005-12-26 Richard M. Stallman <[email protected]>
+
+ * keyboard.h: Undo previous change.
+
+ * Makefile.in (undo.o): Undo previous change.
+
+ * undo.c: Undo previous change.
+
+2005-12-26 Luc Teirlinck <[email protected]>
+
+ * keyboard.h: extern last_point_position_window.
+
+ * undo.c: include keyboard.h.
+
+ * Makefile.in (undo.o): Depend on keyboard.h.
+
+2005-12-26 Richard M. Stallman <[email protected]>
+
+ * commands.h (last_point_position_window): Declare.
+
+ * undo.c: Depend on window.h.
+ (record_point): Save old point from the correct window.
+
+ * keyboard.c (last_point_position_window): New variable.
+ (command_loop_1): Set last_point_position_window.
+ (syms_of_keyboard): Init it.
+
+ * Makefile.in (undo.o): Depend on window.h.
+
+2005-12-25 Richard M. Stallman <[email protected]>
+
+ * eval.c (un_autoload): Expect (0 . OFEATURES) in Vautoload_queue
+ to undo a `provide'.
+
+ * fns.c (Fprovide): Store (0 . OFEATURES) in Vautoload_queue.
+
+2005-12-25 Giorgos Keramidas <[email protected]>
+
+ * m/amdx86-64.h [__FreeBSD__] (START_FILES, LIB_STANDARD):
+ define for FreeBSD on this platform.
+
+2005-12-24 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.h (TYPE_FILE_NAME): New define.
+ (posix_pathname_to_fsspec, fsspec_to_posix_pathname): Remove externs.
+
+ * mac.c (posix_pathname_to_fsspec, fsspec_to_posix_pathname):
+ Add prototypes. Make static.
+ (mac_aedesc_to_lisp): Initialize err to noErr.
+ (mac_coerce_file_name_ptr, mac_coerce_file_name_desc)
+ (init_coercion_handler): New functions.
+ (Fmac_coerce_ae_data): Use coercion of Apple event data for
+ translation from/to file names.
+
+ * macterm.c: Don't include sys/param.h.
+ (init_coercion_handler): Add extern.
+ [MAC_OS8] (main): Call init_coercion_handler.
+ (mac_initialize) [MAC_OSX]: Likewise.
+ [TARGET_API_MAC_CARBON] (mac_do_receive_drag): Use coercion of
+ Apple event data for translation from/to file names.
+
+ * macfns.c [TARGET_API_MAC_CARBON] (Fx_file_dialog): Likewise.
+
+ * image.c [MAC_OS] (find_image_fsspec): Likewise.
+
+2005-12-23 Martin Rudalics <[email protected]>
+
+ * insdel.c (insert, insert_and_inherit, insert_before_markers)
+ (insert_before_markers_and_inherit): Make sure FROM is correct
+ when `after-change-functions' are called.
+
+2005-12-23 Jan Dj,Ad(Brv <[email protected]>
+
+ * xfns.c (Fx_uses_old_gtk_dialog): New function.
+
+ * gtkutil.c (xg_uses_old_file_dialog): New function.
+ (xg_get_file_name): Use xg_uses_old_file_dialog.
+
+ * gtkutil.h: Declare xg_uses_old_file_dialog.
+
+2005-12-22 Richard M. Stallman <[email protected]>
+
+ * xmenu.c (xmenu_show): Call inhibit_garbage_collection.
+
+2005-12-22 YAMAMOTO Mitsuharu <[email protected]>
+
+ * mac.c (Fmac_coerce_ae_data) [MAC_OSX]: Fix memory leak.
+
+ * macgui.h (XCharStruct): Remove member `valid_p'.
+ (STORE_XCHARSTRUCT): Don't set member `valid_p'.
+ (XCharStructRow): New typedef.
+ (XCHARSTRUCTROW_CHAR_VALID_P, XCHARSTRUCTROW_SET_CHAR_VALID):
+ New macros.
+ (struct MacFontStruct): Add member `bounds'. Remove member
+ `per_char'. All uses for QuichDraw Text fonts are changed to
+ `bounds.per_char'. ATSUI font bounds are represented as an array
+ `bounds.rows' of XCharStructRow's, each of which consists of a
+ bitmap of valid entries and an array of char bounds.
+
+ * macterm.c (mac_per_char_metric): Add prototype.
+ (x_per_char_metric) [USE_CG_TEXT_DRAWING]: Remove prototype.
+ (mac_query_char_extents): New function.
+ (x_per_char_metric): Use it.
+ (XLoadQueryFont): Likewise. Consolidate min/max_bounds calculations.
+ [USE_CG_TEXT_DRAWING] (mac_draw_string_cg):
+ Use mac_per_char_metric instead of x_per_char_metric.
+ (mac_text_extents_16): New function.
+ (mac_compute_glyph_string_overhangs): Use it.
+ (mac_unload_font): Free member `bounds' in struct MacFontStruct.
+
+2005-12-21 Stefan Monnier <[email protected]>
+
+ * minibuf.c (Fdisplay_completion_list): Use XCAR/XCDR.
+ (Fminibuffer_completion_help): Remove duplicates before display.
+
+2005-12-21 L$,1 q(Brentey K,Aa(Broly <[email protected]>
+
+ * print.c (print_preprocess): Don't lose print_depth levels while
+ iterating.
+
+2005-12-21 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macmenu.c (Qmac_apple_event): Add extern.
+ (set_frame_menubar, mac_menu_show keymp_panes)
+ (single_keymap_panes, list_of_panes, list_of_item)
+ (single_menu_item): Add argument types to prototypes.
+ (mac_dialog_show) [HAVE_DIALOGS]: Likewise.
+ (struct skp): New struct (from xmenu.c).
+ (single_keymap_panes, single_menu_item, list_of_panes)
+ (list_of_item): Sync with xmenu.c.
+ (Fx_popup_menu, Fx_popup_dialog): Likewise. Don't get window from
+ POSITION if it is mac-apple-event event.
+ (menubar_selection_callback): Don't use menu_command_in_progress.
+ (set_frame_menubar): First parse all submenus, then make
+ widget_value trees from them. Don't allocate any widget_value
+ objects until we are done with the parsing.
+ (parse_single_submenu, digest_single_submenu): New functions.
+ (single_submenu): Function deleted, replaced by those two.
+ (install_menu_quit_handler) [HAVE_CANCELMENUTRACKING]: Don't create
+ or dispose of EventHandlerUPP. Install hander to all submenus.
+ (mac_menu_show) [!HAVE_MULTILINGUAL_MENU]: Use ENCODE_MENU_STRING
+ instead of ENCODE_SYSTEM.
+ (free_frame_menubar, fill_submenu, fill_menu): Don't use NULL for
+ integer values.
+ [HAVE_DIALOGS] (mac_dialog_show): Sync with xdialog_show (in xmenu.c).
+ (add_menu_item) [TARGET_API_MAC_CARBON]: Use CFString functions to
+ format menu item string. Don't use NULL for integer value.
+
+ * macterm.h (struct mac_output): Remove unused member
+ menu_command_in_progress.
+
+2005-12-20 Juri Linkov <[email protected]>
+
+ * xmenu.c (Fx_popup_menu): Set Vmenu_updating_frame to f if
+ position is non-nil, else set it to nil.
+
+ * macmenu.c (Fx_popup_menu): Add `else' to set
+ Vmenu_updating_frame to nil only if position is nil.
+
+ * w32menu.c (Fx_popup_menu): Add `else' to set
+ Vmenu_updating_frame to nil only if position is nil.
+
+2005-12-19 YAMAMOTO Mitsuharu <[email protected]>
+
+ * keyboard.c (make_lispy_event): Drag-and-drop items are now
+ stored in member `args' of struct input_event.
+
+ * termhooks.h (struct input_event): Fix comment for DRAG_N_DROP_EVENT.
+
+ * xselect.c (x_handle_dnd_message): Drag-and-drop items are now
+ stored in member `args' of struct input_event.
+
+ * w32term.c (construct_drag_n_drop): Likewise.
+
+ * macterm.c (mac_do_receive_drag): Likewise.
+ (x_use_underline_position_properties): Undo 2005-07-13 change.
+ (syms_of_macterm) <x-use-underline-position-properties>: Likewise.
+ (mac_use_core_graphics, mac_wheel_button_is_mouse_2)
+ (mac_pass_command_to_system, mac_pass_control_to_system):
+ New boolean variables renamed from Lisp_Object ones
+ Vmac_use_core_graphics, Vmac_wheel_button_is_mouse_2,
+ Vmac_pass_command_to_system, and Vmac_pass_control_to_system.
+ All uses changed.
+ (syms_of_macterm): DEFVAR_BOOL them. Remove previous DEFVAR_LISPs.
+ Make them user options.
+ (mac_handle_command_event, mac_store_services_event):
+ Call create_apple_event_from_event_ref without 5th argument.
+ (backtranslate_modified_keycode): Mask off modifier keys that are
+ mapped to some Emacs modifiers before passing it to KeyTranslate.
+ (syms_of_macterm): Make variables `mac-emulate-three-button-mouse',
+ `mac-wheel-button-is-mouse-2', and `mac-*-modifier' user options.
+ Fix docstrings of `mac-*-modifier'.
+
+ * mac.c (create_apple_event_from_event_ref): Remove arg `types'.
+ (do_applescript): Change argument types to Lisp_Object.
+ All uses changed.
+
+ * macterm.h (create_apple_event_from_event_ref): Remove 5th
+ argument from extern.
+
+2005-12-18 Dan Nicolaescu <[email protected]>
+
+ * xfns.c (Fx_backspace_delete_keys_p): In case we cannot determine
+ the answer, return `lambda', not nil.
+
+2005-12-17 Eli Zaretskii <[email protected]>
+
+ * makefile.w32-in (bootstrap-temacs): Warn that parts of commands
+ enclosed in $(ARGQUOTE)s should not be split between two lines, as
+ that will break with GNU Make >3.80, when sh.exe is used and
+ arg quoting is with '..'.
+
+2005-12-17 Chong Yidong <[email protected]>
+
+ * print.c (print_preprocess): Just signal an error if print_depth
+ is exceeded.
+
+2005-12-17 Eli Zaretskii <[email protected]>
+
+ * .gdbinit: Set a breakpoint on w32_abort.
+
+2005-12-16 Juri Linkov <[email protected]>
+
+ * minibuf.c (Fminibuffer_completion_contents): New Lisp function
+ created from minibuffer_completion_contents.
+ (minibuffer_completion_contents): Remove.
+ (do_completion, Fminibuffer_complete_word)
+ (Fminibuffer_completion_help): Replace minibuffer_completion_contents
+ with Fminibuffer_completion_contents.
+ (syms_of_minibuf): Add Sminibuffer_completion_contents.
+ (Fdisplay_completion_list): Doc fix.
+ (display_completion_list_1): Use `nil' for second arg of
+ `Fdisplay_completion_list'.
+
+2005-12-14 Jan Dj,Ad(Brv <[email protected]>
+
+ * xfns.c (compute_tip_xy): Handle negative dx and dy.
+
+ * w32fns.c (compute_tip_xy): Ditto.
+
+ * macfns.c (compute_tip_xy): Ditto.
+
+2005-12-14 Chong Yidong <[email protected]>
+
+ * print.c (print_preprocess): Go to a deeper print_depth to avoid
+ print_object loop.
+
+2005-12-14 Kyotaro HORIGUCHI <[email protected]> (tiny change)
+
+ * coding.c (code_convert_region_unwind): GCPRO arg.
+
+2005-12-12 Jan Dj,Ad(Brv <[email protected]>
+
+ * xfns.c (compute_tip_xy): Calculate root_y the same way as root_x,
+ i.e. dy is offset from top of frame instead of bottom.
+
+ * macfns.c (compute_tip_xy): Ditto.
+
+ * w32fns.c (compute_tip_xy): Ditto.
+
+ * gtkutil.c (SSDATA): New macro to remove compiler warnings.
+ (xg_get_image_for_pixmap, xg_create_frame_widgets)
+ (xg_get_file_with_chooser): Use SSDATA instead of SDATA.
+
+ * xmenu.c (menubar_selection_callback): Do nothing if the callback
+ is for an unselected radio menu item.
+
+2005-12-11 Richard M. Stallman <[email protected]>
+
+ * xdisp.c (syms_of_xdisp) <blink-cursor-alist>: Doc fix.
+
+ * lisp.h [! NO_UNION_TYPE] (EQ): Use == so args are computed just once.
+
+ * keymap.c (Fset_keymap_parent, store_in_keymap): Use CHECK_IMPURE.
+ (Flookup_key): Doc fix.
+ (syms_of_keymap) <function-key-map>: Doc fix.
+
+ * fns.c (Frequire): Treat evaluating from a source file
+ like loading the file.
+
+ * floatfns.c (Flog): Doc fix.
+
+ * fileio.c (Finsert_file_contents): Set Vdeactivate_mark
+ when we change the buffer.
+
+2005-12-11 Juri Linkov <[email protected]>
+
+ * minibuf.c (display_completion_list_1):
+ Call `minibuffer_completion_contents' instead of using `nil' as
+ second arg of `Fdisplay_completion_list'.
+ (keys_of_minibuf): Unbind SPC in
+ Vminibuffer_local_filename_completion_map (see also related
+ change on 2005-12-06).
+
+2005-12-11 YAMAMOTO Mitsuharu <[email protected]>
+
+ * emacs.c (main) [MAC_OS8]: Undo previous change.
+
+ * macselect.c (syms_of_macselect) <mac-apple-event-map>:
+ Initialize to nil. Keymap is now created in lisp/term/mac-win.el.
+
+2005-12-10 YAMAMOTO Mitsuharu <[email protected]>
+
+ * Makefile.in (macselect.o): Depend on keymap.h.
+
+ * emacs.c (main) [MAC_OS8]: Call syms_of_keymap before
+ syms_of_macselect.
+
+ * image.c (init_image) [MAC_OS]: Don't call EnterMovies.
+ [!HAVE_GIF && MAC_OS] (gif_load): Call EnterMovies.
+
+ * keyboard.c (Qmac_apple_event) [MAC_OS]: New variable.
+ (syms_of_keyboard) [MAC_OS]: Initialize it.
+ (make_lispy_event) [MAC_OS]: Build lisp event for MAC_APPLE_EVENT.
+
+ * mac.c (Qundecoded_file_name): New variable.
+ (syms_of_mac): Initialize it.
+ (mac_aelist_to_lisp, mac_aedesc_to_lisp): New functions.
+ [TARGET_API_MAC_CARBON] (create_apple_event_from_event_ref): New fun.
+ (Fmac_coerce_ae_data): New defun.
+ (syms_of_mac): Defsubr it.
+
+ * macselect.c: Include keymap.h.
+ (mac_ready_for_apple_events): New variable.
+ (Vmac_apple_event_map, Qmac_apple_event_class)
+ (Qmac_apple_event_id): New variables.
+ (syms_of_macselect): Initialize them.
+ (Qundefined, mac_store_apple_event): Add externs.
+ (struct apple_event_binding): New struct.
+ (find_event_binding_fun, find_event_binding)
+ (mac_find_apple_event_spec, defer_apple_events)
+ (mac_handle_apple_event, init_apple_event_handler)
+ (copy_scrap_flavor_data): New functions.
+ (Fmac_process_deferred_apple_events): New defun.
+ (syms_of_macselect): Defsubr it.
+ (mac_store_services_event): Fix extern.
+ (mac_handle_service_event): Don't allocate Lisp objects during
+ asynchronous input processing. Use mac_store_services_event
+ instead of mac_store_application_menu_event.
+
+ * macterm.c (Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
+ (Qpreferences): Remove variables.
+ (syms_of_macterm): Don't initialize them.
+ (Qhicommand) [USE_CARBON_EVENTS]: New variable.
+ (syms_of_macterm) [USE_CARBON_EVENTS]: Initialize it.
+ (init_required_apple_events, do_ae_open_application)
+ (do_ae_print_documents, do_ae_open_documents)
+ (do_ae_quit_application): Remove functions and prototypes.
+ (mac_ready_for_apple_events, Qundefined, init_apple_event_handler)
+ (mac_find_apple_event_spec): Add externs.
+ (mac_store_application_menu_event): Remove function.
+ (mac_store_apple_event, mac_make_lispy_event_code): New functions.
+ (mac_handle_command_event): Create Apple event from Carbon event.
+ Use mac_store_apple_event instead of mac_store_application_menu_event.
+ [MAC_OSX] (mac_store_services_event): Likewise.
+ (struct SelectionRange, SelectionRange): Remove struct and typedef.
+ [MAC_OS8] (main): Call init_apple_event_handler instead of
+ init_required_apple_events.
+ (mac_initialize) [MAC_OSX]: Likewise.
+ [!USE_CARBON_EVENTS] (mac_wait_next_event):
+ Use mac_ready_for_apple_events instead of Qmac_ready_for_drag_n_drop.
+
+ * macterm.h (mac_make_lispy_event_code, mac_aedesc_to_lisp):
+ Add externs.
+ (create_apple_event_from_event_ref) [TARGET_API_MAC_CARBON]: Likewise.
+ (Fmac_get_preference): Add EXFUN.
+
+ * termhooks.h (enum event_kind) [MAC_OS]: Add new MAC_APPLE_EVENT
+ event.
+
+2005-12-09 Richard M. Stallman <[email protected]>
+
+ * xfns.c (Fx_create_frame): Reinstate previous change.
+
+2005-12-09 Eli Zaretskii <[email protected]>
+
+ * w32fns.c (w32_abort) [__GNUC__]: Add instructions for attaching
+ GDB to the abort dialog.
+
+2005-12-09 Kyotaro HORIGUCHI <[email protected]> (tiny change)
+
+ * indent.c (Fvertical_motion): Force move if starting on
+ stretch glyph.
+
+2005-12-08 Richard M. Stallman <[email protected]>
+
+ * lread.c (read_escape) <\s>: Don't treat strings specially.
+
+ * xfns.c (Fx_create_frame): Comment out previous change.
+
+2005-12-07 L$,1 q(Brentey K,Aa(Broly <[email protected]>
+
+ * xfns.c (Fx_create_frame): Initialize Vdefault_minibuffer_frame,
+ when needed.
+
+2005-12-06 Stefan Monnier <[email protected]>
+
+ * minibuf.c (keys_of_minibuf): Just unbind SPC in
+ Vminibuffer_local_filename_completion_map rather than forcing it
+ explicitly to the same binding as the global map.
+
+2005-12-06 Ken Raeburn <[email protected]>
+
+ * buffer.c (Fkill_buffer): Avoid dangerous side effects in NILP args.
+ * bytecode.c (Fbyte_code): Likewise.
+ * fileio.c (internal_delete_file, Fread_file_name_internal): Likewise.
+ * minibuf.c (Fminibuffer_complete_and_exit): Likewise.
+ * undo.c (truncate_undo_list): Likewise.
+
+2005-12-05 Richard M. Stallman <[email protected]>
+
+ * window.c (enlarge_window): Eliminate arg preserve_before.
+ Assume it is 0. All callers changed.
+ (Fenlarge_window, Fshrink_window): Likewise.
+
+2005-12-02 Eli Zaretskii <[email protected]>
+
+ * w32fns.c (compute_tip_xy): Put tip above pointer if it doesn't
+ fit below.
+
+2005-12-02 Jan Dj,Ad(Brv <[email protected]>
+
+ * xterm.h: Add prototype for xg_set_icon_from_xpm_data.
+
+ * xfns.c (x_real_positions): int ign => unsigned int.
+ (xg_set_icon_from_xpm_data): Remove unused variable err.
+ (x_set_name_internal, Fx_create_frame, xg_set_icon): Add cast
+ to remove compiler warning.
+ (compute_tip_xy): Put tip above pointer if it doesn't fit below.
+
+2005-12-02 David Reitter <[email protected]>
+
+ * minibuf.c (Fcompleting_read): If Vminibuffer_completing_file_name is
+ non-nil, use the new keymaps Vminibuffer_local_filename_completion_map
+ and Vminibuffer_local_must_match_filename_map keymaps.
+ (keys_of_minibuf): Bind SPC in the new file-name completion keymaps.
+
+ * keymap.c (Vminibuffer_local_filename_completion_map)
+ (Vminibuffer_local_must_match_filename_map): New variables.
+ (syms_of_keymap): DEFVAR_LISP them, initialize them, and set their
+ parent to be Vminibuffer_local_completion_map and
+ Vminibuffer_local_must_match_map, respectively.
+
+ * commands.h (Vminibuffer_local_filename_completion_map)
+ (Vminibuffer_local_must_match_filename_map): Declare the new keymaps.
+
+2005-12-01 Stefan Monnier <[email protected]>
+
+ * window.c (Fset_window_configuration): Don't accidentally copy the
+ window-point of one window to another.
+
+2005-11-30 L$,1 q(Brentey K,Aa(Broly <[email protected]>
+
+ * buffer.c (Fpop_to_buffer): Remove superfluous call to record_buffer.
+
+2005-11-30 Kim F. Storm <[email protected]>
+
+ * alloc.c: Include fcntl.h. Define O_WRONLY if not defined.
+ (valid_lisp_object_p) [!GC_MARK_STACK]: Validate pointer by
+ passing it to `emacs_write'.
+
+2005-11-29 Ari Roponen <[email protected]> (tiny change)
+
+ * atimer.c (stop_other_atimers): Fix loop to correctly compute `prev'.
+
+2005-11-27 Richard M. Stallman <[email protected]>
+
+ * window.c (adjust_window_trailing_edge): New function.
+ (Fadjust_window_trailing_edge): New function.
+ (syms_of_window): Defsubr it.
+ (window_deletion_count): New variable.
+ (delete_window): Update window_deletion_count.
+
+2005-11-26 Eli Zaretskii <[email protected]>
+
+ * minibuf.c (syms_of_minibuf): Mention the extension of
+ `completion-auto-help's meaning by complete.el.
+
+2005-11-26 Henrik Enberg <[email protected]>
+
+ * xfaces.c (Finternal_set_lisp_face_attribute_from_resource):
+ Handle :inherit property as a lisp expression.
+
+2005-11-24 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.c (Qcontrol): Rename from Qctrl. All uses changed.
+ (syms_of_macterm): Staticpro Qcontrol, Qmeta, Qalt, Qhyper,
+ Qsuper, and Qmodifier_value.
+ (Vmac_control_modifier, Vmac_option_modifier)
+ (Vmac_command_modifier, Vmac_function_modifier)
+ (Vmac_emulate_three_button_mouse, Vmac_wheel_button_is_mouse_2)
+ (Vmac_pass_command_to_system, Vmac_pass_control_to_system)
+ (Vmac_charset_info_alist): Doc fixes.
+
+2005-11-23 YAMAMOTO Mitsuharu <[email protected]>
+
+ * emacs.c (main) [MAC_OSX]: Change working directory to home
+ directory if `-psn_*' option is specified.
+
+ * mac.c (DECODE_UTF_8): Remove macro.
+ [TARGET_API_MAC_CARBON] (cfstring_to_lisp_nodecode): New function
+ created from cfstring_to_lisp.
+ [TARGET_API_MAC_CARBON] (cfstring_to_lisp): Use it.
+ (xrm_get_preference_database) [TARGET_API_MAC_CARBON]: Likewise.
+
+ * macterm.h (cfstring_to_lisp_nodecode) [TARGET_API_MAC_CARBON]:
+ Add prototype.
+
+2005-11-21 Ken Raeburn <[email protected]>
+
+ * keymap.c (shadow_lookup): Use make_number to pass a number to
+ Fsubstring.
+
+2005-11-21 Juri Linkov <[email protected]>
+
+ * puresize.h (BASE_PURESIZE): Increment to 1180000.
+
+2005-11-20 Chong Yidong <[email protected]>
+
+ * xfaces.c (Finternal_set_lisp_face_attribute):
+ Use :ignore-defface for new frame defaults when `unspecified' is
+ supplied.
+ (Finternal_get_lisp_face_attribute): Hide :ignore-defface.
+ (merge_face_vectors): Don't do :ignore-defface overwriting here.
+ (Finternal_merge_in_global_face): Do it here.
+
+2005-11-20 Juri Linkov <[email protected]>
+
+ * charset.c (invalid_character): Use Lisp-readable syntax
+ for octal and hex. Reorder decimal, octal and hex values.
+
+2005-11-20 Nick Roberts <[email protected]>
+
+ * lisp.h: Use typedef when Lisp_Object is EMACS_INT so that
+ this type is recognised when debugging.
+
+2005-11-19 Andreas Schwab <[email protected]>
+
+ * .gdbinit (nextcons, xcdr, xfloat): Update for changes in
+ Lisp_Cons and Lisp_Float.
+
+2005-11-19 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.c [USE_CG_TEXT_DRAWING] (cg_text_anti_aliasing_threshold):
+ New variable.
+ [USE_CG_TEXT_DRAWING] (init_cg_text_anti_aliasing_threshold): New fun.
+ (init_font_name_table) [USE_ATSUI && USE_CG_TEXT_DRAWING]: Use it.
+ [USE_CG_TEXT_DRAWING] (mac_draw_string_cg): Don't do antialiasing if
+ font size is smaller than or equal to cg_text_anti_aliasing_threshold.
+
+2005-11-17 Chong Yidong <[email protected]>
+
+ * image.c (x_create_bitmap_from_xpm_data): Free attributes on fail.
+
+ * xfaces.c (Qignore_defface): New variable.
+ (syms_of_xfaces): Provide `:ignore-defface'.
+ (IGNORE_DEFFACE_P): New macro.
+ (check_lface_attrs, lface_fully_specified_p)
+ (Finternal_set_lisp_face_attribute)
+ (Fface_attribute_relative_p, Fmerge_face_attribute):
+ Handle Qignore_defface as a possible value.
+ (merge_face_vectors): The merged face is `unspecified' if the
+ mergee specifies `:ignore-defface'.
+
+2005-11-16 Stefan Monnier <[email protected]>
+
+ * lread.c (readevalloop): Add missing GCPROs.
+
+2005-11-16 Chong Yidong <[email protected]>
+
+ * xfns.c (xg_set_icon_from_xpm_data): New function.
+
+ * gnu.h (gnu_xpm_bits): Rename from gnu_bits.
+ (gnu_xbm_bits): Rename from gnu_bits (xbm version).
+
+ * xterm.c (x_bitmap_icon): Use the xpm if available.
+
+ * image.c (x_create_bitmap_from_xpm_data): New function.
+ (x_create_bitmap_from_xpm_data): Initialize XpmAttributes.
+
+2005-11-15 Luc Teirlinck <[email protected]>
+
+ * Makefile.in (lisp, shortlisp): Add rfn-eshadow.
+
+2005-11-16 Nick Roberts <[email protected]>
+
+ * .gdbinit: Make SIGTSTP work like SIGINT normally does.
+
+2005-11-15 Andreas Schwab <[email protected]>
+
+ * lisp.h (struct Lisp_Cons): Make cdr a union.
+ (XCDR_AS_LVALUE): Adjust.
+ (struct Lisp_Float): Make data a union.
+ (XFLOAT_DATA): Adjust.
+
+ * alloc.c (free_float): Make free list chaining aliasing-safe.
+ (make_float): Likewise.
+ (free_cons): Likewise.
+ (Fcons): Likewise.
+ (check_cons_list): Likewise.
+ (Fmake_symbol): Likewise.
+ (allocate_misc): Likewise.
+ (free_misc): Likewise.
+ (gc_sweep): Likewise.
+
+2005-11-15 YAMAMOTO Mitsuharu <[email protected]>
+
+ * mac.c (HASHKEY_QUERY_CACHE): New define.
+ (xrm_create_database, xrm_q_put_resource): Empty query cache.
+ (xrm_get_resource): Use query cache.
+
+ * image.c (init_image) [MAC_OS]: Don't call EnterMovies if
+ inhibit_window_system is set.
+
+2005-11-13 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macgui.h (USE_CG_TEXT_DRAWING): New define.
+ (struct MacFontStruct) [USE_CG_TEXT_DRAWING]: New members cg_font
+ and cg_glyphs.
+
+ * macterm.c [USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
+ (x_draw_glyph_string_foreground) [USE_CG_TEXT_DRAWING]: Use it.
+ (XLoadQueryFont) [USE_CG_TEXT_DRAWING]: Set members cg_font and
+ cg_glyphs in struct MacFontStruct if synthesized bold or italic is
+ not used and font substitution never occurs for ASCII and Latin-1
+ characters.
+ (XLoadQueryFont): Maximum and minimum metrics are now those among
+ ASCII characters.
+ (XLoadQueryFont) [!MAC_OS8 || USE_ATSUI]: Apply WebKit-style
+ height adjustments for Courier, Helvetica, and Times.
+
+ * s/darwin.h (LIBS_CARBON) [!HAVE_CARBON]: Remove `-framework Carbon'.
+
+2005-11-11 David Reitter <[email protected]>
+
+ * macterm.c (syms_of_macterm): Remove macCtrlKey, macShiftKey,
+ macMetaKey, macAltKey. Introduce Qctrl, Qmeta,
+ Vmac_control_modifier / mac-control-modifier,
+ Vmac_option_modifier / mac-option-modifier,
+ Vmac_command_modifier / mac-command-modifier.
+ (mac_to_emacs_modifiers): Use the new style modifier
+ variables. Return UInt32 (modifiers are longs now.)
+ (backtranslate_modified_keycode): New function (refactoring).
+ (XTread_socket): Use new modifier variables and refactored function.
+ (mac_determine_quit_char_modifiers): Remove macMetaKey (there is
+ no dedicated meta key. Not in use anyway.)
+ (convert_fn_keycode): Map Fn-keys to their original keycode
+ using a table (english keyboard only).
+
+2005-11-11 Kim F. Storm <[email protected]>
+
+ * .gdbinit (pitx): Fix output format if n_overlay_strings > 0.
+ Add post hook to "backtrace" to always dump lisp call stack to
+ increase chance of people sending it to us when reporting bugs.
+
+ * doc.c (Fsubstitute_command_keys): Doc fix.
+
+ * dispextern.h (struct it): New member ignore_overlay_strings_at_pos_p.
+
+ * xdisp.c (handle_stop): Skip overlay string handling if
+ ignore_overlay_strings_at_pos_p is set.
+ (set_iterator_to_next): At end of display vector, set
+ ignore_overlay_strings_at_pos_p if dpvec came from an overlay
+ string, so we skip those overlay strings at current pos.
+
+2005-11-10 Lars Hansen <[email protected]>
+
+ * fileio.c (file-regular-p): Doc fix.
+
+2005-11-10 Kim F. Storm <[email protected]>
+
+ * alloc.c (valid_lisp_object_p): New function to validate that
+ an object is really a valid Lisp_Object.
+
+ * lisp.h (valid_lisp_object_p): Add prototype.
+
+ * print.c (safe_debug_print): New function to be called from gdb
+ to print Lisp objects; use valid_lisp_object_p to avoid crashing
+ if user tries to print something which is not a Lisp object.
+
+ * .gdbinit (pp, pp1): Use safe_debug_print.
+ (pv, pv1): New commands to print value of a lisp variable.
+
+2005-11-10 Nick Roberts <[email protected]>
+
+ * .gdbinit (pp1): New user-defined function.
+
+2005-11-09 YAMAMOTO Mitsuharu <[email protected]>
+
+ * image.c [MAC_OSX] (image_load_quartz2d): Fix memory leak.
+
+ * mac.c [MAC_OSX] (init_mac_osx_environment): Reinitialize locale
+ related variables for dumped executable.
+
+ * unexmacosx.c (unexec_write_zero): New function.
+ (copy_data_segment): Clear uninitialized local variables in
+ statically linked libraries.
+
+ * s/darwin.h (C_SWITCH_SYSTEM): Remove -fno-common.
+
+2005-11-09 Juri Linkov <[email protected]>
+
+ * keymap.c (shadow_lookup): If Flookup_key returns a number,
+ call it again with a sub-key-sequence, and if its return value
+ is non-nil (sub-key is bound), return nil.
+
+2005-11-08 Kim F. Storm <[email protected]>
+
+ * process.c (Fsignal_process): Recognize signal names with and
+ without SIG prefix, e.g. SIGHUP and HUP.
+
+ * search.c (search_buffer): No need to initialize base_pat.
+
+2005-11-04 Stefan Monnier <[email protected]>
+
+ * window.c (Fget_lru_window, Fget_largest_window, window_loop):
+ Don't abuse the `mini' arg. Use the `obj' arg instead.
+
+2005-11-04 Kim F. Storm <[email protected]>
+
+ * xdisp.c (show_mouse_face): Clear mouse face to eol.
+
+2005-11-03 Dan Nicolaescu <[email protected]>
+
+ * Makefile.in (lisp, shortlisp): Add emacs-lisp/syntax.elc,
+ font-lock.elc and jit-lock.elc.
+
+2005-11-03 Richard M. Stallman <[email protected]>
+
+ * window.c (Fenlarge_window): Rename SIDE to HORIZONTAL.
+ (enlarge_window): Rename WIDTHFLAG to HORIZ_FLAG.
+ (CURBEG, CURSIZE): Use HORIZ_FLAG instead of WIDTHFLAG.
+
+ * sheap.c (STATIC_HEAP_SIZE): Increment both definitions.
+
+ * alloc.c (refill_memory_reserve): Move decl out of conditionals.
+
+2005-11-03 Stefan Monnier <[email protected]>
+
+ * window.c (Fdisplay_buffer): Fix last change to not use
+ a dedicated window.
+
+2005-11-01 Kim F. Storm <[email protected]>
+
+ * fringe.c (update_window_fringes): Undo 2005-10-27 change.
+ Instead, rotate the bottom angle bitmap 180 degrees to indicate
+ that the bottom row does not end in a newline.
+
+2005-11-01 Andreas Schwab <[email protected]>
+
+ * unexelf.c (unexec): Handle .plt section in BSS segment.
+
+2005-11-01 Stefan Monnier <[email protected]>
+
+ * lread.c (readevalloop): Yet another int/Lisp_Object mixup (YAILOM).
+
+ * window.c (window_loop): For LRU and LARGEST, let the `mini' argument
+ determine whether to consider dedicated windows as well.
+ (Fget_lru_window, Fget_largest_window): Add `dedicated' argument.
+ (Fdisplay_buffer): Do consider dedicated windows in those cases where
+ we will split the window rather than reuse it.
+ Don't try to use windows on other displays.
+
+2005-10-31 Dan Nicolaescu <[email protected]>
+
+ * puresize.h (BASE_PURESIZE): Increment to 1170000.
+
+2005-10-31 Romain Francoise <[email protected]>
+
+ * macfns.c: Update copyright year.
+ * m/gould.h: Likewise.
+
+2005-10-30 Kim F. Storm <[email protected]>
+
+ * xdisp.c (display_line): Restore it->current_x and call
+ extend_face_to_end_of_line when last glyph doesn't fit on line.
+ (set_glyph_string_background_width): Remove specific tests here
+ to see if face background should extend to end of line. Simplify.
+
+2005-10-30 Richard M. Stallman <[email protected]>
+
+ * alloc.c (BYTES_USED): Use uordblks, not arena.
+ (bytes_used_when_reconsidered): New variable.
+ (emacs_blocked_free): Set that.
+
+2005-10-29 Chong Yidong <[email protected]>
+
+ * alloc.c (emacs_blocked_free): Fix typo.
+
+2005-10-29 Richard M. Stallman <[email protected]>
+
+ * data.c (Fmake_variable_frame_local): Doc fix.
+
+ * xdisp.c (handle_fontified_prop): Do nothing if memory full.
+ (format_mode_line_unwind_data): New arg SAVE_PROPTRANS
+ controls whether to save and restore mode_line_proptrans_alist.
+ Callers changed.
+ (unwind_format_mode_line): Work with that feature.
+ (redisplay_internal): Don't call prepare_menu_bars if memory full.
+ (move_elt_to_front): New function.
+ (display_mode_element): Use move_elt_to_front.
+ Don't bother munging text props on a null string.
+ Delete obsolete elts from mode_line_proptrans_alist.
+ (decode_mode_spec): Test Vmemory_full, not spare_memory.
+ (Fformat_mode_line): Clear mode_line_proptrans_alist after saving.
+
+ * lisp.h (memory_full_cons_threshold): Declare.
+ (internal_lisp_condition_case): Declare.
+
+ * alloc.c (syms_of_alloc) <memory-full>: Doc fix.
+ (Fmemory_full_p): Function deleted.
+ (syms_of_alloc): Don't defsubr it.
+ (memory_full_cons_threshold): New variable.
+ (spare_memory): Now a vector of 7 elts.
+ (buffer_memory_full): Don't set Vmemory_full here.
+ (xfree): Don't try to refill here.
+ (emacs_blocked_free): Record BYTES_USED in local var.
+ (memory_full): Now free all the slots in spare_memory.
+ (refill_memory_reserve): Allocate each slot in spare_memory.
+ (init_alloc_once): Call refill_memory_reserve.
+
+ * keyboard.c (command_loop_1): Don't set Vmemory_full here.
+
+ * eval.c (internal_lisp_condition_case): New function.
+ (Fcondition_case): Use internal_lisp_condition_case.
+ (Feval): Test Vmemory_full and memory_full_cons_threshold.
+ (Ffuncall): Likewise.
+
+ * bytecode.c (Fbyte_code): Use internal_lisp_condition_case.
+
+2005-10-29 Stefan Monnier <[email protected]>
+
+ * syntax.c (Fparse_partial_sexp): Fix docstring.
+
+2005-10-28 Romain Francoise <[email protected]>
+
+ * puresize.h (BASE_PURESIZE): Increment to 1130000.
+
+2005-10-28 Richard M. Stallman <[email protected]>
+
+ * xfns.c (syms_of_xfns): Provide `x' as feature.
+
+ * xdisp.c (decode_mode_spec): Define %e to indicate memory full.
+
+ * editfns.c (Fformat): Don't include string padding
+ between info[n].start and info[n].end.
+
+ * alloc.c (spare_memory): No longer static.
+ (xfree) [!SYSTEM_MALLOC]: Call refill_memory_reserve.
+
+ * puresize.h (BASE_PURESIZE): Increment to 1120000.
+
+2005-10-27 Chong Yidong <[email protected]>
+
+ * data.c (Fmake_variable_frame_local): Add clarification to docstring.
+
+ * fringe.c (update_window_fringes): Handle case where buffer ends
+ with a newline.
+
+2005-10-27 Kenichi Handa <[email protected]>
+
+ * coding.h (DECODE_SYSTEM): Fix argument name; name->str.
+
+2005-10-24 Kenichi Handa <[email protected]>
+
+ * charset.h (charset_mule_unicode_0100_24ff)
+ (charset_mule_unicode_2500_33ff, charset_mule_unicode_e000_ffff):
+ Extern them.
+
+ * charset.c (charset_mule_unicode_0100_24ff)
+ (charset_mule_unicode_2500_33ff, charset_mule_unicode_e000_ffff):
+ New variables.
+ (Fsetup_special_charsets): Initialize them.
+
+ * xterm.c (handle_one_xevent): Handle keysyms directly mapped to
+ supported Unicode characters.
+
+2005-10-25 Jason Rumney <[email protected]>
+
+ * w32fns.c (w32_to_x_font): Avoid forcing font widths.
+
+2005-10-25 YAMAMOTO Mitsuharu <[email protected]>
+
+ * image.c [MAC_OS] (image_load_qt_1): Check image size.
+ Use GraphicsImportGetImageDescription instead of
+ GraphicsImportGetNaturalBounds.
+ [MAC_OSX] (image_load_quartz2d): Check image size.
+ [MAC_OS] (xpm_load_image): Likewise.
+
+ * macterm.c (last_mouse_glyph_frame): New var.
+ (note_mouse_movement): Say mouse moved if current frame differs
+ from last_mouse_glyph_frame, and update last_mouse_glyph_frame.
+ (XTmouse_position): Set last_mouse_glyph_frame.
+ (XTread_socket): Clear last_mouse_glyph_frame on mouse up/down event.
+ (mac_draw_string_common) [USE_ATSUI && WORDS_BIG_ENDIAN]: Fix typo.
+ Use EndianU16_BtoN.
+ (mac_draw_string_common) [MAC_OSX]: Don't use ATSUClearLayoutControls.
+ (x_per_char_metric, XLoadQueryFont)
+ [MAC_OS_X_VERSION_MAX_ALLOWED < 1020]: Use device origins to get
+ glyph bounds.
+ (mac_to_x_fontname, mac_do_list_fonts)
+ (mac_initialize_display_info): Change screen resolutions to 72dpi.
+
+2005-10-25 Masatake YAMATO <[email protected]>
+
+ * minibuf.c (Fdisplay_completion_list): Small doc fix.
+
+2005-10-24 Kim F. Storm <[email protected]>
+
+ * xterm.c: Undo 2005-10-23 change.
+ (last_mouse_glyph_frame): New var.
+ (note_mouse_movement): Say mouse moved if current frame differs
+ from last_mouse_glyph_frame, and update last_mouse_glyph_frame.
+ (XTmouse_position): Set last_mouse_glyph_frame.
+ (handle_one_xevent): Clear last_mouse_glyph_frame [instead of
+ last_mouse_glyph] on mouse up/down event.
+
+ * editfns.c (Fcompare_buffer_substrings): Fix last change.
+
+2005-10-23 Stefan Monnier <[email protected]>
+
+ * editfns.c (Fcompare_buffer_substrings): Handle multibyte chars.
+
+2005-10-23 Jan Dj,Ad(Brv <[email protected]>
+
+ * xterm.c (note_mouse_movement): Always call note_mouse_highlight
+ so tool tips don't interfere with press on tool bar button.
+
+2005-10-23 Richard M. Stallman <[email protected]>
+
+ * casetab.c (Fset_case_table): Doc fix.
+
+ * lread.c (build_load_history): Replace STREAM arg with ENTIRE.
+ (readevalloop): Compute ENTIRE properly.
+ (syms_of_lread) <load-history>: Doc fix.
+
+2005-10-21 Richard M. Stallman <[email protected]>
+
+ * lread.c (Fload): Simplify gcpro structure.
+ Gcpro FOUND as well as FILE, but not EFOUND.
+ Unless preloading, record FOUND instead of FILE in Vload_history.
+ Rename repeat local FILE to MSG_FILE.
+ (syms_of_lread) <load-history>: Doc fix.
+
+2005-10-21 Kenichi Handa <[email protected]>
+
+ * search.c (boyer_moore): Add parens to fix and/or precedence bug.
+
+2005-10-20 Kim F. Storm <[email protected]>
+
+ * buffer.c (clone_per_buffer_values): Remove unused var tem.
+ (init_buffer): Remove unused vars dotstat, pwdstat.
+
+ * ccl.c (check_ccl_update): Remove unused var vp.
+
+ * fileio.c (auto_save_error): Call SAFE_FREE.
+
+ * fns.c (Fchar_table_range): Remove unused var i.
+
+ * minibuf.c (display_completion_list_1): New wrapper function
+ for Fdisplay_completion_list.
+ (Fminibuffer_completion_help): Use it.
+
+ * term.c (encode_terminal_code): Remove unused var src_start.
+
+ * window.c (Fwindow_tree): Remove unused var alist.
+
+ * xterm.c (x_calc_absolute_position): Remove unused vars win_x, win_y.
+
+2005-10-20 Aubrey Jaffer <[email protected]> (tiny change)
+
+ * unexelf.c (unexec): Fix calls to `fatal' with less than 3 arguments.
+
+2005-10-20 Olli Savia <[email protected]> (tiny change)
+
+ * syssignal.h [__Lynx__]: Undef SIGPOLL along with SIGIO.
+
+2005-10-20 Andreas Schwab <[email protected]>
+
+ * minibuf.c (Fdisplay_completion_list): Doc fix.
+
+2005-10-19 Kim F. Storm <[email protected]>
+
+ * image.c (check_image_size): Handle integer Vmax_image_size value
+ directly as max pixel value. Use default frame size for null frame.
+ (syms_of_image) <max-image-size>: Describe integer value.
+
+2005-10-19 Romain Francoise <[email protected]>
+
+ * emacs.c (main): Update copyright year.
+
+2005-10-18 Chong Yidong <[email protected]>
+
+ * image.c (Vmax_image_size): New variable.
+ (check_image_size): New function.
+ (xbm_read_bitmap_data, pbm_load, png_load, jpeg_load, tiff_load)
+ (gif_load, gs_load): Use it.
+ (lookup_image): Try loading again if previous load failed.
+ (xbm_read_bitmap_data): Add a new argument, a pointer to the frame
+ to display in, NULL if none.
+ (xbm_load_image, xbm_file_p): Pass xbm_read_bitmap_data the new
+ argument.
+
+2005-10-18 Richard M. Stallman <[email protected]>
+
+ * search.c (Fstring_match): Doc fix.
+
+2005-10-18 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.c (note_mouse_movement): Use PtInRect.
+ (XTread_socket): Also ignore mouse motion just before a button
+ release event. Don't process button release event when mouse is
+ not grabbed.
+
+2005-10-16 Masatake YAMATO <[email protected]>
+
+ * minibuf.c (Fdisplay_completion_list): Add new optional
+ argument COMMON_SUBSTRING. Bind `completion-common-substring'
+ to the optional argument during running `completion-setup-hook'.
+
+2005-10-16 YAMAMOTO Mitsuharu <[email protected]>
+
+ * mac.c [TARGET_API_MAC_CARBON] (get_cfstring_encoding_from_lisp):
+ Allow nil as argument.
+ [TARGET_API_MAC_CARBON] (Fmac_code_convert_string): Regard nil
+ for encoding arguments as UTF-16 in native byte order, no BOM.
+
+ * macfns.c (Fx_create_frame): Add debugging code.
+ (Fx_show_tip): Set frame pixel width and height.
+
+ * macterm.c (MAC_WINDOW_NORMAL_GC): Remove macro.
+ (FRAME_NORMAL_GC): New macro.
+ (mac_draw_line, mac_clear_area, mac_clear_window)
+ (mac_fill_rectangle, mac_draw_string, mac_draw_string_16)
+ (mac_draw_image_string, mac_draw_image_string_16): Rename from
+ XDrawLine, XClearArea, XClearWindow, XFillRectangle, XDrawString,
+ XDrawString16, XDrawImageString, and XDrawImageString16, respectively.
+ All uses changed.
+ (mac_draw_line, mac_erase_rectangle, mac_clear_area)
+ (mac_clear_window, mac_draw_bitmap, mac_draw_rectangle)
+ (mac_invert_rectangle, mac_draw_string_common, mac_draw_string)
+ (mac_draw_string_16, mac_draw_image_string)
+ (mac_draw_image_string_16, mac_copy_area, mac_copy_area_with_mask)
+ (mac_scroll_area): Drawing functions now take frame as destination.
+ All uses changed.
+ (mac_draw_string_common): Get port height with FRAME_PIXEL_HEIGHT.
+ (x_draw_fringe_bitmap): Set clipping area in face->gc.
+
+ * macterm.h (mac_clear_area): Add extern.
+
+2005-10-14 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.c (note_mouse_movement, XTread_socket): Apply 2005-10-14
+ changes for xterm.c.
+
+ * w32term.c (note_mouse_movement, w32_read_socket): Likewise.
+
+2005-10-14 Kenichi Handa <[email protected]>
+
+ * search.c (search_buffer): Give up BM search on case-fold-search
+ if one of a target character has a case-equivalence of different
+ charset even if that target charcter is an ASCII.
+
+ * casefiddle.c (casify_object): Fix for the case that case
+ conversion change the byte length.
+
+2005-10-14 Kim F. Storm <[email protected]>
+
+ * xterm.c (note_mouse_movement): Return 1 if mouse moved; 0 otherwise.
+ (handle_one_xevent): Only clear help_echo_string; restore it if
+ note_mouse_movement didn't record any mouse movement.
+
+ * xdisp.c (pos_visible_p): Convert w->hscroll to pixels before use.
+ (remember_mouse_glyph): Clear RECT if mouse is over an image glyph.
+
+ * keyboard.c (make_lispy_position): Adjust wx for left margin if
+ ON_TEXT.
+ (Fposn_at_x_y): Fix calculation of x coordinate.
+ (Fposn_at_point): Return nil if point is hscrolled out of view.
+
+2005-10-13 Andreas Schwab <[email protected]>
+
+ * sysdep.c (request_sigio, unrequest_sigio): Do nothing in
+ non-interactive mode.
+
+2005-10-12 YAMAMOTO Mitsuharu <[email protected]>
+
+ * xterm.c, w32term.c, macterm.c (note_mouse_movement): Undo last change.
+
+2005-10-12 Kim F. Storm <[email protected]>
+
+ * xterm.c (handle_one_xevent): Clear last_mouse_glyph on mouse up/down.
+
+2005-10-12 Romain Francoise <[email protected]>
+
+ * buffer.c (init_buffer): Rename `rc' to `len' for clarity.
+
+2005-10-12 YAMAMOTO Mitsuharu <[email protected]>
+
+ * xdisp.c (remember_mouse_glyph): Use MATRIX_BOTTOM_TEXT_ROW to
+ get end of text rows. Obtain header-line/mode-line rows directly.
+
+ * xterm.c, w32term.c, macterm.c (note_mouse_movement):
+ Restore help_echo_string if mouse is moved inside last_mouse_glyph.
+
+2005-10-12 Kim F. Storm <[email protected]>
+
+ * xdisp.c (remember_mouse_glyph): New generic version based on
+ glyph_rect and remember_mouse_glyph from xterm.c enhanced to
+ properly handle all different window areas.
+
+ * dispextern.h (remember_mouse_glyph): Add prototype.
+
+ * xterm.c (glyph_rect, remember_mouse_glyph): Remove X versions.
+ (note_mouse_movement, XTmouse_position): Use generic
+ remember_mouse_glyph, add last_mouse_glyph arg.
+
+ * w32term.c (note_mouse_movement): Fix last_mouse_glyph check.
+ (glyph_rect, remember_mouse_glyph): Remove w32 specific versions.
+ (note_mouse_movement, w32_mouse_position): Use generic
+ remember_mouse_glyph, add last_mouse_glyph arg.
+
+ * macterm.c (note_mouse_movement): Add call to remember_mouse_glyph.
+ (glyph_rect, remember_mouse_glyph): Remove mac specific versions.
+ (XTmouse_position): Adapt to use generic remember_mouse_glyph
+ instead of pixel_to_glyph_coords.
+
+ * window.c (coordinates_in_window): Fix x position for ON_RIGHT_MARGIN.
+ Fix x position for ON_TEXT when left margin width > 0.
+
+2005-10-11 Kim F. Storm <[email protected]>
+
+ * window.c (coordinates_in_window): Fix y position for ON_SCROLL_BAR.
+
+ * keyboard.c (make_lispy_position): Fix buffer calculations for
+ mouse click or movement in right fringe and the margins.
+
+2005-10-11 Juanma Barranquero <[email protected]>
+
+ * image.c (fn_jpeg_stdio_src): Don't define it.
+ (init_jpeg_functions): Don't initialize `fn_jpeg_stdio_src'.
+ (our_common_init_source): Rename from `our_init_source'.
+ (our_common_term_source): Rename from `our_term_source'.
+ (our_memory_fill_input_buffer): Rename from
+ `our_fill_input_buffer'.
+ (our_memory_skip_input_data): Rename from `our_skip_input_data'.
+ (jpeg_memory_src): Use the new names.
+ (struct jpeg_stdio_mgr): New struct.
+ (JPEG_STDIO_BUFFER_SIZE): New constant.
+ (our_stdio_fill_input_buffer, our_stdio_skip_input_data)
+ (jpeg_file_src): New functions.
+ (jpeg_load): Use `jpeg_file_src' instead of `fn_jpeg_stdio_src'.
+
+2005-10-11 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.c (PER_CHAR_METRIC): Remove unused macro.
+ (fm_font_family_alist): New variable.
+ (syms_of_macterm): Initialize and staticpro it.
+ (decode_mac_font_name): Replace '-' in family name with '_' if it
+ occurs just once. Lower family name.
+ (parse_x_font_name): Rename from x_font_name_to_mac_font_name.
+ All uses changed. Remove argument MF and code conversion for it.
+ Add argument SIZE. Rename argument MF_DECODED to FAMILY, and CS
+ to CHARSET. Parse font size. Lower family name. Return integer
+ value for status of parsing.
+ (init_font_name_table) [USE_ATSUI]: Use decode_mac_font_name.
+ Don't use Fdowncase because family name is already lowered by
+ decode_mac_font_name.
+ (init_font_name_table): Always call decode_mac_font_name.
+ Add pair of family name and its reference to fm_font_family_alist.
+ (mac_clear_font_name_table): Clear fm_font_family_alist.
+ (XLoadQueryFont): Move font size parsing part to parse_x_font_name.
+ Lookup fm_font_family_alist to get font family reference.
+ (XLoadQueryFont) [USE_ATSUI]: Don't use Fdowncase because family
+ name is already lowered by parse_x_font_name.
+
+2005-10-11 Kim F. Storm <[email protected]>
+
+ * xterm.c (glyph_rect): Return 0 if position is outside text area.
+
+ * keyboard.c (make_lispy_position): Fix buffer position calculation for
+ mouse click or movement in fringe.
+
+2005-10-10 Jason Rumney <[email protected]>
+
+ * xterm.c (remember_mouse_glyph): New function.
+ (note_mouse_movement): Use it to remember the current glyph if changed.
+ (XTmouse_position): Fix calculation of fake glyph under mouse.
+ Move code to calculate glyph under mouse into remember_mouse_glyph.
+
+2005-10-10 Jan Dj,Ad(Brv <[email protected]>
+
+ * emacs.c (USAGE3, standard_args): -nb => -nbi.
+
+2005-10-10 Juanma Barranquero <[email protected]>
+
+ * frame.c (Fredirect_frame_focus): Fix typos in docstring.
+ (next_frame, prev_frame, set_term_frame_name): Make static.
+
+ * window.c (Fwindow_tree): Fix spelling.
+
+2005-10-09 Romain Francoise <[email protected]>
+
+ * window.c (Fwindow_end): Don't try to redisplay if non-interactive.
+
+2005-10-09 Jan Dj,Ad(Brv <[email protected]>
+
+ * emacs.c (standard_args): Remove options -i, -itype, --icon-type.
+ Add options -nb, --no-bitmap-icon.
+
+ * xfns.c (Fx_create_frame): Make bitmapIcon have default on.
+
+2005-10-08 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macgui.h (MAX_CLIP_RECTS): New define.
+ (struct _XGC): New member clip_region.
+ (struct _XGC) [MAC_OSX && USE_ATSUI]: New members n_clip_rects and
+ clip_rects.
+
+ * macterm.c (GC_CLIP_REGION): New macro.
+ (saved_port_clip_region): New variable.
+ (mac_begin_clip, mac_end_clip): New functions.
+ (XDrawLine, mac_erase_rectangle, mac_draw_bitmap, XFillRectangle)
+ (mac_draw_rectangle, mac_draw_string_common, mac_copy_area)
+ (mac_copy_area_with_mask, mac_scroll_area): Use them.
+ (mac_set_clip_rectangle, mac_reset_clipping): Remove functions.
+ [USE_ATSUI] (atsu_get_text_layout_with_text_ptr)
+ [MAC_OS_X_VERSION_MAX_ALLOWED < 1020]: Specify kATSLineFractDisable.
+ (mac_draw_string_common) [MAC_OSX && USE_ATSUI]: Clip to clipping
+ rectangles stored in gc.
+ (XFreeGC): Dispose of clipping region.
+ (mac_set_clip_rectangles, mac_reset_clip_rectangles): New functions.
+ (x_draw_fringe_bitmap, x_set_glyph_string_clipping)
+ (x_draw_relief_rect, x_draw_box_rect, x_draw_stretch_glyph_string)
+ (x_draw_glyph_string, x_clip_to_row, x_draw_hollow_cursor)
+ (x_draw_bar_cursor): Use them.
+ (x_set_glyph_string_clipping): Use get_glyph_string_clip_rects to
+ get multiple clipping rectangles.
+
+ * macterm.h (mac_term_init): Add types to extern.
+ (struct mac_output): Remove members mWP and pending_menu_activation.
+ Put members scroll_bar_foreground_pixel and
+ scroll_bar_background_pixel in #if 0.
+ (FRAME_MAC_WINDOW, FRAME_X_WINDOW): Use window_desc.
+
+ * xfaces.c (x_create_gc, x_free_gc) [MAC_OS]: Add BLOCK_INPUT.
+ Add debugging code.
+
+2005-10-08 Kim F. Storm <[email protected]>
+
+ * window.c (window_tree, Fwindow_tree): Rename fns added 2005-10-04.
+
+2005-10-07 Kim F. Storm <[email protected]>
+
+ * dispnew.c (redraw_overlapped_rows, redraw_overlapping_rows)
+ [!HAVE_WINDOW_SYSTEM]: Don't declare them...
+ (update_window) [!HAVE_WINDOW_SYSTEM]: ...and don't call them.
+
+2005-10-07 YAMAMOTO Mitsuharu <[email protected]>
+
+ * dispextern.h (struct glyph_string): Rename member for_overlaps_p
+ to for_overlaps. Now occupy 3 bits.
+ (OVERLAPS_PRED, OVERLAPS_SUCC, OVERLAPS_BOTH)
+ (OVERLAPS_ERASED_CURSOR): New defines.
+ (struct redisplay_interface): Add new OVERLAPS arg to member
+ fix_overlapping_area.
+ (x_fix_overlapping_area): Add new OVERLAPS arg.
+ (get_glyph_string_clip_rects): Add extern.
+
+ * dispnew.c (redraw_overlapping_rows):
+ Call rif->fix_overlapping_area with new OVERLAPS arg as redrawn part.
+
+ * xdisp.c: Rename member for_overlaps_p in struct glyph_string to
+ for_overlaps.
+ (get_glyph_string_clip_rects): New function created from
+ get_glyph_string_clip_rect. Set clipping rectangles according to the
+ value of for_overlaps. Enable to store multiple clipping rectangles.
+ (get_glyph_string_clip_rect): Use get_glyph_string_clip_rects.
+ (fill_composite_glyph_string, fill_glyph_string, draw_glyphs):
+ Rename argument OVERLAPS_P to OVERLAPS. All uses in macros changed.
+ (x_fix_overlapping_area): Add OVERLAPS arg. Pass it to draw_glyphs.
+ (draw_phys_cursor_glyph): Set width of erased cursor to use it for
+ calculating clipping rectangles later. Call x_fix_overlapping_area
+ with new OVERLAPS arg to draw only erased cursor area.
+ (expose_overlaps): Call x_fix_overlapping_area with new OVERLAPS arg
+ to draw overlaps in both preceding and succeeding rows.
+
+ * xterm.c, w32term.c, macterm.c: Rename member for_overlaps_p in
+ struct glyph_string to for_overlaps.
+
+2005-10-04 Richard M. Stallman <[email protected]>
+
+ * alloc.c (refill_memory_reserve): Conditionalize the body,
+ not the function's existence.
+
+2005-10-04 Kim F. Storm <[email protected]>
+
+ * window.c (window_split_tree): New function.
+ (Fwindow_split_tree): New defun.
+ (syms_of_window): Defsubr it.
+
+2005-10-04 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.c (mac_invert_rectangle): New function.
+ (XTflash): Use it.
+
+2005-10-04 Stefan Monnier <[email protected]>
+
+ * regex.h (re_char): Don't expose it in the interface.
+ (re_set_whitespace_regexp): Adjust the arg's type to not use it.
+
+ * regex.c (re_char): Move it back here.
+ (re_set_whitespace_regexp): Change the arg's type to not use it.
+
+ * keyboard.c (make_lispy_event): If point has moved between down and up
+ event, make it a drag, not a click, to mirror what
+ mouse-drag-region expects.
+
+2005-10-02 Dan Nicolaescu <[email protected]>
+
+ * lisp.h (fatal): Undo previous change.
+ * term.c (fatal): Undo previous change.
+
+2005-10-01 Richard M. Stallman <[email protected]>
+
+ * xfaces.c (face_color_gray_p): Colors close to black count as gray.
+
+2005-10-01 Kim F. Storm <[email protected]>
+
+ * xdisp.c (try_window): Skip scroll-margin check if ZV is visible.
+
+2005-10-01 YAMAMOTO Mitsuharu <[email protected]>
+
+ * keyboard.c (init_keyboard) [MAC_OSX]: Don't install SIGINT handler.
+
+ * macfns.c (start_hourglass): Apply 2005-05-07 change for xfns.c.
+ (x_create_tip_frame) [GLYPH_DEBUG]: Uncomment debugging code.
+ (Fx_create_frame, x_create_tip_frame) [USE_ATSUI]:
+ Try ATSUI-compatible 12pt Monaco font first.
+
+ * macgui.h (struct _XCharStruct): New member valid_p.
+ (STORE_XCHARSTRUCT): Set valid_p.
+ (struct MacFontStruct) [USE_ATSUI]: New member mac_style.
+
+ * macterm.c (mac_draw_string_common, x_per_char_metric)
+ (mac_compute_glyph_string_overhangs, init_font_name_table)
+ (XLoadQueryFont, mac_unload_font) [USE_ATSUI]: Add ATSUI support.
+ (atsu_get_text_layout_with_text_ptr) [USE_ATSUI]: New function.
+ (x_draw_glyph_string_background)
+ (x_draw_glyph_string_foreground) [MAC_OS8 && USE_ATSUI]: Don't use
+ XDrawImageString. Always draw background and foreground separately.
+ (x_draw_glyph_string_foreground) [USE_ATSUI]: Don't use 8-bit
+ functions for one-byte chars when using ATSUI-compatible fonts.
+ (atsu_font_id_hash) [USE_ATSUI]: New variable.
+ (syms_of_macterm) [USE_ATSUI]: Initialize and staticpro it.
+ (XLoadQueryFont): Set min_byte1, max_byte1, min_char_or_byte2, and
+ max_char_or_byte2 more in detail.
+ (quit_char_comp, mac_check_for_quit_char) [MAC_OSX]: Remove functions.
+
+2005-09-30 Dan Nicolaescu <[email protected]>
+
+ * image.c (slurp_file, xbm_read_bitmap_data): Cast to the correct type.
+ * xterm.c (handle_one_xevent, handle_one_xevent): Likewise.
+
+ * unexelf.c (fatal): Fix prototype.
+
+ * term.c (fatal): Implement using varargs.
+
+ * regex.c (re_char): Move typedef ...
+ * regex.h (re_char): ... here.
+ (re_iswctype, re_wctype, re_set_whitespace_regexp): New prototypes.
+
+ * emacs.c (malloc_set_state): Fix return type.
+ (endif): Fix type.
+
+ * lisp.h (fatal): Add argument types.
+
+ * dispextern.h (fatal): Delete prototype.
+
+ * systime.h (make_time): Prototype moved from ...
+ * editfns.c (make_time): ... here.
+
+ * editfns.c: Move systime.h include after lisp.h.
+ * dired.c:
+ * xsmfns.c:
+ * process.c: Likewise.
+
+ * alloc.c (old_malloc_hook, old_realloc_hook, old_realloc_hook):
+ Add parameter types.
+ (__malloc_hook, __realloc_hook, __free_hook): Fix prototypes.
+ (emacs_blocked_free): Change definition to match __free_hook.
+ (emacs_blocked_malloc): Change definition to match __malloc_hook.
+ (emacs_blocked_realloc): Change definition to match __realloc_hook.
+
+2005-09-30 Romain Francoise <[email protected]>
+
+ * minibuf.c (Fread_buffer): Follow convention for reading from the
+ minibuffer with a default value. Doc fix.
+
+2005-09-29 Juri Linkov <[email protected]>
+
+ * editfns.c (Fmessage, Fmessage_box, Fmessage_or_box):
+ Rename argument name `string' to `format-string'.
+ (Fformat): Doc fix.
+
+2005-09-28 Kim F. Storm <[email protected]>
+
+ * image.c (gif_load): Fix size of allocated image buffer
+ for images where a sub-image may be larger than the image's
+ total height/width specifications.
+
+2005-09-28 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macgui.h (struct _XCharStruct): Each member now takes short value.
+
+2005-09-27 Dan Nicolaescu <[email protected]>
+
+ * xfaces.c (lookup_derived_face): Add parameter type.
+
+ * xdisp.c (cursor_row_fully_visible_p): Add parameter type.
+
+ * marker.c (verify_bytepos): Add parameter type.
+
+ * process.c (get_operating_system_release): Move prototype ...
+
+ * systime.h (get_operating_system_release): ... here.
+
+ * xterm.c (handle_one_xevent): Refer to union field to match the
+ type required by the function definition.
+ (set_vertical_scroll_bar): Move prototype ...
+
+ * xterm.h: ... here.
+
+ * fns.c (internal_equal, seed_random): Fix prototypes.
+ (internal_equal): Add missing parameter.
+
+2005-09-25 Richard M. Stallman <[email protected]>
+
+ * keyboard.c (update_menu_bindings): Variable deleted.
+ (syms_of_keyboard): Don't defvar it.
+ (parse_menu_item): Don't test it.
+
+2005-09-23 Richard M. Stallman <[email protected]>
+
+ * editfns.c (Fformat): Explicitly test for end of format string
+ and don't use `index'.
+
+2005-09-23 Dan Nicolaescu <[email protected]>
+
+ * s/aix4-2.h (BROKEN_GET_CURRENT_DIR_NAME):
+ Define BROKEN_GET_CURRENT_DIR_NAME.
+
+ * sysdep.c (get_current_dir_name): Also define if
+ BROKEN_GET_CURRENT_DIR_NAME.
+
+ * m/ibmrs6000.h: Test for USG5, not USG5_4.
+
+2005-09-22 Kim F. Storm <[email protected]>
+
+ * xdisp.c (message_dolog): Add warning about GC and Lisp strings.
+ (message2): Fix commentary. Ok to use alloca'ed memory.
+ Still not ok to use Lisp string data (because of GC).
+ (set_message): Add comment why GC cannot happen.
+
+2005-09-22 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.c (xlfdpat_block_match_1): Fix assertion.
+ (init_font_name_table) [TARGET_API_MAC_CARBON]: Don't add style
+ variants for a scalable font multiple times.
+
+2005-09-21 YAMAMOTO Mitsuharu <[email protected]>
+
+ * process.c (create_process) [RTU || UNIPLUS || DONT_REOPEN_PTY]:
+ Setup slave tty options before forking.
+
+2005-09-20 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c (xg_set_geometry): Do a gtk_window_move if program
+ positions have been set for the frame (as is done for frames in
+ special-display-buffer-names).
+
+2005-09-19 Kim F. Storm <[email protected]>
+
+ * editfns.c (Fformat): Don't scan past end of format string that
+ ends in %. Reported by Johan Bockg,Ae(Brd.
+
+2005-09-18 Andreas Schwab <[email protected]>
+
+ * window.h (struct window): Remove height_fixed_p, no longer set.
+
+ * window.c (make_window): Don't initialize height_fixed_p.
+ (window_fixed_size_p): Don't use it.
+
+2005-09-18 John Paul Wallington <[email protected]>
+
+ * data.c (Fdefalias): Signal an error if SYMBOL is not a symbol.
+
+2005-09-18 YAMAMOTO Mitsuharu <[email protected]>
+
+ * Makefile.in (SOME_MACHINE_OBJECTS): Undo previous change.
+
+ * macfns.c (image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
+ New variables.
+ [TARGET_API_MAC_CARBON] (Fx_file_dialog): Don't allow multiple
+ file selection.
+
+ * sysdep.c [MAC_OS8]: Don't include stdlib.h. Include sys/param.h.
+
+2005-09-17 Eli Zaretskii <[email protected]>
+
+ * Makefile.in (XMENU_OBJ) [!HAVE_CARBON]: Reinstate variable.
+ (obj): Use XMENU_OBJ, not a literal xmenu.o.
+
+2005-09-16 Romain Francoise <[email protected]>
+
+ * fileio.c (syms_of_fileio) <write-region-inhibit-fsync>: Doc fix.
+
+2005-09-15 Richard M. Stallman <[email protected]>
+
+ * xdisp.c (overlay_arrow_at_row): Add HAVE_WINDOW_SYSTEM conditional.
+ (display_mode_element): Instead of `lisp_string' and `this',
+ record `offset' and increment that.
+ `last_offset' replaces `last'.
+
+ * Makefile.in (XMENU_OBJ): Variable deleted.
+ (obj): Use xmenu.o unconditionally.
+ (SOME_MACHINE_OBJECTS): Delete xmenu.o.
+
+ * emacs.c (main): Don't conditionalize syms_of_xmenu on HAVE_XMENU.
+
+2005-09-15 Kim F. Storm <[email protected]>
+
+ * xdisp.c (move_it_vertically): Don't try to fetch byte BEGV-1.
+ (reseat_at_next_visible_line_start): Likewise (in xassert).
+
+2005-09-14 Romain Francoise <[email protected]>
+
+ * fileio.c (write_region_inhibit_fsync): New variable.
+ (Fwrite_region): Use it to skip call to fsync.
+ (syms_of_fileio): Initialize it.
+
+2005-09-14 Kenichi Handa <[email protected]>
+
+ * coding.c (code_convert_region_unwind): Argument format changed.
+ (run_pre_post_conversion_on_str): If pre-write-conversion function
+ changed the current buffer, delete the new buffer.
+ (run_pre_write_conversin_on_c_str): Likewise.
+
+ * fileio.c (Fexpand_file_name): Check multibyteness of
+ default_directory.
+
+2005-09-13 Kenichi Handa <[email protected]>
+
+ * composite.c (compose_chars_in_text): Delete it.
+
+ * composite.h (compose_chars_in_text): Delete extern.
+
+2005-09-13 Kim F. Storm <[email protected]>
+
+ * print.c (print_error_message): Fix last change.
+
+2005-09-12 Kim F. Storm <[email protected]>
+
+ * composite.c (compose_chars_in_text): Fix setup of `pend'.
+ Unconditionally reload `ptr' and `pend' after eval.
+
+ * xdisp.c (message3): Pass copy of lisp string to message_dolog.
+
+ * print.c (print_error_message): Pass copy of caller name to
+ message_dolog.
+
+ * fileio.c (auto_save_error): Pass copy of lisp string to message2.
+
+2005-09-12 Kenichi Handa <[email protected]>
+
+ * xdisp.c (display_mode_element): Be sure to make variables THIS
+ and LISP_STRING point into a string data of ELT.
+
+2005-09-12 Kim F. Storm <[email protected]>
+
+ * editfns.c (Ftranslate_region_internal): Reload `tt' after
+ signal_after_change that may have GC'ed.
+ (Fmessage, Fmessage_box, Fmessage_or_box): Doc fix.
+
+ * keymap.c (Fdescribe_buffer_bindings): Reload `translate'
+ after insert while runs signal_after_change.
+
+ * minibuf.c (Fminibuffer_complete_word): Move `completion_string'
+ declaration to where it is used.
+
+ * w32.c (check_windows_init_file): Fix allocation of error buffer.
+
+ * xfns.c (x_encode_text): Declare static. Add FREEP arg.
+ (x_set_name_internal): Call x_encode_text with new FREEP arg to
+ know if xfree is needed instead of guessing.
+
+ * xterm.h (x_encode_text): Remove prototype.
+
+2005-09-11 Chris Prince <[email protected]> (tiny change)
+
+ * w32term.c (x_bitmap_icon): Load small icons too.
+
+2005-09-10 Romain Francoise <[email protected]>
+
+ * buffer.c (init_buffer): Grow buffer to add directory separator
+ and terminal zero. Fix typos.
+
+2005-09-10 Eli Zaretskii <[email protected]>
+
+ * buffer.c (init_buffer): Fix error message for failed call to
+ get_current_dir_name.
+ (get_current_dir_name): Remove prototype.
+
+ * xsmfns.c (get_current_dir_name): Remove prototype.
+
+ * lisp.h (get_current_dir_name) [!HAVE_GET_CURRENT_DIR_NAME]:
+ Add prototype.
+
+ * sysdep.c [WINDOWSNT]: Add prototype for getwd.
+ Don't #undef NULL after including blockinput.h.
+
+ * config.in: Regenerated.
+
+2005-09-10 Giuseppe Scrivano <[email protected]>
+
+ Remove the MAXPATHLEN limitations:
+
+ * sysdep.c (get_current_dir_name) [!HAVE_GET_CURRENT_DIR_NAME]:
+ New function.
+
+ * buffer.c (init_buffer): Use it.
+
+ * xsmfns.c (smc_save_yourself_CB): Ditto.
+
+2005-09-09 Kim F. Storm <[email protected]>
+
+ * doc.c (Fsubstitute_command_keys): Lookup key binding for
+ commands that are remapped from some other command.
+
+ * xdisp.c (try_window_reusing_current_matrix): Clear mode_line_p
+ flag in disabled rows below the window.
+
+ * frame.h (struct frame): New member updated_p.
+
+ * xdisp.c (redisplay_internal): Mark updated frames in new updated_p
+ member. Remove local `updated' array and associated variables.
+
+2005-09-07 Kim F. Storm <[email protected]>
+
+ * xdisp.c (handle_display_prop): Respect overlay window property.
+
+ * xdisp.c (try_window): Remove superfluous cursor_height calculation.
+ Fixes crash reported by YAMAMOTO Mitsuharu.
+
+2005-09-06 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.c (struct xlfdpat_block, struct xlfdpat): New structs.
+ (xlfdpat_destroy, xlfdpat_create, xlfdpat_exact_p)
+ (xlfdpat_block_match_1, xlfdpat_match): New functions.
+ (xlfdpat_block_match): New macro.
+ (mac_to_x_fontname): Don't use tolower for non-ASCII characters.
+ (x_font_name_to_mac_font_name): Set coding.dst_multibyte to 0.
+ (add_font_name_table_entry): Increase font_name_table_size more
+ rapidly.
+ (mac_c_string_match): Remove function.
+ (mac_do_list_fonts): Use XLFD pattern match instead of regular
+ expression match.
+
+ * xfaces.c (xstrlwr): Don't use tolower for non-ASCII characters.
+
+2005-09-03 Richard M. Stallman <[email protected]>
+
+ * xdisp.c (redisplay_internal): Make UPDATED as long as needed.
+ (move_it_in_display_line_to): Stop after last char on line even
+ on a windowing terminal, if that's the specified stop position.
+
+ * fns.c (Fsort): Doc fix.
+
+ * editfns.c (Fpropertize): Don't insist that properties be symbols.
+
+2005-09-02 Stefan Monnier <[email protected]>
+
+ * dired.c (directory_files_internal_unwind, directory_files_internal)
+ (file_name_completion): Use a Save_Value object rather than a cons of
+ two 16bit ints to store the DIR*.
+ (directory_files_internal, file_name_completion): Handle both EINTR and
+ EAGAIN consistently after `readdir'.
+
+2005-09-01 Stefan Monnier <[email protected]>
+
+ * intervals.c (update_interval): Add position info in error.
+
+ * dispnew.c (window_to_frame_hpos, update_window):
+ Avoid gcc warning about unused variable `f'.
+
+2005-08-31 Jason Rumney <[email protected]>
+
+ * w32menu.c (add_menu_item): If unicode_append_menu returns an
+ error, revert to using AppendMenu.
+
+2005-08-31 YAMAMOTO Mitsuharu <[email protected]>
+
+ * image.c (PIX_MASK_DRAW, PIX_MASK_RETAIN): Remove argument.
+ All uses changed.
+ [MAC_OS] (XPutPixel, XGetPixel): Add efficient versions for common
+ cases.
+ (x_create_x_image_and_pixmap) [MAC_OS]: Don't call x_destroy_x_image.
+ [MAC_OS] (find_image_fsspec) [!MAC_OSX]: Don't use FSRef.
+ Use posix_pathname_to_fsspec.
+ [MAC_OS] (xpm_load_image): Fill in background_transparent field
+ while we have mask.
+
+ * macgui.h [!TARGET_API_MAC_CARBON] (GetPixDepth): New define.
+
+ * macterm.h (PIX_MASK_DRAW, PIX_MASK_RETAIN): Move defines to image.c.
+
+2005-08-29 Stefan Monnier <[email protected]>
+
+ * syntax.c (update_syntax_table): Properly reproduce the special +1
+ setting of e_property at the end of the buffer when bumping into the
+ INTERVALS_AT_ONCE limit.
+
+2005-08-27 Eli Zaretskii <[email protected]>
+
+ * emacs.c (USAGE1): Fix the description of the -Q option.
+
+2005-08-26 Stefan Monnier <[email protected]>
+
+ * xdisp.c (pos_visible_p): Yet another int/Lisp_Object mixup (YAILOM).
+
+2005-08-26 Kim F. Storm <[email protected]>
+
+ * xdisp.c (resize_mini_window): Fix 2005-08-20 change.
+ Don't move PT to new window start.
+
+2005-08-25 YAMAMOTO Mitsuharu <[email protected]>
+
+ * keyboard.c (kbd_buffer_get_event) [MAC_OS]: Make events for
+ ICONIFY/DEICONIFY_EVENT.
+
+ * macterm.c (mac_copy_area, mac_copy_area_with_mask):
+ Restore background color.
+ (mac_handle_visibility_change): New function.
+ (x_make_frame_invisible, x_iconify_frame)
+ (XTread_socket) [!USE_CARBON_EVENTS]: Use it.
+ [USE_CARBON_EVENTS] (mac_handle_window_event)
+ (install_window_handler): Handle visibility change events.
+ (x_make_frame_visible): Don't reposition window if it is iconified
+ or asked for visible before. Select and uncollapse window when it
+ is made visible.
+ (x_make_frame_invisible): Don't reset x_highlight_frame.
+ (x_iconify_frame): Likewise. Make invisible frame visible before
+ it is iconified.
+ (read_socket_inev): Move variable outside #if USE_CARBON_EVENTS.
+ (do_window_update): Don't change visibility of invisible frame.
+
+2005-08-22 Juri Linkov <[email protected]>
+
+ * term.c (turn_on_face): Check for TS_set_foreground and
+ TS_set_background depending on standout_mode. Simplify.
+
+2005-08-21 Kim F. Storm <[email protected]>
+
+ * fringe.c (update_window_fringes): Only put TOP and BOTTOM
+ bitmaps on fully visible rows.
+
+ * fringe.c (update_window_fringes): Replace FORCE_P arg with
+ KEEP_CURRENT_P arg; if non-zero, don't update current row fringes,
+ and return 0.
+
+ * xdisp.c (redisplay_window): Call update_window_fringes with
+ KEEP_CURRENT_P non-0 if we are going to refresh fringes later.
+
+2005-08-20 Richard M. Stallman <[email protected]>
+
+ * xdisp.c (display_echo_area_1): Get display start pos from w->start.
+ (resize_mini_window): Set w->start, and PT, so as to display the tail
+ end of the buffer, if it doesn't all fit.
+
+2005-08-18 Kim F. Storm <[email protected]>
+
+ * xdisp.c (calc_pixel_width_or_height): Use actual display
+ resolution when available instead of Vdisplay_pixels_per_inch.
+
+2005-08-17 Kim F. Storm <[email protected]>
+
+ * xdisp.c (pos_visible_p): Adjust X value if window is hscrolled.
+
+ * dispnew.c (buffer_posn_from_coords): Check that target row is
+ within matrix.
+
+2005-08-16 Jan Dj,Ad(Brv <[email protected]>
+
+ * xterm.c (x_wm_set_icon_pixmap): Move GTK specific code to
+ xg_set_frame_icon and call it.
+
+ * gtkutil.c (xg_set_frame_icon): New function.
+
+ * gtkutil.h (xg_set_frame_icon): Declare it.
+
+2005-08-16 Kim F. Storm <[email protected]>
+
+ * dispnew.c (increment_row_positions): Skip non-enabled rows.
+
+ * window.c (SAVED_WINDOW_VECTOR_SIZE): Remove dangerous define.
+ (Fcurrent_window_configuration): Use VECSIZE macro instead.
+
+2005-08-15 Richard M. Stallman <[email protected]>
+
+ * xdisp.c (message3_nolog): Clear echo_message_buffer.
+
+2005-08-15 Kim F. Storm <[email protected]>
+
+ * lisp.h (QUIT) [!SYNC_INPUT]: Throw t to Vthrow_on_input.
+
+ * process.c (deactivate_process, status_notify, read_process_output)
+ (update_status, status_convert, decode_status, allocate_pty)
+ (make_process, remove_process, list_processes_1)
+ (create_process_1, unwind_request_sigio, read_process_output)
+ (send_process, keyboard_bit_set): Declare static.
+ (Fdelete_process): Simplify. Pass process to status_notify, so we
+ don't try to read output from it.
+ (status_notify): New arg deleting_process--don't try to read
+ output from that process.
+
+ * lisp.h (deactivate_process, status_notify, read_process_output):
+ Remove prototypes.
+
+2005-08-14 Richard M. Stallman <[email protected]>
+
+ * image.c (syms_of_image): Init Qxbm, Qpbm before calling
+ define_image_type.
+
+2005-08-13 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c (xg_get_pixbuf_from_pix_and_mask): New function.
+ (xg_get_image_for_pixmap): Move some code to
+ xg_get_pixbuf_from_pix_and_mask, and call it.
+
+ * gtkutil.h (xg_get_pixbuf_from_pix_and_mask): Declare.
+
+ * xterm.c (x_wm_set_icon_pixmap): Call xg_get_pixbuf_from_pix_and_mask
+ to get an GTK icon and set it with GTK functions to avoid having GTK
+ override an icon set with just X functions.
+
+2005-08-11 Richard M. Stallman <[email protected]>
+
+ * image.c (syms_of_image): Init image_types here, and call
+ define_image_type.
+ (init_image): Not here.
+
+2005-08-09 Richard M. Stallman <[email protected]>
+
+ * bytecode.c (BYTE_CODE_QUIT): Throw t to Vthrow_on_input.
+
+ * lisp.h (QUIT): Throw t to Vthrow_on_input.
+
+2005-08-09 Thien-Thi Nguyen <[email protected]>
+
+ * floatfns.c (Fexpt): Use floats for negative exponent.
+
+2005-08-08 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c (xg_modify_menubar_widgets): Remove semicolon that
+ should not be there, causing menu display errors with GTK 2.6.9.
+
+2005-08-07 Richard M. Stallman <[email protected]>
+
+ * floatfns.c (Fexpt): Undo previous change.
+
+ * dispnew.c (Fframe_or_buffer_changed_p): Take an arg
+ so it can be used with various state vectors.
+
+ * emacs.c (endif): Convert -script into -scriptload.
+ (standard_args): Add -scriptload. Allow -basic-display with one dash.
+
+ * fns.c (syms_of_fns): Add `emacs' to features.
+
+ * term.c (set_terminal_modes): If no TS_termcap_modes string,
+ output newlines to scroll the old screen contents off the screen.
+
+2005-08-06 Thien-Thi Nguyen <[email protected]>
+
+ * floatfns.c (Fexpt): Use floats for negative exponent.
+ Reported by D Goel.
+
+2005-08-02 Richard M. Stallman <[email protected]>
+
+ * frame.c (Fframe_char_width): Doc fix.
+
+2005-07-30 Juanma Barranquero <[email protected]>
+
+ * xdisp.c (syms_of_xdisp) <redisplay-end-trigger-functions>:
+ Defvar it.
+
+2005-07-28 Juanma Barranquero <[email protected]>
+
+ * w32fns.c (my_set_window_pos, my_show_window): Don't declare.
+ (my_create_window, my_create_tip_window): Make static.
+
+ * w32term.c (my_show_window, my_set_window_pos, my_set_focus)
+ (my_set_foreground_window, my_destroy_window): Make static.
+
+2005-07-26 Paul Eggert <[email protected]>
+
+ Merge gnulib getopt implementation into Emacs.
+
+ * s/cygwin.h (C_SWITCH_SYSTEM): Remove, since gettext.h is
+ now part of lib-src.
+
+2005-07-26 Stefan Monnier <[email protected]>
+
+ * eval.c (Fdefvar): Allow (defvar enable-multibyte-characters).
+
+2005-07-25 Jason Rumney <[email protected]>
+
+ * w32menu.c (w32_menu_display_help): Suppress tooltip when
+ navigating menus with the keyboard.
+
+2005-07-23 Richard M. Stallman <[email protected]>
+
+ * insdel.c (syms_of_insdel): staticpro combine_after_change_buffer.
+
+ * bytecode.c (MAYBE_GC): Test gc_cons_threshold and
+ gc_relative_threshold, one by one.
+
+ * keyboard.c (read_char): Test gc_cons_threshold.
+ (syms_of_keyboard): staticpro Qecho_area_clear_hook.
+
+ * eval.c (Feval, Ffuncall): Test gc_cons_threshold and
+ gc_relative_threshold, one by one.
+
+ * alloc.c (gc_cons_threshold): Not static.
+ (gc_cons_combined_threshold): Var deleted.
+ (gc_relative_threshold): New variable.
+ (Fgarbage_collect, init_alloc_once): Compute gc_relative_threshold
+ instead of gc_cons_combined_threshold.
+
+ * lisp.h (gc_cons_threshold, gc_relative_threshold): Declare.
+ (gc_cons_combined_threshold): Declaration deleted.
+
+2005-07-23 YAMAMOTO Mitsuharu <[email protected]>
+
+ * mac.c: Don't include stdlib.h or string.h.
+ (Fdo_applescript, Fmac_file_name_to_posix)
+ (Fmac_file_name_to_posix): Doc fixes.
+ [TARGET_API_MAC_CARBON] (Fmac_get_preference)
+ (Fmac_code_convert_string): Likewise.
+ [MAC_OSX] (init_mac_osx_environment): Fall back on terminal mode
+ if the executable is not contained in a bundle.
+
+ * macfns.c: Don't include stdlib.h or string.h. Include atimer.h.
+ (gray_width, gray_height): Remove defines.
+ (gray_bits, gray_bitmap_width, gray_bitmap_height)
+ (gray_bitmap_bits): Remove variables.
+ (lispy_function_keys): Remove extern.
+ (free_frame_menubar): Add extern.
+ (x_window_to_frame): Remove function.
+ (unwind_create_tip_frame): Add declaration.
+ (x_set_name_internal): New function.
+ (x_set_name, x_set_title): Use it.
+ (Fx_create_frame, Fx_display_grayscale_p, Fx_display_pixel_width)
+ (Fx_display_pixel_height, Fx_display_planes)
+ (Fx_display_color_cells, Fx_server_max_request_size)
+ (Fx_server_vendor, Fx_server_version, Fx_display_screens)
+ (Fx_display_mm_height, Fx_display_mm_width)
+ (Fx_display_backing_store, Fx_display_visual_class)
+ (Fx_display_save_under, Fx_synchronize, Fx_show_tip): Doc fixes.
+
+ * macmenu.c (Fx_popup_menu, Fx_popup_dialog): Doc fixes.
+
+ * macselect.c (Fx_own_selection_internal): Follow error conventions.
+ (Fx_get_selection_internal, Fx_selection_owner_p)
+ (Fx_selection_exists_p): Doc fixes.
+ (syms_of_macselect) <selection-converter-alist>: Likewise.
+
+2005-07-21 Juanma Barranquero <[email protected]>
+
+ * buffer.c (syms_of_buffer) <cursor-type>: Doc fix.
+
+ * ccl.c (Fregister_ccl_program): Fix typos in docstring.
+ (Fccl_execute_on_string): Likewise; add usage info.
+
+ * composite.c (Fcompose_region_internal)
+ (Fcompose_string_internal):
+ Improve argument/docstring consistency.
+
+ * minibuf.c (Fminibuffer_prompt_end, Feval_minibuffer):
+ Fix typos in docstrings.
+
+ * textprop.c (Fnext_char_property_change)
+ (Fprevious_char_property_change): Doc fixes.
+
+ * window.c (Fset_window_margins, Fset_window_fringes):
+ Improve argument/docstring consistency.
+
+ * xfaces.c (Finternal_lisp_face_p): Doc fix.
+
+2005-07-21 Andreas Schwab <[email protected]>
+
+ * eval.c (restore_stack_limits): Return a value.
+
+2005-07-20 Juanma Barranquero <[email protected]>
+
+ * eval.c (Fdefvar): Doc fix.
+
+2005-07-20 Kim F. Storm <[email protected]>
+
+ * fileio.c (Fdo_auto_save, do_auto_save_unwind):
+ Use make_save_value to unwind protect stream.
+
+ * lread.c (Fload, load_unwind):
+ Use make_save_value to unwind protect stream.
+
+2005-07-19 Juanma Barranquero <[email protected]>
+
+ * eval.c (Fprog2, Fcalled_interactively_p),
+ (syms_of_eval) <debug-on-quit>: Doc fixes.
+ (syms_of_eval) <max-specpdl-size>:
+ (Finteractive_p): Fix typos in docstrings.
+
+2005-07-19 Kim F. Storm <[email protected]>
+
+ * w32fns.c (Vx_hand_shape): Variable removed.
+ (syms_of_w32fns): Intern and staticpro Qw32_charset_default.
+
+2005-07-19 Kenichi Handa <[email protected]>
+
+ * fns.c (Fstring_as_multibyte): Escape backslashes in the docstring.
+
+2005-07-18 Stefan Monnier <[email protected]>
+
+ * buffer.h (Fgenerate_new_buffer_name): Declare (for use in coding.c).
+
+2005-07-18 Kim F. Storm <[email protected]>
+
+ * frame.h (struct frame): New member already_hscrolled_p.
+
+ * xdisp.c (redisplay_internal): Only try to hscroll each frame once
+ to avoid redisplay looping hscrolling back and forth ad infinitum.
+
+2005-07-18 Juri Linkov <[email protected]>
+
+ * buffer.c (scroll-up-aggressively, scroll-down-aggressively):
+ * keymap.c (Fminor_mode_key_binding):
+ * macterm.c (mac-emulate-three-button-mouse):
+ Delete duplicate duplicate words.
+
+2005-07-18 Ken Raeburn <[email protected]>
+
+ * minibuf.c (Ftest_completion): Fix odd syntax in test.
+
+2005-07-18 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macfns.c (x_set_cursor_color): Use XSetBackground and XSetForeground.
+
+ * macgui.h (struct _XGC): New struct.
+ (GC): Use it.
+ (GCForeground, GCBackground, GCFont): Use X11 mask values.
+ (XCreateGC, XParseGeometry): Move externs to macterm.h.
+
+ * macterm.c (x_bitmap_icon, x_make_frame_visible): Remove declarations.
+ (XSetFont): Add declaration.
+ (mac_set_forecolor, mac_set_backcolor, mac_set_colors):
+ Remove functions.
+ (GC_FORE_COLOR, GC_BACK_COLOR, GC_FONT, MAC_WINDOW_NORMAL_GC):
+ New defines.
+ (XDrawLine, mac_draw_line_to_pixmap, XClearWindow)
+ (mac_draw_bitmap, XCreatePixmapFromBitmapData, XFillRectangle)
+ (mac_draw_rectangle, mac_draw_string_common, mac_scroll_area):
+ Use them.
+ (mac_erase_rectangle): New function.
+ (XClearArea, x_draw_fringe_bitmap, x_clear_glyph_string_rect)
+ (x_draw_stretch_glyph_string): Use it.
+ (XChangeGC, XCreateGC, XGetGCValues, XSetForeground)
+ (XSetBackground, XSetFont): Adjust for new GC implementation.
+ (x_draw_fringe_bitmap, x_draw_box_rect): Use GC to set colors.
+ (XTset_vertical_scroll_bar): Clear area under scroll bar.
+
+ * macterm.h (struct mac_display_info): Change types of
+ scratch_cursor_gc black_relief.gc, and white_relief.gc to GC.
+ (XCreateGC, XParseGeometry): Move externs from macgui.h.
+
+ * xfaces.c [MAC_OS] (XCreateGC): Remove extern.
+
+2005-07-16 Richard M. Stallman <[email protected]>
+
+ * buffer.c (Fmake_overlay): Doc fix.
+
+2005-07-16 Eli Zaretskii <[email protected]>
+
+ * w32proc.c (syms_of_ntproc): staticpro Qhigh, Qlow,
+ Vw32_valid_locale_ids, and Vw32_valid_codepages.
+
+2005-07-16 YAMAMOTO Mitsuharu <[email protected]>
+
+ * mac.c [TARGET_API_MAC_CARBON] (Fmac_code_convert_string):
+ Use Fstring_as_unibyte instead of string_make_unibyte.
+
+2005-07-15 Richard M. Stallman <[email protected]>
+
+ * xdisp.c (select_frame_for_redisplay): Use find_symbol_value.
+
+2005-07-15 Kim F. Storm <[email protected]>
+
+ * xdisp.c: Fix redisplay loop in last change.
+ (IT_POS_VALID_AFTER_MOVE_P): New macro.
+ (move_it_vertically_backward, move_it_by_lines): Use it.
+
+2005-07-14 Jason Rumney <[email protected]>
+
+ * w32.c (init_environment): Default HOME directory to user's
+ appdata directory if possible.
+
+2005-07-14 Kim F. Storm <[email protected]>
+
+ * .gdbinit (pitx): Fix output format. Print string charpos.
+
+ * lread.c (syms_of_lread): Initialize seen_list.
+
+ * search.c (syms_of_search): Staticpro searchbuf.whitespace_regexp.
+
+ * syntax.c (syms_of_syntax): Staticpro lisp objects in gl_state.
+ Staticpro re_match_object.
+
+2005-07-14 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macselect.c (get_scrap_target_type_list): Avoid NULL pointer
+ dereference.
+
+ * macterm.c (mac_window_to_frame): Remove duplicate define.
+
+2005-07-14 Kenichi Handa <[email protected]>
+
+ * coding.c (code_convert_region_unwind): ARG is changed to a cons.
+ (code_convert_region): Adjust for the above change.
+ (set_conversion_work_buffer): If the work buffer is already in
+ use, generate a new buffer and return it. Otherwise return Qnil.
+ (run_pre_post_conversion_on_str): Adjust for the above change.
+ (run_pre_write_conversin_on_c_str): Likewise.
+
+2005-07-13 Kim F. Storm <[email protected]>
+
+ * xdisp.c (start_display): Don't reseat to next visible line start
+ if current start position is in a string or image.
+ (move_it_vertically_backward): Be sure to move out of strings and
+ images when moving it2 forward.
+ (move_it_by_lines): When moving forward, move to next buffer
+ position if we end up in a string or image. When moving backward,
+ count rows moved over when moving to start of current row in case
+ row starts in middle of a string or image. Also move further
+ backward if we end up in a string or image.
+ (try_cursor_movement): If overlay string spans multiple lines,
+ move backward to set cursor on start of an overlay string.
+ (cursor_row_p): Row is ok if cursor is at newline from string, but
+ string starts on this line (so we always position cursor at start
+ of string).
+
+ * indent.c (Fvertical_motion): If start position is on an image,
+ don't move back if we move too far (that's almost certain to happen).
+
+ * xdisp.c (cursor_row_fully_visible_p): Allow partially visible
+ row in minibuffer windows.
+ (try_window): Don't check margins in minibuffer windows.
+
+2005-07-13 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.c: Don't include stdlib.h or composite.h.
+ (x_use_underline_position_properties, last_mouse_press_frame)
+ (x_noop_count, Qvendor_specific_keysyms): Remove unused variables.
+ (syms_of_macterm, mac_initialize): Don't initialize them.
+ (waiting_for_input, initial_argv, initial_argc)
+ (Vcommand_line_args, Vx_no_window_manager, errno, window_scroll)
+ (set_frame_menubar, path_from_vol_dir_name): Remove externs.
+ (extra_keyboard_modifiers): Fix type in extern.
+ (x_window_to_frame, x_window_to_scroll_bar): Remove declarations.
+ (x_scroll_bar_report_motion): Add argument types to declaration.
+ (mac_compute_glyph_string_overhangs): Add declaration.
+ (disable_mouse_highlight): Remove unused variable.
+ [USE_TOOLKIT_SCROLL_BARS] (construct_scroll_bar_click)
+ (x_scroll_bar_handle_press, x_scroll_bar_handle_release)
+ (x_scroll_bar_handle_drag): Remove argument `timestamp'.
+ All callers changed.
+ [USE_TOOLKIT_SCROLL_BARS] (construct_scroll_bar_click): Don't set
+ timestamp.
+ [USE_CARBON_EVENTS] (mac_handle_mouse_event): Likewise.
+ (x_scroll_bar_create, XTset_vertical_scroll_bar): Show scroll bar
+ only when its width is less than the height.
+ (XTredeem_scroll_bar): Sync with xterm.c.
+ (font_name_table, font_name_table_size, font_name_count):
+ Make static.
+ (drag_and_drop_file_list): Remove variable. Previous use is now
+ local to function.
+ (do_ae_open_documents): Move DRAG_N_DROP event construction part
+ from XTread_socket.
+ (XTread_socket): Consolidate setting of event timestamp.
+ Move DRAG_N_DROP event construction part to do_ae_open_documents.
+ Support extra_keyboard_modifiers.
+
+ * xfaces.c (try_font_list) [MAC_OS]: Try font family name
+ beginning with that for ASCII.
+
+2005-07-13 Stefan Monnier <[email protected]>
+
+ * alloc.c (gc_cons_combined_threshold, Vgc_cons_percentage): New vars.
+ (Fgarbage_collect, init_alloc_once): Set gc_cons_combined_threshold.
+ (syms_of_alloc): Declare gc-cons-percentage.
+
+ * eval.c (Feval, Ffuncall):
+ * keyboard.c (read_char):
+ * bytecode.c (MAYBE_GC): Use gc_cons_combined_threshold.
+
+ * lisp.h (gc_cons_combined_threshold): Declare.
+
+2005-07-12 Kim F. Storm <[email protected]>
+
+ * coding.c (Qprocess_argument):
+ * coding.h (Qprocess_argument): Remove unused var.
+
+ * xselect.c (intern): Remove dup. intern and staticpro for QTIMESTAMP.
+
+2005-07-12 YAMAMOTO Mitsuharu <[email protected]>
+
+ * mac.c [!TARGET_API_MAC_CARBON]: Include charset.h, coding.h, and
+ Endian.h.
+ [!MAC_OSX] (fchmod, fchown): New functions.
+ (mac_get_code_from_arg): Don't accept Lisp integer as argument.
+ Use SBYTES and EndianU32_BtoN.
+ (mac_get_object_from_code): Return 4 byte string even if argument
+ is 0. Use make_unibyte_string and EndianU32_NtoB.
+ (Fmac_get_file_creator, Fmac_get_file_type, Fmac_set_file_creator)
+ (Fmac_set_file_type): Fix documents and argument declarations.
+ Don't specify kFSCatInfoNodeFlags. Support Mac OS Classic.
+
+2005-07-11 Stefan Monnier <[email protected]>
+
+ * window.c (Frecenter): Yet another int/Lisp_Object mixup (YAILOM).
+
+2005-07-11 Jan Dj,Ad(Brv <[email protected]>
+
+ * xfaces.c (x_update_menu_appearance): Use fontSet resource for
+ Lucid if X_I18N, font otherwise.
+
+2005-07-10 Steven Tamm <[email protected]>
+
+ * mac.c (Fmac_get_file_type, Fmac_get_file_creator): Add.
+ (Fmac_set_file_type, Fmac_set_file_creator): Add.
+ (mac_get_object_from_code, mac_get_code_from_arg): Add.
+
+2005-07-10 Richard M. Stallman <[email protected]>
+
+ * lread.c (Qeval_buffer_list, Veval_buffer_list): New vars.
+ (syms_of_lread): Set up eval-buffer-list.
+ (Feval_buffer, Feval_region): Bind eval-buffer-list.
+
+2005-07-08 Richard M. Stallman <[email protected]>
+
+ * eval.c (Fdefvar): Allow defvaring a constant to itself quoted.
+
+2005-07-08 Kim F. Storm <[email protected]>
+
+ * keyboard.c (menu_bar_items): Don't GCPRO menu_bar_items_vector here.
+ (syms_of_keyboard): Initialize and staticpro menu_bar_items_vector.
+
+2005-07-07 Kim F. Storm <[email protected]>
+
+ * window.c (Frecenter): Fix last change (set iarg before use).
+
+2005-07-06 Richard M. Stallman <[email protected]>
+
+ * window.c (Frecenter): When arg is inside the scroll margin,
+ move it out of the margin.
+
+2005-07-06 Jason Rumney <[email protected]>
+
+ * w32console.c (initialize_w32_display): Detect when the console
+ dimensions are insane, and default to 80x25 instead.
+ (w32_use_full_screen_buffer): Default to nil.
+
+2005-07-06 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.c (mac_draw_vertical_window_border): Use foreground of
+ VERTICAL_BORDER_FACE_ID for vertical border line.
+ (mac_encode_char): Call check_ccl_update in advance.
+ (mac_to_x_fontname, x_font_name_to_mac_font_name)
+ (init_font_name_table, mac_do_list_fonts, XLoadQueryFont):
+ Don't assume that font family length is less than 32.
+ (x_compute_min_glyph_bounds): Make static.
+ (x_load_font): Never set fonts_changed_p to zero.
+
+2005-07-04 Lute Kamstra <[email protected]>
+
+ * Update FSF's address in GPL notices.
+
+2005-07-03 Richard M. Stallman <[email protected]>
+
+ * xdisp.c (try_window): Fix previous change in how it handles
+ a partially-visible line or one only partly past the margin.
+
+ * window.c (window_scroll_pixel_based): Take account
+ of this_scroll_margin when finding point when scrolling up.
+
+2005-06-29 Ralf Angeli <[email protected]>
+
+ * window.c (window_scroll_pixel_based, window_scroll_line_based):
+ Handle `scroll-preserve-screen-position' non-nil, non-t specially.
+ (syms_of_window) <scroll-preserve-screen-position>: Doc fix.
+
+2005-07-02 Juri Linkov <[email protected]>
+
+ * w32term.c (w32_draw_vertical_window_border): Use foreground of
+ VERTICAL_BORDER_FACE_ID for vertical border line.
+
+2005-07-02 Eli Zaretskii <[email protected]>
+
+ * fileio.c (Fcopy_file): Rearrange the code that calls fchown and
+ fchmod so that chmod doesn't get called on MSDOS before the file
+ is closed.
+
+2005-07-01 Jason Rumney <[email protected]>
+
+ * w32term.c (cleartype_active): New flag for enabling sub-pixel
+ workaround.
+ (w32_initialize): Initialize it.
+ (w32_native_per_char_metric): Allow a couple of extra pixels when
+ Cleartype is active.
+
+ * w32term.c (w32_initialize): Move check for screen reader here
+ from syms_of_w32term.
+
+2005-06-30 Jan Dj,Ad(Brv <[email protected]>
+
+ * xterm.c (handle_one_xevent): bzero compose_status when nbytes
+ is not zero.
+
+2005-07-01 Masatake YAMATO <[email protected]>
+
+ * emacs.c (main): Passing ADD_NO_RANDOMIZE to `personality'.
+
+2005-06-30 Juri Linkov <[email protected]>
+
+ * xdisp.c (x_draw_vertical_border): If left fringe is not present
+ decrease x coord of vertical border by 1 pixel to not occupy text
+ area of the right window.
+
+ * xterm.c (x_draw_vertical_window_border): Use foreground of
+ VERTICAL_BORDER_FACE_ID for vertical border line.
+
+ * term.c (turn_on_face): In standout mode apply specified
+ fg to bg, and specified bg to fg (this makes the logic of
+ inversion on terminal consistent with X).
+
+2005-06-29 Juanma Barranquero <[email protected]>
+
+ * eval.c (user_variable_p_eh): New function.
+ (Fuser_variable_p): Use it. Clarify docstring.
+ Return t for aliases of user options, nil for alias loops.
+
+2005-06-27 Richard M. Stallman <[email protected]>
+
+ * eval.c (Fdefvar): Improve error message.
+
+2005-06-27 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.c [USE_CARBON_EVENTS] (mac_convert_event_ref): Fix last
+ change.
+
+2005-06-27 Juanma Barranquero <[email protected]>
+
+ * eval.c (Fdefvar): Don't try to set constant symbols.
+
+2005-06-25 Richard M. Stallman <[email protected]>
+
+ * macfns.c (Fx_show_tip): Pass new arg to try_window.
+
+ * w32fns.c (Fx_show_tip): Pass new arg to try_window.
+
+ * xfns.c (Fx_show_tip): Pass new arg to try_window.
+
+ * xdisp.c (try_window): New arg CHECK_MARGINS. Calls changed.
+ (redisplay_window): Handle try_window reporting point in scroll margin.
+
+ * dispextern.h (try_window): Declare new arg.
+
+ * fileio.c (Fcopy_file): New arg PRESERVE_UID_GID.
+ Use fchmod to copy the file modes.
+ (Frename_file): Don't copy UID and GID here;
+ instead, specify t for PRESERVE_UID_GID when calling Fcopy_file.
+
+ * eval.c (call_debugger): Take full care of extending stack limits
+ to make space for the debugger, and restore the change afterward.
+ Bind debug-on-error to nil.
+ (restore_stack_limits): New subroutine.
+ (Fsignal): Extend specpdl bound along with eval depth bound,
+ for calling edebug. Don't do either one, for calling debugger.
+ (find_handler_clause): Don't bind debug-on-error here.
+ Don't unbind anything either.
+ Temporarily advance max_specpdl_size for calling
+ internal_with_output_to_temp_buffer.
+ (grow_specpdl): Don't alter max_specpdl_size before signaling
+ an error.
+ (syms_of_eval) <max-specpdl-size>: Doc fix.
+
+ * lread.c (read1): 0.0e+NaN should make a "positive" NaN.
+
+2005-06-24 Eli Zaretskii <[email protected]>
+
+ * fileio.c (Frename_file): Undo last change: no need to ifdef away
+ chown on DOS_NT platforms.
+
+ * w32.c (sys_chown): New function.
+
+ * s/ms-w32.h (chown): New; define to sys_chown.
+
+2005-06-24 Juanma Barranquero <[email protected]>
+
+ * xdisp.c (syms_of_xdisp) <nobreak-char-display>: Doc fix.
+ (syms_of_xdisp) <void-text-area-pointer>: Doc fix.
+
+ * fileio.c (Frename_file)[!DOS_NT]: Don't call chown on MSDOS/Windows.
+
+2005-06-23 Richard M. Stallman <[email protected]>
+
+ * xdisp.c (get_next_display_element): Finish reversing the tests of
+ Vnobreak_char_display.
+
+ * xdisp.c (Vnobreak_char_display): Rename from Vshow_nonbreak_escape.
+ All uses changed.
+ (Qnobreak_space): Rename from Qno_break_space. All uses changed.
+ (syms_of_xdisp): Define nobreak-char-display and nobreak-space.
+
+ * fileio.c (Frename_file): Preserve owner and group, if possible,
+ when copying.
+
+2005-06-23 Juanma Barranquero <[email protected]>
+
+ * abbrev.c (Funexpand_abbrev):
+ * category.c (Fmake_category_set):
+ * dispnew.c (Fsleep_for, Fsit_for):
+ * editfns.c (Fsubst_char_in_region):
+ * eval.c (Fdefvar, Fdefconst, Feval, Ffuncall):
+ * frame.c (make_frame_without_minibuffer):
+ * lread.c (read_vector):
+ * macfns.c (check_x_frame):
+ * process.c (Fstop_process, Fcontinue_process):
+ * search.c (Freplace_match):
+ * syntax.c (Fstring_to_syntax):
+ * w32fns.c (check_x_frame, check_x_display_info):
+ * xfaces.c (x_supports_face_attributes_p):
+ * xselect.c (Fx_own_selection_internal): Follow error conventions.
+
+ * image.c (fn_png_init_io): Don't define it.
+ (init_png_functions) [HAVE_NTGUI]: Don't initialize fn_png_init_io.
+ (png_read_from_file): New function, based on png_read_from_memory.
+ (png_load): Use it, instead of fn_png_init_io.
+
+2005-06-23 Kim F. Storm <[email protected]>
+
+ * search.c (Fmatch_data): Remove evaporate option.
+ (Fset_match_data): Do not mention evaporate option in doc string.
+ Add commentary explaining evaporate arg (for internal use only).
+ (unwind_set_match_data): Add comment on evaporate use.
+
+2005-06-22 Miles Bader <[email protected]>
+
+ * xfaces.c (Qvertical_border): Rename from `Qvertical_divider'.
+ (realize_basic_faces, syms_of_xfaces): Update references to it.
+ * dispextern.h (enum face_id): Rename `VERTICAL_DIVIDER_FACE_ID'
+ to `VERTICAL_BORDER_FACE_ID'.
+ * dispnew.c (build_frame_matrix_from_leaf_window): Update references.
+
+2005-06-21 Juri Linkov <[email protected]>
+
+ * dispextern.h: Add extern Qframe_set_background_mode.
+
+ * xfaces.c: Rename obsolete function Qframe_update_face_colors to
+ Qframe_set_background_mode.
+
+ * frame.c (Fmodify_frame_parameters):
+ Call frame-set-background-mode after changing the background color
+ on non-window non-dos branch.
+
+2005-06-21 Juanma Barranquero <[email protected]>
+
+ * fns.c (Fchar_table_range):
+ * process.c (Fmake_network_process): Fix spellings.
+
+2005-06-20 Kim F. Storm <[email protected]>
+
+ * fns.c (Fsort): Doc fix.
+
+2005-06-20 Miles Bader <[email protected]>
+
+ * xfaces.c (Qvertical_divider): New variable.
+ (realize_basic_faces): Realize its face.
+ (syms_of_xfaces): Initialize it.
+
+ * dispextern.h (enum face_id): Add `VERTICAL_DIVIDER_FACE_ID'.
+
+ * dispnew.c (build_frame_matrix_from_leaf_window): Display vertical
+ window-separator on ttys using `vertical-divider' face by default.
+
+2005-06-17 Richard M. Stallman <[email protected]>
+
+ * xdisp.c (get_next_display_element):
+ Reverse test of Vshow_nonbreak_escape.
+
+ * term.c (produce_special_glyphs): Use spec_glyph_lookup_face.
+ (Ftty_no_underline): New function.
+ (syms_of_term): defsubr it.
+
+ * keyboard.c (read_char): Call restore_getcjmp after jump occurs.
+
+ * dispnew.c (spec_glyph_lookup_face): New function.
+ (build_frame_matrix_from_leaf_window): Use it.
+
+ * dispextern.h (spec_glyph_lookup_face): Add declaration.
+
+ * buffer.c (syms_of_buffer) <cursor-type>: Doc fix.
+
+2005-06-12 Richard M. Stallman <[email protected]>
+
+ * keyboard.c (read_char): After catching a longjmp,
+ call restore_getcjmp.
+
+2005-06-17 Juanma Barranquero <[email protected]>
+
+ * xselect.c (lisp_data_to_selection_data): Fix spelling.
+
+2005-06-15 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.c (mac_compute_glyph_string_overhangs): Don't set
+ overhangs unless the given glyph type is noncomposite CHAR_GLYPH.
+ [USE_CARBON_EVENTS] (mac_convert_event_ref): Convert dead key down
+ events.
+ (XTread_socket): Don't pass keyboard events with the option
+ modifier to the system when Vmac_command_key_is_meta is nil or
+ Vmac_option_modifier is non-nil.
+ [USE_CARBON_EVENTS] (read_socket_inev): New variable.
+ [USE_CARBON_EVENTS] (init_command_handler): Fix argument.
+ [USE_CARBON_EVENTS] (mac_handle_mouse_event): New Carbon event
+ handler function.
+ (install_window_handler) [USE_CARBON_EVENTS]: Install it.
+ (XTread_socket) [USE_CARBON_EVENTS]: Move mouse wheel event
+ handler part to mac_handle_mouse_event.
+
+2005-06-14 Juanma Barranquero <[email protected]>
+
+ * eval.c (Fdefvaralias): Rename arguments SYMBOL and ALIASED to
+ NEW-ALIAS and BASE-VARIABLE, respectively.
+
+2005-06-13 Stefan Monnier <[email protected]>
+
+ * xdisp.c (note_mode_line_or_margin_highlight): Lisp_Object/int mixup.
+ (get_phys_cursor_geometry, format_mode_line_unwind_data)
+ (get_line_height_property, x_produce_glyphs): Remove unused vars.
+
+ * coding.c (run_pre_post_conversion_on_str): Remove unused var `buf'.
+
+2005-06-13 Eli Zaretskii <[email protected]>
+
+ * w32term.c (x_use_underline_position_properties): New variable.
+ (x_draw_glyph_string): Remind in a comment to change doc string of
+ x-use-underline-position-properties if/when underline positioning
+ is implemented.
+ (syms_of_w32term): DEFVAR_BOOL x-use-underline-position-properties,
+ and initialize it to nil.
+
+2005-06-12 Jason Rumney <[email protected]>
+
+ * w32fns.c (NEWOPENFILENAME): New struct.
+ (Fx_file_dialog): Use it to trick the system into giving us up to
+ date dialogs on systems that are documented to support it.
+ Do not set OFN_FILEMUSTEXIST flag if looking for a directory.
+
+2005-06-12 Eli Zaretskii <[email protected]>
+
+ * w32fns.c (w32_abort): Use the MB_YESNO dialog instead of
+ MB_ABORTRETRYIGNORE. Never return, even if DebugBreak does.
+
+2005-06-11 Eli Zaretskii <[email protected]>
+
+ * image.c (x_create_x_image_and_pixmap) [HAVE_NTGUI]: Cast 4th arg
+ to CreateDIBSection to avoid a compiler warning.
+ (pbm_load): Cast 3rd arg to IMAGE_BACKGROUND to avoid a compiler
+ warning.
+ (png_load): Cast return values of fn_png_create_read_struct and
+ fn_png_create_info_struct, to avoid compiler warnings on W32.
+ Cast 3rd arg to IMAGE_BACKGROUND and image_background_transparent
+ to avoid compiler warnings.
+ (jpeg_load): Cast return value of fn_jpeg_std_error to avoid a
+ compiler warning on W32. Cast 3rd arg to IMAGE_BACKGROUND to
+ avoid a compiler warning.
+ (tiff_load): Cast return values of fn_TIFFOpen and
+ fn_TIFFClientOpen to avoid compiler warning on W32. Cast 3rd arg
+ to IMAGE_BACKGROUND to avoid a compiler warning.
+ (gif_load): Cast return values of fn_DGifOpenFileName and
+ fn_DGifOpen to avoid compiler warnings on W32. Cast 3rd arg to
+ IMAGE_BACKGROUND to avoid a compiler warning.
+ (DrawText) [HAVE_NTGUI || MAC_OS]: If already defined, undef
+ before redefining.
+
+ * w32bdf.c (create_offscreen_bitmap): Cast `bitsp' to `void **' in
+ the call to CreateDIBSection, to avoid a compiler warning.
+
+2005-06-11 Jason Rumney <[email protected]>
+
+ * w32fns.c (Fx_file_dialog): Unblock input before falling back to
+ minibuffer.
+ * macfns.c (Fx_file_dialog): Likewise.
+
+2005-06-10 Eli Zaretskii <[email protected]>
+
+ * makefile.w32-in ($(TEMACS)): Depend on addsection.exe.
+
+2005-06-10 Juanma Barranquero <[email protected]>
+
+ * process.c (syms_of_process) [ADAPTIVE_READ_BUFFERING]:
+ * w32fns.c (syms_of_w32fns): Fix spellings.
+
+2005-06-10 Eli Zaretskii <[email protected]>
+
+ * unexw32.c (COPY_CHUNK, COPY_PROC_CHUNK): Add a new argument
+ `verbose'; print diagnostic messages only if it is non-zero.
+ All callers changed to pass a zero value unless DEBUG_DUMP is defined
+ in the environment.
+ (copy_executable_and_dump_data): Print section names with %.8s.
+
+2005-06-10 Masatake YAMATO <[email protected]>
+
+ * xdisp.c (note_mode_line_or_margin_highlight): Call clear_mouse_face
+ when mouse_face is not given.
+
+2005-06-09 Luc Teirlinck <[email protected]>
+
+ * window.c (Fselect_window): Adapt call to Fselect_frame.
+
+ * lisp.h: Update EXFUN of Fselect_frame.
+
+ * keyboard.c (command_loop_1): Adapt call to Fselect_frame.
+
+ * frame.c (Fhandle_switch_frame, Fselect_frame): Delete unused arg
+ no_enter.
+ (Fset_mouse_position, Fset_mouse_pixel_position, Ficonify_frame):
+ Adapt to above change.
+
+2005-06-10 Juanma Barranquero <[email protected]>
+
+ * fns.c (Fmemq, Fmaphash): Doc fixes.
+
+2005-06-09 Juanma Barranquero <[email protected]>
+
+ * xfaces.c (Fdisplay_supports_face_attributes_p):
+ Fix typo in docstring.
+
+2005-06-08 Steven Tamm <[email protected]>
+
+ * unexmacosx.c (copy_data_segment): Copy __la_sym_ptr2 section
+ used by gcc4 on intel mac.
+
+2005-06-09 Kim F. Storm <[email protected]>
+
+ * search.c (Fmatch_data): Add optional RESEAT arg. Unchain markers
+ in REUSE list if non-nil; free them if equal to evaporate.
+ (Fset_match_data): Add optional RESEAT arg. Unchain markers in LIST
+ if non-nil; free them if equal to evaporate. Use XCAR/XCDR.
+ (restore_search_regs): Rename from restore_match_data. Uses changed.
+ (unwind_set_match_data): New function.
+ (record_unwind_save_match_data): New function like save-match-data.
+
+ * lisp.h (Fmatch_data, Fset_match_data): Fix EXFUN.
+ (record_unwind_save_match_data): Add prototype.
+ (restore_search_regs): Rename from restore_match_data.
+
+ * composite.c (compose_chars_in_text):
+ * eval.c (do_autoload):
+ * macmenu.c (set_frame_menubar):
+ * process.c (read_process_output, exec_sentinel):
+ * xmenu.c (set_frame_menubar):
+ * xdisp.c (prepare_menu_bars, update_menu_bar, update_tool_bar):
+ * w32menu.c (set_frame_menubar):
+ Use record_unwind_save_match_data.
+
+2005-06-08 Richard M. Stallman <[email protected]>
+
+ * xdisp.c (get_next_display_element): Alter previous change:
+ Distinguish Vshow_nonbreak_escape = t or not t.
+ For t, use escape_glyph once again, as before previous change.
+ Use space or hyphen for display, instead of the non-ASCII char.
+ (syms_of_xdisp) <show-nonbreak-escape>: Doc fix.
+
+ * process.c (Fstart_process): Don't touch command_channel_p slot.
+
+ * process.h (struct process): Delete command_channel_p.
+
+2005-06-07 Masatake YAMATO <[email protected]>
+
+ * xdisp.c (note_mode_line_or_margin_highlight):
+ Check the overlapping of re-rendering area to avoid flickering.
+ (note_mouse_highlight): Call clear_mouse_face if PART
+ is not ON_MODE_LINE nor ON_HEADER_LINE.
+
+2005-06-07 Kim F. Storm <[email protected]>
+
+ * process.c: Improve commentary for adaptive read buffering.
+
+2005-06-06 Stefan Monnier <[email protected]>
+
+ * xterm.c (x_create_toolkit_scroll_bar): Use XtNarrowScrollbars
+ if available.
+
+2005-06-06 Jan Dj,Ad(Brv <[email protected]>
+
+ * macmenu.c (menu_quit_handler, install_menu_quit_handler):
+ New functions for popping down menus on C-g.
+ (set_frame_menubar, mac_menu_show): Call install_menu_quit_handler.
+
+ * macterm.c: Make mac_quit_char_modifiers and mac_quit_char_keycode
+ non-static.
+
+ * config.in: Add HAVE_CANCELMENUTRACKING.
+
+2005-06-06 Eli Zaretskii <[email protected]>
+
+ * w32heap.h (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_PTR): Remove macros.
+
+ * unexw32.c (RVA_TO_PTR): Move here from w32heap.h.
+
+ * w32proc.c (RVA_TO_PTR): New macro.
+
+ * w32heap.c (RVA_TO_PTR): No need to #undef now.
+
+ * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/w32select.$(O)):
+ Depend on w32heap.h.
+
+2005-06-06 Luc Teirlinck <[email protected]>
+
+ * keyboard.c (command_loop_1): Update Vthis_original_command.
+
+2005-06-06 Richard M. Stallman <[email protected]>
+
+ * xmenu.c (popup_get_selection): Undo previous change.
+
+2005-06-06 Juri Linkov <[email protected]>
+
+ * xdisp.c (Qno_break_space): New variable.
+ (syms_of_xdisp): Initialize it.
+ (get_next_display_element): Add no-break space and soft hypen
+ codes for iso8859-2 and iso8859-5. Don't add `\' for them.
+ Use `no-break-space' face for no-break spaces.
+
+2005-06-06 Jan Dj,Ad(Brv <[email protected]>
+
+ * window.c (delete_window): Handle the case where a h/vchild has
+ a h/vchild.
+
+2005-06-05 Eli Zaretskii <[email protected]>
+
+ * w32.c (sys_setsockopt): Change arg 4 to `const void *'. In the
+ call to pfn_setsockopt, cast optval to `const char *'.
+
+2005-06-04 Eli Zaretskii <[email protected]>
+
+ * w32.c (gettimeofday): Use struct _timeb, not struct timeb.
+ (open_unc_volume): Cast return value of map_w32_filename, to avoid
+ compiler warnings.
+
+ * s/ms-w32.h (fileno): Don't define if already defined.
+
+ * emacs.c: Include w32heap.h, to avoid compiler warning about sbrk.
+
+ * makefile.w32-in (DOC): Define to point to the generated DOC-X.
+
+2005-06-04 Richard M. Stallman <[email protected]>
+
+ * xmenu.c (popup_get_selection): Click not in menu deactivates menu.
+
+2005-06-04 Jan Dj,Ad(Brv <[email protected]>
+
+ * macmenu.c (cleanup_popup_menu): New function.
+ (Fx_popup_menu): Unwind protect cleanup_popup_menu in case
+ mac_menu_show Quit:s.
+ (mac_menu_show): Quit on cancel if not popped up on click (i.e.
+ a dialog).
+
+2005-06-04 Kim F. Storm <[email protected]>
+
+ * coding.c (decode_coding_string): Handle CODING_FINISH_INTERRUPT.
+
+ * callproc.c (Fcall_process): Don't use alloca to gradually
+ increase size of buf, as it effectively uses twice the necessary
+ space on the stack. Instead, pre-allocate buf of full size, and
+ gradually increase the read size.
+
+ * bytecode.c (BYTE_CODE_QUIT): Check Vthrow_on_input.
+
+ * eval.c (unbind_to): Preserve value of Vquit_flag.
+
+ * xterm.c (handle_one_xevent): Also ignore mouse motion just
+ before a button release event.
+
+2005-06-03 Juanma Barranquero <[email protected]>
+
+ * xfaces.c (Finternal_lisp_face_equal_p): Really report
+ on faces in a frame, if the argument FRAME is non-nil.
+ Improve argument/docstring consistency.
+
+2005-06-02 Kim F. Storm <[email protected]>
+
+ * xdisp.c (MODE_LINE_NOPROP_LEN): New macro.
+ (x_consider_frame_title, Fformat_mode_line): Save offset into
+ mode_line_noprop_buf rather than pointer, in case buffer is relocated.
+
+2005-06-01 Kim F. Storm <[email protected]>
+
+ * fns.c (mapcar1): Maybe exit loop if original sequence was modified.
+
+2005-06-01 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.c (mac_to_x_fontname, mac_do_list_fonts): Set XLFD
+ resolution fields for scalable fonts to 0.
+
+ * xfaces.c (build_scalable_font_name): Round pixel size to the
+ nearest integer.
+
+2005-06-01 Kim F. Storm <[email protected]>
+
+ * xdisp.c (display_mode_line): Support nested calls to redisplay
+ and format-mode-line. Set mode_line_target to MODE_LINE_DISPLAY.
+
+2005-05-31 Stefan Monnier <[email protected]>
+
+ * fileio.c (Finsert_file_contents):
+ * xdisp.c (note_mode_line_or_margin_highlight): Lisp_Object/int mixup.
+
+2005-05-31 Kim F. Storm <[email protected]>
+
+ * xdisp.c (mode_line_noprop_buf, mode_line_noprop_buf_end)
+ (mode_line_noprop_ptr): Rename from frame_title_*.
+ (store_mode_line_noprop_char): Rename from store_frame_title_char.
+ (store_mode_line_noprop): Rename from store_frame_title.
+ (mode_line_target): New enum to specify current output target
+ for mode line formatting.
+ (display_mode_element): Test it rather than frame_title_ptr and
+ mode_line_string_list to determine where output should go.
+ (mode_line_proptrans_alist, mode_line_string_alist): Make static.
+ (Vmode_line_unwind_vector): New variable.
+ (format_mode_line_unwind_data, unwind_format_mode_line):
+ New functions for unwind protection in mode line formatting.
+ (x_consider_frame_title): Use them and new local var 'title_start'
+ to support nested calls to format-mode-line and redisplay.
+ Set mode_line_target to MODE_LINE_TITLE.
+ (Fformat_mode_line): Use them and new local var 'string_start' to
+ support nested calls to format-mode-line and redisplay.
+ Set mode_line_target to MODE_LINE_NOPROP or MODE_LINE_STRING.
+ Don't trim trailing dashes.
+ (decode_mode_spec): Don't make infinite number of trailing dashes
+ for MODE_LINE_NOPROP and MODE_LINE_STRING targets.
+ (syms_of_xdisp): Initialize and staticpro mode_line_string_face,
+ mode_line_string_face_prop, and Vmode_line_unwind_vector.
+ (init_xdisp): Initialize mode_line_noprop_ptr to start of _buf.
+ Initialize mode_line_target to MODE_LINE_DISPLAY.
+
+2005-05-29 Richard M. Stallman <[email protected]>
+
+ * buffer.c (Fbuffer_local_value): Call indirect_variable.
+
+2005-05-28 Masatake YAMATO <[email protected]>
+
+ * xdisp.c (note_mode_line_or_margin_highlight): Change the
+ pointer to a hand cursor when hoovering over a mouse-face.
+
+2005-05-27 Kenichi Handa <[email protected]>
+
+ * xterm.c (x_encode_char): Call check_ccl_update in advance.
+
+ * ccl.c: Now an element of Vccl_program_table is a vector of
+ length 4, not 3.
+ (ccl_get_compiled_code): New arg idx. Caller changed.
+ Adjust for the change of Vccl_program_table.
+ (setup_ccl_program): Adjust for the change of Vccl_program_table.
+ (check_ccl_update): New function.
+ (Fregister_ccl_program): Use ASET to set an element of a vector.
+ Adjusted for the change of Vccl_program_table.
+
+ * ccl.h (struct ccl_program): New member idx.
+ (check_ccl_update): Extern it.
+
+2005-05-27 Juanma Barranquero <[email protected]>
+
+ * image.c (Vimage_library_alist): Move from image.el.
+ (syms_of_image): Defvar it.
+ (lookup_image_type): Use it.
+
+ * buffer.c (Fbuffer_local_value): Make argument name match its use
+ in docstring.
+
+2005-05-26 Juanma Barranquero <[email protected]>
+
+ * keyboard.c (Frecursive_edit): Fix typo in docstring.
+ (Fposn_at_x_y): Make argument name match its use in docstring.
+
+2005-05-26 Lute Kamstra <[email protected]>
+
+ * eval.c (Frun_hooks): Mention run-mode-hooks in docstring.
+
+2005-05-24 Masatake YAMATO <[email protected]>
+
+ * xdisp.c (note_mode_line_or_margin_highlight): Use b and e
+ as loop sentinels.
+
+2005-05-24 Nick Roberts <[email protected]>
+
+ * xmenu.c (Fx_popup_dialog): Add a third boolean argument to
+ select frame title ("Question"/"Information").
+ (xdialog_show): Use it.
+
+ * macmenu.c (Fx_popup_dialog, mac_dialog_show): As for xmenu.c.
+
+ * w32menu.c (Fx_popup_dialog, w32_dialog_show): As for xmenu.c.
+
+ * fns.c (Fyes_or_no_p, Fy_or_n_p): Call Fx_popup_dialog with
+ a third argument (Qnil).
+
+ * lisp.h: x-popup-dialog can have three arguments.
+
+ * editfns.c (Fmessage_box): Use "Information" for frame title.
+
+2005-05-23 Thien-Thi Nguyen <[email protected]>
+
+ * termcap.c [VMS]: Include <starlet.h>.
+
+2005-05-23 Masatake YAMATO <[email protected]>
+
+ * xdisp.c (note_mode_line_or_margin_highlight): Add code
+ for mouse-face. Change the type of the first argument from `window'
+ to `Lisp_Object'.
+ (note_mouse_highlight): Call note_mode_line_or_margin_highlight with
+ window instead of w.
+
+2005-05-22 Andreas Schwab <[email protected]>
+
+ * process.c (send_process): Move misplaced volatile.
+
+2005-05-21 Richard M. Stallman <[email protected]>
+
+ * xdisp.c (display_mode_element): If we're processing a list and
+ padding is specified, put it after the last element.
+
+2005-05-21 Eli Zaretskii <[email protected]>
+
+ * fileio.c (Fexpand_file_name) [DOS_NT]: Don't try to support
+ "superroot" on DOS_NT systems.
+
+2005-05-21 David Hunter <[email protected]> (tiny change)
+
+ * process.c (send_process): Restore the SIGPIPE handler if we
+ catch a SIGPIPE.
+
+2005-05-20 Juanma Barranquero <[email protected]>
+
+ * image.c (lookup_image, png_read_from_memory): Remove hacks (and
+ misleading comments).
+ (DEF_IMGLIB_FN): Use C calling convention for image libraries.
+
+2005-05-20 KOBAYASHI Yasuhiro <[email protected]>
+
+ * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges):
+ Correct the right value.
+
+2005-05-19 Nick Roberts <[email protected]>
+
+ * keyboard.c (syms_of_keyboard): Remove Lisp variables
+ post-command-idle-hook and post-command-idle-delay.
+ (command_loop_1): Don't try to execute post-command-idle-hook.
+
+2005-05-16 Kim F. Storm <[email protected]>
+
+ * xdisp.c (handle_display_prop): Handle empty replacement.
+ (handle_single_display_spec): Return -1 for empty replacement.
+
+ * keyboard.c (adjust_point_for_property): Skip empty overlay string.
+
+ * .gdbinit (pitx): Print more info about iterator.
+
+2005-05-16 Andreas Schwab <[email protected]>
+
+ * unexmacosx.c (unexec_realloc): Move declarations before statements.
+
+2005-05-14 Richard M. Stallman <[email protected]>
+
+ * xdisp.c (message3): Call cancel_echoing.
+
+ * alloc.c (Fmemory_full_p): New function.
+ (syms_of_alloc): defsubr it.
+
+ * process.c (send_process_trap): Unblock SIGPIPE.
+ (send_process): Reset SIGPIPE handler before reporting error.
+
+2005-05-14 Nick Roberts <[email protected]>
+
+ * emacs.c (syms_of_emacs): Fix doc string for system-type.
+
+2005-05-13 Richard M. Stallman <[email protected]>
+
+ * fileio.c (Ffind_file_name_handler): Handle lambda-exp as handler.
+ (Finsert_file_contents): If we read 0 bytes from a special file,
+ unlock the visited file if we locked it.
+ (Fmake_symbolic_link, Frecent_auto_save_p): Doc fixes.
+ (Ffile_exists_p, Ffile_symlink_p): Doc fixes.
+
+2005-05-13 YAMAMOTO Mitsuharu <[email protected]>
+
+ * emacs.c (main) [MAC_OS8]: Call init_atimer before mac_term_init.
+
+ * keyboard.c (readable_events) [USE_TOOLKIT_SCROLL_BARS]:
+ Regard toolkit scroll bar thumb drag events as squeezable and prevent
+ redisplay from being paused by them.
+
+ * mac.c [!MAC_OSX]: Include keyboard.h and syssignal.h.
+ [!MAC_OSX] (target_ticks): Remove variable.
+ [!MAC_OSX] (check_alarm, pause, index): Remove functions.
+ [!MAC_OSX && __MRC__] (sys_strftime): Likewise.
+ [!MAC_OSX] (select): If fd 0 is not set in rfds and some input
+ event occurs before timeout, behave as if the function were interrupted.
+ [!MAC_OSX] (sigblock, sigsetmask, alarm): Simulate SIGALRM
+ handling using Time Manager routines.
+ [!MAC_OSX] (mac_atimer_task, mac_atimer_qlink, signal_mask):
+ New variables.
+ [!MAC_OSX] (mac_atimer_handler, set_mac_atimer, remove_mac_atimer)
+ (setitimer): New functions.
+
+ * macfns.c, macmenu.c: Don't include signal.h.
+
+ * macterm.c [USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
+ Rename from get_control_part_bound. All callers changed.
+ (x_scroll_bar_clear): New function.
+ (x_clear_frame): Use it.
+ (XTset_vertical_scroll_bar): Don't call Draw1Control.
+ (x_scroll_bar_handle_click): Change type of second argument from
+ int to ControlPartCode.
+ (check_alarm): Remove declaration.
+ (XTread_socket) [!TARGET_API_MAC_CARBON]: Don't call it.
+ (XTread_socket): Use ControlPartCode instead of SInt16.
+
+2005-05-13 Nozomu Ando <[email protected]>
+
+ * unexmacosx.c: Include assert.h.
+ (MACOSX_MALLOC_MULT16): New define.
+ [MACOSX_MALLOC_MULT16] (ptr_in_unexec_regions): Determine whether
+ ptr is in unexec regions by checking it is multiple of 16.
+ (unexec_malloc_header_t): New typedef.
+ (unexec_malloc, unexec_realloc, unexec_free): Store and use
+ allocated size information in unexec_malloc_header.
+
+2005-05-10 Richard M. Stallman <[email protected]>
+
+ * xterm.c (noinclude): Add #undef.
+
+ * image.c, xfns.c, xmenu.c: Don't include signal.h.
+
+2005-05-09 Juanma Barranquero <[email protected]>
+
+ * fileio.c (Fexpand_file_name, Frename_file, Fadd_name_to_file)
+ (Fmake_symbolic_link, Faccess_file, Frecent_auto_save_p):
+ Doc fixes.
+
+ * dired.c (Ffile_name_completion): Make argument name
+ match its use in docstring.
+
+2005-05-08 Luc Teirlinck <[email protected]>
+
+ * eval.c (Fdefvaralias): Remove any pre-existing
+ variable-documentation property of the alias.
+
+2005-05-07 Thien-Thi Nguyen <[email protected]>
+
+ * xfns.c (start_hourglass): Do nothing when running on a tty.
+
+2005-05-07 Juanma Barranquero <[email protected]>
+
+ * fns.c (Fchar_table_range): Fix typos in docstring.
+
+2005-05-06 Stefan Monnier <[email protected]>
+
+ * fns.c (Fchar_table_range): Yet Another Int/Lisp_Object Mixup.
+
+2005-05-06 Eli Zaretskii <[email protected]>
+
+ * lread.c (Flocate_file_internal): Doc fix.
+
+ * Makefile.in (lisp, shortlisp): Add jka-cmpr-hook.elc.
+
+2005-05-06 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macselect.c (x_own_selection): Accept Lisp string as result of
+ selection converter function.
+ (x_clear_frame_selections): Don't call x-lost-selection-functions
+ if Emacs is not owner of the selection.
+ (Vmac_services_selection): Put variable and initialization in
+ #ifdef MAC_OSX.
+ (syms_of_macselect) [MAC_OSX]: Set default value of
+ Vmac_services_selection to PRIMARY.
+
+ * macterm.c (toolkit_scroll_bar_interaction): Remove unused variable.
+ (mac_handle_tool_bar_click): Remove unused function and declaration.
+ [USE_TOOLKIT_SCROLL_BARS] (scroll_bar_timer_callback)
+ (install_scroll_bar_timer, set_scroll_bar_timer)
+ (control_part_code_to_scroll_bar_part, construct_scroll_bar_click)
+ (get_control_part_bound, x_scroll_bar_handle_press)
+ (x_scroll_bar_handle_release, x_scroll_bar_handle_drag)
+ (x_set_toolkit_scroll_bar_thumb): New functions and declarations.
+ [USE_TOOLKIT_SCROLL_BARS] (last_scroll_bar_part, scroll_bar_timer)
+ (scroll_bar_timer_event_posted_p): New variables.
+ [USE_TOOLKIT_SCROLL_BARS] (SCROLL_BAR_FIRST_DELAY)
+ (SCROLL_BAR_CONTINUOUS_DELAY): New macros.
+ (x_scroll_bar_create): Set control reference with NewControl.
+ (x_scroll_bar_create) [USE_TOOLKIT_SCROLL_BARS]:
+ Initialize track_top and track_height to nil.
+ (x_scroll_bar_set_handle, x_scroll_bar_note_movement):
+ Put functions in #ifndef USE_TOOLKIT_SCROLL_BARS.
+ (XTset_vertical_scroll_bar): Don't make space between scroll bar
+ and associated window.
+ (XTset_vertical_scroll_bar) [MAC_OSX]: Get scroll bar area width
+ from window config.
+ (XTset_vertical_scroll_bar) [USE_TOOLKIT_SCROLL_BARS]:
+ Set track_top and track_height to nil when scroll bar size is changed.
+ Recalculate them if they are nil.
+ (XTread_socket) [MAC_OSX]: Use control kind to determine if the
+ clicked control is a scroll bar.
+ (XTread_socket) [USE_TOOLKIT_SCROLL_BARS]: Use toolkit scroll bar
+ event handler functions. Don't add modifiers to scroll bar click
+ events. Call scroll bar release handler when window is deactivated.
+ (mac_initialize): Remove unused code for X toolkit.
+ (syms_of_macterm) [!USE_TOOLKIT_SCROLL_BARS]:
+ Initialize Vx_toolkit_scroll_bars to nil.
+
+ * macterm.h (struct scroll_bar) [USE_TOOLKIT_SCROLL_BARS]:
+ New members track_top and track_height.
+
+ * sysselect.h [DARWIN || MAC_OSX]: Temporarily undefine
+ init_process when including sys/select.h.
+
+2005-05-05 Luc Teirlinck <[email protected]>
+
+ * eval.c (Fdefvaralias): Doc fix.
+
+ * xmenu.c (Fx_popup_menu, Fx_popup_dialog): Doc fixes.
+
+2005-05-05 Kim F. Storm <[email protected]>
+
+ * buffer.c (init_buffer_once): Set cursor_in_non_selected_windows
+ default value.
+ (syms_of_buffer): Add default-cursor-in-non-selected-windows.
+ Fix type of cursor-in-non-selected-windows.
+
+2005-05-03 Jan Dj,Ad(Brv <[email protected]>
+
+ * mac.c: #undef init_process so not to conflict with system headers.
+
+2005-05-02 Richard M. Stallman <[email protected]>
+
+ * buffer.c (syms_of_buffer): Define cursor-in-non-selected-windows.
+
+ * buffer.h (struct buffer): Add cursor_in_non_selected_windows slot.
+
+ * xdisp.c (Vcursor_in_non_selected_windows)
+ (Qcursor_in_non_selected_windows): Vars deleted.
+ (syms_of_xdisp): Don't initialize them.
+ (get_window_cursor_type): Use cursor_in_non_selected_windows
+ buffer slot.
+
+2005-05-02 Kim F. Storm <[email protected]>
+
+ * macros.c (executing_kbd_macro_index): Rename from
+ executing_macro_index. All uses changed.
+ (executing_kbd_macro_iterations): Rename from
+ executing_macro_iterations. All uses changed.
+ (executing_kbd_macro): Rename from executing_macro.
+ All uses changed.
+ (syms_of_macros): Rename Lisp var executing-macro-index to
+ executing-kbd-macro-index.
+
+ * xdisp.c (move_it_in_display_line_to): Fix last change.
+
+2005-05-01 Luc Teirlinck <[email protected]>
+
+ * xmenu.c (Fx_popup_menu): Doc fix.
+
+ * charset.c (syms_of_charset): Delete defsubr for Schars_in_region.
+
+2005-05-02 Jason Rumney <[email protected]>
+
+ * emacs.c (USAGE3, USAGE4): Keep strings below 2048 bytes.
+
+2005-05-02 Nozomu Ando <[email protected]>
+
+ * sysselect.h: Fix typo.
+
+2005-05-02 Nick Roberts <[email protected]>
+
+ * charset.c (Fchars_in_region): Remove as obsolete.
+
+2005-05-01 Kim F. Storm <[email protected]>
+
+ * xdisp.c (move_it_in_display_line_to): Stop if we move beyond
+ TO_CHARPOS. This may happen if last glyphs was an image or stretch
+ glyph.
+
+2005-05-01 Luc Teirlinck <[email protected]>
+
+ * dispnew.c (sit_for): Vexecuting_macro -> Vexecuting_kbd_macro.
+
+2005-05-01 Richard M. Stallman <[email protected]>
+
+ * xmenu.c [not HAVE_X_TOOLKIT] (xmenu_show):
+ If user cancels the menu, quit unless FOR_CLICK.
+
+ * macros.c (Vexecuting_kbd_macro): Rename from Vexecuting_macro.
+ All uses changed.
+ (syms_of_macros): Define only executing-kbd-macro, not executing-macro.
+ * keyboard.c: Change Vexecuting_macro to Vexecuting_kbd_macro.
+ * macros.h (Vexecuting_kbd_macro): Declare instead of Vexecuting_macro.
+ * commands.h (Vexecuting_kbd_macro): Likewise.
+
+2005-05-01 Thien-Thi Nguyen <[email protected]>
+
+ * sysdep.c (get_frame_size) [VMS]: Use a fresh i/o channel.
+
+2005-04-30 Richard M. Stallman <[email protected]>
+
+ * fileio.c (Ffind_file_name_handler): Handle the `operations'
+ property of the file name handler.
+ (Qoperations): New variable.
+ (syms_of_fileio): Initialize and staticpro it.
+
+ * xdisp.c (set_message_1): Delete xassert.
+
+2005-04-29 YAMAMOTO Mitsuharu <[email protected]>
+
+ * mac.c: Don't include time.h. Include sysselect.h after systime.h.
+
+ * macfns.c (Fx_server_version): Add BLOCK_INPUT around Gestalt.
+
+ * macgui.h [HAVE_CARBON && MAC_OSX]: Don't undefine/define mktime
+ before/after including Carbon.h if there is a working mktime.
+
+2005-04-28 Kim F. Storm <[email protected]>
+
+ * xfaces.c (resolve_face_name): Add arg SIGNAL_P. Calls changed.
+ Fix cyclic alias check. If alias loop is detected, signal
+ circular-list error if SIGNAL_P, and return Qdefault if !SIGNAL_P.
+
+2005-04-28 Lute Kamstra <[email protected]>
+
+ * eval.c (do_autoload): Record only autoloads in the autoload
+ property of symbols.
+
+2005-04-28 Nick Roberts <[email protected]>
+
+ * emacs.c (USAGE1): Add --basic-display and --quick options.
+
+2005-04-27 Kim F. Storm <[email protected]>
+
+ * data.c (syms_of_data) Staticpro Qcyclic_variable_indirection.
+
+2005-04-26 Richard M. Stallman <[email protected]>
+
+ * window.c (Fsame_window_p, Fspecial_display_p): Doc fixes.
+ (syms_of_window): Doc fixes.
+
+ * indent.c (Fvertical_motion): Undo previous change.
+
+2005-04-26 Kenichi Handa <[email protected]>
+
+ * fns.c (char_table_range): New function.
+ (Fchar_table_range): Signal an error if characters in the range
+ have inconsistent values. Don't check the parent.
+
+2005-04-25 Kenichi Handa <[email protected]>
+
+ * fontset.c (fontset_set): Fix previous change.
+
+2005-04-24 Richard M. Stallman <[email protected]>
+
+ * indent.c (Fvertical_motion): Bind fontification-functions to nil.
+
+2005-04-24 Eli Zaretskii <[email protected]>
+
+ * regex.c (re_search_2, re_match_2_internal): Convert second arg
+ of RE_TRANSLATE to int, to shut up GCC warnings.
+
+ * fileio.c (Fcopy_file): Doc fix.
+ [MSDOS]: Fix call to emacs_open: buffer_file_type not defined and
+ not needed.
+
+2005-04-24 YAMAMOTO Mitsuharu <[email protected]>
+
+ * Makefile.in [HAVE_CARBON] (MAC_OBJ): Add macselect.o.
+ (SOME_MACHINE_OBJECTS): Likewise.
+ (mac.o): Depend on ccl.h.
+ (macselect.o): New target.
+
+ * emacs.c (main) [MAC_OS8 || MAC_OSX && HAVE_CARBON]:
+ Call syms_of_macselect.
+
+ * frame.c (Fdelete_frame) [MAC_OS]: Call x_clear_frame_selections.
+
+ * mac.c [!TARGET_API_MAC_CARBON]: Don't include charset.h or coding.h.
+ (QCLIPBOARD): Remove variable.
+ (syms_of_mac): Don't initialize it.
+ (Fmac_paste_function, Fmac_cut_function, Fx_selection_exists_p):
+ Remove functions.
+ (syms_of_mac): Don't defsubr them.
+ [TARGET_API_MAC_CARBON] (Qmime_charset, QNFD, QNFKD, QNFC, QNFKC)
+ (QHFS_plus_D, QHFS_plus_C): New variables.
+ (syms_of_mac) [TARGET_API_MAC_CARBON]: Initialize them.
+ [TARGET_API_MAC_CARBON] (get_cfstring_encoding_from_lisp)
+ (cfstring_create_normalized): New functions.
+ [TARGET_API_MAC_CARBON] (Fmac_code_convert_string): Likewise.
+ (syms_of_mac) [TARGET_API_MAC_CARBON]: Defsubr it.
+
+ * macterm.c (handling_window_update, terminate_flag):
+ Remove variables.
+ (do_window_update, do_ae_quit_application, XTread_socket):
+ Don't use them.
+ (WNE_SLEEP_AT_SUSPEND, WNE_SLEEP_AT_RESUME): Don't define.
+ [USE_CARBON_EVENTS && MAC_OSX] (mac_handle_service_event)
+ (init_service_handler): Move to macselect.c. Remove declarations.
+ [USE_CARBON_EVENTS && MAC_OSX] (init_service_handler): Add extern.
+ (Qapplication, Qabout): New variables.
+ (syms_of_mac): Initialize them.
+ [USE_CARBON_EVENTS && MAC_OSX] (Qpreferences, Qservices, Qpaste)
+ (Qperform): New variables.
+ (syms_of_mac) [USE_CARBON_EVENTS && MAC_OSX]: Initialize them.
+ (do_get_menus) [TARGET_API_MAC_CARBON]: Don't call AppendResMenu.
+ (do_menu_choice): Unhighlight menu bar also when menu_id is 0.
+ (mac_store_application_menu_event, init_menu_bar): New functions.
+ [USE_CARBON_EVENTS] (mac_handle_command_event)
+ (init_command_handler): New functions.
+ (mac_handle_window_event): Return noErr on window update event.
+ (do_ae_quit_application): Call mac_store_application_menu_event.
+ (mac_initialize) [USE_CARBON_EVENTS]: Call init_command_handler
+ and init_menu_bar.
+
+ * macterm.h (x_clear_frame_selections): Add extern.
+
+ * macselect.c: New file for selection processing on Mac OS.
+
+2005-04-23 Richard M. Stallman <[email protected]>
+
+ * fileio.c (Fcopy_file): New arg MUSTBENEW.
+ (Frename_file): Pass new arg to Fcopy_file.
+
+ * window.c (window_size_fixed): Variable deleted.
+ (syms_of_window): Initialize window-size-fixed to nil.
+ But don't DEFVAR window_size_fixed.
+
+2005-04-23 Andreas Schwab <[email protected]>
+
+ * m/macppc.h (LD_SWITCH_MACHINE) [LINUX]: Don't define.
+ (START_FILES, LIB_STANDARD) [LINUX && _ARCH_PPC64]: Override to
+ use lib64 instead of lib.
+ (_LP64) [_ARCH_PPC64]: Define if not defined.
+
+2005-04-23 David Hunter <[email protected]> (tiny change)
+
+ * s/ms-w32.h (HAVE_PWD_H): Define.
+
+2005-04-22 Kenichi Handa <[email protected]>
+
+ * fns.c (copy_sub_char_table): Explicitly copy the default value
+ of the sub-chartable.
+
+ * fontset.c (fontset_set): When a sub-chartable is created,
+ explicitly sets the defalt value.
+
+2005-04-22 Kim F. Storm <[email protected]>
+
+ * fns.c (Fplist_get): Replace by Fsafe_plist_get.
+ (Fsafe_plist_get): Rename to Fplist_get.
+ (Fsafe_get): Remove, as Fget now uses safe Fplist_get.
+ (defsubr): Remove defsubr for Fsafe_plist_get and Fsafe_get.
+
+ * lisp.h (Fsafe_plist_get, Fsafe_get): Remove EXFUN.
+
+ * xdisp.c (store_mode_line_string, produce_stretch_glyph)
+ (note_mode_line_or_margin_highlight, note_mouse_highlight):
+ Use Fplist_get instead of Fsafe_plist_get.
+
+ * xfaces.c (resolve_face_name): Use Fget instead of Fsafe_get.
+
+2005-04-21 Miles Bader <[email protected]>
+
+ * xdisp.c (dump_glyph_row): Don't display overlay_arrow_p field.
+
+2005-04-20 Thien-Thi Nguyen <[email protected]>
+
+ * sysdep.c: Remove reference to defunct vms-pwd.h.
+ * dired.c: Likewise. Also, for pwd.h, use HAVE_PWD_H, not !VMS.
+ * editfns.c, fileio.c, filelock.c, sysdep.c, xrdb.c: Likewise.
+
+ * config.in: Regenerate.
+
+2005-04-20 Kenichi Handa <[email protected]>
+
+ * lisp.h (CHAR_TABLE_DEFAULT_SLOT_ASCII): New macro.
+ (CHAR_TABLE_DEFAULT_SLOT_8_BIT_CONTROL): New macro.
+ (CHAR_TABLE_DEFAULT_SLOT_8_BIT_GRAPHIC): New macro.
+
+ * alloc.c (make_sub_char_table): Argument changed to initial
+ value of the slots.
+
+ * data.c (Faref): Handle special slots used as default values of
+ ascii, eight-bit-control, eight-bit-control. Don't ignore a
+ default value set for a group of characters.
+ (Faset): Signal an error if IDXVAL is not a valid character code.
+ Make a sub-chartable with correct initial value.
+
+ * fns.c (Fset_char_table_range): Don't set slots used as default
+ values for ascii, eight-bit-control, eight-bit-graphic.
+ Don't call Faref with charset-id.
+ (Fset_char_table_default): Document how to treat normal character
+ argument. Handle special slots used as default values of ascii,
+ eight-bit-control, eight-bit-control. Make a sub chartable if
+ necessary.
+
+2005-04-20 Kenichi Handa <[email protected]>
+
+ * search.c (boyer_moore): Fix previous change.
+
+2005-04-19 Kim F. Storm <[email protected]>
+
+ * xdisp.c (setup_for_ellipsis): Reset saved_face_id to use default
+ face unless last visible char and first invisible char have the
+ same face. Also use default face if saved_face_id is undefined.
+
+2005-04-19 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macgui.h (MacFontStruct): Remove member `fontname'. Add member
+ `full_name'.
+ [TARGET_API_MAC_CARBON] (MacFontStruct): Use type int for
+ mac_scriptcode member.
+
+ * macterm.c (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
+ (syms_of_mac): Don't initialize them.
+ (Vmac_charset_info_alist): New variable.
+ (syms_of_mac): Defvar it.
+ (create_text_encoding_info_alist): New function.
+ (decode_mac_font_name, mac_to_x_fontname)
+ (x_font_name_to_mac_font_name, init_font_name_table): Don't hard
+ code the correspondence among XLFD charsets, Mac script codes, and
+ Emacs coding systems. Use Vmac_charset_info_alist and result of
+ create_text_encoding_info_alist instead.
+ (init_font_name_table) [TARGET_API_MAC_CARBON]: Use Font Manager
+ routines also on Mac OS Classic.
+ (init_font_name_table) [!TARGET_API_MAC_CARBON]:
+ Use add_font_name_table_entry.
+ (mac_do_list_fonts): Regard 0 in XLFD scaleble fields as
+ specified. Derive unspecified scalable fields from specified one.
+ (x_list_fonts): Consider Valternate_fontname_alist.
+ (kDefaultFontSize): Change value from 9 to 12.
+ (XLoadQueryFont): Get decoded font family, font face, and charset
+ from x_font_name_to_mac_font_name. Set full name of loaded font.
+ (mac_unload_font): Free `full_name' member.
+ (x_load_font): Don't try XLoadQueryFont if x_list_fonts returns
+ NULL. Copy full_name member of struct MacFontStruct to that of
+ struct font_info.
+
+2005-04-19 Kim F. Storm <[email protected]>
+
+ * xdisp.c (handle_stop): Set saved_face_id to current face if
+ selective_display_ellipsis_p so ellipsis will be shown in same
+ face as preceding text.
+ (setup_for_ellipsis): Don't set saved_face_id here.
+ (next_element_from_display_vector): Default to saved_face_id.
+
+ * fns.c (Fsafe_get): New function.
+ (syms_of_fns): Defsubr it.
+
+ * lisp.h (Fsafe_get): EXFUN it.
+
+ * xfaces.c (resolve_face_name): Use Fsafe_get to avoid redisplay
+ loops in case of bad face property lists. Limit number of face
+ alias lookups to 10 (in case of face alias loops).
+
+2005-04-18 Kim F. Storm <[email protected]>
+
+ * dispextern.h (struct glyph_row): New member overlay_arrow_bitmap.
+ It replaces the corresponding member from struct window, as a
+ window may now show multiple overlay arrows.
+ Remove member overlay_arrow_p, superseeded by overlay_arrow_bitmap.
+
+ * dispnew.c (row_equal_p, update_window_line, scrolling_window):
+ Compare overlay_arrow_bitmap than overlay_arrow_p members.
+
+ * fringe.c (draw_fringe_bitmap): Use overlay_arrow_bitmap from row
+ rather than from window.
+ (update_window_fringes): Compare overlay_arrow_bitmap rather than
+ overlay_arrow_p members.
+ (Ffringe_bitmaps_at_pos): Return fringe overlay_arrow_bitmap name
+ if not default.
+
+ * window.h (struct window): Remove member overlay_arrow_bitmap.
+
+ * window.c (make_window): Don't initialize overlay_arrow_bitmap.
+
+ * xdisp.c (overlay_arrow_string_or_property): Remove PBITMAP arg.
+ Calls changed. Don't check for overlay-arrow-bitmap property here.
+ (overlay_arrow_at_row): Remove PBITMAP arg. Instead, if left
+ fringe is present, return Lisp integer for bitmap (or -1 for default).
+ Fix value of overlay-arrow-bitmap property to be a symbol, use
+ lookup_fringe_bitmap to parse it.
+ (display_line): Change call to overlay_arrow_at_row. Store integer
+ return value as overlay bitmap in row rather than window.
+ Only show overlay arrow if row displays text, or if no other overlay
+ arrow is seen in window (if overlay marker is at point-max).
+
+2005-04-18 Thien-Thi Nguyen <[email protected]>
+
+ * xfaces.c (realize_x_face) [!HAVE_WINDOW_SYSTEM]: Return NULL.
+
+2005-04-18 Lute Kamstra <[email protected]>
+
+ * lread.c (Vloads_in_progress): Static.
+ * fns.c (Vloads_in_progress): Remove extern.
+ (load_in_progress): Add extern.
+ (Frequire): Use load_in_progress instead of Vloads_in_progress.
+
+2005-04-18 Thien-Thi Nguyen <[email protected]>
+
+ * xmenu.c (Fx_popup_menu): Initialize error_name to NULL.
+
+2005-04-18 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.c (XTread_socket): Don't beep on keyboard input even if
+ no frame is visible.
+
+2005-04-16 Dan Nicolaescu <[email protected]>
+
+ * term.c (struct keys): Add support for shifted keys.
+
+2005-04-16 Richard M. Stallman <[email protected]>
+
+ * xdisp.c (with_echo_area_buffer): Delete WHICH < 0 case.
+ (set_message): Call with_echo_area_buffer with WHICH = 0.
+ (set_message_1): Erase the echo area buffer first thing.
+ (echo_area_display): Don't clear echo_message_buffer.
+
+2005-04-16 YAMAMOTO Mitsuharu <[email protected]>
+
+ * Makefile.in (mac.o): Depend on charset.h and coding.h.
+
+ * mac.c: Include charset.h and coding.h.
+ [TARGET_API_MAC_CARBON] (Qutf_8): Remove extern.
+ [TARGET_API_MAC_CARBON] (cfstring_create_with_string): New function.
+ [TARGET_API_MAC_CARBON] (Fmac_get_preference): Use it.
+
+ * macfns.c [TARGET_API_MAC_CARBON] (Fx_file_dialog): Likewise.
+
+ * image.c [MAC_OSX] (image_load_quartz2d): Likewise.
+
+ * macterm.c (x_autoselect_window_p): Remove variable.
+ (last_window): New variable.
+ (XTreassert_line_highlight, x_change_line_highlight):
+ Remove declarations.
+ (mac_focus_changed, x_detect_focus_change): New functions and
+ declarations.
+ (XTextExtents16, front_emacs_window): Remove function.
+ (mac_focus_frame): New function.
+ (XTmouse_position, do_menu_choice, do_zoom_window, XTread_socket)
+ (mac_check_for_quit_char): Use it instead of front_emacs_window.
+ (x_scroll_bar_report_motion): Obtain window from control owner.
+ (x_make_frame_invisible): Set window manager size hint.
+ (do_mouse_moved): Remove function.
+ (XTread_socket): Move its contents here. Generate select-window
+ event on mouse movement if needed. Use x_detect_focus_change on
+ activate/deactivate events. Don't deiconify frame or invalidate
+ window rectangle when dnd items are dropped.
+ Don't activate/deactivate root control.
+ (frame_highlight, frame_unhighlight): Activate/deactivate root
+ control here.
+ (syms_of_macterm): Delete DEFVAR_BOOL for x_autoselect_window_p.
+
+ * macterm.h (cfstring_create_with_string) [TARGET_API_MAC_CARBON]:
+ New extern.
+
+2005-04-15 Luc Teirlinck <[email protected]>
+
+ * Makefile.in: Define new macro TOOLTIP_SUPPORT.
+ (lisp): Use it.
+ (SOME_MACHINE_LISP): Add tooltip.
+
+2005-04-14 YAMAMOTO Mitsuharu <[email protected]>
+
+ * mac.c [!TARGET_API_MAC_CARBON]: Include MacLocales.h.
+ Don't include TextEncodingConverter.h.
+ (mac_system_script_code, Vmac_system_locale): New variables.
+ (syms_of_mac): Defvar them.
+ (mac_get_system_locale): New function.
+
+ * macfns.c (x_set_name, x_set_title) [!TARGET_API_MAC_CARBON]:
+ Use ENCODE_SYSTEM to encode title bar string.
+ (x_create_tip_frame): Apply 2005-03-18 change for xfns.c.
+ (Fx_file_dialog) [TARGET_API_MAC_CARBON && !MAC_OSX]:
+ Use CFStringGetSystemEncoding to get system default string encoding.
+
+ * macterm.c [!TARGET_API_MAC_CARBON]: Don't include
+ TextEncodingConverter.h.
+
+2005-04-13 Steven Tamm <[email protected]>
+
+ * macterm.c (syms_of_macterm): Remove redundant definition of
+ mac-pass-control-to-system.
+
+2005-04-12 Stefan Monnier <[email protected]>
+
+ * window.c (Fset_window_configuration): Be careful when you choose
+ among several possible points for the new_current_buffer.
+
+2005-04-12 YAMAMOTO Mitsuharu <[email protected]>
+
+ * keyboard.c (poll_for_input) [SYNC_INPUT]: Don't call
+ poll_for_input_1. Set interrupt_input_pending to 1 instead.
+ (Qlanguage_change) [MAC_OS]: New variable.
+ (syms_of_keyboard) [MAC_OS]: Intern and staticpro it.
+ (kbd_buffer_get_event) [MAC_OS]: Make event for LANGUAGE_CHANGE_EVENT.
+
+ * macterm.c (mac_keyboard_text_encoding)
+ (current_mac_keyboard_text_encoding): Remove variables.
+ (XTread_socket): Store language-change event if keyboard script change
+ is detected. Don't convert input to `mac_keyboard_text_encoding'.
+ (syms_of_macterm): Delete DEFVAR_INT for mac-keyboard-text-encoding.
+
+ * termhooks.h (enum event_kind) [MAC_OS]: Add LANGUAGE_CHANGE_EVENT.
+
+2005-04-10 Richard M. Stallman <[email protected]>
+
+ * emacs.c (standard_args): Rename --bare-bones to --quick.
+ Add -D aka --basic-display.
+
+ * buffer.c (Fmake_indirect_buffer): Clear out some local variables.
+
+2005-04-09 Richard M. Stallman <[email protected]>
+
+ * keymap.c (where_is_internal): Convert a string used as event type
+ into "(any string)".
+
+ * lread.c (Vloads_in_progress): Not static.
+ * fns.c (Vloads_in_progress): Add extern.
+ (Frequire): Don't do LOADHIST_ATTACH if Vloads_in_progress is nil.
+
+2005-04-09 Thien-Thi Nguyen <[email protected]>
+
+ * dispnew.c (mirror_line_dance): Avoid crash if W2 is null.
+
+2005-04-09 Lute Kamstra <[email protected]>
+
+ * print.c (PRINTPREPARE): Check if the marker PRINTCHARFUN is
+ within the accessible part of the buffer.
+
+2005-04-09 Kim F. Storm <[email protected]>
+
+ * lread.c (readevalloop): Add args START and END as region in
+ current buffer to read. Callers changed.
+ When specified, narrow to this region only when reading,
+ not during eval. Track next point to read from during eval.
+ Also restore point to "real" buffer position before eval.
+ (Feval_region): Don't save excursion and restriction here, and
+ don't narrow to region. Just pass region to readevalloop.
+ Note: Point is now preserved even when PRINTFLAG is nil.
+
+2005-04-08 Kim F. Storm <[email protected]>
+
+ * xdisp.c (syms_of_xdisp): Init overlay-arrow-string to "=>".
+
+2005-04-06 Kim F. Storm <[email protected]>
+
+ * emacs.c (standard_args): Add -Q, --bare-bones, -bare-bones.
+
+2005-04-06 YAMAMOTO Mitsuharu <[email protected]>
+
+ * mac.c (cfdate_to_lisp): Add `const' for variable `epoch_gdate'.
+ (Fmac_get_preference): Doc fix.
+
+ * macfns.c (Fx_create_frame, x_create_tip_frame):
+ Add "fontset-mac" to fallback font/fontsets.
+
+2005-04-04 Kim F. Storm <[email protected]>
+
+ * alloc.c (Fgarbage_collect): Call CHECK_CONS_LIST before and after gc.
+
+ * eval.c (Ffuncall): Always call CHECK_CONS_LIST on entry.
+ Call it again after autoload.
+
+2005-04-02 Jan Dj,Ad(Brv <[email protected]>
+
+ * alloc.c (allocate_string_data): Call BLOCK_INPUT before calling
+ mallopt.
+
+ * ralloc.c (r_alloc_init): Ditto.
+
+2005-04-01 Kenichi Handa <[email protected]>
+
+ * lisp.h (Vascii_upcase_table, Vascii_canon_table)
+ (Vascii_eqv_table): Extern them.
+
+ * casetab.c (set_case_table): If standard is nonzero, setup
+ Vascii_upcase_table, Vascii_canon_table, and Vascii_eqv_table.
+
+ * search.c (looking_at_1): Use current_buffer->case_canon_table,
+ not DOWNCASE_TABLE.
+ (string_match_1): Likewise.
+ (fast_c_string_match_ignore_case): Use Vascii_canon_table, not
+ Vascii_downcase_table.
+ (fast_string_match_ignore_case): Likewise.
+ (search_buffer): Fix checking of boyer-moore usability.
+ (boyer_moore): Calculate translate_prev_byte1/2/3 in advance.
+ No need of tranlating characters in PAT. Fix calculation of
+ simple_translate.
+
+2005-03-31 Stefan Monnier <[email protected]>
+
+ * xterm.c [HAVE_XAW3D]: Include ThreeD.h for XtNbeNiceToColormap.
+ (x_create_toolkit_scroll_bar): Test XtNbeNiceToColormap before using it.
+ Use XtNtopShadowPixel and XtNbottomShadowPixel.
+ (x_set_toolkit_scroll_bar_thumb): Remove ugly old hack that didn't
+ really work and that breaks with some versions of Xaw3d.
+
+2005-03-31 Kenichi Handa <[email protected]>
+
+ * coding.c (syms_of_coding): Fix previous change.
+
+2005-03-30 Stefan Monnier <[email protected]>
+
+ * fileio.c (search_embedded_absfilename): Fix last change.
+
+2005-03-25 Kenichi Handa <[email protected]>
+
+ * coding.c (syms_of_coding): Suggest to use set-coding-category in
+ the docstring of coding-category-list.
+
+2005-03-31 Kim F. Storm <[email protected]>
+
+ * keyboard.c (Qmouse_fixup_help_message): New var.
+ (syms_of_keyboard): Intern and staticpro it.
+ (show_help_echo): Apply mouse-fixup-help-message to help string.
+
+2005-03-30 Kim F. Storm <[email protected]>
+
+ * xdisp.c (display_line): Allow multiple overlay arrows in window.
+
+2005-03-28 Stefan Monnier <[email protected]>
+
+ * fileio.c (Fexpand_file_name): Use IS_DEVICE_SEP.
+ (file_name_absolute_p): New fun, extracted from Ffile_name_absolute_p.
+ (Ffile_name_absolute_p): Use it.
+ (search_embedded_absfilename): New fun, extracted from
+ Fsubstitute_in_file_name. Use file_name_absolute_p.
+ Free the pw data after use.
+ (Fsubstitute_in_file_name): Use it.
+ After cutting a prefix, re-check file-name-handler.
+
+2005-03-26 Lennart Borgman <[email protected]>
+
+ * w32term.h (x_output): Add focus_state.
+
+ * w32term.c (x_focus_changed, w32_detect_focus_change): New functions.
+ (w32_read_socket) <WM_SETFOCUS>: Call w32_detect_focus_change.
+
+2005-03-25 Stefan Monnier <[email protected]>
+
+ * minibuf.c (Fminibuffer_complete_and_exit, Fself_insert_and_exit):
+ Use Fexit_minibuffer.
+ (Fexit_minibuffer): Mark it as no-return, deactivate the mark.
+
+2005-03-24 Stefan Monnier <[email protected]>
+
+ * dired.c (Ffile_attributes): Add a missing gcpro.
+
+ * alloc.c (make_number): The arg can be bigger than `int'.
+ * lisp.h (make_number): Make prototype more precise.
+
+ * process.c, dired.c (Vfile_name_coding_system)
+ (Vdefault_file_name_coding_system):
+ * callproc.c (Vdoc_file_name, Vfile_name_coding_system)
+ (Vdefault_file_name_coding_system): Remove unused declarations.
+
+2005-03-24 Jan Dj,Ad(Brv <[email protected]>
+
+ * xmenu.c (create_and_show_popup_menu): Just remove menu and return
+ if it failed to pop up (Gnome "show pointer on ctrl" option makes
+ menus fail to pop up).
+
+2005-03-24 Stefan Monnier <[email protected]>
+
+ * xdisp.c (get_next_display_element): Also use `\ ' & `\-' for latin-9.
+ Just prepend a backslash without replacing the NBSP by an SPC.
+
+2005-03-22 Kim F. Storm <[email protected]>
+
+ * xfaces.c (lookup_derived_face): Add arg SIGNAL_P.
+ * dispextern.h (lookup_derived_face): Fix prototype.
+ * msdos.c (XMenuActivate): Fix call to lookup_derived_face.
+
+ * xdisp.c (handle_single_display_spec): Derive left-fringe and
+ right-fringe face from fringe face.
+
+ * fringe.c (draw_fringe_bitmap_1, Fset_fringe_bitmap_face):
+ Derive face from fringe face.
+
+2005-03-22 Jan Dj,Ad(Brv <[email protected]>
+
+ * xrdb.c (x_load_resources): Undo previous change (2005-03-18).
+
+2005-03-22 David Kastrup <[email protected]>
+
+ * textprop.c (Fnext_char_property_change)
+ (Fprevious_char_property_change): Allow marker as limit.
+ (Fnext_single_char_property_change)
+ (Fprevious_single_char_property_change): Check that limit is a
+ number in strings.
+ (Fnext_single_char_property_change): Coerce position to integer.
+ (Fprevious_single_char_property_change): Same here.
+
+2005-03-21 Thien-Thi Nguyen <[email protected]>
+
+ * s/openbsd.h (LD_SWITCH_SYSTEM_tmp): Define if undefined.
+
+2005-03-19 Stefan Monnier <[email protected]>
+
+ * frame.c (Fignore_event): Remove.
+ (syms_of_frame): Don't defsubr it.
+
+ * keyboard.c (keys_of_keyboard): Just use `ignore' instead of the
+ redundant `ignore-event'.
+
+2005-03-19 Eli Zaretskii <[email protected]>
+
+ * unexec.c (write_segment, unexec): Move these functions to avoid
+ forward references (which cause errors with "gcc -gcoff").
+
+2005-03-18 Jan Dj,Ad(Brv <[email protected]>
+
+ * xfns.c (x_create_tip_frame): Remove setting of Vx_resource_name so
+ that it doesn't become "tooltip". The specbind is enough.
+
+ * xrdb.c (x_load_resources): Use different char *helv when I18N
+ is present.
+
+2005-03-17 Kenichi Handa <[email protected]>
+
+ * coding.c (syms_of_coding): Docstring of coding-category-list fixed.
+
+2005-03-17 Stefan Monnier <[email protected]>
+
+ * xfaces.c (x_update_menu_appearance) [HAVE_X_I18N]:
+ Use xic_create_fontsetname even for non-Motif menus.
+ Don't forget to free the fontsetname.
+
+ * xfns.c (xic_create_fontsetname): Add a final catch-all font pattern.
+
+2005-03-17 Richard M. Stallman <[email protected]>
+
+ * dispnew.c (mirror_line_dance): Set W2 according to FRAME_FROM.
+
+ * fileio.c (Fcopy_file, Frename_file, Fadd_name_to_file)
+ (Fmake_symbolic_link): Use G to read the new file name.
+
+ * callint.c (Finteractive): Document G option.
+ (Fcall_interactively): Implement G option.
+
+ * buffer.c (buffer_lisp_local_variables): New function,
+ broken out from Fbuffer_local_variables.
+ (clone_per_buffer_values): Use buffer_lisp_local_variables.
+
+2005-03-17 Stefan Monnier <[email protected]>
+
+ * xfns.c (xic_create_fontsetname): Add `motif' argument.
+ Always return a freshly allocated string.
+ (xic_create_xfontset): Adjust call.
+
+ * xfaces.c (x_update_menu_appearance) [USE_MOTIF]:
+ Use xic_create_fontsetname to create a fontset so utf-8 locales work.
+ (dump_realized_face): Fix warning.
+
+ * emacs.c (Fkill_emacs): YAILOM.
+
+ * frame.c (Fignore_event): Fix ancient obscure C-u handling bug.
+
+2005-03-17 YAMAMOTO Mitsuharu <[email protected]>
+
+ * mac.c (HASHKEY_TERMINAL): Remove.
+ (HASHKEY_MAX_NID): New macro.
+ (xrm_q_get_resource_1): Rename from xrm_q_get_resource. Add extra
+ argument.
+ (xrm_q_get_resource): Call xrm_q_get_resource_1 with extra argument.
+ (xrm_create_database, xrm_q_put_resource)
+ (xrm_merge_string_database, xrm_q_get_resource_1)
+ (xrm_q_get_resource): Change resource database representation so
+ that it may not use multiple hash tables for a single database.
+ [TARGET_API_MAC_CARBON] (xrm_cfproperty_list_to_value): YAILOM.
+
+2005-03-16 Stefan Monnier <[email protected]>
+
+ * xmenu.c (ENCODE_MENU_STRING) [HAVE_X_I18N]: Use ENCODE_SYSTEM.
+
+ * coding.h (ENCODE_SYSTEM, DECODE_SYSTEM) [!WINDOWSNT]: Use the
+ locale-coding-system, as was already done for WINDOWSNT.
+
+ * keyboard.c (read_char): Only do the 7-bit-meta -> 27-bit-meta
+ translation for chars in the 0-255 range.
+
+2005-03-16 Lute Kamstra <[email protected]>
+
+ * floatfns.c (Ffloor): Doc fix.
+
+2005-03-16 YAMAMOTO Mitsuharu <[email protected]>
+
+ * mac.c: Include macterm.h instead of directly including Carbon.h.
+ [TARGET_API_MAC_CARBON] (Qstring, Qnumber, Qboolean, Qdate, Qdata)
+ (Qarray, Qdictionary): New variables.
+ (syms_of_mac) [TARGET_API_MAC_CARBON]: Initialize them.
+ [TARGET_API_MAC_CARBON] (Qutf_8): Add extern.
+ [TARGET_API_MAC_CARBON] (DECODE_UTF_8): New macro.
+ [TARGET_API_MAC_CARBON] (struct cfdict_context): New struct used
+ in callback for CFDictionaryApplyFunction.
+ [TARGET_API_MAC_CARBON] (cfdata_to_lisp, cfstring_to_lisp)
+ (cfnumber_to_lisp, cfdate_to_lisp, cfboolean_to_lisp)
+ (cfobject_desc_to_lisp, cfdictionary_add_to_list)
+ (cfdictionary_puthash, cfproperty_list_to_lisp): New functions.
+ [TARGET_API_MAC_CARBON] (Fmac_get_preference): New function.
+ (syms_of_mac) [TARGET_API_MAC_CARBON]: Defsubr it.
+ (P, LOOSE_BINDING, SINGLE_COMPONENT, HASHKEY_TERMINAL): New macro.
+ (skip_white_space, parse_comment, parse_include_file)
+ (parse_binding, parse_component, parse_resource_name, parse_value)
+ (parse_resource_line, xrm_create_database, xrm_q_put_resource)
+ (xrm_merge_string_database, xrm_q_get_resource, xrm_get_resource)
+ (xrm_cfproperty_list_to_value, xrm_get_preference_database):
+ New functions.
+
+ * macfns.c (mac_get_rdb_resource): Remove function.
+ (x_get_string_resource): Use xrm_get_resource.
+
+ * macgui.h (XrmDatabase): Typedef to Lisp_Object.
+
+ * macterm.c (x_list_fonts): FONT-LIST-CACHE is now cadr part of
+ name_list_element.
+ (mac_make_rdb): Create resource database from preferences and
+ argument string.
+ (mac_term_init): Save resource database to cddr part of
+ name_list_element.
+
+ * macterm.h (xrm_merge_string_database, xrm_get_resource)
+ (xrm_get_preference_database): Add externs.
+ [TARGET_API_MAC_CARBON] (cfdata_to_lisp, cfstring_to_lisp)
+ (cfnumber_to_lisp, cfdate_to_lisp, cfboolean_to_lisp)
+ (cfobject_desc_to_lisp, cfproperty_list_to_lisp): Likewise.
+
+ * process.c (init_process): Change `#ifdef DARWIN' to `#if
+ defined (DARWIN) || defined (MAC_OSX)'.
+
+ * s/darwin.h (DARWIN): Don't define.
+
+2005-03-16 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macfns.c (Qhyper, Qsuper, Qmeta, Qalt, Qctrl, Qcontrol, Qshift):
+ Remove unused variables.
+ (syms_of_macfns): Don't initialize them. Likewise for
+ Qface_set_after_frame_default. Defvar and initialize
+ Vx_window_horizontal_drag_shape.
+ (x_set_mouse_color): Change mouse pointer shape.
+ (mac_window) [!MAC_OSX]: Create root control.
+ (Fx_create_frame): Remove initializations of mouse pointer shapes.
+ (hourglass_started): New function (from xfns.c).
+ (start_hourglass, cancel_hourglass): Put function body in #ifdef
+ MAC_OSX.
+ (show_hourglass) [TARGET_API_MAC_CARBON]: Create progress
+ indicator for each non-tooltip frame if needed, and show it.
+ (hide_hourglass) [TARGET_API_MAC_CARBON]: Hide progress indicators.
+
+ * macgui.h [!TARGET_API_MAC_CARBON]: Include Appearance.h and
+ Controls.h. Use ThemeCursor instead of CursHandle.
+
+ * macterm.c (activate_scroll_bars, deactivate_scroll_bars):
+ Remove functions and declarations.
+ (mac_set_colors): Take argument for saving background color.
+ All callers changed.
+ (XDrawLine, XClearArea, mac_draw_bitmap, XFillRectangle)
+ (mac_draw_rectangle, mac_draw_string_common): Save and Restore
+ background color.
+ (x_update_end, mac_do_track_drag): Don't reset background color.
+ (mac_define_frame_cursor) [!TARGET_API_MAC_CARBON]:
+ Use SetThemeCursor.
+ (x_set_window_size) [TARGET_API_MAC_CARBON]: Move progress
+ indicator control to the upper-right corner of the window.
+ (arrow_cursor) [!TARGET_API_MAC_CARBON]: Remove variable.
+ (do_init_managers) [!TARGET_API_MAC_CARBON]: Don't initialize it.
+ (do_window_update): Update controls after updating content area.
+ (mac_handle_window_event): Remove unused extern.
+ (XTread_socket): Check both control handle and control part code
+ to determine whether a scroll bar is clicked. Activate/deactivate
+ root control instead of contained scroll bar controls.
+ (make_mac_terminal_frame): Use ThemeCursor constants.
+
+ * macterm.h (struct mac_output) [TARGET_API_MAC_CARBON]:
+ New member hourglass_control.
+ (HOURGLASS_WIDTH, HOURGLASS_HEIGHT): New defines.
+ (activate_scroll_bars, deactivate_scroll_bars): Remove declarations.
+
+2005-03-15 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.c (keycode_to_xkeysym_table): Change mapping so that it
+ coincides with that in Apple X11 except `clear', `enter' on
+ laptops, and fn + `enter' on laptops.
+
+2005-03-12 Stefan Monnier <[email protected]>
+
+ * xmenu.c (ENCODE_MENU_STRING): Explicitly use string_make_unibyte.
+ (list_of_panes, list_of_items, Fx_popup_menu): Use XCAR/XCDR.
+ (digest_single_submenu, xmenu_show): Use ENCODE_MENU_STRING.
+
+ * xfns.c (xic_defaut_fontset): New constant.
+ (xic_create_fontsetname): New function.
+ Extracted from create_frame_xic. Try to generate a slightly
+ better fontset.
+ (xic_create_xfontset): Use it.
+ (create_frame_xic): Simplify.
+
+2005-03-11 Stefan Monnier <[email protected]>
+
+ * fileio.c (Fmake_symbolic_link): Fix last change.
+
+2005-03-11 Richard M. Stallman <[email protected]>
+
+ * fileio.c (Frename_file, Fadd_name_to_file)
+ (Fmake_symbolic_link): If NEWNAME or LINKNAME is a directory,
+ expand the basename of FILE relative to it.
+
+2005-03-11 Kenichi Handa <[email protected]>
+
+ * fileio.c (Finsert_file_contents): Call Fcheck_coding_system
+ before calling setup_coding_system so that autoloading of a coding
+ system work.
+
+2005-03-10 Jan Dj,Ad(Brv <[email protected]>
+
+ * xfns.c (hourglass_started): New function.
+
+ * dispextern.h: Declare hourglass_started.
+
+ * keyboard.c (Fexecute_extended_command): Restart hourglass
+ after call to Fcompleting_read if already started.
+
+ * gtkutil.c (xg_update_scrollbar_pos): Call x_sync so that the
+ GTK main loop is entered in xterm.c, thus doing the redraw.
+
+2005-03-10 Kim F. Storm <[email protected]>
+
+ * xdisp.c (pos_visible_p): Fix X value in last line of buffer.
+
+2005-03-08 Kenichi Handa <[email protected]>
+
+ * frame.c (x_set_font): Call set_default_ascii_font if an
+ available font is found.
+
+ * fontset.c (set_default_ascii_font): New function.
+ (syms_of_fontset): Don't set FONTSET_ASCII (Vdefault_fontset) here.
+
+ * fontset.h (set_default_ascii_font): Extern it.
+
+2005-03-07 Kim F. Storm <[email protected]>
+
+ * xdisp.c (CLEAR_IMAGE_CACHE_COUNT): New const.
+ (clear_image_cache_count): New var.
+ (redisplay_internal): Don't clear face and image caches in the
+ middle of redisplay; do it afterwards.
+
+ * blockinput.h (TOTALLY_UNBLOCK_INPUT): Avoid dangling else.
+
+ * xdisp.c (notice_overwritten_cursor): Check that phys_cursor.vpos
+ is valid. If not, clear phys_cursor_on_p and return.
+
+2005-03-07 Andreas Schwab <[email protected]>
+
+ * blockinput.h (UNBLOCK_INPUT_TO): Always call UNBLOCK_INPUT.
+
+2005-03-06 Richard M. Stallman <[email protected]>
+
+ * keyboard.c (Ftop_level): Let Fthrow deal with UNBLOCK_INPUT.
+
+ * eval.c (unwind_to_catch): Use UNBLOCK_INPUT_TO.
+ (Feval, Ffuncall): Use CHECK_CONS_LIST.
+
+ * lisp.h (CHECK_CONS_LIST): New macro (two definitions).
+
+ * blockinput.h (UNBLOCK_INPUT_TO): New macro.
+ (TOTALLY_UNBLOCK_INPUT): Handle a pending signal if any.
+
+2005-03-05 Juri Linkov <[email protected]>
+
+ * emacs.c (USAGE1): Replace Info node name "command arguments"
+ with "emacs invocation".
+ (USAGE3): Fix usage of `--color=MODE' which actually doesn't
+ allow arguments `--color' and `MODE' to be separated by space.
+ Add --no-blinking-cursor, -nbc.
+ (standard_args): Add -nbc, --no-blinking-cursor.
+
+2005-03-04 Thien-Thi Nguyen <[email protected]>
+
+ * s/vms.h: Define NO_HYPHENS_IN_FILENAMES.
+ * s/vms4-4.h, s/vms5-5.h: Undefine NO_HYPHENS_IN_FILENAMES.
+ * fileio.c (Fexpand_file_name) [VMS]:
+ Use NO_HYPHENS_IN_FILENAMES, not VMS4_4.
+ * doc.c (munge_doc_file_name) [VMS]: Likewise.
+ (Fsnarf_documentation): Call munge_doc_file_name.
+
+2005-03-04 Thien-Thi Nguyen <[email protected]>
+
+ * s/vms.h (FILE_SYSTEM_CASE): New macro.
+ * fileio.c (Fexpand_file_name) [VMS]: Don't upcase the name
+ "manually"; this is now handled generally via FILE_SYSTEM_CASE.
+
+2005-03-04 YAMAMOTO Mitsuharu <[email protected]>
+
+ * emacs.c (main): Change `#ifdef HAVE_CARBON' to `#if
+ defined (MAC_OSX) && defined (HAVE_CARBON)'.
+
+ * image.c [!MAC_OSX && TARGET_API_MAC_CARBON]: Include QuickTime.h.
+
+ * mac.c [!MAC_OSX && HAVE_CARBON]: Include Carbon.h.
+ [!MAC_OSX] (select) [TARGET_API_MAC_CARBON]: Use ReceiveNextEvent.
+ (posix_pathname_to_fsspec, fsspec_to_posix_pathname): New functions.
+ (mac_clear_font_name_table): Move extern to macterm.h.
+
+ * macfns.c (install_window_handler): Move extern to macterm.h.
+ (Fx_file_dialog): Check STRINGP (default_filename) to see it is
+ valid. Don't check !NILP (dir) because it is already checked with
+ CHECK_STRING.
+ (Fx_file_dialog) [!MAC_OSX]: Use FSSpec instead of FSRef for
+ specifying the default location and obtaining the selected filename.
+
+ * macgui.h [!MAC_OSX && HAVE_CARBON]: Include Carbon.h.
+
+ * macmenu.c [TARGET_API_MAC_CARBON]: Don't include headers that
+ are included via Carbon.h.
+
+ * macterm.c [TARGET_API_MAC_CARBON && !MAC_OSX]:
+ Define USE_CARBON_EVENTS to 1.
+ (qd) [__MRC__ && TARGET_API_MAC_CARBON]: Don't declare.
+ (x_free_frame_resources): Call remove_window_handler for
+ non-tooltip windows.
+ [TARGET_API_MAC_CARBON]: Don't include headers that are included
+ via Carbon.h.
+ [TARGET_API_MAC_CARBON] (mac_do_track_dragUPP)
+ (mac_do_receive_dragUPP): New variables.
+ (mac_handle_service_event, init_service_handler): Put declarations
+ and definitions in #ifdef MAC_OSX.
+ (install_window_handler) [TARGET_API_MAC_CARBON]: Create UPPs for
+ drag-and-drop handler functions and register them.
+ (remove_window_handler): New function.
+ (do_ae_open_documents, mac_do_receive_drag) [!MAC_OSX]:
+ Use fsspec_to_posix_pathname.
+ (main): Change #if !TARGET_API_MAC_CARBON to #ifdef MAC_OS8.
+ (XTread_socket) [!MAC_OSX]: Don't pass keyboard events to TSM.
+ [MAC_OS8] (make_mac_terminal_frame) [TARGET_API_MAC_CARBON]:
+ Set default cursors.
+ (mac_initialize) [USE_CARBON_EVENTS && !MAC_OSX]: Don't call
+ init_service_handler or init_quit_char_handler.
+ (mac_initialize) [!MAC_OSX]: Don't call MakeMeTheFrontProcess.
+
+ * macterm.h (install_window_handler, remove_window_handler)
+ (posix_pathname_to_fsspec, fsspec_to_posix_pathname)
+ (mac_clear_font_name_table): New externs.
+
+2005-03-03 Thien-Thi Nguyen <[email protected]>
+
+ * fileio.c (FILE_SYSTEM_CASE): Define macro if not already defined.
+ (Ffile_name_directory): Use FILE_SYSTEM_CASE unconditionally.
+ (Fexpand_file_name): Likewise.
+
+2005-03-03 Thien-Thi Nguyen <[email protected]>
+
+ * emacs.c (Fkill_emacs): Use EXIT_SUCCESS;
+ no longer special-case VMS. Add bogus return value.
+
+2005-03-02 Kim F. Storm <[email protected]>
+
+ * dispextern.h (XASSERTS): Define to 0 if not already defined.
+ (xassert) [!XASSERTS]: Define dummy version.
+
+2005-03-02 Kim F. Storm <[email protected]>
+
+ * xdisp.c (redisplay_window): YABX (yet another bogus xassert).
+ Reported by David Kastrup.
+
+2005-03-01 Ehud Karni <[email protected]>
+
+ * xdisp.c (get_next_display_element): Fix control and escape
+ glyph from display vector.
+
+2005-03-01 Stefan Monnier <[email protected]>
+
+ * keyboard.c (Fposn_at_x_y): Check integerness of X and Y.
+
+2005-02-27 Richard M. Stallman <[email protected]>
+
+ * xdisp.c (fast_find_position): Rename END to BEG.
+ (syms_of_xdisp) <menu-bar-update-hook>: Doc fix.
+
+2005-02-27 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c (xg_resize_outer_widget): Remove unneeded call to
+ gtk_window_resize and x_wm_set_size_hint.
+
+2005-02-25 Kim F. Storm <[email protected]>
+
+ * dispextern.h (OVERLAY_STRING_CHUNK_SIZE): Increase from 3 to 16.
+
+ * xdisp.c (init_from_display_pos): Don't read past end of
+ it->overlay_strings array.
+
+2005-02-25 Stephan Stahl <[email protected]> (tiny change)
+
+ * buffer.c (syms_of_buffer): Fix typo.
+
+2005-02-23 Lute Kamstra <[email protected]>
+
+ * buffer.c (Foverlay_buffer): Doc fix.
+
+2005-02-22 Kim F. Storm <[email protected]>
+
+ * minibuf.c (Ftry_completion, Fall_completions): Allow both string
+ and symbol keys in alists and hash tables.
+
+ * xdisp.c (fast_find_position): Fix search for start of overlay.
+
+2005-02-21 Kim F. Storm <[email protected]>
+
+ * window.c (window_scroll_pixel_based): When scrolling backwards,
+ handle partial visible line at end of window even when we hit PT.
+
+2005-02-21 Stefan Monnier <[email protected]>
+
+ * keymap.h: Declare Fcurrent_active_maps, used in doc.c.
+
+2005-02-21 Kim F. Storm <[email protected]>
+
+ * xdisp.c (move_it_vertically_backward): Eliminate two xasserts.
+ I think those asserts are bogus if buffer contains invisible text
+ or images.
+
+2005-02-21 David Kastrup <[email protected]>
+
+ * gtkutil.c (xg_create_frame_widgets): UNBLOCK_INPUT on error.
+
+2005-02-20 Kim F. Storm <[email protected]>
+
+ * xdisp.c (pos_visible_p): Be sure to move to the specified
+ position. Always get the full ascent / descent of the
+ corresponding row, to return reliable rtop and rbot values.
+ (back_to_previous_visible_line_start): Fix 2005-01-18 change.
+ Must look one character back, as back_to_previous_line_start
+ returns position after the newline.
+ (move_it_vertically_backward): Fix heuristic for when to move further
+ back in case line_height * 2/3 is larger than window height.
+ (cursor_row_fully_visible_p): Rename make_cursor_line_fully_visible_p
+ as it does not do anything anymore. Add arg current_matrix_p to
+ use current matrix rather than desired matrix when set.
+ (try_cursor_movement): Don't scroll to make cursor row fully
+ visible if cursor didn't move. This avoids unexpected recentering
+ in case of blinking cursor or accepting process output.
+ Use current matrix to check cursor row visibility.
+ (redisplay_window): Fix whether to recenter or move to top in case
+ cursor line is taller than window height.
+ (find_first_unchanged_at_end_row): Stop search if we reach a row
+ which not enabled (instead of abort).
+
+2005-02-18 Kim F. Storm <[email protected]>
+
+ * xfaces.c (Finternal_set_lisp_face_attribute): Allow :color property
+ to be nil in a :box attribute value list; customize prints that
+ as lisp value when no box color is specified.
+
+ * .gdbinit (pitx, pit): Pretty print display iterator.
+ (prowx, prow): Pretty print glyph row.
+ (pcursorx, pcursor): Pretty print a window cursor.
+ (pwinx, pwin): Pretty print struct window.
+
+2005-02-18 Stefan Monnier <[email protected]>
+
+ * alloc.c (BLOCK_BYTES): Harmless typo.
+
+2005-02-17 Andreas Schwab <[email protected]>
+
+ * xfns.c (hack_wm_protocols): Use correct type for last parameter
+ of XGetWindowProperty to avoid aliasing issues.
+ (Fx_window_property): Likewise.
+
+ * xselect.c (Fx_disown_selection_internal): Use union of struct
+ input_event and struct selection_input_event to avoid aliasing issues.
+
+ * xterm.c (handle_one_xevent): Use union of struct input_event and
+ struct selection_input_event to avoid aliasing issues.
+ (SET_SAVED_MENU_EVENT): Adapt reference to inev.
+
+2005-02-17 Kim F. Storm <[email protected]>
+
+ * dispextern.h (enum it_method): New enum.
+ (GET_FROM_*): Its members.
+ (struct it): Change member method from function pointer to enum.
+
+ * xdisp.c (check_it, init_from_display_pos, handle_stop)
+ (setup_for_ellipsis, handle_single_display_spec)
+ (handle_composition_prop, next_overlay_string)
+ (get_overlay_strings, reseat_1, reseat_to_string)
+ (next_element_from_ellipsis, BUFFER_POS_REACHED_P)
+ (in_display_vector_p, display_line, get_next_display_element):
+ Change it->method from function pointer to enum.
+ (get_next_element): New array to map it->method to function.
+ (get_next_display_element): Use it.
+ (set_iterator_to_next): Use switch instead of if/else chain.
+
+2005-02-15 Benjamin Riefenstahl <[email protected]>
+
+ * w32select.c: Summary: Thorough rework to implement Unicode
+ clipboard operations and delayed rendering.
+
+ Drop last_clipboard_text and related code, keep track of
+ ownership via clipboard_owner instead. Drop old #if0 sections.
+
+ (DEFAULT_LCID, ANSICP, OEMCP, QUNICODE, QANSICP, QOEMCP)
+ (clipboard_owner, modifying_clipboard, cfg_coding_system)
+ (cfg_codepage, cfg_lcid, cfg_clipboard_type, current_text)
+ (current_coding_system, current_requires_encoding)
+ (current_num_nls, current_clipboard_type, current_lcid):
+ New static variables.
+
+ (convert_to_handle_as_ascii, convert_to_handle_as_coded)
+ (render, render_all, run_protected, lisp_error_handler)
+ (owner_callback, create_owner, setup_config)
+ (enum_locale_callback, cp_from_locale, coding_from_cp):
+ New local functions.
+
+ (term_w32select, globals_of_w32select): New global functions.
+
+ (Fw32_set_clipboard_data): Ignore parameter FRAME, use
+ clipboard_owner instead. Use delayed rendering and provide
+ all text formats. Provide CF_LOCALE if necessary.
+
+ (Fw32_get_clipboard_data): Handle CF_UNICODETEXT and
+ CF_LOCALE. Fall back to CF_TEXT, if CF_UNICODETEXT is not
+ available. Force DOS line-ends for decoding.
+
+ (Fx_selection_exists_p): Handle CF_UNICODETEXT.
+
+ (syms_of_w32select): Init and register new variables.
+
+ * w32.h: Add prototypes for globals_of_w32select and
+ term_w32select. Make the neighboring K&R declarations into
+ prototypes, too.
+
+ * emacs.c: Include w32.h to get function prototypes.
+ (main): Call globals_of_w32select.
+
+ * w32.c (term_ntproc): Call term_w32select.
+
+ * s/ms-w32.h: Guard MSC-specific #pragmas with an #ifdef.
+
+2005-02-16 Kim F. Storm <[email protected]>
+
+ * xdisp.c (BUFFER_POS_REACHED_P): Return true if pos reached and
+ at end of display vector.
+
+2005-02-15 Richard M. Stallman <[email protected]>
+
+ * xdisp.c (get_next_display_element): Fix escape-glyph criterion
+ for mode and header lines.
+
+ * lread.c (syms_of_lread) <user-init-file>: Doc fix.
+
+ * keymap.h (describe_map_tree): Change decl.
+
+ * keyboard.c (command_loop_1): Always use safe_run_hooks
+ to run Qdeferred_action_function.
+
+ * keymap.c (describe_map_tree): New arg MENTION_SHADOW. Calls changed.
+ (describe_map, describe_vector): Likewise. When it's 1,
+ don't omit shadowed bindings, instead mark them as shadowed.
+
+ * doc.c (Fsubstitute_command_keys): Compute list of shadowing maps
+ for describe_map_tree. Pass 1 for MENTION_SHADOW.
+
+ * data.c (Fsetq_default): Allow no arg case.
+
+2005-02-14 Kenichi Handa <[email protected]>
+
+ * coding.c (encode_coding_string): Always return a unibyte string.
+ If NOCOPY is nonzero and there's no need of encoding, make STR
+ unibyte directly.
+
+ * xselect.c (lisp_data_to_selection_data): If OBJ is a non-ASCII
+ multibyte string, signal an error instead of aborting.
+
+2005-02-12 Dan Nicolaescu <[email protected]>
+
+ * keyboard.c: If HAVE_FCNTL_H include fcntl.h.
+
+2005-02-12 Kim F. Storm <[email protected]>
+
+ * xdisp.c (expose_window): Don't fix overlaps for mode lines.
+
+2005-02-10 Kim F. Storm <[email protected]>
+
+ * xdisp.c (try_window_id): Set first_unchanged_at_end_row to NULL
+ if it moves outside window or it doesn't display text.
+
+2005-02-09 Kim F. Storm <[email protected]>
+
+ * undo.c (Fprimitive_undo): Check that undo function does not
+ switch buffer.
+
+2005-02-08 Jan Dj,Ad(Brv <[email protected]>
+
+ * xselect.c (selection_data_to_lisp_data): For the special case
+ type == XA_ATOM, data contains array of int, not array of Atom.
+ (x_property_data_to_lisp, selection_data_to_lisp_data):
+ Comment update: data must be array of int for format == 32.
+
+2005-02-08 Stefan Monnier <[email protected]>
+
+ * undo.c (Fprimitive_undo): Check veracity of delta,start,end.
+
+2005-02-07 Jan Dj,Ad(Brv <[email protected]>
+
+ * xfns.c (Fx_change_window_property): Use long array when format is 32.
+ (Fx_window_property): If format is 32 and long is bigger than 32 bits,
+ convert long array returned from XGetWindowProperty to an int array.
+ (x_set_tool_bar_lines): Check that width and height is greater than
+ zero before clearing area.
+
+ * xselect.c (x_reply_selection_request): Pass long array to
+ XChangeProperty so that 64 bit longs are handeled correctly.
+ (x_get_window_property): If format is 32 and long is bigger than 32
+ bits convert data from XGetWindowProperty from long array to int array.
+ (lisp_data_to_selection_data): When the input is a vector and the
+ format is 32, allocate a long array even if long is bigger than 32 bits.
+ (x_fill_property_data): Use char, short and long as the man page
+ for XChangeProperty specifies. This way the data returned is OK for
+ both 32 and 64 bit machines.
+ (x_handle_dnd_message): Calculate size correctly even for 64 bit
+ machines.
+ (Fx_send_client_event): Undo change from 2005-02-05,
+ x_fill_property_data now handles that case.
+
+ * xfns.c (Fx_backspace_delete_keys_p): Add comment about the
+ reason for the approach in the code.
+
+2005-02-07 Kim F. Storm <[email protected]>
+
+ * undo.c (Fprimitive_undo): Record max one dummmy apply element.
+
+2005-02-06 Richard M. Stallman <[email protected]>
+
+ * eval.c (Frun_hook_with_args)
+ (Frun_hook_with_args_until_success)
+ (Frun_hook_with_args_until_failure): Doc fixes.
+
+2005-02-05 Andreas Schwab <[email protected]>
+
+ * sysdep.c (sys_subshell): Properly terminate execlp argument list.
+
+2005-02-05 Jan Dj,Ad(Brv <[email protected]>
+
+ * xselect.c (Fx_send_client_event, x_handle_dnd_message): Handle
+ the longs in a XClientMessageEvent correctly when long is 64 bits.
+
+2005-02-05 Eli Zaretskii <[email protected]>
+
+ * xfaces.c (face_color_supported_p): Use HAVE_WINDOW_SYSTEM
+ instead of HAVE_X_WINDOWS, for non-X windowed sessions.
+
+2005-02-03 Jan Dj,Ad(Brv <[email protected]>
+
+ * xmenu.c (menubar_selection_callback): Force out GTK buffered
+ events so the menu event comes after them. This is to prevent sit-for
+ from exiting on buffered events directly after a menu selection,
+ lisp code for Help => About Emacs uses sit-for.
+
+ * gtkutil.c (create_menus): Connect selection-done event instead of
+ the deactivate event to deactivate_cb. This will make the last
+ leave event come before the call to deactivate_cb, so the leave
+ event does not make sit-for exit after a menu selection.
+
+2005-02-03 Kim F. Storm <[email protected]>
+
+ * dispnew.c (build_frame_matrix_from_leaf_window)
+ [!GLYPH_DEBUG]: Fix xassert.
+
+ * xfaces.c (x_free_gc) [!GLYPH_DEBUG]: Fix xassert.
+
+ * xfns.c (unwind_create_frame) [!GLYPH_DEBUG]: Fix xassert.
+
+2005-02-03 YAMAMOTO Mitsuharu <[email protected]>
+
+ * mac.c: Use MAC_OS_X_VERSION_MAX_ALLOWED to conditionalize by
+ the compiling OS version.
+
+ * macfns.c (x_create_tip_frame): Likewise.
+
+ * macterm.c (mac_draw_string_common, x_make_frame_visible): Likewise.
+
+2005-02-03 Richard M. Stallman <[email protected]>
+
+ * xterm.c (x_error_quitter): On GCC 3 and up, specify noinline.
+
+ * xdisp.c (echo_area_display): Clear echo_message_buffer.
+
+ * buffer.c (Fbury_buffer): Doc fix.
+
+2005-02-02 Steven Tamm <[email protected]>
+
+ * macfns.c (unwind_create_frame): Fix compile error due to
+ xassert being uncondition, but predicate is.
+ * dispnew.c (update_window): Fix compile error due to
+ xassert being uncondition, but predicate is.
+
+2005-02-02 Miles Bader <[email protected]>
+
+ * dispextern.h (xassert): Enable unconditionally.
+
+2005-02-02 Kim F. Storm <[email protected]>
+
+ * undo.c (Fprimitive_undo): Fix dummy apply undo entry.
+
+2005-02-02 Kenichi Handa <[email protected]>
+
+ * casefiddle.c (casify_object): Enable changing characters of
+ different byte length.
+ (casify_region): Fix loop condition, args to replace_range_2, and
+ update opoint_byte.
+
+ * insdel.c (replace_range_2): Fix bugs in adjusting markers and point.
+
+2005-02-01 Kim F. Storm <[email protected]>
+
+ * xdisp.c (back_to_previous_visible_line_start): Reset iterator
+ stack before calling handle_display_prop.
+
+2005-01-31 Kim F. Storm <[email protected]>
+
+ * undo.c (Qapply): New lisp var.
+ (syms_of_undo): Intern and staticpro it.
+ (Fprimitive_undo): Support formats (apply FUNNAME . ARGS) and
+ (apply DELTA BEG END FUNNAME . ARGS) instead of (FUNNAME . ARGS).
+
+ * buffer.c (syms_of_buffer) <buffer-undo-list>: Doc fix.
+
+2005-01-30 Jesper Harder <[email protected]>
+
+ * macterm.c (syms_of_macterm) <mac-reverse-ctrl-meta>
+ <mac-emulate-three-button-mouse>: Fix docstring indentation.
+
+2005-01-29 Luc Teirlinck <[email protected]>
+
+ * undo.c (syms_of_undo) <undo-outer-limit>: Doc update.
+ Increase value to 3 Meg.
+
+2005-01-29 Jan Dj,Ad(Brv <[email protected]>
+
+ * xfns.c (show_hourglass): Use FRAME_X_WINDOW as parent for GTK,
+ button events are not received otherwise.
+
+2005-01-29 Richard M. Stallman <[email protected]>
+
+ * buffer.c (syms_of_buffer) <buffer-undo-list>: Doc fix.
+
+ * undo.c (Fprimitive_undo): Handle (FUNNAME . ARGS) by calling FUNNAME.
+
+2005-01-28 Stefan Monnier <[email protected]>
+
+ * keymap.c (access_keymap): YAILOM.
+
+2005-01-27 Kim F. Storm <[email protected]>
+
+ * xdisp.c (get_phys_cursor_geometry): New function to calculate
+ phys cursor position and size for hollow cursor. Position is
+ aligned with get_glyph_string_clip_rect and ensures that a hollow
+ cursor is shown, even when the actual glyph is not visible.
+
+ * dispextern.h (get_phys_cursor_geometry): Add prototype.
+
+ * xterm.c (x_clip_to_row): Ensure y >= 0.
+ (x_draw_hollow_cursor): Use get_phys_cursor_geometry.
+
+ * w32term.c (x_draw_hollow_cursor): Use get_phys_cursor_geometry.
+
+ * macterm.c (x_draw_hollow_cursor): Use get_phys_cursor_geometry.
+
+2005-01-27 Stefan Monnier <[email protected]>
+
+ * xterm.c (x_error_quitter): Add a prototype. Make it static again.
+
+2005-01-27 Kim F. Storm <[email protected]>
+
+ * xdisp.c (get_glyph_string_clip_rect): Always show a cursor
+ glyph, even when row is only partially visible and actual cursor
+ position is not visible.
+
+2005-01-24 Richard M. Stallman <[email protected]>
+
+ * xterm.c (x_error_quitter): No longer static, and moved after
+ x_error_handler.
+
+2005-01-24 Kim F. Storm <[email protected]>
+
+ * xdisp.c (move_it_by_lines): If we move forward after going too
+ far back, cancel move if end position is same as start position.
+
+2005-01-24 YAMAMOTO Mitsuharu <[email protected]>
+
+ * dispextern.h (struct glyph_string): New members clip_head and
+ clip_tail.
+
+ * xdisp.c (get_glyph_string_clip_rect): Restrict horizontal clip
+ region to the area between clip_head and clip_tail.
+ (draw_glyphs): Record the area that need to be actually redrawn to
+ the new variables clip_head and clip_tail when there are
+ overhangs. Set values of these variables to the corresponding
+ members in struct glyph_string. Refine x coordinates for
+ notice_overwritten_cursor using clip_head and clip_tail.
+
+ * macgui.h (STORE_XCHARSETSTRUCT): New macro.
+
+ * macterm.c (mac_compute_glyph_string_overhangs): Implement with
+ QDTextBounds.
+ (x_draw_glyph_string): Don't fill the background of the successor
+ of a glyph with a right overhang if the successor will draw a cursor.
+ (XLoadQueryFont): Obtain font metrics using QDTextBounds.
+ (x_redisplay_interface): Add entry for compute_glyph_string_overhangs.
+
+2005-01-24 Kim F. Storm <[email protected]>
+
+ * window.c (window_scroll_pixel_based): Fix scrolling in the wrong
+ direction if window height was smaller than next-screen-context-lines.
+ Now always scroll at least one line in the requested direction.
+ Ensure that we actually do scroll backwards when requested to do so.
+
+ * xdisp.c (redisplay_window): Only try to make cursor line fully
+ visible once (to avoid redisplay loop).
+
+2005-01-23 Kim F. Storm <[email protected]>
+
+ * window.c (Fpos_visible_in_window_p): Simplify return value for
+ partially visible rows.
+ (window_scroll_pixel_based): Adapt to that change.
+
+ * window.c (window_scroll_pixel_based): Force moving to next line
+ if scrolling doesn't move start point, e.g. if looking at tall image.
+
+ * xdisp.c (pos_visible_p): Return 0 if non-interactive.
+ Clear last_height before calling line_bottom_y to get real height.
+ Fix calculation of y.
+
+2005-01-22 Steven Tamm <[email protected]>
+
+ * s/darwin.h: Removed PTY_ITERATION from here.
+ (DARWIN): Define.
+
+ * process.c (init_process): Default process-connection-type to
+ nil on darwin 6 or less, t if it is 7 or higher. This way the
+ broken pty behavior is still allowed on darwin 6 for interactive
+ processes for people that know what they are doing.
+
+2005-01-22 Kim F. Storm <[email protected]>
+
+ * window.c (auto_window_vscroll_p): New boolean.
+ (syms_of_window): DEFVAR_BOOL it.
+ (Fpos_visible_in_window_p): Extend return value to include RTOP
+ and RBOT values if FULLY is nil.
+ (window_scroll_pixel_based): Adjust vscroll for partially visible
+ rows if auto_window_vscroll_p is set.
+ (Fset_window_vscroll): Do nothing if vscroll is not modified.
+
+ * xdisp.c (pos_visible_p): Replace FULLY arg by RTOP and RBOT args
+ to return number of partially invisible pixels at top and bottom
+ of the dislay row at POS.
+
+ * lisp.h (pos_visible_p): Fix prototype.
+
+2005-01-21 Richard M. Stallman <[email protected]>
+
+ * fileio.c (Fcopy_file): Doc fix.
+
+2005-01-21 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c (xg_tool_bar_detach_callback): Remove unused variable bw.
+ (xg_get_file_name): Move declaration ofx_use_old_gtk_file_dialog to
+ start of function for older compilers.
+
+2005-01-20 Richard M. Stallman <[email protected]>
+
+ * editfns.c (Fmessage): If arg is "", return "" (as before).
+
+ * keymap.c (access_keymap): Protect from bad value of meta_prefix_char.
+
+ * .gdbinit (xgetptr, xgetint, xgettype): Copy $arg0 into a temp
+ variable.
+
+2005-01-20 Steven Tamm <[email protected]>
+
+ * editfns.c (Voperating_system_release): Add.
+ (init_editfns): Assign new variable operating-system-release
+ based on call to uname if available.
+ (get_operating_system_release): Add function to
+ allow c-level access to operating system release.
+
+ * config.h: Regenerated.
+
+ * s/darwin.h (PTY_ITERATION): Don't allow PTYs on darwin 6 or less.
+ (MIN_PTY_KERNEL_VERSION): Define minimum kernel version for
+ using ptys as '7'.
+
+2005-01-20 Kim F. Storm <[email protected]>
+
+ * alloc.c (STRING_MARKED_P, VECTOR_MARKED_P): Return boolean.
+
+ * xterm.c (x_draw_glyph_string_box): Fix last_x for full width rows.
+ Thanks to Chong Yidong <[email protected]> for debugging this.
+
+ * macterm.c (x_draw_glyph_string_box): Likewise.
+
+ * w32term.c (x_draw_glyph_string_box): Likewise.
+
+ * indent.c (Fvertical_motion): Temporarily disable selective display.
+
+2005-01-19 Kim F. Storm <[email protected]>
+
+ * xdisp.c (note_mode_line_or_margin_highlight): Fix :pointer
+ image property.
+
+ * fns.c (sweep_weak_table): Advance prev pointer when we keep a pair.
+
+2005-01-18 Kim F. Storm <[email protected]>
+
+ * xdisp.c (fast_find_position): Backtrack to find first row if
+ charpos is inside a display overlay that spans multiple lines.
+
+2005-01-18 Kenichi Handa <[email protected]>
+
+ * coding.c (decode_coding_iso2022): Translate invalid codes if
+ translation-table is specified.
+
+2005-01-18 Kim F. Storm <[email protected]>
+
+ * xdisp.c (back_to_previous_visible_line_start): Undo 2004-12-28
+ change. If handle_display_prop indicates newline is replaced by
+ image or text, move back to start of relevant overlay or interval
+ and continue scan from there. Simplify.
+
+2005-01-17 Kim F. Storm <[email protected]>
+
+ * dispnew.c (mode_line_string, marginal_area_string):
+ Fix off-by-one error in search for glyph.
+
+2005-01-16 Kim F. Storm <[email protected]>
+
+ * macterm.c (syms_of_macterm) <mac-allow-anti-aliasing>: Doc fix.
+
+2005-01-16 Steven Tamm <[email protected]>
+
+ * macterm.c (mac_to_x_fontname): Remove spurious argument.
+
+2005-01-16 Andreas Schwab <[email protected]>
+
+ * macterm.c (mac_draw_string_common): Fix compilation on OSX 10.1.
+
+2005-01-16 Jan Dj,Ad(Brv <[email protected]>
+
+ * fringe.c (Fdefine_fringe_bitmap, init_fringe): When assigning
+ fringe_faces, cast result from xmalloc/xrealloc to Lisp_Object *.
+
+2005-01-16 YAMAMOTO Mitsuharu <[email protected]>
+
+ * keyboard.c (READABLE_EVENTS_DO_TIMERS_NOW)
+ (READABLE_EVENTS_FILTER_EVENTS, READABLE_EVENTS_IGNORE_SQUEEZABLES):
+ New flags for readable_events.
+ (get_filtered_input_pending, readable_filtered_events): Remove.
+ (tracking_off): Call readable_events and get_input_pending with
+ flag READABLE_EVENTS_DO_TIMERS_NOW.
+ (readable_events): Move code from old readable_filtered_events here,
+ but check new READABLE_EVENTS_* in argument flags instead of previous
+ two boolean arguments do_timers_now and filter_events.
+ If we are doing mouse tracking and the mouse moved, return only if
+ READABLE_EVENTS_IGNORE_SQUEEZABLES is not set in flags.
+ (swallow_events): Call get_input_pending with flag
+ READABLE_EVENTS_DO_TIMERS_NOW.
+ (get_input_pending): Move code from old get_filtered_input_pending
+ here. Replace boolean arguments do_timers_now, filter_events with
+ flags, and pass flags to readable_events. Document new
+ READABLE_EVENTS_* flags.
+ (detect_input_pending_ignore_squeezables): New function.
+ (detect_input_pending_run_timers): Call get_input_pending with flag
+ READABLE_EVENTS_DO_TIMERS_NOW.
+ (Finput_pending_p): Call get_input_pending with flags
+ READABLE_EVENTS_DO_TIMERS_NOW and READABLE_EVENTS_FILTER_EVENTS.
+
+ * dispnew.c (update_window, update_frame_1): Replace calls to
+ detect_input_pending with detect_input_pending_ignore_squeezables
+ so that redisplay is not paused if the event queue contains only
+ mouse movements.
+
+ * lisp.h: Declare detect_input_pending_ignore_squeezables.
+
+2005-01-15 Steven Tamm <[email protected]>
+
+ * macterm.c (Vmac_use_core_graphics): Declare variable for
+ mac-allow-anti-aliasing.
+ (syms_of_macterm): DEFVAR_LISP and initialize it.
+ (mac_draw_string_common): Use core graphics text rendering if
+ mac-allow-anti-aliasing is enabled.
+
+ * macfns.c (Fx_file_dialog): Save As dialog includes only the
+ file name in the text box.
+
+2005-01-15 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macfns.c (x_set_foreground_color, x_set_background_color):
+ Sync with xfns.c.
+ (mac_window, x_create_tip_frame): Use XSetWindowBackground.
+ * macterm.c (XSetBackground, XSetWindowBackground): New functions.
+ * macterm.h (XSetBackground, XSetWindowBackground): Add externs.
+
+2005-01-14 Kim F. Storm <[email protected]>
+
+ * keyboard.c (Fposn_at_x_y): Add optional arg WHOLE.
+
+2005-01-13 Richard M. Stallman <[email protected]>
+
+ * keymap.c (Fcurrent_active_maps): Ignore Voverriding_local_map
+ if Voverriding_terminal_local_map is non-nil.
+
+ * keyboard.c (syms_of_keyboard): Doc fix.
+
+2005-01-13 Kim F. Storm <[email protected]>
+
+ * xdisp.c (Fformat_mode_line): Fix last change. Remove NO_PROPS arg
+ (specify 0 for FACE instead). Reorder arg list. Doc fix.
+
+2005-01-12 Richard M. Stallman <[email protected]>
+
+ * xdisp.c (Fformat_mode_line): New arg FACE specifies a default
+ face property for characters that don't specify one.
+
+ * fns.c (Frequire): Record in load-history unconditionally.
+
+2005-01-10 Kim F. Storm <[email protected]>
+
+ * dispextern.h (merge_faces): Rename from merge_into_realized_face.
+
+ * xfaces.c (merge_faces): Rename from merge_into_realized_face.
+ Callers changed.
+ Add support to merge with lisp face id too (if face_name is t).
+
+ * xdisp.c (get_next_display_element, next_element_from_display_vector):
+ Don't lookup lface_id from display table glyphs here; instead use
+ merge_faces to merge the lisp face id into current face.
+
+2005-01-09 Kim F. Storm <[email protected]>
+
+ * dispextern.h (struct it): New member dpvec_face_id.
+ (merge_into_realized_face): Add prototype.
+
+ * xfaces.c (merge_into_realized_face): New function. Used to
+ merge escape-glyph face or face from display table into current face.
+
+ * xdisp.c (Vshow_nonbreak_escape): New lisp var.
+ (syms_of_xdisp): DEFVAR_LISP it.
+ (escape_glyph_face): Remove var.
+ (redisplay_window): Don't initialize it.
+ (setup_for_ellipsis, get_next_display_element):
+ Set it->dpvec_face_id to -1.
+ (get_next_display_element): Test Vshow_nonbreak_escape.
+ Do not setup escape_glyph_face.
+ Properly merge escape-glyph face or face from display table with
+ current face for escape and control characters.
+ Set it->dpvec_face_id to relevant face id instead of adding it to each
+ element of display vector.
+ (next_element_from_display_vector): If it->dpvec_face_id is set,
+ use that instead of lface_id from glyph itself.
+
+2005-01-08 Jan Dj,Ad(Brv <[email protected]>
+
+ * xterm.h (struct x_output): New member, toolbar_detached.
+
+ * gtkutil.c (xg_create_frame_widgets): Set initial tool bar height to
+ 38.
+ (xg_tool_bar_detach_callback): Set toolbar_detached to 1.
+ (xg_tool_bar_attach_callback): Set toolbar_detached to 0.
+ (xg_create_tool_bar): Initialize toolbar_detached.
+ (update_frame_tool_bar): Only set FRAME_TOOLBAR_HEIGHT (f) if
+ toolbar_detached is zero.
+
+2005-01-07 Jan Dj,Ad(Brv <[email protected]>
+
+ * xmenu.c (create_and_show_popup_menu): Pass zero as button to
+ gtk_menu_popup if not for_click, so callbacks for the menu are called.
+
+ * gtkutil.c (xg_gtk_scroll_destroy, xg_create_scroll_bar)
+ (xg_tool_bar_callback, xg_tool_bar_help_callback)
+ (update_frame_tool_bar): Cast to EMACS_INT to avoid compiler warning.
+
+ * xselect.c (x_get_foreign_selection, x_fill_property_data)
+ (Fx_get_atom_name, Fx_send_client_event): Replace XFLOAT with
+ XFLOAT_DATA to get extract number from Lisp object.
+
+2005-01-07 Kim F. Storm <[email protected]>
+
+ * xdisp.c (set_iterator_to_next): Fix 2004-12-13 change.
+ Set stop_charpos to current charpos instead of 0.
+
+2005-01-06 Nick Roberts <[email protected]>
+
+ * xdisp.c (Fformat_mode_line): First arg now required.
+
+2005-01-06 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.c (XLoadQueryFont): Correctly handle 0 size
+ font widths that are returned from some Japanese fonts.
+
+2005-01-06 Kim F. Storm <[email protected]>
+
+ * fringe.c (fringe_faces): Change to Lisp_Object pointer.
+ (draw_fringe_bitmap_1): Lookup user defined fringe faces here.
+ (destroy_fringe_bitmap): Set fringe_faces element to nil.
+ (Fdefine_fringe_bitmap, init_fringe): Change allocation of
+ fringe_faces array and init elements to nil.
+ (Fset_fringe_bitmap_face): Set fringe_faces to face name instead of
+ non-persistent face id.
+ (mark_fringe_data): New function for GC.
+
+ * alloc.c (mark_fringe_data): Declare extern.
+ (Fgarbage_collect): Call mark_fringe_data.
+
+ * alloc.c (overrun_check_free): Invalidate freed memory if
+ XMALLOC_CLEAR_FREE_MEMORY is defined.
+
+2005-01-05 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macfns.c: Include sys/param.h.
+ [TARGET_API_MAC_CARBON] (mac_nav_event_callback): New declaration
+ and function.
+ [TARGET_API_MAC_CARBON] (Fx_file_dialog): Use MAXPATHLEN for size
+ of filename string. Set event callback function when creating
+ dialog boxes. Add code conversions for filenames. Don't dispose
+ of apple event descriptor record if failed to create it.
+
+ * macterm.c: Include sys/param.h.
+ [USE_CARBON_EVENTS] (mac_handle_window_event): Add handler for
+ kEventWindowUpdate.
+ (install_window_handler) [USE_CARBON_EVENTS]: Register it.
+ (do_ae_open_documents) [TARGET_API_MAC_CARBON]: Get FSRef instead
+ of FSSpec from apple event descriptor record.
+ (do_ae_open_documents) [TARGET_API_MAC_CARBON]: Use MAXPATHLEN for
+ size of filename string.
+ [TARGET_API_MAC_CARBON] (mac_do_receive_drag): Likewise.
+ [TARGET_API_MAC_CARBON] (mac_do_receive_drag): Return error when a
+ file dialog is in action.
+ [TARGET_API_MAC_CARBON] (mac_do_track_drag): Likewise.
+ Reject only when there are no filename items. Set background color
+ before (un)highlighting the window below the dragged items.
+ (XTread_socket) [USE_CARBON_EVENTS]: Don't call do_window_update.
+
+2005-01-05 Romain Francoise <[email protected]>
+
+ * term.c (encode_terminal_code): Fix buffer size computation.
+
+2005-01-04 Richard M. Stallman <[email protected]>
+
+ * xdisp.c (Fformat_mode_line): Doc fix.
+
+2005-01-04 Stefan Monnier <[email protected]>
+
+ * alloc.c (refill_memory_reserve): Move.
+ (emacs_blocked_free, emacs_blocked_malloc, emacs_blocked_realloc)
+ (reset_malloc_hooks, uninterrupt_malloc) [SYNC_INPUT]: Don't define.
+
+2005-01-03 Richard M. Stallman <[email protected]>
+
+ * window.c (window_scroll_pixel_based): Don't correct preserve_y
+ for CURRENT_HEADER_LINE_HEIGHT when moving backwards.
+
+2005-01-03 Jason Rumney <[email protected]>
+
+ * w32bdf.c (w32_load_bdf_font): Set fontp->average_width and
+ fontp->space_width to FONT_WIDTH so they are valid.
+
+ * w32fns.c (w32_load_system_font): Set FONT_WIDTH to maximum, not
+ average width. Set fontp->average_width and fontp->space_width to
+ their appropriate values.
+
+ * w32term.c (x_new_font): Set FRAME_COLUMN_WIDTH to
+ fontp->average_width, not FONT_WIDTH. Set FRAME_SPACE_WIDTH to
+ fontp->space_width.
+
+2005-01-03 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
+ (x_font_min_bounds, XLoadQueryFont): Use the correct font width
+ metrics for max and min bounds.
+ (x_load_font): Correctly calculate average font width metrics.
+
+2005-01-02 Richard M. Stallman <[email protected]>
+
+ * alloc.c (Fgarbage_collect): Don't truncate_undo_list on dead buffers.
+
+2004-12-31 Jan Dj,Ad(Brv <[email protected]>
+
+ * xterm.c (handle_one_xevent): Clear area in expose event for GTK.
+
+2004-12-31 Richard M. Stallman <[email protected]>
+
+ * xdisp.c (setup_for_ellipsis, get_next_display_element):
+ Set it->ellipsis_p to 1 or 0.
+ (display_line): Record whether row ends in mid-ellipsis.
+ (set_cursor_from_row): If ends in ellipsis, find start of it.
+ (cursor_row_p): If PT's at the end of the ellipsis the row
+ ends within, don't display cursor on this row.
+
+ * dispextern.h (struct it): New element ellipsis_p.
+ (struct glyph_row): New element ends_in_ellipsis_p.
+
+ * xdisp.c (BUFFER_POS_REACHED_P): We haven't reached the specified
+ position if we're reading from something other than the buffer.
+
+ * window.c (window_scroll_pixel_based): Only look at
+ Vscroll_preserve_screen_position if the old PT can't be kept.
+ (syms_of_window) <scroll-preserve-screen-position>: Doc fix.
+
+2004-12-30 Kim F. Storm <[email protected]>
+
+ * xdisp.c (get_line_height_property): New function extracted from
+ original calc_line_height_property.
+ (calc_line_height_property): Rework. Handle t and (nil . ratio).
+ (x_produce_glyphs): Use them to handle line-height and
+ line-spacing according to new height spec.
+ (Qtotal): Remove.
+ (syms_of_xdisp): Remove intern and staticpro for Qtotal.
+
+2004-12-30 Kenichi Handa <[email protected]>
+
+ * fileio.c (Finsert_file_contents): Don't use
+ current_buffer->buffer_file_coding_system even if REPLACE is
+ non-nil. Call Qafter_insert_file_set_coding with the second arg VISIT.
+
+ * fontset.h (struct font_info): New members space_width and
+ average_width.
+
+ * frame.h (struct frame): New member space_width.
+ (FRAME_SPACE_WIDTH): New macro.
+
+ * xterm.h (struct x_display_info): New member Xatom_AVERAGE_WIDTH.
+
+ * xterm.c (x_new_font): Set FRAME_COLUMN_WIDTH to
+ fontp->average_width, not FONT_WIDTH. Set FRAME_SPACE_WIDTH to
+ fontp->space_width.
+ (x_load_font): Calculate fontp->space_width and fontp->average_width.
+ (x_term_init): Initialize dpyinfo->Xatom_AVERAGE_WIDTH.
+
+ * xdisp.c (x_produce_glyphs): Calculate tab width by
+ FRAME_SPACE_WIDTH, not FRAME_COLUMN_WIDTH.
+
+2004-12-29 Sanghyuk Suh <[email protected]>
+
+ * macterm.c (SelectionRange): Add Xcode position apple event struct.
+ (do_ae_open_documents): Handle Xcode-style file position open events.
+
+2004-12-29 Luc Teirlinck <[email protected]>
+
+ * buffer.c (syms_of_buffer) <vertical-scroll-bar>: Correct typo.
+
+2004-12-29 Richard M. Stallman <[email protected]>
+
+ * buffer.c (syms_of_buffer) <vertical-scroll-bar>: Doc fix.
+
+2004-12-29 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macfns.c (install_window_handler): Modify extern to return OSErr
+ value.
+ (mac_window): Handle return value of install_window_handler.
+
+ * macterm.c (reflect_byte): Remove function.
+ (mac_create_bitmap_from_bitmap_data): Don't call reflect_byte.
+ Lookup table instead.
+ (mac_do_font_lists): Simplify calculation of the longest
+ nonspecial string.
+ (init_mac_drag_n_drop): Remove function and declaration.
+ (mac_initialize) [TARGET_API_MAC_CARBON]: Don't call
+ init_mac_drag_n_drop.
+ (mac_do_track_drag): New function and declaration.
+ (install_window_handler): Return OSErr value.
+ (install_window_handler) [TARGET_API_MAC_CARBON]:
+ Register handlers for tracking/receiving drag-and-drop items.
+ (do_ae_open_documents): Generate unibyte strings for filenames.
+ (mac_do_receive_drag) [TARGET_API_MAC_CARBON]: Likewise.
+ Reject only non-filename items. Set event modifiers, and return value.
+
+2004-12-28 Dan Nicolaescu <[email protected]>
+
+ * coding.c (decode_coding): Fix previous change.
+
+2004-12-28 Richard M. Stallman <[email protected]>
+
+ * xdisp.c (back_to_previous_visible_line_start):
+ Don't call handle_display_prop.
+
+2004-12-28 Dan Nicolaescu <[email protected]>
+
+ * coding.c (decode_coding_XXX, decode_composition_emacs_mule)
+ (decode_coding_emacs_mule, encode_coding_emacs_mule)
+ (decode_coding_iso2022, encode_designation_at_bol)
+ (encode_coding_iso2022, decode_coding_sjis_big5, decode_eol)
+ (decode_coding): Constify arguments and local vars.
+
+2004-12-27 Jan Dj,Ad(Brv <[email protected]>
+
+ * xmenu.c (popup_get_selection): Only pop down dialogs
+ on C-g and Escape.
+ (popup_get_selection): Remove parameter down_on_keypress.
+ (create_and_show_popup_menu, create_and_show_dialog):
+ Remove parameter down_on_keypress to popup_get_selection.
+
+2004-12-27 YAMAMOTO Mitsuharu <[email protected]>
+
+ * dispextern.h: Change HAVE_CARBON to MAC_OS.
+ (struct glyph_string): Likewise.
+
+ * emacs.c (main) [MAC_OS8]: Call mac_term_init instead of
+ mac_initialize.
+
+ * fileio.c (Fnext_read_file_uses_dialog_p, Fread_file_name):
+ Change TARGET_API_MAC_CARBON to HAVE_CARBON.
+
+ * fns.c (vector): Change MAC_OSX to MAC_OS.
+
+ * frame.c (x_set_frame_parameters, x_report_frame_params)
+ (x_set_fullscreen): Remove #ifndef HAVE_CARBON.
+ (x_set_border_width, Vdefault_frame_scroll_bars):
+ Change HAVE_CARBON to MAC_OS.
+
+ * image.c [MAC_OS]: Include sys/stat.h.
+ [MAC_OS && !MAC_OSX]: Include sys/param.h, ImageCompression.h, and
+ QuickTimeComponents.h.
+
+ * mac.c [!MAC_OSX] (mac_wait_next_event): Add extern.
+ [!MAC_OSX] (select): Use mac_wait_next_event.
+ [!MAC_OSX] (run_mac_command): Change EXEC_SUFFIXES to Vexec_suffixes.
+ [!MAC_OSX] (select, run_mac_command): Change `#ifdef
+ TARGET_API_MAC_CARBON' to `#if TARGET_API_MAC_CARBON'.
+ (mac_clear_font_name_table): Add extern.
+ (Fmac_clear_font_name_table): New defun.
+ (syms_of_mac): Defsubr it.
+ [MAC_OSX] (SELECT_POLLING_PERIOD_USEC): New define.
+ [MAC_OSX] (select_and_poll_event): New function.
+ [MAC_OSX] (sys_select): Use it.
+ [MAC_OSX && SELECT_USE_CFSOCKET] (socket_callback): New function.
+ [MAC_OSX && SELECT_USE_CFSOCKET]
+ (SELECT_TIMEOUT_THRESHOLD_RUNLOOP, EVENT_CLASS_SOCK): New defines.
+ [MAC_OSX] (sys_select) [SELECT_USE_CFSOCKET]: Use CFSocket and
+ RunLoop for simultaneously monitoring two kinds of inputs, window
+ events and process outputs, without periodically polling.
+
+ * macfns.c (mac_initialized): Remove extern.
+ (stricmp): Put in #if 0. All callers changed to use xstricmp in
+ xfaces.c.
+ (strnicmp): Decrement `n' at the end of each loop, not the beginning.
+ (check_mac): Use the term "Mac native windows" instead of "Mac OS".
+ (check_x_display_info, x_display_info_for_name): Sync with xfns.c.
+ (mac_get_rdb_resource): New function (from w32reg.c).
+ (x_get_string_resource): Use it.
+ (install_window_handler): Add extern.
+ (mac_window): New function.
+ (Fx_create_frame): Use it instead of make_mac_frame.
+ Set parameter for Qfullscreen. Call x_wm_set_size_hint.
+ (Fx_open_connection, Fx_close_connection): New defuns.
+ (syms_of_macfns): Defsubr them.
+ (x_create_tip_frame) [TARGET_API_MAC_CARBON]:
+ Add kWindowNoUpdatesAttribute to the window attribute.
+ (x_create_tip_frame) [!TARGET_API_MAC_CARBON]: Use NewCWindow.
+ (x_create_tip_frame): Don't call ShowWindow.
+ (Fx_show_tip): Call ShowWindow.
+ (Fx_file_dialog): Change `#ifdef TARGET_API_MAC_CARBON' to `#if
+ TARGET_API_MAC_CARBON'.
+ (mac_frame_parm_handlers): Set handlers for Qfullscreen.
+ (syms_of_macfns) [MAC_OSX]: Initialize mac_in_use to 0.
+
+ * macgui.h [!MAC_OSX]: Don't include Controls.h. Include Windows.h.
+ (Window): Typedef to WindowPtr and move outside `#if
+ TARGET_API_MAC_CARBON'.
+ (XSizeHints): New struct.
+
+ * macterm.c (x_update_begin, x_update_end)
+ [TARGET_API_MAC_CARBON]: Disable screen updates during update of a
+ frame.
+ (x_draw_glyph_string_background, x_draw_glyph_string_foreground)
+ [MAC_OS8]: Use XDrawImageString/XDrawImageString16.
+ (construct_mouse_click): Put in #if 0.
+ (x_check_fullscreen, x_check_fullscreen_move): Remove decls.
+ (x_scroll_bar_create, x_scroll_bar_handle_click): Change `#ifdef
+ TARGET_API_MAC_CARBON' to `#if TARGET_API_MAC_CARBON'.
+ (activate_scroll_bars, deactivate_scroll_bars)
+ [!TARGET_API_MAC_CARBON]: Use ActivateControl/DeactivateControl.
+ (x_make_frame_visible) [TARGET_API_MAC_CARBON]: Reposition window
+ if the position is neither user-specified nor program-specified.
+ (x_free_frame_resources): Free size_hints.
+ (x_wm_set_size_hint): Allocate size_hints if needed. Set size_hints.
+ (mac_clear_font_name_table): New function.
+ (mac_do_list_fonts): Initialize font_name_table if needed.
+ (x_list_fonts): Don't initialize font_name_table. Add BLOCK_INPUT
+ around mac_do_list_fonts.
+ (mac_unload_font): New function.
+ (x_load_font): Add BLOCK_INPUT around XLoadQueryFont.
+ (init_mac_drag_n_drop, mac_do_receive_drag): Enclose declarations
+ and definitions with #if TARGET_API_MAC_CARBON.
+ [USE_CARBON_EVENTS] (mac_handle_window_event): Add decl.
+ (install_window_handler): Add decl.
+ (do_window_update): Add BeginUpdate/EndUpdate for the tooltip
+ window. Use UpdateControls. Get the rectangle that should be
+ updated and restrict the target of expose_frame to it.
+ (do_grow_window): Set minimum height/width according to size_hints.
+ (do_grow_window) [TARGET_API_MAC_CARBON]: Use ResizeWindow.
+ (do_zoom_window): Don't use x_set_window_size.
+ [USE_CARBON_EVENTS] (mac_handle_window_event): New function.
+ (install_window_handler): New function.
+ [!USE_CARBON_EVENTS] (mouse_region): New variable.
+ [!USE_CARBON_EVENTS] (mac_wait_next_event): New function.
+ (XTread_socket) [USE_CARBON_EVENTS]: Move call to
+ GetEventDispatcherTarget inside BLOCK_INPUT.
+ (XTread_socket) [!USE_CARBON_EVENTS]: Use mac_wait_next_event.
+ Update mouse_region when mouse is moved.
+ (make_mac_frame): Remove.
+ (make_mac_terminal_frame): Put in #ifdef MAC_OS8.
+ Initialize mouse pointer shapes. Change values of f->left_pos and
+ f->top_pos. Don't use make_mac_frame. Use NewCWindow.
+ Don't call ShowWindow.
+ (mac_initialize_display_info) [MAC_OSX]: Create mac_id_name from
+ Vinvocation_name and Vsystem_name.
+ (mac_make_rdb): New function (from w32term.c).
+ (mac_term_init): Use it. Add BLOCK_INPUT. Error if display has
+ already been opened. Don't pass argument to
+ mac_initialize_display_info. Don't set dpyinfo->height/width.
+ Add entries to x_display_list and x_display_name_list.
+ (x_delete_display): New function.
+ (mac_initialize): Don't call mac_initialize_display_info.
+ (syms_of_macterm) [!MAC_OSX]: Don't call Fprovide.
+
+ * macterm.h (check_mac): Add extern.
+ (struct mac_output): New member size_hints.
+ (FRAME_SIZE_HINTS): New macro.
+ (mac_unload_font): Add extern.
+
+ * xdisp.c (expose_window, expose_frame): Remove kludges for Mac.
+
+ * xfaces.c (clear_font_table) [MAC_OS]: Call mac_unload_font.
+
+2004-12-27 Richard M. Stallman <[email protected]>
+
+ * buffer.c (Fbuffer_disable_undo): Delete (move to simple.el).
+ (syms_of_buffer): Don't defsubr it.
+
+ * process.c (list_processes_1): Set undo_list instead
+ of calling Fbuffer_disable_undo.
+
+ * xdisp.c (single_display_spec_string_p): Rename from
+ single_display_prop_string_p.
+ (single_display_spec_intangible_p): Rename from
+ single_display_prop_intangible_p.
+ (handle_single_display_spec): Rename from handle_single_display_prop.
+ Rewritten to be easier to understand.
+
+ Change in load-history format. Functions now get (defun . NAME),
+ and variables get just NAME.
+
+ * data.c (Fdefalias): Use (defun . FN_NAME) in LOADHIST_ATTACH.
+
+ * eval.c (Fdefun, Fdefmacro): Use (defun . FN_NAME) in LOADHIST_ATTACH.
+ (Fdefvaralias, Fdefvar, Fdefconst): Use just SYM in LOADHIST_ATTACH.
+ (Qdefvar): Var deleted.
+ (syms_of_eval): Don't initialze it.
+
+ * lread.c (syms_of_lread) <load-history>: Doc fix.
+
+2004-12-27 Jan Dj,Ad(Brv <[email protected]>
+
+ * xmenu.c (popup_get_selection): Pop down on C-g.
+ (set_frame_menubar): Install translations for Lucid/Motif/Lesstif that
+ pops down menu on C-g.
+ (xdialog_show): If dialog popped down and no button in the dialog was
+ pushed, call Fsignal to quit.
+ (xmenu_show): In no toolkit version, if menu returns NO_SELECT call
+ Fsignal to quit.
+
+ * xfns.c (Fx_file_dialog): Motif/Lesstif version: Pop down on C-g.
+
+ * gtkutil.c (xg_initialize): Install bindings for C-g so that
+ dialogs and menus pop down.
+
+2004-12-27 Kenichi Handa <[email protected]>
+
+ * coding.c (code_convert_region): Fix calculation of `ratio'.
+
+2004-12-25 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c (update_frame_tool_bar): Make the value of
+ tool-bar-button-margin control margins of images in tool bar.
+
+ * alloc.c (check_depth): New variable.
+ (overrun_check_malloc, overrun_check_realloc): Only add
+ overhead and write check pattern if check_depth is 1 (to handle
+ recursive calls). Increase/decrease check_depth in entry/exit.
+ (overrun_check_free): Only check for overhead if check_depth is 1.
+ Increase/decrease check_depth in entry/exit.
+
+2004-12-23 Jan Dj,Ad(Brv <[email protected]>
+
+ * keyboard.c (input_available_signal): Call SIGNAL_THREAD_CHECK
+ before touching input_available_clear_time, to avoid accessing it
+ from multiple threads.
+
+2004-12-23 Jason Rumney <[email protected]>
+
+ * image.c (__WIN32__) [HAVE_NTGUI]: Define for correct behaviour
+ of JPEG library.
+
+2004-12-22 Richard M. Stallman <[email protected]>
+
+ * emacs.c (main): If batch mode, set Vundo_outer_limit to nil.
+
+ * lisp.h (Vundo_outer_limit): Fix decl.
+
+ * undo.c (Vundo_outer_limit): Replaces undo_outer_limit.
+ Uses changed.
+ (syms_of_undo): Initialize appropriately.
+ (truncate_undo_list): If it's nil, there's no limit.
+
+2004-12-22 Kenichi Handa <[email protected]>
+
+ * xselect.c (Fx_get_cut_buffer_internal): Return a unibyte string.
+
+2004-12-21 Richard M. Stallman <[email protected]>
+
+ * eval.c (unwind_to_catch): Clear immediate_quit.
+
+ * xdisp.c (get_next_display_element): Display codes 8a0 and 8ad
+ specially as `\ ' and `\-'.
+
+ * keyboard.c (kbd_buffer_store_event_hold):
+ In the code for while-no-input, handle immediate_quit.
+
+ * alloc.c (Fgarbage_collect): Update call to truncate_undo_list.
+ Call that at the very start.
+ (undo_limit, undo_strong_limit, undo_outer_limit): Move to undo.c.
+ (syms_of_alloc): Don't define undo-limit,
+ undo-strong-limit and undo-outer-limit here.
+
+ * undo.c (truncate_undo_list): Return void.
+ Take just one argument, the buffer.
+ Make it current, and inhibit recursive GC.
+ Access and update the undo list directly; return void.
+ Refer to the undo...limit variables directly.
+ Test undo_outer_limit only after counting the whole current command.
+ When it's exceeded, call the function in undo-outer-limit-function.
+ (undo_limit, undo_strong_limit, undo_outer_limit): From alloc.c.
+ (Vundo_outer_limit_function): New variable.
+ (syms_of_undo): Define undo-limit, undo-strong-limit
+ and undo-outer-limit here, and undo-outer-limit-function.
+ Doc fixes.
+
+ * lisp.h (truncate_undo_list): Update decl.
+
+2004-12-21 Piet van Oostrum <[email protected]>
+
+ * fileio.c (Fread_file_name): Delete duplicates in
+ file-name-history when history_delete_duplicates is true.
+
+2004-12-20 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.c (mac_do_list_fonts): Fix memory leak.
+
+2004-12-20 Richard M. Stallman <[email protected]>
+
+ * regex.c (re_match_2_internal) <symend, wordend>:
+ Fix calls to UPDATE_SYNTAX_TABLE_FORWARD.
+
+2004-12-18 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.c (endif, x_font_name_to_mac_font_name):
+ Use maccentraleurroman instead of maccentraleuropean
+ (mac_c_string_match, mac_do_list_fonts): Speed up font search by
+ quickly finding a specific font without needing regexps.
+
+2004-12-15 Jan Dj,Ad(Brv <[email protected]>
+
+ * syssignal.h: Declare main_thread.
+ (SIGNAL_THREAD_CHECK): New macro.
+
+ * keyboard.c (input_available_signal): Move thread checking code
+ to macro SIGNAL_THREAD_CHECK and call that macro.
+ (interrupt_signal): Call SIGNAL_THREAD_CHECK.
+
+ * alloc.c (uninterrupt_malloc): Move main_thread to emacs.c.
+
+ * emacs.c: Define main_thread.
+ (main): Initialize main_thread.
+ (handle_USR1_signal, handle_USR2_signal, fatal_error_signal)
+ (memory_warning_signal): Call SIGNAL_THREAD_CHECK.
+
+ * floatfns.c (float_error): Call SIGNAL_THREAD_CHECK.
+
+ * dispnew.c (window_change_signal): Call SIGNAL_THREAD_CHECK.
+
+ * sysdep.c (select_alarm): Call SIGNAL_THREAD_CHECK.
+
+ * process.c (send_process_trap, sigchld_handler):
+ Call SIGNAL_THREAD_CHECK.
+
+ * data.c (arith_error): Call SIGNAL_THREAD_CHECK.
+
+ * atimer.c (alarm_signal_handler): Call SIGNAL_THREAD_CHECK.
+
+ * xterm.c (xg_scroll_callback): Update XG_LAST_SB_DATA before
+ returning when xg_ignore_gtk_scrollbar is true.
+
+2004-12-14 Kim F. Storm <[email protected]>
+
+ * keyboard.c (read_char): Save and restore echo_string when
+ handling input method.
+
+2004-12-13 Richard M. Stallman <[email protected]>
+
+ * eval.c (syms_of_eval) <quit-flag>: Doc fix.
+
+ * keyboard.c (Vthrow_on_input): New variable.
+ (syms_of_keyboard): Defvar and initialize it.
+ (kbd_buffer_store_event_hold): Handle Vthrow_on_input.
+
+ * lisp.h (QUIT): Check for Vthrow_on_input.
+ (Vthrow_on_input): Declare it.
+
+2004-12-13 Kim F. Storm <[email protected]>
+
+ * xdisp.c (set_iterator_to_next): Reset stop_charpos after display
+ vector.
+
+2004-12-12 Richard M. Stallman <[email protected]>
+
+ * indent.c (Fvertical_motion): Call move_it_by_lines even if LINES = 0.
+
+ * minibuf.c (Fall_completions): Add var `zero' and use it in loop.
+ (Ftry_completion): Really use outer `zero'; eliminate inner one.
+
+2004-12-12 Kenichi Handa <[email protected]>
+
+ * term.c (encode_terminal_code): Fix previous change.
+
+2004-12-11 Stefan Monnier <[email protected]>
+
+ * keyboard.c (handle_async_input): Remove pthread mutex handling.
+ (input_available_signal): Move pthread thingy to !SYNC_INPUT branch.
+
+ * syntax.c (Fforward_word): Avoid non-idempotent side-effects
+ in macro arguments.
+
+ * minibuf.c (Ftry_completion, Fall_completions): Don't use
+ XFASTINT blindly.
+
+ * emacs.c (main, Fdump_emacs): Don't touch malloc hooks if SYNC_INPUT.
+
+2004-12-11 Jan Dj,Ad(Brv <[email protected]>
+
+ * w32term.c (x_calc_absolute_position): Remove calculation of
+ difference between inner and outer window. Don't subtract difference
+ for left and top calculations.
+
+ * xterm.c (x_calc_absolute_position): Don't subtract outer_pixel_diff
+ for left and top calculations. Remove call to x_real_positions.
+ [Bug report by Drew Adams in November.]
+ (x_check_expected_move): Do not set change_gravity to 1 when calling
+ x_set_offset.
+
+2004-12-08 Richard M. Stallman <[email protected]>
+
+ * xdisp.c (get_next_display_element): Use `escape-glyph' for
+ control chars and escaped octal codes.
+ (Qescape_glyph): New variable.
+ (syms_of_xdisp): Initialize it.
+ (escape_glyph_face): New variable.
+ (redisplay_window): Initialize it.
+
+2004-12-07 Paul Eggert <[email protected]>
+
+ * image.c (our_fill_input_buffer, jpeg_load, CHECK_LIB_AVAILABLE)
+ (init_image): Use 1 rather than TRUE. TRUE's not always defined.
+
+2004-12-07 Jan Dj,Ad(Brv <[email protected]>
+
+ * emacs.c (Fdump_emacs): Add ! defined (SYSTEM_MALLOC) around
+ reset_malloc_hooks.
+
+ * keyboard.c (handle_async_input, input_available_signal):
+ Add ! defined (SYSTEM_MALLOC) around thread code.
+
+ * alloc.c: Add comment about the reason for (UN)BLOCK_INPUT_ALLOC.
+
+2004-12-07 Stefan Monnier <[email protected]>
+
+ * eval.c (init_eval_once): Increase max_specpdl_size to 1000.
+
+ * config.in: Regenerate.
+
+2004-12-07 Jan Dj,Ad(Brv <[email protected]>
+
+ * xmenu.c (Fx_popup_menu): Correct documentation about position.
+ (xmenu_show): Do not call XTranslateCoordinates. Adjust position
+ if not given by a mouse click to correspond with x-popup-menu
+ documentation.
+
+ * config.in: Regenerate.
+
+ * gtkutil.c: Include signal.h and syssignal.h.
+ (xg_get_file_name): Block and unblock __SIGRTMIN if defined.
+
+ * alloc.c: If HAVE_GTK_AND_PTHREAD, include pthread.h,
+ new variables main_thread and alloc_mutex,
+ define (UN)BLOCK_INPUT_ALLOC to use alloc_mutex to protect
+ emacs_blocked_* calls and only do (UN)BLOCK_INPUT in the main thread.
+ If not HAVE_GTK_AND_PTHREAD, (UN)BLOCK_INPUT_ALLOC is the same
+ as (UN)BLOCK_INPUT.
+ (emacs_blocked_free, emacs_blocked_malloc)
+ (emacs_blocked_realloc): Use (UN)BLOCK_INPUT_ALLOC.
+ (uninterrupt_malloc): Initialize main_thread and alloc_mutex.
+ (reset_malloc_hooks): New function.
+
+ * lisp.h: Declare reset_malloc_hooks.
+
+ * emacs.c (Fdump_emacs): Call reset_malloc_hooks.
+
+ * keyboard.c: Conditionally include pthread.h.
+ (handle_async_input, input_available_signalt): If not in the main
+ thread, block signal, send signal to main thread and return.
+
+ * gtkutil.c (xg_get_file_with_chooser): Handle local files only.
+ Set current folder in file chooser if default_filename is a directory.
+
+2004-12-05 Stefan Monnier <[email protected]>
+
+ * regex.c (GET_UNSIGNED_NUMBER): Signal an error when reaching the end.
+ Remove redundant correctness checks.
+ (regex_compile): Fix up error codes for \{..\} expressions.
+
+2004-12-05 Richard M. Stallman <[email protected]>
+
+ * regex.c (regex_compile): Fix end-of-pattern case for space.
+
+2004-12-03 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.h (cfstring_create_with_utf8_cstring): Add prototype.
+ * mac.c (cfstring_create_with_utf8_cstring): Add to prevent
+ crashes with invalid characters.
+ * macmenu.c (add_menu_item): Use it.
+ * image.c (image_load_quartz2d): Likewise.
+ * macfns.c (x_set_name, x_set_title): Likewise.
+ (Fx_file_dialog): Likewise. Use constant CFRefs instead of
+ creating them each time for labels.
+
+2004-12-02 Richard M. Stallman <[email protected]>
+
+ * config.in (RE_TRANSLATE_P): If make_number is not a macro,
+ don't use it here.
+
+ * eval.c (Fcalled_interactively_p): Don't check INTERACTIVE.
+ (interactive_p): Skip Scalled_interactively_p frames
+ like Sinteractive_p frames.
+ (unwind_to_catch): Clear handling_signal.
+
+ * data.c (Fmake_variable_buffer_local): Doc fix.
+ (Fmake_local_variable): Doc fix.
+
+ * insdel.c (insert_from_string_before_markers)
+ (insert_from_string): Don't modify buffer on empty insertion.
+
+ * window.c (Fget_lru_window, Fget_largest_window): Doc fixes.
+
+2004-12-01 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macmenu.c (add_menu_item): Fallback on MacRoman if encoding
+ menu text as UTF8 fails.
+
+2004-12-01 Kim F. Storm <[email protected]>
+
+ * alloc.c: Add commentary for last change.
+ (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): New macros to handle
+ sizeof(size_t) != 4.
+ (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
+ Use them. Also clear header and trailer of freed memory.
+ (GC_STRING_OVERRUN_COOKIE_SIZE): Rename from GC_STRING_EXTRA.
+ (string_overrun_cookie): Rename from string_overrun_pattern.
+ (GC_STRING_EXTRA): Define from GC_STRING_OVERRUN_COOKIE_SIZE.
+
+2004-12-01 Andreas Schwab <[email protected]>
+
+ * lisp.h: Declare string_to_multibyte.
+
+2004-12-01 Kenichi Handa <[email protected]>
+
+ * w32console.c (w32con_write_glyphs): Decide coding here.
+ Adjusted for the change of encode_terminal_code.
+
+ * term.c (encode_terminal_code): Don't make it "static".
+
+2004-11-30 Kenichi Handa <[email protected]>
+
+ * term.c (encode_terminal_buf, encode_terminal_bufsize): New variables.
+ (encode_terminal_code): Argument changed. Encode all
+ characters at once, and return a pointer to the result of encoding.
+ (write_glyphs): Decide coding here. Adjusted for the above change.
+ (insert_glyphs): Likewise.
+ (term_init): Initialize encode_terminal_bufsize to 0.
+
+ * coding.c (Vcode_conversion_workbuf_name): New variable.
+ (syms_of_coding): Initialize and staticpro it.
+ (set_conversion_work_buffer): New function.
+ (run_pre_post_conversion_on_str): Use it.
+ (run_pre_write_conversin_on_c_str): New function.
+
+ * coding.h (run_pre_write_conversin_on_c_str): Extern it.
+
+2004-11-30 YAMAMOTO Mitsuharu <[email protected]>
+
+ * keyboard.c: Don't undef SIGIO
+ * s/darwin.h (NO_SOCK_SIGIO): Define NO_SOCK_SIGIO on carbon
+ * Makefile.in (mac.o): Depend on blockinput.h and atimer.h.
+ (macfns.o): Don't depend on ccl.h.
+ * macfns.c (mac_frame_parm_handlers): Set handlers for
+ Qleft_fringe and Qright_fringe.
+ * macterm.c (mac_fill_rectangle_to_pixmap)
+ (mac_draw_rectangle_to_pixmap, mac_copy_area_to_pixmap)
+ (mac_copy_area_with_mask_to_pixmap, x_draw_image_foreground_1):
+ Put in #if 0.
+ (mac_scroll_area) [TARGET_API_MAC_CARBON]: Use ScrollWindowRect.
+ (x_flush) [TARGET_API_MAC_CARBON]: Don't traverse frames.
+ (XFlush) [TARGET_API_MAC_CARBON]: Define to an empty replacement.
+ (x_draw_glyph_string_background, x_draw_glyph_string_foreground)
+ [!MAC_OS8]: Added ifdef'd out code for os8. Don't use
+ XDrawImageString. Always draw background and foreground separately.
+ (x_draw_image_foreground): Use clipping instead of computing the
+ intersection rectangle.
+ (x_draw_image_glyph_string): Don't draw an image with mask to a
+ pixmap.
+ (x_redisplay_interface): Set flush_display_optional member to 0.
+ (XTread_socket): Correctly reset the TEConverter
+ object.
+
+2004-11-30 Kim F. Storm <[email protected]>
+
+ * lisp.h: New defines to enable buffer overrun checking.
+ (GC_CHECK_STRING_OVERRUN, GC_CHECK_STRING_FREE_LIST)
+ (XMALLOC_OVERRUN_CHECK, GC_CHECK_CONS_LIST): Add.
+
+ * alloc.c: Add more checks for buffer overruns.
+ (XMALLOC_OVERRUN_CHECK_SIZE, xmalloc_overrun_check_header)
+ xmalloc_overrun_check_trailer, overrun_check_malloc)
+ overrun_check_realloc, overrun_check_free): Add.
+ (GC_STRING_EXTRA, string_overrun_pattern): Add.
+ (check_sblock, allocate_string_data, compact_small_strings):
+ Set and check string_overrun_pattern if GC_CHECK_STRING_OVERRUN.
+ (check_cons_list): Condition on GC_CHECK_CONS_LIST.
+ (check_string_free_list): Add.
+ (allocate_string, sweep_strings): Call check_string_free_list.
+
+ * emacs.c (malloc_initialize_hook): Don't free malloc_state_ptr if
+ XMALLOC_OVERRUN_CHECK to avoid crash during load.
+
+2004-11-29 Kim F. Storm <[email protected]>
+
+ * fns.c (concat): Use SAFE_ALLOCA.
+
+2004-11-29 Stefan Monnier <[email protected]>
+
+ * sysdep.c (emacs_write): Don't use QUIT.
+
+2004-11-29 Kenichi Handa <[email protected]>
+
+ * buffer.c (init_buffer): Set current_buffer->directory to a
+ multibyte string made by string_to_multibyte.
+
+ * emacs.c (init_cmdargs): Set unibyte strings in Vcommand_line_args.
+
+2004-11-27 Andreas Schwab <[email protected]>
+
+ * alloc.c (mark_stack): Call GC_MARK_SECONDARY_STACK if defined.
+
+ * s/gnu-linux.h: Enable no-op gcpros on ia64.
+ (GC_MARK_SECONDARY_STACK) [__ia64__]: Define.
+
+ * filelock.c (lock_file_1): Call get_boot_time early.
+ Increase buffer size.
+
+2004-11-27 Eli Zaretskii <[email protected]>
+
+ * lisp.h (DECL_ALIGN): Define non-trivially only if NO_DECL_ALIGN
+ is not defined.
+
+2004-11-27 Kim F. Storm <[email protected]>
+
+ * search.c (syms_of_search) <search-spaces-regexp>: Move 'doc:'
+ marker out of doc string.
+
+2004-11-26 Stefan Monnier <[email protected]>
+
+ * s/darwin.h (POSIX_SIGNALS): Undo the removal of 2002-08-25,
+ which was not mentioned in the log.
+
+2004-11-26 Kim F. Storm <[email protected]>
+
+ * fringe.c (update_window_fringes): Prefer truncation bitmaps over
+ angle bitmaps at top/bottom line.
+
+ * xdisp.c: Undo recent changes for restoring saved_face_id. Instead,
+ set it when it->method is set to next_element_from_display_vector.
+ (setup_for_ellipsis): Add LEN argument. Callers changed.
+ Set it->saved_face_id.
+ (get_next_display_element): Use loop instead of recursion.
+ Set it->saved_face_id. Combine duplicate code for ctr chars.
+ (next_element_from_display_vector): Do not set it->saved_face_id.
+ (next_element_from_ellipsis): Use setup_for_ellipsis.
+
+2004-11-26 Eli Zaretskii <[email protected]>
+
+ * eval.c (Fdefvar): Declare pdl from last change as `volatile' to
+ prevent compiler warnings.
+
+2004-11-25 Stefan Monnier <[email protected]>
+
+ * keyboard.c (command_loop_1): Print a message describing the key
+ the user just pressed when this key has no binding.
+
+ * sysdep.c (sys_signal): Don't use SA_RESTART if SYNC_INPUT is set.
+ (emacs_open, emacs_read, emacs_write): Check QUIT when interrupted.
+
+ * lread.c (readchar): Check QUIT when `getc' is interrupted.
+
+2004-11-24 Richard M. Stallman <[email protected]>
+
+ * coding.c (run_pre_post_conversion_on_str): Bind Qinhibit_read_only.
+
+ * buffer.c (syms_of_buffer) <indicate-buffer-boundaries>: Doc fix.
+
+2004-11-24 Kim F. Storm <[email protected]>
+
+ * xdisp.c (move_it_in_display_line_to, display_line):
+ Restore saved_face_id also when truncate-lines or hscrolled.
+
+2004-11-23 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c (xg_get_file_name): Rename use-old-gtk-file-dialog to
+ x-use-old-gtk-file-dialog.
+
+ * xfns.c: Define x_use_old_gtk_file_dialog.
+ (syms_of_xfns): Rename use-old-gtk-file-dialog to x-... Move it
+ outside ifdef USE_GTK.
+
+2004-11-23 Stefan Monnier <[email protected]>
+
+ * coding.h (ENCODE_FILE, DECODE_FILE, ENCODE_SYSTEM, DECODE_SYSTEM):
+ Don't use XFASTINT blindly.
+
+ * config.in (RE_TRANSLATE_P): Don't use XFASTINT blindly.
+
+ * indent.c (skip_invisible): Avoid non-idempotent side-effects
+ in macro arguments.
+
+ * keymap.c (Flookup_key): Check INTEGERP before XINT.
+
+ * lread.c (oblookup): Don't use XFASTINT blindly.
+
+ * window.c (Fset_window_scroll_bars): Don't use XINT if it isn't int.
+ (decode_next_window_args, window_loop): Don't use XFASTINT blindly.
+
+2004-11-23 Kim F. Storm <[email protected]>
+
+ * dispextern.h (MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P)
+ (MATRIX_ROW_STARTS_IN_MIDDLE_OF_CHAR_P): Not if dpvec_index is zero.
+
+ * xfaces.c (lookup_named_face): Add signal_p arg. Return -1 if
+ signal_p is zero and face name is unknown.
+ (Fx_list_fonts): Don't signal error in lookup_named_face.
+ (Fface_font): Signal error in lookup_named_face.
+ (ascii_face_of_lisp_face): Likewise.
+
+ * dispextern.h (lookup_named_face): Fix prototype.
+
+ * xdisp.c (handle_single_display_prop): Don't signal error in
+ lookup_named_face for unknown fringe face name.
+ (highlight_trailing_whitespace): Don't signal error in
+ lookup_named_face if trailing-whitespace face unknown.
+ (calc_line_height_property): Don't signal error in
+ lookup_named_face if specified face name is unknown.
+
+ * fringe.c (update_window_fringes): Show top row indicator if
+ window has header-line. Don't show arrow at bob and eob
+ if the boundary indicators are not used.
+ (Fset_fringe_bitmap_face): Signal error in lookup_named_face.
+
+ * window.c (set_window_buffer): Clear display_error_modiff.
+
+2004-11-22 Kim F. Storm <[email protected]>
+
+ * fringe.c (update_window_fringes): Provide sensible fall-back
+ value for non-nil indicate-buffer-boundaries setting.
+
+2004-11-22 Markus Rost <[email protected]>
+
+ * minibuf.c (Fminibuffer_complete_and_exit): Fix previous change.
+
+2004-11-22 Stefan Monnier <[email protected]>
+
+ * eval.c (Fdefvar): Warn when var is let-bound but globally void.
+
+2004-11-21 Kim F. Storm <[email protected]>
+
+ * xdisp.c (erase_phys_cursor): Clear hollow cursor inside TEXT_AREA.
+
+ * xterm.c (x_clip_to_row): Add area arg. Callers changed.
+ (x_draw_hollow_cursor, x_draw_bar_cursor): Clip to TEXT_AREA.
+
+ * w32term.c (w32_clip_to_row): Add area arg. Callers changed.
+ (x_draw_hollow_cursor, x_draw_bar_cursor): Clip to TEXT_AREA.
+
+ * macterm.c (x_clip_to_row): Add area arg. Callers changed.
+ (x_draw_hollow_cursor, x_draw_bar_cursor): Clip to TEXT_AREA.
+
+ * xdisp.c (move_it_in_display_line_to, display_line):
+ Restore saved_face_id if overflow-newline-into-fringe is enabled and
+ line is continued before or in middle of element from display vector.
+
+ * indent.c (Fvertical_motion): Fix last change. Use another
+ method to detect if iterator moved too far ahead after reseat.
+
+ * xdisp.c (IT_EXPAND_MATRIX_WIDTH): New macro. Do not
+ expand matrix width for overflow in zero-width area.
+ (append_glyph, append_composite_glyph, produce_image_glyph)
+ (append_stretch_glyph): Use it to avoid loop in redisplay.
+ (note_mode_line_or_margin_highlight): Don't let help-echo from
+ string override help-echo from image map.
+
+2004-11-20 Luc Teirlinck <[email protected]>
+
+ * fns.c (Fyes_or_no_p): Call Fread_from_minibuffer with extra argument.
+ * callint.c (Fcall_interactively): Ditto.
+
+2004-11-20 Stefan Monnier <[email protected]>
+
+ * minibuf.c (Fminibuffer_complete_and_exit):
+ Fixup the case of the completed value, for case-indep completion.
+
+2004-11-20 Richard M. Stallman <[email protected]>
+
+ * lisp.h (Fread_from_minibuffer): Add arg in decl.
+
+ * minibuf.c (read_minibuf): New arg KEEP_ALL. Callers changed.
+ (Fread_from_minibuffer): New arg KEEP_ALL. Callers changed.
+
+ * search.c (Vsearch_spaces_regexp):
+ Rename from Vsearch_whitespace_regexp. All uses changed.
+
+2004-11-20 Thien-Thi Nguyen <[email protected]>
+
+ * eval.c (init_eval_once): Increase `max_specpdl_size' to 650.
+
+2004-11-19 Richard M. Stallman <[email protected]>
+
+ * search.c (Vsearch_whitespace_regexp): New variable.
+ (syms_of_search): Defvar it.
+ (compile_pattern_1): Call re_set_whitespace_regexp with it.
+ (search_buffer): No regexp is trivial if Vsearch_whitespace_regexp
+ is non-nil.
+ (struct regexp_cache): New element whitespace_regexp.
+ (syms_of_search): Initialize whitespace_regexp elements.
+ (compile_pattern): Compare whitespace_regexp elements.
+ (compile_pattern_1): Set whitespace_regexp elements.
+
+ * regex.c (regex_compile): Substitute whitespace_regexp
+ for spaces, if it is nonzero.
+ (whitespace_regexp): New variable.
+ (re_set_whitespace_regexp): New function.
+
+2004-11-19 Kim F. Storm <[email protected]>
+
+ * indent.c (Fvertical_motion): Fix last change.
+
+2004-11-18 Kim F. Storm <[email protected]>
+
+ * indent.c (Fvertical_motion): Undo 2004-11-16 change.
+ Instead, move back again if reseating moves too far ahead.
+
+2004-11-17 Luc Teirlinck <[email protected]>
+
+ * xdisp.c (message3): Call clear_message.
+
+2004-11-17 Kim F. Storm <[email protected]>
+
+ * xdisp.c (erase_phys_cursor): Adjust cursor row visible height.
+
+2004-11-16 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c (xg_get_file_name): Typo in HAVE_GTK_FILE_SELECTION_NEW.
+
+ * xmenu.c (x_menu_in_use): Remove.
+ (x_menu_set_in_use): Also set popup_activated_flag.
+
+ * xfns.c (Fx_file_dialog): Call popup_activated instead of
+ x_menu_in_use. Call x_menu_set_in_use in Motif version also.
+
+ * xterm.h (x_menu_in_use): Remove.
+
+2004-11-16 Richard M. Stallman <[email protected]>
+
+ * keymap.c (Fmap_keymap): New arg SORT-FIRST.
+ Use map-keymap-internal to implement that.
+
+ * indent.c (Fvertical_motion): In batch mode, use vmotion directly.
+
+2004-11-16 Stefan Monnier <[email protected]>
+
+ * xdisp.c (get_glyph_string_clip_rect, init_glyph_string): Check it's
+ a window before using XWINDOW.
+
+ * window.c (make_window, Fselect_window, make_dummy_parent)
+ (save_window_save):
+ * frame.c (make_frame):
+ * fns.c (concat): Avoid side-effects inside XSETFASTINT's arguments.
+
+ * lisp.h (NILP): Use EQ rather than XFASTINT.
+
+2004-11-16 Kim F. Storm <[email protected]>
+
+ * fringe.c (Fdefine_fringe_bitmap): Always set 'h'. Simplify.
+
+ * indent.c (Fvertical_motion): Fix last change. Only reseat when
+ moving backwards.
+
+2004-11-16 Luc Teirlinck <[email protected]>
+
+ * dispextern.h: Extern reseat_at_previous_visible_line_start.
+
+2004-11-16 Kenichi Handa <[email protected]>
+
+ * xdisp.c (display_mode_element): Fix previous change (calculate
+ end position of substring to display correctly).
+
+2004-11-16 Kim F. Storm <[email protected]>
+
+ * keyboard.c (Fposn_at_point): Remove extra */ after doc string.
+ Reported by Andrew M. Scott.
+
+2004-11-15 Kim F. Storm <[email protected]>
+
+ * fns.c (Fsafe_plist_get): New defun.
+ (syms_of_fns): Defsubr it.
+
+ * lisp.h (Fsafe_plist_get): Add EXFUN.
+
+ * xdisp.c (store_mode_line_string, produce_stretch_glyph):
+ Use Fsafe_plist_get.
+ (note_mode_line_or_margin_highlight, note_mouse_highlight):
+ Fix image map element parsing. Use Fsafe_plist_get.
+
+2004-11-15 Richard M. Stallman <[email protected]>
+
+ * xdisp.c (get_next_display_element): Fix previous change.
+
+2004-11-14 Jan Dj,Ad(Brv <[email protected]>
+
+ * window.c (shrink_windows): Handle special case of one window left
+ when trying to shrink the final reminder. Grow windows if
+ total_removed is less than total_shrink.
+
+ * xmenu.c (pop_down_menu): Remove global variable current_menu,
+ extract pointer from arg with XSAVE_VALUE.
+ (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
+ Construct arg to record_unwind_protect with make_save_value.
+
+2004-11-13 Richard M. Stallman <[email protected]>
+
+ * xdisp.c (reseat_at_previous_visible_line_start): No longer static.
+ (get_next_display_element): Fix previous change to apply only to \n.
+
+ * indent.c (Fvertical_motion): Scan to PT from start of line to
+ make iterator consistent.
+
+ * minibuf.c (syms_of_minibuf) <completion-ignore-case>: Doc fix.
+
+2004-11-14 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c (pop_down_file_dialog): Add BLOCK_INPUT.
+
+ * xfns.c (Fx_file_dialog): Call x_menu_in_use and x_menu_set_in_use.
+ Record unwind with clean_up_file_dialog.
+
+ * xterm.h (x_menu_in_use, x_menu_set_in_use, x_menu_wait_for_event):
+ Declare.
+
+ * xmenu.c (x_menu_in_use, x_menu_set_in_use): New functions.
+
+2004-11-13 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c (xg_file_sel_ok, xg_file_sel_cancel)
+ (xg_file_sel_destroy): Remove.
+ (xg_file_response_cb, pop_down_file_dialog)
+ (xg_get_file_name_from_chooser, xg_get_file_name_from_selector):
+ New functions.
+ (xg_get_file_with_chooser, xg_get_file_with_selection):
+ Take new arg func, set it to xg_get_file_name_from_chooser/selector.
+ Move common code to xg_get_file_name. Return widget created.
+ (xg_get_file_name): Set name, transient for, modal and destroy
+ with parent here. Connect response signal to xg_file_response_cb,
+ connect delete-event to gtk_true. Record pop_down_file_dialog
+ for unwind. Do event loop and call x_menu_wait_for_event in loop.
+ (xg_create_widget): Make dialogs modal.
+
+ * xmenu.c (unuse_menu_items, pop_down_menu): Arg is of type
+ Lisp_Object.
+ (popup_get_selection): Move unwind protect ...
+ (create_and_show_popup_menu, create_and_show_dialog): ... to here.
+ Move destroy of widget to pop_down_menu.
+ (popup_widget_loop): Move unwind protect ...
+ (create_and_show_popup_menu, create_and_show_dialog): ... to here.
+ Move destroy of widget to pop_down_menu.
+ (pop_down_menu): BLOCK_INPUT and destroy widget/window.
+ (xmenu_show): Record unwind pop_down_menu. Move XMenuDestroy,
+ x_mouse_leave and grabbed = 0 to pop_down_menu.
+
+2004-11-13 Kim F. Storm <[email protected]>
+
+ * xdisp.c (make_cursor_line_fully_visible_p): New variable.
+ (syms_of_xdisp): DEFVAR_BOOL it.
+ (make_cursor_line_fully_visible, try_cursor_movement)
+ (try_window_id): Use it.
+
+2004-11-12 Kim F. Storm <[email protected]>
+
+ * dispextern.h (struct glyph_row): New member extra_line_spacing.
+ (struct it): New member max_extra_line_spacing.
+ (MR_PARTIALLY_VISIBLE, MR_PARTIALLY_VISIBLE_AT_TOP)
+ (MR_PARTIALLY_VISIBLE_AT_BOTTOM): New helper macros.
+ (MATRIX_ROW_PARTIALLY_VISIBLE_P): Fix to return false if invisible
+ part of last line is only extra line spacing (so the text on the
+ line is fully visible). Use helper macros.
+ Add W arg (to use them). All callers changed.
+ (MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P)
+ (MATRIX_ROW_PARTIALLY_VISIBLE_AT_BOTTOM_P): Use helper macros.
+
+ * window.c (window_scroll_pixel_based, Frecenter):
+ Use move_it_vertically_backward directly.
+ (Frecenter): Fix calculation of new start pos for negative arg.
+ Before, the new start pos was sometimes chosen too far back, so
+ the last line became only partially visible, and thus would be
+ either only semi-visible or automatically scrolled to the middle
+ of the window by redisplay.
+
+ * xdisp.c (init_iterator): Clear it.max_extra_line_spacing.
+ (move_it_vertically_backward): Don't recure to move further back.
+ (move_it_vertically): Remove superfluous condition.
+ (move_it_by_lines): Clear last_height when moved 0 lines.
+ (resize_mini_window): Use it.max_extra_line_spacing.
+ (display_tool_bar_line): Clear row->extra_line_spacing.
+ (try_scrolling): Use move_it_vertically_backward directly.
+ (redisplay_window): Likewise.
+ (compute_line_metrics): Set row->extra_line_spacing.
+ (display_line, display_string): Likewise.
+ (x_produce_glyphs): Update it->max_extra_line_spacing.
+
+ * xmenu.c (pop_down_menu): Return nil.
+
+2004-11-12 Jan Dj,Ad(Brv <[email protected]>
+
+ * xmenu.c (x_menu_wait_for_event): New function.
+ (popup_get_selection, popup_widget_loop): Call x_menu_wait_for_event
+ to handle timers.
+ (popup_widget_loop): Add argument do_timers.
+ (create_and_show_popup_menu, create_and_show_dialog): Pass 1 for
+ do_timers to popup_widget_loop.
+ (xmenu_show): Call XMenuActivateSetWaitFunction so that
+ x_menu_wait_for_event is called by XMenuActivate.
+ (create_and_show_popup_menu): Pass 1 for do_timers to
+ popup_get_selection.
+ (pop_down_menu): New function.
+ (popup_get_selection, popup_widget_loop): Unwind protect to
+ pop_down_menu.
+ (popup_widget_loop): Add argument widget.
+ (create_and_show_popup_menu, create_and_show_dialog): Pass new
+ argument widget to popup_widget_loop.
+
+2004-11-10 Stefan Monnier <[email protected]>
+
+ * keymap.c (Fkeymap_prompt): Accept symbol keymaps.
+
+2004-11-09 Kim F. Storm <[email protected]>
+
+ * xselect.c: Include <sys/types.h> and <unistd.h> (for getpid).
+ Fix various comments referring to XEvents instead of input events.
+ (x_queue_event): Fix format strings.
+ (x_stop_queuing_selection_requests): Likewise.
+
+ * xdisp.c (produce_image_glyph): Remove unused variable 'face_ascent'.
+ (pint2hrstr): Add extra braces to silence compiler.
+
+ * print.c (print_object): Fix format string.
+
+ * lread.c (read1): Fix next_char matching.
+
+ * lisp.h (Fdelete): Add EXFUN.
+ (replace_range_2): Add prototype.
+
+ * keyboard.c (read_avail_input): Remove unused variable 'discard'.
+
+ * intervals.h (NULL_INTERVAL_P): Add separate version when
+ ENABLE_CHECKING is not defined to silence compiler.
+ (compare_string_intervals): Add prototype.
+
+ * fringe.c (destroy_fringe_bitmap): Fix return type.
+ (Ffringe_bitmaps_at_pos): Remove unused var 'old_buffer'.
+
+ * emacs.c (Fdump_emacs): Fix format string.
+
+ * doc.c: Include <ctype.h>.
+ (Fsubstitute_command_keys): Remove unused variable 'firstkey'.
+
+ * data.c (store_symval_forwarding): Remove unused variables.
+
+ * callint.c (Fcall_interactively): Remove unused variable 'funcar'.
+
+2004-11-09 Jan Dj,Ad(Brv <[email protected]>
+
+ * Makefile.in (stamp-oldxmenu): If HAVE_GTK, don't add dependencies
+ to ${OLDXMENU}.
+
+2004-11-09 Kim F. Storm <[email protected]>
+
+ * process.c (Fmake_network_process): Remove kludge for interrupted
+ connects on BSD. If connect is interrupted, just close socket and
+ start over rather than sleeping and retry with same socket.
+
+2004-11-09 Jan Dj,Ad(Brv <[email protected]>
+
+ * .cvsignore: Add buildobj.lst.
+
+ * doc.c: New variable Vbuild_files.
+ (Fsnarf_documentation): If Vbuild_files is nil, populate it with
+ file names from buildobj.lst. Only attach docstrings from files
+ that are in Vbuild_files.
+ (syms_of_doc): Defvar Vbuild_files.
+
+ * Makefile.in (SOME_MACHINE_OBJECTS): Add fringe.o, image.o
+ and w32*.o.
+ (temacs${EXEEXT}): Generate buildobj.lst when temacs is linked.
+ (mostlyclean): Rm buildobj.lst.
+
+ * makefile.w32-in ($(TEMACS)): Generate buildobj.lst when temacs
+ is linked.
+
+2004-11-09 Kim F. Storm <[email protected]>
+
+ * fringe.c (update_window_fringes): Update fringe bitmaps if
+ cur and row ends_at_zv_p differs. If bitmaps of a row is updated,
+ also update previous row to get rid of misc. artifacts.
+
+2004-11-08 Kim F. Storm <[email protected]>
+
+ * xdisp.c (fast_find_position): Fix start pos if header line present.
+ (note_mouse_highlight): Clear mouse face if we move out of text area.
+
+2004-11-08 Eli Zaretskii <[email protected]>
+
+ * editfns.c: Move #include "systime.h" before <sys/resource.h>.
+ Don't include <sys/time.h> explicitly.
+ Include <stdio.h> unconditionally, not just on MacOS.
+
+2004-11-08 Kenichi Handa <[email protected]>
+
+ * fontset.c (fontset_pattern_regexp): Cancel my previous change;
+ don't pay attention to '\' before '*'.
+ (fontset_pattern_regexp): Change the meaning of the second arg.
+ (Fnew_fontset): Call fs_query_fontset, not Fquery_fontset.
+ (check_fontset_name): Try NAME as literal at first, and if it
+ failes, try NAME as pattern.
+
+2004-11-07 Jan Dj,Ad(Brv <[email protected]>
+
+ * emacs.c (Fdump_emacs): Only output warning on GNU/Linux.
+
+2004-11-07 Andreas Schwab <[email protected]>
+
+ * lisp.h (Fmsdos_downcase_filename): Declare.
+ * dired.c (Fmsdos_downcase_filename): Don't declare here.
+ * fileio.c: Likewise.
+
+2004-11-07 Jan Dj,Ad(Brv <[email protected]>
+
+ * dosfns.c (Fdos_memget, Fdos_memput): Use integer variable offs in
+ comparisons with integers instead of Lisp_Object address.
+ (Fmsdos_set_keyboard): Declare argument allkeys.
+
+ * msdos.c (IT_set_frame_parameters): Use EQ, not ==, for Lisp_Object:s.
+
+ * dired.c (Fmsdos_downcase_filename): Declare extern on MSDOS to avoid
+ int/Lisp_Object mixup.
+
+ * fileio.c: Ditto.
+
+2004-11-06 Steven Tamm <[email protected]>
+
+ * editfns.c: Need to include sys/time.h before resource.h on darwin.
+
+2004-11-06 Richard M. Stallman <[email protected]>
+
+ * callint.c (Fcall_interactively): Avoid reusing EVENT for other data.
+
+ * xfaces.c (merge_named_face): GCPRO the face_name in the
+ named_merge_point struct that we make.
+ (merge_face_heights): Eliminate GCPRO arg. All callers changed.
+
+ * keyboard.c (command_loop_1): Change Vtransient_mark_mode
+ before deciding whether to inactivate mark.
+
+2004-11-06 Lars Brinkhoff <[email protected]>
+
+ * config.in: Regenerate (add HAVE_GETRUSAGE).
+ * editfns.c (Fget_internal_run_time): New function.
+ (syms_of_data): Defsubr it.
+ * fns.c (sxhash): As far as possible, merge calculation of
+ hash code for symbols and strings.
+
+2004-11-06 Eli Zaretskii <[email protected]>
+
+ * frame.c (syms_of_frame): Fix the example in the doc string.
+
+2004-11-06 Jan Dj,Ad(Brv <[email protected]>
+
+ * eval.c (Feval): Remove check for INPUT_BLOCKED_P.
+
+ * xmenu.c (popup_get_selection, create_and_show_popup_menu)
+ (create_and_show_dialog): Revert change from 2004-10-31.
+
+2004-11-05 Luc Teirlinck <[email protected]>
+
+ * macros.c (syms_of_macros) <defining-kbd-macro>: Doc fix.
+
+2004-11-05 Kim F. Storm <[email protected]>
+
+ * print.c (print_object): Print Lisp_Misc_Save_Value objects.
+
+ * fileio.c (Ffile_modes): Doc fix.
+ (auto_save_1): Check for Ffile_modes nil value.
+
+2004-11-05 Kim F. Storm <[email protected]>
+
+ * xselect.c (struct selection_event_queue, selection_queue)
+ (x_queue_selection_requests, x_queue_event)
+ (x_start_queuing_selection_requests)
+ (x_stop_queuing_selection_requests): Add new queue for selection
+ input events to replace previous XEvent queue in xterm.c.
+ (queue_selection_requests_unwind): Adapt to new queue.
+ (x_reply_selection_request): Adapt to new queue.
+ Unexpect wait_object in case of x errors (memory leak).
+ (x_handle_selection_request, x_handle_selection_clear): Make static.
+ (x_handle_selection_event): New function. May queue selection events.
+ (wait_for_property_change_unwind): Use save_value instead of cons.
+ Clear property_change_reply_object.
+ (wait_for_property_change): Abort if already waiting.
+ Use save_value instead of cons for unwind data.
+ (x_handle_property_notify): Skip events already arrived, but don't
+ free them, as "arrived" field is checked by wait_for_property_change,
+ and it will be freed by unwind or explicit unexpect_property_change.
+ (x_get_foreign_selection): Add to new queue.
+ (receive_incremental_selection): Don't unexpect wait_object when done
+ as it has already been freed by previous wait_for_property_change.
+
+ * xterm.h (x_start_queuing_selection_requests)
+ (x_stop_queuing_selection_requests, x_handle_selection_request)
+ (x_handle_selection_clear): Remove prototypes.
+ (x_handle_selection_event): Add prototype.
+
+ * xterm.c (handle_one_xevent): Don't queue X selection events
+ here, it may be too late if we start queuing after we have already
+ stored some selection events into the kbd buffer.
+ (struct selection_event_queue, queue, x_queue_selection_requests)
+ (x_queue_event, x_unqueue_events, x_start_queuing_selection_requests)
+ (x_stop_queuing_selection_requests): Remove/move to xselect.c.
+ (x_catch_errors_unwind): Block input around final XSync.
+
+ * keyboard.h (kbd_buffer_unget_event): Add prototype.
+
+ * keyboard.c (kbd_buffer_store_event_hold): Remove obsolete code.
+ (kbd_buffer_unget_event): New function.
+ (kbd_buffer_get_event, swallow_events): Combine SELECTION events
+ and use x_handle_selection_event.
+ (mark_kboards): Don't mark x and y of SELECTION_CLEAR_EVENT.
+
+2004-11-05 Jan Dj,Ad(Brv <[email protected]>
+
+ * xselect.c (TRACE3): New debug macro.
+ (x_reply_selection_request): Use it.
+ (receive_incremental_selection): In call to TRACE0, the name of
+ a symbol is in xname.
+
+2004-11-05 Kim F. Storm <[email protected]>
+
+ * fontset.c (fontset_pattern_regexp): Use unsigned char.
+
+2004-11-04 Jan Dj,Ad(Brv <[email protected]>
+
+ * fileio.c (Fnext_read_file_uses_dialog_p): New function.
+
+ * gtkutil.h (use_old_gtk_file_dialog): Declare.
+
+ * gtkutil.c: Make use_old_gtk_file_dialog non-static.
+ (xg_initialize): Move DEFVAR_BOOL for use_old_gtk_file_dialog ...
+ * xfns.c (syms_of_xfns): ... to here.
+
+ * gtkutil.c (xg_get_file_with_chooser): Expand DEFAULT_FILENAME if
+ it doesn't start with /.
+
+2004-11-04 Kenichi Handa <[email protected]>
+
+ * fontset.c (fontset_pattern_regexp): If '*' is preceded by '\',
+ treat it as a literal character.
+
+2004-11-03 Kim F. Storm <[email protected]>
+
+ * .gdbinit (ppt): New function.
+
+2004-11-02 Jan Dj,Ad(Brv <[email protected]>
+
+ * xterm.c (x_window_to_scroll_bar): Only call
+ xg_get_scroll_id_for_window if toolkit scroll bars are used.
+
+ * gtkutil.c (xg_get_file_with_chooser): Use GTK_STOCK_OK instead
+ of save.
+
+2004-11-02 Andreas Schwab <[email protected]>
+
+ * window.c (Fscroll_right): Fix last change.
+
+2004-11-02 Kim F. Storm <[email protected]>
+
+ * Makefile.in (callproc.o): Depend on blockinput.h, atimer.h, systime.h.
+
+2004-11-02 YAMAMOTO Mitsuharu <[email protected]>
+
+ * callproc.c (Fcall_process): Block input around vfork.
+
+2004-11-02 Kim F. Storm <[email protected]>
+
+ * eval.c (Fcalled_interactively_p): Rename from Fcall_interactive_p.
+ (syms_of_eval): Defsubr it.
+
+2004-11-02 Richard M. Stallman <[email protected]>
+
+ * insdel.c (replace_range_2): New function.
+
+ * casefiddle.c (casify_region): Handle changes in byte-length
+ using replace_range_2.
+
+ * emacs.c (USAGE3): Delete --horizontal-scroll-bars, -hb.
+
+ * xdisp.c (back_to_previous_visible_line_start):
+ Subtract 1 from pos when checking previous newline for invisibility.
+
+ * window.c (window_scroll_pixel_based): Update preserve_y
+ for header line if any.
+ (Fscroll_left, Fscroll_right): Don't call interactive_p;
+ use a new second argument instead.
+
+ * eval.c (Fcall_interactive_p): New function.
+ (interactive_p): Don't test INTERACTIVE here.
+ (Finteractive_p): Doc fix.
+
+ * eval.c (Feval): Abort if INPUT_BLOCKED_P.
+
+2004-11-02 KOBAYASHI Yasuhiro <[email protected]>
+
+ * w32fns.c (w32_font_match): Use fast_string_match_ignore_case for
+ comparing font names.
+
+2004-11-02 Jan Dj,Ad(Brv <[email protected]>
+
+ * fileio.c (Fread_file_name): Pass Qt as fifth parameter to
+ Fx_file_dialog if only directories should be read.
+
+ * lisp.h: Fx_file_dialog takes 5 parameters.
+
+ * xfns.c (Fx_file_dialog): Both Motif and GTK version:
+ Add parameter only_dir_p.
+ In Motif version, don't put DEFAULT_FILENAME in filter part of the
+ dialog, just text field part. Do not add DEFAULT_FILENAME
+ to list of files if it isn't there.
+ In GTK version, pass only_dir_p parameter to xg_get_file_name.
+
+ * macfns.c (Fx_file_dialog): Add parameter only_dir_p.
+ Check only_dir_p instead of comparing prompt to "Dired". When using
+ a save dialog, add option kNavDontConfirmReplacement, change title
+ to "Enter name", change text for save button to "Ok".
+
+ * w32fns.c (Fx_file_dialog): Add parameter only_dir_p.
+ Check only_dir_p instead of comparing prompt to "Dired".
+
+ * gtkutil.c (xg_get_file_with_chooser, xg_get_file_with_selection):
+ New functions, only defined ifdef HAVE_GTK_FILE_CHOOSER_DIALOG_NEW
+ and HAVE_GTK_FILE_SELECTION_NEW respectively.
+ (xg_get_file_name): Add parameter only_dir_p.
+ Call xg_get_file_with_chooser or xg_get_file_with_selection
+ depending on HAVE_GTK_FILE* and the value of use_old_gtk_file_dialog.
+ (xg_initialize): New DEFVAR_BOOL use_old_gtk_file_dialog.
+
+ * gtkutil.h (xg_get_file_name): Add parameter only_dir_p.
+
+ * config.in: Rebuild (added HAVE_GTK_FILE_*).
+
+2004-11-01 Kim F. Storm <[email protected]>
+
+ * process.c (connect_wait_mask, num_pending_connects):
+ Only declare and use them if NON_BLOCKING_CONNECT is defined.
+ (init_process): Initialize them if NON_BLOCKING_CONNECT defined.
+ (IF_NON_BLOCKING_CONNECT): New helper macro.
+ (wait_reading_process_output): Only declare and use local vars
+ Connecting and check_connect when NON_BLOCKING_CONNECT is defined.
+
+2004-11-01 Andy Petrusenco <[email protected]> (tiny change)
+
+ * w32term.c (x_scroll_run): Delete region objects after use.
+
+2004-10-31 Jan Dj,Ad(Brv <[email protected]>
+
+ * xmenu.c: Add prototypes for forward function declarations.
+ (popup_get_selection): Remove parameter do_timers, remove call to
+ timer_check.
+ (create_and_show_popup_menu, create_and_show_dialog):
+ Remove parameter do_timers from call to popup_get_selection.
+
+ * xdisp.c (update_tool_bar): Pass a copy of f->tool_bar_items to
+ tool_bar_items and assign the result to f->tool_bar_items if
+ not equal. Move BLOCK/UNBLOCK_INPUT from around call to
+ tool_bar_items to assignment of result.
+
+ * atimer.c (alarm_signal_handler): Do not call set_alarm if
+ pending_atimers is non-zero.
+
+2004-10-31 Kim F. Storm <[email protected]>
+
+ * dispnew.c (margin_glyphs_to_reserve): Don't use ncols_scale_factor.
+
+2004-10-28 Will <[email protected]>
+
+ * macterm.c: Allow user to assign key modifiers to the Mac Option
+ key via a 'mac-option-modifier' variable.
+
+2004-10-28 Stefan Monnier <[email protected]>
+
+ * xselect.c (Vx_lost_selection_functions, Vx_sent_selection_functions):
+ Rename from Vx_lost_selection_hooks and Vx_sent_selection_hooks.
+ (x_handle_selection_request, x_handle_selection_clear)
+ (x_clear_frame_selections, syms_of_xselect): Adjust accordingly.
+
+2004-10-28 Richard M. Stallman <[email protected]>
+
+ * w32fns.c (Fx_server_vendor, Fx_server_version): Doc fixes.
+
+ * xfns.c (Fx_server_vendor, Fx_server_version): Doc fixes.
+
+2004-10-27 Stefan Monnier <[email protected]>
+
+ * syntax.c (scan_sexps_forward): Give precedence to a 2-char
+ comment-starter over a 1-char one.
+
+2004-10-27 Richard M. Stallman <[email protected]>
+
+ * xdisp.c (get_next_display_element): In mode lines,
+ treat newline and tab like other control characters.
+
+ * editfns.c (Fmessage): Doc fix.
+
+ * indent.c (vmotion): When moving up, check the newline before.
+ Make prevline an int, not a Lisp_Object.
+
+2004-10-27 Kim F. Storm <[email protected]>
+
+ * editfns.c (Fformat): Allocate discarded table with SAFE_ALLOCA.
+ Only allocate info and discarded tables once.
+
+ * lisp.h (USE_SAFE_ALLOCA): Add and init sa_must_free integer.
+ (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Increment it when malloc is used.
+ (SAFE_FREE): Test it to determine if we need to unwind to free.
+ Remove size arg. All users changed.
+ (SAFE_FREE_LISP): Remove. All users changed to use SAFE_FREE.
+
+2004-10-26 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c: Put empty line between comment and function body.
+ (xg_destroy_widgets): Rename from remove_from_container.
+ Just destroy all widgets in list. Argument wcont removed.
+ (xg_update_menubar, xg_update_submenu): Call xg_destroy_widgets
+ instead of remove_from_container.
+ (xg_display_close, xg_create_tool_bar, update_frame_tool_bar)
+ (free_frame_tool_bar): Add comment.
+
+ * xfns.c (xic_create_xfontset): Check that FRAME_XIC_BASE_FONTNAME
+ is not NULL before strcmp.
+
+2004-10-26 Kim F. Storm <[email protected]>
+
+ * callint.c (Fcall_interactively): Add 'U' code to get the
+ up-event discarded by a previous 'k' or 'K' argument.
+
+2004-10-26 David Kastrup <[email protected]>
+
+ * buffer.c (syms_of_buffer): Fix a few typos.
+
+2004-10-26 Jan Dj,Ad(Brv <[email protected]>
+
+ * xsmfns.c: Put empty line between comment and function body.
+ Use two spaces before comment end.
+
+2004-10-25 Kenichi Handa <[email protected]>
+
+ * fontset.c (fontset_pattern_regexp): Optimize for the case that
+ PATTERN is full XLFD.
+
+2004-10-24 Kenichi Handa <[email protected]>
+
+ * regex.h (enum reg_errcode_t): New value REG_ERANGEX.
+
+ * regex.c (re_error_msgid): Add an entry for REG_ERANGEX.
+ (regex_compile): Return REG_ERANGEX if appropriate.
+
+2004-10-22 Jan Dj,Ad(Brv <[email protected]>
+
+ * xfns.c (xic_create_xfontset): Initialize missing_list to NULL.
+
+2004-10-21 K,Aa(Broly L$,1 q(Brentey <[email protected]>
+
+ * xterm.h (x_output): New member `xic_base_fontname'.
+ (FRAME_XIC_BASE_FONTNAME): New macro.
+ (xic_free_xfontset): Declare.
+
+ * xfns.c (xic_create_xfontset): Share fontsets between frames
+ based on base_fontname.
+ (xic_free_xfontset): New function.
+ (free_frame_xic): Use it.
+ (xic_set_xfontset): Ditto.
+
+ * xterm.c (xim_destroy_callback): Ditto.
+
+2004-10-20 B. Anyos <[email protected]> (tiny change)
+
+ * w32term.c (x_draw_glyph_string): Use overline_color for overlines.
+
+2004-10-20 Jan Dj,Ad(Brv <[email protected]>
+
+ * xterm.h (XSync): If USE_GTK, define XSync as process_all and then
+ XSync.
+
+ * emacs.c (my_heap_start, heap_bss_diff, MAX_HEAP_BSS_DIFF):
+ New variables and constant.
+ (main): Calculate heap_bss_diff. If we are dumping and the
+ heap_bss_diff is greater than MAX_HEAP_BSS_DIFF, set PER_LINUX32
+ and exec ourself again.
+ (Fdump_emacs): If heap_bss_diff is greater than MAX_HEAP_BSS_DIFF
+ print a warning.
+
+ * lastfile.c: Make my_endbss and my_endbss_static available on all
+ platforms.
+
+ * Makefile.in (RUN_TEMACS): Remove @SETARCH@.
+ * config.in (HAVE_PERSONALITY_LINUX32): Regenerate.
+
+2004-10-19 Luc Teirlinck <[email protected]>
+
+ * data.c (Flocal_variable_if_set_p): Doc fix.
+
+2004-10-19 Jason Rumney <[email protected]>
+
+ * w32.c (init_environment): Set emacs_dir correctly when running
+ emacs from the build directory.
+
+2004-10-19 Richard M. Stallman <[email protected]>
+
+ * editfns.c (Fdelete_and_extract_region):
+ If region is empty, return null string.
+
+2004-10-19 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.h (xg_update_scrollbar_pos): Remove arguments real_left
+ and canon_width.
+ (xg_frame_cleared): Remove.
+
+ * gtkutil.c (xg_frame_cleared, xg_fixed_handle_expose)
+ (xg_find_top_left_in_fixed): Remove.
+ (xg_create_scroll_bar): Put an event box widget between
+ the scroll bar widget and the edit widget.
+ (xg_show_scroll_bar): Show the parent widget (the event box).
+ (xg_remove_scroll_bar): Destroy parent (the event box) also.
+ (xg_update_scrollbar_pos): Remove arguments real_left and canon_width.
+ Move the parent (the event box) widget inside the fixed widget.
+ Move window clear to xterm.c.
+
+ * gtkutil.h (xg_frame_cleared): Remove.
+
+ * xterm.c (x_clear_frame): Remove call to xg_frame_cleared
+ (x_scroll_bar_create, XTset_vertical_scroll_bar):
+ Remove arguments left and width to xg_update_scrollbar_pos.
+ (XTset_vertical_scroll_bar): Do x_clear_area for USE_GTK also.
+
+2004-10-19 Kenichi Handa <[email protected]>
+
+ * xdisp.c (display_mode_element): Fix display of wide chars.
+
+2004-10-18 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c (xg_update_scrollbar_pos): Change XClearWindow to
+ gdk_window_clear and move gdk_window_process_all_updates after
+ clear so events are sent to the X server in correct order.
+
+2004-10-18 Kenichi Handa <[email protected]>
+
+ * fontset.c (fs_load_font): Use fast_string_match_ignore_case for
+ comparing font names.
+ (fs_query_fontset): Use fast_string_match for comparing fontset names.
+ (list_fontsets): Likewise.
+
+ * search.c (fast_string_match_ignore_case): New function.
+
+ * lisp.h (fast_string_match_ignore_case): Extern it.
+
+2004-10-17 Kim F. Storm <[email protected]>
+
+ * xdisp.c (overlay_arrow_at_row): Return overlay string rather
+ than bitmap if there is not left fringe.
+ (get_overlay_arrow_glyph_row): Also used on windows system.
+ (display_line): Display overlay string if no left fringe.
+
+2004-10-16 Jason Rumney <[email protected]>
+
+ * w32fns.c (w32_font_match): Encode font name being matched.
+
+2004-10-16 Richard M. Stallman <[email protected]>
+
+ * window.c (Fspecial_display_p): Doc fix.
+
+2004-10-15 Stefan Monnier <[email protected]>
+
+ * doc.c (Fsubstitute_command_keys): Fix remap-handling.
+ Don't ignore menus, because where-is-internal already does it for us.
+
+2004-10-15 Kim F. Storm <[email protected]>
+
+ * xdisp.c (redisplay_window): Only update fringes and vertical
+ border on window frames.
+
+2004-10-14 Andreas Schwab <[email protected]>
+
+ * m/ia64.h (DATA_SEG_BITS): Don't define.
+
+2004-10-14 Kim F. Storm <[email protected]>
+
+ * xterm.h: Include Xutil.h after keysym.h to work around bug
+ in some X versions.
+
+2004-10-13 Stefan Monnier <[email protected]>
+
+ * fns.c (map_char_table): Add missing gcpros.
+
+2004-10-13 Stefan Monnier <[email protected]>
+
+ * keymap.c (get_keymap): An autoload form is not a keymap.
+
+ * textprop.c (syms_of_textprop): Make `syntax-table' nonsticky.
+
+2004-10-13 Kim F. Storm <[email protected]>
+
+ * callproc.c (Fcall_process): Simplify handling of display arg.
+ Resume `display_on_the_fly' once a coding system is determined.
+
+ * xdisp.c (redisplay_preserve_echo_area): Fix last change.
+
+2004-10-12 Kim F. Storm <[email protected]>
+
+ * xdisp.c (redisplay_preserve_echo_area): Flush display in case
+ caller, such as call-process, is not going to poll for input.
+ (calc_line_height_property): Handle case where it->object is nil.
+
+ * xterm.c (x_redisplay_interface): Fix flush_display_optional.
+
+2004-10-12 Kenichi Handa <[email protected]>
+
+ * xdisp.c (get_next_display_element):
+ If unibyte_display_via_language_environment is zero, display 8-bit
+ chars in octal in unibyte buffer.
+
+2004-10-12 Kim F. Storm <[email protected]>
+
+ * doc.c (Fsubstitute_command_keys): Ignore remappings unless there
+ are no ordinary bindings.
+
+2004-10-11 Jan Dj,Ad(Brv <[email protected]>
+
+ * xfns.c (syms_of_xfns): Defsubr x-file-dialog for GTK also.
+
+2004-10-10 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.c (x_raise_frame): Add BLOCK_INPUT around SelectWindow.
+ (x_lower_frame): Add BLOCK_INPUT around SendBehind.
+ (make_mac_frame): Add BLOCK_INPUT around the making of a
+ terminal frame.
+ (mac_initialize): Add BLOCK_INPUT around carbon initialization.
+ * macgui.h (mktime): Use emacs_mktime.
+ * macfns.c (Fx_file_dialog): Add BLOCK_INPUT around more code.
+ Make a cancel file-open dialog be like C-g.
+ * mac.c (mktime): Use emacs_mktime.
+ (Fdo_applescript): Add BLOCK_INPUT around do_applescript.
+ (Fmac_paste_function): Add better error handling for carbon cut/paste.
+
+2004-10-10 Kim F. Storm <[email protected]>
+
+ * keyboard.c (timer_resume_idle): New function to resume idle
+ timer without resetting timers on the idle list.
+ (read_char): Use timer_resume_idle. Remove local var last_idle_start.
+ (timer_start_idle, timer_stop_idle): Declare static.
+ (read_key_sequence): Use timer_resume_idle instead of timer_start_idle.
+
+ * keyboard.h (timer_start_idle, timer_stop_idle): Remove prototypes.
+
+2004-10-08 Steven Tamm <[email protected]>
+
+ * config.in (HAVE_MALLOC_MALLOC_H): Regenerate.
+ * macterm.c (mac_check_for_quit_char): Remove warning for using
+ NULL where 0 should be used.
+ * unexmacosx.c: Use malloc/malloc.h on Tiger instead of
+ objc/malloc.h
+ * mac.c: Include time.h for Tiger compatibility.
+
+2004-10-07 Kim F. Storm <[email protected]>
+
+ * xdisp.c (redisplay_window): Fix flicker on vertical line between
+ windows. Update vertical line after drawing window fringes, but
+ only if actually drawing any bitmaps--or there is no fringe.
+
+ * xterm.c (x_update_window_end): Likewise.
+ * macterm.c (x_update_window_end): Likewise.
+ * w32term.c (x_update_window_end): Likewise.
+
+ * fringe.c (draw_window_fringes): Return value now indicates if
+ any fringe bitmaps were redrawn (or there are no fringes).
+
+ * dispextern.h (draw_window_fringes): Update prototype.
+
+2004-10-06 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macfns.c (mac_get_window_bounds): Add extern.
+ (x_real_positions): Use mac_get_window_bounds.
+
+ * macmenu.c (update_submenu_strings): Apply 2004-09-07 change for
+ xmenu.c (YAILOM).
+
+ * macterm.c [!MAC_OSX]: Include Windows.h.
+ (front_emacs_window): Rename from mac_front_window. All uses
+ changed. Return the frontmost non-tooltip emacs window.
+ (mac_get_window_bounds): New function.
+ (x_calc_absolute_position): Use the difference of width and height
+ between the inner and outer window.
+ (x_set_offset): Specify window position by the coordinae of the
+ outer window. Adjust the position if the title bar is completely
+ outside the screen.
+ (app_is_suspended, app_sleep_time): Remove unused variables.
+ (do_app_resume, do_app_suspend): Remove their contents because
+ window-activate/deactivate events will do the job.
+ (do_zoom_window): Remove unused variables. Make compliant to the
+ standard way of zooming. Set f->left_pos and f->top_pos.
+ (XTread_socket): Don't use argument `expected'. Don't use
+ FrontWindow to determine the clicked window. Exclude unprocessed
+ mouseUp cases in the early stage. Add parentheses to fix operator
+ precedence.
+ (XTread_socket) [TARGET_API_MAC_CARBON]: Don't specify drag area.
+
+2004-10-05 Jan Dj,Ad(Brv <[email protected]>
+
+ * config.in: Regenerate.
+
+ * Makefile.in (RUN_TEMACS): Check HAVE_RANDOM_HEAPSTART instead of
+ HAVE_EXECSHIELD.
+
+2004-10-05 Jan Dj,Ad(Brv <[email protected]>
+
+ * xterm.c (x_find_modifier_meanings): Ignore any Super or Hyper for
+ a row if Alt or Meta has been found for that row. Also stop scanning
+ for Keysyms for that row.
+
+2004-10-04 Kim F. Storm <[email protected]>
+
+ * fringe.c (Ffringe_bitmaps_at_pos): Change return value from cons
+ to list. Include overlay arrow bitmap in return value.
+
+ * xterm.c (XTset_vertical_scroll_bar): Improve handling of scroll
+ bars with fractional column width. If scroll bar separates two
+ windows, move it towards the window it belongs to. Only update
+ the padding area below the scroll bar widget when necessary,
+ i.e. when scroll bar widget is created, moved, or resized.
+
+ * xdisp.c (define_frame_cursor1): Do not change frame cursor
+ while tracking/dragging mouse.
+ (x_draw_vertical_border): Do not draw line if frame has scroll bars.
+
+ * window.c (coordinates_in_window): Relax check for cursor
+ on vertial border between mode lines.
+ (Fset_window_fringes): Do not allow negative widths.
+ (Fset_window_scroll_bars): Likewise.
+
+ * .gdbinit (pp): Shorthand for p ARG + pr.
+ (ff): New command: flush frame updates (X only).
+
+2004-10-03 Michael Albinus <[email protected]>
+
+ * fileio.c (auto_save_1) Call Ffile_modes for remote files.
+
+2004-09-30 Kenichi Handa <[email protected]>
+
+ * process.c (send_process): Free composition data.
+
+ * fileio.c (Finsert_file_contents): Free composition data.
+
+ * coding.c (code_convert_region): Don't skip ASCIIs if there are
+ compositions to encode.
+ (encode_coding_string): Likewise. Free composition data.
+
+2004-09-30 Florian Weimer <[email protected]>
+
+ * coding.c (code_convert_region): Free composition data.
+
+2004-09-29 Kim F. Storm <[email protected]>
+
+ * fringe.c: Remove limit on number of bitmaps.
+ (fringe_bitmaps, fringe_faces): Change to pointers.
+ (max_fringe_bitmaps): New var.
+ (Fdefine_fringe_bitmap): Expand fringe_bitmaps and fringe_faces.
+ (init_fringe): Allocate fringe_bitmaps and fringe_faces.
+
+ * dispextern.h (FRINGE_ID_BITS): Increase to 16 bits (64K bitmaps).
+ (struct glyph_row): Reorder fringe_bitmap related fields.
+ (struct it): Likewise.
+
+ * w32term.c (fringe_bmp): Change to pointer.
+ (max_fringe_bmp): New var.
+ (w32_define_fringe_bitmap): Expand fringe_bmp.
+ (w32_draw_fringe_bitmap): Check max_fringe_bmp.
+ (w32_destroy_fringe_bitmap): Likewise.
+
+2004-09-29 Kim F. Storm <[email protected]>
+
+ * fringe.c: Simplify last change.
+ (lookup_fringe_bitmap): New function.
+ (valid_fringe_bitmap_p, resolve_fringe_bitmap): Remove.
+ (Fdestroy_fringe_bitmap): Use lookup_fringe_bitmap.
+ Keep standard bitmaps in Vfringe_bitmaps.
+ (Fdefine_fringe_bitmap): Use lookup_fringe_bitmap.
+ (Fset_fringe_bitmap_face): Likewise.
+
+ * dispextern.h (lookup_fringe_bitmap): Add prototype.
+ (valid_fringe_bitmap_p): Remove prototype.
+
+ * xdisp.c (handle_single_display_prop): Use lookup_fringe_bitmap.
+
+2004-09-29 Kim F. Storm <[email protected]>
+
+ * fringe.c (destroy_fringe_bitmap, init_fringe_bitmap)
+ (w32_init_fringe, w32_reset_fringes): Fix bootstrap (NULL rif).
+
+ * dispextern.h (valid_fringe_bitmap_p): Fix prototype.
+
+ * fringe.c (Vfringe_bitmaps): New variable.
+ (syms_of_fringe): DEFVAR_LISP it.
+ (valid_fringe_bitmap_p): Rename from valid_fringe_bitmap_id_p.
+ Change arg to Lisp_Object and fail if not an integer.
+ (get_fringe_bitmap_name, resolve_fringe_bitmap)
+ (destroy_fringe_bitmap): New functions.
+ (Fdestroy_fringe_bitmap): Change arg to bitmap symbol.
+ Use destroy_fringe_bitmap. Remove symbol from Vfringe_bitmaps and
+ clear its fringe property.
+ (init_fringe_bitmap): Use destroy_fringe_bitmap instead of
+ Fdestroy_fringe_bitmap.
+ (Fdefine_fringe_bitmap): Add BITMAP arg specifying new or existing
+ bitmap symbol; remove WHICH arg. Add symbol to Vfringe_bitmaps
+ and set fringe property. Signal error if no free slots.
+ (Fset_fringe_bitmap_face): Change arg to bitmap symbol.
+ (Ffringe_bitmaps_at_pos): Return bitmap symbols instead of numbers.
+
+ * xdisp.c (handle_single_display_prop): Fringe bitmaps are now
+ symbols with a fringe property.
+
+2004-09-27 Kim F. Storm <[email protected]>
+
+ * buffer.c (syms_of_buffer) <indicate-buffer-boundaries>:
+ Doc fix. Format may now be a symbol or alist, not a cons.
+
+ * fringe.c (update_window_fringes): Handle new formats of
+ indicate-buffer-boundaries (symbol or alist). No longer
+ allow a simple cons.
+ (Ffringe_bitmaps_at_pos): Use nil value for no bitmap.
+
+2004-09-25 Jan Dj,Ad(Brv <[email protected]>
+
+ * config.in: Rebuild.
+
+2004-09-24 Jan Dj,Ad(Brv <[email protected]>
+
+ * config.in: Rebuild.
+
+ * Makefile.in: Run setarch i386 ./temacs if exec-shield is present.
+
+2004-09-18 Stefan Monnier <[email protected]>
+
+ * xterm.c (x_term_init): Work around a bug in some X servers.
+
+2004-09-18 Richard M. Stallman <[email protected]>
+
+ * buffer.c (syms_of_buffer) <default-major-mode>: Doc fix.
+
+ * xdisp.c (try_window_reusing_current_matrix):
+ Handle the case where we reach the old displayed text,
+ out of sync with the old line boundary.
+
+2004-09-14 Stefan Monnier <[email protected]>
+
+ * fileio.c (Finsert_file_contents): Fix case of replacement in a
+ narrowed buffer.
+
+2004-09-14 Kim F. Storm <[email protected]>
+
+ * puresize.h (PURESIZE_RATIO): Define based on BITS_PER_EMACS_INT.
+
+ * xfaces.c (Qface_no_inherit): New var.
+ (syms_of_xfaces): Intern and staticpro it.
+ (Finternal_make_lisp_face, Finternal_set_lisp_face_attribute)
+ (Finternal_copy_lisp_face, update_face_from_frame_parameter):
+ Don't increment face_change_count when face has non-nil
+ face-no-inherit property.
+
+2004-09-13 Stefan Monnier <[email protected]>
+
+ * bytecode.c (BYTE_CODE_QUIT): Add missing AFTER_POTENTIAL_GC.
+ (Fbyte_code): Remove dead code after `wrong_type_argument'.
+
+ * alloc.c (Fgarbage_collect): Mark keyboards, gtk data, and specpdl
+ before doing the mark_stack_check_gcpros since they're not on the stack.
+
+2004-09-12 Kim F. Storm <[email protected]>
+
+ * editfns.c (Fformat): Handle format strings with multiple text
+ properties. Reverse text property list from the format string,
+ so the positions are in increasing order.
+
+2004-09-10 Jan Dj,Ad(Brv <[email protected]>
+
+ * xselect.c (x_reply_selection_request): XSync and UNBLOCK before
+ x_uncatch_errors so that possible protocol errors are delivered.
+
+2004-09-10 Eli Zaretskii <[email protected]>
+
+ * Makefile.in (msdos.o): Depend on buffer.h, commands.h, and
+ blockinput.h.
+ (dosfns.o): Depend on blockinput.h, window.h, dispextern.h,
+ charset.h, and coding.h
+ (w16select.o): Depend on buffer.h, charset.h, coding.h, and composite.h.
+ (term.o): Depend on window.h and keymap.h.
+ (abbrev.o): Depend on syntax.h.
+ (callint.o): Depend on keymap.h.
+ (casefiddle.o): Depend on charset.h and keymap.h.
+ (category.o): Depend on keymap.h.
+ (coding.o): Depend on dispextern.h.
+ (cmds.o): Depend on keyboard.h and keymap.h.
+ (dispnew.o): Depend on indent.h and intervals.h.
+ (doc.o): Depend on keymap.h.
+ (editfns.o): Depend on frame.h.
+ (emacs.o): Depend on dispextern.h.
+ (fileio.o): Don't depend on ccl.h.
+ (filelock.o): Depend on charset.h and coding.h.
+ (frame.o): Depend on w32term.h and macterm.h.
+ (insdel.o): Depend on region-cache.h.
+ (keyboard.o): Depend on keymap.h, w32term.h, and macterm.h.
+ (minibuf.o): Depend on $(INTERVALS_SRC) and keymap.h.
+ (search.o): Depend on $(INTERVALS_SRC).
+ (syntax.o): Depend on keymap.h, regex.h, and $(INTERVALS_SRC).
+ (window.o): Depend on keymap.h, blockinput.h, $(INTERVALS_SRC),
+ xterm.h, w32term.h, and macterm.h.
+ (xdisp.o): Depend on keyboard.h, $(INTERVALS_SRC), xterm.h,
+ w32term.h, and macterm.h.
+ (xfaces.o): Depend on keyboard.h, $(INTERVALS_SRC),
+ region-cache.h, xterm.h, w32term.h, and macterm.h.
+ (bytecode.o): Depend on dispextern.h, frame.h, and xterm.h.
+ (data.o): Depend on frame.h.
+ (fns.o): Depend on keymap.h, xterm.h, and blockinput.h.
+ (print.o): Depend on termchar.h and $(INTERVALS_SRC).
+ (lread.o): Depend on $(INTERVALS_SRC), termhooks.h, and coding.h.
+ (intervals.o): Depend on keymap.h.
+
+ * msdos.c (msdos_set_cursor_shape, IT_display_cursor):
+ Add debugging print-out to termscript.
+
+2004-09-09 Richard M. Stallman <[email protected]>
+
+ * xdisp.c (decode_mode_spec): Use current buffer for most purposes.
+
+2004-09-08 Richard M. Stallman <[email protected]>
+
+ * window.c (Fset_window_buffer): Doc fix.
+
+ * xdisp.c (Fformat_mode_line): New arg BUFFER says which buffer to use.
+
+2004-09-08 Dan Nicolaescu <[email protected]>
+
+ * minibuf.c (history_delete_duplicates): New variable.
+ (read_minibuf): Use it.
+ (syms_of_minibuf): Create the corresponding lisp variable.
+
+2004-09-08 Kim F. Storm <[email protected]>
+
+ * xdisp.c (set_cursor_from_row): Also look at 'cursor' property in
+ overlay just before point.
+
+2004-09-07 Luc Teirlinck <[email protected]>
+
+ * buffer.h (struct buffer): Add auto_save_file_format field.
+ * buffer.c (reset_buffer, init_buffer_once):
+ Handle auto_save_file_format field.
+ (syms_of_buffer): Add DEFVAR_PER_BUFFER for
+ `buffer-auto-save-file-format'.
+ * fileio.c: Delete declaration for removed Vauto_save_file_format.
+ (build_annotations): Adapt to replacement of
+ `auto-save-file-format' with the new buffer-local variable
+ `buffer-auto-save-file-format'.
+ (syms_of_fileio): Delete DEFVAR_LISP for auto-save-file-format.
+
+2004-09-07 Jason Rumney <[email protected]>
+
+ * w32term.h (AppendMenuW_Proc): Move declaration from w32menu.c.
+
+ * w32fns.c (w32_wnd_proc) <WM_MEASUREITEM, WM_DRAWITEM>:
+ Handle Unicode menu titles.
+
+2004-09-07 Kim F. Storm <[email protected]>
+
+ * xdisp.c (set_cursor_from_row): Fix last change. Only use 'cursor'
+ property from text property or overlay strings at point.
+
+2004-09-07 Stefan Monnier <[email protected]>
+
+ * xmenu.c (update_submenu_strings): YAILOM.
+ (set_frame_menubar): Make sure last_i is initialized.
+
+2004-09-03 Jason Rumney <[email protected]>
+
+ * w32menu.c (_widget_value): Add lname and lkey.
+ (digest_single_submenu): Set lname and lkey in widget_value
+ instead of name and key.
+ (update_submenu_strings): New function.
+ (set_frame_menubar): Remove call to inhibit_garbage_collection,
+ call update_submenu_strings.
+
+ * w32menu.c (globals_of_w32menu): Check for Unicode API.
+ (digest_single_submenu, w32_menu_show): Encode menu strings as
+ UTF-8 if Unicode API is available.
+ (utf8to16): New function.
+ (add_menu_item): Use it when calling Unicode API.
+
+2004-09-03 Kim F. Storm <[email protected]>
+
+ * xdisp.c (set_cursor_from_row): Look for non-nil `cursor' property
+ in overlay or text-property strings; set cursor on corresponding
+ glyph rather than at end of the string.
+
+2004-09-02 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macfns.c (x_real_positions): Save the current window port and
+ set a new one before obtaining the global coordinate.
+ Use FRAME_MAC_WINDOW.
+ (x_set_name, x_set_title): Encode title to UTF8.
+ Use SetWindowTitleWithCFString.
+ (Fx_server_version): Get correct OS version.
+
+ * macmenu.c (add_menu_item): Remove unused variable `i'.
+ Don't let separator items destroy refence constants of other menu items.
+
+ * macterm.c (x_update_end): Move SetPortWindowPort to inside
+ BLOCK_INPUT.
+ (x_set_offset): Use FRAME_MAC_WINDOW.
+
+ * xdisp.c (note_mouse_highlight): Set the mouse pointer shape to
+ nontext_cursor if it is on a scroll bar.
+
+ * s/darwin.h (LIBS_CARBON): New define to specify libraries for
+ Carbon support.
+ (LD_SWITCH_SYSTEM_TEMACS): Don't link with unused libstdc++.
+ Use LIBS_CARBON.
+
+2004-09-02 Jan Dj,Ad(Brv <[email protected]>
+
+ * xfns.c (x_set_name_internal): New function. Check if we shall call
+ xfree before ENCODE_UTF_8.
+ (x_set_name, x_set_title): Call x_set_name_internal.
+
+2004-08-31 NAKAMURA Toshikazu <[email protected]> (tiny change)
+
+ * w32fns.c (w32_load_font): If a BDF font is already loaded, do not
+ reload it.
+
+2004-08-30 Jan Dj,Ad(Brv <[email protected]>
+
+ * macmenu.c (_widget_value): Add lname and lkey.
+ (single_submenu): Set lname and lkey in widget_value
+ instead of name and key.
+ (update_submenu_strings): New function.
+ (set_frame_menubar): Remove call to inhibit_garbage_collection,
+ call update_submenu_strings.
+
+ * xmenu.c (digest_single_submenu): Set lname and lkey in widget_value
+ instead of name and key.
+ (update_submenu_strings): New function.
+ (set_frame_menubar): Remove call to inhibit_garbage_collection,
+ call update_submenu_strings.
+
+ * gtkutil.h (_widget_value): Added lname and lkey.
+
+2004-08-30 Steven Tamm <[email protected]>
+
+ * macmenu.c (mac_menu_show): Remove shadowing of menu variable
+ by using different names for inner loop variables.
+
+2004-08-27 Jan Dj,Ad(Brv <[email protected]>
+
+ * xmenu.c (set_frame_menubar): Reintroduce inhibit_garbage_collection
+ from 2002-07-15T00:01:[email protected] so that strings from ENCODE_UTF_8 isn't GC:ed before used.
+
+ * gtkutil.c (xg_create_frame_widgets): Compensate for tool bar when
+ tool bar items is 0.
+
+2004-08-26 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macmenu.c (ENCODE_MENU_STRING): Added to handle multibyte
+ strings in menu items.
+ (single_submenu): Use ENCODE_MENU_STRING
+ (mac_menu_show): Use ENCODE_MENU_STRING. Reset grabbed because
+ button release isn't passed to event loop
+ (add_menu_item): Use SetMenuItemWithCFString.
+
+2004-08-26 Steven Tamm <[email protected]>
+
+ * fileio.c (Fread_file_name): Call x_file_dialog on carbon on
+ tool-bar/menu click.
+ * macfns.c (Fx_file_dialog): Implement using NavServices.
+
+2004-08-24 Jan Dj,Ad(Brv <[email protected]>
+
+ * xterm.c (x_catch_errors_unwind): Do not XSync if display has closed.
+
+ * xfns.c (x_window_to_frame, x_any_window_to_frame)
+ (x_non_menubar_window_to_frame, x_menubar_window_to_frame)
+ (x_top_window_to_frame): Return 0 if wdesc is None.
+
+2004-08-22 Richard M. Stallman <[email protected]>
+
+ * process.c (process_send_signal) [SIGNALS_VIA_CHARACTERS,
+ HAVE_TERMIOS]: If there's no char for this signal, drop through
+ and use system calls.
+
+ * bytecode.c (Fbyte_code) <unwind-protect>: Cannot GC.
+
+2004-08-20 Kim F. Storm <[email protected]>
+
+ * process.c (wait_reading_process_output): Rename from
+ wait_reading_process_input. All uses changed.
+ (wait_reading_process_output_1): Rename from
+ wait_reading_process_input_1. All uses changed.
+
+ * dispnew.c (Fsleep_for): Remove obsolete code.
+
+2004-08-20 Kenichi Handa <[email protected]>
+
+ * syntax.c (skip_chars): Fix for unibyte case.
+
+2004-08-19 Stefan Monnier <[email protected]>
+
+ * syntax.c (char_quoted): Mixup byte/char pos.
+ (back_comment): Fixup globals in all cases.
+
+2004-08-19 Jan Dj,Ad(Brv <[email protected]>
+
+ * xfns.c (x_set_name, x_set_title): Encode title to UTF8 before
+ passing it to gtk_window_set_title.
+
+2004-08-19 Kim F. Storm <[email protected]>
+
+ * process.c (wait_reading_process_input): Clean up.
+ Add wait_for_cell, wait_proc, and just_wait_proc args
+ to avoid overloading `read_kbd' and `do_display' args.
+ Change read_kbd arg to int. All callers changed.
+
+ * process.c (process_send_signal): Use CDISABLE.
+
+ * sysdep.c (child_setup_tty, init_sys_modes): Use CDISABLE.
+
+2004-08-18 Kim F. Storm <[email protected]>
+
+ * process.c (Faccept_process_output): Add arg JUST-THIS-ONE;
+ forward to wait_reading_process_input via DO_DISPLAY arg.
+ (wait_reading_process_input): If DO_DISPLAY < 0 for a process
+ object, only process output from that process; also inhibit
+ running timers if DO_DISPLAY==-2.
+
+2004-08-17 Kim F. Storm <[email protected]>
+
+ * process.c (process_send_signal): Fix last change--use
+ _POSIX_VDISABLE instead of CVDISABLE when available.
+
+2004-08-16 Richard M. Stallman <[email protected]>
+
+ * sysdep.c (child_setup_tty) [SIGNALS_VIA_CHARACTERS]:
+ Set VQUIT and VINTR chars to the standard ones if they are unset.
+ [AIX]: Don't do that here. And don't force VINTR to standard
+ when SIGNALS_VIA_CHARACTERS.
+
+ * process.c (process_send_signal)
+ [SIGNALS_VIA_CHARACTERS, HAVE_TERMIOS]: Clean up.
+ Do nothing if the character is CVDISABLE.
+
+ * xfaces.c (merge_face_ref): Specifying `unspecified' is a no-op.
+
+ * intervals.c (move_if_not_intangible):
+ Force POSITION to be between BEGV and ZV.
+
+2004-08-14 John Paul Wallington <[email protected]>
+
+ * buffer.c (Frestore_buffer_modified_p): Doc fix.
+
+ * fileio.c (Fread_file_name): Doc fix.
+
+ * minibuf.c (syms_of_minibuf) <completion-ignore-case>: Doc fix.
+
+2004-08-09 Luc Teirlinck <[email protected]>
+
+ * keymap.c (Fmake_keymap, Fmap_keymap, Fwhere_is_internal): Doc fixes.
+
+2004-08-08 Luc Teirlinck <[email protected]>
+
+ * keyboard.c: Declare Qdisabled_command_function instead of
+ Qdisabled_command_hook.
+ (Fcommand_execute): Use Qdisabled_command_function instead of
+ Qdisabled_command_hook.
+ (syms_of_keyboard): Ditto.
+
+2004-08-07 Luc Teirlinck <[email protected]>
+
+ * keymap.c (Flocal_key_binding, Fglobal_key_binding)
+ (syms_of_keymap) <key-translation-map>: Doc fixes.
+
+2004-08-07 Stefan Monnier <[email protected]>
+
+ * window.c (window_list_1): YAILOM.
+
+ * fileio.c (make_temp_name): Handle multibyte prefixes.
+
+2004-08-06 Luc Teirlinck <[email protected]>
+
+ * keyboard.c (syms_of_keyboard) <overriding-terminal-local-map>:
+ Doc fix.
+
+2004-08-03 Kenichi Handa <[email protected]>
+
+ * coding.c (decode_coding_string): Adjust coding->consumed, and
+ etc. with shrinked_bytes.
+
+2004-08-03 Kim F. Storm <[email protected]>
+
+ * indent.c (compute_motion): Fix check for full width window
+ in non-window case. Do not count left truncation glyph on
+ window systems.
+
+2004-08-02 Luc Teirlinck <[email protected]>
+
+ * data.c (Finteractive_form): Doc fix.
+
+2004-08-02 Kim F. Storm <[email protected]>
+
+ * indent.c (compute_motion): Use actual window width if WIDTH is -1,
+ properly accounting for continuation glyph on non-window systems.
+ (Fcompute_motion): Use actual window width if WIDTH is nil, and
+ actual window width/height if TOPOS is nil, properly accounting for
+ continuation glyphs on non-window systems, and optional header lines.
+ (vmotion): Let compute_motion calculate actual window width.
+
+ * window.c (window_scroll_line_based): Let compute_motion
+ calculate actual window width.
+
+2004-08-02 Kim F. Storm <[email protected]>
+
+ * process.c (read_process_output): Use whole read buffer.
+ Don't trigger adaptive read buffering on errors.
+
+2004-07-31 Luc Teirlinck <[email protected]>
+
+ * keymap.c (Fset_keymap_parent, Fdefine_prefix_command): Doc fixes.
+
+ * keyboard.c (syms_of_keyboard) <disable-point-adjustment>: Doc fix.
+
+ * callint.c (Fcall_interactively): Doc fix.
+
+2004-07-30 Richard M. Stallman <[email protected]>
+
+ * abbrev.c (Fexpand_abbrev): Undo previous change.
+
+2004-07-30 Kim F. Storm <[email protected]>
+
+ * editfns.c (Fformat): Allocate extra (dummy) element in info.
+
+2004-07-28 Luc Teirlinck <[email protected]>
+
+ * eval.c (Fdefvar, Fdefconst): Doc fixes.
+
+2004-07-27 Kim F. Storm <[email protected]>
+
+ * xdisp.c (move_it_in_display_line_to): Check BUFFER_POS_REACHED_P after
+ we have ensured that the glyph fits on the current line (or returned
+ MOVE_LINE_CONTINUED otherwise).
+
+2004-07-26 Kim F. Storm <[email protected]>
+
+ * xdisp.c (move_it_in_display_line_to): If overflow-newline-into-fringe
+ is enabled, return MOVE_LINE_CONTINUED rather than MOVE_POS_MATCH_OR_ZV
+ if target position is at end of display line but char is not a newline.
+
+2004-07-25 Richard M. Stallman <[email protected]>
+
+ * window.c (coordinates_in_window): Return ON_SCROLL_BAR
+ instead of ON_VERTICAL_BORDER, when on scroll bar.
+ (Fcoordinates_in_window_p): Handle ON_SCROLL_BAR--return nil.
+
+ * dispextern.h (enum window_part): Add ON_SCROLL_BAR.
+
+ * window.c (Fcoordinates_in_window_p):
+ Take account of FRAME_INTERNAL_BORDER_WIDTH.
+
+ * alloc.c (check_cons_list): New function (contents commented out).
+
+2004-07-24 Luc Teirlinck <[email protected]>
+
+ * xfaces.c (Fcolor_supported_p): Doc fix.
+
+ * frame.c (Fselect_frame, Fset_frame_selected_window)
+ (Fframe_visible_p, Fraise_frame): Doc fixes.
+
+2004-07-24 Richard M. Stallman <[email protected]>
+
+ * keyboard.h (not_single_kboard_state): Declare.
+
+ * fileio.c (Fwrite_region): Doc fix.
+
+ * window.c (Fwindow_at): Take account of FRAME_INTERNAL_BORDER_WIDTH.
+
+ * abbrev.c (Fexpand_abbrev): Run Qpre_abbrev_expand_hook
+ only when a real abbrev is present.
+
+ * xfns.c (x_icon_verify): New function.
+ (Fx_create_frame): Use it.
+
+2004-07-22 Barry Fishman <[email protected]> (tiny change)
+
+ * s/gnu-linux.h: Use GC_MARK_STACK if __amd64__ is defined.
+
+2004-07-21 Kim F. Storm <[email protected]>
+
+ * window.h (struct glyph_matrix): New members nrows_scale_factor
+ and ncols_scale_factor.
+
+ * window.c (make_window): Initialize nrows_scale_factor and
+ ncols_scale_factor members.
+
+ * dispnew.c (margin_glyphs_to_reserve): Apply ncols_scale_factor.
+ (allocate_matrices_for_frame_redisplay): Fix left/right margin mix-up.
+ (required_matrix_height): Apply nrows_scale_factor.
+ (required_matrix_width): Apply ncols_scale_factor.
+
+ * xdisp.c (display_line): Increment nrows_scale_factor and set
+ fonts_changed_p if past last allocated row.
+ (append_glyph, append_composite_glyph, produce_image_glyph)
+ (append_stretch_glyph): Increment ncols_scale_factor and set
+ fonts_changed_p if current area is full.
+
+2004-07-21 Jan Dj,Ad(Brv <[email protected]>
+
+ * widget.c (EmacsFrameDestroy): Don't abort if normal_gc is 0.
+
+2004-07-19 Luc Teirlinck <[email protected]>
+
+ * window.c (Fpos_visible_in_window_p, Fset_window_hscroll)
+ (Fwindow_inside_pixel_edges, Fwindow_end, Fset_window_point)
+ (Fset_window_start, Fscroll_up, Fscroll_down)
+ (Fother_window_for_scrolling, Fscroll_other_window)
+ (Fsave_window_excursion, Fset_window_vscroll)
+ (syms_of_window) <window-size-fixed>: Doc fixes.
+
+2004-07-19 KOBAYASHI Yasuhiro <[email protected]>
+
+ * w32fns.c (Fx_file_dialog): Use ENCODE_FILE instead of
+ ENCODE_SYSTEM for filenames.
+
+2004-07-18 YAMAMOTO Mitsuharu <[email protected]>
+
+ * mac.c (sys_select): Block input around call to
+ ReceiveNextEvent to prevent breakage. Correctly handle
+ blocking on event queue only by calling ReceiveNextEvent
+ instead of select (since GUI events aren't on an fd).
+ (sys_read): Remove function
+ * sysdep.c: Remove redefine of read to sys_read if HAVE_CARBON.
+
+2004-07-18 YAMAMOTO Mitsuharu <[email protected]>
+
+ * mac.c (sys_select): Redo sys_select to use alarm-based
+ polling instead of 1 sec timeouts (like solaris).
+
+ * macterm.c (x_make_frame_visible): Comment in polling on
+ frame creation.
+
+ * keyboard.c: Undef SIGIO on Carbon.
+
+ * atimer.c (alarm_signal_handler): Call alarm handlers after
+ scheduling.
+
+ * eval.c (Feval): Remove quit_char test.
+
+ * process.c (wait_reading_process_input): Remove clearing
+ stdin for select call on process input.
+
+2004-07-18 Luc Teirlinck <[email protected]>
+
+ * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Correct
+ capitalization error in docstring.
+
+2004-07-17 Juanma Barranquero <[email protected]>
+
+ * keyboard.c (not_single_kboard_state): Do nothing unless
+ MULTI_KBOARD is defined.
+
+2004-07-17 Richard M. Stallman <[email protected]>
+
+ * window.c (coordinates_in_window): Inside the window but outside
+ its box to the L or R, return ON_VERTICAL_BORDER.
+ (window_list_1): Rotate the list to start with WINDOW.
+
+ * print.c (print_preprocess): Test for print_depth at limit
+ before entering in being_printed.
+
+ * keyboard.c (not_single_kboard_state): New function.
+ (stuff_buffered_input): Now no-op only if no SIGTSTP.
+
+ * frame.c (Fdelete_frame): If we're in single_bboard_state on
+ this kboard, and we delete its last frame, go to any_kboard_state.
+
+ * buffer.c (syms_of_buffer) <transient-mark-mode>: Doc fix.
+
+2004-07-15 KOBAYASHI Yasuhiro <[email protected]>
+
+ * w32fns.c (Fx_file_dialog): Encode strings in system coding
+ system before passing them to OS functions for display.
+
+2004-07-15 David Kastrup <[email protected]>
+
+ * search.c (syms_of_search): Staticpro `saved_last_thing_searched'.
+ Apparently fixes an abort condition.
+
+2004-07-14 Luc Teirlinck <[email protected]>
+
+ * fileio.c (Fvisited_file_modtime): Return a list of two integers,
+ instead of a cons.
+
+2004-07-14 K,Aa(Broly L$,1 q(Brentey <[email protected]>
+
+ * keyboard.c (echo_dash): Do nothing if there already is a dash
+ at the end of the echo string.
+
+2004-07-12 Kim F. Storm <[email protected]>
+
+ * alloc.c (mark_object): Only look at Lisp_Misc_Save_Value
+ if GC_MARK_STACK.
+
+2004-07-10 Luc Teirlinck <[email protected]>
+
+ * buffer.c (Fswitch_to_buffer, Fpop_to_buffer): Doc fixes.
+
+ * window.c (Fwindow_buffer, Fother_window, Fget_lru_window)
+ (Fget_largest_window, Fget_buffer_window, Fdelete_windows_on)
+ (Freplace_buffer_in_windows, Fset_window_buffer)
+ (Fselect-window, Fdisplay-buffer, Fsplit_window): Doc fixes.
+ (syms_of_window): Expand docstring of `display-buffer-function'.
+
+2004-07-09 Luc Teirlinck <[email protected]>
+
+ * editfns.c (Ffloat_time, Fformat_time_string, Fdecode_time)
+ (Fcurrent_time_string, Fcurrent_time_zone): Mention in docstrings
+ that time values of the type (HIGH . LOW) are considered obsolete.
+
+2004-07-06 Luc Teirlinck <[email protected]>
+
+ * keyboard.c (syms_of_keyboard): Fix `keyboard-translate-table'
+ docstring.
+
+ * fns.c (Fclear_string): Declare `len' before call to CHECK_STRING.
+
+2004-07-06 John Paul Wallington <[email protected]>
+
+ * eval.c (Fdefmacro): Signal an error if NAME is not a symbol.
+
+ * fns.c (Fclear_string): Signal an error if STRING is not a string.
+
+2004-07-05 Jan Dj,Ad(Brv <[email protected]>
+
+ * macterm.c (mac_initialize_display_info): Use CGGetActiveDisplayList
+ instead of CGMainDisplayID (only in OSX 10.2 and later).
+
+2004-07-04 John Paul Wallington <[email protected]>
+
+ * fileio.c (read_file_name_completion_ignore_case): New variable.
+ (syms_of_fileio): Declare and initialise it.
+ (Fread_file_name): Bind `completion-ignore-case' to respect it.
+
+2004-07-03 Eli Zaretskii <[email protected]>
+
+ * msdos.c (dos_rawgetc): Use make_number to produce Lisp objects
+ for event.x and event.y.
+
+2004-07-01 Kenichi Handa <[email protected]>
+
+ * w32select.c (Fw32_set_clipboard_data): Update `nbytes' correctly
+ after getting a new string by pre-write-conversion.
+
+2004-06-30 Stefan Monnier <[email protected]>
+
+ * xterm.c (x_detect_focus_change): Remove unused var `nr_events'.
+ (x_calc_absolute_position): Remove unused var `child'.
+
+ * xfaces.c (x_supports_face_attributes_p)
+ (Fdisplay_supports_face_attributes_p): YAILOM.
+ (tty_supports_face_attributes_p): Remove unused var `i'.
+
+ * syntax.c (skip_chars): Remove unused labels fwd_unibyte_ok and
+ back_unibyte_ok.
+
+ * search.c (match_limit, Fmatch_data, Fset_match_data): YAILOM.
+
+ * fontset.c (Fset_fontset_font): Remove unused vars `family' and
+ `registry'.
+
+ * Makefile.in (${etc}DOC): Fix file name of make-docfile.
+
+2004-06-30 Andreas Schwab <[email protected]>
+
+ * image.c (CHECK_LIB_AVAILABLE): Add third parameter LIBRARIES.
+ (Finit_image_library): Pass LIBRARIES through to
+ CHECK_LIB_AVAILABLE. Declare parameters. Doc fix.
+ (lookup_image_type): Pass Qnil as second argument to
+ Finit_image_library.
+
+ * lisp.h (Finit_image_library): Declare.
+
+2004-06-29 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.c (do_window_activate, do_window_deactivate): Remove.
+ (XTread_socket): Send mouse button events to the toolbox
+ dispatcher even when the mouse is grabbed. Don't process window
+ activate events for non-Emacs windows. Replace function calls to
+ do_window_activate and do_window_deactivate with their contents.
+ Reset mouse grabbing status when a window is deactivated.
+
+2004-06-29 Steven Tamm <[email protected]>
+
+ * macterm.c (mac_get_emulated_btn)
+ (mac_event_to_emacs_modifiers): Fix emulated mouse button
+ support to correctly mask out modifiers.
+
+2004-06-29 David Kastrup <[email protected]>
+
+ * search.c (Fset_match_data): Allow buffer before end of list
+ which can happen if set-match-data is using a pre-consed list.
+
+2004-06-28 Steven Tamm <[email protected]>
+
+ * macterm.c (XTread_socket): Correctly set the frame position
+ after the window is moved.
+
+2004-06-28 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c (xg_get_image_for_pixmap): Call g_object_unref on
+ gpix and gmask just before return to avoid memory leak.
+ (xg_get_image_for_pixmap): Add workaround for monochrome displays
+ so insensitive and activated icons look ok.
+
+2004-06-27 Jason Rumney <[email protected]>
+
+ * w32fns.c (file_dialog_callback): Disable edit control if set
+ to directories only on CDN_INITDONE message.
+ (Fx_file_dialog): Default to directories only when prompt starts
+ with "Dired".
+
+2004-06-25 Kim F. Storm <[email protected]>
+
+ * alloc.c (allocate_misc): Update total_free_markers.
+ (free_misc): New function.
+ (safe_alloca_unwind, free_marker): Use it.
+
+ * lisp.h (free_misc): Add prototype.
+
+ * fns.c (Fmapconcat, Fmapcar): Remove superfluous GCPROs.
+
+2004-06-24 Richard M. Stallman <[email protected]>
+
+ * emacs.c (Vsignal_USR1_hook, Vsignal_USR2_hook): Definitions deleted.
+ (syms_of_emacs): Lisp variables deleted.
+
+2004-06-23 David Kastrup <[email protected]>
+
+ * search.c (Freplace_match): Adjust the match-data more thoroughly
+ when replacing strings in the buffer.
+ (Fmatch_data): When INTEGERS is non-nil and the last match was in
+ a buffer, add the buffer as last element to the match data.
+ (Fset_match_data): If an additional element of the match-data is a
+ buffer, restore it to last_thing_searched.
+ (save_search_regs): Save last_thing_searched as part of the match data.
+ (restore_match_data): Restore it again.
+
+2004-06-23 Luc Teirlinck <[email protected]>
+
+ * keymap.c (Ftext_char_description): Doc fix.
+ * doc.c (Fsnarf_documentation): Doc fix.
+
+2004-06-22 Kim F. Storm <[email protected]>
+
+ * fns.c (Fmapcar, Fmapconcat): GCPRO the args array.
+
+ * lisp.h (struct Lisp_Save_Value): New member dogc.
+ (SAFE_ALLOCA_LISP): Change second arg to number of elements.
+ Set dogc member in Lisp_Save_Value object so it will be GC'ed.
+ (SAFE_FREE_LISP): New macro.
+
+ * alloc.c (safe_alloca_unwind): Clear dogc and pointer members.
+ (make_save_value): Init new dogc member.
+ (mark_object): Mark Lisp_Save_Value pointer array if dogc is set.
+
+ * fns.c (Fmapconcat, Fmapcar): Use new SAFE_ALLOCA_LISP and
+ SAFE_FREE_LISP macros.
+
+2004-06-22 Kim F. Storm <[email protected]>
+
+ * lisp.h (SAFE_ALLOCA_LISP): New macro to allocate Lisp_Objects.
+ Temporarily inhibits GC if memory is xmalloc'ed, as the Lisp_Objects
+ in that memory area are unknown to GC. Add comments.
+
+ * fns.c (Fmapconcat, Fmapcar): Use SAFE_ALLOCA_LISP.
+
+2004-06-21 Kim F. Storm <[email protected]>
+
+ * lisp.h (MAX_ALLOCA): Define here.
+ (safe_alloca_unwind): Add prototype.
+ (USE_SAFE_ALLOCA, SAFE_ALLOCA, SAFE_FREE): New macros.
+
+ * alloc.c (safe_alloca_unwind): New function.
+
+ * casefiddle.c (casify_object): Use SAFE_ALLOCA.
+
+ * charset.c (Fstring): Use SAFE_ALLOCA.
+
+ * coding.c (MAX_ALLOCA): Remove define.
+
+ * data.c (MAX_ALLOCA): Remove define.
+ (Faset): Use SAFE_ALLOCA.
+
+ * editfns.c (Fformat, Ftranspose_regions): Use SAFE_ALLOCA.
+
+ * fns.c (string_make_multibyte, string_to_multibyte)
+ (string_make_unibyte, Fmapconcat, Fmapcar): Use SAFE_ALLOCA.
+ (MAX_ALLOCA): Remove define.
+ (Fbase64_encode_region, Fbase64_encode_string)
+ (Fbase64_decode_region, Fbase64_decode_string): Use SAFE_ALLOCA.
+ (Fbase64_encode_region, Fbase64_encode_string): Fix potential
+ memory leak if encoding fails.
+
+ * xdisp.c (add_to_log): Use SAFE_ALLOCA.
+
+2004-06-21 Eli Zaretskii <[email protected]>
+
+ * print.c (Fwith_output_to_temp_buffer): Doc fix.
+
+2004-06-20 Richard M. Stallman <[email protected]>
+
+ * xfaces.c (Finternal_copy_lisp_face): Small cleanup; doc fix.
+
+ * search.c (match_limit): Cleaner err msg when no match data available.
+
+ * window.c (syms_of_window): Doc fix.
+
+ * keyboard.c (command_loop_1): Handle values `only' and `identity'
+ for Vtransient_mark_mode.
+
+ * buffer.c (syms_of_buffer): Doc fix.
+
+2004-06-21 David Kastrup <[email protected]>
+
+ * minibuf.c (Ftry_completion, Fall_completions): Do lazy binding
+ and unbinding of `case-fold-search' according to
+ `completion-ignore-case' around calls of string-match and
+ predicates, respectively. Should give satisfactory performance
+ in all relevant cases.
+
+2004-06-17 Jan Dj,Ad(Brv <[email protected]>
+
+ * xterm.c (x_draw_image_foreground_1): Subtract slice.x/y from
+ clip_x/y_origin.
+
+ * fns.c (string_to_multibyte): Use xmalloc/xfree instead of alloca.
+
+ * macfns.c (Fx_display_color_cells): Do not limit return value to 256.
+
+ * macterm.c (mac_initialize_display_info): Initialize n_planes correctly
+ on Mac OSX.
+
+2004-06-16 Luc Teirlinck <[email protected]>
+
+ * buffer.c (syms_of_buffer): Clarify `fill-column' docstring.
+
+2004-06-16 Kim F. Storm <[email protected]>
+
+ * dispextern.h (Vimage_types): Remove extern.
+
+2004-06-16 Miles Bader <[email protected]>
+
+ * image.c (lookup_image_type): Initialize image type if necessary.
+
+2004-06-15 Kim F. Storm <[email protected]>
+
+ * xdisp.c (try_cursor_movement): Exclude header line from scroll
+ margin at top of window.
+ (try_window_reusing_current_matrix): Calculate proper cursor position
+ after scrolling up with non-zero scroll margin, as the old cursor
+ position corresponds to value of PT before executing this command.
+ (try_window_id): Consider scroll margin at bottom of window too;
+ otherwise we fail to scroll when hl-line-mode is enabled.
+
+ * syntax.c (skip_chars): Only recognize [:class:] when it has the
+ proper format and class is a lower-case word.
+
+2004-06-14 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c (xg_get_image_for_pixmap): New function.
+ (xg_get_gdk_pixmap_and_mask): Remove.
+ (update_frame_tool_bar): Call xg_get_image_for_pixmap instead of
+ xg_get_gdk_pixmap_and_mask.
+
+ * xterm.h (struct x_display_info): Typo in comment fixed.
+
+2004-06-14 Juanma Barranquero <[email protected]>
+
+ * dispextern.h (Vimage_types): Make it conditional on
+ HAVE_WINDOW_SYSTEM.
+
+ * image.c (Vimage_types): Move from xdisp.c.
+ (Vimage_type_cache): New variable.
+ (define_image_type): New argument indicating whether an image
+ library was loaded; cache loaded status and return t on success,
+ nil otherwise.
+ (CACHE_IMAGE_TYPE, ADD_IMAGE_TYPE): New macros.
+ (w32_delayed_load): New function to load an image library from a
+ list of possible filenames.
+ (init_xpm_functions, init_png_functions, init_jpeg_functions)
+ (init_tiff_functions, init_gif_functions): Use `w32_delayed_load'.
+ (CHECK_LIB_AVAILABLE): Call `define_image_library' with new argument.
+ (Finit_image_library): New function, extracted from `init_image'.
+ Try to initialize an image library on demand and cache whether we
+ were successful or not.
+ (syms_of_image): Initialize `Vimage_types' and
+ `Vimage_type_cache'. Add recognized image types to Vimage_types.
+ Export `init-image-library'.
+ (init_image): Remove initialization of all image types, except xbm
+ and pbm.
+
+ * xdisp.c (Vimage_types): Delete (moved to image.c).
+
+2004-06-14 Andreas Schwab <[email protected]>
+
+ * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
+ Avoid calling specbind when completion-regexp-list is empty.
+
+2004-06-13 Richard M. Stallman <[email protected]>
+
+ * regex.h (CHAR_CLASS_MAX_LENGTH, re_wctype_t, re_wchar_t)
+ (re_wctype, re_iswctype, re_wctype_to_bit):
+ Non-function definitions moved here from regex.c.
+
+ * regex.c (re_wctype, re_iswctype): Function defs longer static.
+ (CHAR_CLASS_MAX_LENGTH, re_wctype_t, re_wchar_t)
+ (re_wctype, re_iswctype, re_wctype_to_bit):
+ Non-function definitions moved to regex.h.
+
+ * window.c (Fselect_window): Doc fix.
+
+ * syntax.c: Include regex.h.
+ (skip_chars): New arg HANDLE_ISO_CLASSES. Callers changed.
+ If requested, make a list of classes, then check the scanned
+ chars for membership in them.
+ (in_classes): New function.
+ Doc fix.
+
+ * keyboard.c (cmd_error): Don't call any_kboard_state
+ if inside a recursive edit level.
+
+2004-06-13 K,Aa(Broly L$,1 q(Brentey <[email protected]>
+
+ * keyboard.c (command_loop): Call any_kboard_state before
+ command_loop_2 when at top level.
+
+2004-06-13 Andreas Schwab <[email protected]>
+
+ * print.c (print_object): Always use %ld for printing EMACS_INT.
+
+ * keyboard.c (cancel_hourglass_unwind): Return a value.
+ (modify_event_symbol): Always use %ld for printing EMACS_INT.
+ (Fexecute_extended_command): Likewise.
+
+ * syntax.h (SYNTAX_ENTRY_FOLLOW_PARENT): Rename local variable to
+ avoid clashes.
+ (SYNTAX): Likewise.
+ (SYNTAX_WITH_FLAGS): Likewise.
+ (SYNTAX_MATCH): Likewise.
+
+ * syntax.c (char_quoted): Avoid warning about undefined operation.
+ (find_defun_start): Likewise.
+ (scan_lists): Likewise.
+ (INC_FROM): Likewise.
+ (scan_sexps_forward): Likewise.
+
+ * image.c: Include <ctype.h>.
+
+ * xfaces.c (face_attr_equal_p): Declare parameters.
+
+2004-06-13 Kenichi Handa <[email protected]>
+
+ * ccl.c (CCL_READ_CHAR): If hit EOF, set REG to -1.
+
+2004-06-12 Matthew Mundell <[email protected]>
+
+ * eval.c (Fdefun): Signal an error if NAME is not a symbol.
+
+2004-06-12 Kenichi Handa <[email protected]>
+
+ * ccl.c (CCL_CALL_FOR_MAP_INSTRUCTION): Save eof_ic in
+ ccl_prog_stack_struct and update it.
+ (CCL_INVALID_CMD): If CCL_DEBUG is defined, call ccl_debug_hook.
+ (CCL_READ_CHAR): Get instruction counter from eof_ic, not from
+ ccl->eof_ic on EOF.
+ (ccl_debug_hook): New function.
+ (struct ccl_prog_stack): New member eof_ic.
+ (ccl_driver): Handle EOF in subrountine call correctly.
+
+2004-06-11 Kenichi Handa <[email protected]>
+
+ * coding.c (encode_coding_string): Check CODING_FINISH_INTERRUPT.
+
+2004-06-11 Kim F. Storm <[email protected]>
+
+ * emacs.c (shut_down_emacs): Inhibit redisplay during shutdown.
+
+2004-06-11 Juanma Barranquero <[email protected]>
+
+ * keyboard.c (Fposn_at_point): Doc fix.
+
+2004-06-11 David Kastrup <[email protected]>
+
+ * search.c (match_limit): Don't flag an error if match-data
+ exceeding the allocated search_regs.num_regs gets requested, just
+ return Qnil.
+
+2004-06-08 Miles Bader <[email protected]>
+
+ * xfaces.c (push_named_merge_point): Return 0 when a cycle is detected.
+
+2004-06-07 Juanma Barranquero <[email protected]>
+
+ * editfns.c (Fuser_login_name, Ffloat_time, Fencode_time)
+ (Fcurrent_time_string, Fcurrent_time_zone)
+ (Finsert_buffer_substring, Ftranspose_regions): Doc fixes.
+
+2004-06-07 Miles Bader <[email protected]>
+
+ * xfaces.c (struct named_merge_point): New type.
+ (push_named_merge_point): New function.
+ (merge_named_face): New function.
+ (merge_face_ref, face_at_buffer_position, face_at_string_position):
+ Use `merge_named_face'.
+ (merge_face_inheritance): Function removed.
+ (merge_face_ref): Rename from `merge_face_vector_with_property'.
+ Add new `err_msgs' and `named_merge_points' args. Return error
+ status. Only print error messages if ERR_MSGS is true. Don't try to
+ do :inherit attribute validation.
+ (merge_face_heights): Handle `unspecified' in both directions.
+ (merge_face_vectors): Rename `cycle_check' arg to `named_merge_points'.
+ Call `merge_face_ref' instead of `merge_face_inheritance'.
+ (Fdisplay_supports_face_attributes_p, Fface_attributes_as_vector)
+ (compute_char_face, face_at_buffer_position)
+ (face_at_string_position): Call `merge_face_ref' instead of
+ `merge_face_vector_with_property'.
+
+2004-06-07 Kenichi Handa <[email protected]>
+
+ * coding.c (find_safe_codings): Check NILP (safe_codings) only at
+ the necessary places.
+
+2004-06-07 Kim F. Storm <[email protected]>
+
+ * process.c (Fdelete_process): Undo 2004-05-28 change.
+ Instead, call status_notify also for network process.
+ (status_message): Use process instead of status as arg.
+ Give messages "deleted" or "connection broken by remote peer" for
+ an exited network process.
+ (status_notify): Change call to status_message.
+ (read_process_output): Increase readmax to 4096. Do not increase
+ buffer size for datagram channels (default is now large enough).
+
+2004-06-06 Steven Tamm <[email protected]>
+
+ * macfns.c (x_create_tip_frame): Fix Mac OS X 10.1 compilation
+ problem due to newly defined variable.
+
+2004-06-06 Miles Bader <[email protected]>
+
+ * xfaces.c (Fdisplay_supports_face_attributes_p): Give up
+ immediately if non-interactive or not initialized.
+
+2004-06-05 Richard M. Stallman <[email protected]>
+
+ * minibuf.c (Fcompleting_read): Doc fix.
+
+2004-06-05 Andreas Schwab <[email protected]>
+
+ * macfns.c (x_create_tip_frame): Fix declaration after statement.
+
+2004-06-05 Juanma Barranquero <[email protected]>
+
+ * keymap.c (Fdescribe_vector): Fix docstring.
+ (Fkey_description, Fglobal_key_binding): Fix typo in docstring.
+
+2004-06-05 Miles Bader <[email protected]>
+
+ * xfaces.c (tty_supports_face_attributes_p): Make sure the specified
+ attributes have different values than the default face.
+
+2004-06-04 Eli Zaretskii <[email protected]>
+
+ * xfaces.c (x_supports_face_attributes_p): Make this function
+ conditional on HAVE_WINDOW_SYSTEM.
+ (Fdisplay_supports_face_attributes_p) [HAVE_WINDOW_SYSTEM]:
+ Don't call x_supports_face_attributes_p if it was not compiled in.
+
+2004-06-04 Miles Bader <[email protected]>
+
+ * xfaces.c (tty_supports_face_attributes_p): New function, mostly
+ from Ftty_supports_face_attributes_p.
+ (x_supports_face_attributes_p): New function.
+ (Ftty_supports_face_attributes_p): Function deleted.
+ (Fdisplay_supports_face_attributes_p): New function.
+ (syms_of_xfaces): Initialize Sdisplay_supports_face_attributes_p.
+ (face_attr_equal_p): New function.
+ (lface_equal_p): Use it.
+
+2004-06-03 Juanma Barranquero <[email protected]>
+
+ * w32fns.c (Fx_display_grayscale_p, Fw32_send_sys_command)
+ (Vw32_color_map): Fix typo in docstring.
+ (Fx_create_frame, Fw32_find_bdf_fonts, Fx_show_tip)
+ (Fw32_unregister_hot_key, Fw32_reconstruct_hot_key):
+ Make argument names match their use in docstring.
+
+2004-06-02 Juanma Barranquero <[email protected]>
+
+ Work around bugs/problems with MinGW builds of graphics libraries
+ called from MSVC builds of Emacs.
+
+ * image.c (lookup_image): Make pointer to img static.
+ (png_read_from_memory): Disable "global" optimization.
+
+2004-06-01 Stefan Monnier <[email protected]>
+
+ * eval.c (Fcondition_case): Fix usage. Simplify.
+
+ * mem-limits.h (EXCEEDS_LISP_PTR) [USE_LSB_TAG]: Never true.
+
+2004-05-29 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macfns.c: Don't include ccl.h.
+ [MAC_OSX]: Don't include QuickTime/QuickTime.h.
+ [!MAC_OSX]: Don't include alloca.h, Windows.h, Gestalt.h, or
+ TextUtils.h.
+ (Fx_create_frame): Sync with xfns.c. Initialize cursor descriptors.
+ (Fx_display_mm_height, Fx_display_mm_width): Calculate length from
+ display height/width.
+ (compute_tip_xy, Vx_max_tooltip_size): Declare.
+ (unwind_create_tip_frame, compute_tip_xy): New functions.
+ (x_create_tip_frame, Fx_show_tip, Fx_hide_tip): Sync with xfns.c.
+ (syms_of_macfns): Initialize Qcancel_timer, Vx_max_tooltip_size,
+ and last_show_tip_args.
+
+ * macgui.h [!MAC_OSX]: Include Gestalt.h.
+ (Cursor, No_Cursor): New defines.
+ [!TARGET_API_MAC_CARBON] (SetPortWindowPort): New compatibility macro.
+ [!TARGET_API_MAC_CARBON] (arrow_cursor): Declare.
+
+ * macmenu.c (mac_menu_show, mac_dialog): Use SetPortWindowPort.
+
+ * macterm.c: Don't include Gestalt.h.
+ (enum mouse_tracking_type, mouse_tracking_in_progress): Remove.
+ (XDrawLine, XClearArea, XClearWindow, mac_draw_bitmap)
+ (mac_set_clip_rectangle, mac_reset_clipping, XCreatePixmap)
+ (XFillRectangle, mac_draw_rectangle, mac_draw_string_common)
+ (mac_copy_area, mac_copy_area_with_mask, x_update_end)
+ (construct_mouse_click, XTmouse_position)
+ (x_scroll_bar_report_motion, x_calc_absolute_position)
+ (do_mouse_moved, do_zoom_window, mac_do_receive_drag)
+ (XTread_socket, make_mac_frame): Use SetPortWindowPort.
+ (note_mouse_movement): Clear the mouse face and reset the pointer
+ shape when the pointer goes outside the frame without grabbing.
+ (mac_front_window): New function.
+ (mac_window_to_frame): New macro.
+ (XTmouse_position, x_scroll_bar_report_motion, do_window_update)
+ (do_window_activate, do_window_deactivate, do_app_resume)
+ (do_app_suspend, do_mouse_moved, do_menu_choice, do_grow_window)
+ (do_zoom_window, mac_do_receive_drag, XTread_socket)
+ (mac_check_for_quit_char): Use mac_front_window and/or
+ mac_window_to_frame.
+ (x_scroll_bar_handle_click): Set `(PORTION . WHOLE)' part in a
+ scroll-bar click event.
+ (mac_define_frame_cursor): Change the pointer shape.
+ (x_free_frame_resources): Reset tip_window to NULL when it is
+ disposed of.
+ [!TARGET_API_MAC_CARBON] (arrow_cursor): New variable.
+ [!TARGET_API_MAC_CARBON] (do_init_managers): Initialize arrow_cursor.
+ (do_window_update): Don't do anything if the updated window is the
+ tooltip window.
+ (do_mouse_moved): Handle mouse movement events here (previously in
+ XTread_socket). Clear the mouse face if
+ dpyinfo->mouse_face_hidden is set.
+ (do_os_event, do_events): Remove (now in XTread_socket).
+ (XTread_socket): Immediately return if interrupt_input_blocked.
+ Loop until all the events in the queue are processed.
+ Rearrange codes for mouse grabbing. Add tooltip support. Include the
+ contents of do_os_event and do_events. Remove mouse movement
+ handling (now in do_mouse_moved). Add the case where
+ Vmouse_highlight has an integer value.
+ (NewMacWindow): Remove.
+ (make_mac_frame): Do what NewMacWindow previously did. Don't do
+ excess initializations.
+ (make_mac_terminal_frame): Previous initializations in
+ make_mac_frame are moved here.
+ (mac_initialize_display_info):
+ Initialize dpyinfo->mouse_face_overlay and dpyinfo->mouse_face_hidden.
+
+ * xdisp.c [MAC_OS] (No_Cursor): Remove variable.
+ (define_frame_cursor1): Don't treat HAVE_CARBON as a special case.
+
+2004-05-29 Richard M. Stallman <[email protected]>
+
+ * lisp.h (truncate_undo_list): Update decl.
+
+ * alloc.c (undo_outer_limit): New variable.
+ (syms_of_alloc): Defvar it.
+ (Fgarbage_collect): Pass undo_outer_limit to truncate_undo_list.
+
+ * undo.c (truncate_undo_list): New arg LIMITSIZE.
+
+ * alloc.c (lisp_align_malloc): Check for base == 0
+ regardless of HAVE_POSIX_MEMALIGN.
+ Clean up HAVE_POSIX_MEMALIGN handling of `err'.
+
+2004-05-28 Stefan Monnier <[email protected]>
+
+ * alloc.c: Undo Kim's recent changes and fix the same bug differently.
+ (marker_blocks_pending_free): Remove.
+ (Fgarbage_collect): Sweep after cleaning up undo-lists.
+ Mark the undo lists after claning them up.
+ Don't free block in marker_blocks_pending_free.
+ (mark_buffer): Don't mark undo_list.
+ (gc_sweep): Sweep hash-tables and strings first.
+ Do free marker blocks that are empty.
+
+2004-05-28 Jim Blandy <[email protected]>
+
+ * regex.c (print_partial_compiled_pattern): Add missing 'break'
+ after 'case wordend'. For symbeg and symend, print to stderr,
+ like the other cases.
+
+2004-05-28 Noah Friedman <[email protected]>
+
+ * process.c (Fdelete_process): Do not call remove_process.
+
+2004-05-28 Stefan Monnier <[email protected]>
+
+ * alloc.c (struct backtrace): Remove.
+ (Fgarbage_collect): Use the new mark_backtrace.
+
+ * eval.c (mark_backtrace): New function.
+
+ * minibuf.c (run_exit_minibuf_hook): New function.
+ (read_minibuf_unwind): Don't run exit-minibuffer-hook any more.
+ (read_minibuf): Use separate unwind handler to run exit-minibuf-hook.
+
+2004-05-27 Kim F. Storm <[email protected]>
+
+ * xdisp.c (back_to_previous_visible_line_start): Skip backwards
+ over display properties, e.g. images, that replace buffer text.
+
+2004-05-25 Kim F. Storm <[email protected]>
+
+ * alloc.c (marker_blocks_pending_free): New var.
+ (gc_sweep): Store free marker blocks on that list.
+ (Fgarbage_collect): Free them after undo-list cleanup.
+
+ * process.c (wait_reading_process_input): Check connect_wait_mask
+ before actually accepting connection in case it has already been
+ accepted due to recursion.
+
+2004-05-23 K,Aa(Broly L$,1 q(Brentey <[email protected]>
+
+ * coding.c (Fset_safe_terminal_coding_system_internal):
+ Set suppress_error in safe_terminal_coding, not terminal_coding.
+
+2004-05-22 Richard M. Stallman <[email protected]>
+
+ * alloc.c (Fmake_string): Doc fix.
+
+ * buffer.c (clone_per_buffer_values): Copy the alist of local vars,
+ and the alist pairs too.
+
+ * casefiddle.c (casify_object): Return OBJ unchanged if not real char.
+
+ * emacs.c (main): Update copyright year.
+
+ * fileio.c (Fread_file_name): Expand DIR if not absolute.
+
+ * insdel.c (del_range_2, replace_range): Don't write an anchor
+ if the gap is empty.
+
+ * xdisp.c (try_scrolling): If scroll-up-aggressively or
+ scroll-down-aggressively is small but positive, put point
+ near the screen edge.
+
+2004-05-22 Juanma Barranquero <[email protected]>
+
+ * keymap.c (Fdefine_key): Doc fix.
+
+2004-05-22 Kim F. Storm <[email protected]>
+
+ * alloc.c (struct backtrace): Add debug_on_exit member.
+ (Fgarbage_collect): Clear out buffer undo_list markers after gc_sweep.
+ Identify those markers as Lisp_Misc_Free objects. Clear car and cdr of
+ the removed cons cells.
+ (mark_object): Undo previous change - disallow Lisp_Misc_Free objects.
+ (gc_sweep): Clear cons_blocks before sweeping strings, so we don't have
+ any cons cells pointing to unallocated stings.
+ Do not lisp_free any marker blocks, as there may still be pointers
+ to them from buffer undo lists at this stage of GC.
+
+ * keyboard.c (struct backtrace): Add debug_on_exit member.
+ (Fcommand_execute): Clear it.
+
+2004-05-20 Luc Teirlinck <[email protected]>
+
+ * intervals.c (lookup_char_property): Do not prematurely return nil.
+
+2004-05-19 Jim Blandy <[email protected]>
+
+ Add support for new '\_<' and '\_>' regexp operators, matching the
+ beginning and end of symbols.
+
+ * regex.c (enum syntaxcode): Add Ssymbol.
+ (init_syntax_once): Set the syntax for '_' to Ssymbol, not Sword.
+ (re_opcode_t): New opcodes `symbeg' and `symend'.
+ (print_partial_compiled_pattern): Print the new opcodes properly.
+ (regex_compile): Parse the new operators.
+ (analyse_first): Skip sym(beg|end) (they match only the empty string).
+ (mutually_exclusive_p): `symend' is mutually exclusive with \s_ and
+ \sw; `symbeg' is mutually exclusive with \S_ and \Sw.
+ (re_match_2_internal): Match symbeg and symend.
+
+ * search.c (trivial_regexp_p): \_ is no longer a trivial regexp.
+
+2004-05-19 Kim F. Storm <[email protected]>
+
+ * .gdbinit (xsymbol): Fix last change.
+
+2004-05-18 Stefan Monnier <[email protected]>
+
+ * .gdbinit (xprintstr): New fun.
+ (xstring, xprintsym): Use it.
+
+ * w32proc.c (create_child): Use INTMASK.
+
+ * alloc.c (Fgarbage_collect): Do all the marking before flushing
+ unmarked elements of the undo list.
+
+2004-05-18 David Ponce <[email protected]>
+
+ * print.c (print): Reset print_depth before to call print_object.
+
+2004-05-18 Jason Rumney <[email protected]>
+
+ * w32console.c: Prefix RIF functions with w32con_ to avoid
+ namespace clash with functions in term.c and w32term.c.
+
+ * w32menu.c (add_menu_item, w32_menu_display_help)
+ [USE_LISP_UNION_TYPE]: Cast from Lisp_Object using i member.
+
+ * w32term.h (display_x_get_resource, vga_stdcolor_name): Add prototype.
+
+2004-05-18 Eli Zaretskii <[email protected]>
+
+ * lisp.h (DECL_ALIGN): Remove restriction on MS-DOS systems.
+
+ * msdos.c (syms_of_msdos): Initialize dos-unsupported-char-glyph
+ with make_number.
+ (IT_write_glyphs): Extract glyph from dos-unsupported-char-glyph
+ with XINT.
+
+2004-05-18 Kim F. Storm <[email protected]>
+
+ * blockinput.h (INPUT_BLOCKED_P): New macros.
+
+ * keyboard.c (Frecursive_edit): Return immediately if input blocked.
+ (Ftop_level): Unblock input if blocked.
+
+ * buffer.h (GET_OVERLAYS_AT): New macro.
+ * msdos.c (IT_note_mouse_highlight): Use it.
+ * textprop.c (get_char_property_and_overlay): Use it.
+ * xdisp.c (next_overlay_change, note_mouse_highlight): Use it.
+ * xfaces.c (face_at_buffer_position): Use it.
+
+ * print.c (print_object): Increase buf size.
+
+2004-05-17 Jason Rumney <[email protected]>
+
+ * w32fns.c (Fw32_register_hot_key, Fw32_unregister_hot_key)
+ (Fw32_toggle_lock_key) [USE_LISP_UNION_TYPE]: Cast from
+ Lisp_Object using i member.
+ (w32_quit_key): Rename from Vw32_quit_key, and make an int.
+ (syms_of_w32fns, globals_of_w32fns): Use Lisp_Object and int
+ consistently.
+
+ * w32proc.c (create_child): Use make_number instead of masking pid.
+
+ * w32fns.c (w32_color_map_lookup): Return a Lisp_Object.
+ (x_to_w32_charset, w32_to_x_charset, w32_to_all_x_charsets):
+ Use EQ to compare Lisp_Objects.
+ (w32_parse_hot_key): Use int for lisp_modifiers consistently.
+
+ * w32term.c (w32_num_mouse_buttons): Rename from
+ Vw32_num_mouse_buttons and make it an int.
+
+ * w32.c (init_environment): Use it.
+
+ * w32fns.c (w32_wnd_proc): Likewise.
+
+ * w32proc.c (w32_pipe_read_delay): Rename from
+ Vw32_pipe_read_delay and make it an int.
+
+ * w32.c (_sys_read_ahead): Use it.
+
+ * lisp.h (egetenv) [USE_CRT_DLL]: Remove condition.
+
+ * w32proc.c (create_child) [USE_LSB_TAG]: Don't try to mask pid.
+
+ * w32inevt.c (w32_console_mouse_position, do_mouse_event)
+ (key_event): Don't mix Lisp_Object and int.
+
+ * w32heap.c (init_heap) [USE_LSB_TAG]: Don't check heap location.
+
+ * keyboard.c (kbd_buffer_get_event): Don't use event->code and
+ modifiers in language change event.
+
+2004-05-17 Kim F. Storm <[email protected]>
+
+ * alloc.c (mark_object): Ignore Lisp_Misc_Free objects.
+ Such objects may be freed markers which still exist on an undo list.
+
+2004-05-16 Juanma Barranquero <[email protected]>
+
+ * data.c (Fset_default): Make argument names match their use in
+ docstring.
+
+2004-05-15 Andreas Schwab <[email protected]>
+
+ * emacs.c (gdb_array_mark_flag): Define.
+ * .gdbinit: Mask off gdb_array_mark_flag from vector sizes.
+
+2004-05-15 Eli Zaretskii <[email protected]>
+
+ * lisp.h (DECL_ALIGN) [MSDOS]: Don't define DECL_ALIGN to use
+ __attribute__((__aligned__)), so that USE_LSB_TAG would not become
+ defined for the MS-DOS build.
+
+2004-05-14 Stefan Monnier <[email protected]>
+
+ * w32fns.c (Fw32_define_rgb_color): Avoid XSET.
+
+2004-05-14 Kenichi Handa <[email protected]>
+
+ * ccl.c (Fccl_execute_on_string): Fix setting elements of STATUS.
+
+2004-05-14 YAMAMOTO Mitsuharu <[email protected]>
+
+ * lisp.h (Vx_resource_name, Vx_resource_class): Move from xfns.c
+ section to frame.c section.
+ (Fxw_display_color_p, Fx_file_dialog): Declare if
+ HAVE_WINDOW_SYSTEM defined.
+
+ * macfns.c (Fx_create_frame): Fix int/Lisp_Object mixup.
+
+ * macmenu.c (set_frame_menubar): Use NILP to test a lisp value.
+
+ * macterm.c (mac_get_emulated_btn, mac_event_to_emacs_modifiers)
+ (mac_get_mouse_btn): Use NILP and EQ to test/compare lisp values.
+ (XTread_socket): Fix int/Lisp_Object mixup.
+ (mac_check_for_quit_char): Fix pointer/Lisp_Object mixup.
+
+ * macterm.h (struct frame, struct face, struct image)
+ (display_x_get_resource, Fx_display_color_p)
+ (Fx_display_grayscale_p, Fx_display_planes, x_free_gcs):
+ Add prototypes.
+
+2004-05-14 Kim F. Storm <[email protected]>
+
+ * process.c (wait_reading_process_input): Make reentrant.
+ Make Available and Connecting non-static. Save and restore value
+ of waiting_for_user_input_p.
+
+2004-05-13 Kim F. Storm <[email protected]>
+
+ * keyboard.c (mark_kboards): Don't mark x and y members
+ that are overloaded in selection request events.
+
+2004-05-13 Stefan Monnier <[email protected]>
+
+ * lisp.h (USE_LSB_TAG): Make it the default when it is known to work.
+
+2004-05-13 Glenn Morris <[email protected]>
+
+ * window.c (Fdisplay_buffer, Fsplit_window)
+ (split-height-threshold): Doc fix.
+
+2004-05-13 Juanma Barranquero <[email protected]>
+
+ * xfaces.c (Ftty_supports_face_attributes_p)
+ (Finternal_copy_lisp_face): Fix typo in docstring.
+ (Finternal_get_lisp_face_attribute): Fix docstring.
+
+2004-05-12 Jan Dj,Ad(Brv <[email protected]>
+
+ * xfns.c (syms_of_xfns): Provide x-toolkit also for GTK.
+
+2004-05-11 Steven Tamm <[email protected]>
+
+ * macfns.c (Fx_create_frame): Default to using tool-bar by
+ setting tool-bar-lines to 1 in default-frame-alist.
+
+2004-05-11 YAMAMOTO Mitsuharu <[email protected]>
+
+ * image.c (xpm_scan, xpm_make_color_table_v, xpm_put_color_table_v)
+ (xpm_get_color_table_v, xpm_make_color_table_h)
+ (xpm_put_color_table_h, xpm_get_color_table_h)
+ (xpm_str_to_color_key, xpm_load_image, xpm_load)
+ (syms_of_image): Support XPM on Carbon Emacs. Does not
+ depend on libXpm, but only supports XPM version 3 without extensions.
+
+2004-05-11 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.c (x_flush, XTframe_up_to_date): Use FRAME_MAC_P
+ instead of FRAME_X_P.
+
+2004-05-11 Kim F. Storm <[email protected]>
+
+ * process.c (read_process_output): Grow decoding_buf when needed;
+ this could cause a crash in allocate_string and compact_small_strings.
+
+2004-04-29 Jim Blandy <[email protected]>
+
+ * regex.c (mutually_exclusive_p): In 'case wordbeg', compare op2
+ against proper opcode.
+
+2004-05-10 Juanma Barranquero <[email protected]>
+
+ * process.c (Fstart_process): Fix docstring.
+
+ * charset.c (Fget_unused_iso_final_char): Fix typos in docstring.
+ (Fchar_bytes, Fchar_width, Fstring_width, Fchar_direction)
+ (Fsplit_char, Fchar_charset): Make argument names match their use
+ in docstring.
+
+2004-05-10 Richard M. Stallman <[email protected]>
+
+ * print.c (print_preprocess): Use being_printed, loop_count and
+ halftail to detect overdeep nesting and cyclic cdr chains.
+
+2004-05-10 Andreas Schwab <[email protected]>
+
+ * lisp.h (Fmake_symbolic_link): Declare.
+
+ * fileio.c (Frename_file): Remove extra argument in call to
+ Fmake_symbolic_link.
+
+2004-05-10 Kim F. Storm <[email protected]>
+
+ * xdisp.c (calc_line_height_property): Use string position when
+ object is a string.
+
+2004-05-10 Kenichi Handa <[email protected]>
+
+ * print.c (temp_output_buffer_setup): Bind inhibit-read-only and
+ inhibit-modification-hooks to t temporarily before calling
+ Ferase_buffer.
+
+ * xfns.c (x_create_tip_frame): Bind inhibit-read-only and
+ inhibit-modification-hooks to t temporarily before calling
+ Ferase_buffer.
+
+ * w32fns.c (x_create_tip_frame): Bind inhibit-read-only and
+ inhibit-modification-hooks to t temporarily before calling
+ Ferase_buffer.
+
+ * fns.c (count_combining): Delete it.
+ (concat): Don't check combining bytes.
+
+2004-05-09 Jason Rumney <[email protected]>
+
+ * w32fns.c (Vw32_ansi_code_page): New Lisp variable.
+ (globals_of_w32fns): Set it.
+
+2004-05-09 Piet van Oostrum <[email protected]>
+
+ * data.c (Fquo): Simplify.
+
+2004-05-08 Peter Whaite <[email protected]> (tiny change)
+
+ * data.c (Fquo): If any argument is float, do the computation in
+ floating point.
+
+2004-05-08 Juanma Barranquero <[email protected]>
+
+ * process.c (Fwaiting_for_user_input_p, Fmake_network_process)
+ (Fset_process_query_on_exit_flag, Vprocess_adaptive_read_buffering):
+ Fix spelling of Emacs on docstring.
+ (Fset_process_coding_system, Fprocess_coding_system)
+ (Fset_process_filter_multibyte, Fprocess_filter_multibyte_p):
+ Make argument names match their use in docstring.
+ (Fprocess_id, Fprocess_query_on_exit_flag, Finterrupt_process):
+ Fix docstring.
+
+ * editfns.c (Finsert_buffer_substring): Make argument names match their
+ use in docstring.
+
+ * syntax.c (Fmodify_syntax_entry): Fix docstring.
+
+2004-05-07 Steven Tamm <[email protected]>
+
+ * macterm.c (mac_check_for_quit_char): Adding BLOCK_INPUT
+ around call to ReceiveEvent to avoid certain crashes.
+
+2004-05-07 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.c (mac_draw_line_to_pixmap, XCreatePixmapFromBitmapData)
+ (mac_fill_rectangle_to_pixmap, mac_draw_rectangle_to_pixmap)
+ (mac_copy_area_to_pixmap, mac_copy_area_with_mask_to_pixmap):
+ Save/restore the current graphics port and device handle when
+ drawing into an offscreen graphics world.
+
+ * image.c [MAC_OS] (XPutPixel, XGetPixel, image_load_qt_1)
+ (gif_load): Likewise.
+
+2004-05-07 Juanma Barranquero <[email protected]>
+
+ * window.c (Fset_window_buffer): Fix docstring.
+
+2004-05-06 Thien-Thi Nguyen <[email protected]>
+
+ * emacs.c (main) [VMS]: Fix var ref.
+
+2004-05-06 Romain Francoise <[email protected]>
+
+ * data.c (Fsetq_default): Fix docstring.
+
+2004-05-06 Jason Rumney <[email protected]>
+
+ * image.c (Display) [HAVE_NTGUI]: Redefine while loading xpm.h
+ to avoid name clash.
+
+2004-05-04 Jan Dj,Ad(Brv <[email protected]>
+
+ * fileio.c (barf_or_query_if_file_exists): Use lstat.
+ (Frename_file): Handle renaming of symlinks across file systems.
+ (Frename_file): Put symlink handling inside #ifdef S_IFLNK.
+
+2004-05-04 Kim F. Storm <[email protected]>
+
+ * xdisp.c (Qtotal): New var.
+ (syms_of_xdisp): Intern and staticpro it.
+ (calc_line_height_property): New arg total. Set it if
+ line-spacing property has format (total . VALUE).
+ (x_produce_glyphs): Ignore line-spacing if line-height is 0.
+ Handle total line-spacing property.
+
+2004-05-03 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c (xg_update_scrollbar_pos): Call XClearWindow to clear
+ "under" scroll bar when size/position changes.
+
+2004-05-03 Jason Rumney <[email protected]>
+
+ * makefile.nt: Remove.
+
+2004-05-02 Eli Zaretskii <[email protected]>
+
+ * syntax.h (SET_RAW_SYNTAX_ENTRY, SYNTAX_ENTRY_INT):
+ Avoid compiler warnings.
+
+ * Makefile.in (region-cache.o): Depend on config.h.
+
+2004-05-02 Romain Francoise <[email protected]>
+
+ * indent.c (compute_motion): Save vpos in prev_vpos when dealing
+ with continuation lines, too.
+
+2004-05-02 Thien-Thi Nguyen <[email protected]>
+
+ * syssignal.h (init_signals): Move decl outside `#ifdef POSIX_SIGNALS'.
+
+2004-05-01 Stefan Monnier <[email protected]>
+
+ * xdisp.c (calc_line_height_property): YAILOM (yet another
+ int/Lisp_Object mixup).
+
+2004-05-01 Eli Zaretskii <[email protected]>
+
+ * msdos.c (top-level): Add "#pragma pack(0)" after <dir.h>, to
+ undo bad effect of pack(4) in some versions of system headers.
+
+2004-05-01 Jason Rumney <[email protected]>
+
+ * w32term.c (x_draw_hollow_cursor): Sync with xterm.c.
+
+2004-04-30 Kim F. Storm <[email protected]>
+
+ * buffer.c (syms_of_buffer) <line-spacing>: Allow float value.
+ (syms_of_buffer) <cursor-type>: Doc fix.
+
+ * dispextern.h (struct it): Remove member use_default_face.
+ Add members override_ascent, override_descent, override_boff.
+
+ * xdisp.c (init_iterator): Handle line-spacing float value.
+ Initialize override_ascent member.
+ (append_space_for_newline): Reset override_ascent.
+ Remove use_default_face.
+ (calc_line_height_property): New function to calculate value of
+ line-height and line-spacing properties. Look at overlays, too.
+ Set override_ascent, override_descent, override_boff members when
+ using another face than the current face. Float values are now
+ relative to the frame default font, by default; accept a cons
+ of ratio and face name to specify value relative to a specific face.
+ (x_produce_glyphs): Use calc_line_height_property.
+ Use override_ascent etc. when set to handle different face heights.
+ A negative line-spacing property value is interpreted as a total
+ line height, rather than inter-line spacing.
+ (note_mouse_highlight): Allocate room for 40 overlays initially.
+
+2004-04-29 Stefan Monnier <[email protected]>
+
+ * data.c (Fsubr_name): New fun.
+ (syms_of_data): Defsubr it.
+
+2004-04-29 Kim F. Storm <[email protected]>
+
+ * xdisp.c (null_glyph_slice): New var.
+ (append_glyph, append_composite_glyph, append_stretch_glyph):
+ Use it to initialize glyph slice.
+
+2004-04-27 Stefan Monnier <[email protected]>
+
+ * xdisp.c (x_produce_glyphs): Fix the proverbial int/Lisp_Object mixup.
+ (on_hot_spot_p): Make sure we always return a value.
+ (Flookup_image_map): Remove unused var ix and iy.
+ (note_mode_line_or_margin_highlight): Remove unused var `image'.
+
+2004-04-27 Eli Zaretskii <[email protected]>
+
+ * msdos.c (init_environment): If one of the TMP... environment
+ variables is set to a drive letter without a trailing slash,
+ append a slash.
+
+2004-04-27 Matthew Mundell <[email protected]>
+
+ * editfns.c (lisp_time_argument): Provide externally.
+
+ * fileio.c (Fset_file_times): New function.
+ (syms_of_fileio): Intern and staticpro it.
+
+2004-04-27 Kim F. Storm <[email protected]>
+
+ * xdisp.c (x_produce_glyphs): Fix last change; handle newline in
+ header line strings.
+
+ * dispextern.h (struct it): New member use_default_face.
+
+ * xdisp.c (Qline_height): New variable.
+ (syms_of_xdisp): Intern and staticpro it.
+ (append_space_for_newline): Partially undo 2004-04-25 change;
+ add default_face_p arg, and restore callers.
+ Clear it->use_default_face after use.
+ (x_produce_glyphs): Set default font for ascii char if
+ it->use_default_font is set. Change line-spacing property to set
+ just extra line spacing. Handle new line-height property.
+
+2004-04-26 Andreas Schwab <[email protected]>
+
+ * print.c (print_object): Print non-ascii characters in bool
+ vector representation as octal escapes.
+
+ * lisp.h (BOOL_VECTOR_BITS_PER_CHAR): Define.
+ * print.c (print_object): Use it instead of BITS_PER_CHAR for
+ bool vectors.
+ * lread.c (read1): Likewise.
+ * alloc.c (Fmake_bool_vector): Likewise.
+ * data.c (Faref, Faset): Likewise.
+ * fns.c (Fcopy_sequence, concat, internal_equal, Ffillarray)
+ (mapcar1): Likewise.
+
+2004-04-26 Steven Tamm <[email protected]>
+
+ * lread.c (init_lread): Fix typo in HAVE_CARBON test logic.
+
+2004-04-26 Miles Bader <[email protected]>
+
+ * lisp.h (CYCLE_CHECK): Macro moved from xfaces.c.
+
+2004-04-26 Juanma Barranquero <[email protected]>
+
+ * buffer.c (Fpop_to_buffer): Fix docstring.
+
+2004-04-26 Steven Tamm <[email protected]>
+
+ * lread.c (init_lread): Don't display missing lisp directory
+ warnings with Carbon Emacs because self-contained bundled Emacs
+ may be built without correct installation path.
+
+2004-04-25 Kim F. Storm <[email protected]>
+
+ * macterm.c (x_draw_hollow_cursor): Fix height of box for narrow lines.
+
+ * xterm.c (x_draw_hollow_cursor): Fix height of box for narrow lines.
+
+ * xdisp.c (append_space_for_newline): Rename from append_space.
+ Remove DEFAULT_FACE_P arg; always use current face. Callers changed.
+ (x_produce_glyphs): Handle line-spacing property on newline char.
+ If value is t, adjust ascent and descent to fit current row height.
+ If value is an integer or float, set extra_line_spacing to integer
+ value, or to float value x current line height.
+
+2004-04-23 Kenichi Handa <[email protected]>
+
+ * fontset.c (Finternal_char_font): If POSITION is nil, return
+ font for displaying CH with the default face.
+
+2004-04-23 Juanma Barranquero <[email protected]>
+
+ * makefile.w32-in: Add "-*- makefile -*-" mode tag.
+
+2004-04-21 Stefan Monnier <[email protected]>
+
+ * lisp.h (XINT) [EXPLICIT_SIGN_EXTEND && !NO_UNION_TYPE]:
+ Don't make assumptions about the relative place of i and val.
+ (EQ) [!NO_UNION_TYPE]: Don't forget to check the type match as well.
+
+2004-04-21 Kim F. Storm <[email protected]>
+
+ * dispextern.h (struct glyph_slice): New struct.
+ (struct glyph): New member slice.
+ (GLYPH_SLICE_EQUAL_P): New macro.
+ (GLYPH_EQUAL_P): Use it.
+ (struct glyph_string): New member slice.
+ (struct it_slice): New struct.
+ (struct it): New member slice, add member to stack too.
+ New member constrain_row_ascent_descent_p.
+ (image_ascent): Add prototype.
+
+ * dispnew.c (buffer_posn_from_coords): Return full image width
+ and height even for image slices (posn is relative to full image).
+ (marginal_area_string): Adjust x0,y0 for image slice.
+
+ * image.c (image_ascent): Add slice arg; calculate ascent for
+ image slice (or full image).
+
+ * keyboard.c (Fposn_at_x_y, Fposn_at_point): New defuns.
+ (syms_of_keyboard): Defsubr them.
+
+ * lisp.h (pos_visible_p): Fix prototype.
+
+ * macterm.c (x_draw_relief_rect): Add top_p and bot_p args.
+ (x_draw_glyph_string_box): Fix call to x_draw_relief_rect.
+ (x_draw_image_foreground, x_draw_image_relief)
+ (x_draw_image_foreground_1, x_draw_image_glyph_string):
+ Draw sliced images.
+
+ * w32term.c (w32_draw_relief_rect): Add top_p and bot_p args.
+ (x_draw_glyph_string_box): Fix call to x_draw_relief_rect.
+ (x_draw_image_foreground, x_draw_image_relief)
+ (w32_draw_image_foreground_1, x_draw_image_glyph_string):
+ Draw sliced images.
+
+ * w32term.h (image_ascent): Remove prototype.
+
+ * window.c (Fpos_visible_in_window_p): Return pixel position if
+ PARTIALLY arg is non-nil. Simplify. Doc fix.
+ (Fwindow_vscroll, Fset_window_vscroll): Add optional PIXEL_P arg
+ to return/set vscroll in pixels.
+
+ * window.h (Fwindow_vscroll, Fset_window_vscroll): Fix EXFUN.
+
+ * xdisp.c (Qslice): New variable.
+ (syms_of_xdisp): Intern and staticpro it.
+ (pos_visible_p): Return pixel position in new x and y args.
+ (init_iterator): Reset it->slice info.
+ (handle_display_prop): Parse (slice ...) property.
+ (push_it, pop_it): Save/restore slice info.
+ (make_cursor_line_fully_visible): Fix 2004-04-14 change. Do not
+ force repositioning of tall row if window is vscrolled, as that
+ would reset vscroll.
+ (append_space): Set it->constrain_row_ascent_descent_p to avoid
+ increasing row height if row is non-empty.
+ (fill_image_glyph_string): Copy slice info.
+ (take_vertical_position_into_account): Simplify.
+ (produce_image_glyph): Handle iterator slice info, setup glyph
+ slice info. Do not force minimum line height.
+ (x_produce_glyphs): If it->constrain_row_ascent_descent_p is set,
+ do not increase height (ascent/descent) of non-empty row when
+ adding normal character glyph; instead reduce glyph ascent/descent
+ appropriately; if row is higher than current glyph, adjust glyph
+ descent/ascent to reposition glyph within the existing row.
+ Likewise, when char is newline, only set ascent/descent if row is
+ currently empty.
+ (note_mouse_highlight): Handle hotspots with sliced image.
+
+ * xterm.c (x_draw_relief_rect): Add top_p and bot_p args.
+ (x_draw_glyph_string_box): Fix call to x_draw_relief_rect.
+ (x_draw_image_foreground, x_draw_image_relief)
+ (x_draw_image_foreground_1, x_draw_image_glyph_string):
+ Draw sliced images.
+
+ * xterm.h (image_ascent): Remove prototype.
+
+2004-04-20 Stefan Monnier <[email protected]>
+
+ * keymap.c (Fkey_description): Fix the usual int/Lisp_Object mixup.
+
+2004-04-20 John Paul Wallington <[email protected]>
+
+ * fns.c (Fassoc, Feql): Fix indentation.
+
+ * fontset.c (regularize_fontname): Rename from regulalize_fontname.
+
+2004-04-19 John Paul Wallington <[email protected]>
+
+ * fns.c (Feql): New function.
+ (syms_of_fns): Defsubr it.
+
+2004-04-18 Jason Rumney <[email protected]>
+
+ * w32select.c (Fw32_set_clipboard_data): Get sequence number
+ after closing the clipboard.
+
+2004-04-16 Luc Teirlinck <[email protected]>
+
+ * buffer.c (Fbuffer_base_buffer): Doc fix.
+
+2004-04-17 Kim F. Storm <[email protected]>
+
+ * keymap.c (Fkey_description): Add optional PREFIX arg.
+ Combine prefix with KEYS to make up the full key sequence to describe.
+ Correlate meta_prefix_char and following (simple) key to describe
+ as meta modifier. All callers changed.
+ (describe_map): Rename arg `keys' to `prefix'. Remove local
+ `elt_prefix' var. Use Fkey_description with prefix instead of
+ elt_prefix combined with Fsingle_key_description.
+ (describe_vector): Declare static. Replace arg `elt_prefix' with
+ `prefix'. Add KEYMAP_P arg. Add local var `elt_prefix'; use it
+ if !KEYMAP_P. Use Fkey_description with prefix instead of
+ Fsingle_key_description.
+
+ * keymap.h (Fkey_description): Fix prototype.
+ (describe_vector): Remove prototype.
+
+ * xdisp.c (update_overlay_arrows): Fix handling of up_to_date < 0.
+
+ * image.c (PNG_BG_COLOR_SHIFT): Remove.
+ (png_load): Fix calculation of transparent background color on X
+ and W32 platforms.
+
+2004-04-16 Juanma Barranquero <[email protected]>
+
+ * xdisp.c (try_scrolling): Make sure `scroll-conservatively' is
+ not too large before computing how much to scroll.
+
+2004-04-15 Stefan Monnier <[email protected]>
+
+ * dired.c (Ffile_attributes): Don't pass extra nil arg to file-handler.
+
+2004-04-14 Luc Teirlinck <[email protected]>
+
+ * fileio.c (Fverify_visited_file_modtime, Fvisited_file_modtime):
+ Add hyperlink to Elisp manual to the docstring.
+
+2004-04-14 Stefan Monnier <[email protected]>
+
+ * callint.c (fix_command): Use XDCR.
+
+2004-04-14 Nick Roberts <[email protected]>
+
+ * window.c (Fget_lru_window): Doc fix.
+
+2004-04-14 Kim F. Storm <[email protected]>
+
+ * editfns.c (Fformat): Fix allocation size of precision array.
+
+ * dispnew.c (update_window): Only set changed_p if
+ scrolling_window actually did scroll.
+ (scrolling_window): Only return 1 if we actually did scroll.
+
+ * xdisp.c (get_glyph_string_clip_rect): Fix reduction of cursor
+ height to glyph height when cursor row is not fully visible.
+ (make_cursor_line_fully_visible): Add FORCE_P arg to return
+ failure in case row is higher than window. Callers changed.
+ (try_scrolling): Fix loop in scrolling if last_line_misfit (from Gerd).
+ Try to scroll partially visible, higher-than-window cursor row.
+ (redisplay_window): Always try to scroll partially visible,
+ higher-than-window cursor row - both initially and again with
+ centering_position = 0.
+ Clear desired matrix before retrying with centering_position = 0.
+
+2004-04-13 Stefan Monnier <[email protected]>
+
+ * syntax.c (scan_lists): Simplify backward string scan.
+ Fix off-by-one boundary check for string and comment fences.
+
+2004-04-13 Joe Buehler <[email protected]>
+
+ * sheap.c, unexcw.c: New files.
+
+2004-04-12 Luc Teirlinck <[email protected]>
+
+ * buffer.c (Fmake_indirect_buffer): Throw an error if the intended
+ base buffer has been killed. Correct the error message if the
+ base buffer does not exist.
+
+2004-04-12 Joe Buehler <[email protected]>
+
+ * s/cygwin.h: Changes for Cygwin unexec() support, changes in
+ Cygwin itself. Add support for Xaw3d scrollbars.
+
+ * puresize.h: Set up PURE_P() for Cygwin unexec() support.
+
+ * lastfile.c: Define my_endbss[] for Cygwin unexec() support.
+
+ * gmalloc.c (__default_morecore): Use bss_sbrk(), not __sbrk(),
+ before Cygwin unexec.
+
+ * Makefile.in: Link changes for Cygwin unexec() support.
+
+2004-04-12 Andreas Schwab <[email protected]>
+
+ * buffer.c (Fmake_indirect_buffer): Check that NAME is a string.
+
+2004-04-11 Luc Teirlinck <[email protected]>
+
+ * buffer.c (Fgenerate_new_buffer_name): Return NAME argument if
+ IGNORE argument equals NAME. Doc fix.
+
+2004-04-11 Masatake YAMATO <[email protected]>
+
+ * buffer.c (fix_start_end_in_overlays): Make overlays
+ empty if they are backwards.
+
+2004-04-09 Stefan Monnier <[email protected]>
+
+ * xfaces.c (face_color_supported_p): Fix compilation without X11.
+
+2004-04-07 Stefan Monnier <[email protected]>
+
+ * doc.c (Fsnarf_documentation): Ignore new file name entries.
+
+2004-04-06 Kim F. Storm <[email protected]>
+
+ * msdos.c (clear_mouse_face): Only clear mouse highlight if not hidden.
+ (dos_rawgetc): Set mouse_face_hidden after clearing highlight.
+
+ * w32term.c (w32_read_socket): Set mouse_face_hidden after
+ clearing highlight.
+
+ * xdisp.c (clear_mouse_face): Only clear mouse highlight if not hidden.
+
+ * xterm.c (handle_one_xevent): Set mouse_face_hidden after
+ clearing highlight.
+
+ * indent.c (vmotion): Do not reserve one column for continuation
+ marks on window frames.
+
+2004-04-04 Eli Zaretskii <[email protected]>
+
+ * charset.h (SINGLE_BYTE_CHAR_P): Fix macro to avoid warnings
+ from GCC.
+
+2004-04-03 Stefan Monnier <[email protected]>
+
+ * .gdbinit-union: Remove.
+
+ * .gdbinit: Make it work for USE_LSB_TAG and !NO_LISP_UNION.
+ (xgetptr, xgetint, xgettype): New funs. Use them everywhere.
+ ($nonvalbits): Remove.
+ ($valmask): Set it by calling xreload to avoid redundancy.
+
+ * emacs.c (gdb_use_union, gdb_use_lsb): New vars.
+ (gdb_emacs_intbits): Remove.
+
+2004-03-31 Jan Dj,Ad(Brv <[email protected]>
+
+ * data.c (Fbyteorder): Make test work even if unsigned is not 4 bytes.
+
+2004-03-30 Kenichi Handa <[email protected]>
+
+ * editfns.c (Fformat): Fix initialization of the array info.
+
+2004-03-30 Kim F. Storm <[email protected]>
+
+ * xterm.c (x_mouse_click_focus_ignore_position): New var.
+ (syms_of_xterm): DEFVAR_BOOL it.
+ (ignore_next_mouse_click_timeout): New var.
+ (handle_one_xevent): Clear it on KeyPress, set it on EnterNotify.
+ Use it to filter mouse clicks following focus event.
+
+2004-03-29 David Ponce <[email protected]>
+
+ * callint.c (Fcall_interactively): Fix last change.
+
+2004-03-28 Stefan Monnier <[email protected]>
+
+ * eval.c (Fcommandp): Simplify.
+
+ * data.c (Finteractive_form): Rename from Fsubr_interactive_form.
+ Extend to handle all kinds of functions.
+
+ * lisp.h (Finteractive_form): Declare.
+
+ * callint.c (Fcall_interactively): Use it.
+
+2004-03-26 Kim F. Storm <[email protected]>
+
+ * xdisp.c (syms_of_xdisp): Include `void-variable' in list_of_error
+ to catch errors in calc_pixel_width_or_height during redisplay.
+
+2004-03-26 Masatake YAMATO <[email protected]>
+
+ * buffer.c (fix_start_end_in_overlays): Rename fix_overlays_in_range.
+
+ * lisp.h (fix_start_end_in_overlays): Likewise.
+
+ * insdel.c (adjust_markers_for_insert): Call fix_start_end_in_overlays.
+
+ * editfns.c (Ftranspose_regions): Likewise.
+
+2004-03-20 Jan Dj,Ad(Brv <[email protected]>
+
+ * xterm.c (handle_one_xevent): Do not pass key press events to GTK.
+
+2004-03-19 Richard M. Stallman <[email protected]>
+
+ * s/sol2-6.h: Delete previous change.
+
+2004-03-19 Kim F. Storm <[email protected]>
+
+ * xdisp.c (move_it_in_display_line_to): Fix MOVE_TO_POS case when
+ to_charpos corresponds to newline in right fringe. Use local
+ BUFFER_POS_REACHED_P macro.
+
+2004-03-19 Jan Dj,Ad(Brv <[email protected]>
+
+ * xdisp.c (calc_pixel_width_or_height): Add ifdef HAVE_WINDOW_SYSTEM
+ to compile on non-window system.
+
+2004-03-19 Kim F. Storm <[email protected]>
+
+ * dispextern.h (calc_pixel_width_or_height): Add prototype.
+
+ * image.c (Qcenter): Move to xdisp.c.
+
+ * xdisp.c (Qcenter): Declare here.
+ (syms_of_xdisp): Intern and staticpro it.
+ (handle_single_display_prop): Allow space display property on all
+ platforms.
+ (display_mode_line): Set mode_line_p before displaying line.
+ (calc_pixel_width_or_height): Declare extern. Add separate :align-to
+ handling. Remove complex cases for fringes and scroll-bars.
+ Add left, right, and center alignment positions. Add text (area)
+ width/height. Return width or height for image specs.
+ (produce_stretch_glyph): Improve handling of :align-to. Is now
+ relative to left of text area by default, but other base offsets
+ can be specified -- also for text lines.
+
+ * term.c (produce_glyphs): Handle IT_STRETCH.
+ (produce_stretch_glyph): New function to handle space width and
+ align-to display properties on non-window systems.
+
+2004-03-17 Stefan Monnier <[email protected]>
+
+ * fileio.c (Fread_file_name): Set completion-ignore-case for
+ case-insensitive systems.
+
+2004-03-14 Masatake YAMATO <[email protected]>
+
+ * xdisp.c (note_mode_line_or_margin_highlight): Accept HEADER_LINE
+ when keymap and cursor are setup.
+
+2004-03-14 Steven Tamm <[email protected]>
+
+ * Makefile.in (XMENU_OBJ) [HAVE_CARBON]: Do not include xmenu.o.
+
+2004-03-14 Kim F. Storm <[email protected]>
+
+ * dispextern.h (x_find_image_file): Add prototype.
+
+ * image.c (x_find_image_file): Make extern.
+
+ * xfns.c (x_find_image_file): Remove prototype.
+
+2004-03-13 Eli Zaretskii <[email protected]>
+
+ * Makefile.in (XMENU_OBJ): Include xmenu.o if HAVE_MENUS is defined.
+
+ * emacs.c (main): Call syms_of_xmenu only if HAVE_MENUS is defined.
+
+2004-03-12 Richard M. Stallman <[email protected]>
+
+ * fns.c (internal_equal): New arg PROPS controls comparing
+ text properties. All callers changed.
+ (Fequal_including_properties): New function.
+ (syms_of_fns): defsubr it.
+
+2004-03-12 Kim F. Storm <[email protected]>
+
+ Fix image support on MAC. From YAMAMOTO Mitsuharu.
+
+ * dispextern.h (XImagePtr, XImagePtr_or_DC): Add typedefs.
+ (image_background, image_background_transparent): Fix prototypes.
+
+ * image.c (XImagePtr, XImagePtr_or_DC): Move typedefs to dispextern.h.
+
+ * macfns.c (x_list_fonts, x_get_font_info, x_load_font)
+ (x_query_font, x_find_ccl_program, x_set_window_size)
+ (x_make_frame_visible, mac_initialize, XCreatePixmap)
+ (XCreatePixmapFromBitmapData, XFreePixmap, XSetForeground)
+ (mac_draw_line_to_pixmap): Move prototypes to macterm.h.
+
+ * macterm.h (x_list_fonts, x_get_font_info, x_load_font)
+ (x_query_font, x_find_ccl_program, x_set_window_size)
+ (x_make_frame_visible, mac_initialize, XCreatePixmap)
+ (XCreatePixmapFromBitmapData, XFreePixmap, XSetForeground)
+ (mac_draw_line_to_pixmap): Add prototypes.
+
+2004-03-12 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.c (XTread_socket): Fix mouse click on tool bar.
+
+2004-03-11 Kim F. Storm <[email protected]>
+
+ * dispextern.h: Move image related prototypes from xfns.c section
+ to image.c. Condition them by HAVE_WINDOW_SYSTEM rather than
+ HAVE_X_WINDOWS.
+
+ * Makefile.in (XOBJ): Consolidate into one list. Add image.o.
+ Move gtkutil.o to new GTK_OBJ list.
+ (XMENU_OBJ) [HAVE_MENUS]: Move declaration to proper place.
+ (GTK_OBJ) [USE_GTK]: New declaration.
+ (obj): Add $(GTK_OBJ) to list.
+
+2004-03-11 Steven Tamm <[email protected]>
+
+ * image.c [MAC_OSX]: Include sys/stat.h.
+
+ * macfns.c (syms_of_macfns): Remove definitions of things now
+ defined in image.c.
+
+2004-03-11 Kim F. Storm <[email protected]>
+
+ The following changes consolidates the identical/similar image
+ support code previously found in xfns.c, w32fns.c, and macfns.c
+ into a new file image.c.
+
+ * makefile.w32-in (OBJ1): Add image.o.
+ ($(BLD)/image.$(O)): Add dependencies.
+
+ * Makefile.in (XOBJ, MAC_OBJ): Add image.o.
+ (image.o): Add dependencies.
+
+ * image.c: New file with consolidated image support code.
+ (COLOR_TABLE_SUPPORT): New define to control whether
+ color table support is available (X only).
+ (Bitmap_Record): Common name for x_bitmap_record,
+ w32_bitmap_record, and mac_bitmap_record.
+ (XImagePtr): Common name for pointer to XImage or equivalent.
+ (XImagePtr_or_DC): New type to simplify code sharing; equivalent
+ to XImagePtr on X+MAC, and to HDC on W32.
+ (GET_PIXEL): Wrapper for XGetPixel or equivalent.
+ (NO_PIXMAP): Common name for "None" or equivalent.
+ (PNG_BG_COLOR_SHIFT): Bits to shift PNG background colors.
+ (RGB_PIXEL_COLOR): Common type for an integer "pixel color" value.
+ (PIX_MASK_RETAIN, PIX_MASK_DRAW): Portability macros (from macfns.c).
+ (FRAME_X_VISUAL, x_defined_color, DefaultDepthOfScreen):
+ Define with suitable equivalents on W32 and MAC for code sharing.
+ (XDrawLine): Define on MAC for code sharing.
+ (Destroy_Image, Free_Pixmap): Wrappers for code sharing.
+ (IF_LIB_AVAILABLE): Macro to simplify code sharing.
+ (Vx_bitmap_file_path, Vimage_cache_eviction_delay)
+ (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
+ (x_reference_bitmap, x_create_bitmap_from_data)
+ (x_create_bitmap_from_file, x_destroy_bitmap)
+ (x_destroy_all_bitmaps, x_create_bitmap_mask)
+ (XGetImage, XPutPixel, XGetPixel, XDestroyImage)
+ (QCascent, QCmargin, QCrelief, QCconversion, QCcolor_symbols)
+ (QCheuristic_mask, QCindex, QCmatrix, QCcolor_adjustment, QCmask)
+ (Qlaplace, Qemboss, Qedge_detection, Qheuristic, Qcenter)
+ (define_image_type, lookup_image_type, valid_image_p)
+ (image_error, enum image_value_type, struct image_keyword)
+ (parse_image_spec, image_spec_value, Fimage_size, Fimage_mask_p)
+ (make_image, free_image, prepare_image_for_display, image_ascent)
+ (four_corners_best, image_background, image_background_transparent)
+ (x_clear_image_1, x_clear_image, x_alloc_image_color)
+ (make_image_cache, free_image_cache, clear_image_cache)
+ (Fclear_image_cache, postprocess_image, lookup_image, cache_image)
+ (forall_images_in_image_cache, x_create_x_image_and_pixmap)
+ (x_destroy_x_image, x_put_x_image, x_find_image_file, slurp_file)
+ (find_image_fsspec, image_load_qt_1, image_load_quicktime)
+ (init_image_func_pointer, image_load_quartz2d)
+ (struct ct_color, init_color_table, free_color_table)
+ (lookup_rgb_color, lookup_pixel_color, colors_in_color_table)
+ (cross_disabled_images, x_to_xcolors, x_from_xcolors)
+ (x_detect_edges, x_emboss, x_laplace, x_edge_detection)
+ (x_disable_image, x_build_heuristic_mask)
+ (XBM support, XPM support, PBM support, PNG support, JPEG support)
+ (TIFF support, GIF support, Ghostscript support): Consolidate image
+ code from xfns.c, w32fns.c, and macfns.c.
+ (syms_of_image): Consolidate image related symbol setup here.
+ (init_image): Consolidate image related initializations here.
+
+ * emacs.c (main) [HAVE_WINDOW_SYSTEM]: Add calls to syms_of_image
+ and init_image. Remove call to init_xfns.
+
+ * macterm.h (struct mac_bitmap_record): Add file member.
+ Not currently used, but simplifies code sharing.
+
+ * macfns.c (Vx_bitmap_file_path, Vimage_cache_eviction_delay)
+ (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
+ (x_reference_bitmap, x_create_bitmap_from_data)
+ (x_create_bitmap_from_file, x_destroy_bitmap)
+ (x_destroy_all_bitmaps, x_create_bitmap_mask)
+ (XGetImage, XPutPixel, XGetPixel, XDestroyImage)
+ (QCascent, QCmargin, QCrelief, QCconversion, QCcolor_symbols)
+ (QCheuristic_mask, QCindex, QCmatrix, QCcolor_adjustment, QCmask)
+ (Qlaplace, Qemboss, Qedge_detection, Qheuristic, Qcenter)
+ (define_image_type, lookup_image_type, valid_image_p)
+ (image_error, enum image_value_type, struct image_keyword)
+ (parse_image_spec, image_spec_value, Fimage_size, Fimage_mask_p)
+ (make_image, free_image, prepare_image_for_display, image_ascent)
+ (four_corners_best, image_background, image_background_transparent)
+ (x_clear_image_1, x_clear_image, x_alloc_image_color)
+ (make_image_cache, free_image_cache, clear_image_cache)
+ (Fclear_image_cache, postprocess_image, lookup_image, cache_image)
+ (forall_images_in_image_cache, x_create_x_image_and_pixmap)
+ (x_destroy_x_image, x_put_x_image, x_find_image_file, slurp_file)
+ (find_image_fsspec, image_load_qt_1, image_load_quicktime)
+ (init_image_func_pointer, image_load_quartz2d)
+ (struct ct_color, init_color_table, free_color_table)
+ (lookup_rgb_color, lookup_pixel_color, colors_in_color_table)
+ (cross_disabled_images, x_to_xcolors, x_from_xcolors)
+ (x_detect_edges, x_emboss, x_laplace, x_edge_detection)
+ (x_disable_image, x_build_heuristic_mask)
+ (XBM support, XPM support, PBM support, PNG support, JPEG support)
+ (TIFF support, GIF support, Ghostscript support): Merge with image
+ code from xfns.c and macfns.c into image.c.
+ (syms_of_xfns): Move image related symbols to image.c.
+ (init_external_image_libraries, init_xfns): Remove; initialization
+ moved to init_image in image.c.
+
+ * w32fns.c (Vx_bitmap_file_path, Vimage_cache_eviction_delay)
+ (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
+ (x_reference_bitmap, x_create_bitmap_from_data)
+ (x_create_bitmap_from_file, x_destroy_bitmap)
+ (x_destroy_all_bitmaps, x_create_bitmap_mask)
+ (QCascent, QCmargin, QCrelief, QCconversion, QCcolor_symbols)
+ (QCheuristic_mask, QCindex, QCmatrix, QCcolor_adjustment, QCmask)
+ (Qlaplace, Qemboss, Qedge_detection, Qheuristic, Qcenter)
+ (define_image_type, lookup_image_type, valid_image_p)
+ (image_error, enum image_value_type, struct image_keyword)
+ (parse_image_spec, image_spec_value, Fimage_size, Fimage_mask_p)
+ (make_image, free_image, prepare_image_for_display, image_ascent)
+ (four_corners_best, image_background, image_background_transparent)
+ (x_clear_image_1, x_clear_image, x_alloc_image_color)
+ (make_image_cache, free_image_cache, clear_image_cache)
+ (Fclear_image_cache, postprocess_image, lookup_image, cache_image)
+ (forall_images_in_image_cache, x_create_x_image_and_pixmap)
+ (x_destroy_x_image, x_put_x_image, x_find_image_file, slurp_file)
+ (struct ct_color, init_color_table, free_color_table)
+ (lookup_rgb_color, lookup_pixel_color, colors_in_color_table)
+ (cross_disabled_images, x_to_xcolors, x_from_xcolors)
+ (x_detect_edges, x_emboss, x_laplace, x_edge_detection)
+ (x_disable_image, x_build_heuristic_mask)
+ (XBM support, XPM support, PBM support, PNG support, JPEG support)
+ (TIFF support, GIF support, Ghostscript support): Merge with image
+ code from xfns.c and macfns.c into image.c.
+ (syms_of_xfns): Move image related symbols to image.c.
+ (init_external_image_libraries, init_xfns): Remove; initialization
+ moved to init_image in image.c.
+
+ * xfns.c (Vx_bitmap_file_path, Vimage_cache_eviction_delay)
+ (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
+ (x_reference_bitmap, x_create_bitmap_from_data)
+ (x_create_bitmap_from_file, x_destroy_bitmap)
+ (x_destroy_all_bitmaps, x_create_bitmap_mask)
+ (QCascent, QCmargin, QCrelief, QCconversion, QCcolor_symbols)
+ (QCheuristic_mask, QCindex, QCmatrix, QCcolor_adjustment, QCmask)
+ (Qlaplace, Qemboss, Qedge_detection, Qheuristic, Qcenter)
+ (define_image_type, lookup_image_type, valid_image_p)
+ (image_error, enum image_value_type, struct image_keyword)
+ (parse_image_spec, image_spec_value, Fimage_size, Fimage_mask_p)
+ (make_image, free_image, prepare_image_for_display, image_ascent)
+ (four_corners_best, image_background, image_background_transparent)
+ (x_clear_image_1, x_clear_image, x_alloc_image_color)
+ (make_image_cache, free_image_cache, clear_image_cache)
+ (Fclear_image_cache, postprocess_image, lookup_image, cache_image)
+ (forall_images_in_image_cache, x_create_x_image_and_pixmap)
+ (x_destroy_x_image, x_put_x_image, x_find_image_file, slurp_file)
+ (struct ct_color, init_color_table, free_color_table)
+ (lookup_rgb_color, lookup_pixel_color, colors_in_color_table)
+ (cross_disabled_images, x_to_xcolors, x_from_xcolors)
+ (x_detect_edges, x_emboss, x_laplace, x_edge_detection)
+ (x_disable_image, x_build_heuristic_mask)
+ (XBM support, XPM support, PBM support, PNG support, JPEG support)
+ (TIFF support, GIF support, Ghostscript support): Merge with
+ w32fns.c and macfns.c image code into image.c.
+ (syms_of_xfns): Move image related symbols to image.c.
+ (init_xfns): Remove; initialization moved to init_image in image.c.
+
+ * lisp.h (syms_of_image, init_image): Add protoypes.
+ (init_xfns): Remove prototype.
+
+ * dispextern.h (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
+ (x_reference_bitmap, x_create_bitmap_from_data)
+ (x_create_bitmap_from_file, x_destroy_bitmap)
+ (x_create_bitmap_mask): Move prototypes from dispextern.h.
+ (gamma_correct) [MAC_OS]: Add prototype.
+
+ * xterm.h (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
+ (x_reference_bitmap, x_create_bitmap_from_data)
+ (x_create_bitmap_from_file, x_destroy_bitmap)
+ (x_create_bitmap_mask): Move prototypes to dispextern.h.
+
+2004-03-09 Kenichi Handa <handa@etlken2>
+
+ * coding.c (decode_coding_emacs_mule): Handle insufficent source
+ correctly.
+
+2004-03-04 Richard M. Stallman <[email protected]>
+
+ * s/sol2-6.h (LD_SWITCH_SYSTEM_TEMACS): New definition.
+
+ * window.c (Fdisplay_buffer): Doc fix.
+
+ * buffer.c (Fpop_to_buffer): Doc fix.
+
+2004-03-03 Kim F. Storm <[email protected]>
+
+ * xdisp.c (display_line): Fix call to get_overlay_arrow_glyph_row.
+
+2004-03-02 Stefan Monnier <[email protected]>
+
+ * editfns.c (Ftranslate_region): Lisp_Object/int mixup.
+
+2004-03-02 Richard M. Stallman <[email protected]>
+
+ * indent.c (compute_motion): Save vpos in prev_vpos, like hpos etc.
+
+2004-03-02 Kenichi Handa <[email protected]>
+
+ * doc.c (Fsubstitute_command_keys): Fix counding bytes.
+
+2004-03-02 Kim F. Storm <[email protected]>
+
+ * window.h (struct window): New member overlay_arrow_bitmap.
+
+ * window.c (make_window): Initialize overlay_arrow_bitmap.
+
+ * xdisp.c (Voverlay_arrow_variable_list): New variable to properly
+ implement and integrate multiple overlay arrows with redisplay.
+ (syms_of_xdisp): DEFVAR_LISP and initialize it.
+ (last_arrow_position, last_arrow_string): Replace by properties.
+ (Qlast_arrow_position, Qlast_arrow_string)
+ (Qoverlay_arrow_string, Qoverlay_arrow_bitmap): New variables.
+ (syms_of_xdisp): Intern and staticpro them.
+ (overlay_arrow_string_or_property, update_overlay_arrows)
+ (overlay_arrow_in_current_buffer_p, overlay_arrows_changed_p)
+ (overlay_arrow_at_row): New functions for multiple overlay arrows.
+ (redisplay_internal): Use them instead of directly accessing
+ Voverlay_arrow_position etc. for multiple overlay arrows.
+ (mark_window_display_accurate): Use update_overlay_arrows.
+ (try_cursor_movement): Use overlay_arrow_in_current_buffer_p.
+ (try_window_id): Use overlay_arrows_changed_p.
+ (get_overlay_arrow_glyph_row): Add overlay_arrow_string arg.
+ (display_line): Use overlay_arrow_at_row to check multiple
+ overlay arrows, and get relevant overlay-arrow-string and
+ overlay-arrow-bitmap. Set w->overlay_arrow_bitmap accordingly.
+ (produce_image_glyph): Set pixel_width = 0 for fringe bitmap.
+ (syms_of_xdisp): Remove last_arrow_position and last_arrow_string.
+
+ * fringe.c (draw_fringe_bitmap): Use w->overlay_arrow_bitmap if set.
+ (update_window_fringes): Remove unused code.
+
+2004-03-01 Jason Rumney <[email protected]>
+
+ * w32term.c (w32_read_socket): Fix last change to ButtonPress handling.
+
+2004-03-01 Juanma Barranquero <[email protected]>
+
+ * fringe.c (Fdefine_fringe_bitmap): Fix typo in docstring.
+
+ * makefile.w32-in ($(BLD)/fringe.$(O)): Add dependencies.
+
+2004-03-01 Jan Dj,Ad(Brv <[email protected]>
+
+ * xfns.c (Fx_display_color_cells): Use number of planes to calculate
+ how many colors can be displayed.
+
+2004-03-01 Kenichi Handa <[email protected]>
+
+ * editfns.c (Ftranslate_region): Handle multibyte chars in TABLE
+ correctly.
+
+2004-02-28 Kim F. Storm <[email protected]>
+
+ * dispnew.c (update_window): Update header line also if there are
+ no other changes in window (move code after set_cursor label).
+
+ * lisp.h (mark_window_display_accurate): Remove prototype.
+
+ * window.c (window_loop, Fforce_window_update): Force mode line
+ updates by setting prevent_redisplay_optimizations_p and
+ update_mode_lines.
+
+2004-02-28 Jan Dj,Ad(Brv <[email protected]>
+
+ * xfns.c (x_window): Fix indentation.
+
+ * xterm.c (x_calc_absolute_position): Call x_real_positions
+ to get WM window sizes and use those to calculate position.
+ (x_set_offset): Remove code commented out.
+
+2004-02-28 Miles Bader <[email protected]>
+
+ * keyboard.c (adjust_point_for_property): #ifdef-out dodgy xassert.
+
+2004-02-28 Kim F. Storm <[email protected]>
+
+ * keyboard.c (kbd_buffer_store_event_hold): New function to store
+ an event into kbd fifo, but with special handling of quit event;
+ a quit event is saved for later, and further events are discarded
+ until the saved quit event has been processed.
+ (kbd_buffer_store_event): Use kbd_buffer_store_event_hold.
+ (gen_help_event): Store help event in kbd fifo.
+ (NREAD_INPUT_EVENTS): Remove.
+ (read_avail_input): Adapt to new read_socket_hook interface.
+ Remove allocation and initialization of local input_event buffer,
+ as read_socket_hook stores events directly in fifo. Allocate and
+ initialize local hold_quit event to handle postponed quit event
+ (and store it if set by kbd_buffer_store_event_hold).
+
+ * keyboard.h (kbd_buffer_store_event_hold): Add prototype.
+ (gen_help_event): Fix prototype.
+
+ * macterm.c (XTread_socket): Remove bufp_r and
+ numcharsp args. Add hold_quit arg.
+ Rework to use just one, local, inev input_event. Store inev
+ directly in fifo using kbd_buffer_store_event_hold.
+
+ * sysdep.c (BUFFER_SIZE_FACTOR): Remove.
+ (read_input_waiting): Adapt to new read_socket_hook interface.
+ Remove allocation and initialization of local input_event buffer,
+ as read_socket_hook stores events directly in fifo. Allocate and
+ initialize local hold_quit event to handle postponed quit event
+ (and store it if set by kbd_buffer_store_event_hold).
+
+ * term.c (read_socket_hook): Fix arg list.
+
+ * termhooks.h (read_socket_hook): Fix prototype.
+
+ * w32inevt.c (w32_console_read_socket): Remove bufp_r and
+ numcharsp args. Add hold_quit arg.
+ Rework to use just one, local, inev input_event. Store inev
+ directly in fifo using kbd_buffer_store_event_hold.
+
+ * w32inevt.h (w32_console_mouse_position): Fix prototype.
+
+ * w32term.c (w32_read_socket): Remove bufp_r and numcharsp args.
+ Add hold_quit arg. Rework to use just one, local, inev
+ input_event. Store inev directly in fifo using
+ kbd_buffer_store_event_hold. Update count in one place.
+ Postpone call to gen_help_event until inev is stored; use new
+ local do_help for this.
+ Remove local emacs_event in handing of ButtonPress event; just use
+ inev instead (so no reason to copy it later).
+
+ * xsmfns.c (x_session_check_input): Remove numchars arg.
+
+ * xterm.c (x_focus_changed, x_detect_focus_change):
+ Remove numchars arg. Always store event into bufp arg.
+ Return nothing. Callers changed accordingly.
+ (glyph_rect): Simplify.
+ (STORE_KEYSYM_FOR_DEBUG): New macro.
+ (SET_SAVED_MENU_EVENT): Use inev instead of bufp, etc.
+ (current_bufp, current_numcharsp) [USE_GTK]: Remove.
+ (current_hold_quit) [USE_GTK]: Add.
+ (event_handler_gdk): Adapt to new handle_one_xevent.
+ (handle_one_xevent): Remove bufp_r and numcharsp args.
+ Add hold_quit arg. Rework to use just one, local, inev
+ input_event. Store inev directly in fifo using
+ kbd_buffer_store_event_hold. Update count in one place.
+ Postpone call to gen_help_event until inev is stored; use new
+ local do_help for this.
+ Simplify handling of keysyms (consolidate common code). Fix bug
+ where count was updated with nchars instead of nbytes.
+ Remove local emacs_event in handing of ButtonPress event; just use
+ inev instead (so no reason to copy it later).
+ Remove `out' label. Rename label `ret' to `done'; add various
+ `goto done' to clarify code flow in deeply nested blocks.
+ (x_dispatch_event): Simplify as handle_one_xevent now calls
+ kbd_buffer_store_event itself.
+ (XTread_socket): Remove bufp_r and numcharsp args. Add hold_quit
+ arg. Call handle_one_xevent with new arglist. Store event from
+ x_session_check_input in fifo.
+ [USE_GTK]: Setup current_hold_quit.
+ Decrement handling_signal before unblocking input.
+ (x_initialize) [USE_GTK]: Initialize current_count.
+
+ * xterm.h (x_session_check_input): Fix prototype.
+
+2004-02-26 YAMAMOTO Mitsuharu <[email protected]>
+
+ * s/darwin.h (LD_SWITCH_SYSTEM_TEMACS): Add `-framework QuickTime'.
+
+ * dispextern.h [MAC_OSX]: Do not include Carbon/Carbon.h (now in
+ macgui.h).
+
+ * emacs.c (main) [HAVE_CARBON]: Call init_xfns.
+
+ * macgui.h [MAC_OSX]: Include Carbon/Carbon.h.
+ (mktime, DEBUG, Z, free, malloc, realloc, max, min)
+ (init_process) [MAC_OSX]: Avoid conflicts with Carbon/Carbon.h.
+ [!MAC_OSX]: Include QDOffscreen.h and Controls.h.
+ (INFINITY) [MAC_OSX]: Avoid conflict with definition in math.h.
+ (Bitmap): Remove typedef.
+ (Pixmap): Change int to GWorldPtr.
+
+ * macmenu.c [MAC_OSX]: Don't include Carbon/Carbon.h (now in macgui.h).
+
+ * macterm.h [MAC_OSX]: Don't include Carbon/Carbon.h (now in macgui.h).
+ (RED16_FROM_ULONG, GREEN16_FROM_ULONG, BLUE16_FROM_ULONG):
+ New #define to extract 16-bit depth color components from unsigned
+ long representation.
+ (PIX_MASK_DRAW, PIX_MASK_RETAIN): New #define to represent pixel
+ colors used for masks.
+ (struct mac_display_info): Add color_p. Remove n_cbits.
+
+ * macfns.c: Include sys/types.h and sys/stat.h.
+ [MAC_OSX]: Do not include Carbon/Carbon.h (now in macgui.h).
+ Include QuickTime/QuickTime.h.
+ (XCreatePixmap, XCreatePixmapFromBitmapData, XFreePixmap)
+ (XSetForeground, mac_draw_line_to_pixmap): Add externs for
+ functions defined in macterm.c.
+ (XImagePtr): New typedef. Corresponds to XImage * in xfns.c.
+ (ZPixmap): New #define for compatibility with xfns.c.
+ (XGetImage, XPutPixel, XGetPixel, XDestroyImage)
+ (x_create_x_image_and_pixmap, x_destroy_x_image, x_put_x_image)
+ (find_image_fsspec, image_load_qt_1, image_load_quicktime):
+ New functions.
+ (four_corners_best, x_create_x_image_and_pixmap)
+ (x_destroy_x_image, unwind_create_frame, x_disable_image)
+ (x_edge_detection, init_color_table, colors_in_color_table)
+ (lookup_rgb_color, lookup_pixel_color, postprocess_image)
+ (x_put_x_image, slurp_file, xbm_scan, xbm_load, xbm_load_image)
+ (xbm_image_p, xbm_read_bitmap_data, xbm_file_p, x_to_xcolors)
+ (x_from_xcolors, x_detect_edges): New declarations (from xfns.c).
+ (mac_color_map_lookup, x_to_mac_color): Fix Lisp_Object/unsigned
+ long mixup.
+ (mac_defined_color, x_to_x_colors): Use RED16_FROM_ULONG etc.
+ (x_decode_color): Don't use n_cbits (in struct mac_display_info).
+ (x_set_foreground_color, x_set_cursor_color): Sync with w32fns.c.
+ (x_set_cursor_type, Fxw_color_values, valid_image_p)
+ (image_value_type, parse_image_spec, image_ascent, x_clear_image)
+ (x_alloc_image_color, clear_image_cache, lookup_image)
+ (x_find_image_file, xbm_read_bitmap_file_data)
+ (enum xbm_keyword_index, xbm_format, xbm_image_p, xbm_scan)
+ (xbm_read_bitmap_data, xbm_load, pbm_image_p, pbm_scan_number)
+ (enum pbm_keyword_index, pbm_format, enum png_keyword_index)
+ (png_format, png_image_p, enum jpeg_keyword_index, jpeg_format)
+ (jpeg_image_p, enum tiff_keyword_index, tiff_format, tiff_image_p)
+ (enum gif_keyword_index, gif_format, gif_image_p): Sync with xfns.c.
+ (x_make_gc): Sync with xfns.c. Enclose unused `border_tile' with
+ #if 0.
+ (x_free_gcs): Sync with xfns.c. Enclose unused `border_tile' with
+ #if 0. Free white_relief.gc and black_relief.gc.
+ (unwind_create_frame, x_emboss, x_laplace, x_edge_detection):
+ New functions (from xfns.c).
+ (Fx_create_frame): Record unwind_create_frame.
+ (Fxw_display_color_p): Use dpyinfo->color_p.
+ (Fx_display_grayscale_p, Fx_display_planes): Don't use
+ dpyinfo->n_cbits.
+ (Fx_display_color_cells): Use dpyinfo->n_planes;
+ (QCmatrix, QCcolor_adjustment, QCmask, Qemboss, Qedge_detection)
+ (Qheuristic, cross_disabled_images, emboss_matrix)
+ (laplace_matrix): New variables (from xfns.c).
+ (Fimage_size, Fimage_mask_p, four_corners_best, image_background)
+ (x_clear_image_1, postprocess_image, slurp_file, xbm_load_image)
+ (xbm_file_p, x_to_xcolors, x_from_xcolors, x_detect_edges)
+ (image_background_transparent): New function (from xfns.c).
+ Use PIX_MASK_DRAW/PIX_MASK_RETAIN.
+ (image_load_quicktime): Add declaration.
+ [MAC_OSX] (image_load_quartz2d): Likewise.
+ [MAC_OSX] (CGImageCreateWithPNGDataProviderProcType): New typedef.
+ [MAC_OSX] (MyCGImageCreateWithPNGDataProvider): New variable.
+ [MAC_OSX] (init_image_func_pointer, image_load_quartz2d): New funs.
+ (xbm_load_image_from_file, x_laplace_read_row)
+ (x_laplace_write_row, pbm_read_file): Remove functions.
+ [HAVE_XPM] (enum xpm_keyword_index, xpm_format, xpm_image_p)
+ (xpm_load): Sync with xfns.c (although XPM is not supported yet).
+ (colors_in_color_table): Sync with xfns.c (although not used).
+ (lookup_rgb_color): Don't lookup color table. Just do gamma
+ correction.
+ (COLOR_INTENSITY): New #define (from xfns.c).
+ (x_disable_image): New function (from xfns.c).
+ Use PIX_MASK_DRAW/PIX_MASK_RETAIN.
+ (x_build_heuristic_mask): Sync with xfns.c.
+ Use PIX_MASK_DRAW/PIX_MASK_RETAIN.
+ (HAVE_PBM): Remove #ifdef.
+ (pbm_load): Sync with xfns.c. Set img->width and img->height
+ before IMAGE_BACKGROUND.
+ (png_image_p, png_load): Don't enclose declarations with #if HAVE_PNG.
+ (Qpng, enum png_keyword_index, png_format, png_type, png_image_p):
+ Don't enclose with #if HAVE_PNG.
+ [!HAVE_PNG] (png_load) [MAC_OSX]: Use image_load_quartz2d if a
+ symbol _CGImageCreateWithPNGDataProvider is defined.
+ Otherwise use image_load_quicktime.
+ [!HAVE_PNG] (png_load) [!MAC_OSX]: Use image_load_quicktime.
+ [HAVE_PNG] (png_load): Sync with xfns.c.
+ Use PIX_MASK_DRAW/PIX_MASK_RETAIN.
+ (jpeg_image_p, jpeg_load): Don't enclose declarations with #if
+ HAVE_JPEG.
+ (Qjpeg, enum jpeg_keyword_index, jpeg_format, jpeg_type)
+ (jpeg_image_p): Don't enclose with #if HAVE_JPEG.
+ [!HAVE_JPEG] (jpeg_load) [MAC_OSX]: Use image_load_quartz2d.
+ [!HAVE_JPEG] (jpeg_load) [!MAC_OSX]: Use image_load_quicktime.
+ [HAVE_JPEG] (jpeg_load): Sync with xfns.c.
+ (tiff_image_p, tiff_load): Don't enclose declarations with #if
+ HAVE_TIFF.
+ (Qtiff, enum tiff_keyword_index, tiff_format, tiff_type)
+ (tiff_image_p): Don't enclose with #if HAVE_TIFF.
+ [!HAVE_TIFF] (tiff_load): Use image_load_quicktime.
+ [HAVE_TIFF] (tiff_error_handler, tiff_warning_handler):
+ New functions (from xfns.c).
+ [HAVE_TIFF] (tiff_load): Sync with xfns.c.
+ (gif_image_p, gif_load): Don't enclose declarations with #if HAVE_GIF.
+ (Qgif, enum gif_keyword_index, gif_format, gif_type, gif_image_p):
+ Don't enclose with #if HAVE_GIF.
+ [!HAVE_GIF] (gif_load): Use Quicktime Movie Toolbox if it is
+ animated gif. Otherwise use image_load_quicktime.
+ [HAVE_GIF] (gif_lib.h): Temporarily define DrawText as
+ gif_DrawText to avoid conflict with QuickdrawText.h.
+ [HAVE_GIF] (gif_load): Sync with xfns.c.
+ (enum gs_keyword_index, gs_format, gs_image_p, gs_load)
+ [HAVE_GHOSTSCRIPT] (x_kill_gs_process): Sync with xfns.c (although
+ Ghostscript is not supported yet).
+ (syms_of_macfns): Initialize Qemboss, Qedge_detection, Qheuristic,
+ QCmatrix, QCcolor_adjustment, and QCmask. Add DEFVAR_BOOL
+ cross_disabled_images (from xfns.c). Remove #if 0 for supported
+ image types. Remove #if HAVE_JPEG, HAVE_TIFF, HAVE_GIF, and
+ HAVE_PNG. Add defsubr for Simage_size and Simage_mask_p.
+ (init_xfns): Remove #if HAVE_JPEG, HAVE_TIFF, HAVE_GIF, and
+ HAVE_PNG. Call EnterMovies to support animated gifs.
+ Call init_image_func_pointer to bind a symbol
+ _CGImageCreateWithPNGDataProvider if it is defined.
+
+ * macterm.c [MAC_OSX]: Don't include Carbon/Carbon.h (now in macgui.h).
+ (x_draw_bar_cursor): Sync declaration with xterm.c.
+ (XFreePixmap, mac_draw_rectangle_to_pixmap, mac_copy_area)
+ (mac_copy_area_to_pixmap): Implementation with GWorld (offscreen
+ graphics).
+ (mac_set_forecolor, mac_set_backcolor): Use RED16_FROM_ULONG etc.
+ (mac_draw_line_to_pixmap, XCreatePixmap)
+ (XCreatePixmapFromBitmapData, mac_fill_rectangle_to_pixmap)
+ (mac_copy_area_with_mask, mac_copy_area_with_mask_to_pixmap):
+ New functions.
+ (mac_draw_bitmap) [TARGET_API_MAC_CARBON]:
+ Use GetPortBitMapForCopyBits instead of the cast to Bitmap *.
+ Cast bits to char *.
+ (reflect_byte): New function (from w32fns.c).
+ (mac_create_bitmap_from_bitmap_data): Use it and don't stuff bits
+ due to byte alignment.
+ (mac_scroll_area) [TARGET_API_MAC_CARBON]:
+ Use GetPortBitMapForCopyBits instead of the cast to Bitmap *.
+ (XSetForeground): Remove static (now used in macfns.c).
+ (HIGHLIGHT_COLOR_DARK_BOOST_LIMIT): New #define (from w32term.c).
+ (mac_alloc_lighter_color, x_destroy_window): Sync with w32term.c.
+ (x_setup_relief_color, x_setup_relief_colors, x_draw_box_rect)
+ (x_draw_glyph_string_box, x_draw_image_foreground)
+ (x_draw_image_foreground_1, x_draw_image_glyph_string)
+ (x_draw_stretch_glyph_string, x_draw_glyph_string)
+ (x_draw_hollow_cursor, x_draw_bar_cursor, mac_draw_window_cursor):
+ Sync with xterm.c.
+ (x_draw_relief_rect): Sync with xterm.c. Make 1 pixel shorter
+ than the xterm.c version when a strictly horizontal or vertical
+ line is drawn.
+ (XTset_terminal_window): Add static.
+ (x_make_frame_visible): Add UNBLOCK_INPUT.
+ (x_free_frame_resources): New funcion (from xterm.c).
+ (XTread_socket): Call handle_tool_bar_click if mouse up/down event
+ occurs in tool bar area.
+ (mac_initialize_display_info): Remove dpyinfo->n_cbits.
+ Set dpyinfo->color_p. Determine dpyinfo->n_planes using HasDepth.
+ Initialize image cache.
+ (stricmp, wildstrieq, mac_font_pattern_match, mac_font_match):
+ Enclose unused functions with #if 0.
+ (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): New variables.
+ (decode_mac_font_name): New function to apply code conversions
+ from a mac font name to an XLFD font name according to its script code.
+ (x_font_name_to_mac_font_name): Apply code conversion from an XLFD
+ font name to a mac font name according to REGISTRY and ENCODING fields.
+ (init_font_name_table) [TARGET_API_MAC_CARBON]: Don't use a font
+ whose name starts with `.'.
+ (init_font_name_table): Use decode_mac_font_name. Add both
+ jisx0208.1983-sjis and jisx0201.1976-0 entries if the script code
+ of a font is smJapanese.
+ (mac_do_list_fonts): New function to list fonts that match a given
+ pattern.
+ (x_list_fonts, XLoadQueryFont): Use it.
+ (XLoadQueryFont): Set rbearing field for each variable width
+ character to avoid needless redraw.
+ (syms_of_macterm): Initialize Qbig5, Qcn_gb, Qsjis, and Qeuc_kr.
+
+2004-02-26 Kim F. Storm <[email protected]>
+
+ * keyboard.c (NREAD_INPUT_EVENTS): Temporarily increase to 512
+ as read_socket_hook handler on X aborts if buffer is too small
+ and W32 handler doesn't always check buffer limit.
+
+ * xdisp.c (handle_single_display_prop): Handle left-fringe and
+ right-fringe similar to a display margin image. Specifically,
+ the characters having the fringe prop are no longer shown, and
+ we use IT_IMAGE/next_element_from_image with image_id = -1 to
+ do this. Set fringe bitmap face_id in it->face_id.
+ (produce_image_glyph): Handle image_id < 0 as "no image" case, but
+ still realize it->face (i.e. the fringe bitmap face).
+
+2004-02-25 Miles Bader <[email protected]>
+
+ * xdisp.c (check_it): Check string/string_pos consistency.
+ (init_iterator): Initialize string-related fields properly.
+
+2004-02-11 Miles Bader <[email protected]>
+
+ * xdisp.c (produce_image_glyph): Force negative descents to zero.
+
+2004-02-10 Miles Bader <[email protected]>
+
+ * xfns.c (lookup_image): Remove xassert(!interrupt_input_blocked);
+ BLOCK_INPUT can be nested, so it doesn't make much sense.
+
+2004-02-24 Michael Mauger <[email protected]>
+
+ * w32fns.c (slurp_file, xbm_scan, xbm_load_image)
+ (xbm_read_bitmap_data): Use unsigned char for image data.
+
+2004-02-23 Luc Teirlinck <[email protected]>
+
+ * abbrev.c (Finsert_abbrev_table_description): Doc fix.
+
+2004-02-22 Jason Rumney <[email protected]>
+
+ * w32term.c (w32_draw_fringe_bitmap): Draw overlaid bitmaps
+ correctly over other bitmaps.
+
+2004-02-21 Eli Zaretskii <[email protected]>
+
+ * emacs.c (USAGE1): Split into two halves.
+ (USAGE2): Second half of the old USAGE1.
+ (USAGE3): Rename from USAGE2.
+ (USAGE4): Rename from USAGE3.
+
+2004-02-21 Juri Linkov <[email protected]>
+
+ * emacs.c (USAGE1): Add --no-desktop. Move --display from USAGE2.
+ Fix --multibyte. Move --help, --version to USAGE2. Add alias
+ --file. Fix -f, -l. Sort options. Untabify.
+ (USAGE2): Add -hb. Fix --name, --title. Sort options. Untabify.
+
+2004-02-19 Luc Teirlinck <[email protected]>
+
+ * category.c (Fdefine_category, Fcategory_docstring)
+ (Fget_unused_category, Fset_category_table)
+ (Fcategory_set_mnemonics): Doc fixes.
+
+2004-02-20 Kim F. Storm <[email protected]>
+
+ * keyboard.c: Undo 2004-02-16 and 2004-02-17 changes.
+ The following changes are relative to the 2004-01-21 revision.
+ (NREAD_INPUT_EVENTS): Define as max number of input events to read
+ in one call to read_socket_hook. Value is 8.
+ (read_avail_input): Separate and rework handling of read_socket_hook
+ and non-read_socket_hook cases. Use smaller input_event buffer
+ in read_socket_hook case, and repeat if full buffer is read.
+ Use new local variable 'discard' to skip input after C-g.
+ In non-read_socket_hook case, just use a single input_event, and
+ call kbd_buffer_store_event on the fly for each character.
+
+2004-02-19 Stefan Monnier <[email protected]>
+
+ * lisp.h (union Lisp_Object): Give a more precise type for `type'.
+ Remove unused `gu' alternative.
+
+2004-02-19 Andreas Schwab <[email protected]>
+
+ * fringe.c (Fdefine_fringe_bitmap): Use && instead of & to avoid
+ warning.
+
+2004-02-18 Kim F. Storm <[email protected]>
+
+ * xdisp.c (get_window_cursor_type, display_and_set_cursor):
+ Fix last change.
+
+2004-02-17 Kim F. Storm <[email protected]>
+
+ * xdisp.c (fast_find_position): Fix return value of new version;
+ it was inverted compared to the 21.1 version.
+ (get_window_cursor_type): Don't look at glyph if NULL.
+ (display_and_set_cursor): Set glyph to NULL if cursor in fringe.
+
+ * keyboard.c: Rework previous change; it didn't consider that the
+ buf array was allocated on the stack.
+ (prev_read): Remove variable.
+ (read_avail_input_buf): New static event buffer array.
+ (in_read_avail_input): New static variable to handle re-entrancy.
+ (read_avail_input): Change buf to pinter to read_avail_input_buf.
+ Use in_read_avail_input to handle re-entrance; when re-entered,
+ fully initialize and use tmp_buf array instead of read_avail_input_buf.
+ Do not initialize read_avail_input_buf in full here; instead assume it
+ is always cleared on entry. To ensure that, we clear (just) the
+ entries that were used before we return.
+ (init_keyboard): Initialize read_avail_input_buf here.
+
+2004-02-16 Jesper Harder <[email protected]>
+
+ * cmds.c (Fend_of_line): Doc fix.
+
+2004-02-16 Dmitry Antipov <[email protected]> (tiny change)
+
+ * keyboard.c (prev_read): New static variable.
+ (read_avail_input): Use it to zero out only those slots in buf[]
+ that were used last time we were called.
+
+2004-02-16 Eli Zaretskii <[email protected]>
+
+ * Makefile.in (obj): Move fringe.o from here...
+ (XOBJ, MAC_OBJ): ...to here.
+
+2004-02-16 Stephen Eglen <[email protected]>
+
+ * fringe.c (init_fringe_bitmap): Define j in MAC_OS code.
+
+2004-02-15 Stefan Monnier <[email protected]>
+
+ * data.c (Fbyteorder):
+ * fringe.c (Fdefine_fringe_bitmap):
+ * xdisp.c (handle_single_display_prop):
+ * xselect.c (x_handle_dnd_message): Lisp_Object/int mixup.
+
+2004-02-16 Jason Rumney <[email protected]>
+
+ * w32term.c (w32_draw_fringe_bitmap): Handle overlay fringe bitmaps.
+
+2004-02-15 Steven Tamm <[email protected]>
+
+ * macterm.c (Vmac_emulate_three_button_mouse): New variable for
+ controlling emulation of a three button mouse with option and
+ command keys.
+ (Qreverse, mac_get_enumlated_btn): Handle the emulation.
+ (mac_event_to_emacs_modifiers, XTread_socket): Ditto.
+
+2004-02-15 Kim F. Storm <[email protected]>
+
+ * buffer.c (syms_of_buffer): Doc fix for indicate-buffer-boundaries.
+
+ * fringe.c (init_fringe_bitmap) [MAC_OS, WORDS_BIG_ENDIAN]:
+ Perform byte-swapping.
+
+2004-02-14 Kim F. Storm <[email protected]>
+
+ * dispextern.h (struct draw_fringe_bitmap_params): Change member
+ bits from char to short to facilitate wider bitmaps.
+ (struct redisplay_interface): Fix prototype of define_fringe_bitmap
+ member.
+
+ * fringe.c (struct fringe_bitmap): Change member bits from char to
+ short to facilitate 16 bits wide bitmaps. Modify all standard
+ bitmaps accordingly.
+ (BYTES_PER_BITMAP_ROW, STANDARD_BITMAP_HEIGHT): New macros.
+ (FRBITS): Use STANDARD_BITMAP_HEIGHT instead of just sizeof.
+ (draw_fringe_bitmap): Ditto.
+ (init_fringe_bitmap) [MAC_OS]: Don't bitswap.
+ (init_fringe_bitmap) [HAVE_X_WINDOWS]: Enhance bitswapping to
+ handle up to 16 bits wide bitmaps.
+ (Fdefine_fringe_bitmap): Doc fix. Handle wider bitmaps.
+ (Ffringe_bitmaps_at_pos): Add missing arg declarations.
+
+ * macterm.c (mac_draw_bitmap): Handle 16 bits wide bitmaps directly.
+ (x_draw_fringe_bitmap): Use enhanced mac_draw_bitmap, so we no longer
+ need to call mac_create_bitmap_from_bitmap_data and mac_free_bitmap.
+
+ * w32term.c (w32_define_fringe_bitmap): Bitmaps are now 16 bits wide,
+ so it is no longer necessary to expand them here.
+
+ * xterm.c (x_draw_fringe_bitmap): Handle wider bitmaps (max 16 bits).
+
+2004-02-12 Kim F. Storm <[email protected]>
+
+ * window.c (Fwindow_fringes): Doc fix.
+
+2004-02-10 Jan Dj,Ad(Brv <[email protected]>
+
+ * xselect.c (x_get_foreign_selection): Add new optional parameter
+ time_stamp.
+ (Fx_get_selection_internal): Ditto, pass time_stamp to
+ x_get_foreign_selection.
+
+ * data.c (Fbyteorder): New function.
+
+2004-02-09 Jan Dj,Ad(Brv <[email protected]>
+
+ * atimer.c: Move include stdio.h to same place as in other files.
+
+ * region-cache.c: Ditto.
+
+ * sysdep.c: Ditto.
+
+ * xfaces.c: Ditto.
+
+2004-02-09 Sam Steingold <[email protected]>
+
+ * w32term.c (w32_draw_fringe_bitmap): Fix a typo in the last patch.
+
+2004-02-09 Kim F. Storm <[email protected]>
+
+ * fringe.c: New file. Move original fringe related declarations
+ and code from dispextern.h and xdisp.c here.
+ Rework code to support user defined fringe bitmaps, redefining
+ standard bitmaps, ability to overlay user defined bitmap with
+ overlay arrow bitmap, and add faces to bitmaps.
+ (Voverflow_newline_into_fringe): Declare here.
+ (enum fringe_bitmap_align): New enum.
+ (..._bits): All bitmaps are now defined without bitswapping; that
+ is now done in init_fringe_once (if necessary).
+ (standard_bitmaps): New array with specifications for the
+ standard fringe bitmaps.
+ (fringe_faces): New array.
+ (valid_fringe_bitmap_id_p): New function.
+ (draw_fringe_bitmap_1): Rename from draw_fringe_bitmap.
+ (draw_fringe_bitmap): New function which draws fringe bitmap,
+ possibly overlaying bitmap with cursor in right fringe or the
+ overlay arrow in the left fringe.
+ (update_window_fringes): Do not handle overlay arrow here.
+ Compare and copy fringe bitmap faces.
+ (init_fringe_bitmap): New function.
+ (Fdefine_fringe_bitmap, Fdestroy_fringe_bitmap): New DEFUNs to
+ define and destroy user defined fringe bitmaps.
+ (Fset_fringe_bitmap_face): New DEFUN to set face for a fringe bitmap.
+ (Ffringe_bitmaps_at_pos): New DEFUN to read current fringe bitmaps.
+ (syms_of_fringe): New function. Defsubr new DEFUNs.
+ DEFVAR_LISP Voverflow_newline_into_fringe.
+ (init_fringe_once, init_fringe): New functions.
+ (w32_init_fringe, w32_reset_fringes) [WINDOWS_NT]: New functions.
+
+ * Makefile.in (obj): Add fringe.o.
+ (fringe.o): New dependencies.
+
+ * dispextern.h (FRINGE_ID_BITS): New definition for number of
+ bits allocated to hold a fringe number. Increase number of bits
+ from 4 to 8 to allow user defined fringe bitmaps.
+ (struct glyph_row, struct it): New members left_user_fringe_bitmap,
+ left_user_fringe_face_id, right_user_fringe_bitmap,
+ right_user_fringe_face_id.
+ (enum fringe_bitmap_type, struct fringe_bitmap, fringe_bitmaps):
+ Move to new file fringe.c.
+ (MAX_FRINGE_BITMAPS): Define here.
+ (struct draw_fringe_bitmap_params): New members bits, cursor_p,
+ and overlay_p. Change member which to int.
+ (struct redisplay_interface): New members define_fringe_bitmap
+ and destroy_fringe_bitmap.
+ (valid_fringe_bitmap_id_p): Add prototype.
+ (w32_init_fringe, w32_reset_fringes) [WINDOWS_NT]: Add prototypes.
+
+ * dispnew.c (row_equal_p): Compare fringe bitmap faces and overlay
+ arrows.
+ (update_frame): Do flush_display if force_flush_display_p to
+ ensure display (specifically fringes) are updated in a timely
+ manner when resizing the frame by dragging the mouse.
+ (update_window_line): Update row if overlay arrow changed.
+ (scrolling_window): Redraw fringe bitmaps if fringe bitmap faces
+ or overlay arrow changed.
+
+ * emacs.c (main) [HAVE_WINDOW_SYSTEM]: Call init_fringe_once,
+ syms_of_fringe, and init_fringe.
+
+ * frame.h (struct frame): New member force_flush_display_p.
+
+ * lisp.h (syms_of_fringe, init_fringe, init_fringe_once):
+ Add prototypes.
+
+ * macterm.c (mac_draw_bitmap): Add overlay_p arg.
+ (x_draw_fringe_bitmap): Handle overlayed fringe bitmaps;
+ thanks to YAMAMOTO Mitsuharu for advice on how to do this.
+ Use cursor color for displaying cursor in fringe.
+ (x_redisplay_interface): Add null handlers for
+ define_fringe_bitmap and destroy_fringe_bitmap functions.
+
+ * w32term.c (w32_draw_fringe_bitmap): Copy unadapted code from
+ xterm.c to handle overlayed fringe bitmaps and to use cursor color
+ for displaying cursor in fringe.
+ (w32_define_fringe_bitmap, w32_destroy_fringe_bitmap): New W32
+ specific functions to define and destroy fringe bitmaps in fringe_bmp.
+ (w32_redisplay_interface): Add them to redisplay_interface.
+ (w32_term_init): Call w32_init_fringe instead of explicitly
+ defining fringe bitmaps in fringe_bmp array.
+ (x_delete_display): Call w32_reset_fringes instead of explicitly
+ destroying fringe bitmaps in fringe_bmp array.
+
+ * xdisp.c (Voverflow_newline_into_fringe, syms_of_xdisp)
+ (left_bits, right_bits, up_arrow_bits, down_arrow_bits)
+ (continued_bits, continuation_bits, ov_bits, first_line_bits)
+ (last_line_bits, filled_box_cursor_bits, hollow_box_cursor_bits)
+ (bar_cursor_bits, hbar_cursor_bits, zv_bits, hollow_square_bits)
+ (fringe_bitmaps, draw_fringe_bitmap, draw_row_fringe_bitmaps)
+ (draw_window_fringes, compute_fringe_widths, update_window_fringes):
+ Move fringe handling vars and code to new file fringe.c.
+ (handle_display_prop): Handle left-fringe and right-fringe
+ display properties; store user fringe bitmaps in iterator.
+ (move_it_in_display_line_to): Handle cursor in fringe at eob.
+ (clear_garbaged_frames): Set force_flush_display_p if resized.
+ (redisplay_window): Redraw fringe bitmaps if not just_this_one_p.
+ (display_line): Handle cursor in fringe at eob.
+ (display_line): Set row user fringe bitmaps from iterator.
+
+ * xterm.c (x_draw_fringe_bitmap): Handle overlayed fringe bitmaps.
+ Use cursor color for displaying cursor in fringe.
+ (x_redisplay_interface): Add null handlers for
+ define_fringe_bitmap and destroy_fringe_bitmap functions.
+
+2004-02-07 Jan Dj,Ad(Brv <[email protected]>
+
+ * macfns.c (Fx_change_window_property): Make doc string and
+ parameters same as for X version.
+
+ * w32fns.c (Fx_change_window_property): Ditto.
+
+2004-02-07 Kim F. Storm <[email protected]>
+
+ * xdisp.c (hscroll_window_tree): Position cursor near to right
+ margin in hscrolled window when jumping to end of line (rather
+ than centering cursor).
+
+ * process.c (wait_reading_process_input): Don't do adaptive read
+ buffering if waiting for a specific process.
+
+2004-02-05 Luc Teirlinck <[email protected]>
+
+ * minibuf.c (Fminibufferp, Fread_from_minibuffer)
+ (Fread_minibuffer, Feval_minibuffer)
+ (Fread_string, Fread_no_blanks_input)
+ (Fcompleting_read): Doc fixes.
+ (syms_of_minibuf): Doc fixes for minibuffer-completion-table and
+ completion-regexp-list. Define Qcase_fold_search and staticpro it.
+ (read_minibuf): Fix initial comment.
+ (Ftry_completion, Fall_completions, Ftest_completion): Bind
+ case-fold-search to the value of completion-ignore-case when
+ checking completion-regexp-list.
+ (Fdisplay_completion_list): Make it handle arguments that are
+ symbols. Doc fix.
+
+2004-02-05 Jan Dj,Ad(Brv <[email protected]>
+
+ * xterm.h: Add declaration of free_frame_menubar.
+
+ * xfns.c (x_create_bitmap_mask): Removed unused variable depth.
+ (x_set_menu_bar_lines): Added ! defined USE_GTK for olines.
+ (Fx_change_window_property): Add declaration of parameters type and
+ format. Remove unused variable cons.
+
+ * xselect.c: Include stdio.h.
+
+2004-02-05 Kenichi Handa <[email protected]>
+
+ * fns.c (Fset_char_table_range): Fix previous change.
+
+ * buffer.c (Fset_buffer_multibyte): Fix docstring.
+
+2004-02-04 Luc Teirlinck <[email protected]>
+
+ * editfns.c (Fchar_after, Fchar_before): Doc fixes.
+
+2004-02-04 Stefan Monnier <[email protected]>
+
+ * keymap.c (Vmouse_events): Rename from Vmenu_events.
+ (syms_of_keymap): Add mouse-[45], header-line, and mode-line to it.
+
+2004-02-04 Kenichi Handa <[email protected]>
+
+ * fns.c (Fset_char_table_range): Handle charsets ascii,
+ eight-bit-control, and eight-bit-graphic correctly.
+
+2004-02-03 Jason Rumney <[email protected]>
+
+ * w32select.c (Fw32_set_clipboard_data): Make coding iso2022 safe.
+
+ * w32fns.c (x_to_w32_font): Likewise.
+
+2004-02-03 Jan Dj,Ad(Brv <[email protected]>
+
+ * xterm.h: Add x_handle_dnd_message, x_check_property_data,
+ x_fill_property_data, x_property_data_to_lisp and check_x_display_info.
+
+ * xterm.c (handle_one_xevent): Call x_handle_dnd_message for
+ ClientMessages.
+
+ * xselect.c: Include termhooks.h and X11/Xproto.h.
+ (x_check_property_data, x_fill_property_data)
+ (x_property_data_to_lisp, mouse_position_for_drop)
+ (Fx_get_atom_name, x_handle_dnd_message): New functions for DND support.
+ (Fx_send_client_event): Move here from xfns.c.
+ (syms_of_xselect): Add Sx_get_atom_name and Sx_send_client_message.
+
+ * xfns.c (x-send-client-message): Move to xselect.c.
+ (Fx_change_window_property): Add optional arguments TYPE, FORMAT and
+ OUTER_P.
+ (Fx_window_property): Add optional arguments TYPE, SOURCE, DELETE_P,
+ VECTOR_RET_P. Handle AnyPropertyType. Call x_property_data_to_lisp
+ if vector_ret_p is true.
+ (syms_of_xfns): Sx_send_client_message moved to xselect.c.
+
+2004-02-02 Eli Zaretskii <[email protected]>
+
+ * fileio.c (Fcopy_file): If NEWNAME is a directory, expand the
+ basename of FILE relative to it, not FILE itself.
+
+2004-02-02 Kenichi Handa <[email protected]>
+
+ * coding.c (coding_restore_composition): Check invalid
+ composition data more rigidly.
+
+2004-01-30 Luc Teirlinck <[email protected]>
+
+ * fileio.c (Fread_file_name_internal): Correctly handle the case
+ where insert-default-directory is nil.
+ (Fread_file_name): Always return an empty string if the user exits
+ with an empty minibuffer. Adapt the docstring accordingly.
+ (syms_of_fileio): Adapt the docstring of insert-default-directory
+ to the change in Fread_file_name.
+
+2004-01-29 Eli Zaretskii <[email protected]>
+
+ * alloca.c [!alloca]: Fix the prototype for xfree.
+
+2004-01-29 Kenichi Handa <[email protected]>
+
+ * fns.c (string_char_to_byte): Optimize for ASCII only string.
+ (string_byte_to_char): Likewise.
+
+2004-01-28 Peter Runestig <[email protected]>
+
+ * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
+
+2004-01-27 Steven Tamm <[email protected]>
+
+ * unexmacosx.c (unexec_copy): Do not copy more than was
+ requested to prevent overwriting during unexec.
+
+2004-01-27 Jan Dj,Ad(Brv <[email protected]>
+
+ * process.c (sigchld_handler): Add comment about not calling malloc.
+
+ * process.h: Add extern to synch_process_termsig.
+
+2004-01-27 Steven Tamm <[email protected]>
+
+ * macterm.c (make_mac_frame, make_mac_terminal_frame):
+ Move setting of scroll bars from make_mac_frame to
+ make_mac_terminal_frame to prevent clobbering of scroll-bar-mode.
+
+2004-01-26 Richard M. Stallman <[email protected]>
+
+ * search.c (Freplace_match): Handle nonexistent
+ back-references properly.
+
+2004-01-03 Richard M. Stallman <[email protected]>
+
+ * window.c (decode_any_window): New function.
+ (Fwindow_height, Fwindow_width, Fwindow_edges)
+ (Fwindow_pixel_edges, Fwindow_inside_edges)
+ (Fwindow_inside_pixel_edges): Use decode_any_window.
+
+2004-01-27 Jan Dj,Ad(Brv <[email protected]>
+
+ * process.h: synch_process_termsig new variable.
+
+ * callproc.c: Define synch_process_termsig.
+ (Fcall_process): Initiate synch_process_termsig to zero and
+ check if non-zero and get signal name after subprocess has ended.
+
+ * process.c (sigchld_handler): Set synch_process_termsig
+ if terminated by a signal. synch_process_death setting removed.
+
+ * sysdep.c (mkdir, rmdir): Also check synch_process_termsig.
+
+2004-01-26 Andreas Schwab <[email protected]>
+
+ * print.c (print_preprocess): Declare size as EMACS_INT to not
+ lose bits.
+ (print_object): Likewise.
+ * alloc.c (Fpurecopy): Likewise.
+
+2004-01-25 Luc Teirlinck <[email protected]>
+
+ * window.c (Fwindow_minibuffer_p): Doc fix.
+
+2004-01-24 Jonathan Yavner <[email protected]>
+
+ * editfns.c (Fformat): Make both passes accept the same set of flags.
+
+2004-01-23 Kenichi Handa <[email protected]>
+
+ * fns.c (Fmd5): If OBJECT is a buffer different from the current
+ one, set buffer to OBJECT temporarily.
+
+2004-01-21 Stefan Monnier <[email protected]>
+
+ * keyboard.c (kbd_buffer_gcpro): Remove.
+ (kbd_buffer_store_event, clear_event, Fdiscard_input)
+ (stuff_buffered_input, init_keyboard, syms_of_keyboard):
+ Don't initialize and/or maintain the variable any more. It was made
+ redundant by my commit of 2003-06-15.
+
+ * lisp.h [USE_LSB_TAG && !DECL_ALIGN]: Signal an error.
+
+2004-01-21 Jan Dj,Ad(Brv <[email protected]>
+
+ * lisp.h: Add undef DECL_ALIGN.
+
+2004-01-21 Stefan Monnier <[email protected]>
+
+ * process.c (wait_reading_process_input) [SYNC_INPUT]:
+ Check interrupt_input_pending explicitly.
+
+ * lisp.h (QUIT) [SYNC_INPUT]: Check interrupt_input_pending as well.
+
+ * keyboard.c (handle_async_input): New fun,
+ extracted from input_available_signal.
+ (input_available_signal, reinvoke_input_signal): Use it.
+
+2004-01-20 Stefan Monnier <[email protected]>
+
+ * buffer.c (buffer_defaults, buffer_local_symbols): Use DECL_ALIGN.
+
+ * lisp.h [USE_LSB_TAG]: Add definitions for Lisp_Object value
+ manipulation macros for when tags are in the lower bits.
+ (struct Lisp_Free) [USE_LSB_TAG]: Add padding.
+ (DECL_ALIGN): New macro.
+ (DEFUN): Use it.
+
+ * lisp.h [ENABLE_CHECKING]: Don't force union type.
+
+ * s/darwin.h (__attribute__): Remove outdated workaround.
+
+ * macterm.c (main) [USE_LSB_TAG]: Don't range check the ram.
+
+ * alloc.c (lisp_malloc, lisp_align_malloc) [USE_LSB_TAG]:
+ Don't check range of malloc address.
+ (pure_alloc) [USE_LSB_TAG]: Enforce alignment.
+
+ * process.c (wait_reading_process_input): Lisp_Object/int mixup.
+
+ * dired.c (Ffile_attributes): Lisp_Object/int mixup.
+
+2004-01-19 Kenichi Handa <[email protected]>
+
+ * fontset.c (fontset_font_pattern): Fix previous change.
+
+2004-01-16 Miles Bader <[email protected]>
+
+ * xdisp.c (Voverflow_newline_into_fringe)
+ (move_it_in_display_line_to, redisplay_internal)
+ (update_window_fringes, redisplay_window, display_line, window):
+ Add `#ifdef HAVE_WINDOW_SYSTEM' around fringe-drawing stuff, so
+ that it compiles without a window-system.
+ * dispnew.c (direct_output_for_insert, update_window): Likewise.
+
+2004-01-16 Kim F. Storm <[email protected]>
+
+ * buffer.h (struct buffer): New member indicate_buffer_boundaries.
+
+ * buffer.c (init_buffer_once): Set buffer_defaults and
+ buffer_local_flags for indicate_buffer_boundaries.
+ (syms_of_buffer): Defvar_per_buffer it, and defvar_lisp_nopro
+ default- variable for it.
+
+ * dispextern.h (struct glyph_row): New members left_fringe_bitmap,
+ right_fringe_bitmap, redraw_fringe_bitmaps_p for new fringe handling.
+ New members exact_window_width_line_p and cursor_in_fringe_p for
+ overflowing newlines into right fringe.
+ New members indicate_bob_p, indicate_top_line_p, indicate_eob_p,
+ and indicate_bottom_line_p for buffer boundaries and scrolling.
+ (enum fringe_bitmap_type): Add UP_ARROW_BITMAP, DOWN_ARROW_BITMAP,
+ FIRST_LINE_BITMAP, LAST_LINE_BITMAP, FILLED_BOX_CURSOR_BITMAP,
+ HOLLOW_BOX_CURSOR_BITMAP, BAR_CURSOR_BITMAP, HBAR_CURSOR_BITMAP,
+ and HOLLOW_SQUARE_BITMAP.
+ (draw_fringe_bitmap, draw_window_fringes, update_window_fringes):
+ Add prototypes.
+
+ * dispnew.c (row_equal_p, update_window_line): Compare fringe bitmaps
+ instead of related indicator fields.
+ Compare exact_window_width_line_p and cursor_in_mouse_face_p indicators.
+ (direct_output_for_insert): Handle exact width lines like
+ contined lines. Call update_window_fringes.
+ (update_window): Call update_window_fringes.
+ (scrolling_window): Don't skip desired rows with changed bitmaps.
+ Check if fringe bitmaps changes when assigning scrolled rows.
+
+ * xdisp.c (Voverflow_newline_into_fringe): New variable.
+ (IT_OVERFLOW_NEWLINE_INTO_FRINGE): New macro.
+ (move_it_in_display_line_to): Overflow newline into fringe for
+ rows that are exactly as wide as the window.
+ (up_arrow_bits, down_arrow_bits, first_line_bits, last_line_bits)
+ (filled_box_cursor_bits, hollow_box_cursor_bits, bar_cursor_bits)
+ (hbar_cursor_bits, hollow_square_bits): New fringe bitmaps.
+ (fringe_bitmaps): Add new bitmaps.
+ (draw_fringe_bitmap): Make extern. Remove WHICH arg.
+ Select proper bitmap for cursor in fringe when appropriate.
+ Handle alignment of bitmap to top or bottom of row.
+ (draw_row_fringe_bitmaps): Don't select bitmaps here; that is now
+ done by update_window_fringes.
+ (update_window_fringes, draw_window_fringes): New functions.
+ (redisplay_internal): Call update_window_fringes in case only
+ cursor row is updated.
+ (redisplay_window): Call update_window_fringes.
+ Explicitly call draw_window_fringes if redisplay was done using
+ the current matrix or the overlay arrow is in the window.
+ (try_window_reusing_current_matrix): Mark scrolled rows for
+ fringe update (to update buffer-boundaries / scrolling icons).
+ (find_last_unchanged_at_beg_row): Handle exact width lines line
+ continued lines.
+ (display_line): Overflow newline into fringe for rows that are
+ exactly as wide as the window. Don't append space for newline
+ in this case.
+ (notice_overwritten_cursor): Explicitly clear cursor bitmap
+ in fringe as if it had been overwritten.
+ (erase_phys_cursor): Erase cursor bitmap in fringe.
+ (syms_of_xdisp): Mark show-trailing-whitespace and
+ void-text-area-pointer as user options.
+ DEFVAR_LISP Voverflow_newline_into_fringe. Enable by default.
+
+ * xterm.c (x_update_window_end): Call draw_window_fringes.
+ (x_after_update_window_line): Just set redraw_fringe_bitmaps_p
+ in row instead of actually drawing fringe bitmaps.
+ (x_draw_fringe_bitmap): Handle bottom aligned bitmaps.
+ (x_draw_window_cursor): Draw cursor in fringe.
+
+ * w32term.c (x_update_window_end): Call draw_window_fringes.
+ (x_after_update_window_line): Just set redraw_fringe_bitmaps_p
+ in row instead of actually drawing fringe bitmaps.
+ (w32_draw_fringe_bitmap): Handle bottom aligned bitmaps.
+ (w32_draw_window_cursor): Draw cursor in fringe.
+
+ * macterm.c (x_update_window_end): Call draw_window_fringes.
+ (x_after_update_window_line): Just set redraw_fringe_bitmaps_p
+ in row instead of actually drawing fringe bitmaps.
+ (x_draw_fringe_bitmap): Handle bottom aligned bitmaps.
+ (mac_draw_window_cursor): Draw cursor in fringe.
+
+2004-01-16 Jan Dj,Ad(Brv <[email protected]>
+
+ * xterm.c (handle_one_xevent): Don't handle characters that are part
+ of an old style (XLookupString) compose sequence.
+
+2004-01-15 Kenichi Handa <[email protected]>
+
+ * search.c (Freplace_match): Use make_multibyte_string or
+ make_unibyte_string according to the buffer multibyteness.
+
+2004-01-14 Stefan Monnier <[email protected]>
+
+ * alloc.c (struct interval_block, struct string_block)
+ (struct symbol_block, struct marker_block, live_string_p)
+ (live_cons_p, live_symbol_p, live_float_p, live_misc_p):
+ Better preserve alignment for objects in blocks.
+ (FLOAT_BLOCK_SIZE): Adjust for possible alignment padding.
+
+ * lread.c (defvar_per_buffer): Remove dead declaration.
+
+ * macterm.c (do_check_ram_size): Don't hardcode the lisp address
+ space size.
+
+2004-01-12 Jan Dj,Ad(Brv <[email protected]>
+
+ * xmenu.c (popup_get_selection): Check new parameter down_on_keypress
+ if a key press should pop down. Only pop down if a key is pressed
+ outside the menu/dialog.
+ (create_and_show_popup_menu): Pass 0 for down_on_keypress to
+ popup_get_selection.
+ (create_and_show_dialog): Pass 1 for down_on_keypress to
+ popup_get_selection.
+
+2004-01-11 Jan Dj,Ad(Brv <[email protected]>
+
+ * alloc.c (allocate_vectorlike): Surround calls to mallopt with
+ BLOCK/UNBLOCK_INPUT.
+
+2004-01-08 Jan Dj,Ad(Brv <[email protected]>
+
+ * xmenu.c (Fx_popup_dialog): Add an Ok button if no buttons are
+ specified.
+
+2004-01-08 Kenichi Handa <[email protected]>
+
+ * editfns.c (Fformat): Fix '&' to '&&'.
+
+2004-01-08 Andreas Schwab <[email protected]>
+
+ * print.c (print_preprocess) <case Lisp_Vectorlike>: Only mask
+ size if PSEUDOVECTOR_FLAG is set.
+
+2004-01-07 Kenichi Handa <[email protected]>
+
+ * charset.c (Fdeclare_equiv_charset): Fix docstring.
+
+ * fontset.c (fontset_ref_via_base): Fix previous change.
+
+2004-01-07 Kim F. Storm <[email protected]>
+
+ * process.c (read_process_output): Only activate adaptive
+ buffering if we read less than 256 bytes at a time.
+
+2004-01-06 Kim F. Storm <[email protected]>
+
+ * dispnew.c (buffer_posn_from_coords): Return both buffer/string
+ object and image object. Return glyph width and height.
+ (mode_line_string, marginal_area_string): Ditto.
+
+ * dispextern.h (buffer_posn_from_coords, mode_line_string)
+ (marginal_area_string): Fix prototypes.
+
+ * keyboard.h (POSN_POSN, POSN_SET_POSN): Rename macros from
+ POSN_BUFFER_POSN and POSN_SET_BUFFER_POSN. All uses changed.
+ (POSN_INBUFFER_P, POSN_BUFFER_POSN): New macros.
+
+ * keyboard.c (make_lispy_position): Use modified mode_line_string,
+ buffer_posn_from_coords, and marginal_area_string functions to
+ include both string object and image object in the lispy position.
+ Also add actual glyph width and height to position.
+ (read_key_sequence): Use real buffer position from mouse
+ event to find keymap property even when click is in marginal area.
+
+ * xdisp.c (note_mode_line_or_margin_highlight): Use modified
+ mode_line_string and marginal_area_string functions to handle
+ both string object and image object properties.
+
+2004-01-06 Andreas Schwab <[email protected]>
+
+ * syntax.c (skip_chars): Treat '-' at end of string as ordinary
+ character.
+
+2004-01-02 Andreas Schwab <[email protected]>
+
+ * macterm.c (emacs_options, x_initialized, same_x_server):
+ Remove unused (and duplicated) definitions.
+
+2004-01-02 Kim F. Storm <[email protected]>
+
+ * process.h (struct Lisp_Process): New members for adaptive read
+ buffering: adaptive_read_buffering, read_output_delay, and
+ read_output_skip.
+
+ * process.c (ADAPTIVE_READ_BUFFERING): New conditional.
+ (READ_OUTPUT_DELAY_INCREMENT, READ_OUTPUT_DELAY_MAX)
+ (READ_OUTPUT_DELAY_MAX_MAX): New constants.
+ (process_output_delay_count, process_output_skip): New vars.
+ (Vprocess_adaptive_read_buffering): New variable.
+ (make_process): Initialize adaptive read buffering members.
+ (Fstart_process): Set adaptive_read_buffering member.
+ (deactivate_process): Cleanup adaptive read buffering.
+ (wait_reading_process_input): Temporarily omit delayed
+ subprocesses from the set of file descriptors to read from;
+ adjust the select timeout if we skipped any subprocesses.
+ (read_process_output): Increase adaptive read buffering delay if
+ we read less than a full buffer; reduce delay when we read a
+ full buffer.
+ (send_process): Simplify using local Lisp_Process var.
+ Reset adaptive read buffering delay after write.
+ (init_process): Initialize process_output_delay_count and
+ process_output_skip.
+ (syms_of_process): DEFVAR_LISP Vprocess_adaptive_read_buffering.
+
+2004-01-01 Jason Rumney <[email protected]>
+
+ * w32term.c (w32_text_out): Use s->font, for consistency with callers.
+
+2003-12-30 Luc Teirlinck <[email protected]>
+
+ * print.c (Ferror_message_string): Add hyperlink in the docstring
+ to the definition of `signal' in the Elisp manual.
+ * eval.c (Fsignal): Ditto.
+
+2003-12-29 James Clark <[email protected]>
+
+ * fns.c (internal_equal): Return t for two NaN arguments.
+
+2003-12-29 Richard M. Stallman <[email protected]>
+
+ * data.c (store_symval_forwarding): Handle setting
+ default-fill-column, etc., by changing the value in
+ buffers that use the default.
+
+ * minibuf.c (Fset_minibuffer_window): Doc fix.
+
+ * fileio.c (choose_write_coding_system): Ignore auto_saving
+ if using the visited file for auto saves.
+ (Fwrite_region): Don't update SAVE_MODIFF
+ if auto-saving in visited file.
+
+2003-12-29 Kenichi Handa <[email protected]>
+
+ * dispextern.h (face_font_available_p): Extern it.
+
+ * fontset.c (Voverriding_fontspec_alist): New variable.
+ (lookup_overriding_fontspec): New function.
+ (fontset_ref_via_base): Call lookup_overriding_fontspec if necessary.
+ (fontset_font_pattern): Likewise.
+ (regulalize_fontname): New function.
+ (Fset_fontset_font): Call regulalize_fontname.
+ (Fset_overriding_fontspec_internal): New function.
+ (syms_of_fontset): Initialize and staticpro Voverriding_fontspec_alist.
+ Defsubr Sset_overriding_fontspec_internal.
+
+ * xfaces.c (face_font_available_p): New function.
+
+2003-12-28 Richard M. Stallman <[email protected]>
+
+ * buffer.c (Fother_buffer): Don't crash if BUF is nil
+ or if its name is nil.
+
+ * buffer.c (Fkill_buffer): Don't delete auto-save file
+ if it's the same as the visited file.
+
+2003-12-28 Luc Teirlinck <[email protected]>
+
+ * coding.c (Fcheck_coding_system): Doc fix.
+
+2003-12-28 Kim F. Storm <[email protected]>
+
+ * Makefile.in (eval.o): Depend on dispextern.h.
+
+ * dispnew.c (buffer_posn_from_coords): Fix calculation of dy for
+ image glyph using image's ascent.
+ (mode_line_string): Return image glyph as object clicked on.
+ Adjust y0 for image glyph using image's ascent.
+
+ * dispextern.h (FACE_ID_BITS, MAX_FACE_ID): New defines.
+ (struct glyph): New members, ascent and descent. Used to save
+ this glyph's ascent and descent, instead of having.
+ (struct glyph): Declare member face_id using FACE_ID_BITS.
+ (find_hot_spot): Add prototype.
+
+ * keyboard.c (Qimage): Remove extern (now in lisp.h).
+ (QCmap): Declare extern.
+ (make_lispy_position): When position is inside image hot-spot,
+ use hot-spot element's id as posn element.
+
+ * lisp.h (IMAGEP): New macro to test for image object type.
+ (Qimage): Declare extern.
+
+ * macfns.c (Qimage): Remove extern (now in lisp.h).
+ (valid_image_p, parse_image_spec): Use IMAGEP macro.
+
+ * macterm.c (Qface, Qmouse_face): Remove unused externs.
+
+ * w32fns.c (Qimage): Remove extern (now in lisp.h).
+ (valid_image_p, parse_image_spec): Use IMAGEP macro.
+
+ * w32menu.c (Qmouse_click, Qevent_kind): Remove unused externs.
+
+ * w32term.c (Qface, Qmouse_face): Remove unused externs.
+
+ * xdisp.c (Qarrow, Qhand, Qtext, Qpointer): New variables for
+ pointer types.
+ (Qrelative_width, Qalign_to): Remove unused variables.
+ (Vvoid_text_area_pointer): Replace Vshow_text_cursor_in_void.
+ (QCmap, QCpointer, Qrect, Qcircle, Qpoly): New variables for image
+ maps.
+ (x_y_to_hpos_vpos): Return glyph relative coordinates through new
+ dx and dy args. Remove buffer_only_p arg (always 0). Simplify
+ code accordingly.
+ (get_glyph_string_clip_rect): Draw cursor using glyph's rather
+ than row's ascent and height, to get sensible height on tall rows.
+ (build_desired_tool_bar_string): Remove Qimage extern.
+ (get_tool_bar_item): Fix call to x_y_to_hpos_vpos.
+ (produce_image_glyph): Adjust it.ascent to minimum row ascent if
+ image glyph is alone on the last line.
+ (append_glyph, append_composite_glyph, produce_image_glyph)
+ (append_stretch_glyph): Set glyph's ascent and descent.
+ (on_hot_spot_p): New function to check if position is inside an
+ rectangular, circular, or polygon-shaped image hot-spot,
+ (find_hot_spot): New function to search for image hot-spot.
+ (Flookup_image_map): New defun to search for image hot-spot.
+ (define_frame_cursor1): New aux function to determine frame
+ pointer.
+ (note_mode_line_or_margin_highlight, note_mouse_highlight): Handle
+ `pointer' text property and :pointer image property to control
+ frame pointer shape. Detect image hot-spots for pointer and
+ help_echo properties. Use define_frame_cursor1.
+ (note_mouse_highlight): Use Vvoid_text_area_pointer.
+ (syms_of_xdisp): Defsubr new defun. Intern and staticpro new
+ variables. DEFVAR_LISP Vvoid_text_area_pointer instead of
+ Vshow_text_cursor_in_void.
+
+ * xfaces.c (cache_face): Abort if c->size exceeds MAX_FACE_ID.
+
+ * xfns.c (x_set_mouse_color): Remove bogus x_check_errors call.
+ (Qimage): Remove extern (now in lisp.h).
+ (valid_image_p, parse_image_spec): Use IMAGEP macro.
+
+ * xmenu.c (show_help_event): Remove unused code.
+
+ * xterm.c (Qface, Qmouse_face): Remove unused externs.
+ (x_draw_hollow_cursor): Draw cursor using glyph's rather than
+ row's ascent and descent, to get a sensible height on tall rows.
+
+2003-12-25 Luc Teirlinck <[email protected]>
+
+ * minibuf.c (Fcompleting_read): Undo previous change.
+
+2003-12-25 Lars Hansen <[email protected]>
+
+ * dired.c (Fdirectory_files, Fdirectory_files_and_attributes):
+ Arguments GCPRO'ed in call to file name handler.
+
+2003-12-25 Thien-Thi Nguyen <[email protected]>
+
+ * termcap.c (tgetst1): Scan for "%pN"; if all
+ N are continuous in [1,9], remove all "%pN".
+
+2003-12-24 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c (xg_frame_set_char_size): Call x_wm_set_size_hint.
+
+ * xfaces.c (lface_fully_specified_p): Take into account that
+ MAC OS always have unspecified stipple.
+
+2003-12-24 Thien-Thi Nguyen <[email protected]>
+
+ * tparam.c (tparam1): Add handling for `%pN', which
+ means use param N for the next substitution.
+
+2003-12-24 Thien-Thi Nguyen <[email protected]>
+
+ * xfaces.c (Fcolor_gray_p): Fix omission bug:
+ In case `frame' is nil, consult the selected frame.
+ (Fcolor_supported_p): Likewise.
+
+2003-12-23 Luc Teirlinck <[email protected]>
+
+ * fns.c (Frandom, Fstring_make_multibyte, Fset_char_table_range):
+ Doc fixes.
+
+ * minibuf.c (read_minibuf): Allow INITIAL to be a cons of a string
+ and an integer. Adapt the introductory comment accordingly.
+ (Fread_from_minibuffer): Delete code moved into read_minibuf.
+ Doc fix.
+ (Fread_minibuffer, Fread_no_blanks_input): Adapt to changes in
+ read_minibuf.
+ (Fcompleting_read): Delete code moved into read_minibuf.
+ (Ftest_completion): Make it handle obarrays and hash tables correctly.
+
+2003-12-03 Kenichi Handa <[email protected]>
+
+ * coding.c (decode_coding_iso2022): Fix for preserving UTF-8
+ encoding sequence.
+
+2003-12-01 Kenichi Handa <[email protected]>
+
+ * composite.c (syms_of_composite): Don't make the compostion hash
+ table week.
+
+2003-11-30 Luc Teirlinck <[email protected]>
+
+ * intervals.h: Add EXFUN for Fget_char_property_and_overlay.
+ * textprop.c (Fget_char_property_and_overlay): New function.
+ (syms_of_textprop): Defsubr it.
+
+2003-11-29 Jan Dj,Ad(Brv <[email protected]>
+
+ * dispnew.c (buffer_posn_from_coords): Add ifdef HAVE_WINDOW_SYSTEM
+ to compile on terminal configuration.
+
+ * fileio.c (Fread_file_name): Check use_file_dialog also before
+ calling Fx_file_dialog.
+
+ * fns.c (use_file_dialog): New variable.
+ (syms_of_fns): DEFVAR_BOOL use-file-dialog.
+
+2003-11-29 Kim F. Storm <[email protected]>
+
+ * msdos.c (Qcursor_type, Qbar, Qhbar): Declare extern.
+ (syms_of_msdos): Don't intern and staticpro them.
+
+2003-11-27 Kim F. Storm <[email protected]>
+
+ * dispnew.c (buffer_posn_from_coords): Calculate and return pixel
+ coordinates relative to glyph at posn. If glyph is an image,
+ return that as object at posn. Callers changed.
+ (mode_line_string, marginal_area_string): Calculate and return
+ pixel coordinates relative to glyph. Callers changed.
+
+ * dispextern.h (buffer_posn_from_coords, mode_line_string)
+ (marginal_area_string): Fix prototypes.
+ (window_box_left_offset, window_box_right_offset): Add prototypes.
+
+ * frame.h (get_specified_cursor_type, get_window_cursor_type):
+ Remove prototypes.
+
+ * keyboard.h (EVENT_CLICK_COUNT, POSN_SCROLLBAR_PART): Fix defines.
+
+ * keyboard.c (make_lispy_position): Add x and y coordinates
+ relative to the current glyph as 7th element of position.
+ If glyph is an image, return it in the object element.
+ (read_key_sequence): Skip checks for keymap property in cases
+ where POSN_STRING is not a string (e.g. an image).
+
+ * xdisp.c (Vdisplay_pixels_per_inch): New variable.
+ (Vshow_text_cursor_in_void): New variable.
+ (glyph_to_pixel_coords): Don't use negative hpos.
+ (x_y_to_hpos_vpos): Fix for partially visible first glyph.
+ (append_stretch_glyph): Change ascent arg to be actual value
+ in pixels rather than ratio to height. Callers changed.
+ (calc_pixel_width_or_height): New aux function, implementing
+ pixel based artihmetic for glyph widths and heights.
+ (produce_stretch_glyph): Use calc_pixel_width_or_height for
+ :width, :height, :align-to, and :ascent, thus allowing these to
+ be specified in pixels as well as multiples of characters.
+ Don't produce stretch glyphs with zero width or height.
+ (get_specified_cursor_type): Declare static.
+ (get_window_cursor_type): Declare static. Add glyph arg to be
+ able to know when cursor is on an image; always substitute
+ hollow-box cursor for filled-box cursor on images, to avoid
+ negative images and flicker when blinking the cursor.
+ (display_and_set_cursor): Pass glyph to get_window_cursor_type.
+ (note_mode_line_or_margin_highlight): Use non-text cursor rather
+ than vertical scroll-bar cursor in display margins.
+ (note_mouse_highlight): Use non-text cursor rather than text
+ cursor in fringes and over images in the text area.
+ Use non-text cursor when mouse pointer is outside editable text,
+ i.e. in the void after end-of-line or end-of-buffer; this was
+ already done for W32, but is now standard for all systems --
+ user can toggle show-text-cursor-in-void to get old behaviour.
+ (syms_of_xdisp): DEFVAR_LISP Vshow_text_cursor_in_void and
+ Vdisplay_pixels_per_inch.
+
+2003-11-25 Andreas Schwab <[email protected]>
+
+ * fns.c (internal_equal) <case Lisp_Vectorlike>: Declare size as
+ EMACS_INT to not lose bits.
+ (Ffillarray): Don't set bits beyond the size of a bool vector.
+
+2003-11-25 Kim F. Storm <[email protected]>
+
+ * print.c (Fredirect_debugging_output) [!GNU_LINUX]: Do not
+ define this defun on systems that cannot use stderr as lvalue.
+
+2003-11-24 Gerd Moellmann <[email protected]>
+
+ * s/freebsd.h (LD_SWITCH_SYSTEM_TEMACS)
+ [__FreeBSD_version >= 500042]: Define as -znocombreloc because
+ ld's default is incompatible with unexec.
+
+2003-11-23 Kim F. Storm <[email protected]>
+
+ * window.c (enum window_loop): Add REDISPLAY_BUFFER_WINDOWS.
+ (window_loop): Handle REDISPLAY_BUFFER_WINDOWS.
+ (Fforce_window_update): New defun.
+ (syms_of_window): Defsubr it.
+ (Fset_window_margins, Fset_window_fringes): Doc fix.
+
+ * print.c (Fredirect_debugging_output): New defun.
+ (syms_of_print): Defsubr it.
+
+2003-11-22 Luc Teirlinck <[email protected]>
+
+ * fns.c (Fset_char_table_parent): Doc fix.
+
+2003-11-22 Kim F. Storm <[email protected]>
+
+ * dispnew.c (buffer_posn_from_coords): Return actual row/column
+ for glyph clicked on, rather than (unused) pixel positions.
+ (mode_line_string, marginal_area_string): Change X and Y args to
+ pointers for returning actual row/column for glyph clicked on.
+ Simplify and optimize loops.
+
+ * dispextern.h (mode_line_string, marginal_area_string):
+ Update prototypes.
+
+ * keyboard.c (make_lispy_position): New function for generating
+ mouse click positions from frame and pixel coordinates.
+ Enhanced to return buffer position and actual row/column for
+ events outside the text area using updated mode_line_string and
+ marginal_area_string functions.
+ Return left-fringe and right-fringe clicks as such, rather than
+ clicks in text area.
+ (make_lispy_event) [USE_X_TOOLKIT, USE_GTK]: Don't call
+ pixel_to_glyph_coords, as we never use the results.
+ (make_lispy_event): Use make_lispy_position for MOUSE_CLICK_EVENT,
+ WHEEL_EVENT, and DRAG_N_DROP_EVENT to replace redundant code.
+ Eliminate unused code in WHEEL_EVENT handling.
+ (make_lispy_movement): Use make_lispy_position.
+
+ * window.c (coordinates_in_window): Remove redundant tests.
+ Fix returned X pixel value for left-margin.
+
+ * xdisp.c (note_mode_line_or_margin_highlight): Adapt to new
+ mode_line_string and marginal_area_string parameters.
+
+2003-11-22 Lars Hansen <[email protected]>
+
+ * w32.c (struct the_group, getgrgid): Add.
+ * mac.c (struct my_group, getgrgid): Add.
+
+2003-11-21 Luc Teirlinck <[email protected]>
+
+ * fns.c (Fassq, Fassoc, Frassq, Frassoc): Doc fixes.
+
+2003-11-21 Lars Hansen <[email protected]>
+
+ * dired.c (Ffile_attributes): Add parameter ID-FORMAT and
+ include in call to file name handler. Optionally translate numeric
+ UID and GID to strings. Update docstring.
+ (directory_files_internal): Add parameter ID-FORMAT.
+ (Fdirectory_files_and_attributes): Add parameter ID-FORMAT and
+ include in call to file name handler and call to
+ directory_files_internal. Update Docstring.
+ (Fdirectory_files): Add dummy parameter in call to
+ directory_files_internal.
+ * lisp.h (Qinteger): Add.
+ (Qinteger_or_floatp, Qinteger_or_float_or_marker_p): Remove.
+ (Ffile_attributes): Add parameter.
+ * data.c (Qinteger): Export.
+
+2003-11-21 Luc Teirlinck <[email protected]>
+
+ * fns.c (Freverse, Fnreverse): Doc fixes.
+
+2003-11-19 Kim F. Storm <[email protected]>
+
+ * xdisp.c (init_iterator): Initialize it->start to position
+ before reseating (in case start position is invisible).
+ (init_to_row_start): Set it->start to row-start.
+ (redisplay_window): Accept optional_new_start if start position
+ is invisible (in which case IT_CHARPOS overshoots PT).
+ (display_line): Setup row->start from it->start (rather than
+ it->current which is wrong if first char on line is invisible).
+ When done, reseat it->start to it->current (= start of next row).
+ (expose_area): Fix exposure of text area when first char (e.g. TAB)
+ is only partially visible.
+
+ * dispextern.h (struct it): New member start.
+
+2003-11-17 Stefan Monnier <[email protected]>
+
+ * alloc.c (make_float, Fcons): Clear the markbit at init time.
+ (make_float, Fcons, Fmake_symbol, allocate_misc): Move the increment
+ of block_index outside of the macro call.
+ (Fgarbage_collect): Remove null code.
+
+ * m/amdx86-64.h: Don't redefine XPNTR.
+
+ * keyboard.c (parse_modifiers, apply_modifiers): Use INTMASK instead
+ of VALMASK.
+
+ * fns.c (hashfn_eq, hashfn_eql, hashfn_equal, hash_put)
+ (sxhash_string, sxhash): Use INTMASK instead of VALMASK.
+ (maybe_resize_hash_table): Use MOST_POSITIVE_FIXNUM.
+
+ * lisp.h (VALMASK): Only define for non-union type.
+ (MARKBIT): Remove.
+ (ARRAY_MARK_FLAG): Use previous value of MARKBIT.
+ (XTYPE): Define unconditionally.
+ (XSETTYPE): Remove one more remnant.
+ (EQ): Define differently for the union and non-union cases.
+ (INTMASK): New bit mask.
+ (struct Lisp_Marker): Move down to prepare for upcoming patch.
+ (GC_EQ): Delegate to EQ.
+
+ * coding.c (coding_restore_composition): Lisp_Object/int mixup.
+
+2003-11-17 Jan Dj,Ad(Brv <[email protected]>
+
+ * xterm.c (x_window_to_scroll_bar): Move check of display to
+ where window_id is compared.
+
+2003-11-17 Kim F. Storm <[email protected]>
+
+ * dispextern.h (struct it): New member first_vpos.
+
+ * xdisp.c (start_display): Set it->first_vpos.
+ (try_window_id): Use first_vpos to start display in first _text_
+ line if no reusable lines at start of window with header line.
+
+2003-11-16 Jan Dj,Ad(Brv <[email protected]>
+
+ * w32fns.c (XPutPixel):
+ * w32bdf.c (w32_init_bdf_font):
+ * sunfns.c (sel_read):
+ * process.c (Fmake_network_process):
+ * frame.c (store_frame_param):
+ * fontset.c (Fset_fontset_font):
+ * emacs.c (shut_down_emacs):
+ * ccl.c (ccl_driver): Remove period at end of error message.
+
+ * config.in: Regenerate.
+
+ * xfns.c (x_window_to_frame, x_any_window_to_frame)
+ (x_non_menubar_window_to_frame, x_menubar_window_to_frame)
+ (x_top_window_to_frame): Add Display* argument to xg_win_to_widget.
+ (x_create_bitmap_mask, xg_set_icon, create_frame_xic)
+ (xic_set_statusarea, x_window, gif_load): Formatting adjustments.
+
+ * xterm.h (struct x_display_info): New field xg_cursor for GTK.
+
+ * xterm.c: Add Display * to x_window_to_scroll_bar declaration.
+ (XTmouse_position, handle_one_xevent): Pass Display* to
+ x_window_to_scroll_bar.
+ (x_window_to_scroll_bar): Take a Display* argument.
+ Check that display for frame is equal to Display* argument.
+ (event_handler_gdk): Remove current_dpyinfo. Get dpyinfo from
+ x_display_info_for_display instead. Use Display in xev instead
+ of GDK_DISPLAY.
+ (x_dispatch_event): Call x_display_info_for_display.
+ (XTread_socket): Move GTK part out of loop. current_dpyinfo removed.
+ (x_connection_closed): Call xg_display_close for GTK.
+ (x_term_init): Call xg_display_open for additional displays.
+ Initiate dpyinfo->xg_cursor with call to xg_create_default_cursor
+ for GTK.
+
+ * xmenu.c (single_menu_item, mouse_position_for_popup)
+ (x_activate_menubar): Formatting adjustments.
+
+ * xdisp.c (update_tool_bar, redisplay_tool_bar): Formatting
+ adjustments.
+
+ * gtkutil.c (xg_get_gdk_display, xg_set_screen, xg_display_open)
+ (xg_display_close, xg_create_default_cursor)
+ (xg_get_gdk_pixmap_and_mask): New functions for multiple display
+ handling.
+ (xg_left_ptr_cursor): Remove.
+ (xg_set_cursor): Change cursor to GdkCursor*. Do not create
+ cursor here.
+ (xg_win_to_widget): Take Display* argument, call
+ gdk_xid_table_lookup_for_display.
+ (xg_create_frame_widgets, xg_get_file_name, create_menus)
+ (xg_create_widget, xg_modify_menubar_widgets): Call xg_set_screen.
+ (xg_create_widget, xg_create_scroll_bar): Use xg_cursor
+ in FRAME_X_DISPLAY_INFO.
+ (xg_get_scroll_id_for_window): Take Display* argument.
+ (update_frame_tool_bar): Call xg_get_gdk_pixmap_and_mask.
+ (xg_initialize): Remove xg_left_ptr_cursor.
+
+ * gtkutil.h (xg_get_scroll_id_for_window, xg_win_to_widget): Add
+ Display* argument.
+ (xg_display_open, xg_display_close, xg_create_default_cursor): Declare.
+
+2003-11-14 Jan Dj,Ad(Brv <[email protected]>
+
+ * xterm.c (x_detect_focus_change): Do not change focus frame for
+ Enter/LeaveNotify if the current focus frame has explicit focus.
+
+2003-11-14 Kim F. Storm <[email protected]>
+
+ * dispnew.c (update_text_area): Fix redisplay error when hscroll
+ is active and first glyph is only partially visible.
+
+2003-11-13 Kenichi Handa <[email protected]>
+
+ * xdisp.c (select_frame_for_redisplay): New function.
+ (redisplay_internal): Record also selected_frame for
+ unwind_redisplay. Call select_frame_for_redisplay before
+ redrawing each frame.
+ (unwind_redisplay): Argument changed to a cons.
+
+2003-11-12 Luc Teirlinck <[email protected]>
+
+ * fns.c (Fstring_to_multibyte): Doc fix.
+
+2003-11-11 Kenichi Handa <[email protected]>
+
+ * xterm.c (x_list_fonts): Fix excluding of auto-scaled fonts.
+
+2003-11-09 Jan Dj,Ad(Brv <[email protected]>
+
+ * xfns.c (x_window): Set XtNx and XtNy in shell widget for
+ program specified positions.
+
+2003-11-08 Jan Dj,Ad(Brv <[email protected]>
+
+ * xterm.c (XAW_ARROW_SCROLLBARS): Define it for Xaw 1.5E.
+
+2003-11-08 Kenichi Handa <[email protected]>
+
+ * Makefile.in (lisp): Add kannada.el.
+ (shortlisp): Likewise.
+
+2003-11-07 Kenichi Handa <[email protected]>
+
+ * coding.c (coding_allocate_composition_data):
+ Reset coding->composing to COMPOSITION_NO.
+ (coding_restore_composition): Detect invalid composition data.
+ Give Fstring and Fvector a Lispy integer, not C int.
+
+2003-11-05 Stefan Monnier <[email protected]>
+
+ * floatfns.c (Flogb): Don't use VALMASK.
+
+ * m/amdx86-64.h (VALBITS, XINT, XUINT): Remove.
+ * m/ia64.h (VALBITS, XINT, XUINT): Remove.
+
+ * lisp.h (XINT): Move the cast to clarify what is going on.
+ (GCTYPEMASK, XSETTYPE): Remove.
+ (XGCTYPE): Make it an alias of XTYPE.
+
+2003-11-03 Jan Dj,Ad(Brv <[email protected]>
+
+ * xterm.c (x_term_init): Fix formatting.
+
+2003-11-02 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.h (xg_have_tear_offs): Declare.
+ (xg_keep_popup, xg_did_tearoff): Remove.
+
+ * gtkutil.c: Remove variable xg_did_tearoff.
+ (xg_have_tear_offs): New function.
+ (tearoff_remove): Just decrease xg_detached_menus.
+ (tearoff_activate): Increase xg_detached_menus and call
+ tearoff_remove when tearoff is removed.
+ (xg_keep_popup): Remove function.
+ (create_menus): Give add_tearoff_p as argument to recursive
+ call to create_menus.
+ (xg_create_widget): Use variables instead of multiple
+ strcmp. Tell create_menus to create tear off only for
+ menu bar menus.
+ (xg_update_menubar): Change title for a detached menu also.
+ (xg_modify_menubar_widgets): Always call xg_update_menubar, regardless
+ of deep_p.
+ (xg_initialize): Initialize xg_detached_menus, remove
+ initialization of xg_did_tearoff.
+
+ * xmenu.c (set_frame_menubar): For GTK, set deep_p if
+ xg_have_tear_offs returns non-zero.
+ (create_and_show_popup_menu): Remove setting of xg_did_tearoff and
+ call to xg_keep_popup.
+
+2003-11-01 Andrew Choi <[email protected]>
+
+ * macterm.c (XTread_socket): Handle menubar selection and grow
+ window only for mouseDown events.
+
+2003-10-31 Jan Dj,Ad(Brv <[email protected]>
+
+ * xterm.c (x_term_init): For GTK part, increase x_initialized
+ to check for more than one display. Use error instead of return 0.
+
+2003-10-31 Andrew Choi <[email protected]>
+
+ * unexmacosx.c (unrelocate): New function (contributed by Nozomu Ando).
+ (copy_dysymtab): Call it.
+
+2003-10-31 Luc Teirlinck <[email protected]>
+
+ * eval.c (Fdefvaralias): Doc fix.
+
+2003-10-26 Luc Teirlinck <[email protected]>
+
+ * data.c (Fsetplist): Doc fix.
+
+2003-10-14 Lute Kamstra <[email protected]>
+
+ * window.c (Fset_window_fringes): Clarify docstring.
+
+2003-10-14 Kim F. Storm <[email protected]>
+
+ * window.c (Fset_window_margins): Simplify arg checking.
+
+2003-10-13 Richard M. Stallman <[email protected]>
+
+ * regex.c (MAX_BUF_SIZE): Reduce to 2**15.
+ (print_partial_compiled_pattern): Replace assert with a printout.
+ (skip_noops, mutually_exclusive_p): Change args, values to re_char *.
+
+ * alloc.c (lisp_align_malloc): If BASE is 0, call memory_full.
+
+ * window.c (Fset_window_margins): Allow only integers as args.
+ (syms_of_window) <special-display-buffer-names,
+ special-display-regexps>: Doc fixes.
+
+2003-10-13 Lute Kamstra <[email protected]>
+
+ * window.c (Fset_window_fringes): Elaborate docstring.
+
+2003-10-12 Andrew Choi <[email protected]>
+
+ * macterm.c (XTread_socket): Call DragWindow only for mouseDown events.
+
+ * s/darwin.h (GC_MARK_STACK): Define.
+
+2003-10-12 Jan Dj,Ad(Brv <[email protected]>
+
+ * window.c (shrink_windows): New function.
+ (size_window): Call shrink_windows to calculate window sizes when
+ shrinking frame with more than one window.
+
+2003-10-12 Kim F. Storm <[email protected]>
+
+ * xdisp.c (compute_fringe_widths): Doc fix.
+
+2003-10-08 Kenichi Handa <[email protected]>
+
+ * coding.c (Fcoding_system_p): Return t for auto-loading coding system.
+
+2003-10-07 Kenichi Handa <[email protected]>
+
+ * coding.c (Qcoding_system_define_form): New variable.
+ (syms_of_coding): Intern and staticpro it.
+ (Fcheck_coding_system): Try to autoload the definition of
+ CODING-SYSTEM.
+
+2003-10-05 Luc Teirlinck <[email protected]>
+
+ * fns.c (Frequire): Doc fix.
+
+2003-10-05 Jan Dj,Ad(Brv <[email protected]>
+
+ * xfns.c (Fx_send_client_event): New function as a base for
+ manipulating extended window manager hints.
+ (Fx_send_client_event): Remove unused variable s.
+
+ * w32term.c (w32_read_socket): Remove call to x_check_fullscreen_move,
+ that function is removed.
+
+ * xterm.c (x_set_offset): Use move_offset_left/top instead of
+ x/y_pixels_outer_diff.
+ (x_check_expected_move): Calculate move_offset_left/top.
+
+ * xterm.h (struct x_output): New members: move_offset_top/left.
+
+ * frame.c (x_set_frame_parameters): Remove x_fullscreen_move,
+ call x_set_offset directly.
+
+ * frame.h (enum): FULLSCREEN_MOVE_WAIT removed.
+
+ * frame.c (Fdelete_frame): Free decode_mode_spec_buffer.
+
+ * xterm.c (x_delete_display): Free font names and font_encoder
+ in dpyinfo->font_table.
+
+ * xfns.c (Fx_close_connection): Only call XFreeFont here.
+ Move xfree of font names to x_delete_display.
+
+ * xterm.h (struct x_display_info): New member, wm_type.
+ (struct x_output): New members, expected_top/left and
+ check_expected_move.
+
+ * xterm.c (handle_one_xevent): Reset wm_type when ReparentNotify
+ is received.
+ (handle_one_xevent): Rename x_check_expected_move from
+ x_check_fullscreen_move.
+ (x_set_offset): Only add WM decoration sizes to modified_top/left
+ for X_WMTYPE_A. Set check_expected_move when WM type is unknown.
+ (x_check_expected_move): Rename from x_check_fullscreen_move.
+ Removed fullscreen specific code. Use check_expected_move,
+ expected_left/top instead. Also, set wm_type.
+ (x_term_init): Initialize wm_type to unknown.
+
+ * frame.c (x_fullscreen_move): Remove addition of WM decoration
+ sizes to move_x/y.
+
+2003-10-03 Kenichi Handa <[email protected]>
+
+ * macterm.c (x_load_font): Clear all members of FONTP before start
+ filling them.
+
+2003-10-02 Kenichi Handa <[email protected]>
+
+ * fontset.c (fs_load_font): Don't set fontp->font_encoder to NULL
+ before calling find_ccl_program_func. Call find_ccl_program_func
+ only when fontp->font_encoder is not NULL.
+
+ * xterm.c (x_load_font): Clear all members of FONTP before start
+ filling them.
+
+2003-10-03 John Paul Wallington <[email protected]>
+
+ * keymap.c (map_keymap): Don't abort when binding is a vector.
+
+2003-10-02 Jason Rumney <[email protected]>
+
+ * makefile.w32-in (emacs.o, coding.o, bytecode.o):
+ Sync dependencies with Makefile.in.
+ (alloca.o): Remove.
+
+ * w32fns.c (w32_load_system_font): Clear all members of FONTP before
+ filling them.
+
+ * w32bdf.c (w32_load_bdf_font): Likewise.
+
+2003-09-30 Richard M. Stallman <[email protected]>
+
+ * term.c (set_tty_color_mode): Calculate current_mode_spec
+ regardless of value of VAL.
+
+ * intervals.c (graft_intervals_into_buffer):
+ Set BUF_INTERVALS (buffer)->up_obj when appropriate.
+ Handle over_used when splitting UNDER.
+
+2003-09-30 YAMAMOTO Mitsuharu <[email protected]>
+
+ * regex.c (regex_compile): Free the stack when returning from function.
+
+2003-09-28 Kenichi Handa <[email protected]>
+
+ * fontset.c (Finternal_char_font): Change return value to
+ cons (FONT-NAME . GLYPH-CODE).
+
+2003-09-28 Eli Zaretskii <[email protected]>
+
+ * term.c (tty_setup_colors): Treat any negative argument as -1.
+
+2003-09-27 Gaute B Strokkenes <[email protected]> (tiny change)
+
+ * process.c (send_process): Delete unused temp_buf.
+
+2003-09-26 Dave Love <[email protected]>
+
+ * xterm.c (x_bitmap_mask): Declare.
+
+2003-09-25 Dave Love <[email protected]>
+
+ * Makefile.in (fns.o): Depend on md5.h.
+
+2003-09-25 Kim F. Storm <[email protected]>
+
+ * window.c (set_window_buffer): Fix redisplay problems when
+ switching between buffers with different display margin widths.
+
+2003-09-23 Kim F. Storm <[email protected]>
+
+ * process.c (set_socket_option): Fix :bindtodevice option.
+ (Fset_network_process_option): Update process contact list when
+ setting option succeeds.
+ (Fmake_network_process): Doc fix.
+
+2003-09-23 Dave Love <[email protected]>
+
+ * process.c (Fnetwork_interface_info): Use HAVE_STRUCT_IFREQ... macros.
+
+2003-09-22 Eli Zaretskii <[email protected]>
+
+ * term.c (set_tty_color_mode): Use INTEGERP to test whether a
+ color mode is an integer number (it could be -1).
+
+2003-09-22 Richard M. Stallman <[email protected]>
+
+ * intervals.c (graft_intervals_into_buffer): Correct the main loop
+ in the case where OVER is longer than UNDER.
+
+2003-09-22 Masatake YAMATO <[email protected]>
+
+ * window.c (Fset_window_scroll_bars): Validate the value of
+ `vertical_type'.
+
+2003-09-21 Kim F. Storm <[email protected]>
+
+ * frame.c (Vdefault_frame_scroll_bars): New variable.
+ (x_set_vertical_scroll_bars): Use it instead of hardcoded values.
+ (syms_of_frame): DEFVAR_LISP it, and initialize according to
+ window-system default scroll bar position.
+
+ * window.c (Fwindow_scroll_bars): Doc fix.
+
+2003-09-19 Jan Dj,Ad(Brv <[email protected]>
+
+ * xterm.c (x_set_offset): Take window manager decorations into account.
+
+2003-09-19 Richard M. Stallman <[email protected]>
+
+ * atimer.h: Don't include lisp.h.
+ (P_): Define it here (as well as elsewhere).
+
+ * print.c (Fprin1_to_string): Move the PRINTPREPARE
+ later, so that PRINTFINISH won't unbind Qinhibit_modification_hooks.
+
+ * data.c (Fvariable_binding_locus): New function.
+ (syms_of_data): defsubr it.
+ (Flocal_variable_p): Delete duplicate call to indirect_variable.
+
+2003-09-18 Dave Love <[email protected]>
+
+ * alloc.c (GC_MALLOC_CHECK): Move conditional undef after lisp.h.
+
+ * process.c (Fnetwork_interface_info): Fix type error.
+ (Fnetwork_interface_list): Doc fix.
+ (read_process_output, read_process_output): Delete unused var.
+
+2003-09-17 Kim F. Storm <[email protected]>
+
+ * process.c (Fnetwork_interface_list, Fnetwork_interface_info):
+ Require HAVE_NET_IF_H and HAVE_SYS_IOCTL_H to include these fns.
+ (Fnetwork_interface_info): Check that ifreq struct has required
+ fields before accessing them; this requires that those fields are
+ defined as macros, which may be too restrictive on some platforms,
+ but it is better than failing on other platforms.
+ (syms_of_process): Only defsubr above fns when included.
+
+2003-09-17 Dave Love <[email protected]>
+
+ * unexalpha.c: Don't include varargs.h.
+
+2003-09-17 Kim F. Storm <[email protected]>
+
+ * process.c (Fset_process_sentinel): Add sentinel to childp plist
+ for network process.
+ (socket_options): Add `:' prefix to option names. Add optbit field.
+ (set_socket_option): Remove no_error arg and special handling of s < 0.
+ Return 1<<optbit for known option, 0 for unknown.
+ Do not interpret 0 as false for boolean option (only nil).
+ Pass failed option and value to report_file_error.
+ (Fset_network_process_options): Replace by Fset_network_process_option.
+ (Fset_network_process_option): New function to set just one option.
+ (Fmake_network_process): Allow :coding arg to be a cons.
+ Allow :server arg to be an integer specifying backlog size.
+ Remove :options arg, and allow options to be specified directly
+ as :KEY, VALUE pairs. Parse these options before binding socket.
+ As before, :reuseaddr t is default for a server process, but this
+ can now be disabled by specifying :reuseaddr nil.
+ (Fnetwork_interface_info): Rename from Fget_network_interface_info.
+ (init_process): Availability of network options is now checked with
+ simpler syntax (featurep 'make-network-process :OPTION); use loop to
+ setup features.
+ (syms_of_process): Fix defsubr's for the replaced functions.
+
+2003-09-16 Dave Love <[email protected]>
+
+ * Makefile.in: Depend on coding.h.
+
+2003-09-14 Kim F. Storm <[email protected]>
+
+ * process.c [HAVE_SOCKETS]: Include sys/ioctl.h and net/if.h.
+ (Fnetwork_interface_list, Fget_network_interface_info): New defuns.
+ (syms_of_process): Defsubr them.
+
+ * config.in: Regenerate.
+
+2003-09-12 Stefan Monnier <[email protected]>
+
+ * m/sr2k.h (XMARKBIT, XUNMARK): Remove.
+ * m/news-r6.h (XUNMARK): Remove.
+ * m/mips.h (XUNMARK): Remove.
+ * m/mips-siemens.h (XUNMARK): Remove.
+ * m/iris4d.h (XUNMARK): Remove.
+ * m/hp800.h (XMARKBIT, XUNMARK): Remove.
+
+2003-09-11 Stefan Monnier <[email protected]>
+
+ * lisp.h (VALBITS): Don't remove 1 for the markbit.
+ (union Lisp_Object): Use unsigned int for types. Remove markbit.
+ (MARKBIT): Remove 1 from VALBITS so we still use same old val.
+ (XTYPE): Use unsigned right-shift.
+ (XMARKBIT, XMARK, XUNMARK): Remove.
+
+ * alloc.c (init_intervals, init_symbol, init_marker):
+ Don't preallocate anything.
+ (Fgarbage_collect, mark_object): Ignore the markbit.
+
+ * bytecode.c (mark_byte_stack, unmark_byte_stack): Ignore the markbit.
+
+2003-09-08 Lute Kamstra <[email protected]>
+
+ * xdisp.c (pint2hrstr): New function.
+ (decode_mode_spec): Add `%i' and `%I' specs.
+ * buffer.c (syms_of_buffer): Document `%i' and `%I' constructs
+ for `mode-line-format'.
+
+2003-09-07 Andreas Schwab <[email protected]>
+
+ * alloc.c: Use long instead of int when casting ABLOCKS_BUSY to
+ avoid warning.
+
+2003-09-07 Eli Zaretskii <[email protected]>
+
+ * editfns.c (region_limit): Support any non-zero value of BEGINNINGP.
+
+2003-09-03 Kim F. Storm <[email protected]>
+
+ * xdisp.c (get_window_cursor_type): Partially undo 2002-03-01
+ change (superseded by 2002-08-30 change); the default blink-off
+ cursor is now again "no cursor".
+
+2003-09-01 Jason Rumney <[email protected]>
+
+ * makefile.w32-in (alloca.o): Remove.
+ (coding.o): Depend on intervals.h
+ (emacs.o, bytecode.o): Depend on window.h.
+
+2003-09-01 Dave Love <[email protected]>
+
+ * Makefile.in (alloca.o): Remove commands.
+ (coding.o): Depend on intervals.h composite.h window.h.
+ (emacs.o): Depend on window.h keyboard.h keymap.h.
+ (gtkutil.o): Depend on keyboard.h charset.h coding.h.
+ (bytecode.o): Depend on window.h.
+
+2003-08-31 Jason Rumney <[email protected]>
+
+ * w32term.c (w32_per_char_metric): Allow cached metrics to be
+ returned even when font_type is unknown.
+
+ * xdisp.c (init_iterator): Remove old WINDOWSNT conditional.
+
+2003-08-30 Jan Dj,Ad(Brv <[email protected]>
+
+ * xterm.c (x_term_init): Initialize new fields in x_display_info.
+
+ * xterm.h (struct x_display_info): Add red/green/blue_bits and
+ *_offset.
+
+ * xfns.c (lookup_rgb_color): Use new fields in x_display_info to
+ calculate pixel value.
+
+2003-08-29 Gerd Moellmann <[email protected]>
+
+ * xdisp.c (redisplay_internal): Fix change of 2003-04-30.
+ Don't tell redisplay display is accurate when it's actually been
+ paused for pending input.
+
+2003-08-29 Richard M. Stallman <[email protected]>
+
+ * dispnew.c (adjust_glyph_matrix): Call window_box
+ whenever W is nonzero.
+
+ * data.c (Fmake_variable_buffer_local, Fmake_local_variable)
+ (Fkill_local_variable, Fmake_variable_frame_local)
+ (Flocal_variable_p, Flocal_variable_if_set_p):
+ Use indirect_variable to trace thru variable aliases.
+
+ * config.in: Updated.
+
+ * callint.c (Fcall_interactively): Save and restore
+ Vthis_command, Vthis_original_command, real_this_command,
+ and current_kboard->Vlast_command.
+
+ * abbrev.c (Fexpand_abbrev): Insert before deleting.
+
+2003-08-29 Gerd Moellmann <[email protected]>
+
+ * xfns.c (lookup_rgb_color): Handle TrueColor visuals specially.
+
+2003-08-28 David Abrahams <[email protected]> (tiny change)
+
+ * coding.c (decode_coding_iso2022): Initialize local variable c2.
+ (decode_coding_sjis_big5): Likewise.
+
+2003-08-27 Jason Rumney <[email protected]>
+
+ * w32.c (sys_pipe): Protect against file descriptor overflow.
+
+ * w32fns.c (syms_of_w32fns): Remove non-existent functions.
+
+ * w32term.c (w32_read_socket): Fix WM_MOUSEWHEEL assignment.
+
+2003-08-26 Terje Rosten <[email protected]>
+
+ * xfns.c (Vgtk_version_string): New variable.
+ (syms_of_xfns): DEFVAR_LISP it. Provide gtk.
+
+2003-08-24 Eli Zaretskii <[email protected]>
+
+ * term.c (term_init): Remove `const' from buffer_size's declaration.
+
+ * Makefile.in (msdos.o): Depend on intervals.h.
+
+ * msdos.c: Include intervals.h, since STRING_INTERVALS requires that.
+
+2003-08-21 Jan Dj,Ad(Brv <[email protected]>
+
+ * xterm.h (struct x_display_info): New fields: client_leader_window
+ and Xatom_wm_client_leader.
+
+ * xterm.c (x_initialize): Move call to x_session_initialize to ...
+ (x_term_init): ... here. Initialize client_leader fields in dpyinfo.
+
+ * xsmfns.c (create_client_leader_window): New function.
+ (x_session_initialize): Call create_client_leader_window, take
+ dpyinfo as argument.
+
+ * xfns.c (Fx_create_frame): Set property WM_CLIENT_LEADER.
+
+ * Makefile.in (xsmfns.o): Add more depenedencies.
+
+2003-08-21 Dave Love <[email protected]>
+
+ * m/iris4d.h: Use _MIPS_SZLONG, not _LP64.
+
+2003-08-21 Kenichi Handa <[email protected]>
+
+ * term.c (term_init): Fix previous change; don't rely on the
+ length of `buffer' if TERMINFO is defined.
+
+2003-08-20 Dave Love <[email protected]>
+
+ * atimer.h: Include lisp.h.
+
+ * lisp.h (EMACS_LISP_H): New.
+ (popup_activated_flag): Don't declare.
+
+ * alloca.c: Some merging with gnulib. Change logic and doc
+ concerning (x)malloc/(x)free -- no longer Emacs-specific.
+ [DO_BLOCK_INPUT]: Don't include lisp.h.
+ (xmalloc, xfree): Declare.
+ (malloc): Don't declare.
+
+ * Makefile.in (LWLIB_OPTIONS): Remove (unused).
+ (alloca.o): Remove obsolete stuff concerning alloca.s. Depend on
+ atimer.h, blockinput.h.
+
+ * alloc.c (lisp_align_malloc): Change type of `aligned'.
+
+ * alloca.s: Remove.
+
+2003-08-19 Gerd Moellmann <[email protected]>
+
+ * s/freebsd.h [__FreeBSD_version >= 400000]: Define TERMINFO,
+ use -lncurses.
+
+ * term.c (term_init): Use a buffer of size 4096 for tgetent since
+ FreeBSD returns something longer than 2044. Abort if the end of
+ the buffer is overwritten.
+
+2003-08-19 Miles Bader <[email protected]>
+
+ * xterm.c (x_term_init): Correctly use result of Ffile_readable_p.
+
+2003-08-19 Gerd Moellmann <[email protected]>
+
+ * alloc.c (lisp_align_malloc): Check for memory full when
+ allocating ablocks, which also avoids freeing a pointer into an
+ ablocks structure.
+
+ * puresize.h (BASE_PURESIZE): Increase to 1100000.
+
+ * buffer.c (Fmove_overlay): Set overlay's next pointer unconditionally.
+
+2003-08-16 Richard M. Stallman <[email protected]>
+
+ * editfns.c (Fencode_time): Doc fix.
+
+2003-08-16 David Ponce <[email protected]>
+
+ * fileio.c (Fwrite_region): Fix conditional expression to issue
+ the right message.
+
+2003-08-16 Juri Linkov <[email protected]>
+
+ * syntax.c (Fforward_word): Argument changed to optional.
+ Set default value to 1.
+
+2003-08-15 Kenichi Handa <[email protected]>
+
+ * xfaces.c (better_font_p): Prefer a real scalable font; i.e. not
+ what autoscaled.
+ (best_matching_font): Once we find a better scalable font, set
+ non_scalable_has_exact_height_p to 1.
+ (try_font_list): Call try_alternative_families to try any family
+ with the given registry.
+
+2003-08-09 Andreas Schwab <[email protected]>
+
+ * alloc.c (mark_object): Handle Lisp_Misc_Save_Value.
+
+ * print.c (print_string): Fix printing of multibyte string with
+ nontrivial printcharfun.
+
+2003-07-31 Jan Dj,Ad(Brv <[email protected]>
+
+ * xfns.c (xg_set_icon): Rewrite to compile with GTK 2.0 and 2.2.
+
+ * xterm.c (x_bitmap_icon): Return if xg_set_icon succeeds.
+
+2003-07-31 Kenichi Handa <[email protected]>
+
+ * process.c (read_process_output): Return the actually read bytes
+ instead of the result of decoding.
+
+2003-07-31 Kenichi Handa <[email protected]>
+
+ * xterm.h (struct x_bitmap_record): New member have_mask.
+
+ * xfns.c (x_create_bitmap_from_data): Initialize have_mask member
+ to 0.
+ (x_create_bitmap_from_file): Likewise.
+ (x_destroy_bitmap): Check have_mask member before freeing a mask.
+ (x_destroy_all_bitmaps): Likewise.
+ (x_create_bitmap_mask): Set have_mask member to 1.
+
+2003-07-30 Richard M. Stallman <[email protected]>
+
+ * Makefile.in (CFLAGS) [!OPTIMIZE]: Undo previous change.
+
+2003-07-29 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c (xg_mark_data): Update calls to mark_object.
+
+2003-07-29 Richard M. Stallman <[email protected]>
+
+ * xterm.c (xim_open_dpy, xim_initialize, xim_close_dpy):
+ Conditionalize XIM code on HAVE_XIM.
+
+ * fns.c (Fclear_string): New function.
+ (syms_of_fns): defsubr it.
+
+2003-07-28 KOBAYASHI Yasuhiro <[email protected]>
+
+ * xfns.c (xic_set_preeditarea): Add the left fringe width to spot.x.
+
+2003-07-22 Stefan Monnier <[email protected]>
+
+ * xfns.c: Don't check HAVE_PNG_H: autoconf doesn't seem to find it.
+
+ * buffer.c (delete_all_overlays): New function.
+ * buffer.h (delete_all_overlays): Declare.
+ * coding.c (run_pre_post_conversion_on_str):
+ * print.c (temp_output_buffer_setup):
+ * fileio.c (Finsert_file_contents):
+ * minibuf.c (get_minibuffer): Use it.
+
+2003-07-22 Andrew Choi <[email protected]>
+
+ * unexmacosx.c (unexec_regions_sort_compare):
+ (unexec_regions_merge): New functions. Sort and merge unexec
+ regions before dumping them.
+
+2003-07-22 Dave Love <[email protected]>
+
+ * xfns.c [HAVE_PNG]: Consider both png.h and libpng/png.h.
+
+2003-07-21 Stefan Monnier <[email protected]>
+
+ * alloc.c (MARK_STRING, UNMARK_STRING, STRING_MARKED_P)
+ (GC_STRING_CHARS, string_bytes): Use ARRAY_MARK_FLAG rather than
+ MARKBIT as the gcmarkbit for strings.
+
+2003-07-21 Richard M. Stallman <[email protected]>
+
+ * s/openbsd.h (LD_SWITCH_SYSTEM_TEMACS): Add undef.
+
+ * fns.c (Flocale_info): Rename from Flanginfo. Doc fixes.
+ (syms_of_fns): Corresponding change.
+
+ * alloc.c (syms_of_alloc): Doc fixes.
+
+2003-07-20 Han Boetes <[email protected]> (tiny change)
+
+ * s/netbsd.h: Use -Wl syntax.
+
+2003-07-17 Richard M. Stallman <[email protected]>
+
+ * xterm.c (xim_initialize): Redo 6/24 change.
+
+2003-07-15 Stefan Monnier <[email protected]>
+
+ * buffer.c (copy_overlays): Use EMACS_INT for positions.
+ (Fswitch_to_buffer): Don't signal an error when switching to the same
+ buffer in a dedicated window.
+
+ * alloc.c: Use bitmaps for cons, as was done for floats.
+ (init_float, init_cons): Let the normal code allocate the first block.
+ (CONS_BLOCK_SIZE): Redefine based on BLOCK_BYTES and bitmap size.
+ (CONS_BLOCK, CONS_INDEX, CONS_MARKED_P, CONS_MARK, CONS_UNMARK):
+ New macros.
+ (struct cons_block): Move conses to the beginning. Add gcmarkbits.
+ (Fcons): Use lisp_align_malloc and CONS_UNMARK.
+ (live_cons_p): Check the pointer is not past the `conses' array.
+ (mark_maybe_object, mark_maybe_pointer): Use CONS_MARKED_P.
+ (mark_object, mark_buffer): Use CONS_MARKED_P and CONS_MARK.
+ (survives_gc_p): Use CONS_MARKED_P and simplify.
+ (gc_sweep): Use CONS_MARKED_P, CONS_UNMARK, and lisp_align_free.
+
+2003-07-13 Paul Eggert <[email protected]>
+
+ GCC 3.3 (sparc) no longer puts "int foo = 0;" into data; it
+ puts it into BSS instead, at least on Solaris 8 and 9.
+ This is a valid optimization, and it may occur on other platforms,
+ so Emacs should not assume that initializing a static variable to
+ zero puts it into data.
+ * alloc.c (pure, staticvec):
+ Initialize these arrays to nonzero, so that they're not
+ put into BSS by that optimization.
+
+2003-07-13 Stefan Monnier <[email protected]>
+
+ * alloc.c (BLOCK_PADDING): Rename from ABLOCKS_PADDING. Update users.
+ (lisp_align_malloc): Use posix_memalign is available.
+ (ABLOCKS_BASE): Use HAVE_POSIX_MEMALIGN as an optimization.
+ (STRING_BLOCK_SIZE): Rename from STRINGS_IN_STRING_BLOCK
+ for consistency. Update users.
+
+2003-07-13 Richard M. Stallman <[email protected]>
+
+ * s/netbsd.h (START_FILES_1, END_FILES_1): Always define them.
+
+2003-07-13 Terje Rosten <[email protected]>
+
+ * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap): Modify to add mask,
+ and use the Gtk+ function gtk_window_icon_from_file if available.
+
+ * xfns.c (x_bitmap_mask, x_create_bitmap_mask): New functions to
+ handle mask of bitmaps.
+ (x_allocate_bitmap_record, x_destroy_bitmap): Modify to handle the
+ mask property.
+ (xg_set_icon): New function, wrapper for gtk_window_icon_from_file.
+
+ * xterm.h (xg_set_icon): New function.
+
+2003-07-12 Paul Eggert <[email protected]>
+
+ * unexelf.c (unexec): Consider a section to precede the .bss
+ section if its addresses overlap that of .bss.
+
+2003-07-12 Richard M. Stallman <[email protected]>
+
+ * Makefile.in (CFLAGS) [!OPTIMIZE]: Set CFLAGS to -g.
+
+ * config.in (HAVE_CRTIN): Add #undef.
+ (INLINE): Really inline only if OPTIMIZE is defined.
+
+ * s/netbsd.h (START_FILES, LIB_STANDARD): Use START_FILES_1,
+ END_FILES_1.
+ (START_FILES_1, END_FILES_1): New macros (conditional).
+ (LD_SWITCH_SYSTEM_TEMACS): Define.
+
+ * s/openbsd.h: Don't include bsd4-3.h.
+ (TERMINFO): Define.
+ (LIBS_TERMCAP): Define.
+ (LD_SWITCH_SYSTEM): Define (two definitions).
+
+ * xfns.c: Include libpng/png.h instead of png.h.
+
+2003-07-11 Andreas Schwab <[email protected]>
+
+ * buffer.c (modify_overlay): Update prototype.
+ * lisp.h (adjust_overlays_for_insert, adjust_overlays_for_delete):
+ Likewise.
+
+2003-07-09 Stefan Monnier <[email protected]>
+
+ * lisp.h (VALBITS): Define in terms of GCTYPEBITS.
+ (struct interval): Move to intervals.h.
+ (struct Lisp_Marker): Use EMACS_INT for position info.
+ (forward_point): Remove prototype of defunct function.
+ (Qmodification_hooks, Qrear_nonsticky, Fnext_property_change)
+ (Fget_text_property, Fset_text_properties, Ftext_propertes_not_all)
+ (syms_of_textprop, set_text_properties): Remove prototypes that are
+ already in intervals.h.
+
+ * intervals.h (struct interval): Move from lisp.h.
+ Use EMACS_INT for position and size info.
+
+ * coding.c: Include intervals.h for Fset_text_properties.
+
+ * buffer.h (struct buffer_text, struct buffer): Use EMACS_INT for
+ position and length information.
+
+2003-07-09 Stefan Monnier <[email protected]>
+
+ * buffer.h (struct buffer_text, struct buffer): Use EMACS_INT for
+ position and length information.
+
+2003-07-09 Stefan Monnier <[email protected]>
+
+ Change overlays_after and overlays_before so the overlays themselves
+ are linked into lists, rather than using cons cells. After all each
+ Lisp_Misc already occupies 5 words, so we can add a `next' field to
+ Lisp_Overlay for free and save up one cons cell per overlay (not
+ to mention one indirection when traversing the list of overlay).
+
+ * lisp.h (struct Lisp_Overlay): New field `next'.
+
+ * buffer.h (struct buffer): Change overlays_before and overlays_after
+ from Lisp lists of overlays to pointers to overlays.
+
+ * buffer.c (overlay_strings, recenter_overlay_lists):
+ Fix typo in eassert in last commit.
+ (unchain_overlay): New function.
+ (add_overlay_mod_hooklist): Use AREF.
+ (copy_overlays, reset_buffer, overlays_at, overlays_in)
+ (overlay_touches_p, overlay_strings, recenter_overlay_lists)
+ (fix_overlays_in_range, fix_overlays_before, Fmake_overlay)
+ (Fmove_overlay, Fdelete_overlay, Foverlay_lists)
+ (report_overlay_modification, evaporate_overlays, init_buffer_once):
+ Adjust to new type of overlays_(before|after).
+
+ * alloc.c (mark_object): Mark the new `next' field of overlays.
+ (mark_buffer): Manually mark the overlays_(after|before) fields.
+
+ * coding.c (run_pre_post_conversion_on_str):
+ * editfns.c (overlays_around):
+ * xdisp.c (load_overlay_strings):
+ * fileio.c (Finsert_file_contents):
+ * indent.c (current_column):
+ * insdel.c (signal_before_change, signal_after_change):
+ * intervals.c (set_point_both):
+ * print.c (temp_output_buffer_setup): Use new type for
+ overlays_(before|after).
+
+2003-07-08 Stefan Monnier <[email protected]>
+
+ * buffer.c (report_overlay_modification): Don't run hooks while
+ traversing the list of overlays.
+
+ * buffer.h (struct buffer): Use an int for overlay_center.
+ (overlays_at, evaporate_overlays, recenter_overlay_lists)
+ (overlay_strings, fix_overlays_before): Use EMACS_INT for positions.
+
+ * buffer.c (reset_buffer, recenter_overlay_lists)
+ (adjust_overlays_for_insert, adjust_overlays_for_delete)
+ (fix_overlays_in_range, Fmake_overlay, Fmove_overlay)
+ (evaporate_overlays, init_buffer_once): Update use of overlay_center.
+ (overlays_at, evaporate_overlays, recenter_overlay_lists)
+ (overlay_strings, fix_overlays_before): Use EMACS_INT for positions.
+
+ * xdisp.c (fast_find_position): Remove unused var.
+
+ * cmds.c (Qexpand_abbrev): New sym.
+ (syms_of_cmds): Initialize it.
+ (internal_self_insert): Use it to call expand-abbrev.
+
+2003-07-09 Kim F. Storm <[email protected]>
+
+ * xterm.c (use_xim) [!USE_XIM]: Default to disable XIM if Emacs
+ was configured with --without-xim.
+ (x_term_init) [!USE_XIM]: Use `useXIM' resource to turn on XIM.
+
+2003-07-07 Richard M. Stallman <[email protected]>
+
+ * xdisp.c (reseat_1): Set it->area to TEXT_AREA.
+
+ * alloc.c (Fgarbage_collect): Doc fix.
+
+2003-07-07 Nozomu Ando <[email protected]>
+
+ * buffer.c (Fkill_buffer): Clear charpos cache if necessary.
+
+2003-07-06 Stefan Monnier <[email protected]>
+
+ * minibuf.c (read_minibuf): UNGCPRO before returning.
+ (Ftry_completion, Fall_completions): Doc fix.
+
+ * alloc.c (live_float_p): Check that p is not past the `floats' array,
+ now that `floats' is not the last element of the struct any more.
+
+2003-07-06 Jason Rumney <[email protected]>
+
+ * w32term.h (ClipboardSequence_Proc): New type.
+
+ * w32fns.c (clipboard_sequence_fn): New variable.
+ (globals_of_w32fns): Initialize it.
+
+ * w32select.c (last_clipboard_sequence_number): New variable.
+ (Fw32_set_clipboard_data, Fw32_get_clipboard_data): Use sequence
+ number if possible.
+
+2003-07-06 Stefan Monnier <[email protected]>
+
+ * m/amdx86-64.h (MARKBIT):
+ * m/ia64.h (MARKBIT): Remove definition since lisp.h does not compare
+ MARKBIT and ARRAY_MARK_FLAG any more.
+
+ * m/hp800.h (XSETMARKBIT):
+ * m/sr2k.h (XSETMARKBIT):
+ * lisp.h (XSETMARKBIT): Remove unused macro.
+
+ * lisp.h (mark_object): Change prototype.
+
+ * alloc.c (mark_object): Change arg *Lisp_Object -> Lisp_Object.
+ (last_marked): Change accordingly.
+ (mark_interval, mark_maybe_object, mark_maybe_pointer)
+ (Fgarbage_collect, mark_glyph_matrix, mark_face_cache, mark_image)
+ (mark_buffer): Update calls to mark_object.
+
+ * bytecode.c (mark_byte_stack):
+ * fns.c (sweep_weak_table):
+ * keyboard.c (mark_kboards): Update calls to mark_object.
+
+2003-07-06 Jason Rumney <[email protected]>
+
+ * alloc.c (struct ablock): Only include padding when there is some.
+
+2003-07-04 Stefan Monnier <[email protected]>
+
+ * alloc.c (ALIGN): Add casts to simplify usage.
+ (BLOCK_ALIGN, BLOCK_BYTES, ABLOCKS_PADDING, ABLOCKS_SIZE)
+ (ABLOCKS_BYTES, ABLOCK_ABASE, ABLOCKS_BUSY, ABLOCKS_BASE): New macros.
+ (struct ablock, struct ablocks): New types.
+ (free_ablock): New global var.
+ (lisp_align_malloc, lisp_align_free): New functions.
+ (FLOAT_BLOCK_SIZE): Redefine in terms of BLOCK_BYTES.
+ (struct float_block): Reorder and add gcmarkbits.
+ (GETMARKBIT, SETMARKBIT, UNSETMARKBIT, FLOAT_BLOCK, FLOAT_INDEX)
+ (FLOAT_MARKED_P, FLOAT_MARK, FLOAT_UNMARK): New macros.
+ (init_float, make_float): Use lisp_align_malloc.
+ (free_float, live_float_p): Don't use `type' any more.
+ (make_float): Use FLOAT_UNMARK to access to mark bit.
+ (mark_maybe_object, mark_maybe_pointer, survives_gc_p):
+ Use FLOAT_MARKED_P to access the mark bit.
+ (pure_alloc): Simplify use of ALIGN.
+ (mark_object): Use FLOAT_MARK to access the mark bit.
+ (gc_sweep): Use new macros to access the float's mark bit.
+ (init_alloc_once): Init free_ablock.
+
+ * lisp.h (struct Lisp_Float): Remove unused field `type'.
+
+2003-06-27 Stefan Monnier <[email protected]>
+
+ * alloc.c (VECTOR_MARK, VECTOR_UNMARK, VECTOR_MARKED_P): New macros.
+ (GC_STRING_BYTES): Don't mask markbit (it's only used on `size').
+ (allocate_buffer): Move.
+ (string_bytes): Don't mask markbit of `size_byte'.
+ (mark_maybe_object, mark_maybe_pointer, Fgarbage_collect)
+ (mark_object, mark_buffer, survives_gc_p, gc_sweep):
+ Use the `size' field of buffers (rather than the `name' field) for
+ the mark bit, as is done for all other vectorlike objects.
+ Use the new macros to access the mark bit of vectorlike objects.
+
+2003-06-26 Richard M. Stallman <[email protected]>
+
+ * puresize.h (BASE_PURESIZE): Increment base size.
+
+ * xdisp.c (fast_find_position): Enable Gerd's new definition.
+
+ * xterm.c (xim_initialize): Undo previous change.
+
+2003-06-26 Stefan Monnier <[email protected]>
+
+ * alloc.c (survives_gc_p): Simplify.
+
+ * buffer.c (set_buffer_internal_1): Test CONSP for lists.
+
+ * window.c (Fset_window_dedicated_p): Simplify.
+ (display_buffer_1): Don't raise the win from which minibuf was entered.
+ (temp_output_buffer_show): Don't assume BEG == 1. Simplify.
+ (Fminibuffer_selected_window): Simplify.
+
+ * buffer.h (struct buffer_text): Lisp_Object `markers' => Lisp_Marker.
+
+ * lisp.h (unchain_marker): Lisp_Object arg => Lisp_Marker.
+ (struct Lisp_Marker): Lisp_Object `chain' => Lisp_Marker `next'.
+
+ * insdel.c (check_markers, adjust_markers_for_delete)
+ (adjust_markers_for_insert, adjust_markers_for_replace)
+ (prepare_to_modify_buffer, RESTORE_VALUE):
+ * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos)
+ (Fset_marker, set_marker_restricted, set_marker_both, unchain_marker)
+ (set_marker_restricted_both, Fbuffer_has_markers_at, count_markers):
+ * alloc.c (Fmake_marker, free_marker, gc_sweep):
+ * buffer.c (Fget_buffer_create, Fkill_buffer, Fset_buffer_multibyte):
+ * editfns.c (save_excursion_restore, transpose_markers):
+ * window.c (delete_window):
+ * xdisp.c (message_dolog): Update for new types.
+
+2003-06-26 Jan Dj,Ad(Brv <[email protected]>
+
+ * xfaces.c (set_font_frame_param): Set default_face_done_p to zero.
+ (realize_default_face): Use default_face_done_p for the force_p
+ argument to set_lface_from_font_name. Set default_face_done_p to one.
+
+ * frame.c (make_frame): Initialize default_face_done_p.
+
+ * frame.h (struct frame): Add default_face_done_p.
+
+ * config.in: Add XRegisterIMInstantiateCallback_arg6 so it
+ will be defined.
+
+2003-06-25 Stefan Monnier <[email protected]>
+
+ * alloc.c (make_interval, Fmake_symbol, allocate_misc):
+ Initialize the new field `gcmarkbit'.
+ (mark_interval, MARK_INTERVAL_TREE): Use the new `gcmarkbit' field.
+ (mark_interval_tree): Don't mark the tree separately from the nodes.
+ (UNMARK_BALANCE_INTERVALS): Don't unmark the tree.
+ (mark_maybe_object, mark_maybe_pointer, Fgarbage_collect)
+ (mark_object, survives_gc_p, gc_sweep): Use new `gcmarkbit' fields.
+
+ * lisp.h (struct interval, struct Lisp_Symbol, struct Lisp_Free)
+ (struct Lisp_Marker, struct Lisp_Intfwd, struct Lisp_Boolfwd)
+ (struct Lisp_Kboard_Objfwd, struct Lisp_Save_Value)
+ (struct Lisp_Buffer_Local_Value, struct Lisp_Overlay)
+ (struct Lisp_Objfwd, struct Lisp_Buffer_Objfwd): Add `gcmarkbit' field.
+
+2003-06-24 Dave Love <[email protected]>
+
+ * xterm.c (xim_initialize): Use XRegisterIMInstantiateCallback_arg6.
+
+ * strftime.c: Test HAVE_SYS__MBSTATE_H, not __hpux. Merge changes
+ from gnulib.
+
+2003-06-21 Richard M. Stallman <[email protected]>
+
+ * fileio.c (Fwrite_region): Alternate messages
+ for append and partial write.
+
+ * keyboard.c (read_key_sequence): When converting upcase fn key to
+ downcase, update fkey and keytran so `backspace' gets translated.
+
+ * keyboard.c (read_avail_input): Don't signal SIGHUP in batch mode.
+
+ * process.c (wait_reading_process_input): Don't signal SIGIO
+ in batch mode.
+
+2003-06-17 Kenichi Handa <[email protected]>
+
+ * Makefile.in (xselect.o): Don't depend on charset.h, coding.h,
+ composite.h.
+
+ * xselect.c: Don't include charset.h, coding.h, composite.h.
+ (Qforeign_selection): New variable.
+ (syms_of_xselect): Intern and static it.
+ (selection_data_to_lisp_data): Return a unibyte string made from
+ data with `foreign-selection' text property.
+
+2003-06-15 Stefan Monnier <[email protected]>
+
+ * termhooks.h (EVENT_INIT): New macro.
+
+ * keyboard.c (mark_kboards): Move from alloc.c. Mark kbd_buffer.
+
+ * alloc.c (mark_kboards): Move to keyboard.c.
+
+ * keyboard.c (record_asynch_buffer_change, read_avail_input):
+ * xterm.c (x_dispatch_event):
+ * xmenu.c (find_and_call_menu_selection):
+ * xdisp.c (handle_tool_bar_click):
+ * w32menu.c (menubar_selection_callback):
+ * sysdep.c (kbd_input_ast, read_input_waiting):
+ * msdos.c (dos_rawgetc):
+ * macterm.c (mac_check_for_quit_char):
+ * macmenu.c (menubar_selection_callback):
+ * gtkutil.c (xg_tool_bar_callback): Don't pass uninitialized
+ data to kbd_buffer_store_event.
+
+2003-06-15 Kim F. Storm <[email protected]>
+
+ * xdisp.c (x_fix_overlapping_area): Always use area relative X
+ to fix redisplay problem with tall characters (such as ,AC(B).
+
+2003-06-13 Kai Gro,A_(Bjohann <[email protected]>
+
+ * fileio.c (Fcopy_file): Doc fix: copies file modes, too.
+
+2003-06-12 Kenichi Handa <[email protected]>
+
+ * fileio.c (Fwrite_region): Save and restore restriction.
+
+2003-06-12 Dave Love <[email protected]>
+
+ * alloca.c (alloca): Declare arg as size_t.
+
+ * sysdep.c: Remove redundant include of unistd.h, stdlib.h.
+ Use HAVE_DECL_SYS_SIGLIST, not SYS_SIGLIST_DECLARED.
+
+2003-06-11 Dave Love <[email protected]>
+
+ * search.c (shrink_regexp_cache): Use xrealloc.
+ (syms_of_search): Use xmalloc.
+
+2003-06-10 Kim F. Storm <[email protected]>
+
+ * xdisp.c (phys_cursor_in_rect_p): Fix 2003-05-24 change.
+ Adjust phys_cursor.x to be relative to window box, rather than
+ text area before checking -- to ensure cursor is redrawn when
+ exposing window.
+ Note: This also fixes a similar (older) bug if display margins
+ are present.
+
+2003-06-06 Kenichi Handa <[email protected]>
+
+ * coding.c (encoding_buffer_size): If coding->type is
+ coding_type_ccl, double magnification on CRLF encoding.
+
+2003-06-06 Jason Rumney <[email protected]>
+
+ * w32reg.c (SYSTEM_DEFAULT_RESOURCES): New constant.
+ (w32_get_string_resource): Try SYSTEM_DEFAULT_RESOURCES last.
+
+ * xfaces.c (Finternal_face_x_get_resource): Do it on Windows and
+ Mac too.
+
+2003-06-05 Dave Love <[email protected]>
+
+ * strftime.c: Merge changes from gnulib.
+
+ * mktime.c (__mktime_internal): Merge changes from gnulib
+ involving year 69 and dst2.
+
+ Changes to merge with gnulib version and be consistent with the
+ autoconf test:
+
+ * getloadavg.c: Set NLIST_STRUCT from HAVE_NLIST_H.
+ Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not NLIST_NAME_UNION.
+ [HAVE_LOCALE_H]: Include locale.h.
+ (getloadavg) [HAVE_SETLOCALE]: Run sscanf in C locale.
+
+2003-06-05 Kim F. Storm <[email protected]>
+
+ * window.c (coordinates_in_window): Convert X and Y to window
+ relative coordinates inside mode-line and header-line parts.
+ Convert X and Y to margin area relative coordinates inside left
+ and right display margin parts.
+
+2003-06-05 Jason Rumney <[email protected]>
+
+ * w32fns.c (add_system_logical_colors_to_map): New function.
+ (Fx_open_connection): Use it.
+
+2003-06-04 Stefan Monnier <[email protected]>
+
+ * process.c (allocate_pty): Revert part of the previous patch.
+ (Faccept_process_output): Simplify.
+
+2003-06-04 Jason Rumney <[email protected]>
+
+ * termhooks.h (enum event_kind): Remove MOUSE_WHEEL_EVENT.
+
+ * keyboard.c (Qmouse_wheel, mouse_wheel_syms)
+ (lispy_mouse_wheel_names): Remove.
+ (syms_of_keyboard): Remove Qmouse_wheel and mouse_wheel_syms.
+ Always define drag_and_drop_syms.
+
+ * macterm.c (XTread_socket): Map mouse wheel events to Emacs
+ WHEEL_EVENT events.
+
+2003-06-03 Stefan Monnier <[email protected]>
+
+ * xdisp.c (update_tool_bar): Add missing UNGCPRO.
+
+ * buffer.c (init_buffer_once): Make kill-buffer-hook permanent-local.
+
+2003-06-03 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c (make_menu_item): Make sure we don't crash on a NULL
+ menu item label.
+
+2003-06-03 Richard M. Stallman <[email protected]>
+
+ * window.c (Fwindow_edges): Doc fix.
+ (Fwindow_pixel_edges, Fwindow_inside_edges)
+ (Fwindow_inside_pixel_edges): New functions.
+ (syms_of_window): defsubr them.
+
+ * window.h (WINDOW_LEFT_FRINGE_COLS, WINDOW_RIGHT_FRINGE_COLS)
+ (WINDOW_MODE_LINE_LINES, WINDOW_HEADER_LINE_LINES): New macros.
+
+2003-06-02 Stefan Monnier <[email protected]>
+
+ * dispnew.c (Fsit_for): Don't lie about the number of args.
+
+2003-06-02 Dave Love <[email protected]>
+
+ * callproc.c: Use HAVE_FCNTL_H, not USG5.
+ (syms_of_callproc) <process-environment>: Doc fix.
+
+ * doc.c: Use HAVE_FCNTL_H, not USG5.
+
+ * xfaces.c (font_rescale_ratio): Fix for K&R.
+
+ * termcap.c: Use HAVE_FCNTL_H, not _POSIX_VERSION.
+
+ * mem-limits.h: Use HAVE_SYS_RESOURCE_H, HAVE_SYS_VLIMIT_H.
+
+ * lread.c [HAVE_FCNTL_H]: Include fcntl.h.
+
+ * gtkutil.c: Include keyboard.h, charset.h, coding.h.
+ (xg_create_frame_widgets): Use ENCODE_UTF_8.
+
+ * xterm.c (Qutf_8): Move to coding.c.
+
+ * xmenu.c (ENCODE_MENU_STRING): New.
+ (list_of_panes, list_of_items, digest_single_submenu, xmenu_show):
+ Use it.
+
+ * coding.h (ENCODE_UTF_8): New.
+ (Qutf_8): Declare.
+
+ * coding.c (Qutf_8): New.
+ (syms_of_coding): Intern it.
+
+ * fns.c: Doc fixes.
+
+2003-06-02 Kenichi Handa <[email protected]>
+
+ * buffer.c (Fset_buffer_multibyte): Fix previous change.
+
+2003-06-01 Stefan Monnier <[email protected]>
+
+ * lread.c (openp): Make sure STR is a string.
+
+2003-06-01 David Ponce <[email protected]>
+
+ * termhooks.h (enum event_kind): Add new WHEEL_EVENT event.
+ Declare MOUSE_WHEEL_EVENT only if MAC_OSX defined.
+
+ * keyboard.c (Qmouse_wheel): Declare only if MAC_OSX defined.
+ (mouse_wheel_syms, lispy_mouse_wheel_names): Likewise.
+ (discard_mouse_events): Discard WHEEL_EVENT events too.
+ (lispy_wheel_names, wheel_syms): New.
+ (syms_of_keyboard): Init and staticpro `wheel_syms'. Init and
+ staticpro `Qmouse_wheel' and `mouse_wheel_syms' only if MAC_OSX defined.
+ (make_lispy_event): Add WHEEL_EVENT handler.
+
+ * w32term.c (construct_mouse_wheel): Construct WHEEL_EVENT.
+ (w32_read_socket): Map w32 WM_MOUSEWHEEL events to Emacs
+ WHEEL_EVENT events.
+
+2003-05-31 John Paul Wallington <[email protected]>
+
+ * Makefile.in (lisp, shortlisp): byte-run, float-sup, map-ynp, and
+ timer are in lisp/emacs-lisp.
+
+2003-05-31 Kenichi Handa <[email protected]>
+
+ * buffer.c (Fset_buffer_multibyte): Correctly recover a narrowed
+ region when a buffer is changed to unibyte.
+
+ * charset.h (VALID_LEADING_CODE_P): New macro.
+ (UNIBYTE_STR_AS_MULTIBYTE_P): Check more rigidly.
+
+ * coding.c (DECODE_EMACS_MULE_COMPOSITION_CHAR): If coding->flags
+ is nonzero, accept multibyte form of eight-bit-control chars.
+ (decode_composition_emacs_mule): Likewise.
+ (decode_coding_emacs_mule): Likewise.
+ (encode_coding_emacs_mule): If coding->flags is nonzero, produce
+ multibyte form of eight-bit-control chars.
+
+ * fileio.c (Qauto_save_coding, auto_save_coding): New variables.
+ (Finsert_file_contents): If coding-system-for-read is bound to
+ Qauto_save_coding, use the coding system emacs-mule with special
+ setting for recovering a file.
+ (choose_write_coding_system): On auto saving, use the coding
+ system emacs-mule with special setting for auto saving.
+ (syms_of_fileio) <Qauto_save_coding>: Intern and staticpro it.
+
+2003-05-30 Kenichi Handa <[email protected]>
+
+ * coding.c (ccl_coding_driver): Set ccl->eight_bit_control
+ properly before calling ccl_driver.
+
+ * ccl.h (struct ccl_program) <eight_bit_control>: Comment fixed.
+
+ * ccl.c (CCL_WRITE_CHAR): Increment extra_bytes only when it is nonzero.
+ (ccl_driver): Initialize extra_bytes to ccl->eight_bit_control.
+ (setup_ccl_program): Initialize ccl->eight_bit_control to zero.
+
+2003-05-29 Glenn Morris <[email protected]>
+
+ * xfaces.c (realize_default_face): Do not abort if lface is
+ non-existent - reverts change from 2003-05-19.
+
+2003-05-29 Kenichi Handa <[email protected]>
+
+ * coding.c (decode_coding_iso2022): Pay attention to the byte
+ sequence of CTEXT extended segment, and retain those bytes as is.
+
+2003-05-28 Kenichi Handa <[email protected]>
+
+ * coding.c (ENCODE_UNSAFE_CHARACTER): Adjust for the name change
+ of CODING_REPLACEMENT_CHARACTER.
+ (decode_coding_iso2022): If CODING_FLAG_ISO_SAFE, set
+ CODING_MODE_INHIBIT_UNENCODABLE_CHAR flag in coding->mode, and
+ check this flag on encoding.
+ (encode_coding_sjis_big5):
+ Check CODING_MODE_INHIBIT_UNENCODABLE_CHAR flag of coding->mode.
+ (Fset_terminal_coding_system_internal):
+ Set CODING_MODE_INHIBIT_UNENCODABLE_CHAR flag in terminal_coding.mode
+ instead of setting CODING_FLAG_ISO_SAFE flag in terminal_coding.flags.
+
+ * coding.h (CODING_REPLACEMENT_CHARACTER): Rename from
+ CODING_INHIBIT_CHARACTER_SUBSTITUTION.
+ (CODING_MODE_INHIBIT_UNENCODABLE_CHAR): New macro.
+
+2003-05-28 Richard M. Stallman <[email protected]>
+
+ * print.c (syms_of_print) <print-escape-nonascii>: Doc fix.
+
+ * eval.c (unbind_to): Move init of this_binding to separate statement.
+
+2003-05-28 Kim F. Storm <[email protected]>
+
+ * xdisp.c (expose_window): Fix error in calculation of
+ window relative coordinates of area to redisplay.
+
+2003-05-27 Jason Rumney <[email protected]>
+
+ * w32term.c (GET_WHEEL_DELTA_WPARAM): New macro.
+
+2003-05-27 David Ponce <[email protected]>
+
+ Handle W32 mouse wheel events as mouse click events, like in X.
+
+ * keyboard.c (make_lispy_event) [WINDOWSNT]: Don't handle
+ MOUSE_WHEEL_EVENT anymore.
+
+ * w32term.c (construct_mouse_wheel): Result is a MOUSE_CLICK_EVENT.
+ Scrolling down/up the mouse wheel is respectively mapped to mouse
+ button 4 and 5.
+ (w32_read_socket): Map w32 WM_MOUSEWHEEL events to Emacs
+ MOUSE_CLICK_EVENT events. Forward w32 MSH_MOUSEWHEEL events as
+ WM_MOUSEWHEEL events.
+
+2003-05-27 Andreas Schwab <[email protected]>
+
+ * buffer.c (syms_of_buffer) <default-direction-reversed>: Doc fix.
+
+ * xdisp.c (try_window_id): Avoid aborting if PT is inside a
+ partially visible line.
+
+ * alloc.c (Fgarbage_collect): Fix last change.
+
+2003-05-26 John Paul Wallington <[email protected]>
+
+ * xfns.c (Fx_create_frame): Don't call Qface_set_after_frame_default.
+
+2003-05-25 Stefan Monnier <[email protected]>
+
+ * window.c (Fset_window_buffer): Add type of `keep_margins'.
+ (Fset_window_fringes, Fset_window_scroll_bars): Declare before use.
+
+ * window.h (window_box_text_cols): Declare.
+
+ * xdisp.c (window_text_bottom_y, draw_row_fringe_bitmaps)
+ (x_draw_vertical_border): Remove unused var `f'.
+
+ * xfaces.c (build_scalable_font_name): Remove `unused var
+ pixel_size' warning.
+
+ * xfns.c (png_load): Remove `unused vars intent, image_gamma' warning.
+
+ * unexelf.c (unexec): Remove `unused var n' warning.
+
+ * strftime.c (my_strftime_localtime_r): Remove `defined but
+ unused' warning.
+
+ * process.c (allocate_pty): Remove `unused var stb' and
+ `cp might be used uninitialized' warnings.
+
+ * dispnew.c (mode_line_string): Remove unused var `f'.
+
+ * coding.c (find_safe_codings): Remove unused var `i'.
+
+ * bytecode.c (Fbyte_code): Remove `unused val' warning.
+
+ * buffer.c (Fkill_buffer): Remove unused var `list'.
+
+ * alloc.c (Fgarbage_collect): Remove `unused var tail' warning.
+
+2003-05-25 Jan Dj,Ad(Brv <[email protected]>
+
+ * frame.c (make_frame): Condition want_fullscreen with
+ HAVE_WINDOW_SYSTEM.
+
+2003-05-25 Juanma Barranquero <[email protected]>
+
+ * window.c (Fset_window_scroll_bars): Fix typo in argument name.
+ (Fwindow_scroll_bars): Fix typo in docstring.
+
+2003-05-24 Kim F. Storm <[email protected]>
+
+ The following changes serve several purposes:
+
+ 1) Swap the position of fringes and display margins in windows, i.e.
+ the fringes are now displayed between the margins and the text area
+ (by default).
+
+ 2) Allow fringe and scroll bar parameters to be set per-buffer and
+ per-window (like display margins). Such settings are now stored
+ in window configurations, preserved when frames are resized, and
+ copied when windows are split vertically or horizontally.
+ Several bugs related to display margins have been fixed.
+
+ 3) Consistently use FRAME_FONT and FRAME_FONTSET macros.
+
+ 4) Use FRAME_COLUMN_WIDTH (f) consistently throughout the code
+ rather than FRAME_WIDTH (FRAME_FONT (f)).
+
+ 5) Introduce a consistent naming of variables, members and macros
+ depending on whether their value is measured in pixels or in
+ canonical columns/lines. Pixel dimensions are named *_width and
+ *_height, while canonical columns/lines are named *_cols and
+ *_lines. Pixel positions are named *_x and *_y, while column/line
+ positions are named *_col and *_line.
+
+ 6) Consolidate more of the X, W32, and MAC gui code by moving
+ common data into struct frame, and generalize it for the non-gui
+ case by using suitable defaults.
+
+ 7) Cleanup and consolidate the macros controlling frame and window
+ layout into frame.h and window.h, and generalize the use of the
+ various window_box_* functions (enhanced to handle the new fringe
+ position and the per-window fringe and scroll bar settings).
+
+ * frame.h (struct frame): Rename members height to text_lines,
+ width to text_cols, window_height to total_lines, window_width to
+ total_cols, new_height to new_text_lines, new_width to
+ new_text_cols. All uses changed.
+ (struct frame): New members which consolidate common members of
+ x_output, w32_output, and mac_output structures: left_pos,
+ top_pos, pixel_height, pixel_width, x_pixels_diff, y_pixels_diff,
+ win_gravity, size_hint_flags, border_width, internal_border_width,
+ line_height, fringe_cols, left_fringe_width, right_fringe_width,
+ want_fullscreen. All uses changed.
+ (struct frame): New member column_width contaning the canonical
+ column width, analogue to line_height. All uses changed.
+ (struct frame): Rename members scroll_bar_pixel_width to
+ config_scroll_bar_width, and scroll_bar_cols to
+ config_scroll_bar_cols. All uses changed.
+ (struct frame): New member scroll_bar_actual_width which
+ consolidates and renames the vertical_scroll_bar_extra member of
+ x_output, w32_output, and mac_output structures. All uses changed.
+ (FRAME_PIXEL_HEIGHT): Rename from PIXEL_HEIGHT and moved
+ from x/w32/macterm.h files. All uses changed. Also change code
+ which referred to f->output_data...->pixel_height.
+ (FRAME_PIXEL_WIDTH): Rename from PIXEL_WIDTH and moved
+ from x/w32/macterm.h files. All uses changed. Also change code
+ which referred to f->output_data...->pixel_width.
+ (FRAME_LINES): Rename from FRAME_HEIGHT. All uses changed.
+ Also change code which referred to f->height.
+ (FRAME_COLS): Rename from FRAME_WIDTH. All uses changed.
+ Also change code which referred to f->width.
+ (FRAME_NEW_HEIGHT, FRAME_NEW_WIDTH): Remove macros; change uses
+ to update new_text_lines and new_text_cols members directly.
+ (FRAME_CONFIG_SCROLL_BAR_WIDTH): Rename from
+ FRAME_SCROLL_BAR_PIXEL_WIDTH. All uses changed.
+ (FRAME_CONFIG_SCROLL_BAR_COLS): Rename from
+ FRAME_SCROLL_BAR_COLS. All uses changed.
+ (FRAME_LEFT_SCROLL_BAR_COLS, FRAME_RIGHT_SCROLL_BAR_COLS):
+ Rename from FRAME_LEFT_SCROLL_BAR_WIDTH and
+ FRAME_RIGHT_SCROLL_BAR_WIDTH, resp. All uses changed.
+ (FRAME_SCROLL_BAR_AREA_WIDTH, FRAME_LEFT_SCROLL_BAR_AREA_WIDTH)
+ (FRAME_RIGHT_SCROLL_BAR_AREA_WIDTH): New macros.
+ (FRAME_TOTAL_COLS): Rename from FRAME_WINDOW_WIDTH.
+ (SET_FRAME_COLS): Rename from SET_FRAME_WIDTH.
+ (FRAME_TOTAL_COLS_ARG): Rename from FRAME_WINDOW_WIDTH_ARG.
+ (WINDOW_VERTICAL_SCROLL_BAR_COLUMN): Remove unused macro.
+ (WINDOW_VERTICAL_SCROLL_BAR_HEIGHT): Remove unused macro.
+ (FRAME_LINE_HEIGHT): Rename from CANON_Y_UNIT.
+ Unconditionally return line_height member (it now has proper value
+ also for non-window frames).
+ (FRAME_COLUMN_WIDTH): Rename from CANON_X_UNIT. Unconditionally
+ return new column_width member (rather than the default font width).
+ (FRAME_FRINGE_COLS, FRAME_LEFT_FRINGE_WIDTH)
+ (FRAME_RIGHT_FRINGE_WIDTH): Rename from FRAME_X_... and moved
+ from x/w32/macterm.h files. Unconditionally return corresponding
+ member of frame structure (they now have proper values also for
+ non-window frames).
+ (FRAME_TOTAL_FRINGE_WIDTH): Rename from FRAME_FRINGE_WIDTH.
+ Calculate return value from left and right widths.
+ (FRAME_INTERNAL_BORDER_WIDTH): Unconditionally return
+ internal_border_width member (has proper value for non-window frame).
+ (FRAME_PIXEL_X_FROM_CANON_X): Rename from PIXEL_X_FROM_CANON_X.
+ (FRAME_PIXEL_Y_FROM_CANON_Y): Rename from PIXEL_Y_FROM_CANON_Y.
+ (FRAME_CANON_X_FROM_PIXEL_X): Rename from CANON_X_FROM_PIXEL_X.
+ (FRAME_CANON_Y_FROM_PIXEL_Y): Rename from CANON_Y_FROM_PIXEL_Y.
+ (FRAME_LINE_TO_PIXEL_Y): Rename from CHAR_TO_PIXEL_ROW,
+ consolidated from xterm.h, macterm.h, and w32term.h.
+ (FRAME_COL_TO_PIXEL_X): Rename from CHAR_TO_PIXEL_COL,
+ consolidated from xterm.h, macterm.h, and w32term.h.
+ (FRAME_TEXT_COLS_TO_PIXEL_WIDTH): Rename from
+ CHAR_TO_PIXEL_WIDTH consolidated from x/mac/w32term.h.
+ (FRAME_TEXT_LINES_TO_PIXEL_HEIGHT): Rename from
+ CHAR_TO_PIXEL_HEIGHT consolidated from x/mac/w32term.h.
+ (FRAME_PIXEL_Y_TO_LINE): Rename from PIXEL_TO_CHAR_ROW
+ consolidated from x/mac/w32term.h.
+ (FRAME_PIXEL_X_TO_COL): Rename from PIXEL_TO_CHAR_COL
+ consolidated from x/mac/w32term.h.
+ (FRAME_PIXEL_WIDTH_TO_TEXT_COLS): Rename from
+ PIXEL_TO_CHAR_WIDTH consolidated from x/mac/w32term.h.
+ (FRAME_PIXEL_HEIGHT_TO_TEXT_LINES): Rename from
+ PIXEL_TO_CHAR_HEIGHT consolidated from x/mac/w32term.h.
+
+ * window.h (struct window): Rename members left to left_col,
+ top to top_line, height to total_lines, width to total_cols,
+ left_margin_width to left_margin_cols, right_margin_width to
+ right_margin_cols, orig_height to orig_total_lines, orig_top to
+ orig_top_line. All uses changed.
+ (struct window): New members left_fringe_width, right_fringe_width,
+ fringes_outside_margins, scroll_bar_width, vertical_scroll_bar_type.
+ (WINDOW_XFRAME, WINDOW_FRAME_COLUMN_WIDTH, WINDOW_FRAME_LINE_HEIGHT):
+ New macros primarily used to simplify other macros.
+ (WINDOW_TOTAL_COLS): New macro. Change relevant code that
+ referred to XINT (w->width).
+ (WINDOW_TOTAL_LINES): New macro. Change relevant code that
+ referred to XINT (w->height).
+ (WINDOW_TOTAL_WIDTH): New macro. Change relevant code that
+ referred to XINT (w->width) * canon_x_unit.
+ (WINDOW_TOTAL_HEIGHT): New macro. Change relevant code that
+ referred to XINT (w->height) * canon_y_unit.
+ (WINDOW_LEFT_EDGE_COL): New macro. Change relevant code that
+ referred to XINT (w->left).
+ (WINDOW_RIGHT_EDGE_COL): Rename from WINDOW_RIGHT_EDGE. Change
+ all uses and code that referred to XINT (w->left) + XINT (w->width).
+ (WINDOW_TOP_EDGE_LINE): New macro. Change relevant code that
+ referred to XINT (w->top).
+ (WINDOW_BOTTOM_EDGE_LINE): New macro. Change relevant code that
+ referred to XINT (w->top) + XINT (w->height).
+ (WINDOW_LEFT_EDGE_X): New macro. Change relevant code that
+ referred to XINT (w->left) * canon_x_unit.
+ (WINDOW_RIGHT_EDGE_X): New macro. Change relevant code that
+ referred to (XINT (w->left) + XINT (w->width)) * canon_x_unit.
+ (WINDOW_TOP_EDGE_Y): New macro. Change relevant code that
+ referred to XINT (w->top) * canon_y_unit.
+ (WINDOW_BOTTOM_EDGE_Y): New macro. Change relevant code that
+ referred to (XINT (w->top) + XINT (w->height)) * canon_y_unit.
+ (WINDOW_LEFTMOST_P): New macro.
+ (WINDOW_BOX_LEFT_EDGE_COL): Rename from WINDOW_LEFT_MARGIN.
+ All uses changed.
+ (WINDOW_BOX_RIGHT_EDGE_COL): Rename from WINDOW_RIGHT_MARGIN.
+ All uses changed.
+ (WINDOW_BOX_LEFT_EDGE_X): Rename from
+ WINDOW_DISPLAY_LEFT_EDGE_PIXEL_X, moved from dispextern.h.
+ Do not exclude left fringe width.
+ (WINDOW_BOX_RIGHT_EDGE_X): Rename from
+ WINDOW_DISPLAY_RIGHT_EDGE_PIXEL_X, moved from dispextern.h.
+ Do not exclude fringe widths.
+ (WINDOW_LEFT_FRINGE_WIDTH, WINDOW_RIGHT_FRINGE_WIDTH)
+ (WINDOW_FRINGE_COLS, WINDOW_TOTAL_FRINGE_WIDTH): New macros.
+ Change relevant code that referred to FRAME_LEFT_FRINGE_WIDTH,
+ FRAME_RIGHT_FRINGE_WIDTH, FRAME_FRINGE_COLS, and
+ FRAME_TOTAL_FRINGE_WIDTH to allow per-window fringe settings.
+ (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS): New macro.
+ (WINDOW_VERTICAL_SCROLL_BAR_TYPE, WINDOW_HAS_VERTICAL_SCROLL_BAR)
+ (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT)
+ (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT)
+ (WINDOW_CONFIG_SCROLL_BAR_WIDTH, WINDOW_CONFIG_SCROLL_BAR_COLS):
+ New macros. Change code which referenced corresponding
+ FRAME_VERTICAL_SCROLL_BAR_TYPE, FRAME_HAS_VERTICAL_SCROLL_BARS,
+ FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT,
+ FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT,
+ FRAME_SCROLL_BAR_PIXEL_WIDTH, and FRAME_SCROLL_BAR_COLS macros to
+ allow per-window scroll-bar settings.
+ (WINDOW_LEFT_SCROLL_BAR_COLS, WINDOW_RIGHT_SCROLL_BAR_COLS): New macros.
+ (WINDOW_LEFT_SCROLL_BAR_AREA_WIDTH): New macro. Change code that
+ referred to FRAME_LEFT_SCROLL_BAR_WIDTH.
+ (WINDOW_RIGHT_SCROLL_BAR_AREA_WIDTH): New macro. Change code
+ that referred to FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT and
+ FRAME_SCROLL_BAR_WIDTH.
+ (WINDOW_SCROLL_BAR_COLS, WINDOW_SCROLL_BAR_AREA_WIDTH)
+ (WINDOW_SCROLL_BAR_AREA_X): New macros.
+ (WINDOW_HEADER_LINE_HEIGHT): Rename from
+ WINDOW_DISPLAY_HEADER_LINE_HEIGHT, moved from dispextern.h.
+ (WINDOW_BOX_HEIGHT_NO_MODE_LINE): Rename from
+ WINDOW_DISPLAY_HEIGHT_NO_MODE_LINE, moved from dispextern.h.
+ (WINDOW_BOX_TEXT_HEIGHT): Rename from
+ WINDOW_DISPLAY_PIXEL_WIDTH, moved from dispextern.h.
+ (WINDOW_TO_FRAME_PIXEL_X, WINDOW_TO_FRAME_PIXEL_Y)
+ (FRAME_TO_WINDOW_PIXEL_X, FRAME_TO_WINDOW_PIXEL_Y)
+ (WINDOW_TEXT_TO_FRAME_PIXEL_X): Move here from dispextern.h.
+ (WINDOW_LEFT_MARGIN_WIDTH): Rename from
+ WINDOW_DISPLAY_LEFT_AREA_PIXEL_WIDTH, moved from dispextern.h.
+ (WINDOW_RIGHT_MARGIN_WIDTH): Rename from
+ WINDOW_DISPLAY_RIGHT_AREA_PIXEL_WIDTH, moved from dispextern.h.
+ (window_from_coordinates): Update prototype.
+ (Fset_window_buffer): Update EXFUN.
+ (set_window_buffer): Update prototype.
+
+ * dispextern.h (struct glyph_matrix): Rename members window_left_x
+ to window_left_col, window_top_y to window_top_line. All uses
+ changed.
+ (FRAME_INTERNAL_BORDER_WIDTH_SAFE): Remove macro; can now safely
+ use FRAME_INTERNAL_BORDER_WIDTH macro instead as
+ internal_border_width is now set to 0 for non-window frames.
+ (WINDOW_DISPLAY_PIXEL_WIDTH, WINDOW_DISPLAY_PIXEL_HEIGHT)
+ (WINDOW_DISPLAY_MODE_LINE_HEIGHT, WINDOW_DISPLAY_HEADER_LINE_HEIGHT)
+ (WINDOW_DISPLAY_HEIGHT_NO_MODE_LINE, WINDOW_DISPLAY_TEXT_HEIGHT)
+ (WINDOW_DISPLAY_LEFT_EDGE_PIXEL_X, WINDOW_DISPLAY_RIGHT_EDGE_PIXEL_X)
+ (WINDOW_DISPLAY_TOP_EDGE_PIXEL_Y, WINDOW_DISPLAY_BOTTOM_EDGE_PIXEL_Y)
+ (WINDOW_TO_FRAME_PIXEL_X, WINDOW_TO_FRAME_PIXEL_Y)
+ (FRAME_TO_WINDOW_PIXEL_X, FRAME_TO_WINDOW_PIXEL_Y)
+ (WINDOW_DISPLAY_LEFT_AREA_PIXEL_WIDTH)
+ (WINDOW_DISPLAY_RIGHT_AREA_PIXEL_WIDTH, WINDOW_WANTS_MODELINE_P):
+ Move to window.h and renamed [see window.h changes].
+ (WINDOW_AREA_TO_FRAME_PIXEL_X, WINDOW_AREA_PIXEL_WIDTH)
+ (WINDOW_DISPLAY_TEXT_AREA_PIXEL_WIDTH): Remove macros.
+ (WINDOW_WANTS_MODELINE_P, WINDOW_WANTS_HEADER_LINE_P):
+ Use WINDOW_TOTAL_LINES.
+ (frame_update_line_height): Remove prototype.
+
+ * buffer.h (struct buffer): Rename members measured in columns:
+ left_margin_width to left_margin_cols, right_margin_width to
+ right_margin_cols. All uses changed.
+ New members left_fringe_width, right_fringe_width,
+ fringes_outside_margins for per-buffer fringe settings.
+ New members scroll_bar_width and vertical_scroll_bar_type for
+ per-buffer scroll bar settings.
+
+ * buffer.c (init_buffer_once): Set buffer_defaults and
+ buffer_local_flags for new buffer-local variables
+ left_fringe_width, right_fringe_width, fringes_outside_margins,
+ scroll_bar_width, and vertical_scroll_bar_type.
+ (syms_of_buffer): Defvar_per_buffer them, and defvar_lisp_nopro
+ default-* variables for them.
+
+ * dispnew.c: Make (many) trivial substitutions for renamed and
+ new macros in dispextern.h, frame.h and window.h.
+ (mode_line_string): No need to adjust width for mode lines, as it
+ is already adjusted by the caller.
+ (marginal_area_string): Handle fringes inside/outside margins.
+
+ * frame.c: Make (many) trivial substitutions for renamed and
+ new macros in dispextern.h, frame.h and window.h.
+ (make_frame): Initialize left_fringe_width, right_fringe_width,
+ fringe_cols, scroll_bar_actual_width, border_width,
+ internal_border_width, column_width, line_height, x_pixels_diff,
+ y_pixels_diff, want_fullscreen, size_hint_flags, and win_gravity
+ members with values suitable for a non-window frames.
+
+ * gtkutil.c: Make (many) trivial substitutions for renamed and
+ new macros in dispextern.h, frame.h and window.h.
+
+ * indent.c: Make (few) trivial substitutions for renamed and
+ new macros in dispextern.h, frame.h and window.h.
+
+ * keyboard.c: Make (many) trivial substitutions for renamed and
+ new macros in dispextern.h, frame.h and window.h.
+ (make_lispy_event): Use window positions returned from
+ window_from_coordinates when constructing the lisp event for
+ MOUSE_CLICK_EVENT and DRAG_N_DROP_EVENT, rather than calculating
+ (incorrect) values locally.
+ (make_lispy_movement): Use window positions returned from
+ window_from_coordinates when constructing the lisp event, rather
+ than calculating (incorrect) values locally.
+
+ * scroll.c: Make (some) trivial substitutions for renamed and
+ new macros in dispextern.h, frame.h and window.h.
+
+ * sunfns.c (Fsun_menu_internal): Adapt to per-window fringes and
+ scroll-bars.
+
+ * sysdep.c: Make (few) trivial substitutions for renamed and
+ new macros in dispextern.h, frame.h and window.h.
+
+ * term.c: Make (some) trivial substitutions for renamed and
+ new macros in dispextern.h, frame.h and window.h.
+
+ * widget.c: Make (few) trivial substitutions for renamed and
+ new macros in dispextern.h, frame.h and window.h.
+
+ * window.c: Make (many) trivial substitutions for renamed and
+ new macros in dispextern.h, frame.h and window.h.
+ (make_window): Initialize new members
+ left_margin_cols, right_margin_cols, left_fringe_width,
+ right_fringe_width, fringes_outside_margins, scroll_bar_width,
+ and vertical_scroll_bar_type.
+ (coordinates_in_window): Adapt to new fringe/margin positions
+ and per-window fringes and scroll-bars.
+ Fix bug related to incorrectly adjusting coordinates by
+ frame's internal_border_width (the effect normally negible since
+ the internal_border_width is typically 0 or 1 pixel, but very
+ noticeable for an internal_border_width of e.g. 25 pixels).
+ Upon successful return (other than ON_NOTHING), the coordinates
+ are now always properly converted to window relative for the
+ given display element.
+ (window_from_coordinates): Add new parameters wx and wy to
+ return the window relative x and y position in the returned
+ window and part. A null arg means, don't return the position.
+ All callers changed.
+ (adjust_window_margins): New function which may reduce the width
+ of the display margins if a window's text area is too small after
+ resizing or splitting windows.
+ (size_window): Fix bug that did not account for display margin
+ widths when checking the minimum width of a window; use
+ adjust_window_margins.
+ (set_window_buffer): Call Fset_window_fringes and
+ Fset_window_scroll_bars to setup per-window elements.
+ Add new arg KEEP_MARGINS_P. Non-nil means to keep window's
+ existing display margin, fringe widths, and scroll bar settings
+ (e.g. after splitting a window or resizing the frame).
+ All callers changed.
+ (Fset_window_buffer): New arg KEEP_MARGINS. All callers changed.
+ (Fsplit_window): Duplicate original window's display margin,
+ fringe, and scroll-bar settings; then call Fset_window_buffer with
+ KEEP_MARGINS non-nil. This fixes a bug which caused a split
+ window to only preserve the display margins in one of the windows.
+ When splitting horizontally, call adjust_window_margins on both
+ windows to ensure that the text area of the new windows is non too
+ narrow. This fixes a bug which could cause Emacs to trap if the
+ width of the split window was less than the width of the display
+ margins.
+ (window_box_text_cols): Rename from window_internal_width.
+ All uses changed. Adapt to per-window fringes and scroll bars.
+ Fix bug that caused vertical separator to be subtracted also on
+ window frames. Fix another bug that did not reduce the returned
+ value by the columns used for display margins.
+ (window_scroll_line_based): Fix bug related to scrolling too much
+ when display margins are present (implicitly fixed by the fix to
+ window_box_text_cols).
+ (scroll_left, scroll_right): Fix bug related to scrolling too far
+ by default when display margins are present (implicitly fixed by
+ the fix to window_box_text_cols).
+ (struct saved_window): Rename members left to left_col, top to
+ top_line, width to total_cols, height to total_lines, orig_top to
+ orig_top_line, orig_height to orig_total_lines. All uses changed.
+ New members left_margin_cols, right_margin_cols,
+ left_fringe_width, right_fringe_width, fringes_outside_margins,
+ scroll_bar_width, and vertical_scroll_bar_type for saving
+ per-window display elements.
+ (Fset_window_configuration): Restore display margins, fringes,
+ and scroll bar settings. This fixes a bug which caused display
+ margins to be discarded when saving and restoring a window
+ configuration.
+ (save_window_save): Save display margins, fringes, and scroll bar
+ settings. This fixes a bug which caused display margins to be
+ discarded when saving and restoring a window configuration.
+ (Fset_window_margins): Do nothing if display margins are not
+ really changed. Otherwise, call adjust_window_margins to ensure
+ the text area doesn't get too narrow. This fixes a bug which
+ could cause Emacs to trap if setting display margins wider than
+ the width of the window.
+ (Fset_window_fringes): New defun to allow user to specifically set
+ this window's fringe widths and position vs. display margins.
+ (Fwindow_fringes): New defun to return window's actual fringe settings.
+ (Fset_window_scroll_bars): New defun to allow user to specifically
+ set this window's scroll bar width and position.
+ (Fwindow_scroll_bars): New defun to return window's actual scroll
+ bar settings.
+ (compare_window_configurations): Also compare display margins,
+ fringes, and scroll bar settings.
+ (syms_of_window): Defsubr new defuns for fringe and scroll bars.
+
+ * xdisp.c: Make (many) trivial substitutions for renamed and
+ new macros in dispextern.h, frame.h and window.h.
+ (window_box_width): Adapt to per-window fringes and scroll bars,
+ and new fringe vs. display margin position. Note that returned
+ value is no longer guaranteed to be a whole multiple of the frame
+ column width, since per-window fringes may now be any width.
+ (window_box_left_offset): New function like window_box_left, but
+ value is relative to left border of window (rather than frame).
+ (window_box_right_offset): New function like window_box_right,
+ but value is relative to left border of window.
+ (window_box_left): Adapt to per-window fringes and scroll bars,
+ and new fringe vs. display margin position. Simplify by using
+ WINDOW_LEFT_EDGE_X and window_box_left_offset.
+ (window_box): Allow null args for unnecessary return values;
+ change/simplify relevant callers.
+ (x_y_to_hpos_vpos): Adapt to per-window fringes and scroll bars,
+ and new fringe vs. display margin position.
+ Use window_box_left_offset and window_box_right_offset
+ (get_glyph_string_clip_rect): Adapt to per-window fringes and
+ scroll bars, and new fringe vs. display margin position.
+ Use WINDOW_LEFT_EDGE_X and WINDOW_TOTAL_WIDTH.
+ (draw_fringe_bitmap): Rework to handle per-window fringes and new
+ fringe vs. display margin position.
+ (hscroll_window_tree): Use window_box_width instead of window_box.
+ (redisplay_window): Adapt to per-window scroll bars.
+ (draw_glyphs): Rework to handle per-window fringes and scroll
+ bars, and new fringe vs. display margin position.
+ Use WINDOW_LEFT_EDGE_X, WINDOW_TOTAL_WIDTH, and window_box_left.
+ (x_clear_end_of_line): Adapt to per-window fringes and scroll
+ bars, and new fringe vs. display margin position. Fix bug which
+ increased total width of full_width rows by width of scroll bars
+ although window's total width already includes that.
+ (x_fix_overlapping_area): Simplify using window_box_left_offset.
+ (expose_area): Simplify using window_box_left_offset.
+ (x_draw_vertical_border): Handle per-window scroll bar settings,
+ mixing windows with left, right and no scroll bars.
+
+ * xfaces.c [WINDOWSNT]: Move redefinition of FONT_WIDTH macro to
+ where it's used in x_list_fonts (for clarity).
+ (frame_update_line_height): Remove unused function; functionality
+ is now done directly when setting the default font in x_set_font.
+
+ * xfns.c: Make (many) trivial substitutions for renamed and
+ new macros in dispextern.h, frame.h and window.h.
+
+ * xmenu.c: Make (some) trivial substitutions for renamed and
+ new macros in dispextern.h, frame.h and window.h.
+
+ * xterm.h (struct x_output): Move members left_pos, top_pos,
+ border_width, pixel_height, pixel_width, line_height,
+ internal_border_width, vertical_scroll_bar_extra,
+ left_fringe_width, right_fringe_width, fringe_cols,
+ fringes_extra, win_gravity, size_hint_flags, want_fullscreen,
+ x_pixels_diff, and y_pixels_diff to struct frame (frame.h).
+ (FRAME_INTERNAL_BORDER_WIDTH, FRAME_LINE_HEIGHT): Move to frame.h.
+ (FRAME_DEFAULT_FONT_WIDTH): Remove macro.
+ (PIXEL_WIDTH, PIXEL_HEIGHT)
+ (FRAME_X_FRINGE_COLS, FRAME_X_FRINGE_WIDTH)
+ (FRAME_X_LEFT_FRINGE_WIDTH, FRAME_X_RIGHT_FRINGE_WIDTH): Move to
+ frame.h and renamed [see frame.h changes].
+ (CHAR_TO_PIXEL_ROW, CHAR_TO_PIXEL_COL, CHAR_TO_PIXEL_WIDTH)
+ (CHAR_TO_PIXEL_HEIGHT, PIXEL_TO_CHAR_ROW, PIXEL_TO_CHAR_COL)
+ (PIXEL_TO_CHAR_WIDTH, PIXEL_TO_CHAR_HEIGHT): Move to frame.h
+ and renamed [see frame.h changes].
+
+ * xterm.c: Make (several) trivial substitutions for renamed and
+ new macros in dispextern.h, frame.h and window.h.
+ (x_draw_glyph_string_box): Adapt to per-window fringes and scroll-bars.
+ (scroll_run): Adapt to new fringe position.
+ (glyph_rect): Use window coordinates returned from
+ window_from_coordinates rather than frame_to_window_pixel_xy.
+ (XTset_vertical_scroll_bar): Adapt to per-window fringes and
+ scroll-bars.
+ (handle_one_xevent): Simplify a USE_GTK conditional.
+ (x_clip_to_row): Remove superfluous whole_line_p arg and code
+ (fringes are now inside margins, i.e. always in the clipping area).
+ All callers changed.
+ (x_new_font): Set FRAME_COLUMN_WIDTH and FRAME_LINE_HEIGHT
+ directly, then call compute_fringe_widths. Don't call
+ frame_update_line_height.
+
+ * w32term.h (struct w32_output): Move members left_pos, top_pos,
+ border_width, pixel_height, pixel_width, line_height,
+ internal_border_width, vertical_scroll_bar_extra,
+ left_fringe_width, right_fringe_width, fringe_cols,
+ fringes_extra, win_gravity, size_hint_flags, want_fullscreen,
+ x_pixels_diff, and y_pixels_diff to struct frame (frame.h).
+ (FRAME_INTERNAL_BORDER_WIDTH, FRAME_LINE_HEIGHT): Move to frame.h.
+ (FRAME_DEFAULT_FONT_WIDTH): Remove macro.
+ (PIXEL_WIDTH, PIXEL_HEIGHT)
+ (FRAME_X_FRINGE_COLS, FRAME_X_FRINGE_WIDTH)
+ (FRAME_X_LEFT_FRINGE_WIDTH, FRAME_X_RIGHT_FRINGE_WIDTH): Move to
+ frame.h and renamed [see frame.h changes].
+ (CHAR_TO_PIXEL_ROW, CHAR_TO_PIXEL_COL, CHAR_TO_PIXEL_WIDTH)
+ (CHAR_TO_PIXEL_HEIGHT, PIXEL_TO_CHAR_ROW, PIXEL_TO_CHAR_COL)
+ (PIXEL_TO_CHAR_WIDTH, PIXEL_TO_CHAR_HEIGHT): Move to frame.h
+ and renamed [see frame.h changes].
+
+ * w32term.c: Make (several) trivial substitutions for renamed and
+ new macros in dispextern.h, frame.h and window.h.
+ (x_draw_glyph_string_box): Adapt to per-window fringes and scroll-bars.
+ (glyph_rect): Use window coordinates returned from
+ window_from_coordinates rather than frame_to_window_pixel_xy.
+ (XTset_vertical_scroll_bar): Adapt to per-window fringes and
+ scroll-bars.
+ (w32_clip_to_row): Remove superfluous whole_line_p arg and code
+ (fringes are now inside margins, i.e. always in the clipping area).
+ All callers changed.
+ (x_new_font): Set FRAME_COLUMN_WIDTH and FRAME_LINE_HEIGHT
+ directly, then call compute_fringe_widths. Don't call
+ frame_update_line_height.
+
+ * w32console.c: Make (few) trivial substitutions for renamed and
+ new macros in dispextern.h, frame.h and window.h.
+
+ * w32fns.c: Make (many) trivial substitutions for renamed and
+ new macros in dispextern.h, frame.h and window.h.
+
+ * w32menu.c: Make (few) trivial substitutions for renamed and
+ new macros in dispextern.h, frame.h and window.h.
+
+ * macterm.h (struct mac_output): Move members left_pos, top_pos,
+ border_width, pixel_height, pixel_width, line_height,
+ internal_border_width, vertical_scroll_bar_extra,
+ left_fringe_width, right_fringe_width, fringe_cols,
+ fringes_extra, win_gravity, size_hint_flags, want_fullscreen,
+ x_pixels_diff, y_pixels_diff to struct frame (frame.h).
+ (FRAME_INTERNAL_BORDER_WIDTH, FRAME_LINE_HEIGHT): Move to frame.h.
+ (FRAME_DEFAULT_FONT_WIDTH): Remove macro.
+ (PIXEL_WIDTH, PIXEL_HEIGHT)
+ (FRAME_X_FRINGE_COLS, FRAME_X_FRINGE_WIDTH)
+ (FRAME_X_LEFT_FRINGE_WIDTH, FRAME_X_RIGHT_FRINGE_WIDTH): Move to
+ frame.h and renamed [see frame.h changes].
+ (CHAR_TO_PIXEL_ROW, CHAR_TO_PIXEL_COL, CHAR_TO_PIXEL_WIDTH)
+ (CHAR_TO_PIXEL_HEIGHT, PIXEL_TO_CHAR_ROW, PIXEL_TO_CHAR_COL)
+ (PIXEL_TO_CHAR_WIDTH, PIXEL_TO_CHAR_HEIGHT): Move to frame.h
+ and renamed [see frame.h changes].
+
+ * macterm.c: Make (several) trivial substitutions for renamed and
+ new macros in dispextern.h, frame.h and window.h.
+ (x_draw_glyph_string_box): Adapt to per-window fringes and scroll-bars.
+ (glyph_rect): Use window coordinates returned from
+ window_from_coordinates rather than frame_to_window_pixel_xy.
+ (XTset_vertical_scroll_bar): Adapt to per-window fringes and
+ scroll-bars.
+ (x_clip_to_row): Remove superfluous whole_line_p arg and code
+ (fringes are now inside margins, i.e. always in the clipping area).
+ All callers changed.
+ (x_new_font): Set FRAME_COLUMN_WIDTH and FRAME_LINE_HEIGHT
+ directly, then call compute_fringe_widths. Don't call
+ frame_update_line_height.
+
+ * macfns.c: Make (several) trivial substitutions for renamed and
+ new macros in dispextern.h, frame.h and window.h.
+ (x_real_positions): Set f->x_pixels_diff and f->y_pixels_diff to 0.
+
+ * macmenu.c: Make (few) trivial substitutions for renamed and
+ new macros in dispextern.h, frame.h and window.h.
+
+ * msdos.h (struct x_output): Remove members left_pos, top_pos,
+ and line_height, and use corresponding new members in struct
+ frame. All uses changed.
+ (FRAME_LINE_HEIGHT, FRAME_INTERNAL_BORDER_WIDTH): Remove macros;
+ superseeded by corresponding macros in frame.h.
+
+ * msdos.c: Make (several) trivial substitutions for renamed and
+ new macros in dispextern.h, frame.h and window.h.
+ (IT_note_mouse_highlight): Use updated window coordinates returned
+ by window_from_coordinates, rather than adjusting them locally.
+ (internal_terminal_init): No need to initialize line_height here;
+ it now defaults to 1.
+
+2003-05-24 Stefan Monnier <[email protected]>
+
+ * keyboard.c (read_key_sequence): Adjust fkey and keytran when
+ dropping `down' events.
+
+2003-05-24 Andreas Schwab <[email protected]>
+
+ * coding.c (find_safe_codings): Fix last change.
+
+2003-05-24 Istvan Marko <[email protected]> (tiny change)
+
+ * xfns.c (x_window): Fix typo from 2003-05-21 change.
+
+2003-05-23 Stefan Monnier <[email protected]>
+
+ * xdisp.c (display_mode_element): Increase max depth.
+ Simplify the error handling code. Use a different error string
+ for the case where we hit the depth limit.
+
+ * lisp.h (Vfundamental_mode_abbrev_table): Don't declare.
+
+ * buffer.c (reset_buffer_local_variables): Remove redundant setting.
+
+2003-05-21 Stefan Monnier <[email protected]>
+
+ * intervals.c (get_local_map): Don't get char-property of previous
+ point any more: get_pos_property already does it and better.
+
+2003-05-21 Dave Love <[email protected]>
+
+ [Merged from unicode branch.]
+
+ * xfns.c (x_window, x_window): Use use_xim.
+
+ * xterm.c (use_xim): Initialize.
+ (xim_open_dpy, xim_initialize, xim_close_dpy): Use use_xim.
+ (x_term_init): Maybe set use_xim.
+
+ * xterm.h (use_xim) [HAVE_X_I18N]: Declare.
+
+2003-05-21 Jason Rumney <[email protected]>
+
+ * unexw32.c (_start): Remove _fmode initialization.
+
+ * emacs.c (main) [WINDOWSNT]: Move it here.
+
+2003-05-20 Dave Love <[email protected]>
+
+ * s/gnu-linux.h (MAIL_USE_FLOCK): Make it conditional.
+
+2003-05-19 Richard M. Stallman <[email protected]>
+
+ * xfaces.c (Finternal_set_lisp_face_attribute): Handle Qunspecified
+ as value for QCfont attribute.
+ (realize_default_face): lface should already exist; crash if not.
+ Specify 0 for FORCE_P when calling set_lface_from_font_name.
+
+ * frame.c (Fignore_event): Doc fix.
+
+2003-05-19 Kenichi Handa <[email protected]>
+
+ * coding.c (decode_coding_string): Handle post-read-conversion
+ even if the coding doesn't require decoding.
+
+2003-05-18 Richard M. Stallman <[email protected]>
+
+ * callproc.c (Fcall_process_region): Doc fix.
+
+2003-05-17 Stefan Monnier <[email protected]>
+
+ * lread.c (Fload): Print a message if package is obsolete.
+
+ * window.c (Fselect_window): Add optional `norecord' arg.
+ (select_window_1): Fold into Fselect_window.
+ (select_window_norecord): New function.
+ (temp_output_buffer_show): Use it. Preserve current buffer.
+
+ * window.h (Fselect_window): Update declaration.
+
+ * window.c (delete_window, Fother_window, Fset_window_configuration):
+ * minibuf.c (read_minibuf):
+ * macterm.c (x_new_focus_frame):
+ * frame.c (do_switch_frame, Fset_frame_selected_window, Fdelete_frame):
+ * callint.c (Fcall_interactively):
+ * xterm.c (x_new_focus_frame): Pass nil as new arg to Fselect_window.
+
+ * buffer.c (Fpop_to_buffer): Pass norecord to Fselect_window.
+
+2003-05-17 David Kastrup <[email protected]>
+
+ * process.c (read_process_output): Back out change from 2003-03-09.
+
+2003-05-17 Stefan Monnier <[email protected]>
+
+ * editfns.c (get_pos_property): Don't assume that `object' = nil.
+
+ * textprop.c (text_property_stickiness): New arg `buffer'.
+
+ * intervals.h (text_property_stickiness): New arg `buffer'.
+ (get_pos_property): Declare.
+
+ * intervals.c (get_local_map): Use get_pos_property, to obey
+ stickiness and empty overlays.
+ (create_root_interval, graft_intervals_into_buffer): Use BEG.
+ (merge_properties, intervals_equal, merge_properties_sticky):
+ Use XCAR, XCDR.
+ (adjust_for_invis_intang): Pass new arg to text_property_stickiness.
+
+2003-05-17 Richard M. Stallman <[email protected]>
+
+ * minibuf.c (read_minibuf): If buffer is empty, record the default
+ in the history.
+ (Fminibuffer_complete_word): When deleting the overlap, take account
+ of its real position.
+
+ * fns.c (map_char_table): Fix previous change.
+
+ * syntax.c (find_defun_start):
+ When open_paren_in_column_0_is_defun_start,
+ return beginning of buffer.
+
+ * lisp.h (map_char_table): Declare added arg.
+
+ * fns.c (map_char_table): New arg TABLE gets the master table.
+ All calls changed.
+ Process default and inheritance, resorting to Faref if necessary.
+
+ * keymap.c (Fset_keymap_parent, map_keymap, Fcopy_keymap)
+ (Faccessible_keymaps): Pass new arg to map_char_table.
+
+ * fontset.c (Ffontset_info): Pass new arg to map_char_table.
+
+ * casetab.c (set_case_table): Pass new arg to map_char_table.
+
+ * data.c (let_shadows_buffer_binding_p): Make target of p volatile.
+
+ * lisp.h (specbinding_func): New typedef.
+ (struct specbinding): Use specbinding_func, to put the `volatile'
+ in the right place.
+
+ * alloc.c (Fgarbage_collect): Cast pointers into specpdl
+ to avoid GCC warning.
+
+2003-05-16 Ralph Schleicher <[email protected]>
+
+ * fileio.c (Fdelete_file): Handle symlinks pointing to directories.
+
+2003-05-15 Stefan Monnier <[email protected]>
+
+ * keyboard.c (apply_modifiers): Don't fill the other cache.
+
+2003-05-14 Stefan Monnier <[email protected]>
+
+ * .gdbinit-union: New file, for USE_LISP_UNION_TYPE users.
+
+ * window.h (Qwindowp, Qwindow_live_p, Vwindow_list)
+ (Fwindow_end, Fselected_window, Fdelete_window, Fwindow_buffer)
+ (Fget_buffer_window, Fsave_window_excursion, Fsplit_window)
+ (Fset_window_configuration, Fcurrent_window_configuration)
+ (compare_window_configurations, Fcoordinates_in_window_p, Fwindow_at)
+ (Fpos_visible_in_window_p, mark_window_cursors_off)
+ (window_internal_height, window_internal_width, Frecenter)
+ (Fscroll_other_window, Fset_window_start, temp_output_buffer_show)
+ (replace_buffer_in_all_windows, init_window_once, init_window)
+ (syms_of_window, keys_of_window): Move from lisp.h.
+ * lisp.h: Move window.c declarations to window.h.
+
+ * bytecode.c: Include window.h.
+ * emacs.c: Include window.h.
+
+ * keyboard.c (make_lispy_event): Apply modifiers to multibyte-char key.
+ (keyremap): Add `parent' field.
+ (keyremap_step): Use it. Remove `parent' argument.
+ (read_key_sequence): Setup and use the new `parent' field.
+
+2003-05-11 Stefan Monnier <[email protected]>
+
+ * keyboard.c (adjust_point_for_property): Ensure termination.
+
+2003-05-10 Stefan Monnier <[email protected]>
+
+ * keyboard.c (follow_key): Remove dead variable `did_meta'.
+ (access_keymap_keyremap, keyremap_step): New funs, extracted from the
+ duplicated handling of function-key-map and key-translation-map
+ in read_key_sequence.
+ (read_key_sequence): Use them.
+
+ * keyboard.c (adjust_point_for_property): Try harder to move point
+ to the non-sticky end of an invisible property.
+
+ * xdisp.c (single_display_prop_intangible_p): Make `space' display
+ property intangible as well.
+
+2003-05-10 Andreas Schwab <[email protected]>
+
+ * xmenu.c (single_menu_item): Change last parameter to void* to
+ avoid warning.
+
+2003-05-09 Richard M. Stallman <[email protected]>
+
+ * print.c (Fprin1_to_string): Instead of gcpro, set abort_on_gc.
+ Bind Qinhibit_modification_hooks to t so there will be no GC.
+ Rename local `tem' to `save_deactivate_mark'.
+
+ * eval.c (specpdl_ptr): Declare volatile.
+ (unbind_to): Copy the whole binding and decrement specpdl_ptr
+ before doing the work of unbinding it.
+
+ * lisp.h (struct specbinding): Declare elements volatile.
+ (specpdl_ptr): Declare volatile.
+
+ * Makefile.in (alloca.o): Specify -DDO_BLOCK_INPUT in compiling.
+
+ * alloca.c: Test DO_BLOCK_INPUT rather than `emacs'
+ for use of BLOCK_INPUT and inclusion of lisp.h and blockinput.h.
+
+2003-05-08 Dave Love <[email protected]>
+
+ * coding.c (Vlast_coding_system_used): Doc fix.
+
+2003-05-07 Jason Rumney <[email protected]>
+
+ * fileio.c (Ffile_symlink_p): Let handlers handle symlinks even
+ when system does not support them.
+
+2003-05-05 Stefan Monnier <[email protected]>
+
+ * fileio.c (Qwrite_region_annotate_functions): New var.
+ (build_annotations): Use it to process the global part of the hook.
+ (syms_of_fileio): Init and staticpro it.
+
+ * keyboard.c (safe_run_hooks_error): Display a message instead of
+ silently ignoring the error.
+
+2003-05-03 Stefan Monnier <[email protected]>
+
+ * keyboard.c (input_available_signal): Mark static.
+ (menu_bar_items): Use map_keymap.
+ (menu_bar_one_keymap): Remove.
+ (menu_bar_item): Adjust arglist (for use in map_keymap).
+ Properly hide a second binding when not both are keymaps.
+
+ * xmenu.c (struct skp): New struct, to pass args through map_keymap.
+ (single_keymap_panes): Use it and map_keymap.
+ (single_menu_item): Use skp as well.
+
+ * keymap.h (map_keymap_function_t): New type.
+ (map_keymap): Declare.
+
+ * keymap.c (map_keymap_item, map_keymap_char_table_item, map_keymap)
+ (map_keymap_call, Fmap_keymap): New functions.
+ (syms_of_keymap): Defsubr map-keymap.
+
+2003-05-02 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c (create_dialog, make_widget_for_menu_item)
+ (make_menu_item, create_menus, xg_update_menu_item): Don't call
+ ..._with_mnemonic functions for menu items.
+
+2003-05-01 Kenichi Handa <[email protected]>
+
+ * coding.c (coding_system_accept_latin_extra_p): Delete this
+ function.
+ (find_safe_codings): Pay attention to
+ the property tranlsation-table-for-encode of each codings.
+ (syms_of_coding): Give Qtranslation_table the extra slot number 2.
+
+2003-05-01 Stefan Monnier <[email protected]>
+
+ * eval.c (Funwind_protect): Use func=Fprogn rather than symbol=Qnil.
+
+2003-04-30 Stefan Monnier <[email protected]>
+
+ * eval.c (unbind_to): Don't handle symbol = Qnil any more.
+
+ * lisp.h (CHECK): Wrap args in parenthesis.
+ (specbind): Fix doc: symbol = Qnil is not supported any more.
+
+ * bytecode.c (Fbyte_code) <unwind-protect>:
+ Use Fprogn rather than 0 and Qnil.
+
+ * keyboard.c (parse_modifiers_uncached): Parse `down', `drag',
+ `double', and `triple' modifiers as well.
+
+2003-04-30 Richard M. Stallman <[email protected]>
+
+ * keyboard.c (echo_char): Don't clear out a dash that follows a space.
+
+ * alloc.c (abort_on_gc): New variable.
+ (Fgarbage_collect): Abort if abort_on_gc is set.
+
+ * lisp.h (abort_on_gc): Add decl.
+
+ * eval.c (Fsignal): Clear abort_on_gc.
+
+ * editfns.c (Fformat): Set abort_on_gc during first scan of format.
+ Reinit FORMAT_START and END before second scan.
+
+ * xdisp.c (move_it_vertically_backward): Do the final big else
+ even if nlines is 0.
+
+ * xdisp.c (redisplay_internal): Finish the per-frame loop
+ even if redisplay is suspended by input.
+
+2003-04-24 Andrew Choi <[email protected]>
+
+ * macterm.c (x_list_fonts): Return all fonts that match if
+ maxnames = -1.
+
+2003-04-25 Kenichi Handa <[email protected]>
+
+ * syntax.c (skip_chars): Fix previous change.
+
+2003-04-24 Kenichi Handa <[email protected]>
+
+ * syntax.c (skip_chars): Make the code faster by using the common
+ technique of *p, *stop, and *endp.
+
+2003-04-23 Jan Dj,Ad(Brv <[email protected]>
+
+ * xdisp.c (update_tool_bar): BLOCK_INPUT before calling
+ tool_bar_items so GTK tool bar expose callback does not access items
+ being updated.
+
+2003-04-19 Stefan Monnier <[email protected]>
+
+ * eval.c (Fapply): Undo last change and add a comment about why.
+
+2003-04-18 Miles Bader <[email protected]>
+
+ * data.c (Faset): Calculate nbytes earlier, to satisfy the now
+ pickier PARSE_MULTIBYTE_SEQ.
+
+2003-04-17 Stefan Monnier <[email protected]>
+
+ * eval.c (For, Fand, Fprogn, un_autoload, do_autoload):
+ Use XCDR, XCAR, CONSP.
+ (Fdefmacro): Fix docstring. Use XCAR, XCDR.
+ (Fapply): Remove unnecessary GCPRO.
+
+ * doc.c (Fsubstitute_command_keys): Remove spurious casts.
+
+ * charset.h (PARSE_MULTIBYTE_SEQ): Pretend `length' is used.
+
+ * buffer.h: Don't hardcode BEG==1.
+
+ * abbrev.c (Fdefine_abbrev_table): Use XCAR, XCDR.
+
+2003-04-16 Richard M. Stallman <[email protected]>
+
+ * xdisp.c (try_window, try_window_reusing_current_matrix):
+ When at end of window, set window_end_pos to Z-ZV.
+
+ * buffer.c (Foverlay_recenter): Doc fix.
+
+2003-04-14 Stefan Monnier <[email protected]>
+
+ * dispnew.c (Fsit_For): Support XEmacs-style arg list.
+
+2003-04-14 Andrew Choi <[email protected]>
+
+ * macterm.c (mac_check_for_quit_char): Don't check more often than
+ once a second.
+
+2003-04-11 Stefan Monnier <[email protected]>
+
+ * keyboard.c (kbd_buffer_get_event): Don't handle SELECT_WINDOW_EVENT
+ specially, so that they can't hide an implicit switch-frame event.
+ (make_lispy_event): Handle SELECT_WINDOW_EVENT.
+ (head_table): Use switch-frame as event_kind for select-window.
+ (keys_of_keyboard): Don't bind [select-window] in special-event-map.
+
+ * editfns.c (Fformat): Lisp_Object/int mixup.
+ (format2): Remove unused var numargs.
+
+2003-04-11 Kenichi Handa <[email protected]>
+
+ * fileio.c (Vafter_insert_file_adjust_coding_function): Delete.
+ (Qafter_insert_file_set_coding): New variable.
+ (syms_of_fileio): Initialize and staticpro it. Delete declaration
+ for after-insert-file-adjust-coding-function.
+ (Finsert_file_contents): Call Qafter_insert_file_set_coding
+ instead of Vafter_insert_file_adjust_coding_function.
+
+2003-04-11 Kenichi Handa <[email protected]>
+
+ * lisp.h (temp_echo_area_glyphs): Adjust prototype.
+
+ * minibuf.c (temp_echo_area_glyphs): Change the arg to Lisp
+ string. Callers changed.
+
+2003-04-10 Kenichi Handa <[email protected]>
+
+ * fileio.c (Vafter_insert_file_adjust_coding_function): New variable.
+ (syms_of_fileio): Declare it as a lisp variable.
+ (Finsert_file_contents):
+ Call Vafter_insert_file_adjust_coding_function before calling
+ decode-format.
+
+2003-04-09 Jan Dj,Ad(Brv <[email protected]>
+
+ * xterm.c (xg_scroll_callback): Call gtk_range_get_adjustment to
+ get GtkAdjustment as widget now is a GtkRange.
+
+ * gtkutil.c (xg_create_scroll_bar): Connect to value-changed on
+ GtkRange to avoid memory leak.
+
+2003-04-09 Kenichi Handa <[email protected]>
+
+ * xfaces.c (Vface_font_rescale_alist): New variable.
+ (struct font_name): New member rescale_ratio.
+ (font_rescale_ratio): New function.
+ (split_font_name): If NUMERIC_P is nonzero, set font->rescale_ratio.
+ (better_font_p): On comparing point sized, pay attention to
+ recale_ratio member of fonts.
+ (build_scalable_font_name): Reflect font->rescale_ratio in the
+ font name.
+ (syms_of_xfaces): Declare Vface_font_rescale_alist as a Lisp variable.
+
+ * lread.c (read1): Before calling index, check if the 2nd
+ arguemnt is in ASCII range.
+
+2003-04-08 Richard M. Stallman <[email protected]>
+
+ * fileio.c (Ffile_symlink_p): Doc fix.
+
+ * editfns.c (Fformat): Translate positions of text properties
+ in the format string to apply them to the result.
+
+ * fileio.c (Finsert_file_contents): Doc fix.
+ (syms_of_fileio) <after-insert-file-functions>: Doc fix.
+
+2003-04-08 Ivan Zakharyaschev <[email protected]> (tiny change)
+
+ * lread.c (openp): Get the Qfile_exists_p handler for STRING, not FN.
+
+2003-04-08 Steven Tamm <[email protected]>
+
+ * mac.c (init_mac_osx_environment): Switch libexec and bin so
+ that self-contained application finds libexec files.
+
+2003-04-08 Kenichi Handa <[email protected]>
+
+ * coding.c (code_convert_region_unwind):
+ Set Vlast_coding_system_used to the argument.
+ (code_convert_region): If post-read-conversion function changed
+ the value of last-coding-sytem, keep the new value in
+ coding->symbol so that it won't be overridden.
+ (run_pre_post_conversion_on_str): Likewise.
+ (coding_system_accept_latin_extra_p): New function.
+ (find_safe_codings): Pay attention to characters registered in
+ latin-extra-code-table.
+
+2003-04-07 Thien-Thi Nguyen <[email protected]>
+
+ * Makefile.in (md5.o): Add missing dependency info.
+
+2003-04-06 Richard M. Stallman <[email protected]>
+
+ * xselect.c (x_handle_selection_request): Move UNGCPRO to very end.
+
+ * marker.c (verify_bytepos): New function.
+
+ * intervals.c (set_intervals_multibyte_1): When becoming
+ multibyte, adjust right and left child sizes to a whole set of
+ characters. If an interval gets zero total-length, delete it.
+ If an interval consists of just its children, delete one of them.
+
+ * intervals.h (CHECK_TOTAL_LENGTH): New macro.
+ * intervals.c: Add many calls to CHECK_TOTAL_LENGTH.
+
+ * alloc.c (VALIDATE_LISP_STORAGE): Macro deleted.
+ All calls deleted.
+ (lisp_malloc): Do the work here directly.
+
+2003-04-06 Gareth Jones <[email protected]> (tiny change)
+
+ * fns.c (Flength): Return SUB_CHAR_TABLE_ORDINARY_SLOTS for sub
+ char tables.
+
+2003-04-04 Kenichi Handa <[email protected]>
+
+ * editfns.c (Fformat): Use a copy of FORMAT string so that we can
+ destructively change "%S" to "%s".
+
+2003-04-03 Miles Bader <[email protected]>
+
+ * xfaces.c (choose_face_font): Make sure *NEEDS_OVERSTRIKE is
+ always set.
+
+2003-04-01 Dave Love <[email protected]>
+
+ * xfns.c (xpm_lookup_color): Grok "opaque".
+
+2003-03-31 Andrew Choi <[email protected]>
+
+ * frame.c (x_report_frame_params) [HAVE_CARBON]: Do not report
+ parent window ID.
+
+ * macfns.c (syms_of_macfns): Remove call to init_x_parm_symbols.
+
+ * macterm.h (struct mac_output): Define x_pixels_diff and
+ y_pixels_diff.
+
+2003-03-31 Juanma Barranquero <[email protected]>
+
+ * makefile.w32-in ($(BLD)/frame.$(O)): Add dependency on
+ blockinput.h and files included from it.
+
+2003-03-31 Kim F. Storm <[email protected]>
+
+ The following changes consolidates the common code related to
+ frame-parameter handling from the xfns.c, w32fns.c, and macfns.c
+ files into frame.c.
+
+ * frame.c: Include blockinput.h.
+ (Vx_resource_name, Vx_resource_class, Qx_frame_parameter)
+ (Qx_resource_name, Qface_set_after_frame_default): Define vars here.
+ (Qauto_raise, Qauto_lower, ...): Define all frame parameter
+ related vars here.
+ (struct frame_parm_table, frame_parms): New table for describing
+ frame parameters and their associated Q-variable.
+ The order of the parameters corresponds to the sequence of the
+ frame_parm_handlers table in redisplay_interface.
+ (x_fullscreen_move, x_set_frame_parameters)
+ (x_report_frame_params, x_set_fullscreen, x_set_line_spacing)
+ (x_set_screen_gamma, x_set_font, x_set_fringe_width)
+ (x_set_border_width, x_set_internal_border_width, x_set_visibility)
+ (x_set_autoraise, x_set_autolower, x_set_unsplittable)
+ (x_set_vertical_scroll_bars, x_set_scroll_bar_width, x_icon_type):
+ Generic functions for processing of frame parameters.
+ (validate_x_resource_name, xrdb_get_resource, Fx_get_resource)
+ (display_x_get_resource, x_get_resource_string): Functions for
+ generic access to X resources.
+ (x_get_arg, x_frame_get_arg, x_frame_get_and_record_arg)
+ (x_default_parameter, Fx_parse_geometry): Functions for generic
+ access to frame parameters.
+ (x_figure_window_size): Generic calculation of frame size.
+ Fixed to add space needed for tool bar. Also setup size_hint_flags.
+ (syms_of_frame): Intern and staticpro frame parameter variables.
+ Defvar_lisp Vx_resource_class and Vx_resource_name here.
+ Defsubr Sx_get_resource and Sx_parse_geometry.
+
+ * frame.h (Qauto_raise, Qauto_lower, ...): Declare extern all frame
+ parameter related vars defined in frame.c.
+ (EMACS_CLASS): Define here.
+ (enum FULLSCREEN_*): Define here.
+ (x_set_scroll_bar_default_width, x_wm_set_icon_position)
+ (x_set_offset, x_new_font, x_new_fontset): Add prototypes.
+ (x_fullscreen_adjust, x_set_frame_parameters, x_report_frame_params)
+ (x_set_fullscreen, x_set_line_spacing, x_set_screen_gamma, x_set_font)
+ (x_set_fringe_width, x_set_border_width, x_set_internal_border_width)
+ (x_set_visibility, x_set_autoraise, x_set_autolower)
+ (x_set_unsplittable, x_set_vertical_scroll_bars)
+ (x_set_scroll_bar_width, x_icon_type, validate_x_resource_name)
+ (x_figure_window_size): Add prototypes.
+
+ * dispextern.h (frame_parm_handler): New typedef.
+ (struct redisplay_interface): New member frame_parm_handlers.
+ (enum resource_types): Move declaration here.
+ (x_get_arg, x_frame_get_arg, x_frame_get_and_record_arg)
+ (x_default_parameter): Add prototypes.
+
+ * window.c: Remove extern decl for frame parameter vars.
+ (change_window_heights): New generic function;
+ replaces x_change_window_heights. All users changed.
+
+ * window.h (change_window_heights): Add prototype.
+
+ * xfaces.c: Remove extern decl for frame parameter vars.
+
+ * xterm.h (EMACS_CLASS): Remove. Use generic define.
+ (struct w32_display_info): Fix type of xrdb member.
+ (enum FULLSCREEN_*): Remove.
+ Remove prototypes for generic functions (in frame.h).
+
+ * xfns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
+ parameters now defined in frame.h and frame.c.
+ (Vx_resource_name): Remove. Use generic var.
+ (enum x_frame_parms): Remove (bogus, unused enum).
+ (check_x_display_info): Make non-static (for frame.c).
+ (struct x_frame_parm_table, x_frame_parms): Remove.
+ (init_x_parm_symbols, x_set_frame_parameters, x_report_frame_params)
+ (x_set_line_spacing, x_set_screen_gamma, x_icon_type, x_set_font)
+ (x_set_border_width, x_set_internal_border_width, x_set_visibility)
+ (x_change_window_heights, x_set_autoraise, x_set_autolower)
+ (x_set_vertical_scroll_bars, x_set_scroll_bar_width)
+ (validate_x_resource_name, Fx_get_resource, x_get_resource_string)
+ (x_default_parameter, Fx_parse_geometry, x_figure_window_size):
+ Remove. Use generic functions instead.
+ (enum resource_types): Remove.
+ (x_set_scroll_bar_default_width): New global function (for frame.c).
+ (Fx_create_frame): Depend on x_figure_window_size to add space for
+ toolbar and setup size_hint_flags.
+ (x_frame_parm_handlers): New table for redisplay_interface.
+ (syms_of_xfns): Don't intern/staticpro removed vars.
+
+ * xterm.c: Remove unnecessary extern declarations.
+ (x_fullscreen_adjust): Remove. Use generic instead.
+ (x_redisplay_interface): Add x_frame_parm_handlers member.
+
+ * w32gui.h (XrmDatabase): New (dummy) typedef.
+
+ * w32term.h (EMACS_CLASS): Remove. Use generic define.
+ (struct w32_display_info): Fix type of xrdb member.
+ (enum FULLSCREEN_*): Remove.
+ (x_fullscreen_adjust): Remove prototype.
+
+ * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
+ parameters now defined in frame.h and frame.c.
+ (Vx_resource_name): Remove. Use generic var.
+ (enum x_frame_parms): Remove (bogus, unused enum).
+ (check_x_display_info): Make non-static (for frame.c).
+ (struct x_frame_parm_table, x_frame_parms): Remove.
+ (init_x_parm_symbols, x_set_frame_parameters, x_report_frame_params)
+ (x_set_line_spacing, x_set_screen_gamma, x_icon_type, x_set_font)
+ (x_set_border_width, x_set_internal_border_width, x_set_visibility)
+ (x_change_window_heights, x_set_autoraise, x_set_autolower)
+ (x_set_vertical_scroll_bars, x_set_scroll_bar_width)
+ (validate_x_resource_name, Fx_get_resource, x_get_resource_string)
+ (x_default_parameter, Fx_parse_geometry, x_figure_window_size):
+ Remove. Use generic functions instead.
+ (enum resource_types): Remove.
+ (x_set_scroll_bar_default_width): New global function (for frame.c).
+ (Fx_create_frame): Depend on x_figure_window_size to add space for
+ toolbar and setup size_hint_flags.
+ (w32_frame_parm_handlers): New table for redisplay_interface.
+ (syms_of_w32fns): Don't intern/staticpro removed vars.
+
+ * w32term.c: Remove unnecessary extern declarations.
+ (x_fullscreen_adjust): Remove. Use generic instead.
+ (x_redisplay_interface): Add w32_frame_parm_handlers member.
+
+ * w32reg.c (x_get_string_resource): Use XrmDatabase.
+
+ * macgui.h (XrmDatabase): New (dummy) typedef.
+
+ * macterm.h (EMACS_CLASS): Remove.
+ (struct mac_display_info): Add xrdb member.
+ (struct mac_output): Add want_fullscreen member.
+
+ * macfns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
+ parameters now defined in frame.h and frame.c.
+ (Vx_resource_name): Remove. Use generic var.
+ (check_x_display_info): Make non-static (for frame.c).
+ (struct x_frame_parm_table, x_frame_parms): Remove.
+ (init_x_parm_symbols, x_set_frame_parameters, x_report_frame_params)
+ (x_set_line_spacing, x_set_screen_gamma, x_icon_type, x_set_font)
+ (x_set_border_width, x_set_internal_border_width, x_set_visibility)
+ (x_change_window_heights, x_set_autoraise, x_set_autolower)
+ (x_set_vertical_scroll_bars, x_set_scroll_bar_width)
+ (validate_x_resource_name, Fx_get_resource, x_get_resource_string)
+ (x_default_parameter, Fx_parse_geometry, x_figure_window_size):
+ Remove. Use generic functions instead.
+ (enum resource_types): Remove.
+ (x_set_scroll_bar_default_width): New global function (for frame.c).
+ (mac_frame_parm_handlers): New table for redisplay_interface.
+ (syms_of_macfns): Don't intern/staticpro removed vars.
+
+ * macterm.c: Remove unnecessary extern declarations.
+ (x_redisplay_interface): Add mac_frame_parm_handlers member.
+
+ * Makefile.in (frame.o): Add dependency on blockinput.h and files
+ included from it (atimer.h and systime.h).
+
+2003-03-30 Andreas Schwab <[email protected]>
+
+ * xdisp.c (x_insert_glyphs): Fix swapped width and height
+ parameters for shift_glyphs_for_insert.
+
+ * macterm.c (x_redisplay_interface): Add missing entry for
+ draw_vertical_window_border.
+
+2003-03-29 Kai Gro,A_(Bjohann <[email protected]>
+
+ * fileio.c (Fexpand_file_name): In the no-handler case, after
+ expanding, look again for a handler and invoke it. This is needed
+ for filenames like "/foo/../user@host:/bar/../baz" -- the first
+ expansion produces "/user@host:/bar/../baz" which needs to be
+ expanded again for the finame result "/user@host:/baz".
+
+2003-03-28 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c (xg_tool_bar_item_expose_callback): Reduce size
+ of area to be redrawn for better performance.
+
+2003-03-28 Stefan Monnier <[email protected]>
+
+ * xterm.c (take_vertical_position_into_account): Remove.
+ (xt_action_hook): Call set_vertical_scroll_bar if needed.
+ (XM_SB_MIN, XM_SB_RANGE): Remove (min is now set to 0).
+ (xm_scroll_callback, x_create_toolkit_scroll_bar)
+ (x_set_toolkit_scroll_bar_thumb): Simplify.
+ (x_scroll_bar_expose): Only compile if !USE_TOOLKIT_SCROLL_BARS.
+ (XTread_socket): Remove unused var.
+ (x_make_frame_invisible): Replace goto with else.
+
+ * xdisp.c (set_vertical_scroll_bar): New fun.
+ (redisplay_window): Use it.
+
+2003-03-26 Richard M. Stallman <[email protected]>
+
+ * xdisp.c (update_tool_bar): Recompute tool bar if
+ update_mode_lines is set. Set w->update_mode_line
+ only if the tool bar contents actually change.
+ (update_menu_bar): Undo previous change.
+
+2003-03-26 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c (xg_resize_widgets): Don't call xg_frame_cleared.
+ (xg_frame_set_char_size): Calculate scroll bar width before frame
+ width. Call SET_FRAME_GARBAGED and cancel_mouse_face.
+ (xg_separator_p): Check for all documented separator types.
+ (xg_update_scrollbar_pos): Variable gheight not needed, use height.
+ (update_frame_tool_bar): Don't call gdk_window_process_all_updates.
+
+ * xdisp.c (update_menu_bar): Set w->update_mode_line to Qt
+ so tool bar gets updated.
+
+2003-03-26 Stefan Monnier <[email protected]>
+
+ * data.c (store_symval_forwarding): Re-instate part of the code
+ that was deleted with too much enthusiasm.
+
+2003-03-25 Stefan Monnier <[email protected]>
+
+ * data.c (store_symval_forwarding): Delete special read-only
+ hack for type == -1, since we now use ->constant instead.
+ (Fkill_local_variable): Don't use XBUFFER if it can be nil.
+
+ * buffer.c (overlays_in): Declare static.
+ (syms_of_buffer) <enable-multibyte-characters>: Use the symbol's
+ `constant' field rather than the variable's `type' field.
+
+2003-03-24 Andrew Choi <[email protected]>
+
+ * config.in [MAC_OSX]: Do not redefine bcopy, bzero, and bcmp.
+
+ * dispextern.h [HAVE_CARBON]: Include Carbon.h.
+
+ * fns.c [MAC_OSX]: Do not redefine vector.
+
+ * keyboard.c [MAC_OSX]: Handle SIGINT with interrupt_signal.
+
+ * macgui.h: Remove definition of No_Cursor.
+
+ * macterm.h: Include Carbon.h. Replace (struct Cursor *) by Cursor.
+
+ * xdisp.c: Define No_Cursor.
+ (x_write_glyphs, notice_overwritten_cursor)
+ (draw_phys_cursor_glyph, note_mode_line_or_margin_highlight)
+ (note_mouse_highlight): Remove Mac-specific code.
+ (note_mouse_highlight): Use bcmp instead of == to compare Cursors.
+
+2003-03-24 John Paul Wallington <[email protected]>
+
+ * xdisp.c (redisplay_window): If mini window's buffer is not
+ empty, then redisplay it like other windows.
+
+2003-03-23 Kim F. Storm <[email protected]>
+
+ * w32term.c (w32_draw_window_cursor): Fix last change.
+
+2003-03-23 Kenichi Handa <[email protected]>
+
+ * alloc.c (make_string_from_bytes, make_specified_string):
+ Add `const' for the arg CONTENTS.
+
+ * lisp.h (make_string_from_bytes, make_specified_string):
+ Prototypes adjusted.
+
+2003-03-23 Jan Dj,Ad(Brv <[email protected]>
+
+ * xdisp.c (get_glyph_string_clip_rect): Remove ; at end of #endif.
+
+ * gtkutil.h: Take two more arguments to xg_update_scrollbar_pos.
+ (XG_SB_RANGE): New define.
+
+ * gtkutil.c (xg_fixed_handle_expose): New function.
+ (xg_create_frame_widgets): Call xg_fixed_handle_expose for
+ expose events.
+ (xg_update_scrollbar_pos): Take two more arguments, left and width
+ of scroll bar including borders.
+ Clear left and right part outside scroll bar separately as some
+ themes have bars that are not an even number of pixels.
+ Don't set reallocate_redraws, don't call
+ gdk_window_process_all_updates.
+ (xg_set_toolkit_scroll_bar_thumb): Upper value is fixed,
+ so no need to change it. Calculate size and value with XG_SB_RANGE.
+
+ * xterm.c (x_scroll_bar_create, XTset_vertical_scroll_bar):
+ Pass left and width of scroll bar including borders to
+ xg_update_scrollbar_pos.
+
+2003-03-22 Thien-Thi Nguyen <[email protected]>
+
+ * Makefile.in: Make sure space precedes end-of-line backslashes.
+
+2003-03-22 Kim F. Storm <[email protected]>
+
+ * xdisp.c (pixel_to_glyph_coords, glyph_to_pixel_coords):
+ Add generic versions here. Remove system specific versions
+ defined elsewhere.
+
+ * dispextern.h (pixel_to_glyph_coords, glyph_to_pixel_coords):
+ Add prototypes.
+
+ * xterm.h (STORE_NATIVE_RECT): New macro.
+
+2003-03-21 Kim F. Storm <[email protected]>
+
+ * xdisp.c (get_glyph_string_clip_rect):
+ Use FRAME_INTERNAL_BORDER_WIDTH.
+
+ * dispextern.h (struct redisplay_interface): Add active_p
+ argument to draw_window_cursor member. All uses changed.
+
+2003-03-21 Kim F. Storm <[email protected]>
+
+ The following changes consolidate code related to writing and
+ inserting glyphs, exposing frame, the tool bar, the mouse face,
+ the output cursor, and help echo from xterm.c, w32term.c and
+ macterm.c into xdisp.c. It also generalizes the use of the
+ window_part enum instead of using numeric values throughout.
+
+ * xdisp.c: Consolidate gui-independent code here.
+ Include keymap.h.
+ (Qhelp_echo): Import.
+ (mouse_autoselect_window, x_stretch_cursor_p): Declare here.
+ (help_echo_string, help_echo_window, help_echo_object)
+ (previous_help_echo_string, help_echo_pos): Declare here.
+ (output_cursor, last_mouse_frame, last_tool_bar_item): Declare here.
+ (estimate_mode_line_height): Define here. Handle windowing
+ systems directly (without using estimate_mode_line_height_hook).
+ (x_y_to_hpos_vpos, get_tool_bar_item, note_tool_bar_highlight):
+ (update_window_cursor, update_cursor_in_window_tree)
+ (fast_find_position, fast_find_string_pos)
+ (note_mode_line_highlight, note_mode_line_or_margin_highlight)
+ (expose_area, expose_line, expose_overlaps, expose_window)
+ (expose_window_tree, phys_cursor_in_rect_p): New generic versions;
+ declared static as they are only used locally in xdisp.c.
+ (draw_glyphs): Rename from x_draw_glyphs and make static.
+ (tool_bar_item_info, notice_overwritten_cursor): Make static.
+ (frame_to_window_pixel_xy, get_glyph_string_clip_rect)
+ (set_output_cursor, x_cursor_to, handle_tool_bar_click)
+ (x_write_glyphs, x_insert_glyphs, x_clear_end_of_line):
+ (x_fix_overlapping_area, draw_phys_cursor_glyph, erase_phys_cursor)
+ (display_and_set_cursor, x_update_cursor, x_clear_cursor)
+ (show_mouse_face, clear_mouse_face, cursor_in_mouse_face_p)
+ (note_mouse_highlight, x_clear_window_mouse_face)
+ (cancel_mouse_face, x_draw_vertical_border, expose_frame)
+ (x_intersect_rectangles): New generic functions for use by xdisp.c
+ and GUI front-ends.
+ (syms_of_xdisp): Initialize and staticpro help_echo* variables.
+ Defvar_bool "x-streach-cursor" and "mouse-autoselect-window" here.
+
+ * dispextern.h (Display_Info): Generic typedef for *_display_info.
+ (NativeRectangle): Generic typedef for rectangle type.
+ (enum window_part): Move here from window.c.
+ (struct redisplay_interface): New members flush_display_optional,
+ define_frame_cursor, clear_frame_area, draw_window_cursor,
+ draw_vertical_window_border, shift_glyphs_for_insert.
+ Rename member clear_mouse_face to clear_window_mouse_face.
+ (estimate_mode_line_height_hook): Remove hook.
+ (auto_raise_tool_bar_buttons_p): Don't declare extern.
+ (tool_bar_item_info): Remove prototype.
+ (help_echo_string, help_echo_window, help_echo_object)
+ (previous_help_echo_string, help_echo_pos)
+ (last_mouse_frame, last_tool_bar_item, mouse_autoselect_window):
+ (x_stretch_cursor_p, output_cursor): Declare extern.
+ (x_draw_glyphs, notice_overwritten_cursor): Remove prototypes.
+ (x_write_glyphs), x_insert_glyphs, x_clear_end_of_line)
+ (x_fix_overlapping_area, draw_phys_cursor_glyph, erase_phys_cursor)
+ (display_and_set_cursor, set_output_cursor, x_cursor_to)
+ (x_update_cursor, x_clear_cursor, x_draw_vertical_border)
+ (frame_to_window_pixel_xy, get_glyph_string_clip_rect)
+ (note_mouse_highlight, x_clear_window_mouse_face, cancel_mouse_face)
+ (handle_tool_bar_click, clear_mouse_face, show_mouse_face)
+ (cursor_in_mouse_face_p, expose_frame, x_intersect_rectangles):
+ Add prototypes.
+ (mode_line_string, marginal_area_string): Fix prototypes.
+
+ * window.c (enum window_part): Move to dispextern.h.
+ (coordinates_in_window): Use enum window_part member names
+ instead of numbers to describe return value.
+ (struct check_window_data): Change part member to window_part.
+ (check_window_containing): Return window_part unaltered.
+ (window_from_coordinates): Change part arg from int to enum
+ window_part. Allow part arg to be null. All users changed.
+
+ * window.h (window_from_coordinates): Fix prototype.
+
+ * term.c (estimate_mode_line_height): Move to xdisp.c.
+
+ * keyboard.c (make_lispy_event): Use enum window_part.
+
+ * dispnew.c (mode_line_string, marginal_area_string): Use enum
+ window_part instead of int in arg list. Users changed.
+
+ * xterm.h (No_Cursor): Declare as None for X.
+ (struct mac_output): Replace member cross_cursor by hand_cursor.
+
+ * xterm.c: Remove consolidated defines and code.
+ (BETWEEN): Remove unused macro.
+ (x_draw_vertical_window_border, x_shift_glyphs_for_insert)
+ (x_define_frame_cursor, x_clear_frame_area)
+ (x_draw_window_cursor): New X-specific functions for RIF.
+ (x_redisplay_interface): Add new members.
+
+ * xfns.c: Setup and use hand_cursor instead of cross_cursor.
+
+ * w32term.h (struct w32_output): Remove cross_cursor member.
+
+ * w32term.c: Remove consolidated defines and code.
+ (BETWEEN): Remove unused macro.
+ (w32_draw_vertical_window_border, w32_shift_glyphs_for_insert)
+ (w32_define_frame_cursor, w32_clear_frame_area)
+ (w32_draw_window_cursor): New W32-specific functions for RIF.
+ (w32_redisplay_interface): Add new members.
+
+ * w32gui.h (No_Cursor): Define as 0 for W32.
+ (XRectangle): Add X compatible rectangle type.
+ (NativeRectangle): Declare as RECT for W32.
+ (CONVERT_TO_XRECT, CONVERT_FROM_XRECT, STORE_NATIVE_RECT): New macros.
+
+ * w32fns.c: Remove setup of cross_cursor (already has hand_cursor).
+
+ * w32console.c: Remove consolidated defines and code.
+
+ * msdos.h (Display_Info): Add generic typedef.
+
+ * msdos.c: Remove consolidated defines and code.
+ (IT_note_mouse_highlight, dos_rawgetc): Use enum window_part.
+
+ * macterm.h (struct mac_output): Replace member cross_cursor by
+ hand_cursor.
+ (activate_scroll_bars, deactivate_scroll_bars): Add prototypes.
+
+ * macterm.c: Remove consolidated defines and code.
+ (BETWEEN): Remove unused macro.
+ (mac_draw_vertical_window_border, mac_shift_glyphs_for_insert)
+ (mac_define_frame_cursor, mac_clear_frame_area)
+ (mac_draw_window_cursor): New Mac-specific functions for RIF.
+ (x_redisplay_interface): Add new members.
+
+ * macgui.h (No_Cursor): Define as 0 for Mac.
+ (XRectangle): Add X compatible rectangle type.
+ (NativeRectangle): Declare as Rect for Mac.
+ (CONVERT_TO_XRECT, CONVERT_FROM_XRECT, STORE_NATIVE_RECT): New macros.
+
+ * macfns.c (x_set_mouse_color): Setup hand_cursor.
+ (x_set_cursor_color): Use x_display_and_set_cursor.
+
+ * Makefile.in (xdisp.o): Add dependency on blockinput.h and files
+ included from it. Add dependency on keymap.h.
+
+ * makefile.w32-in (xdisp.o): Add dependency on keymap.h.
+
+2003-03-21 Kenichi Handa <[email protected]>
+
+ * fileio.c (Fexpand_file_name): Fix previous change.
+
+2003-03-19 Kenichi Handa <[email protected]>
+
+ * fileio.c (Ffile_name_directory): Reconstruct file name by
+ make_specified_string.
+ (Ffile_name_nondirectory, Ffile_name_as_directory)
+ (Fdirectory_file_name, Fexpand_file_name)
+ (Fsubstitute_in_file_name): Likewise.
+ (Fread_file_name): Compare decoded homedir with DIR and
+ DEFAULT_FILENAME.
+
+ * alloc.c (make_specified_string): If NCHARS is negative, count
+ the number of characters.
+
+2003-03-18 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c (xg_frame_cleared): Call gtk_widget_queue_draw for
+ all widgets.
+
+ * gtkutil.h: Removed xg_ignore_next_thumb.
+
+2003-03-18 Kenichi Handa <[email protected]>
+
+ * coding.c (Vchar_coding_system_table): Remove this variable.
+ (Vcoding_system_safe_chars): New variable.
+ (intersection): Remove this function.
+ (find_safe_codings): Don't use Vchar_coding_system_table, but try
+ all codings in SAFE_CODINGS.
+ (Ffind_coding_systems_region_internal): Adjust for the change of
+ find_safe_codings. Get generic coding systems from
+ Vcoding_system_safe_chars.
+ (Fdefine_coding_system_internal): New function.
+ (syms_of_coding): Defsubr Sdefine_coding_system_internal.
+ Initialize and staticpro Vcoding_system_safe_chars.
+
+2003-03-18 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c (xg_set_toolkit_scroll_bar_thumb): Check if new values
+ equal old values before updating.
+
+ * xterm.c (xg_scroll_callback): Remove xg_ignore_next_thumb.
+
+ * gtkutil.c (xg_initialize): Remove xg_ignore_next_thumb.
+
+2003-03-17 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c: Removed handle_fixed_child, struct xg_last_sb_pos.
+ (xg_resize_widgets): Don't call foreach(handle_fixed_child).
+ (xg_gtk_scroll_destroy): Remove free of struct xg_last_sb_pos.
+ (scroll_bar_button_cb): Set bar->dragging to nil on button release.
+ (xg_create_scroll_bar): Pass bar to button event callback.
+ (xg_find_top_left_in_fixed): New function.
+ (xg_update_scrollbar_pos): Don't call gdk_window_clear on
+ whole scroll bar area. Get old position with
+ xg_find_top_left_in_fixed, calculate and only clear needed areas.
+ (xg_set_toolkit_scroll_bar_thumb): Do not adjust scroll bar if
+ dragging is in progress. Calculate whole as for Motif.
+ Remove code that saved last values. Call gtk_range functions to
+ set scroll bar sizes.
+
+ * gtkutil.h: Removed xg_ignore_next_thumb.
+
+2003-03-17 Juanma Barranquero <[email protected]>
+
+ * makefile.w32-in ($(BLD)/xdisp.$(O)): Add dependency on blockinput.h
+ and files included from it.
+
+2003-03-18 Stefan Monnier <[email protected]>
+
+ * keymap.c (accessible_keymaps_1): Break cycles but without preventing
+ multiple occurrences of the same keymap under different prefixes.
+ (Faccessible_keymaps): Remove code redundant since 1994-08-03T07:39:[email protected].
+
+2003-03-16 Jason Rumney <[email protected]>
+
+ * w32gui.h: Use HDC for Display.
+
+ * w32term.c (w32_encode_char): Prevent double-byte chars from
+ crashing Emacs.
+
+ * w32fns.c (jpeg_load, png_load, slurp_file): Read image files
+ as binary.
+
+2003-03-16 Juanma Barranquero <[email protected]>
+
+ * xdisp.c (x_produce_glyphs): Use FRAME_BASELINE_OFFSET.
+
+2003-03-16 Kim F. Storm <[email protected]>
+
+ The following changes consolidate some of the gui-independent
+ parts of the processing and drawing of "glyph strings" from
+ xterm.c, w32term.c, and macterm.c into xdisp.c.
+
+ * dispextern.h (struct glyph): Reduce face_id member from 22 to
+ 21 bits (this reduces number of faces from 4M to 2M).
+ Replace W32 specific w32_font_type member (2 bits) by generic
+ font_type member (3 bits) for portability.
+ (FONT_TYPE_UNKNOWN): New define, default for font_type member.
+ (enum draw_glyphs_face): Define here.
+ (struct glyph_string): Define here. Merge W32 and X versions.
+ (struct redisplay_interface): New members per_char_metric,
+ encode_char, compute_glyph_string_overhangs, draw_glyph_string.
+ (VCENTER_BASELINE_OFFSET): Define here.
+ (dump_glyph_string, x_get_glyph_overhangs, x_produce_glyphs)
+ (x_draw_glyphs, notice_overwritten_cursor): Declare prototypes here.
+
+ * xdisp.c: Consolidate gui-independent "glyph string" code here.
+ (dump_glyph_string): Moved here.
+ (init_glyph_string, append_glyph_string_lists, append_glyph_string)
+ (prepend_glyph_string_lists, get_glyph_face_and_encoding)
+ (fill_composite_glyph_string, fill_glyph_string)
+ (fill_image_glyph_string, fill_stretch_glyph_string)
+ (left_overwritten, left_overwriting, right_overwritten)
+ (right_overwriting, get_char_face_and_encoding)
+ (set_glyph_string_background_width, compute_overhangs_and_x)
+ (append_glyph, append_composite_glyph, produce_image_glyph)
+ (take_vertical_position_into_account, append_stretch_glyph)
+ (produce_stretch_glyph): New generic functions (based on X version).
+ Call platform specific functions through rif.
+ (INIT_GLYPH_STRING): New macro, hides W32 details.
+ (BUILD_STRETCH_GLYPH_STRING, BUILD_IMAGE_GLYPH_STRING)
+ (BUILD_CHAR_GLYPH_STRINGS, BUILD_COMPOSITE_GLYPH_STRING)
+ (BUILD_GLYPH_STRINGS): Generic macros (based on X version).
+ (x_draw_glyphs, x_get_glyph_overhangs, x_produce_glyphs)
+ (notice_overwritten_cursor):
+ Generic functions exported to platform modules. Users changed.
+
+ * xterm.h (FONT_DESCENT, FRAME_X_OUTPUT, FRAME_BASELINE_OFFSET)
+ (FONT_TYPE_FOR_UNIBYTE, FONT_TYPE_FOR_MULTIBYTE)
+ (STORE_XCHAR2B, XCHAR2B_BYTE1, XCHAR2B_BYTE2):
+ New macros for consolidated code.
+
+ * xterm.c: Remove consolidated defines and code.
+ (x_per_char_metric, x_encode_char)
+ (x_compute_glyph_string_overhangs): Adapt to RIF requirements.
+ (x_redisplay_interface): Add new members.
+
+ * w32gui.h (Display): Add dummy typedef for consolidation.
+ (XChar2b): Define alias for wchar_t for consolidation.
+ (STORE_XCHAR2B, XCHAR2B_BYTE1, XCHAR2B_BYTE2): New macros.
+
+ * w32term.h (FRAME_X_OUTPUT, FRAME_X_WINDOW, FRAME_X_DISPLAY)
+ (FONT_TYPE_FOR_UNIBYTE, FONT_TYPE_FOR_MULTIBYTE):
+ New macros for consolidation.
+
+ * w32term.c: Remove consolidated defines and code.
+ (BUILD_WCHAR_T, BYTE1, BYTE2): Macros removed; callers changed
+ to use STORE_XCHAR2B, XCHAR2B_BYTE1, XCHAR2B_BYTE2 instead.
+ (w32_per_char_metric): Change font_type arg to int for RIF.
+ (w32_encode_char): Return int according to RIF requirements.
+ (w32_compute_glyph_string_overhangs): Adapt to RIF.
+ (w32_get_glyph_overhangs): New function for RIF. Uses generic
+ x_get_glyph_overhangs.
+ (w32_redisplay_interface): Add new members.
+
+ * macgui.h (XChar2b): Move typedef here for consolidation.
+ (STORE_XCHAR2B, XCHAR2B_BYTE1, XCHAR2B_BYTE2): New macros.
+
+ * macterm.h (FRAME_X_OUTPUT, FRAME_X_WINDOW, FRAME_X_DISPLAY):
+ (FONT_TYPE_FOR_UNIBYTE, FONT_TYPE_FOR_MULTIBYTE): New macros for
+ consolidation.
+
+ * macterm.c: Remove consolidated defines and code.
+ (mac_per_char_metric): New function for RIF.
+ (mac_encode_char): Adapt to new RIF requirements.
+ (mac_compute_glyph_string_overhangs): Adapt for RIF.
+ (x_redisplay_interface): Add new members.
+
+2003-03-15 Stefan Monnier <[email protected]>
+
+ * keymap.c (Vmenu_events): New var.
+ (syms_of_keymap): Initialize it.
+ (where_is_internal): Check more carefully what is a menu event.
+
+2003-03-14 Richard M. Stallman <[email protected]>
+
+ * lread.c (read1): After #!, exit loop on eof.
+
+2003-03-14 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.h: Add declaration for xg_frame_cleared.
+
+ * xterm.c (x_clear_frame): Call xg_frame_cleared for GTK.
+
+ * gtkutil.c (struct xg_last_sb_pos): New structure.
+ (handle_fixed_child): New function.
+ (xg_resize_widgets): Call handle_fixed_child on all scroll bar widgets
+ and force a redraw on them.
+ (xg_gtk_scroll_destroy): Free struct xg_last_sb_pos also.
+ (xg_create_scroll_bar): Add struct xg_last_sb_pos to scroll bar
+ so we can avoid unneeded redraws.
+ (xg_update_scrollbar_pos): Invalidate data in xg_last_sb_pos
+ and force a redraw on the scroll bar.
+ (xg_set_toolkit_scroll_bar_thumb): Do not change/redraw scroll bar
+ if xg_last_sb_pos shows the positions are up to date.
+ (xg_frame_cleared): New function.
+
+2003-03-13 Kenichi Handa <[email protected]>
+
+ * coding.c (Fdetect_coding_region): Fix docstring.
+ (Fdetect_coding_string): Fix docstring.
+
+2003-03-13 Andreas Schwab <[email protected]>
+
+ * gtkutil.c: Add prototype for create_menus.
+
+ * data.c (long_to_cons): Fix type of top.
+
+ * xselect.c (selection_data_to_lisp_data): Use int instead of
+ long for an integer of size 4.
+
+ * gtkutil.c (xg_update_frame_menubar): Add missing return value.
+ (xg_tool_bar_help_callback): Likewise.
+
+2003-03-12 Andreas Schwab <[email protected]>
+
+ * xterm.c (x_term_init) [USE_GTK]: Fix typo.
+
+2003-03-12 Kim F. Storm <[email protected]>
+
+ The following changes consolidate the fringe handling from
+ xterm.c, w32term.c, and macterm.c into xdisp.c.
+
+ * xdisp.c: Consolidate fringe handling code here.
+ (left_bits, right_bits, continued_bits, continuation_bits)
+ (ov_bits, zv_bits): Define fringe bitmaps.
+ (fringe_bitmaps): New array holding fringe bitmaps.
+ (draw_fringe_bitmap): Draw a specific bitmap; call display
+ specific drawing routine via rif->draw_fringe_bitmap.
+ (draw_row_fringe_bitmaps): Generic replacement for
+ x_draw_row_fringe_bitmaps; all callers changed.
+ (compute_fringe_widths): Generic replacement for
+ x_compute_fringe_widths; all callers changed.
+
+ * dispextern.h (enum fringe_bitmap_type): Define here.
+ (struct fringe_bitmap, struct draw_fringe_bitmap_params): New.
+ (fringe_bitmaps): Declare extern.
+ (struct redisplay_interface): New member draw_fringe_bitmap.
+ (draw_row_fringe_bitmaps, compute_fringe_widths): Declare extern.
+
+ * xterm.c: Remove generic fringe code.
+ (x_draw_fringe_bitmap): Only perform actual fringe drawing.
+ (x_redisplay_interface): Add x_draw_fringe_bitmap member.
+
+ * w32term.c: Remove generic fringe code.
+ (w32_draw_fringe_bitmap): Only perform actual fringe drawing.
+ (w32_redisplay_interface): Add w32_draw_fringe_bitmap member.
+
+ * macterm.c: Remove generic fringe code.
+ (x_draw_fringe_bitmap): Only perform actual fringe drawing.
+ (x_redisplay_interface): Add x_draw_fringe_bitmap member.
+
+2003-03-11 Stefan Monnier <[email protected]>
+
+ * print.c (Fprin1_to_string): Return unibyte string if possible.
+
+2003-03-09 David Kastrup <[email protected]>
+
+ * process.c (read_process_output): We have allocated enough space
+ for readmax and carryover, so actually use the alloted space.
+
+2003-03-09 Jan Dj,Ad(Brv <[email protected]>
+
+ * keyboard.c (make_lispy_event): Extend mouse_syms if needed for
+ toolkit scrollbar click.
+
+ * xterm.c (x_window_to_scroll_bar): Call xg_get_scroll_id_for_window
+ for USE_GTK.
+ (x_scroll_bar_handle_click): Use this function for toolkit scrollbars
+ also.
+ (handle_one_xevent): ButtonPress/Release: If event is for a toolkit
+ scrollbar and control is pressed, call x_scroll_bar_handle_click.
+
+ * gtkutil.h (xg_get_scroll_id_for_window): Declare.
+
+ * gtkutil.c (xg_get_scroll_id_for_window): New function.
+ (xg_tool_bar_item_expose_callback): New function.
+ (xg_tool_bar_expose_callback): Call update_frame_tool_bar.
+ (xg_create_tool_bar): Connect xg_tool_bar_expose_callback to expose
+ on the tool bar widget.
+ (update_frame_tool_bar): Connect xg_tool_bar_item_expose_callback
+ to expose on the tool bar item widgets.
+
+2003-03-08 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c (update_frame_tool_bar): Compare pixmap ID instead of
+ struct image* when deciding to update (struct image* may have been
+ deleted from the image cache).
+
+ * xterm.c (handle_one_xevent): Pass ReparentNotify to Xt even if
+ the event isn't for a frame (i.e. for dialogs).
+
+2003-03-07 Kenichi Handa <[email protected]>
+
+ * coding.c (CODING_ADD_COMPOSITION_COMPONENT): If the number of
+ composition components reaches the limit, terminate composing.
+ (COMPOSITION_OK): New macro.
+ (detect_coding_iso2022): Use it if an escape sequence for
+ composition is found.
+ (coding_restore_composition): Adjust the number of composition
+ components if it is not sane.
+
+2003-03-06 Juanma Barranquero <[email protected]>
+
+ * w32term.h (struct w32_display_info): Add xrdb member to support
+ passing resources via -xrm on Windows.
+
+ * w32term.c (w32_make_rdb): New function.
+ (w32_term_init): Use it to initialize xrdb member of w32_display_info
+ struct. Delete leftover code.
+
+ * w32fns.c (Fx_get_resource, x_get_resource_string): Pass xrdb to check
+ for resources passed on the command line.
+
+ * w32reg.c (w32_get_rdb_resource): New function.
+ (x_get_string_resource): Use it, so resources passed with -xrm
+ supercede the ones in the registry.
+
+2003-03-04 Jan Dj,Ad(Brv <[email protected]>
+
+ * xterm.c (x_detect_focus_change): Call x_any_window_to_frame
+ instead of x_top_window_to_frame.
+
+2003-03-03 Jan Dj,Ad(Brv <[email protected]>
+
+ * xsmfns.c (smc_save_yourself_CB): Add --no-splash to options
+ when restarting Emacs.
+
+2003-03-03 Richard M. Stallman <[email protected]>
+
+ * buffer.c (Fkill_buffer): Use Frun_hook_with_args_until_failure
+ to run kill-buffer-query-functions.
+ (Qkill_buffer_query_functions): New var.
+ (syms_of_buffer): Init and staticpro it.
+
+2003-03-02 Jan Dj,Ad(Brv <[email protected]>
+
+ * xterm.h (XSync): Define as gdk_window_process_all_updates for GTK.
+
+2003-02-25 Kim F. Storm <[email protected]>
+
+ * xdisp.c (redisplay_window): Fix infinite loop in redisplay.
+ If centering point failed to make whole line visible and vscroll
+ is non-zero, disable vscroll and try centering point again.
+
+ * lread.c (read1): Accept `single space' syntax like (? x).
+
+2003-02-25 Jan Dj,Ad(Brv <[email protected]>
+
+ * keyboard.c (cancel_hourglass_unwind): Surround with
+ #ifdef HAVE_X_WINDOWS.
+
+2003-02-25 Kenichi Handa <[email protected]>
+
+ * buffer.c (Fset_buffer_multibyte): Pay attention to the buffer
+ process only when "subprocesses" is defined.
+
+2003-02-24 Stefan Monnier <[email protected]>
+
+ * syntax.c (back_comment): Only check nestedness of 2nd char if needed.
+
+2003-02-24 Juanma Barranquero <[email protected]>
+
+ * callint.c (fix_command): Declare as static void and move before
+ Fcall_interactively.
+
+ * xdisp.c (Qwhen): Declare external; it's now defined in callint.c.
+ (syms_of_xdisp): Don't initialize Qwhen.
+
+2003-02-23 Jan Dj,Ad(Brv <[email protected]>
+
+ * keyboard.c (cancel_hourglass_unwind): New function.
+ (command_loop_1): Cancel hourglass with unwind-protect.
+
+2003-02-23 Richard M. Stallman <[email protected]>
+
+ * callint.c (fix_command): New subroutine, from Fcall_interactively.
+ Detect (when ... (region-beginning)) etc.
+ (Fcall_interactively): Call fix_command.
+ (Qif, Qwhen): New variables.
+ (syms_of_callint): Init and staticpro them.
+
+ * regex.c (print_partial_compiled_pattern): Output to stderr.
+
+2003-02-23 Kai Gro,A_(Bjohann <[email protected]>
+
+ * dired.c (directory_files_internal): Don't expand directory.
+ (Fdirectory_files, Fdirectory_files_and_attributes): Do it here
+ instead. From Lars Hansen <[email protected]>.
+
+2003-02-22 Stefan Monnier <[email protected]>
+
+ * fns.c (string_to_multibyte): Remove unused var i.
+ (Flanginfo): Fix int/Lisp_Object mixup.
+ (void_call2): New fun.
+ (Fmap_char_table): Use it in place of call2.
+
+ * xfaces.c (x_face_list_fonts): Fix int/Lisp_Object mixup.
+
+ * macros.c (Fstart_kbd_macro): Remove redundant assignment.
+
+ * keymap.c (copy_keymap_1): Make it static.
+
+ * alloc.c (Fgarbage_collect): Don't use XSETFLOAT.
+
+2003-02-22 David Ponce <[email protected]>
+
+ * lread.c (Fload): Don't check STRING_MULTIBYTE.
+
+2003-02-21 Jan Dj,Ad(Brv <[email protected]>
+
+ * process.h: Removed subtty field from struct Lisp_Process.
+
+ * process.c (create_process): Remove setting of subtty.
+ (emacs_get_tty_pgrp): New function.
+ (Fprocess_running_child_p, process_send_signal):
+ Call emacs_get_tty_pgrp instead of ioctl.
+ (process_send_signal): Call EMACS_KILLPG if ioctl TIOCSIGSEND fails.
+
+2003-02-21 Kai Gro,A_(Bjohann <[email protected]>
+
+ * keymap.c (Fdefine_key): Doc fix.
+
+2003-02-21 Juanma Barranquero <[email protected]>
+
+ Port of patch for RC by Klaus Zeitler <[email protected]>.
+
+ * s/hpux10.h: Define POLL_INTERRUPTED_SYS_CALL, not
+ POLLING_PROBLEM_IN_SELECT.
+
+ * s/hpux11.h: Include hpux10-20.h instead of hpux10.h.
+ Delete #undef of POLLING_PROBLEM_IN_SELECT.
+
+ * s/hpux10-20.h: New file.
+
+ * process.c (wait_reading_process_input):
+ Use POLL_INTERRUPTED_SYS_CALL, not POLLING_PROBLEM_IN_SELECT.
+
+2003-02-20 Kenichi Handa <[email protected]>
+
+ * fontset.c (check_fontset_name): If NAME is nil, return the
+ default fontset.
+ (override_font_info): New function.
+ (Fset_fontset_font): Document that NAME nil means the default fontset.
+ (Ffontset_info): If FONTSET is not the default fontset, merge
+ FONTSET onto the copy of the default fontset, and work on that
+ copy. Document that NAME nil means the default fontset.
+ (Ffontset_font): Document that NAME nil means the default fontset.
+
+ * process.c (setup_process_coding_systems): If the process's
+ in/out descriptor is -1, do nothing.
+
+2003-02-19 Andreas Schwab <[email protected]>
+
+ * lisp.h (Fcancel_kbd_macro_events, Fstring_to_multibyte):
+ Add prototypes.
+
+2003-02-19 Kenichi Handa <[email protected]>
+
+ * xfaces.c (try_alternative_families): Try all scalable fonts if
+ Vscalable_fonts_allowed is not Qt.
+
+2003-02-19 Jan Dj,Ad(Brv <[email protected]>
+
+ * xfaces.c (x_face_list_fonts): Set *pfonts to 0 if no fonts found.
+
+2003-02-18 Jan Dj,Ad(Brv <[email protected]>
+
+ * xterm.c (x_list_fonts): If maxnames is less than 0, get all font
+ names.
+
+ * xfaces.c (x_face_list_fonts): Allocate struct font_name here.
+ (sorted_font_list): Move allocation of struct font_name to
+ x_face_list_fonts.
+ (Fx_font_family_list): Set font-list-limit to -1 to get all font names.
+ (Fx_list_fonts): Set maxnames to -1 to get all font names.
+
+2003-02-18 Kim F. Storm <[email protected]>
+
+ * lread.c (read1): Fix last change.
+ "`" is not always special. Allow "?" after a character constant.
+
+2003-02-18 Andrew Choi <[email protected]>
+
+ * unexmacosx.c (copy_data_segment): Also copy __cfstring section.
+
+2003-02-18 Andreas Schwab <[email protected]>
+
+ * window.c (window_scroll_pixel_based): Move outside a
+ multi-glyph character before setting new window start.
+
+ * xdisp.c (in_display_vector_p): New function.
+ * dispextern.h (in_display_vector_p): Declare.
+
+2003-02-18 Kim F. Storm <[email protected]>
+
+ * lread.c (read1): Fix and relax read syntax.
+ Recognize "[", ";", "#", and "?" after a dotted-pair dot.
+ Only recognize "," after dotted-pair dot if inside backquote.
+ Never include "`" or "," (inside backquote) in a symbol.
+ Allow dotted-pair dot after a character constant.
+ Allow "`" and "," (inside backquote) after a character constant.
+
+2003-02-17 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c (xg_tool_bar_expose_callback): New function.
+ (xg_create_tool_bar): Force style of tool bar to be horizontal with
+ icons. Set name of tool bar to emacs-toolbar.
+ (update_frame_tool_bar): Connect expose event to
+ xg_tool_bar_expose_callback.
+
+2003-02-17 Richard M. Stallman <[email protected]>
+
+ * keyboard.c (this_command_key_count_reset): New variable.
+ Initiatize to 0 where this_command_key_count is set.
+ (read_char): Save and restore this_command_key_count_reset
+ around input method code.
+ (read_char): If this_command_key_count_reset, echo reread commands.
+ (Freset_this_command_lengths): Set this_command_key_count_reset to 1.
+
+2003-02-17 Kenichi Handa <[email protected]>
+
+ * fns.c (string_to_multibyte): Always return a multibyte string.
+
+2003-02-16 Jason Rumney <[email protected]>
+
+ * w32fns.c (w32_list_bdf_fonts, w32_list_fonts):
+ Negative max_fonts parameter means list all.
+
+2003-02-14 Dave Love <[email protected]>
+
+ * fns.c (Flanginfo): Doc fix.
+
+2003-02-13 Kim F. Storm <[email protected]>
+
+ * lread.c (read_escape): Interpret \s as a SPACE character, except
+ for \s-X in a character constant which still is the super modifier.
+ (read1): Signal an `invalid read syntax' error if a character
+ constant is immediately followed by a digit or symbol character.
+
+ * search.c (Fmatch_data): Doc fix. Explicitly state that
+ match-data is undefined if last search failed.
+
+ * keymap.c (Fcommand_remapping): Rename from Fremap_command.
+ All uses changed.
+
+2003-02-12 Juanma Barranquero <[email protected]>
+
+ * eval.c (Fdefmacro): Fix typo.
+
+2003-02-12 Kim F. Storm <[email protected]>
+
+ * macros.c (Fstart_kbd_macro): If appending, and last keyboard
+ macro is a string, convert meta modifiers in string when copying
+ the string into a vector.
+
+2003-02-11 Kim F. Storm <[email protected]>
+
+ * keymap.c (Fremap_command): Return nil if arg is not a symbol.
+
+2003-02-11 Kenichi Handa <[email protected]>
+
+ * Makefile.in (lisp, shortlisp): Add malayalam.el and tamil.el.
+
+2003-02-10 Kim F. Storm <[email protected]>
+
+ * process.c: Doc fixes.
+ (syms_of_process): Add `:' prefix to QCfilter_multibyte.
+
+2003-02-10 Kenichi Handa <[email protected]>
+
+ * fns.c (Fstring_to_multibyte): Fix typo in the docstring.
+
+ * process.c (QCfilter_multibyte): New variable.
+ (setup_process_coding_systems): New function.
+ (Fset_process_buffer, Fset_process_filter):
+ Call setup_process_coding_systems.
+ (Fstart_process): Initialize the member `filter_multibyte' of
+ struct Lisp_Process.
+ (create_process): Call setup_process_coding_systems.
+ (Fmake_network_process): New keyward `:filter-multibyte'.
+ Initialize the member `filter_multibyte' of struct Lisp_Process.
+ Call setup_process_coding_systems.
+ (server_accept_connection): Call setup_process_coding_systems.
+ (read_process_output): If the process has a filter, decide the
+ multibyteness of a string to given to the filter by
+ `filter_multibyte' member of the process. If the process doesn't
+ have a filter and the result of conversion is unibyte, use
+ Fstring_to_multibyte (not Fstring_make_multibyte) to get the
+ multibyte form.
+ (Fset_process_coding_system): Call setup_process_coding_systems.
+ (Fset_process_filter_multibyte): New function.
+ (Fprocess_filter_multibyte_p): New function.
+ (syms_of_process): Intern and staticpro QCfilter_multibyte.
+ Defsubr Sset_process_filter_multibyte and
+ Sprocess_filter_multibyte_p.
+
+ * process.h (struct Lisp_Process): New member filter_multibyte.
+
+ * lisp.h (setup_process_coding_systems): Add prototype.
+
+ * buffer.c (Fset_buffer_multibyte): If the current buffer has a
+ process, update coding systems for the process.
+
+2003-02-09 Kenichi Handa <[email protected]>
+
+ * fns.c (string_to_multibyte): New function.
+ (Fstring_to_multibyte): New function.
+ (syms_of_fns): Defsubr it.
+
+2003-02-08 Andreas Schwab <[email protected]>
+
+ * Makefile.in (EXEEXT): Define to @EXEEXT@ and use this variable
+ instead of the substitution.
+
+2003-02-08 Jan Dj,Ad(Brv <[email protected]>
+
+ * xterm.c (x_make_frame_visible): Call gtk_window_deiconify.
+
+ * xmenu.c (menu_position_func): Adjust menu popup position so that
+ the menu is fully visible.
+
+2003-02-07 Jan Dj,Ad(Brv <[email protected]>
+
+ * xterm.c (x_text_icon, x_raise_frame, x_lower_frame)
+ (x_make_frame_invisible, x_wm_set_icon_position):
+ Use FRAME_OUTER_WINDOW instead of ifdef X_TOOLKIT/else/endif.
+
+ * xfns.c (x_set_name, x_set_title): Ditto.
+
+2003-02-04 Richard M. Stallman <[email protected]>
+
+ * keyboard.c (echo_now): Update before_command_echo_length.
+ (Freset_this_command_lengths): Reset this_command_key_count etc.
+ immediately rather than arranging to do it later.
+ (before_command_key_count_1, before_command_echo_length_1)
+ (before_command_restore_flag): Vars deleted.
+ (add_command_key): Don't handle before_command_restore_flag.
+ (read_char, record_menu_key): Don't update before_command_key_count or
+ before_command_echo_length.
+ (read_char): Don't handle before_command_restore_flag.
+
+ * keyboard.c (command_loop_1): Don't call adjust_point_for_property
+ in direct-output clauses if it wouldn't be called in the ordinary case.
+
+2003-02-04 Kim F. Storm <[email protected]>
+
+ * keyboard.c (syms_of_keyboard) <this-original-command>: Doc fix.
+
+2003-02-02 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c (remove_from_container): Copying list is not needed.
+ (xg_update_menubar, xg_update_menu_item, xg_update_submenu)
+ (xg_modify_menubar_widgets, update_frame_tool_bar): Call g_list_free
+ on list returned from gtk_container_get_children to avoid memory leak.
+
+2003-02-01 Jason Rumney <[email protected]>
+
+ * w32fns.c (w32_create_pixmap_from_bitmap_data): Use alloca for
+ local malloc.
+ [HAVE_XPM]: Avoid clashes with XColor, XImage and Pixel
+ definitions in xpm.h.
+ (init_xpm_functions): New function.
+ (xpm_load): Sync with xfns.c. Adapt for Windows version of libXpm.
+ (init_external_image_libraries): Try to load libXpm.dll.
+
+ * fileio.c (Fcopy_file) [WINDOWSNT]: Reverse logic for setting
+ timestamp.
+
+2003-01-31 Dave Love <[email protected]>
+
+ * syntax.c (Fskip_chars_forward)
+ (open-paren-in-column-0-is-defun-start): Doc fix.
+
+2003-01-31 Joe Buehler <[email protected]>
+
+ * fileio.c: Support // at start of name for Cygwin (just added proper
+ preprocessor tests).
+
+ * keyboard.c: Port to Cygwin (just added proper preprocessor tests).
+
+ * Makefile.in: Use @EXEEXT@ for Cygwin.
+
+ * mem-limits.h: Added ifdef to define BSD4_2 for Cygwin.
+
+ * s/cygwin.h: Added for Cygwin port.
+
+2003-01-31 Juanma Barranquero <[email protected]>
+
+ * w32fns.c (DrawText): Kludge to avoid a redefinition on Windows
+ when including gif_lib.h.
+ (init_gif_functions, init_tiff_functions): New functions.
+ (gif_load, tiff_load): Sync with xfns.c version. Adjust colors for
+ Windows. Disable color table lookups. Call library functions
+ through pointers determined at runtime.
+ (init_external_image_libraries): Try to load libungif.dll and
+ libtiff.dll.
+
+2003-01-31 Kenichi Handa <[email protected]>
+
+ * xdisp.c (SKIP_GLYPHS): New macro.
+ (set_cursor_from_row): Skip all glyphs that comes from overlay string.
+
+2003-01-30 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c (free_frame_tool_bar): Remove debug printf.
+
+2003-01-30 Dave Love <[email protected]>
+
+ * alloc.c (Vgc_elapsed, gcs_done): New variables.
+ (Fgarbage_collect): Use them.
+ (init_alloc, syms_of_alloc): Set them up.
+
+2003-01-30 Juanma Barranquero <[email protected]>
+
+ * w32fns.c (init_external_image_libraries): Add missing operator.
+
+2003-01-29 Jason Rumney <[email protected]>
+
+ * w32fns.c (init_external_image_libraries): Allow jpeg-62.dll as
+ an alternative name for jpeg.dll.
+
+2003-01-29 Kenichi Handa <[email protected]>
+
+ * xdisp.c (set_cursor_from_row): Pay attention to string display
+ properties.
+
+2003-01-28 Benjamin Riefenstahl <[email protected]>
+
+ * macterm.c (keycode_to_xkeysym_table): Add <tab>, <backspace>,
+ <escape>.
+ (keycode_to_xkeysym_table): Reformat and add more comments.
+ (XTread_socket): Drop special case for backspace.
+
+2003-01-28 Andrew Choi <[email protected]>
+
+ * macfns.c (x_to_mac_color): Correct the order for parsing the RGB
+ values in old-style RGB specs.
+
+2003-01-27 Juanma Barranquero <[email protected]>
+
+ * w32fns.c (init_external_image_libraries): Try alternate names for the
+ jpeg dll.
+
+2003-01-27 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c (create_dialog, xg_separator_p)
+ (xg_item_label_same_p, xg_update_menu_item): Check for NULL string
+ before calling strcmp or strlen.
+
+2003-01-26 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c (update_frame_tool_bar): Call prepare_image_for_display
+ and handle image load failure.
+
+2003-01-26 Jason Rumney <[email protected]>
+
+ * w32fns.c (init_jpeg_functions, jpeg_resync_to_restart_wrapper):
+ New functions.
+ (jpeg_load): Sync with xfns.c version. Adjust colors for Windows.
+ Disable color table lookups. Call jpeg library functions
+ through pointers determined at runtime.
+ (init_external_image_libraries): Try to load jpeg.dll.
+
+2003-01-25 Richard M. Stallman <[email protected]>
+
+ * lisp.h: Declare format2 instead of format1.
+
+ * fileio.c (barf_or_query_if_file_exists):
+ Call format2 instead of format1.
+
+ * editfns.c (format2): New function, replaces format1
+ but takes exactly two Lisp Objects as format args.
+
+ * buffer.c (Fkill_buffer): Call format2 instead of format1.
+
+2003-01-25 Jan Dj,Ad(Brv <[email protected]>
+
+ * xterm.h: Change to return value of x_dispatch_event to int.
+
+ * xterm.c (x_filter_event): New function.
+ (event_handler_gdk, XTread_socket): Call x_filter_event.
+ (x_dispatch_event): Change to return value of finish.
+ (event_handler_gdk): Use return value from x_dispatch_event.
+
+ * xfns.c (x_window): Call create_frame_xic for GTK version to
+ initialize input methods.
+
+ * gtkutil.h: Add (void) prototypes.
+
+ * gtkutil.c (create_menus): Remove code that puts the help menu to
+ the right.
+
+2003-01-25 Jason Rumney <[email protected]>
+
+ * w32fns.c (XPutPixel): Handle monochrome images; used for masks.
+ [HAVE_PNG]: Sync with xfns.c version.
+ (png_load): Adjust colors for Windows. Use Windows
+ bitmaps. Disable color table lookups.
+ (DEF_IMGLIB_FN, LOAD_IMGLIB_FN): New macros.
+ (init_png_functions): New function.
+ (png_read_from_memory, png_load): Call png library functions
+ through pointers determined at runtime.
+ (QCloader, QCbounding_box, QCpt_width, QCpt_height): Declare.
+ (init_external_image_libraries): New function.
+ (init_xfns): Call it.
+
+2003-01-24 Andreas Schwab <[email protected]>
+
+ * minibuf.c (Fminibuffer_message): Verify type of parameter.
+
+2003-01-24 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c (xg_initialize): Initialize id_to_widget here instead
+ of static initializer.
+
+2003-01-24 Dave Love <[email protected]>
+
+ * s/gnu-linux.h (GC_SETJMP_WORKS, GC_MARK_STACK): Define for more
+ architectures.
+
+ * alloc.c (mark_stack) [!GC_LISP_OBJECT_ALIGNMENT && __GNUC__]:
+ Use __alignof__.
+
+2003-01-24 Kenichi Handa <[email protected]>
+
+ * keyboard.c (adjust_point_for_property): New second arg MODIFIED.
+ It it is nonzero, don't pretend that an invisible area doesn't exist.
+ (command_loop_1): Call adjust_point_for_property with proper
+ second arg.
+
+2003-01-22 Jason Rumney <[email protected]>
+
+ Sync changes with xterm.c and xfns.c.
+
+ * w32term.c (x_draw_glyph_string_foreground)
+ (x_draw_composite_glyph_string_foreground): Implement overstriking.
+
+ * w32term.c (x_write_glyphs): Clear phys_cursor_on_p if current
+ phys_cursor's hpos is overwritten. This is still not completely
+ correct, as it doesn't really make sense to use hpos at all to
+ get the cursor glyph (as that is relative to the width of the
+ characters on the line, which may have changed during the update).
+
+ * w32term.c (notice_overwritten_cursor): Handle the special case
+ of the cursor being in the first blank non-text line at the
+ end of a window.
+
+ * w32term.c (x_draw_hollow_cursor, x_draw_bar_cursor)
+ (x_draw_phys_cursor_glyph): Set phys_cursor_width here.
+ Compute from the x position returned by x_draw_glyphs.
+
+ (x_display_and_set_cursor): Don't set phys_cursor_width here,
+ except for NO_CURSOR and system caret, to make phys_cursor_width
+ contain what its name suggests.
+ (notice_overwritten_cursor): Consider the cursor image erased if
+ the output area intersects the cursor image in y-direction.
+
+ * w32term.c (note_mode_line_or_margin_highlight): Rename from
+ note_mode_line_highlight and extend.
+
+ * w32term.c (last_window): New variable.
+ (w32_read_socket) <WM_MOUSEMOVE>: Generate SELECT_WINDOW_EVENTs.
+ (note_mouse_movement): Remove reimplemented code in #if 0.
+
+ * w32fns.c (x_set_cursor_type): Set cursor_type_changed,
+ not update_mode_lines, and always set it to 1.
+
+2003-01-21 Jason Rumney <[email protected]>
+
+ * w32fns.c (IDC_HAND): Define it if system headers don't.
+
+2003-01-21 KOBAYASHI Yasuhiro <[email protected]>
+
+ * w32term.h (struct w32_output): New member hand_cursor.
+ (WM_EMACS_SETCURSOR): New message definition.
+
+ * w32term.c (note_mode_line_highlight): Delete #if 0 to enable
+ function w32_define_cursor.
+ (note_mouse_highlight): Initialize, setup cursor accoding to mouse
+ position, change member name output_data.x to output_data.w32 and
+ add function w32_define_cursor.
+ (show_mouse_face): Delete #if 0 to enable function w32_define_cursor
+ and change member name output_data.x to output_data.w32.
+ (w32_initialize_display_info):
+ Setup dpyinfo->vertical_scroll_bar_cursor.
+
+ * w32fns.c (Vx_hand_shape): New variable.
+ (w32_wnd_proc): Add message entries for WM_SETCURSOR and
+ WM_EMACS_SETCURSOR.
+ (x-create-frame): Setup Cursor types.
+
+2003-01-21 David Ponce <[email protected]>
+
+ * w32term.c (w32_encode_char): For DIM=1 charset, set
+ ccl->reg[2] to -1 before calling ccl_driver.
+ (Sync. with xterm.c x_encode_char change by Kenichi Handa
+ <[email protected]> on 2002-09-30.)
+ (w32_draw_relief_rect): Declare all args.
+ (w32_define_cursor): New.
+
+ * w32fns.c (w32_load_cursor): New function.
+ (w32_init_class): Use it.
+ (x_put_x_image): Declare all args.
+
+2003-01-21 Richard Dawe <[email protected]>
+
+ * Makefile.in (ALL_CFLAGS): Include MYCPPFLAGS, not MYCPPFLAG.
+
+2003-01-21 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c: Must include stdio.h before termhooks.h.
+
+2003-01-21 Dave Love <[email protected]>
+
+ * alloc.c (Fgc_status): Print zombie list.
+ (mark_maybe_object) [GC_MARK_STACK==GC_USE_GCPROS_CHECK_ZOMBIES]:
+ Fix assignment of zombies.
+ (Fgarbage_collect) [GC_MARK_STACK==GC_USE_GCPROS_CHECK_ZOMBIES]:
+ Don't take car of non-cons.
+
+ * s/sol2-5.h (GC_SETJMP_WORKS, GC_MARK_STACK): Define.
+
+ * s/sunos4-0.h (GC_SETJMP_WORKS, GC_MARK_STACK): Define.
+
+2003-01-20 David Ponce <[email protected]>
+
+ * w32menu.c (digest_single_submenu): Declare all args.
+
+ Sync with 2002-12-23 Richard M. Stallman <[email protected]>
+ changes in xmenu.c:
+
+ (parse_single_submenu): Use individual keymap's prompt
+ string as pane name, if there is one.
+ (set_frame_menubar): Save menu_items_n_panes from each call to
+ parse_single_submenu and use it when calling digest_single_submenu.
+
+2003-01-20 Steven Tamm <[email protected]>
+
+ * macterm.c (XTread_socket): Check for valid, visible window
+ before sending a scroll-wheel event.
+
+2003-01-20 Richard M. Stallman <[email protected]>
+
+ * xdisp.c (redisplay_window): If mini window's buffer is not
+ a minibuffer, then redisplay it like other windows.
+
+2003-01-20 Jan Dj,Ad(Brv <[email protected]>
+
+ * gtkutil.c (xg_create_frame_widgets): Check if there is an
+ external tool bar before setting tool bar height.
+
+2003-01-19 Jan Dj,Ad(Brv <[email protected]>
+
+ * xterm.c (handle_one_xevent): Surround popup_activated
+ with #ifdef:s for non-toolkit version.
+
+ * Makefile.in (XOBJ): Add gtkutil.o if USE_GTK.
+ (gtkutil.o): New file.
+ (TOOLKIT_DEFINES): Set to -DUSE_GTK if HAVE_GTK.
+ (LIBW): Set to @GTK_LIBS@ if USE_GTK.
+
+ * gtkutil.c: New file for GTK version.
+
+ * gtkutil.h: New file for GTK version.
+
+ * xterm.h: Add xt_or_gtk_widget.
+ Include gtk files for USE_GTK.
+ (struct x_output): Add toolbar_height.
+ (struct x_output): Add GTK widgets and Gdk size_hints.
+ (GTK_WIDGET_TO_X_WIN, FRAME_GTK_OUTER_WIDGET, FRAME_GTK_WIDGET)
+ (FRAME_OUTER_WINDOW): New macros for USE_GTK.
+ (FRAME_OUTER_TO_INNER_DIFF_Y): Add FRAME_TOOLBAR_HEIGHT to calculation.
+
+ * xterm.c: Include gtkutil.h for USE_GTK.
+ (free_frame_menubar): Declare extern void for USE_GTK.
+ (note_mouse_highlight): Check popup_activated for USE_GTK.
+ (xt_action_hook): Don't compile if USE_GTK.
+ (x_scroll_bar_to_input_event): Use CurrentTime for USE_GTK.
+ (xg_scroll_callback): New function.
+ (x_create_toolkit_scroll_bar): Call xg_create_scroll_bar for USE_GTK.
+ (x_set_toolkit_scroll_bar_thumb): Call xg_set_toolkit_scroll_bar_thumb
+ for USE_GTK.
+ (x_scroll_bar_create): Call xg_update_scrollbar_pos and
+ xg_show_scroll_bar for USE_GTK.
+ (x_scroll_bar_remove): Call xg_remove_scroll_bar for USE_GTK.
+ (XTset_vertical_scroll_bar): Call xg_update_scrollbar_pos for USE_GTK.
+ (event_handler_gdk): New function for USE_GTK.
+ (handle_one_xevent): Call xg_resize_widgets for USE_GTK.
+ (handle_one_xevent): Make sure widget is mapped before
+ calling x_real_positions for USE_GTK.
+ (XTread_socket): Add GTK event loop for USE_GTK.
+ (x_set_window_size): Call xg_frame_set_char_size for USE_GTK.
+ (x_make_frame_visible): Call gtk_widget_show_all for USE_GTK.
+ (x_make_frame_invisible): Call gtk_widget_hide for USE_GTK.
+ (x_iconify_frame): Add code for USE_GTK.
+ (x_free_frame_resources): Call gtk_widget_destroy for USE_GTK.
+ (x_wm_set_size_hint): Only compile if not USE_GTK. GTK version
+ is in gtkutil.c.
+ (x_term_init): Add initialization for GTK.
+ (syms_of_xterm): Set Vx_toolkit_scroll_bars for USE_GTK.
+
+ * xmenu.c: Include gtkutil.h for USE_GTK.
+ (Fx_popup_menu): Use current position if x and y are nil.
+ (single_menu_item, single_menu_item, Fx_popup_dialog):
+ Check for USE_GTK.
+ (popup_widget_loop): New function for USE_GTK.
+ (x_activate_menubar): Add code for USE_GTK.
+ (popup_activate_callback, popup_deactivate_callback)
+ (menu_highlight_callback, menubar_selection_callback):
+ Add USE_GTK versions.
+ (update_frame_menubar): Call xg_update_frame_menubar for USE_GTK.
+ (set_frame_menubar): Call xg_modify_menubar_widgets for USE_GTK.
+ (free_frame_menubar): Only compile if not USE_GTK. GTK version
+ is in gtkutil.c.
+ (popup_selection_callback): New version for USE_GTK.
+ (create_and_show_popup_menu): New fuction, one USE_GTK version and
+ one USE_X_TOOLKIT version.
+ (xmenu_show): Call create_and_show_popup_menu.
+ (dialog_selection_callback): New version for USE_GTK.
+ (create_and_show_dialog): New fuction, one USE_GTK version and
+ one USE_X_TOOLKIT version.
+ (xdialog_show): Call create_and_show_dialog.
+
+ * xfns.c: Include gtkutil for USE_GTK.
+ (x_window_to_frame, x_any_window_to_frame)
+ (x_non_menubar_window_to_frame, x_menubar_window_to_frame)
+ (x_top_window_to_frame): Add code for USE_GTK.
+ (x_set_background_color): Call xg_set_background_color for GTK.
+ (x_set_menu_bar_lines): Check for USE_GTK.
+ (x_set_tool_bar_lines): Call update_frame_tool_bar for USE_GTK.
+ (x_set_name, x_set_title): Call gtk_window_set_title for USE_GTK.
+ (x_window): Call xg_create_frame_widgets for USE_GTK.
+ (Fx_create_frame): Check for USE_GTK.
+ (Fx_file_dialog): New implementation for USE_GTK.
+
+ * xdisp.c: Add check for USE_GTK for extern void set_frame_menubar.
+ (update_menu_bar): Add check for USE_GTK.
+ (update_tool_bar): Add check for USE_GTK and external tool bar.
+ (redisplay_tool_bar): Add check for USE_GTK and external tool bar.
+ (redisplay_internal): Add check for USE_GTK and popup_activated.
+ (redisplay_window): Add check for USE_GTK and FRAME_EXTERNAL_MENU_BAR.
+ (redisplay_window): Add check for USE_GTK and FRAME_EXTERNAL_TOOL_BAR.
+ (display_menu_bar): Add check for USE_GTK.
+
+ * lisp.h (Vx_resource_name): Declare extern.
+
+ * keyboard.c (kbd_buffer_get_event): Check MENU_BAR_ACTIVATE_EVENT
+ for USE_GTK.
+ (make_lispy_event): Check MENU_BAR_EVENT for USE_GTK.
+
+ * frame.h (struct frame): Add external_tool_bar. Check for USE_GTK.
+ (FRAME_EXTERNAL_TOOL_BAR): New macro.
+ (FRAME_EXTERNAL_MENU_BAR): Check for USE_GTK.
+
+ * fileio.c (Fread_file_name): Add check for USE_GTK.
+
+ * dispnew.c (adjust_frame_glyphs_for_window_redisplay):
+ Add check for USE_GTK.
+
+ * config.in: Added HAVE_GTK.
+
+ * alloc.c (Fgarbage_collect): Call xg_mark_data for GTK.
+
+2003-01-18 Stefan Monnier <[email protected]>
+
+ * charset.h (Funibyte_char_to_multibyte): Export.
+
+2003-01-18 Jan Dj,Ad(Brv <[email protected]>
+
+ * xmenu.c (mouse_position_for_popup): New function.
+ (Fx_popup_menu): Call mouse_position_for_popup for X and
+ mouse_position_hook for others.
+
+2003-01-17 Kim F. Storm <[email protected]>
+
+ * editfns.c (Finsert): Mention `string-make-multibyte' and
+ `string-as-multibyte' in doc string.
+
+2003-01-17 Kenichi Handa <[email protected]>
+
+ * fontset.c (syms_of_fontset): Setup Vfont_encoding_alist here.
+
+ * editfns.c (Fformat): Convert an unibyte char argument that is
+ formatted by "%c" to multibyte if the total result must be a
+ multibyte string.
+
+2003-01-16 Kim F. Storm <[email protected]>
+
+ * process.c (set-process-filter): Document unibyte/multibyte-ness
+ of string argument.
+
+2003-01-16 Kenichi Handa <[email protected]>
+
+ * charset.h (NEXT_CHAR_BOUNDARY, PREV_CHAR_BOUNDARY): New macros.
+
+ * regex.c (GET_CHAR_BEFORE_2): Use PREV_CHAR_BOUNDARY.
+ (re_search_2): Likewise.
+
+2003-01-15 Kenichi Handa <[email protected]>
+
+ * xdisp.c (message_dolog): Fix bug of the case that *Message*
+ buffer is unibyte.
+
+2003-01-15 Francesco Potort,Al(B <[email protected]>
+
+ * fns.c (Fsubstring): Clarify doc string.
+
+ * textprop.c (Ftext_properties_at, Fnext_char_property_change)
+ (Fprevious_char_property_change)
+ (Fnext_single_char_property_change)
+ (Fprevious_single_char_property_change, Fnext_property_change)
+ (Fnext_single_property_change, Fprevious_property_change)
+ (Fprevious_single_property_change, Fadd_text_properties)
+ (Fput_text_property, Fset_text_properties)
+ (Fremove_text_properties, Fremove_list_of_text_properties)
+ (Ftext_property_any, Ftext_property_not_all): Clarify doc strings.
+
+2003-01-14 Kim F. Storm <[email protected]>
+
+ * process.h (struct Lisp_Process): New member plist replaces old
+ member private_vars. All uses changed.
+
+ * process.c: Reworked 2003-01-12 change -- call a plist a plist!
+ (QCplist): Rename from QCvars. Change all uses.
+ (Fprocess_plist): Replaces Fprocess_variable. Simplified.
+ (Fset_process_plist): Replaces Fset_process_variable. Simplify.
+ (syms_of_process): Intern, staticpro, defsubr these.
+ (Fmake_network_process): Describe :plist arg. Remove :vars arg.
+
+2003-01-14 Francesco Potort,Al(B <[email protected]>
+
+ * m/delta.h: Remove (obsolete).
+
+2003-01-13 Francesco Potort,Al(B <[email protected]>
+
+ * fileio.c (Fdelete_directory, Fdelete_file): Document the
+ behaviour in front of symlinks.
+ (Fdelete_file): Raise an error on directories.
+
+2003-01-13 Dave Love <[email protected]>
+
+ * fns.c (Freverse): Use QUIT.
+
+2003-01-13 Richard M. Stallman <[email protected]>
+
+ * minibuf.c (minibuffer_completion_contents):
+ Error if point is inside prompt.
+
+ * keyboard.c (command_loop_1): Don't redisplay directly
+ if there's a post-command-hook.
+
+ * fileio.c (syms_of_fileio) <directory-sep-char>: Doc fix.
+ (Fdo_auto_save): Add gcpros around Ffile_name_directory.
+
+2003-01-12 Kim F. Storm <[email protected]>
+
+ * process.h (struct Lisp_Process): New member private_vars.
+
+ * process.c (QCvars): New variable.
+ (syms_of_process): Intern and staticpro it.
+ (Fset_process_contact): Removed function.
+ (Fprocess_variable, Fset_process_variable): New functions.
+ (syms_of_process): Defsubr them.
+ (Fstart_process): Initialize private_vars plist to nil.
+ (Fmake_network_process): New arg :vars to setup the private
+ variables for new network process.
+ (server_accept_connection): Copy server's private variables to
+ client process.
+
+ * alloc.c (pure_alloc): Fixed 2003-01-10 changed (caused spurious
+ crashes). Code rewritten and simplified. Now directly aligns the
+ pointer and recalculates pure_bytes_used, rather than aligning the
+ size and adjusting the pointer.
+
+2003-01-11 Kim F. Storm <[email protected]>
+
+ * process.c (Fset_process_contact): New function.
+ (syms_of_process): defsubr it.
+ (make-network-process): Update doc.
+
+2003-01-10 Andreas Schwab <[email protected]>
+
+ * alloc.c (pure_alloc): Correct alignment for Lisp_Floats.
+ Reported by Berthold Gunreben <[email protected]>.
+
+2003-01-10 Dave Love <[email protected]>
+
+ * composite.c (syms_of_composite): Make composition_hash_table weak.
+
+2003-01-09 Kim F. Storm <[email protected]>
+
+ * process.c (Fmake_network_process): Convert new port number
+ to host byte order for `:service t' case. From Mario Lang.
+
+2003-01-08 Jan Dj,Ad(Brv <[email protected]>
+
+ * xfns.c (Fx_file_dialog): Call XtAppNextEvent and x_dispatch_event
+ instead of XtAppProcessEvent.
+
+ * xterm.c (handle_one_xevent): New function.
+ (x_dispatch_event): New function.
+ (XTread_socket): Call handle_one_xevent.
+
+ * xterm.h (FRAME_OUTER_TO_INNER_DIFF_X/Y): New.
+
+ * xmenu.c (Fx_popup_menu): If popping up at mouse position,
+ call XQueryPointer to get coordinates.
+ (popup_get_selection): Do not set popup_activated_flag to zero,
+ let popup_deactivate_callback do that. Needed for Motif.
+ Call x_dispatch_event instead of XtDispatchEvent.
+ (xmenu_show): Calculate root coordinate from frame top/left position.
+
+2003-01-08 Kim F. Storm <[email protected]>
+
+ * process.c (server_accept_connection): Fix recording of new
+ connection's local address in :local property of contact info.
+ (Fmake_network_process): Record local network address for new
+ client processes in :local property of contact info.
+ (format-network-address): Add arg OMIT-PORT. Change callers.
+
+2003-01-07 Dave Love <[email protected]>
+
+ * Makefile.in (fns.o): Depend on coding.h.
+
+2003-01-06 Dave Love <[email protected]>
+
+ * fns.c: Include coding.h. Use POINTER_TYPE*, not void*.
+ (Vlocale_coding_system): Declare.
+ (Qcodeset, Qdays, Qmonths, Qpaper): New.
+ (Flanginfo): New.
+ (syms_of_fns): Initialize new stuff.
+
+2003-01-07 Markus Rost <[email protected]>
+
+ * minibuf.c (Fread_variable): Doc fix.
+
+ * eval.c (Fuser_variable_p): Doc change. For custom variables,
+ use the same test as for custom-variable-p.
+
+2003-01-05 Richard M. Stallman <[email protected]>
+
+ * xdisp.c (try_scrolling): New arg LAST_LINE_MISFIT.
+ Count LAST_LINE_MISFIT in scroll margin for end of window.
+ Move label too_near_end before setting SCROLL_MARGIN_POS.
+ Set LAST_LINE_MISFIT before jumping there.
+
+ * xdisp.c (try_scrolling): Calculate amount_to_scroll better in
+ scroll_conservatively case. If scrolling that much doesn't change
+ STARTP, move it down one line.
+
+ * xdisp.c (redisplay_window): Pass last_line_misfit arg to
+ try_scrolling. Make it 1 after make_cursor_line_fully_visible fails.
+
+ * xdisp.c (setup_echo_area_for_printing): Kill Emacs if no
+ selected frame.
+
+ * keymap.c (apropos_predicate, apropos_accumulate): Make them static.
+ (syms_of_keymap): Staticpro them.
+ (Fapropos_internal): Initialize them and clear them out.
+ Don't GCPRO them.
+
+ * buffer.c (syms_of_buffer) <scroll-up|down-aggressively>: Doc fixes.
+
+ * lisp.h: New misc type Lisp_Save_Value.
+ (enum Lisp_Misc_Type): Add Lisp_Misc_Save_Value.
+ (XSAVE_VALUE): New macro.
+ (struct Lisp_Save_Value): New data type.
+ (union Lisp_Misc): Add u_save_value alternative.
+ (make_save_value): Declare.
+
+ * alloc.c (make_save_value): New function.
+
+ * xterm.c (x_catch_errors): Save dpy using make_save_value.
+ (x_catch_errors_unwind): Call XSync.
+
+2003-01-01 Richard M. Stallman <[email protected]>
+
+ * window.c (window_scroll_pixel_based): Partially undo last change.
+
+ * keyboard.c (command_loop_1): Call adjust_point_for_property
+ in direct action cases for Qforward_char and Qbackward_char.
+ Set already_adjusted so it won't be done twice.
+
+2002-12-30 Richard Dawe <[email protected]>
+
+ * src/config.in (!HAVE_SIZE_T): Fix order of arguments in
+ type definition of size_t.
+
+2003-01-02 Steven Tamm <[email protected]>
+
+ * macterm.c (syms_of_macterm): Provide the feature "mac-carbon" to
+ distinguish Carbon GUI builds from X11 builds on darwin.
+
+2002-12-30 Steven Tamm <[email protected]>
+
+ * macterm.c (syms_of_macterm): Set mac-wheel-button-is-mouse-2
+ to default to t.
+
+2002-12-29 Francesco Potort,Al(B <[email protected]>
+
+ * data.c (Fstring_to_number, Fminus): Better English in doc strings.
+
+2002-12-28 Steven Tamm <[email protected]>
+
+ * Makefile.in (macosx-bundle): Fix Mac OS X/Carbon port to
+ allow building in a different directory than source. Uses some
+ GNU Make extensions, but there is no other make on Mac OS X.
+
+2002-12-26 Francesco Potort,Al(B <[email protected]>
+
+ * data.c (Fmakunbound, Ffmakunbound, Fmake_variable_buffer_local)
+ (Fsetq_default, Fmake_local_variable, Fkill_local_variable)
+ (Fmake_variable_frame_local, Faset, Fnumber_to_string, Fminus)
+ (Fstring_to_number): Mention the returned value in the doc strings.
+
+2002-12-23 Richard M. Stallman <[email protected]>
+
+ * buffer.c (syms_of_buffer) <scroll-up-aggressively>
+ <scroll-down-aggressively>: Doc fix.
+
+ * xmenu.c (parse_single_submenu): Use individual keymap's prompt
+ string as pane name, if there is one.
+ (set_frame_menubar): Save menu_items_n_panes from each call to
+ parse_single_submenu and use it when calling digest_single_submenu.
+
+ * window.c (window_scroll_pixel_based): Fix check for reaching BEGV.
+ Don't try to make last line fully visible if it is past end of window.
+
+2002-12-22 Steven Tamm <[email protected]>
+
+ * macmenu.c (MIN_POPUP_SUBMENU_ID): Add.
+ (mac_menu_show): Add support for hierarchical popup menus.
+ (add_menu_item): Remove indentation support.
+ (fill_submenu, fill_menu): Create hierarchical menus
+ instead of using indentation.
+
+2002-12-22 Richard M. Stallman <[email protected]>
+
+ * xdisp.c (try_cursor_movement): Don't call try_window here.
+ (redisplay_window): Never redisplay minibuffer when inactive.
+
+ * window.c (select_window_1): Undo 9/21 change.
+
+2002-12-22 Steven Tamm <[email protected]>
+
+ * macterm.c (XTread_socket): Call KeyTranslate for control and
+ meta to deal correctly shifted non-alpha characters, like C-S-5
+ being treated like C-%. Do not look for shift key to deal
+ with masking off control-key with mac-reverse-ctrl-meta.
+
+2002-12-21 Richard M. Stallman <[email protected]>
+
+ * xmenu.c (popup_get_selection): Now static. New arg DO_TIMERS.
+ If it is non-nil, run timers. Use an unwind-protect to requeue
+ the events that were read ahead.
+ (popup_get_selection_unwind): New subroutine.
+ (popup_get_selection_queue): File-scope variable now holds that queue.
+ (xmenu_show): Pass 0 for DO_TIMERS to popup_get_selection.
+ (xdialog_show): Pass 1 for DO_TIMERS to popup_get_selection.
+ Use an unwind-protect to pop down the dialog box.
+ (xdialog_show_unwind): New subroutine implements that.
+
+ * xdisp.c (row_containing_pos): Change exit test using last_y.
+ (try_window_id): Abort if row_containing_pos returns null.
+
+ * lread.c (load_error_handler): New function.
+ (Fload): Handle errors in Fsubstitute_in_file_name.
+ Don't expect Fsignal to return.
+
+ * eval.c: Errors and throws work right with interrupt blocking.
+ (struct catchtag): New elt interrupt_input_blocked.
+ (unwind_to_catch): Restore interrupt_input_blocked from saved value.
+ (internal_catch, Fcondition_case, internal_condition_case)
+ (internal_condition_case_1, internal_condition_case_2): Save it.
+ (Fsignal): Don't do TOTALLY_UNBLOCK_INPUT.
+
+ * editfns.c (Fformat): Add parens.
+
+ * dired.c (file_name_completion): Fix that change.
+ Delete special quit-handling code; just use QUIT.
+
+2002-12-21 Tak Ota <[email protected]>
+
+ * dired.c (file_name_completion): Close directory on error
+ just as in directory_files_internal.
+
+2002-12-19 David Kastrup <[email protected]>
+
+ * window.c (Fset_window_configuration): Set old_point to correct
+ value when new_current_buffer == current_buffer.
+
+2002-12-17 Ben Key <[email protected]>
+
+ Revisited my earlier fix for the following entry in etc/PROBLEMS:
+ "Emacs built on Windows 9x/ME crashes at startup on Windows XP,
+ or Emacs builtpart of on XP crashes at startup on Windows 9x/ME."
+
+ These changes were in part based upon suggestions made by Peter
+ 'Luna' Runestig [[email protected]].
+
+ * w32.c (g_b_init_is_windows_9x, g_b_init_open_process_token)
+ (g_b_init_get_token_information, g_b_init_lookup_account_sid)
+ (g_b_init_get_sid_identifier_authority ): Add several static
+ global variables.
+
+ * w32.c (globals_of_w32): New function. Used to initialize those
+ global variables that must always be initialized on startup even
+ when the global variable initialized is non zero. Its primary
+ purpose at this time is to set the global variables
+ g_b_init_is_windows_9x, g_b_init_open_process_token,
+ g_b_init_get_token_information, g_b_init_lookup_account_sid, and
+ g_b_init_get_sid_identifier_authority to 0 on startup.
+ Called from main.
+
+ * w32.c (is_windows_9x): Perform initialization only if
+ g_b_init_is_windows_9x is equal to 0. On initialization set
+ g_b_init_is_windows_9x equal to 1.
+
+ * w32.c (open_process_token): Perform initialization only if
+ g_b_init_open_process_token is equal to 0. On initialization set
+ g_b_init_open_process_token equal to 1.
+
+ * w32.c (get_token_information): Perform initialization only if
+ g_b_init_get_token_information is equal to 0. On initialization
+ set g_b_init_get_token_information equal to 1.
+
+ * w32.c (lookup_account_sid): Perform initialization only if
+ g_b_init_lookup_account_sid is equal to 0. On initialization
+ set g_b_init_lookup_account_sid equal to 1.
+
+ * w32.c (get_sid_identifier_authority): Perform initialization
+ only if g_b_init_get_sid_identifier_authority is equal to 0.
+ On initialization set g_b_init_get_sid_identifier_authority equal to 1.
+
+ * w32fns.c (globals_of_w32fns): New function. Used to initialize
+ those global variables that must always be initialized on startup
+ even when the global variable initialized is non zero.
+ Its primary purpose at this time is to initialize the global variable
+ track_mouse_event_fn.
+
+ * w32fns.c (w32_wnd_proc): Remove initialization of
+ track_mouse_event_fn from the handler for the WM_SETFOCUS message.
+
+ * w32fns.c (syms_of_w32fns): Call globals_of_w32fns.
+
+ * w32menu.c (globals_of_w32menu): New function. Used to
+ initialize those global variables that must always be initialized
+ on startup even when the global variable initialized is non zero.
+ Its primary purpose at this time is to initialize the global
+ variables get_menu_item_info and set_menu_item_info.
+
+ * w32menu.c (initialize_frame_menubar): Remove initialization of
+ get_menu_item_info and set_menu_item_info.
+
+ * w32menu.c (syms_of_w32menu): Call globals_of_w32menu.
+
+ * w32.h (globals_of_w32, globals_of_w32fns, globals_of_w32menu):
+ Declare them.
+
+ * emacs.c (main): Call globals_of_w32 prior to calling
+ init_environment if WINDOWSNT is defined. Call globals_of_w32fns
+ and globals_of_w32menu if initialized is non zero and HAVE_NTGUI
+ is defined.
+
+ * w32term.c (x_update_window_begin): Fix Windows API error
+ detected by BoundsChecker. Test to determine if
+ w32_system_caret_hwnd is NULL prior to attempting to use
+ SendMessage to send the WM_EMACS_HIDE_CARET message to it.
+
+ * w32term.c (x_update_window_end): Fix Windows API error
+ detected by BoundsChecker. Test to determine if
+ w32_system_caret_hwnd is NULL prior to attempting to use
+ SendMessage to send the WM_EMACS_SHOW_CARET message to it.
+
+2002-12-17 Kenichi Handa <[email protected]>
+
+ * coding.c (coding_system_require_warning): New variable.
+ (syms_of_coding): DEFVAR it.
+
+ * coding.h (coding_system_require_warning): Extern it.
+
+ * fileio.c (choose_write_coding_system): Even if
+ Vcoding_system_for_write is non-nil, if
+ coding_system_require_warning is nonzero, call
+ Vselect_safe_coding_system_function.
+
+2002-12-17 Markus Rost <[email protected]>
+
+ * Makefile.in (lisp, shortlisp): Add cus-face and timer.
+ (lisp): Add font-core.
+
+2002-12-13 Stefan Monnier <[email protected]>
+
+ * textprop.c (text_read_only): New arg `propval'.
+ (get_char_property_and_overlay): Remove unused var `next_overlay'.
+ (verify_interval_modification): Use text_read_only's new arg.
+
+2002-12-13 Kenichi Handa <[email protected]>
+
+ * coding.c (Funencodable_char_position): Set pend correctly.
+
+2002-12-12 Jason Rumney <[email protected]>
+
+ * w32term.c (last_mousemove_x, last_mousemove_y): New variables.
+ (w32_read_socket) <WM_MOUSEMOVE>: Use them to detect non-movement.
+ Be more careful about when help_events are generated.
+
+2002-12-12 Steven Tamm <[email protected]>
+
+ * macterm.c (mac_check_for_quit_char): Correctly set the
+ modifiers of the event to 0.
+ * mac.c (sys_select): Duplicate rfds before calling select to
+ ensure that rfds survive the while loop.
+
+2002-12-11 Kim F. Storm <[email protected]>
+
+ * xdisp.c (try_window_id): Don't call set_cursor_from_row if
+ row_containing_pos returned NULL.
+
+2002-12-10 Steven Tamm <[email protected]>
+
+ * mac.c (sys_read): Fix sys_read to not call select if IO is
+ non-blocking.
+ (sys_select): Fix sys_select to not use a timeout larger than
+ the one given.
+
+2002-12-10 Juanma Barranquero <[email protected]>
+
+ * editfns.c (Fformat): Use alloca, not _alloca.
+
+2002-12-09 Richard M. Stallman <[email protected]>
+
+ * buffer.c (Fget_buffer_create): Call Qucs_set_table_for_input
+ as the last thing.
+
+2002-12-09 Dave Love <[email protected]>
+
+ * s/sol2-8.h: Removed. (Not necessary.)
+
+2002-12-09 Matthew Swift <[email protected]>
+
+ * editfns.c (Fformat): Handle precision in string conversion
+ specifiers like libc functions do (ie, print at most that many
+ characters).
+
+2002-12-08 Richard M. Stallman <[email protected]>
+
+ * xdisp.c (row_containing_pos): Check more carefully
+ whether charpos is really in the row before returning it.
+
+2002-12-07 Steven Tamm <[email protected]>
+
+ * sysdep.c (emacs_read) [HAVE_CARBON]: Have emacs_read use sys_read.
+
+ * eval.c (Feval) [HAVE_CARBON]: Calls mac_check_for_quit_char at
+ each stack frame. This may change as it could be time consuming.
+
+ * macterm.c (mac_check_for_quit_char, quit_char_comp)
+ (init_quit_char_handler, mac_determine_quit_char_modifiers)
+ (mac_initialize): Add code to check for pressing of quit_char
+ in the OS event queue.
+
+ * mac.c (sys_select): Call mac_check_for_quit_char every second
+ while blocking on select.
+
+ * mac.c (sys_read): Use sys_select to test for input first
+ before calling read, to allow C-g to break.
+
+2002-12-07 Richard M. Stallman <[email protected]>
+
+ * minibuf.c (Fcompleting_read): Doc fix.
+
+ * lread.c (syms_of_lread) <load-history>: Doc fix.
+
+ * fileio.c (Fcopy_file): Set immediate_quit around emacs_open call.
+
+ * eval.c (Fdefun, Fdefmacro): Record in load-history redefining an
+ autoload.
+
+ * data.c (Fdefalias): Record in load-history redefining an autoload.
+
+ * alloca.c: Undo ifdef change accidentally made on 12-04.
+
+2002-12-06 Francesco Potort,Al(B <[email protected]>
+
+ * xfns.c (png_load): Avoid double gamma correction for PNG images.
+
+2002-12-04 Richard M. Stallman <[email protected]>
+
+ * sysdep.c (fcntl.h): Test only HAVE_FCNTL_H.
+
+ * fileio.c (fcntl.h): Test only HAVE_FCNTL_H.
+
+ * alloca.c: Don't use #error.
+
+2002-12-03 Dave Love <[email protected]>
+
+ * buffer.c (Qucs_set_table_for_input): New.
+ (Fget_buffer_create): Use it.
+ (Qset_buffer_major_mode_hook): Deleted.
+ (Fset_buffer_major_mode): Revert previous change.
+ (init_buffer_once): Intern ucs-set-table-for-input.
+ (syms_of_buffer): Delete Qset_buffer_major_mode_hook.
+ Add &Qucs_set_table_for_input.
+
+2002-12-03 Andreas Schwab <[email protected]>
+
+ * callint.c (Fcall_interactively): Use next_event only if less
+ than key_count.
+
+2002-12-02 Andrew Choi <[email protected]>
+
+ * macmenu.c (add_menu_item, fill_menubar): Truncate menu item
+ names to 255 characters.
+
+ * macterm.c (XTread_socket): If all frames have been collapsed,
+ expand the first one before handling drag-and-drop events.
+
+ * s/darwin.h (GETPGRP_NO_ARG): Delete. Replaced by GETPGRP_VOID,
+ which is detected by autoconf.
+
+2002-12-01 Steven Tamm <[email protected]>
+
+ * unexmacosx.c (copy_twolevelhints, dump_it): Now corrects the
+ offset in two hints table to allow prebinding to be redone and
+ allow the executable to be stripped.
+
+2002-11-29 Dave Love <[email protected]>
+
+ * fns.c (Frequire): Don't call LOADHIST_ATTACH if feature was
+ already provided.
+
+2002-11-29 Richard M. Stallman <[email protected]>
+
+ * xdisp.c (start_display): Check more intelligently for
+ whether the line is continued.
+ (move_it_vertically_backward): Clear it->continuation_lines_width.
+
+2002-11-28 Dave Love <[email protected]>
+
+ * s/amdahl.h, s/unipl5-0.h, m/sgi3000.h, s/3700.h, s/alliant-2800.h:
+ * s/alliant.h, s/altos.h: Deleted. (Unused/empty.)
+
+2002-11-27 Steven Tamm <[email protected]>
+
+ * fns.c (Frequire): Change nesting allowance from 2 to 3 to cause
+ more descriptive error output from lread.c:Fload upon most require
+ cycles during boostrapping.
+
+2002-11-27 Jason Rumney <[email protected]>
+
+ * fileio.c (Finsert_file_contents): Give a more appropriate error
+ for files bigger than 2Gb when off_t is 32 bit.
+
+ * dired.c (Ffile_attributes): Don't return negative file sizes for
+ files bigger than 2Gb when off_t is 32 bit.
+
+2002-11-27 Dave Love <[email protected]>
+
+ * s/irix6-0.h (GC_SETJMP_WORKS, GC_MARK_STACK): Define.
+
+ * systty.h: Don't conditionally define GETPGRP_NO_ARG.
+ Test GETPGRP_VOID instead.
+ [BSD_TERMIOS]: Remove definitions (never used).
+
+ * s/osf5-0.h (WAIT_USE_INT, SYS_SIGLIST_DECLARED, sys_siglist):
+ Don't define.
+ (GC_SETJMP_WORKS, GC_MARK_STACK): Define.
+
+ * m/mips.h (WORDS_BIG_ENDIAN): Define conditionally.
+
+2002-11-25 Jason Rumney <[email protected]>
+
+ * w32.c (sys_write): Avoid non-blocking mode, which is not fully
+ supported.
+
+2002-11-25 Dave Love <[email protected]>
+
+ * unexalpha.c (update_dynamic_symbols): Cast arg of fatal_unexec.
+
+ * Makefile.in (TEMACS_LDFLAGS): Update last change.
+
+2002-11-25 Andreas Schwab <[email protected]>
+
+ * m/ia64.h: Restore `#ifndef NOT_C_CODE' deleted by last change.
+
+2002-11-24 Steven Tamm <[email protected]>
+
+ * unexmacosx.c (unexec_realloc): Use malloc_default_zone to
+ determine the size of pointers alloced in unexed space instead
+ of using possibly invalid emacs_zone pointers. This fixes the
+ binary incompatibility problems caused by updates to libSystem.B.
+
+2002-11-24 Richard M. Stallman <[email protected]>
+
+ * search.c (Fstring_match): Doc fix.
+
+ * callint.c (Fcall_interactively): If a command fails because
+ `*' detects a read-only buffer, but RECORD_FLAG is set,
+ record it anyway if the args don't actually do tty input.
+
+2002-11-22 Dave Love <[email protected]>
+
+ * sysdep.c (stuff_char) [PROTOTYPES]: Provide ISO C arglist.
+
+ * keyboard.c (interrupt_signal): Provide forward declaration.
+ (kbd_buffer_store_event): Don't declare interrupt_signal.
+
+ * xdisp.c (store_frame_title_char) [PROTOTYPES]: Provide ISO C arglist.
+
+2002-11-21 Richard M. Stallman <[email protected]>
+
+ * eval.c (interactive_p): Skip any number of bytecode
+ and special form frames, in any order.
+
+2002-11-20 Jason Rumney <[email protected]>
+
+ * w32fns.c (convert_mono_to_color_image): New function.
+ (xbm_load, xbm_load_image): Use it when foreground or background
+ is explicitly set.
+
+2002-11-19 Dave Love <[email protected]>
+
+ * s/usg5-4.h, sco4.h (bcopy, bzero, bcmp): Don't define.
+
+2002-11-18 Jason Rumney <[email protected]>
+
+ * w32fns.c (x_build_heuristic_mask): Filter palette info from color.
+ (XPutPixel): Swap blue and red.
+ (xpm_format, pbm_format, png_format, jpeg_format, tiff_format)
+ (gif_format, gs_format): Use IMAGE_ASCENT_VALUE.
+ (xpm_image_p, pbm_image_p, png_image_p, jpeg_image_p)
+ (tiff_image_p, gif_image_p, gs_image_p): Don't check ascent.
+
+2002-11-18 Dave Love <[email protected]>
+
+ * m/orion105.h (HAVE_ALLOCA): Don't define.
+
+ * m/m68k.h, m/arm.h, mtekxd88.h, m/tower32v3.h: Don't define alloca.
+
+ * m/intel386.h: Don't include alloca.h or define alloca.
+
+ * m/ia64.h: Don't include alloca.h, stdlib.h. Don't declare
+ malloc, realloc, calloc.
+
+ * m/hp800.h, m/sr2k.h, m/ns16000.h, m/wicat.h (bcopy, bzero)
+ (bcmp): Don't define.
+
+ * m/delta.h (bcopy, bzero, bcmp, alloca): Don't define.
+
+ * m/amdahl.h: Don't define LIB_STANDARD.
+
+ * m/alpha.h: Move OSF1 stuff from here to s/osf1.h.
+
+ * s/osf1.h: Move OSF1 stuff from m/alpha.h to here.
+
+ * s/irix4-0.h, s/irix5-0.h, m/powerpcle.h, m/sparc.h:
+ Don't include alloca.h.
+
+ * s/aix3-2.h (HAVE_FSYNC): Don't define.
+
+ * regex.c (_GNU_SOURCE): Don't define.
+
+ * process.c (_GNU_SOURCE): Don't define.
+
+ * fileio.c (_GNU_SOURCE, HAVE_FSYNC): Don't define.
+
+2002-11-18 Markus Rost <[email protected]>
+
+ * s/sol2-8.h: Include sol2-6.h.
+
+2002-11-18 Miles Bader <[email protected]>
+
+ * dispextern.h (struct face): Add `overstrike' field.
+ * xterm.c (x_draw_glyph_string_foreground)
+ (x_draw_composite_glyph_string_foreground): Implement overstriking.
+ * xfaces.c (load_face_font): Set `face->overstrike' based on
+ result from choose_face_font.
+ (best_matching_font, choose_face_font): Add `needs_overstrike'
+ argument, and use it to return whether overstriking is desirable
+ for this face/font combo.
+ (set_font_frame_param): Pass new argument to choose_face_font.
+
+2002-11-17 Ben Key <[email protected]>
+
+ This change is my fix for the following entry in etc/PROBLEMS:
+ "Emacs built on Windows 9x/ME crashes at startup on Windows XP,
+ or Emacs builtpart of on XP crashes at startup on Windows 9x/ME."
+
+ * w32.c: Added wrapper functions around the win32 API functions
+ OpenProcessToken, GetTokenInformation, LookupAccountSid, and
+ GetSidIdentifierAuthority. These wrapper functions serve two
+ purposes:
+ 1. They ensure that the wrapped function can never be called
+ when Emacs is running on an operating system on which they are
+ not supported (Microsoft Windows 95 / 98 / ME).
+ 2. They call the wrapped functions via function pointers rather
+ than calling them directly. This avoids taking advantage of the
+ undocumented fact that although these functions are not supported
+ in the 9x branch of Microsoft Windows, the functions do exist in
+ the version of advapi32.dll that is found in the 9x branch of
+ Microsoft Windows.
+
+ * w32.c (init_user_info): Replace the calls to the win32 API
+ functions OpenProcessToken, GetTokenInformation, LookupAccountSid,
+ and GetSidIdentifierAuthority with calls to the newly added
+ wrapper functions.
+
+ * w32.h: Added extern declarations for the following functions:
+ syms_of_w32term, syms_of_w32fns, syms_of_w32select,
+ syms_of_w32menu, and void syms_of_fontset.
+
+ * w32fns.c (w32_wnd_proc): Add code to reinitialize the
+ function pointer track_mouse_event_fn in the handler for the
+ WM_SETFOCUS message.
+
+ * w32menu.c (initialize_frame_menubar): Add code to
+ reinitialize the function pointers set_menu_item_info and
+ get_menu_item_info.
+
+2002-11-17 Ben Key <[email protected]>
+
+ * sound.c: Added a partial implementation of play-sound-internal
+ for Microsoft Windows. Added various #ifdef / #else / #endif
+ code blocks to separate the code that will compile under
+ Microsoft Windows from the code that is specific to GNU/Linux.
+ Moved several blocks of code around to make this separation of code
+ into Windows compatible and GNU/Linux compatible code blocks easier.
+
+ * makefile.w32-in: Include sound.c and link with WinMM.lib.
+
+ * s/ms-w32.h: Defined the symbol HAVE_SOUND so that the newly
+ added support for play-sound-internal under Windows would be
+ included in the build of Emacs.
+
+2002-11-16 Jason Rumney <[email protected]>
+
+ * w32fns.c (w32_load_system_font): Don't disable Cleartype.
+
+ * w32term.c (w32_get_glyph_string_clip_rect): Clip cursor tightly.
+
+2002-11-15 Stefan Monnier <[email protected]>
+
+ * keyboard.c (command_loop_1): Fix int/Lisp_Object mixup.
+ (adjust_point_for_property): Move out of display and invisible even if
+ we were already inside before (in case a property was added while
+ we weren't looking). Be more careful when handling invisible props.
+ Skip invisible text as if it really wasn't there at all.
+
+2002-11-15 Jason Rumney <[email protected]>
+
+ * w32term.c (x_draw_image_foreground)
+ (w32_draw_image_foreground_1): Use standard copy and invert
+ operations to draw images.
+
+ * w32fns.c (x_create_x_image_and_pixmap): Fill in palette for
+ depth of 1.
+ (xbm_read_bitmap_data): Invert bits as xbm is read in.
+ (XPutPixel): Don't invert bits here.
+
+2002-11-15 Jason Rumney <[email protected]>
+
+ * w32term.c (x_draw_image_foreground, x_draw_image_glyph_string)
+ (w32_draw_image_foreground_1): Handle image masks.
+ (x_draw_image_glyph_string): Don't BitBlt transparently.
+
+ * w32fns.c (w32_defined_color): Adjust RGB values for Emacs.
+ (x_from_xcolors): Adjust RGB values for W32.
+ (image_background, image_background_transparent)
+ (postprocess_image, x_to_xcolors, x_disable_image)
+ (x_build_heuristic_mask): Adapt for W32 and enable.
+ (x_create_x_image_and_pixmap): Mark images with palettes as such.
+ (xbm_load): Remove unused variable.
+
+2002-11-14 Richard M. Stallman <[email protected]>
+
+ * buffer.c (syms_of_buffer): Doc fix.
+
+2002-11-14 Dave Love <[email protected]>
+
+ * alloc.c (SETJMP_WILL_NOT_WORK): Add note.
+
+ * xterm.c (x_draw_relief_rect, x_draw_box_rect, x_update_cursor):
+ * xmenu.c (unuse_menu_items, digest_single_submenu):
+ * xfns.c (x_put_x_image):
+ * xdisp.c (message2_nolog, set_message):
+ * undo.c (record_point):
+ * terminfo.c (tparam):
+ * syntax.c (scan_sexps_forward):
+ * scroll.c (calculate_scrolling, calculate_direct_scrolling):
+ * composite.c (update_compositions):
+ * cm.c (calccost, cmgoto):
+ * charset.c (c_string_width): Declare all args (per C99).
+
+ * frame.h (get_specified_cursor_type, get_window_cursor_type): Declare.
+
+ * lisp.h (get_specified_cursor_type, get_window_cursor_type):
+ Don't declare.
+
+ * emacs.c (main) [!VMS]: Avoid third arg.
+
+ * fns.c (Fcopy_sequence): Doc fix.
+ (Fmap_char_table): Cast `call2'.
+
+2002-11-14 Francesco Potort,Al(B <[email protected]>
+
+ * s/sol2-8.h: New file.
+
+2002-11-14 Kim F. Storm <[email protected]>
+
+ * buffer.c (syms_of_buffer) <mode-line-format>: Document symbol
+ dependency on `risky-local-variable' and the :propertize form.
+
+2002-11-12 Stefan Monnier <[email protected]>
+
+ * fns.c (Fmap_char_table): Don't use map_char_table's function arg.
+
+ * syntax.c (scan_sexps_forward): Undo last patch.
+ Use a more obvious fix: check eob before updating the syntax table.
+
+2002-11-09 Stefan Monnier <[email protected]>
+
+ * syntax.c (scan_sexps_forward): Update syntax table before reading
+ a char rather than after so we don't update the table past eob.
+
+2002-11-09 Dave Love <[email protected]>
+
+ * buffer.c (Fset_buffer_major_mode): Fix last change.
+
+ * regex.c (regexec): Fix pmatch declaration.
+
+ * cmds.c (Fself_insert_command): Apply Vtranslation_table_for_input.
+
+ * keyboard.c (command_loop_1): Apply Vtranslation_table_for_input
+ to self-inserting characters.
+ (syms_of_keyboard) <keyboard-translate-table>: Doc fix.
+
+ * coding.c (Vtranslation_table_for_input): New.
+ (syms_of_coding): DEFVAR it.
+
+2002-11-08 Juanma Barranquero <[email protected]>
+
+ * w32term.c (w32_draw_fringe_bitmap): Remove unused local variable
+ window.
+
+2002-11-08 Pavel Jan,Am(Bk <[email protected]>
+
+ * process.c (Fformat_network_address): Remove unused locals p,
+ cp, and i.
+
+2002-11-06 Dave Love <[email protected]>
+
+ * buffer.c (Qset_buffer_major_mode_hook): New.
+ (Fset_buffer_major_mode): Use it.
+
+2002-11-06 Richard M. Stallman <[email protected]>
+
+ * xterm.c (x_term_init): Use turn_on_atimers, not start_polling
+ and stop_polling.
+
+ * process.c (wait_reading_process_input):
+ Test POLLING_PROBLEM_IN_SELECT, not hpux.
+ Avoid initialization for auto Lisp_Object var.
+
+ * s/hpux11.h (POLLING_PROBLEM_IN_SELECT): Add #undef.
+
+ * s/hpux10.h (POLLING_PROBLEM_IN_SELECT): Defined.
+
+2002-11-05 Richard M. Stallman <[email protected]>
+
+ * s/sol2-5.h (BROKEN_SIGIO): Turn off the #undef.
+
+ * callint.c (Fcall_interactively): New local filter_specs.
+ (Fcall_interactively): Check for progn as well as let.
+ Add a gcpro.
+ (Qprogn): New variable.
+ (syms_of_callint): Staticpro and init Qprogn.
+
+2002-11-04 John Paul Wallington <[email protected]>
+
+ * lread.c (Feval_buffer): Doc fix.
+
+2002-11-04 Dave Love <[email protected]>
+
+ * keyboard.c (read_char): Always translate iff
+ Vkeyboard_translate_table is a char table and c is valid.
+
+ * xterm.c (XTread_socket): Check Lisp types for Vx_keysym_table
+ and fix C types.
+
+2002-11-03 Stefan Monnier <[email protected]>
+
+ * xdisp.c (single_display_prop_intangible_p): Strings are intangible.
+
+ * editfns.c (get_pos_property): Don't hardcode Qfield.
+
+ * keyboard.c (adjust_point_for_property): Handle `display' prop on
+ overlays. Also handle `invisible' prop.
+
+2002-11-02 Stefan Monnier <[email protected]>
+
+ * coding.c (decode_coding_emacs_mule, decode_coding_iso2022)
+ (decode_coding_sjis_big5, decode_eol): Allow lone \r in DOS EOL.
+
+2002-11-01 Andreas Schwab <[email protected]>
+
+ * editfns.c (Fmessage): Revert last change to properly handle %%.
+
+2002-11-01 Stefan Monnier <[email protected]>
+
+ * xmenu.c (unuse_menu_items): New fun.
+ (menu_items_inuse): New var.
+ (syms_of_xmenu): Initialize it.
+ (init_menu_items): Use it to detect re-entrance.
+ (Fx_popup_menu, Fx_popup_dialog, set_frame_menubar): Reset when done.
+ (Fx_popup_menu): Remove spurious XSETFRAME.
+
+ * editfns.c (find_field): Make an exception for nil fields.
+
+2002-11-01 Dave Love <[email protected]>
+
+ * m/gec63.h: Deleted.
+
+2002-10-31 Dave Love <[email protected]>
+
+ * xterm.c (XTread_socket): Fix last change.
+ (xaw_scroll_callback): Cast call_data to long to avoid warning.
+
+2002-10-31 Stefan Monnier <[email protected]>
+
+ * process.c (Fformat_network_address): Fix int/Lisp_Object mixup.
+
+2002-10-30 Stefan Monnier <[email protected]>
+
+ * editfns.c (overlays_around, get_pos_property): New funs.
+ (find_field): Use them.
+ Also be careful not to modify POS before its last use.
+ (Fmessage): Don't Fformat if there's nothing to format.
+
+2002-10-30 Dave Love <[email protected]>
+
+ * process.c [HAVE_SYS_WAIT]: Include sys/wait.h.
+ [HAVE_PTY_H]; Include pty.h.
+
+ * lread.c (Fload) <!load_dangerous_libraries>: Close fd.
+
+ * xterm.c (Qeql): Declare.
+ (Vx_keysym_table): New.
+ (syms_of_xterm): Initialize it.
+ (XTread_socket): Use it. Deal with ASCII keysyms.
+ (XSetIMValues) [HAVE_X11R6]: Prototype.
+
+ * keyboard.c (lispy_accent_codes, lispy_accent_keys): Extended.
+ (lispy_kana_keys): Comment out.
+ (make_lispy_event) [XK_kana_A]: Comment out.
+ (modify_event_symbol) <sizeof (long) == sizeof (EMACS_INT)>:
+ Fix sprintf call.
+
+ * s/osf5-0.h (C_SWITCH_SYSTEM): Revert last change (fixed by
+ regexp.h change).
+ (TERMINFO, LIBS_TERMCAP): Define.
+
+ * s/usg5-4.h (bcopy, bzero): Define conditional on HAVE_BCOPY.
+ (bcmp): Define conditional on HAVE_BCMP.
+ (NO_SIOCTL_H): Don't define.
+ (TIOCSIGSEND): Don't make conditional on IRIX6.
+
+ * s/sol2-5.h: Don't include strings.h.
+ (bcopy, bzero, bcmp) [HAVE_BCOPY]: Don't undef.
+
+ * s/irix6-0.h (IRIX6): Don't define.
+ (bcopy, bcmp, bzero): Don't undef.
+
+ * s/irix6-5.h: Don't include strings.h.
+ (IRIX6): Don't define.
+ (bcopy, bcmp, bzero): Don't undef.
+
+ * syntax.c (Fforward_comment): Doc fix.
+
+2002-10-29 Kim F. Storm <[email protected]>
+
+ * process.c (Fsignal_process): Allow PROCESS to be specified by
+ name in addition to pid (as integer or string).
+
+2002-10-28 Harald Maier <[email protected]> (tiny change)
+
+ * w32heap.c: Don't redefine _heap_init and _heap_term on MSVC 7 build
+ environments.
+
+2002-10-27 Kim F. Storm <[email protected]>
+
+ * xterm.c (note_mouse_highlight): Don't use mouse-face if hidden.
+
+ * w32term.c (note_mouse_highlight): Don't use mouse-face if hidden.
+
+ * msdos.c (IT_note_mouse_highlight): Don't use mouse-face if hidden.
+
+ * macterm.c (note_mouse_highlight): Don't use mouse-face if hidden.
+
+2002-10-26 Richard M. Stallman <[email protected]>
+
+ * editfns.c (Fformat): Detect invalid format letters for floats.
+
+2002-10-25 Kenichi Handa <[email protected]>
+
+ * xfns.c (x_set_name): Encode by Qcompound_text unconditionally.
+ (x_set_title): Likewise.
+
+2002-10-25 Juanma Barranquero <[email protected]>
+
+ * macgui.h:
+ * w32gui.h: Remove definition of XColor.
+
+ * dispextern.h [!HAVE_X_WINDOWS]: Define XColor.
+
+2002-10-24 Kim F. Storm <[email protected]>
+
+ * xdisp.c (get_window_cursor_type): New arg ACTIVE_CURSOR.
+ Callers changed (supply dummy arg).
+
+ * lisp.h (get_window_cursor_type): Update prototype.
+
+ * w32term.c (x_display_and_set_cursor): Get active_cursor from
+ get_window_cursor_type to track system caret.
+
+2002-10-24 Kim F. Storm <[email protected]>
+
+ * process.c (Fformat_network_address): New function.
+ (syms_of_process): Defsubr it.
+ (list_processes_1): Use it to format :local/:remote address if
+ service/host is not set; before Emacs would crash in that case.
+ (Fmake_network_process): Don't use Ffind_operation_coding_system
+ to setup coding system if host or service is not set.
+
+2002-10-23 Juanma Barranquero <[email protected]>
+
+ Patch suggested by Jay Finger <[email protected]>.
+
+ * w32term.c (w32_term_init): Pass XColor to w32_define_color, not
+ COLORREF.
+
+ * macgui.h:
+ * w32gui.h: Add definition of XColor.
+
+ * macfns.c:
+ * w32fns.c:
+ * xfaces.c: Remove definition of XColor.
+
+2002-10-22 Stefan Monnier <[email protected]>
+
+ * xfns.c (x_set_name, x_set_title): `icon.value' has unsigned char.
+
+ * window.c (window_loop): For GET_LRU_WINDOW and GET_LARGEST_WINDOW>,
+ Only ignore truly dedicated windows. For UNSHOW_BUFFER, delete the
+ window if it is dedicated.
+ (Fshrink_window): Add preserve_before as was done for enlarge_window.
+ (Vspecial_display_function): Update docstring.
+
+ * buffer.c (assoc_ignore_text_properties, Fother_buffer, Fkill_buffer)
+ (call_overlay_mod_hooks): Use CONSP and XCAR/XCDR.
+ (Fget_buffer_create, advance_to_char_boundary): Use BEG and BEG_BYTE.
+
+2002-10-21 Stefan Monnier <[email protected]>
+
+ * casefiddle.c (casify_region): Don't treat a prefix char as part
+ of a word when at the beginning.
+
+2002-10-17 Juanma Barranquero <[email protected]>
+
+ * lread.c (syms_of_lread): Fix typos.
+
+2002-10-17 Dave Love <[email protected]>
+
+ * Makefile.in (TEMACS_LDFLAGS): Add trailing comment.
+
+2002-10-16 Richard M. Stallman <[email protected]>
+
+ * fileio.c (Fcopy_file): Fix backward test of KEEP_TIME.
+
+2002-10-14 Juanma Barranquero <[email protected]>
+
+ * w16select.c (syms_of_win16select): Fix docstring for
+ `selection-coding-system'.
+
+ * w32select.c (syms_of_w32select): Likewise.
+
+2002-10-14 Stefan Monnier <[email protected]>
+
+ * syntax.c (scan_lists): Don't get fooled by a symbol ending with
+ a backslash-quoted char.
+ (scan_lists, scan_sexps_forward): Pacify the compiler.
+
+2002-10-13 Richard M. Stallman <[email protected]>
+
+ * window.c (window_scroll): Set immediate_quit.
+
+ * print.c (print): When backquote form is the car of a list,
+ output in old style. Use old_backquote_output to output all
+ comma forms inside it in old style too.
+
+ * buffer.h (struct buffer): Move `undo_list' down below `name'.
+
+2002-10-11 Markus Rost <[email protected]>
+
+ * emacs.c (syms_of_emacs) <kill-emacs-hook>: Doc fix (not run in
+ batch mode).
+
+ * lread.c (Fload): Doc fix (load-suffixes).
+
+2002-10-10 Steven Tamm <[email protected]>
+
+ * macterm.c (syms_of_macterm, mac_get_mouse_btn):
+ Reverse functionality of mac-wheel-button-is-mouse-2 to be correct.
+ Also switch the default to Qnil from Qt.
+
+2002-10-08 Kenichi Handa <[email protected]>
+
+ * coding.c (code_convert_region): When we need more GAP for
+ conversion, pay attention to the case that coding->produced is not
+ greater than coding->consumed.
+
+2002-10-07 Richard M. Stallman <[email protected]>
+
+ * unexelf.c (unexec): Redo 9/16 change, but only if IRIX6_5.
+
+2002-10-06 Andrew Choi <[email protected]>
+
+ * macmenu.c (mac_menu_show): Add j to count menu items; match
+ menu_item_selection to it to find selected item.
+
+2002-10-06 Jan Dj,Ad(Brv <[email protected]>
+
+ * xterm.c (XTread_socket): Fix from 2002-10-03 didn't cover all
+ cases. The correct fix is to pass ReparentNotify to Xt.
+ The shell widget interprets ConfigureNotify differently depending
+ on if it has been reparented or not.
+
+2002-10-05 Markus Rost <[email protected]>
+
+ * editfns.c (Fformat_time_string): Doc fix.
+
+2002-10-05 John Paul Wallington <[email protected]>
+
+ * fns.c (Flength): Doc fix.
+
+2002-10-04 Stefan Monnier <[email protected]>
+
+ * keyboard.c (keyremap): New struct.
+ (read_key_sequence): Use it: globally replace keytran_foo with
+ keytran.foo and fkey_foo with fkey.foo. Rename temp vars
+ keytran_next and fkey_next to just `next'.
+
+2002-10-04 Steven Tamm <[email protected]>
+
+ * macterm.c (keycode_to_xkeysym_table): Change return to be
+ treated like an X keysym.
+
+2002-10-03 Jan Dj,Ad(Brv <[email protected]>
+
+ * xterm.c (XTread_socket): For ConfigureNotify, with x and y == 0,
+ and USE_MOTIF, call XTranslateCoordinates to get the real x and y.
+ This is to also handle x/y changes that occur because of a resize.
+
+2002-10-02 John Paul Wallington <[email protected]>
+
+ * frame.c (Vdelete_frame_functions): New variable.
+ (syms_of_frame): Initialize and defvar it.
+ (Fdelete_frame): Use it instead of delete-frame-hook. Don't run
+ it when frame's `tooltip' parameter is non-nil.
+
+ * xfns.c (x_create_tip_frame): Set `tooltip' frame parameter to t.
+
+ * w32fns.c (x_create_tip_frame): Likewise.
+
+ * macfns.c (x_create_tip_frame): Likewise.
+
+2002-09-30 Kenichi Handa <[email protected]>
+
+ * xterm.c (x_encode_char): For DIM=1 charset, set ccl->reg[2] to
+ -1 before calling ccl_driver.
+
+ * coding.c (decode_coding_emacs_mule): Check coding->cmp_data.
+ Only when it is non-nil, handle composition sequence.
+ (setup_coding_system) <0>: Don't force composition handling.
+
+ * Makefile.in (lisp, shortlisp): Add utf-16.elc.
+
+2002-09-29 Richard M. Stallman <[email protected]>
+
+ * search.c (Freplace_match): Adjust match data for the substitution
+ just made in the buffer.
+
+ * xdisp.c (STOP_POLLING, RESUME_POLLING): New macros.
+ (redisplay_internal): Use them. Do RESUME_POLLING at end of function.
+
+2002-09-27 Richard M. Stallman <[email protected]>
+
+ * keyboard.c (STOP_POLLING, RESUME_POLLING): New macros.
+ (read_char): Use them. Do all exits thru the end of the function.
+
+2002-09-27 Kenichi Handa <[email protected]>
+
+ * xfaces.c (try_font_list): Pay attention to the case that FAMILY
+ is nil.
+
+2002-09-26 Richard M. Stallman <[email protected]>
+
+ * regex.h (__restrict_arr): Don't define if already defined.
+
+ * coding.c (run_pre_post_conversion_on_str):
+ Save and restore Vdeactivate_mark.
+
+2002-09-26 John Paul Wallington <[email protected]>
+
+ * minibuf.c (Fminibufferp): Add an optional `buffer' argument.
+
+2002-09-26 Kenichi Handa <[email protected]>
+
+ * xfaces.c (try_font_list): New arg PREFER_FACE_FAMILY. If it is
+ nonzero, try face's family at first. Otherwise try FAMILY at first.
+ (choose_face_font): If C is a single byte char or latin-1, call
+ try_font_list with PREFER_FACE_FAMILY 1.
+
+2002-09-21 Richard M. Stallman <[email protected]>
+
+ * window.c (select_window_1): Don't select frame.
+ Set frame's selected window only when frame itself is selected.
+ (Fselect_window): Doc fix.
+
+2002-09-18 Kim F. Storm <[email protected]>
+
+ * process.c (make-network-process): Doc fix (there is no
+ network-server-log-function hook).
+
+2002-09-18 Richard M. Stallman <[email protected]>
+
+ * print.c (print): Clear out the unused parts of Vprint_number_table.
+ (syms_of_print): Doc fix for `print-number-table'.
+
+ * unexelf.c (unexec): Undo previous change.
+
+2002-09-17 Andreas Schwab <[email protected]>
+
+ * m/alpha.h [LINUX]: Don't define DATA_START.
+
+2002-09-16 Dave Love <[email protected]>
+
+ * unexelf.c (unexec): Deal with .got, reinstating change from
+ 25-08-1999.
+
+2002-09-13 Richard M. Stallman <[email protected]>
+
+ * s/sol2-6.h (UNEXEC): Comment out definition.
+
+ * unexsol.c (unexec): Don't downcase first letter of error msg.
+
+ * xfaces.c (Fcolor_supported_p): Just one arg is required.
+
+2002-09-12 Markus Rost <[email protected]>
+
+ * unexsol.c: Include buffer.h, charset.h, coding.h.
+
+2002-09-11 Richard M. Stallman <[email protected]>
+
+ * unexsol.c: Don't use report_file_error; do it by hand
+ using dlerror.
+
+ * process.c (wait_reading_process_input, both versions):
+ Before calling turn_on_atimers, call stop_polling.
+
+ * emacs.c (syms_of_emacs) <command-line-args>: Doc fix.
+
+ * xdisp.c (try_scrolling): If after make_cursor_line_fully_visible
+ we go to too_near_end, call clear_glyph_matrix.
+ (redisplay_window): After make_cursor_line_fully_visible,
+ call clear_glyph_matrix and bypass `goto done'.
+
+ * xfns.c (x_report_frame_params): If FRAME_SCROLL_BAR_PIXEL_WIDTH is 0
+ and we have non-toolkit scroll bars, return nil for scroll-bar-width.
+
+2002-09-10 Richard M. Stallman <[email protected]>
+
+ * fileio.c (Fdo_auto_save): Catch error making directory.
+ Only call push_message if we need to.
+ At the same time, make an unwind-protect to pop it.
+ Rename local message_p to old_message_p.
+ (do_auto_save_make_dir, do_auto_save_eh): New functions.
+ (do_auto_save_unwind): Don't call pop_message.
+
+ * lisp.h (pop_message_unwind): Renamed from push_message_unwind.
+
+ * keyboard.c (Fexecute_extended_command): Use pop_message_unwind.
+
+ * alloc.c (Fgarbage_collect): Use pop_message_unwind.
+
+ * xdisp.c (pop_message_unwind): Renamed from push_message_unwind.
+
+2002-09-10 Stefan Monnier <[email protected]>
+
+ * regex.c (DISCARD_FAILURE_REG_OR_COUNT): Delete.
+ (CHECK_INFINITE_LOOP): Don't pop anything: just set `cycle' to 1.
+ (re_match_2_internal): Be more careful with infinite loops.
+
+2002-09-10 Kim F. Storm <[email protected]>
+
+ * macros.c (end_kbd_macro): New function.
+ (Fend_kbd_macro): Use it.
+
+ * macros.h (end_kbd_macro): Declare extern.
+
+ * keyboard.c (Fdiscard_input): If defining keyboard macro,
+ end and save it instead of discarding it.
+
+2002-09-09 Markus Rost <[email protected]>
+
+ * s/sol2-6.h: Fix typo. Add comment.
+
+2002-09-09 Richard M. Stallman <[email protected]>
+
+ * regex.c (regnum_t): Use signed int, not unsigned int.
+
+ * s/sol2-6.h: New file.
+
+ * s/sol2-5.h (UNEXEC): Definition deleted.
+
+2002-09-08 Kim F. Storm <[email protected]>
+
+ * macros.c (executing_macro_index): Change type to EMACS_INT.
+ (syms_of_macros): DEFVAR_INT it (needed by kmacro).
+
+ * macros.h (executing_macro_index): Change type to EMACS_INT.
+
+2002-09-06 Richard M. Stallman <[email protected]>
+
+ * casetab.c (set_case_table): Make canon table point to eqv table.
+
+2002-09-06 Juanma Barranquero <[email protected]>
+
+ * coding.c (syms_of_coding): Fix spacing.
+
+ * composite.c (Fcompose_region_internal)
+ (Fcompose_string_internal): Likewise.
+
+ * data.c (Flsh): Likewise.
+
+ * fontset.c (Fset_fontset_font): Likewise.
+
+ * macfns.c (Fx_server_max_request_size): Likewise.
+
+ * w16select.c (syms_of_win16select): Likewise.
+
+ * w32select.c (syms_of_w32select): Likewise.
+
+ * xselect.c (syms_of_xselect): Likewise.
+
+2002-09-05 Richard M. Stallman <[email protected]>
+
+ * regex.c (set_image_of_range_1): In no-TRANSLATE case,
+ call EXTEND_RANGE_TABLE and return a proper value.
+ (set_image_of_range): Don't call set_image_of_range_1
+ if no TRANSLATE or if range includes all of Latin-1.
+ Only call it for the Latin-1 part of the range.
+ For other cases, make two separate ranges,
+ one for the original specified characters and one for
+ their case-conversions.
+
+2002-09-04 Richard M. Stallman <[email protected]>
+
+ * s/sol2-5.h (UNEXEC): Use unexsol.o.
+
+ * window.c (displayed_window_lines): Correct for one-off bug
+ in HEIGHT on non-window displays.
+
+ * regex.c (set_image_of_range_1): New function.
+ (set_image_of_range): Use set_image_of_range_1 for Latin-1.
+ Return a value to indicate running out of memory.
+ (SET_RANGE_TABLE_WORK_AREA): Check value from set_image_of_range.
+ (extend_range_table_work_area): New subroutine.
+ (EXTEND_RANGE_TABLE): Replaces EXTEND_RANGE_TABLE_WORK_AREA.
+ Different calling conventions, and used from set_image_of_range{,_1}.
+ (IMMEDIATE_QUIT_CHECK): Definitions moved.
+
+2002-09-04 Juanma Barranquero <[email protected]>
+
+ * makefile.w32-in: All dependencies updated.
+
+2002-09-01 Richard M. Stallman <[email protected]>
+
+ * unexsol.c: New file.
+
+ * xfns.c (Qbox): Declare external, don't define.
+
+ * xdisp.c (redisplay_window) <force-start case>:
+ If point is on semi-visible last line, reposition
+ it at previous line.
+
+ * alloc.c (display_malloc_warning): Use display-warning.
+ (malloc_warning_1): Function deleted.
+
+ * alloc.c [ALLOC_DEBUG]: #undef INLINE.
+
+ * lread.c (read1): Handle #! by skipping the line.
+
+2002-08-31 Richard M. Stallman <[email protected]>
+
+ * Makefile.in (TEMACS_LDFLAGS): Renamed from ALL_LDFLAGS.
+ Don't include LDFLAGS.
+ (temacs): Pass LDFLAGS separately, and not via YMF_PASS_LDFLAGS.
+
+2002-08-31 Eli Zaretskii <[email protected]>
+
+ * xdisp.c (get_window_cursor_type): Don't use x_highlight_frame
+ member of x_display_info unless we compile for some window system.
+
+2002-08-31 Kim F. Storm <[email protected]>
+
+ * xdisp.c (Valternate_cursor_type, Qalternate_cursor_type): Removed.
+ (get_window_cursor_type): Don't use them.
+ (syms_of_xdisp): Remove intern, staticpro, and defvar for them.
+
+2002-08-30 Kenichi Handa <[email protected]>
+
+ * xdisp.c (get_next_display_element): Fix previous change.
+
+2002-08-30 Andrew Choi <[email protected]>
+
+ * macterm.c (expose_overlaps): New function (merge code from xterm.c).
+ (expose_window): Use it to fix the display of overlapping
+ rows (merge code from xterm.c).
+
+ * macfns.c (Qbox): Add extern declaration.
+
+2002-08-30 Juanma Barranquero <[email protected]>
+
+ * w32fns.c (Qbox): Make extern.
+ (syms_of_w32fns): Remove initialization of Qbox.
+
+2002-08-30 Rune Kleveland <[email protected]> (tiny change)
+
+ * xfns.c (Fx_open_connection): Fix error message.
+
+2002-08-30 Kim F. Storm <[email protected]>
+
+ The following changes consolidates the handling of the cursor
+ type in xdisp.c, moving duplicate code and functionality from
+ xfns.c, xterm.c, w32fns.c, w32term.c, macfns.c, and macterm.c.
+
+ * frame.h (enum text_cursor_kinds): Consolidated here.
+ Added DEFAULT_CURSOR value.
+ (struct frame) <desired_cursor, cursor_width>
+ <blink_off_cursor, blink_off_cursor_width>: New fields.
+ Consolidated from output_x, output_w32 and output_mac structs.
+ (FRAME_DESIRED_CURSOR, FRAME_CURSOR_WIDTH, FRAME_BLINK_OFF_CURSOR)
+ (FRAME_BLINK_OFF_CURSOR_WIDTH): Macros consolidated here.
+
+ * xdisp.c (Qbar, Qhbar, Qbox, Qhollow, Vblink_cursor_alist):
+ Variables consolidated here.
+ (Valternate_cursor_type, Qalternate_cursor_type): New variables.
+ (Vcursor_in_non_selected_windows): Renamed from
+ cursor_in_non_selected_windows and changed to Lisp_Object.
+ (syms_of_xdisp): Define and staticpro new and moved variables.
+ (get_specified_cursor_type): Renamed from x_specified_cursor_type;
+ consolidated here. Recognize Qhollow setting.
+ (set_frame_cursor_types): New function to set frame cursor types
+ based on the frame parameters.
+ (get_window_cursor_type): New function to calculate new cursor
+ type and width for the specified window. Based on duplicated
+ code consolidated here.
+ Enhancements: cursor-in-non-selected-windows may be a cursor type,
+ check buffer-local alternate-cursor-type and blink-cursor-alist
+ before using built-in blink off methods.
+
+ * dispextern.h (cursor_in_non_selected_windows): Extern removed.
+
+ * lisp.h (Qcursor_in_non_selected_windows): Extern removed.
+ (get_specified_cursor_type, get_window_cursor_type)
+ (set_frame_cursor_types): Added prototypes.
+
+ * macfns.c (x_specified_cursor_type): Removed.
+ (x_set_cursor_type): Use set_frame_cursor_types.
+ (Qbar, Qbox): Removed.
+ (syms_of_macfns): Don't intern or staticpro them.
+
+ * macterm.c (x_specified_cursor_type): Remove prototype.
+ (x_draw_bar_cursor): Use FRAME_CURSOR_WIDTH.
+ (x_display_and_set_cursor): Use get_window_cursor_type.
+ Remove unused local variables cursor_non_selected, active_cursor.
+ Redraw cursor if hbar cursor width changes.
+ (make_mac_frame): Set FRAME_DESIRED_CURSOR.
+
+ * macterm.h (enum text_cursor_kinds): Removed.
+ (struct output_mac) <current_cursor, desired_cursor, cursor_width>
+ <blink_off_cursor, blink_off_cursor_width>: Members removed.
+ (FRAME_DESIRED_CURSOR): Macro removed.
+
+ * w32fns.c (Vblink_cursor_alist): Removed.
+ (Qbar, Qhbar, Qbox, Qhollow): Removed.
+ (syms_of_w32fns): Don't intern, staticpro, or define them.
+ (x_specified_cursor_type): Removed.
+ (x_set_cursor_type): Use set_frame_cursor_types.
+
+ * w32term.c (x_specified_cursor_type): Remove prototype.
+ (x_draw_bar_cursor): Use FRAME_CURSOR_WIDTH.
+ (x_display_and_set_cursor): Use get_window_cursor_type.
+ Remove unused local variables cursor_off_state.
+ Redraw cursor if hbar cursor width changes.
+ Changed all occurrences of w32_highlight_frame to x_highlight_frame.
+
+ * w32term.h (enum text_cursor_kinds): Removed.
+ (struct output_w32) <current_cursor, desired_cursor, cursor_width>
+ <blink_off_cursor, blink_off_cursor_width>: Members removed.
+ (FRAME_DESIRED_CURSOR, FRAME_CURSOR_WIDTH, FRAME_BLINK_OFF_CURSOR)
+ (FRAME_BLINK_OFF_CURSOR_WIDTH): Macros removed.
+ (struct w32_display_info) <x_highlight_frame>: Renamed member from
+ w32_highlight_frame.
+
+ * xfns.c (Vblink_cursor_alist): Removed.
+ (Qbar, Qhbar, Qbox, Qhollow): Removed.
+ (syms_of_xfns): Don't intern, staticpro, or define them.
+ (x_specified_cursor_type): Removed.
+ (x_set_cursor_type): Use set_frame_cursor_types.
+
+ * xterm.c (x_specified_cursor_type): Remove prototype.
+ (x_draw_bar_cursor): Use FRAME_CURSOR_WIDTH.
+ (x_display_and_set_cursor): Use get_window_cursor_type.
+ Remove unused local variables cursor_off_state.
+ Redraw cursor if hbar cursor width changes.
+
+ * xterm.h (enum text_cursor_kinds): Removed.
+ (struct output_x) <current_cursor, desired_cursor, cursor_width>
+ <blink_off_cursor, blink_off_cursor_width>: Members removed.
+ (FRAME_DESIRED_CURSOR, FRAME_CURSOR_WIDTH, FRAME_BLINK_OFF_CURSOR)
+ (FRAME_BLINK_OFF_CURSOR_WIDTH): Macros removed.
+ (x_specified_cursor_type): Remove prototype.
+
+2002-08-28 Richard M. Stallman <[email protected]>
+
+ * w32fns.c (x_set_cursor_type): Set FRAME_BLINK_OFF_CURSOR and
+ FRAME_BLINK_OFF_CURSOR_WIDTH using defaults and Vblink_cursor_alist.
+ (Vblink_cursor_alist): New variable.
+ (syms_of_w32fns): Initialize and defvar it.
+ (x_specified_cursor_type): Recognize Qbox for filled box.
+ Exceptions are hollow boxes.
+ (Qbox, Qhollow): New variables.
+ (syms_of_w32fns): Initialize and staticpro them.
+
+ * w32term.h (FRAME_BLINK_OFF_CURSOR, FRAME_BLINK_OFF_CURSOR_WIDTH):
+ New macros.
+ (struct w32_output): New fields blink_off_cursor,
+ blink_off_cursor_width.
+ (FRAME_CURSOR_WIDTH): New macro.
+
+ * w32term.c (x_display_and_set_cursor): Use FRAME_BLINK_OFF_CURSOR
+ and FRAME_BLINK_OFF_CURSOR_WIDTH for blinking cursor off.
+
+ * w32term.c (x_display_and_set_cursor): Check FRAME_CURSOR_WIDTH
+ for bar cursor.
+
+ * w32term.c (expose_overlaps): New function.
+ (expose_window): Use it to fix the display of overlapping rows.
+
+2002-08-28 Simon Josefsson <[email protected]>
+
+ * xfns.c (Fx_open_connection): Improve help when X connection
+ fails, xhost is insecure and xauth is better.
+
+2002-08-28 Juanma Barranquero <[email protected]>
+
+ * makefile.w32-in: Add missing dependencies on w32term.h and
+ composite.h.
+
+ * emacs.c (USAGE1): Add missing newline.
+
+2002-08-27 Andrew Choi <[email protected]>
+
+ * s/darwin.h [HAVE_LIBNCURSES]: Define HAVE_TERMINFO.
+
+2002-08-27 Richard M. Stallman <[email protected]>
+
+ * xfns.c (x_set_cursor_type): Set FRAME_BLINK_OFF_CURSOR and
+ FRAME_BLINK_OFF_CURSOR_WIDTH using defaults and Vblink_cursor_alist.
+ (Vblink_cursor_alist): New variable.
+ (syms_of_xfns): Initialize and defvar it.
+ (x_specified_cursor_type): Recognize Qbox for filled box.
+ Exceptions are hollow boxes.
+ (Qbox, Qhollow): New variables.
+ (syms_of_xfns): Initialize and staticpro them.
+
+ * xterm.h (FRAME_BLINK_OFF_CURSOR, FRAME_BLINK_OFF_CURSOR_WIDTH):
+ New macros.
+ (struct x_output): New fields blink_off_cursor, blink_off_cursor_width.
+
+ * xterm.c (x_display_and_set_cursor): Use FRAME_BLINK_OFF_CURSOR
+ and FRAME_BLINK_OFF_CURSOR_WIDTH for blinking cursor off.
+
+ * emacs.c (main): Handle --script.
+ (USAGE1): Mention --script.
+ (standard_args): Define sort order for --script.
+
+2002-08-27 Gerd Moellmann <[email protected]>
+
+ * xdisp.c (redisplay_updating_p): Variable removed.
+ (inhibit_free_realized_faces, Qinhibit_free_realized_faces):
+ New variables.
+ (init_iterator): Don't free realized faces if
+ inhibit_free_realized_faces is set.
+ (redisplay_internal): Bind Qinhibit_free_realized_faces to nil.
+ (syms_of_xdisp): DEFVAR_BOOL inhibit-free-realized-faces,
+ initialize Qinhibit_free_realized_faces.
+
+ * dispextern.h (PRODUCE_GLYPHS): Set inhibit_free_realized_faces
+ when iterator is adding glyphs to a glyph matrix.
+
+2002-08-27 Kenichi Handa <[email protected]>
+
+ * xdisp.c (get_next_display_element): In unibyte case, don't use
+ octal form for such eight-bit characters that can be converted to
+ multibyte char.
+
+2002-08-26 Kim F. Storm <[email protected]>
+
+ * frame.c (make_terminal_frame) [CANNOT_DUMP]: Initialize
+ foreground and background colors. From Joe Buehler.
+
+2002-08-26 Miles Bader <[email protected]>
+
+ * bytecode.c (Fbyte_code): Fsub1 can GC, so protect it.
+
+2002-08-25 Andrew Choi <[email protected]>
+
+ * emacs.c (main): Call init_mac_osx_environment if HAVE_CARBON is
+ defined instead of MAC_OSX.
+
+ * s/darwin.h (select): Define select to sys_select only if
+ HAVE_CARBON is defined.
+ (HAVE_WORKING_VFORK): #undef it. Define vfork to fork.
+ (DONT_REOPEN_PTY): #def it.
+
+ * macterm.c (XTread_socket): Remove code to call
+ SendEventToEventTarget for keys with command modifiers when
+ mac_command_key_is_meta is nil.
+
+2002-08-24 Andreas Schwab <[email protected]>
+
+ * eval.c (Fdefvar): Fix last change.
+
+2002-08-23 Richard M. Stallman <[email protected]>
+
+ * eval.c (Fdefvar, Fdefconst, Fdefvaralias):
+ Record variables in load history as (defvar . VAR).
+ (Fdefvar): Don't record in load history if no initial value.
+ (Qdefvar): New variable.
+ (syms_of_eval): Init and staticpro it.
+
+ * lread.c (syms_of_lread): Doc fix.
+ (build_load_history): Use Fmember to see if a definition
+ is already in the Vload_history element.
+
+ * process.c (Fstart_process): Remove /: from program name.
+
+ * emacs.c (decode_env_path): Don't add /: if file name handler
+ has a `safe-magic' property.
+
+ * callproc.c (Fcall_process): Remove /: from program name.
+
+2002-08-23 Stefan Monnier <[email protected]>
+
+ * regex.c (PATFETCH): Remove the translating fetch.
+ (PATFETCH_RAW): Rename to PATFETCH.
+ (set_image_of_range): New fun.
+ (SET_RANGE_TABLE_WORK_AREA): Use it.
+ (regex_compile): Don't translate the pattern chars so eagerly.
+ Only do it when inserting an `exactn' bytecode or when handling
+ a char-range.
+ (mutually_exclusive_p): Avoid empty statement.
+
+2002-08-22 Kim F. Storm <[email protected]>
+
+ * xdisp.c (redisplay_window): Do not `goto try_to_scroll' when we
+ end up on a partially visible line; this reverts a specific part
+ of the 2002-07-07 change by Richard M. Stallman to "fix" a nasty
+ display error which has been reported several times now.
+ However it introduces the problem that changes was supposed to fix.
+ See my comments in the source if you want to debug this further.
+
+2002-08-20 Kenichi Handa <[email protected]>
+
+ * abbrev.c (Fexpand_abbrev): Fix for the multibyte case.
+
+2002-08-19 Eli Zaretskii <[email protected]>
+
+ * msdos.c (croak): Add `void' to definition.
+
+ * sysdep.c (request_sigio, unrequest_sigio) [MSDOS]:
+ Don't define them, they are defined in msdos.c.
+
+ * mem-limits.h [MSDOS]: Declare etext.
+
+ * fileio.c (Ffile_name_directory) [DOS_NT]: Don't declare `beg'
+ `const' since CORRECT_DIR_SEPS modifies its target.
+
+2002-08-19 Kim F. Storm <[email protected]>
+
+ * keyboard.c (Fclear_this_command_keys): Add optional arg
+ KEEP-RECORD to avoid clearing lossage when we just want to clear
+ the current key sequence (kmacro needs this).
+
+2002-08-19 Kenichi Handa <handa@localhost>
+
+ * composite.c (run_composition_function): Call FUNC if it is fboundp.
+
+ * composite.h (COMPOSITION_MODIFICATION_FUNC): If PROP is not a
+ cons, return Qnil.
+
+2002-08-17 Richard M. Stallman <[email protected]>
+
+ * s/sol2-5.h (BROKEN_SIGIO): Add #undef.
+
+ * sysdep.c [!VMS]: Include sys/files.h.
+
+ * editfns.c (save_restriction_restore): Defend from unchained marker.
+
+ * buffer.c (overlays_at): Handle extending vec uniformly.
+ (overlays_in): Handle extending vec from length 0 as in overlays_at.
+
+2002-08-15 Andrew Choi <[email protected]>
+
+ * mac.c (init_mac_osx_environment): New function.
+
+ * emacs.c (main) [MAC_OSX]: Call init_mac_osx_environment.
+
+2002-08-14 Kim F. Storm <[email protected]>
+
+ * macros.c (Fstart_kbd_macro): Added NO-EXEC argument to inhibit
+ executing macro before appending to it (when used from Lisp).
+ (Fexecute_kbd_macro): Added LOOPFUNC argument to supply function
+ which is called prior to each iteration of macro (for kmacro.el).
+ (Fend_kbd_macro, Fcall_last_kbd_macro): Likewise.
+
+ * lisp.h (Fexecute_kbd_macro): Update prototype.
+
+ * keyboard.c (Fcommand_execute): Update call to Fexecute_kbd_macro.
+
+2002-08-14 Kenichi Handa <[email protected]>
+
+ * xselect.c (QUTF8_STRING): New variable.
+ (symbol_to_x_atom): Pay attention to QUTF8_STRING.
+ (x_atom_to_symbol): Likewise.
+ (x_get_local_selection): New argument local_request. If it is
+ nonzero, call handler_fn with the second arg nil.
+ (x_handle_selection_request): Call x_get_local_selection with
+ local_request 0.
+ (lisp_data_to_selection_data): Don't encode the string here.
+ (Fx_get_selection_internal): Call x_get_local_selection with
+ local_request 1.
+ (syms_of_xselect): Intern and staticpro QUTF8_STRING.
+
+ * xterm.c (x_term_init): Initialize dpyinfo->Xatom_UTF8_STRING.
+
+ * xterm.h (struct x_display_info): New member Xatom_UTF8_STRING.
+
+2002-08-13 Richard M. Stallman <[email protected]>
+
+ * minibuf.c (Fminibufferp): New function.
+ (syms_of_minibuf): Defsubr it.
+ (Fminibuffer_prompt_end): Handle non-minibuffers specially.
+
+2002-08-13 Gerd Moellmann <[email protected]>
+
+ * coding.c (Funencodable_char_position): Lisp_Object/int mixup.
+
+2002-08-12 Richard M. Stallman <[email protected]>
+
+ * syswait.h: Only the include of sys/wait.h tests HAVE_SYS_WAIT_H.
+ [!VMS] (WCOREDUMP, WEXITSTATUS, WIFEXITED, WIFSTOPPED, WIFSIGNALED)
+ (WSTOPSIG, WTERMSIG): Define each one independently if not defined
+ already.
+
+ * buffer.c (syms_of_buffer) <fill-column>: Doc fix.
+
+2002-08-11 Andrew Choi <[email protected]>
+
+ * macterm.c (XTmouse_position): Check wp with is_emacs_window.
+ (Vmac_pass_command_to_system): New variable.
+ (Vmac_pass_control_to_system): New variable.
+ (do_mouse_moved): Check wp with is_emacs_window.
+ (XTread_socket): Check window_ptr with is_emacs_window.
+ Call FrontNonFloatingWindow instead of FrontWindow. Send keydown
+ events back to Mac Toolbox for processing, depending on values of
+ Vmac_pass_command_to_system and Vmac_pass_control_to_system.
+ (syms_of_macterm): DEFVAR_LISP Vmac_pass_command_to_system and
+ Vmac_pass_control_to_system.
+
+2002-08-10 Kenichi Handa <[email protected]>
+
+ * coding.c (unencodable_char_position): New function.
+ (Funencodable_char_position): New function.
+ (syms_of_coding): Defsubr Funencodable_char_position.
+
+2002-08-10 Andrew Choi <[email protected]>
+
+ * mac.c (sys_select) [MAC_OSX]: New function.
+
+ * macterm.c (MakeMeTheFrontProcess): New function.
+ (mac_initialize): Call MakeMeTheFrontProcess.
+
+ * s/darwin.h: Define select to sys_select.
+
+2002-08-09 Richard M. Stallman <[email protected]>
+
+ * keyboard.c (make_lispy_event): Test WINDOWSNT, not WINDOWS_NT.
+
+2002-08-09 Gerd Moellmann <[email protected]>
+
+ * xdisp.c (forward_to_next_line_start): Return 0 when reaching the
+ end of the buffer.
+
+2002-08-08 Ken Raeburn <[email protected]>
+
+ * coding.c (Ffind_operation_coding_system): Fix Lisp_Object/int mixup.
+
+ * puresize.h (BASE_PURESIZE): Increase to 910000.
+
+2002-08-08 Kenichi Handa <[email protected]>
+
+ * coding.c (Ffind_operation_coding_system): For write-region, if
+ VISIT is a filename, make it the target.
+
+2002-08-07 Richard M. Stallman <[email protected]>
+
+ * alloc.c (mark_object): Detect long lists for debugging.
+ (mark_object_loop_halt): New variable.
+
+ * s/hpux10.h (C_SWITCH_SYSTEM): #undef it.
+
+ * data.c (Fmake_variable_frame_local): Doc fix.
+
+2002-08-01 David Ponce <[email protected]>
+
+ * w32menu.c (local_heap, local_alloc, local_free): New macros.
+ (malloc_widget_value, free_widget_value)
+ (w32_free_submenu_strings): Use them.
+
+ (push_submenu_start, push_submenu_end, push_left_right_boundary)
+ (push_menu_pane, push_menu_item, single_keymap_panes)
+ (single_menu_item, Fx_popup_menu, menubar_selection_callback)
+ (single_submenu, set_frame_menubar)
+ (w32_menu_show, w32_dialog_show): Use AREF, ASET, ASIZE.
+
+ (Fx_popup_menu): Don't show pop up menu until preceding one is
+ actually cleaned up. Moved UNGCPRO outside #ifdef HAVE_MENUS block.
+
+ * w32menu.c: Changes adapted from xmenu.c
+ (set_frame_menubar): First parse all submenus,
+ then make widget_value trees from them.
+ Don't allocate any widget_value objects
+ until we are done with the parsing.
+ (parse_single_submenu): New function.
+ (digest_single_submenu): New function.
+ (single_submenu): Function deleted, replaced by those two.
+
+2002-08-04 Andrew Choi <[email protected]>
+
+ * macterm.c (XTread_socket): Check that FrontNonFloatingWindow
+ returns a valid window pointer before proceeding for keyDown and
+ autoKey events.
+
+2002-08-03 Andrew Choi <[email protected]>
+
+ * macterm.c (USE_CARBON_EVENTS): New macro.
+ (macCtrlKey, macShiftKey, macMetaKey, macAltKey): New macros.
+ (x_iconify_frame): Call CollapseWindow.
+ (Vmac_reverse_ctrl_meta): New variable.
+ (Vmac_wheel_button_is_mouse_2): New variable.
+ (init_mac_drag_n_drop): New function.
+ (mac_do_receive_drag): New function.
+ (mac_handle_service_event): New function.
+ (init_service_handler): New function.
+ (mac_to_emacs_modifiers): New function.
+ (mac_event_to_emacs_modifiers): New function.
+ (mac_get_mouse_btn): New function.
+ (mac_convert_event_ref): New function.
+ (XTread_socket) [USE_CARBON_EVENTS]: Call ReceiveNextEvent,
+ SendEventToEventTarget, mac_event_to_emacs_modifiers, and
+ mac_get_mouse_btn.
+ (mac_initialize): Call init_mac_drag_n_drop and init_service_handler.
+
+ * keyboard.c: Define Qmouse_wheel, mouse_wheel_syms, and
+ lispy_mouse_wheel_names for MAC_OSX as well as for WINDOWS_NT.
+ (kbd_buffer_get_event): Set used_mouse_menu for MENU_BAR_EVENT and
+ TOOL_BAR_EVENT for MAC_OS as well.
+ (make_lispy_event): Handle MOUSE_WHEEL_EVENT for MAC_OSX as well
+ as for WINDOWS_NT.
+ (syms_of_keyboard): Initialize Qmouse_wheel for MAC_OSX.
+
+ * termhooks.h (event_kind): Define MOUSE_WHEEL_EVENT also for MAC_OSX.
+
+2002-08-03 Gerd Moellmann <[email protected]>
+
+ * xdisp.c (forward_to_next_line_start): Fix a condition that
+ lead to a newline being skipped.
+
+2002-08-02 Andrew Choi <[email protected]>
+
+ * mac.c (syms_of_mac): Defsubr Sx_selection_exists_p.
+
+2002-08-01 Richard M. Stallman <[email protected]>
+
+ * Makefile.in (SOME_MACHINE_OBJECTS): Add fontset.o.
+
+2002-07-31 Andrew Choi <[email protected]>
+
+ * macfns.c: #undef init_process before #define-ing it.
+
+ * s/darwin.h: Define MAC_OS, SYMS_SYSTEM, and OTHER_FILES only if
+ HAVE_CARBON is defined.
+
+2002-07-31 Richard M. Stallman <[email protected]>
+
+ * xmenu.c (set_frame_menubar): First parse all submenus,
+ then make widget_value trees from them.
+ Don't allocate any widget_value objects
+ until we are done with the parsing.
+ (parse_single_submenu): New function.
+ (digest_single_submenu): New function.
+ (single_submenu): Function deleted, replaced by those two.
+
+2002-07-30 Juanma Barranquero <[email protected]>
+
+ * w32proc.c (syms_of_ntproc): Fix docstring of
+ `w32-get-true-file-attributes'.
+
+2002-07-28 Richard M. Stallman <[email protected]>
+
+ * s/hpux8.h (HPUX8): Define this before including hpux.h.
+ (HAVE_SYS_WAIT_H): #define deleted; we let Autoconf decide.
+
+ * s/hpux.h (HAVE_SYS_WAIT_H): The #undef is conditional on HPUX8.
+
+ * keyboard.c (make_lispy_event):
+ Use #ifdef to test USE_TOOLKIT_SCROLL_BARS.
+ Explicitly clear up_modifier in event->modifiers.
+
+2002-07-27 Richard M. Stallman <[email protected]>
+
+ * xterm.h (FRAME_CURSOR_WIDTH): New macro.
+
+ * xterm.c (x_display_and_set_cursor): Check FRAME_CURSOR_WIDTH
+ for bar cursor.
+
+2002-07-26 Kenichi Handa <[email protected]>
+
+ * coding.c (detect_coding_iso2022): While checking a byte sequence
+ for CODING_CATEGORY_MASK_ISO_8_2, if we read one extra byte, check
+ it in the normal loop.
+
+2002-07-24 Gerd Moellmann <[email protected]>
+
+ * xterm.c (expose_overlaps): New function.
+ (expose_window): Use it to fix the display of overlapping rows.
+
+ * xdisp.c (unwind_redisplay): Clear redisplay_updating_p.
+
+2002-07-23 Ken Raeburn <[email protected]>
+
+ * lisp.h (XPNTR): Use NO_UNION_TYPE version for union as well,
+ since it only depends on XUINT.
+
+ * m/alpha.h (BITS_PER_LONG, BITS_PER_EMACS_INT, EMACS_INT,
+ EMACS_UINT, SPECIAL_EMACS_INT, DATA_SEG_BITS,
+ PNTR_COMPARISON_TYPE, VALBITS, MARKBIT, XINT, XUINT, XPNTR):
+ Macros deleted.
+
+ * mem-limits.h (start_of_data): If DATA_START is defined, prefer
+ its value over other approaches.
+ * sysdep.c (start_of_data): Don't define the function if a macro
+ form has been defined.
+
+2002-07-23 Gerd Moellmann <[email protected]>
+
+ * xdisp.c (redisplay_updating_p): New variable.
+ (init_iterator): Don't free realized faces when
+ redisplay_updating_p is set.
+ (redisplay_internal): Set redisplay_updating_p while updating
+ the display.
+
+2002-07-23 Richard M. Stallman <[email protected]>
+
+ * editfns.c (Fmessage): Treat "" like nil.
+
+2002-07-23 Kenichi Handa <[email protected]>
+
+ * xdisp.c (face_before_or_after_it_pos):
+ Call FETCH_MULTIBYTE_CHAR with byte postion, not char position.
+
+2002-07-22 Juanma Barranquero <[email protected]>
+
+ * callproc.c (init_callproc) [DOS_NT]:
+ Initialize Vshared_game_score_directory to nil.
+ (syms_of_callproc) [DOS_NT]: Likewise.
+
+2002-07-22 Gerd Moellmann <[email protected]>
+
+ * xdisp.c (display_line): Replace an abort with xassert.
+
+2002-07-21 Richard M. Stallman <[email protected]>
+
+ * xdisp.c (redisplay_window): Don't test BEG_UNCHANGED
+ and END_UNCHANGED when setting buffer_unchanged_p.
+ Use current_matrix_up_to_date_p to decide whether to use
+ try_cursor_movement.
+
+ * config.in (HAVE_SHARED_GAME_DIR): Undef deleted.
+
+ * epaths.in (PATH_GAME): New macro, edited by ../Makefile.in.
+
+ * callproc.c (init_callproc): Set up Vshared_game_score_directory.
+ Set to nil if dir does not exist.
+ (syms_of_callproc): Init unconditionally and simply.
+
+ * buffer.c (Fbuffer_list): Doc fix.
+
+2002-07-21 Ken Raeburn <[email protected]>
+
+ * sysdep.c (end_of_text, end_of_data): Unused functions deleted.
+
+ * buffer.c (mmap_realloc): When shrinking, make sure number of
+ pages to unmap is rounded towards zero.
+
+ * m/mips-siemens.h (XSETUINT, XSETPNTR): Unused macros deleted.
+ (XSETINT): Deleted.
+
+ * m/att3b.h (XINT): Don't define.
+ (VALBITS, VALMASK, XTYPE): Deleted.
+ (DATA_SEG_BITS): Define.
+ * m/gec63.h (VALBITS, VALAMASK, XTYPE, XSETTYPE, XPNTR, XSET,
+ ARRAY_MARK_FLAG): Deleted.
+ (DATA_SEG_BITS): Define.
+ * m/pfa50.h (VALBITS, VALMASK, XTYPE): Deleted.
+ (DATA_SEG_BITS): Define.
+
+2002-07-20 Richard M. Stallman <[email protected]>
+
+ * print.c (print_error_message): New args CONTEXT and CALLER.
+ Calls changed.
+
+ * lisp.h (print_error_message): Declare new args.
+
+ * keyboard.c (cmd_error_internal): Pass Vsignaling_function
+ and CONTEXT to print_error_message, don't print them here.
+ For a Quit, don't use Vsignaling_function.
+ Call message_log_maybe_newline.
+
+ * Makefile.in (xsmfns.o): Don't depend on lisp.h.
+
+2002-07-20 Kim F. Storm <[email protected]>
+
+ * xdisp.c (redisplay_window): Test MODIFF to set buffer_unchanged_p.
+
+2002-07-19 Ken Raeburn <[email protected]>
+
+ * bytecode.c (struct byte_stack): Pointers into byte string now
+ point to const.
+ * callproc.c (Fcall_process): Make NEW_ARGV array hold pointer to
+ const.
+ * charset.h (BCOPY_SHORT): Source pointer now points to const.
+ * coding.c (encode_eol, detect_coding, detect_eol):
+ (decode_coding, encode_coding, detect_coding_system):
+ Source strings now treated as const.
+ (decode_coding_string, encode_coding_string): Use STRING_COPYIN to
+ modify Lisp string contents.
+ * coding.h (decode_coding, encode_coding, detect_coding,
+ detect_eol): Declarations updated.
+ * composite.c (compose_chars_in_text): Treat Lisp string contents
+ as const.
+ * dispnew.c (safe_bcopy): Source pointer now points to const.
+ * lisp.h (STRING_COPYIN): New macro.
+ (detect_coding_system, safe_bcopy, temp_output_buffer_setup):
+ (internal_with_output_to_temp_buffer): Declarations updated.
+ * print.c (temp_output_buffer_setup):
+ (internal_with_output_to_temp_buffer): Buffer name argument is now
+ pointer to const.
+ * sound.c (struct sound_device): Function pointer field "write"
+ buffer argument now points to const.
+ (vox_write): Buffer argument points to const.
+ * syntax.c (Fstring_to_syntax, skip_chars): Treat Lisp string
+ contents as const.
+ * sysdep.c (emacs_write): Buffer pointer now const.
+ * term.c (encode_terminal_code): Buffer pointer now const.
+ * xfaces.c (may_use_scalable_font_p): Argument now points to const.
+ (x_face_list_fonts, x_update_menu_appearance):
+ (hash_string_case_insensitive): Treat Lisp string contents as const.
+
+2002-07-19 Juanma Barranquero <[email protected]>
+
+ * xdisp.c (syms_of_xdisp): Remove redundant deprecation info.
+
+ * fileio.c (syms_of_fileio): Likewise.
+ (Ffile_name_as_directory): Fix argument name in docstring.
+ (file_name_as_directory): Use literal '/' instead of DIRECTORY_SEP.
+
+2002-07-18 Richard M. Stallman <[email protected]>
+
+ * data.c (Fdefalias): Doc fix.
+
+2002-07-17 Dave Love <[email protected]>
+
+ * intervals.h (text_property_stickiness): Use P_.
+
+ * ccl.c: Remove `emacs' conditionals.
+ (ccl_backtrace_table): Fix size spec.
+ (ccl_driver): Fix type errors.
+
+2002-07-16 Ken Raeburn <[email protected]>
+
+ * alloc.c (xstrdup, make_string, make_unibyte_string)
+ (make_multibyte_string, build_string): String pointer args now
+ point to const.
+ * charset.c (find_charset_in_text, c_string_width):
+ (chars_in_text, multibyte_chars_in_text, parse_str_as_multibyte):
+ * fileio.c (report_file_error):
+ * insdel.c (copy_text, count_size_as_multibyte, insert_1):
+ (count_combining_before, count_combining_after, insert_1_both):
+ (insert, insert_and_inherit, insert_string):
+ (insert_before_markers, insert_before_markers_and_inherit):
+ * lread.c (intern, oblookup, hash_string):
+ * minibuf.c (temp_echo_area_glyphs):
+ * search.c (fast_c_string_match_ignore_case):
+ * sysdep.c (emacs_open, set_file_times):
+ * xfaces.c (xstricmp):
+ * xdisp.c (store_frame_title, string_char_and_length):
+ (message_dolog, message2, message2_nolog, set_message): Likewise.
+ (set_message_1): Cast message string argument to const pointer.
+ * editfns.c (general_insert_function): Insertion function now
+ takes pointer to const for input data.
+ * charset.h (find_charset_in_text, c_string_width):
+ (parse_str_as_multibyte): Declarations updated.
+ * dispextern.h (xstricmp): Declaration updated.
+ * lisp.h (chars_in_text, multibyte_chars_in_text, copy_text):
+ (count_size_as_multibyte, count_combining_before):
+ (count_combining_after, insert_1, insert_1_both, message_dolog):
+ (insert, insert_and_inherit, insert_before_markers)
+ (insert_before_markers_and_inherit, set_message, message2):
+ (message2_dolog, build_string, make_string, make_unibyte_string):
+ (make_multibyte_string, intern, oblookup, report_file_error):
+ (fast_c_string_match_ignore_case, temp_echo_area_glyphs):
+ (emacs_open, xstrdup): Declarations updated.
+ * systime.h (set_file_times): Declaration updated.
+
+ * charset.c (find_charset_in_text, lisp_string_width): Use const
+ for pointer to lisp string data.
+ * charset.h (FETCH_STRING_CHAR_ADVANCE):
+ (FETCH_STRING_CHAR_ADVANCE_NO_CHECK):
+ * coding.c (Ffind_coding_systems_region_interval):
+ * fileio.c (Ffile_name_directory, Ffile_name_nondirectory):
+ (Fmake_directory_internal, Fdelete_directory):
+ (Ffile_name_absolute_p, Fwrite_region, double_dollars):
+ * fontset.c (font_family_registry, fs_query_fontset):
+ (list_fontsets):
+ * frame.c (Fframe_parameter):
+ * keyboard.c (cmd_error_internal):
+ * keymap.c (Fdescribe_buffer_bindings):
+ * lread.c (complete_filename_p, openp):
+ * minibuf.c (Fminibuffer_complete_word):
+ * xdisp.c (string_pos_nchars_ahead, init_from_display_pos):
+ (face_before_or_after_it_pos, next_element_from_string):
+ (get_overlay_arrow_glyph_row, display_mode_element):
+ (decode_mode_spec_coding):
+ * xterm.c (same_x_server): Likewise.
+
+ * buffer.c (reset_buffer_local_variables): Delete "#if 0"
+ settings of non-existent fields.
+
+ * editfns.c (Fstring_to_char): Don't use XSTRING/XSETSTRING to
+ copy a lisp value.
+
+ * lread.c (Fintern_soft): Use string macros instead of
+ Lisp_String fields.
+ * keyboard.c (echo_char, parse_modifiers_uncached):
+ (parse_solitary_modifier, Fexecute_extended_command): Likewise.
+ * textprop.c (validate_interval_range, interval_of): Likewise.
+
+ * fontset.c (Fset_fontset_font): Use SDATA instead of XSTRING()->data.
+
+ * charset.h (FETCH_STRING_CHAR_ADVANCE)
+ (FETCH_STRING_CHAR_ADVANCE_NO_CHECK): Use SBYTES instead of
+ XSTRING()->size_byte.
+
+ * lisp.h (SDATA, SREF): Produce rvalue.
+ (SSET): New macro.
+ * alloc.c (make_event_array): Use SSET for storing into a string.
+ * buffer.c (Fother_buffer): Use SREF when retrieving a byte from
+ a string.
+ * casefiddle.c (casify_object): Use SSET.
+ * charset.h (FETCH_STRING_CHAR_ADVANCE)
+ (FETCH_STRING_CHAR_ADVANCE_NO_CHECK): Use SDATA when getting
+ address of string contents.
+ * data.c (Faref): Use SDATA.
+ (Faset): Use SDATA, SSET.
+ * dired.c (directory_files_internal): Use SSET.
+ * fileio.c (Fmake_symbolic_link, Fexpand_file_name): Use SSET.
+ (Fread_file_name): Use SREF, SSET.
+ * fns.c (concat): Use SSET.
+ (concat, Fdelete): Use SDATA.
+ * insdel.c (insert_from_string_1): Use SDATA.
+ * keyboard.c (Fevent_convert_list): Use SREF.
+ * lread.c (Fload): Use SDATA, SSET.
+ * macfns.c (validate_x_resource_name): Use SSET.
+ * process.c (status_message): Use SSET.
+ * search.c (wordify): Use SDATA.
+ (Freplace_match): Use SREF.
+ * w32fns.c (validate_x_resource_name): Use SSET.
+ * xfns.c (validate_x_resource_name): Use SSET.
+ * xterm.c (x_catch_errors, x_clear_errors): Use SSET.
+
+2002-07-16 Richard M. Stallman <[email protected]>
+
+ * s/hpux11.h (USG_SUBTTY_WORKS): Defined.
+
+ * xdisp.c (reconsider_clip_changes):
+ Don't test prevent_redisplay_optimizations_p.
+ (redisplay_internal): Test prevent_redisplay_optimizations_p
+ along with clip_changed in some cases.
+ (try_window_id): Likewise.
+ (redisplay_window): New local var buffer_unchanged_p.
+
+ * keyboard.c (cmd_error) [HAVE_X_WINDOWS]: Maybe call cancel_houglass.
+
+ * process.c (create_process): Test USG_SUBTTY_WORKS.
+ (process_send_signal): Clean up handling of GID.
+ Detect errors in ioctls meant to set GID.
+
+ * window.c (temp_output_buffer_show):
+ Don't set prevent_redisplay_optimizations_p.
+
+2002-07-15 Juanma Barranquero <[email protected]>
+
+ * eval.c (Fdefvaralias): Add docstring argument.
+
+2002-07-15 Ken Raeburn <[email protected]>
+
+ * lisp.h (STRING_INTERVALS): Produce rvalue.
+ (STRING_SET_INTERVALS): New macro.
+ * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): Use it.
+ * fns.c (Fstring_as_multibyte): Likewise.
+ * intervals.c (balance_possible_root_interval, delete_interval)
+ (create_root_interval, copy_intervals_to_string): Likewise.
+ * textprop.c (set_text_properties): Likewise. Use NULL_INTERVAL
+ instead of 0.
+
+2002-07-14 Ken Raeburn <[email protected]>
+
+ * lisp.h (STRING_SET_CHARS): New macro.
+ (SCHARS, SBYTES): Produce rvalues.
+ * dired.c (directory_files_internal): Use STRING_SET_CHARS.
+ * fns.c (concat): Likewise.
+ * lread.c (read_vector): Likewise.
+
+ * lisp.h (SMBP): Delete. All uses changed to STRING_MULTIBYTE.
+ (STRING_SET_UNIBYTE): New macro.
+ (SET_STRING_BYTES): Delete. Callers (all of which supplied a
+ length of -1) changed to use STRING_SET_UNIBYTE.
+ * abbrev.c, alloc.c, buffer.c, bytecode.c, callint.c, callproc.c,
+ casefiddle.c, category.c, ccl.c, charset.c, charset.h, coding.c,
+ composite.c, data.c, dired.c, dispnew.c, disptab.h, doc.c,
+ dosfns.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fn.c,
+ fontset.c, frame.c, indent.c, insdel.c, intervals.c, keyboard.c,
+ keymap.c, lread.c, mac.c, macfns.c, macmenu.c, macterm.c,
+ minibuf.c, msdos.c, print.c, process.c, search.c, sound.c,
+ sunfns.c, syntax.c, syntax.h, sysdep.c, textprop.c, undo.c,
+ w16select.c, w32.c, w32fns.c, w32menu.c, w32proc.c, w32select.c,
+ w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c,
+ xselect.c, xsmfns.c, xterm.c: Most uses of XSTRING combined with
+ STRING_BYTES or indirection changed to SCHARS, SBYTES,
+ STRING_INTERVALS, SREF, SDATA; explicit size_byte references left
+ unchanged for now.
+
+2002-07-13 Kim F. Storm <[email protected]>
+
+ * keyboard.c (command_loop_1): Invert check on Vmemory_full.
+
+2002-07-12 Richard M. Stallman <[email protected]>
+
+ * fileio.c (Fwrite_region): Doc fix.
+
+ * print.c (print_error_message): Don't handle Vsignaling_function here.
+
+ * keyboard.c (cmd_error_internal): Handle Vsignaling_function here.
+ (command_loop_1): Avoid certain actions after memory-full error.
+
+ * eval.c (Fsignal): Don't call cancel_hourglass.
+ For a memory-full error, don't call Vsignal_hook_function
+ and don't set Vsignaling_function.
+
+ * process.c (process_send_signal): Add abort call.
+
+2002-07-11 Markus Rost <[email protected]>
+
+ * keymap.c (Fkey_binding): Fix typo.
+
+2002-07-11 Richard M. Stallman <[email protected]>
+
+ * alloc.c (Vmemory_full): New variable.
+ (Vmemory_signal_data): Rename from memory_signal_data.
+ Uses changed.
+ (syms_of_alloc): Defvar them.
+ (memory_full, buffer_memory_full): Set Vmemory_full.
+
+ * lisp.h (Vmemory_full): Add declaration.
+ (current_column, indented_beyond_p): Change declaration.
+
+ * indent.c (last_known_column): Declare as double, not float.
+ (current_column, current_column_1, string_display_width)
+ (position_indentation): Return `double'.
+ (indented_beyond_p): Arg `column' is `double'. Callers changed.
+
+ * xdisp.c (message_dolog): Do nothing if Vmemory_full is non-nil.
+ (back_to_previous_visible_line_start)
+ (reseat_at_next_visible_line_start, next_element_from_buffer):
+ Use `double', not `float', when calling indented_beyond_p.
+
+ * s/hpux11.h (BROKEN_SA_RESTART): Define.
+
+ * sysdep.c (sys_signal): Test BROKEN_SA_RESTART.
+
+2002-07-11 Juanma Barranquero <[email protected]>
+
+ * alloc.c, buffer.c, bytecode.c, callint.c, callproc.c, coding.c,
+ * composite.c, dired.c, dispnew.c, editfns.c, emacs.c, eval.c,
+ * fileio.c, fns.c, insdel.c, keyboard.c, keymap.c, lread.c, macfns.c,
+ * macmenu.c, macros.c, minibuf.c, print.c, process.c, sound.c,
+ * textprop.c, w32fns.c, w32menu.c, window.c, xfaces.c, xfns.c,
+ * xmenu.c, xselect.c, xterm.c: Use SPECPDL_INDEX wherever makes sense.
+
+2002-07-10 Juanma Barranquero <[email protected]>
+
+ * lisp.h (SPECPDL_INDEX): Rename from BINDING_STACK_SIZE.
+ All callers changed.
+
+2002-07-09 Stefan Monnier <[email protected]>
+
+ * data.c (Fdefalias): Add an optional `docstring' argument.
+ (set_internal, Fsetq_default): Use XCAR/XCDR.
+
+ * composite.c (HASH_VALUE, HASH_KEY):
+ * ccl.c (HASH_VALUE): Remove (it's in lisp.h now).
+
+2002-07-09 Kenichi Handa <[email protected]>
+
+ * callproc.c (Fcall_process): Fix previous change.
+
+2002-07-07 Stefan Monnier <[email protected]>
+
+ * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
+ Add support for hash-tables.
+ (Ftry_completion): Return t even if the string appears multiple times.
+
+ * fns.c (Fnconc): Use XCDR.
+ (Fprovide): Use CONSP and XCDR.
+ (HASH_KEY, HASH_VALUE, HASH_NEXT, HASH_HASH, HASH_INDEX)
+ (HASH_TABLE_SIZE): Delete: moved to lisp.h.
+ (Fmake_hash_table): Accept `:size nil'.
+ (Fmakehash): Delete: moved to subr.el.
+ (syms_of_fns): Don't defsubr makehash.
+
+ * lisp.h (HASH_KEY, HASH_VALUE, HASH_NEXT, HASH_HASH, HASH_INDEX)
+ (HASH_TABLE_SIZE): Move from fns.c.
+
+2002-07-07 Richard M. Stallman <[email protected]>
+
+ * xdisp.c (make_cursor_line_fully_visible): Don't try short scrolls.
+ Instead just return 0 when there is something to be done.
+ (try_scrolling): If make_cursor_line_fully_visible returns 0,
+ retry scrolling as if cursor were off the bottom.
+ (try_cursor_movement): If make_cursor_line_fully_visible returns 0,
+ return CURSOR_MOVEMENT_MUST_SCROLL.
+ (redisplay_window): If make_cursor_line_fully_visible returns 0,
+ go to try_to_scroll.
+
+ * buffer.c (Fbuffer_local_value): Store current value into its binding
+ so we get the up-to-date value for the binding that is loaded.
+
+ * eval.c (Fdefmacro): Doc fix.
+
+2002-07-05 Dave Love <[email protected]>
+
+ * keyboard.c (read_key_sequence): Set initial_idleness_start_time
+ correctly.
+
+ * ccl.c (Vtranslation_hash_table_vector, GET_HASH_TABLE)
+ (HASH_VALUE, CCL_LookupIntConstTbl, CCL_LookupCharConstTbl): New.
+ (ccl_driver): Add cases for CCL_LookupIntConstTbl,
+ CCL_LookupCharConstTbl.
+ (syms_of_ccl): Defvar translation-hash-table-vector.
+
+2002-07-05 Pavel Jan,Am(Bk <[email protected]>
+
+ * xdisp.c: Remove unused variable `face'.
+
+2002-07-04 Juanma Barranquero <[email protected]>
+
+ * keyboard.c (post_command_idle_hook): Remove redundant (and inexact)
+ obsolescence information.
+
+2002-07-03 Andrew Choi <[email protected]>
+
+ * macterm.c (x_list_fonts): Fix comment. Cache fonts matching
+ pattern. Search cache first.
+ (init_font_name_table): Also add entry for jisx0201.1976-0 coding
+ for Japanese font.
+ (XLoadQueryFont): Use it.
+
+2002-07-02 Richard M. Stallman <[email protected]>
+
+ * keymap.c (Fdefine_key): Doc fix.
+
+ * xterm.c (x_term_init): Turn off polling around XtOpenDisplay.
+
+2002-07-02 Juanma Barranquero <[email protected]>
+
+ * keymap.c (syms_of_keymap): Fix typo.
+
+2002-07-01 Andrew Choi <[email protected]>
+
+ * s/darwin.h: Define POSIX_SIGNALS.
+
+ * macterm.c (do_ae_open_documents) [MAC_OSX]: Call FSpMakeFSRef
+ and FSRefMakePath to convert FSSpec returned with Apple Event to
+ Posix pathname.
+ (mac_initialize) [TARGET_API_MAC_CARBON]:
+ Call init_required_apple_events and disable the `Quit' menu item
+ provided automatically by the Carbon Toolbox.
+
+2002-07-01 Dave Love <[email protected]>
+
+ * keyboard.c (kbd_buffer_store_event): Fix interrupt_signal decl
+ for K&R.
+
+ * xterm.c: Fix prototype for K&R.
+
+ * term.c (costs_set): Declare static, non-initialized for pcc.
+
+2002-07-01 Richard M. Stallman <[email protected]>
+
+ * keyboard.c (timer_last_idleness_start_time): New variable.
+ (timer_start_idle): Set that.
+ (read_key_sequence): Use that to reset timer_idleness_start_time
+ to previous value.
+
+ * window.c (Frecenter): With arg, set optional_new_start.
+
+ * xdisp.c (redisplay_internal): Make optional_new_start really work.
+
+ * minibuf.c (Fminibuffer_complete_and_exit): Move to end of
+ buffer for completion.
+
+2002-06-29 Ken Raeburn <[email protected]>
+
+ * xdisp.c (store_mode_line_string): Lisp_Object/int mixup.
+
+2002-06-28 Jan Dj,Ad(Brv <[email protected]>
+
+ * keyboard.c (readable_filtered_events): New function that filters
+ FOCUS_IN_EVENT depending on parameter.
+ (readable_events): Calls readable_filtered_events, not filtering
+ FOCUS_IN_EVENT.
+ (get_filtered_input_pending): New function, filtering parameter passed
+ to readable_filtered_events.
+ (get_input_pending): Calls get_filtered_input_pending, not filtering
+ FOCUS_IN_EVENT.
+ (Finput_pending_p): Calls get_filtered_input_pending, DO filter
+ FOCUS_IN_EVENT.
+
+ * xterm.h (struct x_output): Add focus_state.
+
+ * xterm.c (x_focus_changed): New function.
+ (x_detect_focus_change): New function.
+ (XTread_socket): Call x_detect_focus_change for FocusIn/FocusOut
+ EnterNotify and LeaveNotify to track X focus changes.
+
+2002-06-28 Andreas Schwab <[email protected]>
+
+ * lisp.h: Remove duplicate declaration of code_convert_string_norecord.
+
+2002-06-27 Kim F. Storm <[email protected]>
+
+ * xdisp.c (mode_line_string_list, mode_line_string_face)
+ (mode_line_string_face_prop): New variables.
+ (store_mode_line_string): New function.
+ (display_mode_element): Use store_mode_line_string to
+ add mode-line string elements to mode_line_string_list
+ when mode_line_string_list is non-nil.
+ (Fformat_mode_line): Now returns propertized string by
+ default. New arg NO-PROPS to ignore properties.
+ (decode_mode_spec): Only add two dashes for %- in propertized
+ mode-line string.
+ (syms_of_xdisp): Init and staticpro mode_line_string_list.
+
+2002-06-27 Stefan Monnier <[email protected]>
+
+ * minibuf.c (minibuffer_completion_contents): Add return type.
+
+2002-06-27 Juanma Barranquero <[email protected]>
+
+ * charset.c (Fchar_bytes): Remove obsolescence info from docstring.
+
+2002-06-26 Juanma Barranquero <[email protected]>
+
+ * fileio.c (read_file_name_cleanup): Add missing return.
+
+2002-06-26 Richard M. Stallman <[email protected]>
+
+ * window.c (Frecenter): Don't set force_start flag.
+
+ * minibuf.c (do_completion, Fminibuffer_complete_word)
+ (Fminibuffer_completion_help): Complete just the text before point.
+ (minibuffer_completion_contents): New function.
+
+ * buffer.c (Fbury_buffer): Use frames_discard_buffer.
+
+ * frame.c (frames_bury_buffer): Function deleted.
+
+2002-06-25 Miles Bader <[email protected]>
+
+ * callint.c (Fcall_interactively): When checking to see if doprnt hit
+ the end of callint_message, allow for a terminating '\0'.
+
+2002-06-24 Juanma Barranquero <[email protected]>
+
+ * w32select.c: Include composite.h.
+
+ * w16select.c: Likewise.
+
+2002-06-24 Kenichi Handa <[email protected]>
+
+ * callproc.c (Fcall_process): If code detection is necessary,
+ call detect_coding directly here.
+
+ * coding.c (detect_eol): Preserve coding->cmp_data.
+
+ * w16select.c (Fw16_get_clipboard_data):
+ * w32fns.c (w32_to_x_font):
+ * w32select.c (Fw32_get_clipboard_data):
+ * xselect.c (selection_data_to_lisp_data):
+ * xterm.c (XTread_socket): Disable composition handling.
+
+2002-06-24 Stefan Monnier <[email protected]>
+
+ * print.c (temp_output_buffer_setup): Kill all local variables.
+
+2002-06-22 Stefan Monnier <[email protected]>
+
+ * lread.c (Fread): Remove redundant and imprecise declaration.
+
+ * xfns.c (check_x_display_info): Use check_x_frame.
+
+ * .gdbinit (xprintsym): Use the new `xname' field.
+ (xsymbol): Use it.
+
+2002-06-22 Jason Rumney <[email protected]>
+
+ * w32fns.c (file_dialog_callback): New function.
+ (Fx_file_dialog): Allow selecting directories as well as files.
+
+2002-06-21 Pavel Jan,Am(Bk <[email protected]>
+
+ * m/pmax.h (START_FILES): Define START_FILES for NetBSD and
+ OpenBSD. Add support for mipseb-*-netbsd* machines.
+
+2002-06-17 Andrew Choi <[email protected]>
+
+ * macterm.c (mac_scroll_area): Set foreground and backcolor to
+ black and white before scrolling. Restore frame background and
+ foreground color after scrolling.
+ (do_window_update): Call XClearWindow before calling expose_frame.
+ (make_mac_frame): Don't set FRAME_BACKGROUND_PIXEL and
+ FRAME_FOREGROUND_PIXEL of frame.
+
+ * macterm.c (XTread_socket): If Vmac_command_key_is_meta is nil,
+ test Mac command key as <ALT> key.
+
+2002-06-17 Stefan Monnier <[email protected]>
+
+ * window.c (Fset_window_configuration): Lisp_Object/int mixup.
+
+ * keyboard.c (read_key_sequence): Be more careful with first_unbound.
+ Lookup keys in function-key-map immediately so that key-translation-map
+ can be applied earlier.
+ Remove function_key_possible and key_translation_possible, replaced
+ by checking `keytran_start < t'.
+
+ * .gdbinit (xsymbol): Use the new `xname' field.
+
+2002-06-17 Andrew Choi <[email protected]>
+
+ * macterm.c (XTread_socket): If Vmac_command_key_is_meta is nil,
+ test Mac command key as <ALT> key.
+
+ * mac.c (do_applescript): Call initialize_applescript if necessary
+ when first called. Dispose of result_desc only when there is no error.
+ (Fdo_applescript): Use %d format specifier instead of %ld.
+
+2002-06-16 Andrew Choi <[email protected]>
+
+ * macterm.c (XTread_socket): Call FrontNonFloatingWindow instead
+ of FrontWindow for cases keyDown and autoKey.
+
+ * fontset.c (syms_of_fontset) [MAC_OS]: Set ASCII font of
+ Vdefault_fontset to Monaco with mac-roman coding.
+
+ * mac.c, macfns.c, macmenu.c, macterm.c: Undefine and redefine
+ init_process before and after inclusion of Carbon/Carbon.h, resp.
+
+ * macterm.c (x_new_font): Set font for normal_gc, reverse_gc, and
+ cursor_gc.
+ (add_font_name_table_entry): New function.
+ (init_font_name_table): Use add_font_name_table_entry; add italic,
+ bold, and bold-italic entries for truetype fonts.
+
+ * xfaces.c (init_frame_faces) [MAC_OS]: Call realize_basic_faces
+ for Mac too.
+ (try_font_list) [MAC_OS]: If no font matches given registry, try
+ fonts with any registry matching face_family.
+ (realize_x_face) [MAC_OS]: Remove old ad-hoc fix to load font here.
+
+ * s/darwin.h: If autoconf detects the Ncurses library, define
+ LIBS_TERMCAP to -lncurses to use it.
+
+2002-06-16 Eli Zaretskii <[email protected]>
+
+ * strftime.c [__hpux]: Include sys/_mbstate_t.h.
+
+2002-06-15 Richard M. Stallman <[email protected]>
+
+ * window.c (Fset_window_configuration): Explicitly preserve
+ the point value that new_current_buffer had at the start.
+
+2002-06-14 Juanma Barranquero <[email protected]>
+
+ * composite.c (Fcompose_region_internal, Fcompose_string_internal):
+ Fix typos.
+
+2002-06-14 Kim F. Storm <[email protected]>
+
+ * insdel.c (insert_1_both, insert_from_string_1)
+ (insert_from_buffer_1): Recalculate END_UNCHANGED in case the
+ insert happened in the end_unchanged region. Otherwise, the
+ redisplay may be confused and duplicate the last line in the
+ buffer [seen after save-buffer when require-final-newline==t].
+
+2002-06-13 Jason Rumney <[email protected]>
+
+ * w32.c (init_environment): Remove EMACSLOCKDIR.
+ (stat): Swap _S_IFDIR and _S_IFREG.
+
+2002-06-13 Pavel Jan,Am(Bk <[email protected]>
+
+ * keyboard.c, macterm.c, macmenu.c, msdos.c, sysdep.c
+ * termhooks.h, xmenu.c, xsmfns.c, xterm.h, xterm.c, w32term.c,
+ * w32menu.c, w32inevt.c: Rename enum event_kind as follows:
+ ascii_keystroke to ASCII_KEYSTROKE_EVENT, multibyte_char_keystroke
+ to MULTIBYTE_CHAR_KEYSTROKE_EVENT, non_ascii_keystroke to
+ NON_ASCII_KEYSTROKE_EVENT, timer_event to TIMER_EVENT, mouse_click
+ to MOUSE_CLICK_EVENT, mouse_wheel to MOUSE_WHEEL_EVENT,
+ language_change_event to LANGUAGE_CHANGE_EVENT, scroll_bar_click
+ to SCROLL_BAR_CLICK_EVENT, w32_scroll_bar_click to
+ W32_SCROLL_BAR_CLICK_EVENT, selection_request_event to
+ SELECTION_REQUEST_EVENT, selection_clear_event to
+ SELECTION_CLEAR_EVENT, buffer_switch_event to BUFFER_SWITCH_EVENT,
+ delete_window_event to DELETE_WINDOW_EVENT, iconify_event to
+ ICONIFY_EVENT, deiconify_event to DEICONIFY_EVENT,
+ menu_bar_activate_event to MENU_BAR_ACTIVATE_EVENT, drag_n_drop to
+ DRAG_N_DROP_EVENT, save_session_event to SAVE_SESSION_EVENT and
+ no_event to NO_EVENT.
+
+2002-06-12 Pavel Jan,Am(Bk <[email protected]>
+
+ * macmenu.c: Remove declaration of Qmouse_click and Qevent_kind.
+
+2002-06-12 Stefan Monnier <[email protected]>
+
+ * intervals.c (textget): Don't forget to `return'.
+ (lookup_char_property): Use XCAR/XCDR.
+
+2002-06-12 Juanma Barranquero <[email protected]>
+
+ * xdisp.c (Fformat_mode_line): Fix typo.
+
+2002-06-12 Kim F. Storm <[email protected]>
+
+ * xdisp.c (Fformat_mode_line): New function.
+ (frame_title_buf, frame_title_buf_end, frame_title_ptr)
+ (store_frame_title_char, store_frame_title): Use unconditionally.
+ (init_xdisp): Defsubr Fformat_mode_line.
+ Initialize frame_title_buf etc. unconditionally.
+
+2002-06-11 Stefan Monnier <[email protected]>
+
+ * keyboard.c (read_key_sequence):
+ Remove prev_(fkey|keytran}_(map|start|end) since we don't want to pass
+ things through those maps after downcasing events.
+ Enforce that keytran_end <= fkey_start, i.e. that key-translation-map
+ applies after function-key-map.
+ Make sure that keytran can be done in the middle in the sequence.
+ Be careful not to throw away events past the one we downcase.
+
+ * lread.c (read_integer): Remove unused var `tem'.
+ (read1): Fix int/Lisp_Object mixup.
+
+ * xfaces.c (tty_lookup_color): Type bool/Lisp_Object mismatch fixed.
+
+2002-06-11 Richard M. Stallman <[email protected]>
+
+ * keyboard.c (readable_events): Ignore any number of
+ FOCUS_IN_EVENT events and return 0 if nothing else in buffer.
+
+2002-06-09 Miles Bader <[email protected]>
+
+ * xfaces.c (Ftty_supports_face_attributes_p): New function.
+ (parse_rgb_list, tty_lookup_color): New functions.
+ (tty_defined_color): Use `tty_lookup_color' to do all the work.
+ (color_distance, Fcolor_distance): New functions.
+ (TTY_SAME_COLOR_THRESHOLD): New macro.
+ (Qtty_color_standard_values): New variable.
+ (syms_of_xfaces): Initialize new vars & functions.
+
+2002-06-08 Colin Walters <[email protected]>
+
+ * textprop.c (Vchar_property_alias_alist): New variable.
+ (syms_of_textprop) <Vchar_property_alias_alist>: DEFVAR_LISP.
+
+ * intervals.c (lookup_char_property): New function for looking up
+ overlay and text properties, created from textget.
+ (textget): Use it.
+
+ * intervals.h (lookup_char_property): Declare.
+ (Vchar_property_alias_alist): Declare.
+
+ * buffer.c (Foverlay_get): Use lookup_char_property.
+
+2002-06-07 Sam Steingold <[email protected]>
+
+ * xselect.c (lisp_data_to_selection_data): Fix last change:
+ *data_ret is not a Lisp string, while unibyte_string is.
+
+2002-06-07 Eli Zaretskii <[email protected]>
+
+ * xselect.c (lisp_data_to_selection_data): Fix last change:
+ set size_ret.
+
+2002-06-07 Andreas Schwab <[email protected]>
+
+ * m/amdx86-64.h: New file.
+
+2002-06-05 Eli Zaretskii <[email protected]>
+
+ * fns.c (Fstring_make_unibyte): Doc fix.
+
+ * xselect.c (lisp_data_to_selection_data): If the requested type
+ is STRING, call string_make_unibyte to encode the selected text
+ as a string.
+
+ * window.c (Fset_window_hscroll): Doc fix.
+
+2002-06-05 Pavel Jan,Am(Bk <[email protected]>
+
+ * fileio.c (choose_write_coding_system):
+ Call select-safe-coding-system properly.
+
+2002-06-03 Richard M. Stallman <[email protected]>
+
+ * xdisp.c (message_with_string): Error if STRING is not a string.
+
+ * fns.c (md5): Pass FILE arg to Vselect_safe_coding_system_function.
+
+ * fileio.c (choose_write_coding_system): Pass FILE arg to
+ Vselect_safe_coding_system_function.
+
+2002-06-03 Ken Raeburn <[email protected]>
+
+ * buffer.c (fix_overlays_before): Fix list-walking bug in 05-19 change.
+
+2002-06-02 Thien-Thi Nguyen <[email protected]>
+
+ * bytecode.c (Fbyte_code): Cast `current_column' return value to int.
+ * cmds.c (Fdelete_backward_char, internal_self_insert): Likewise.
+ * keymap.c (describe_command): Likewise.
+ * minibuf.c (read_minibuf): Likewise.
+
+ * xdisp.c (redisplay_internal, redisplay_window, decode_mode_spec):
+ Cast `current_column' return value to int.
+ (back_to_previous_visible_line_start)
+ (reseat_at_next_visible_line_start, next_element_from_buffer):
+ Cast `indented_beyond_p' 3rd arg to float.
+
+ * indent.c (last_known_column): Now a float.
+ (current_column_1, position_indentation, current_column)
+ (string_display_width): Return float.
+ (Fcurrent_column): Cast `current_column' return value to int.
+ (Fcurrent_indentation): Cast `position_indentation' retval to int.
+ (indented_beyond_p): Third arg now a float.
+ (compute_motion, vmotion): Cast `indented_beyond_p' 3rd arg to float.
+
+ * lisp.h (current_column): Now returns float.
+ (indented_beyond_p): 3rd arg now a float.
+
+2002-05-31 Eli Zaretskii <[email protected]>
+
+ * xfns.c (x_encode_text): Return stringp non-NULL if coding_system
+ is Qcompound_text_with_extensions.
+
+ * xselect.c (lisp_data_to_selection_data): Always set selection
+ type as string if x_encode_text returns streingp non-NULL.
+
+ * s/netbsd.h: Include /usr/pkg in the run time shared library path.
+
+2002-05-30 Richard M. Stallman <[email protected]>
+
+ * window.c (Fset_window_configuration): Correct the handling
+ of point in current buffer, to work with multiple windows.
+
+2002-05-29 Colin Walters <[email protected]>
+
+ * lread.c (Fread_from_string): Don't depend on order of evaluation
+ for C function parameters.
+
+2002-05-28 Richard M. Stallman <[email protected]>
+
+ * xterm.c (x_display_and_set_cursor): Change the cursor in the same
+ way for blinked-off state and for a nonselected window.
+
+ * window.c (window_scroll_pixel_based): Don't call Fbolp;
+ instead, see if the new start pos is at beginning of line.
+
+ * fileio.c (Fwrite_region): If START is a string, don't
+ make any annotations.
+
+ * eval.c (syms_of_eval): Doc fix.
+
+2002-05-28 Colin Walters <[email protected]>
+
+ * emacs.c (USAGE1): Add --no-splash.
+ (standard_args): Ditto.
+
+2002-05-28 Colin Walters <[email protected]>
+
+ * lread.c (readchar_count): New variable.
+ (readchar): Increment it.
+ (unreadchar): Decrement it.
+ (read_multibyte): Decrement it.
+ (Vread_with_symbol_positions): New variable.
+ (Vread_symbol_positions_list): New variable.
+ (read_internal_start): New function, created from Fread and
+ Fread_from_string. Handle Vread_symbol_positions_list and
+ Vread_with_symbol_positions.
+ (readevalloop, Fread, Fread_from_string): Use it.
+ (read1): Use readchar_count to add symbol positions to
+ Vread_symbol_positions_list if Vread_with_symbol_positions is non-nil.
+ (syms_of_lread): DEFVAR_LISP and initialize them.
+
+ * lread.c (read0, read1, read_list, read_vector, read_multibyte)
+ (substitute_object_recurse, substitute_object_in_subtree)
+ (substitute_in_interval): Prototype.
+ (read_multibyte): Return c if it's less than zero.
+
+2002-05-28 Kim F. Storm <[email protected]>
+
+ * fileio.c (Fread_file_name_internal): Added brute-force
+ speed up for using predicate file-directory-p.
+
+2002-05-28 Kim F. Storm <[email protected]>
+
+ * fileio.c (Vread_file_name_function, Vread_file_name_predicate):
+ New variables.
+ (syms_of_fileio): DEFVAR_LISP them.
+ (read_file_name_cleanup): New unwind function.
+ (Fread_file_name_internal): Only return completions satifying
+ Vread_file_name_predicate. Temporarily unwind protect and rebind
+ default-directory while checking completions against the predicate.
+ (Fread_file_name): Added PREDICATE argument. Specbind it to
+ Vread_file_name_predicate during completion.
+ Call Vread_file_name_function to read the file name if non-nil.
+
+ * lisp.h (Fread_file_name): Now has 6 args.
+
+ * callint.c (Fcall_interactively) <"D">: Supply Qfile_directory_p
+ predicate for Fread_file_name when reading directory name.
+ Supply Qnil for predicate in other calls to Fread_file_name.
+
+2002-05-26 Miles Bader <[email protected]>
+
+ * term.c (tty_capable_p): New function.
+ * dispextern.h (tty_capable_p): New function declaration.
+ (TTY_CAP_INVERSE, TTY_CAP_UNDERLINE, TTY_CAP_BOLD, TTY_CAP_DIM)
+ (TTY_CAP_BLINK, TTY_CAP_ALT_CHARSET): New macros.
+
+2002-05-23 Stefan Monnier <[email protected]>
+
+ * fileio.c (read_non_regular, Finsert_file_contents): Use BEG_BYTE.
+ (Finsert_file_contents, build_annotations): Use XCAR, XCDR.
+ (Vwrite_region_annotate_functions): Docstring fix.
+
+2002-05-23 Kim F. Storm <[email protected]>
+
+ * xterm.c (x_write_glyphs): Clear phys_cursor_on_p if current
+ phys_cursor's hpos is overwritten. This is still not completely
+ correct, as it doesn't really make sense to use hpos at all to
+ get the cursor glyph (as that is relative to the width of the
+ characters on the line, which may have changed during the update).
+
+2002-05-22 Jason Rumney <[email protected]>
+
+ * w32fns.c (enumfont_t): Remove tail, make pattern a normal
+ Lisp_Object.
+ (enum_font_cb2, enum_font_maybe_add_to_list, w32_list_fonts):
+ Use modified enumfont_t struct.
+
+ * w32term.h (text_cursor_kinds): New enumeration member HBAR_CURSOR.
+
+ * w32term.c (x_draw_bar_cursor): New argument KIND; callers changed.
+ Handle the `hbar' cursor type.
+ (x_display_and_set_cursor): Handle the HBAR_CURSOR case.
+
+ * w32fns.c (Qhbar): New variable.
+ (x_specified_cursor_type): Use it.
+
+2002-05-21 Ken Raeburn <[email protected]>
+
+ * w32fns.c (enum_font_maybe_add_to_list): Use XCDR_AS_LVALUE for
+ now, when the address is needed.
+
+2002-05-21 Colin Walters <[email protected]>
+
+ * Makefile.in (shortlisp): Add font-core.el.
+
+2002-05-20 Richard M. Stallman <[email protected]>
+
+ * buffer.c (syms_of_buffer) <cursor-type>: Doc fix.
+
+ * keyboard.c (read_char_minibuf_menu_prompt): Don't list
+ equivalent key bindings here.
+
+2002-05-20 Ken Raeburn <[email protected]>
+
+ Change symbol structure to contain a lisp object for the symbol
+ name:
+ * lisp.h (struct Lisp_Symbol): Replace field "name" with a lisp
+ object field named "xname".
+ (SYMBOL_NAME): New macro.
+ * abbrev.c (write_abbrev): Use SYMBOL_NAME instead of XSYMBOL and
+ name field.
+ * alloc.c (Fmake_symbol): Set symbol xname field instead of name.
+ (mark_object, gc_sweep): Use symbol xname field and XSTRING
+ instead of name field.
+ * buffer.c (buffer_slot_type_mismatch): Use XSTRING and
+ SYMBOL_NAME instead of XSYMBOL and name field.
+ * callint.c (Fcall_interactively): Use XSTRING and SYMBOL_NAME
+ instead of XSYMBOL and name field.
+ * charset.c (Fdefine_charset, Fdeclare_equiv_charset): Use XSTRING
+ and SYMBOL_NAME instead of XSYMBOL and name field.
+ * coding.c (Fread_coding_system, code_convert_region1)
+ (code_convert_string1, code_convert_string_norecord)
+ (Ffind_operation_coding_system): Use SYMBOL_NAME instead of
+ XSYMBOL and name field.
+ * data.c (Fkeywordp, Fsymbol_name, store_symval_forwarding)
+ (Fmake_variable_buffer_local, Fmake_local_variable)
+ (Fmake_variable_frame_local): Use SYMBOL_NAME and XSTRING instead
+ of XSYMBOL and name field.
+ * editfns.c (Fformat): Use SYMBOL_NAME and XSTRING instead of
+ XSYMBOL and name field.
+ * emacs.c (shut_down_emacs) [#if 0]: Use SYMBOL_NAME and XSTRING
+ instead of XSYMBOL and name field.
+ * eval.c (do_autoload): Use SYMBOL_NAME and XSTRING instead of
+ XSYMBOL and name field.
+ * fns.c (Fstring_equal, Fstring_lessp, Frequire, sxhash):
+ Use SYMBOL_NAME and XSTRING instead of XSYMBOL and name field.
+ * fontset.c (Fset_fontset_font): Use SYMBOL_NAME and XSTRING
+ instead of XSYMBOL and name field.
+ * keyboard.c (echo_char, record_char, parse_modifiers_uncached)
+ (parse_modifiers, apply_modifiers, Fevent_convert_list)
+ (parse_solitary_modifier, Fexecute_extended_command):
+ Use SYMBOL_NAME and XSTRING instead of XSYMBOL and name field.
+ * keymap.c (silly_event_symbol_error, Fsingle_key_description)
+ (Fdescribe_buffer_bindings): Use SYMBOL_NAME and XSTRING instead
+ of XSYMBOL and name field.
+ (describe_command, describe_translation): Use SYMBOL_NAME and
+ assignment instead of XSYMBOL and name field and XSETSTRING.
+ * lread.c (Fintern_soft, oblookup): Use SYMBOL_NAME and XSTRING
+ instead of XSYMBOL and name field.
+ (Funintern): Use SYMBOL_NAME and assignment instead of XSYMBOL and
+ name field and XSETSTRING.
+ * macfns.c (parse_image_spec): Use SYMBOL_NAME and XSTRING instead
+ of XSYMBOL and name field.
+ * minibuf.c (Fread_command, Fread_variable): Use SYMBOL_NAME and
+ assignment instead of XSYMBOL and name field and XSETSTRING.
+ * print.c (print_error_message, print_object): Use SYMBOL_NAME and
+ XSTRING instead of XSYMBOL and name field.
+ * process.c (set_socket_options, Fsignal_process): Use SYMBOL_NAME
+ and XSTRING instead of XSYMBOL and name field.
+ * w32fns.c (parse_image_spec, w32_parse_hot_key): Use SYMBOL_NAME
+ and XSTRING instead of XSYMBOL and name field.
+ * xfaces.c (merge_face_vector_with_property): Use SYMBOL_NAME and
+ XSTRING instead of XSYMBOL and name field.
+ * xfns.c (parse_image_spec): Use SYMBOL_NAME and XSTRING instead
+ of XSYMBOL and name field.
+ * xselect.c (symbol_to_x_atom, x_get_foreign_selection):
+ Use SYMBOL_NAME and XSTRING instead of XSYMBOL and name field.
+
+2002-05-19 Ken Raeburn <[email protected]>
+
+ * lisp.h (LISP_MAKE_RVALUE): Delete disabled version, making XCAR
+ and XCDR real rvalues in most configurations.
+
+ * buffer.c (fix_overlays_in_range, fix_overlays_before):
+ Don't take the address of the cdr part of a cons cell; instead, track
+ the parent cell and call XSETCDR, or set the variable for the head
+ of the list if we haven't started down the list yet.
+
+2002-05-19 Richard M. Stallman <[email protected]>
+
+ * doc.c (reread_doc_file): Don't ask for confirmation.
+
+2002-05-18 Jason Rumney <[email protected]>
+
+ * w32fns.c (w32_create_pixmap_from_bitmap_data): New function.
+ (xbm_load_image): Use it.
+ (xbm_load): Ditto.
+ (xbm_read_bitmap_data): Reverted to xfns.c version.
+ From David Ponce <[email protected]>.
+
+2002-05-17 Eli Zaretskii <[email protected]>
+
+ * msdos.c (sig_suspender, sigprocmask): Don't define for DJGPP
+ 2.02 and later.
+
+2002-05-16 Juanma Barranquero <[email protected]>
+
+ * keyboard.c (Fthis_command_keys, Fthis_command_keys_vector): Fix typo.
+
+2002-05-15 Stefan Monnier <[email protected]>
+
+ * keyboard.c (read_char_x_menu_prompt): Use an equivalent but more
+ meaningful test.
+ (read_char_minibuf_menu_prompt): Fix typo.
+
+2002-05-15 Eli Zaretskii <[email protected]>
+
+ * eval.c (Fcommandp): Doc fix.
+
+2002-05-13 Stefan Monnier <[email protected]>
+
+ * keymap.c (keymap_parent): New fun, extracted from Fkeymap_parent.
+ (Fkeymap_parent, keymap_memberp, fix_submap_inheritance): Use it.
+ (Fset_keymap_parent): Gcpro a bit more.
+ (access_keymap): Gcpro around meta_map call and around the main loop.
+ (get_keyelt): Gcpro when following indirect references.
+ (copy_keymap_item): New fun, extracted from Fcopy_keymap.
+ (copy_keymap_1, Fcopy_keymap): Use it. Don't copy the parent map.
+ (Fdefine_key, Flookup_key): Gcpro before calling get_keymap.
+ Remove useless ad-hoc remap code.
+
+2002-05-13 Richard M. Stallman <[email protected]>
+
+ * search.c (search_buffer): Give up boyer moore search if inverse
+ translation change charset_base.
+
+2002-05-12 Eli Zaretskii <[email protected]>
+
+ * coding.c (decode_coding) <coding_type_ccl>: If a lone CR
+ characters is carried over from the previous block of text, adjust
+ coding->produced to account for the extra character.
+
+2002-05-11 Andreas Schwab <[email protected]>
+
+ * coding.c (intersection): Keep the elements of the returned list
+ in the same order as in the first list.
+
+2002-05-11 Kim F. Storm <[email protected]>
+
+ * keymap.c (current_minor_maps): Fix resizing of cmm_maps;
+ only update cmm_size if realloc actually succeeds.
+ Testing with initial size of 2 elements revealed that using
+ realloc on GNU/Linux would cause a random trap in xmalloc
+ later on, so I rewrote the code to use malloc/bcopy/free instead
+ of realloc.
+
+2002-05-10 Jason Rumney <[email protected]>
+
+ * w32fns.c (enum_font_cb2): Avoid DBCS raster fonts.
+
+2002-05-10 Eli Zaretskii <[email protected]>
+
+ * coding.c (encode_coding_sjis_big5): Enclose bitwise AND in
+ parens, to ensure correct evaluation order.
+
+2002-05-10 Kim F. Storm <[email protected]>
+
+ * keymap.c (Vemulation_mode_map_alists): New variable.
+ (syms_of_keymap): DEFVAR_LISP it.
+ (current_minor_maps): Process keymap alists in that list before
+ minor-mode-overriding-map-alist and minor-mode-map-alist.
+
+2002-05-09 Richard M. Stallman <[email protected]>
+
+ * search.c (Freplace_match): Doc fix.
+
+2002-05-09 Kim F. Storm <[email protected]>
+
+ * macterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
+ Enlarge cursor rectangle drawn around image with non-zero relief.
+
+ * w32term.c (x_draw_image_foreground, w32_draw_image_foreground_1):
+ Enlarge cursor rectangle drawn around image with non-zero relief.
+
+ * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
+ Enlarge cursor rectangle drawn around image with non-zero relief.
+
+2002-05-07 Eli Zaretskii <[email protected]>
+
+ * xselect.c (lisp_data_to_selection_data): Don't set selection
+ type if comes from the Lisp object's car. If the selection
+ contains a pure ASCII text, always return QSTRING as its type.
+
+2002-05-06 Pavel Jan,Am(Bk <[email protected]>
+
+ * mac.c (mac-cut-function): Doc fix.
+
+2002-05-05 Richard M. Stallman <[email protected]>
+
+ * s/gnu.h [DOUG_LEA_MALLOC] (REL_ALLOC): Undefine it.
+
+2002-05-04 Jason Rumney <[email protected]>
+
+ * keyboard.c (make_lispy_event) <mouse-wheel>: Set count to 1
+ for event-click-count.
+
+ * process.c (init_process): Only add server subfeature if we can
+ use non-blocking I/O.
+
+2002-05-04 Andrew Choi <[email protected]>
+
+ * macterm.c (XTread_socket): Call WaitNextEvent once instead of
+ repeatedly.
+
+2002-05-03 Jason Rumney <[email protected]>
+
+ * process.c (Fmake_network_process): Only support server sockets
+ when we can make them non-blocking.
+
+ * s/ms-w32.h (HAVE_SELECT): Define.
+
+ * w32.h (FILE_NDELAY): New flag.
+
+ * w32.c (sys_getpeername, fcntl): New functions.
+ (_sys_read_ahead): Temporarily block on non-blocking sockets.
+
+ * w32proc.c: Include sys/file.h.
+
+2002-05-03 Colin Walters <[email protected]>
+
+ * callproc.c (Vgame_score_directory): Renamed to
+ Vshared_game_score_directory.
+
+2002-04-30 Richard M. Stallman <[email protected]>
+
+ * s/gnu.h [emacs]: Include stdio.h.
+ (GNU_LIBRARY_PENDING_OUTPUT_COUNT): New definition, conditional.
+
+ * eval.c (do_autoload): Error if called while preparing to dump.
+
+ * fns.c (Frequire): Error if need to load while preparing to dump.
+
+2002-04-28 Colin Walters <[email protected]>
+
+ * callproc.c (Vgame_score_directory) [!HAVE_SHARED_GAME_DIR]:
+ Default to "~/.emacs.d/games".
+
+2002-04-29 Stefan Monnier <[email protected]>
+
+ * lread.c (openp): Change arg exec_only to predicate.
+ (build_load_history): Use XCAR/XCDR.
+ (Flocate_file_internal): New fun.
+ (syms_of_lread): Defsubr it.
+ (Fload): Update call to openp.
+
+ * lisp.h (openp): Update prototype.
+
+ * xfns.c (x_create_bitmap_from_file, x_find_image_file):
+ * w32proc.c (sys_spawnve):
+ * w32fns.c (x_create_bitmap_from_file, x_find_image_file):
+ * w32.c (check_windows_init_file):
+ * sound.c (Fplay_sound_internal):
+ * process.c (Fstart_process):
+ * macfns.c (x_create_bitmap_from_file, x_find_image_file):
+ * mac.c (run_mac_command):
+ * emacs.c (init_cmdargs):
+ * callproc.c (Fcall_process): Update call to openp.
+
+ * textprop.c (remove_properties): Don't use XCAR without CONSP.
+
+ * xterm.c (XTread_socket): Disable the Xutf8LookupString code.
+
+2002-04-29 Pavel Jan,Am(Bk <[email protected]>
+
+ * dispextern.h (DEFAULT_TOOL_BAR_BUTTON_MARGIN)
+ (DEFAULT_TOOL_BAR_BUTTON_RELIEF): Change default values.
+
+2002-04-28 Richard M. Stallman <[email protected]>
+
+ * minibuf.c (Fall_completions, Ftry_completion): New arg to Fcommandp.
+
+ * eval.c (Fcommandp): New arg for_call_interactively.
+ * lisp.h (Fcommandp): Declare new arg.
+
+2002-04-28 Jason Rumney <[email protected]>
+
+ * w32proc.c (syms_of_w32proc): Get true file attributes by default.
+
+ * w32.c (stat, fstat): Use file index information to generate
+ inodes for directories where available.
+
+2002-04-26 Andrew Choi <[email protected]>
+
+ * Makefile.in (C_SWITCH_SYSTEM_TEMACS): Add.
+ [HAVE_CARBON]: Include Mac object files.
+
+ * alloc.c, callproc.c, dispextern.h, dispnew.c, emacs.c,
+ fontset.c, frame.c, frame.h, keyboard.c, sysdep.c, term.c,
+ termcap.c, window.c, xdisp.c, xfaces.c: Use macros MAC_OS8,
+ MAC_OSX, and MAC_OS instead of macintosh.
+
+ * editfns.c [MAC_OS8]: Include stdio.h.
+
+ * emacs.c [MAC_OS8]: Call mac_initialize instead of x_term_init.
+
+ * fontset.c [MAC_OS]: Set Vdefault_fontset to ETL Fixed instead of
+ Apple Monaco.
+
+ * process.c (QCfamily, QCfilte): Declare extern.
+ (wait_reading_process_input) [MAC_OSX]: Clear bit for stdin before
+ calling select.
+
+ * termcap.c [MAC_OSX]: Don't define tgetnum, PC, tputs, and tgetent.
+
+ * tparam.c [MAC_OSX]: Don't define BC and UP.
+
+ * config.in [HAVE_CARBON]: Add.
+
+ * mac.c, macgui.h, macfns.c, macmenu.c, macterm.c, macterm.h:
+ Move here from mac/src and mac/inc.
+
+ * s/darwin.h, m/powermac.h, unexmacosx.c: New files.
+
+2002-04-26 Gerd Moellmann <[email protected]>
+
+ * xterm.c (x_draw_phys_cursor_glyph): Undo last change.
+ Compute phys_cursor_width from the x position returned
+ by x_draw_glyhs, which is cheaper.
+ (x_display_and_set_cursor): Compute the buffer-local value
+ of `cursor-in-non-selected-windows' only when needed.
+
+2002-04-25 Gerd Moellmann <[email protected]>
+
+ * xterm.c (x_draw_phys_cursor_glyph): Take into account that a box
+ cursor on a stretch glyph has a width that depends on
+ x_stretch_cursor_p.
+
+2002-04-25 Pavel Jan,Am(Bk <[email protected]>
+
+ * abbrev.c (abbrev-start-location): Doc fix.
+
+ * indent.c (Fvertical_motion): Fix last change.
+
+2002-04-25 Gerd Moellmann <[email protected]>
+
+ * indent.c (Fvertical_motion): Move to the start of the line
+ containing PT before moving up or down.
+
+2002-04-24 Gerd Moellmann <[email protected]>
+
+ * dispnew.c (update_text_area): Set phys_cursor_on_p to 0 in the
+ case of writing a whole row, more or less analogous to the case of
+ writing only parts of a row.
+
+ * xterm.c (x_display_and_set_cursor): Set phys_cursor_width to
+ 0 for NO_CURSOR.
+
+ * xterm.c (notice_overwritten_cursor): Fix an off by 1 error.
+
+2002-04-23 Colin Walters <[email protected]>
+
+ * buffer.c (syms_of_buffer): Doc fix.
+
+2002-04-23 Gerd Moellmann <[email protected]>
+
+ * xterm.c (notice_overwritten_cursor): Handle the special case
+ of the cursor being in the first blank non-text line at the
+ end of a window.
+
+ * xterm.c (x_draw_hollow_cursor, x_draw_bar_cursor)
+ (x_draw_phys_cursor_glyph): Set phys_cursor_width here.
+ (x_display_and_set_cursor): Don't set phys_cursor_width here, for
+ bar cursors only, to make phys_cursor_width contain what its name
+ suggests.
+ (notice_overwritten_cursor): Consider the cursor image erased if
+ the output area intersects the cursor image in y-direction.
+
+2002-04-23 Simon Marshall <[email protected]>
+
+ * xfns.c (x_set_mouse_color): Change default for cross_cursor
+ to XC_hand2.
+
+2002-04-23 Pavel Jan,Am(Bk <[email protected]>
+
+ * xdisp.c: Remove unused global variable `minibuf_prompt_pixel_width'.
+
+2002-04-22 Kim F. Storm <[email protected]>
+
+ * textprop.c (remove_properties): Fixed trap for malformed plist.
+
+2002-04-22 Richard M. Stallman <[email protected]>
+
+ * cmds.c (Fend_of_line): Handle intangible text in mid line.
+
+ * window.c (make_window): Initialize height_fixed_p,
+ last_cursor_off_p, and p->cursor_off_p slots.
+
+2002-04-20 Pavel Jan,Am(Bk <[email protected]>
+
+ * fns.c (use-dialog-box): Doc fix.
+
+2002-04-19 Pavel Jan,Am(Bk <[email protected]>
+
+ * xterm.c (note_mode_line_or_margin_highlight): Remove unused
+ variables `row', `i' and `area'.
+ (XTread_socket) <KeyPress>: Pass KeyPress events when in menu to
+ toolkit library.
+
+2002-04-19 Stefan Monnier <[email protected]>
+
+ * xfaces.c (clear_font_table): Don't free the default font of
+ a frame even if it's on another display.
+ (Finternal_set_lisp_face_attribute): Don't use XFRAME on something
+ that could be Qt.
+
+2002-04-19 Juanma Barranquero <[email protected]>
+
+ * indent.c (Fmove_to_column): Remove unused local variable
+ `next_boundary_byte'.
+ (current_column_1): Likewise.
+
+2002-04-19 Eli Zaretskii <[email protected]>
+
+ * msdos.c (Qhbar): New variable.
+ (syms_of_msdos): Intern and staticpro it.
+ (IT_set_cursor_type, IT_set_frame_parameters): Handle the `hbar'
+ cursor type.
+
+2002-04-19 Dave Lambert <[email protected]>
+
+ Theses change implement an underscore-like (`hbar') cursor.
+
+ * xterm.h (text_cursor_kinds): New enumeration member HBAR_CURSOR.
+
+ * xterm.c (x_draw_bar_cursor): New argument KIND; callers changed.
+ Handle the `hbar' cursor type.
+ (x_display_and_set_cursor): Handle the HBAR_CURSOR case.
+
+ * xfns.c (Qhbar): New variable.
+ (syms_of_xfns): Intern and staticpro it.
+ (x_specified_cursor_type): Handle `hbar' cursor.
+
+ * s/sol2-5.h (bcopy, bzero, bcmp): Define only if HAVE_BCOPY is
+ not defined.
+
+2002-04-18 Richard M. Stallman <[email protected]>
+
+ * textprop.c (remove_properties): New arg LIST allows scanning
+ either a list or a plist.
+ (interval_has_some_properties_list): New function, like
+ interval_has_some_properties using list instead of plist.
+ All callers changed.
+ (Fremove_list_of_text_properties): New function.
+ (syms_of_textprop): Defsubr it.
+
+2002-04-17 Eli Zaretskii <[email protected]>
+
+ * s/sol2.h (HAVE_LIBKSTAT): Define only if not already defined.
+
+2002-04-17 Juanma Barranquero <[email protected]>
+
+ * indent.c (Fmove_to_column): Remove unused local variable `end_byte'.
+
+2002-04-17 Eli Zaretskii <[email protected]>
+
+ * window.c (coordinates_in_window): Don't report on margin area
+ if its width is zero.
+
+2002-04-16 Jason Rumney <[email protected]>
+
+ * w32fns.c (Fx_file_dialog): Decode file name before using.
+
+ * w32term.c (construct_drag_n_drop): Likewise.
+
+2002-04-16 Eli Zaretskii <[email protected]>
+
+ * puresize.h (BASE_PURESIZE): Increase to 830000, since we now
+ store load-history in pure space.
+
+ * s/msdos.h (SYSTEM_PURESIZE_EXTRA): Reduce to 50000.
+
+2002-04-16 Stefan Monnier <[email protected]>
+
+ * xterm.c (Qlatin_1, Qutf_8): New vars.
+ (syms_of_xterm): Initialize them.
+ (XTread_socket): Eliminate incorrect optimization that tried to avoid
+ decoding the output of X*LookupString.
+ Always use latin-1 to decode the output of XLookupString.
+ Try Xutf8LookupString if XmbLookupString failed.
+
+ * region-cache.c (new_region_cache): Use BEG.
+
+2002-04-16 Gerd Moellmann <[email protected]>
+
+ * buffer.c (MMAP_ALLOCATED_P): New macro to be set from system
+ configuration files.
+ (mmap_enlarge): Enlarge mapped regions only if MMAP_ALLOCATED_P
+ returns 0.
+
+2002-04-15 Andreas Schwab <[email protected]>
+
+ * config.in: Regenerated using autoheader.
+
+ * m/7300.h, m/acorn.h, m/alliant-2800.h, m/alliant.h, m/alpha.h,
+ m/altos.h, m/amdahl.h, m/apollo.h, m/arm.h, m/att3b.h, m/aviion.h,
+ m/celerity.h, m/clipper.h, m/cnvrgnt.h, m/convex.h, m/cydra5.h,
+ m/delta.h, m/delta88k.h, m/dpx2.h, m/elxsi.h, m/gec63.h,
+ m/gould.h, m/hp800.h, m/hp9000s300.h, m/i860.h, m/ia64.h,
+ m/ibmps2-aix.h, m/ibmrs6000.h, m/ibmrt-aix.h, m/ibmrt.h,
+ m/ibms390.h, m/intel386.h, m/iris4d.h, m/irist.h, m/isi-ov.h,
+ m/m68k.h, m/macppc.h, m/masscomp.h, m/mg1.h, m/mips-siemens.h,
+ m/mips.h, m/news-r6.h, m/news.h, m/next.h, m/nh3000.h, m/nh4000.h
+ m/ns32000.h, m/orion.h, m/pfa50.h, m/plexus.h, m/pmax.h,
+ m/powerpcle.h, m/pyrmips.h, m/sequent-ptx.h, m/sequent.h,
+ m/sparc.h, m/sr2k.h, m/symmetry.h, m/tad68k.h, m/tahoe.h,
+ m/targon31.h, m/tek4300.h, m/tekxd88.h, m/template.h, m/tower32.h,
+ m/tower32v3.h, m/ustation.h, m/vax.h, m/wicat.h, m/windowsnt.h,
+ m/xps100.h, s/aix3-2.h, s/aix4-2.h, s/irix4-0.h, s/irix5-0.h,
+ s/sco5.h, s/unixware.h: Don't set HAVE_ALLOCA, C_ALLOCA and
+ STACK_DIRECTION, now set by autoconf.
+
+2002-04-14 Pavel Jan,Am(Bk <[email protected]>
+
+ * dispnew.c (marginal_area_string): Sort arguments.
+
+ * dispextern.h (marginal_area_string): Add prototype.
+
+2002-04-13 Richard M. Stallman <[email protected]>
+
+ * fileio.c (Finsert_file_contents):
+ Don't call temp_output_buffer_setup--do just part, by hand.
+
+ * coding.c (run_pre_post_conversion_on_str):
+ Don't call temp_output_buffer_setup--do just part, by hand.
+
+ * keyboard.c (command_loop_1): Don't call start_hourglass
+ or cancel_hourglass when executing a macro.
+
+ * marker.c (count_markers): New function.
+
+ * xdisp.c (display_mode_element): Don't let mode_line_proptrans_alist
+ grow without limit. Move recently used elements to the front.
+
+2002-04-13 Eli Zaretskii <[email protected]>
+
+ * unexelf.c (unexec) [__sgi]: Undo the change from 2002-01-20.
+
+2002-04-12 Gerd Moellmann <[email protected]>
+
+ * xdisp.c (sync_frame_with_window_matrix_rows): Don't give frame
+ rows marginal areas.
+ (Fdump_frame_glyph_matrix) [GLYPH_DEBUG]: New function.
+ (syms_of_xdisp) [GLYPH_DEBUG]: Defsubr it.
+
+ * dispnew.c (marginal_area_string): Check that glyph row is enabled.
+
+2002-04-12 Dave Love <[email protected]>
+
+ * dispnew.c (marginal_area_string): New.
+
+ * window.c (window_part): Add ON_LEFT_MARGIN, ON_RIGHT_MARGIN.
+ (Qleft_margin, Qright_margin): Declare.
+ (coordinates_in_window, (Fcoordinates_in_window_p): Deal with margins.
+
+ * xterm.c (note_mode_line_or_margin_highlight): Renamed from
+ note_mode_line_highlight and extended.
+
+ * keyboard.c (Qleft_margin, Qright_margin): Declare.
+ (make_lispy_event): Deal with mouse events in margins.
+
+2002-04-12 Stefan Monnier <[email protected]>
+
+ * msdos.c (dos_rawgetc): Use a single event for HELP_EVENT.
+
+ * keyboard.c (command_loop_1): Turn off transient-mark-mode rather
+ than deactivating the mark if tmm is set to `lambda'.
+ (gen_help_event, kbd_buffer_store_help_event, kbd_buffer_get_event):
+ Use a single event for HELP_EVENT.
+ (Fexecute_extended_command): Save last_point_position.
+
+2002-04-12 Pavel Jan,Am(Bk <[email protected]>
+
+ * lisp.h (Fpropertize): Add prototype.
+
+ * fns.c (Fy_or_n_p): Use `minibuffer-prompt' face for prompt.
+
+2002-04-10 Colin Walters <[email protected]>
+
+ * config.in: Add HAVE_SHARED_GAME_DIR.
+
+ * callproc.c (Vgame_score_directory): New variable.
+ (syms_of_callproc) <Vgame_score_directory>: DEFVAR_LISP.
+
+2002-04-10 Richard M. Stallman <[email protected]>
+
+ * puresize.h (BASE_PURESIZE): Reduce again to avoid big excess.
+
+2002-04-09 Stefan Monnier <[email protected]>
+
+ * minibuf.c (read_minibuf): Use empty_string.
+ (Ftry_completion): Allow lambda forms and lists of strings for `alist'.
+ Short-circuit the search as soon as it "failed".
+ (Fall_completions): Allow lambda forms and lists of strings for alist.
+ (Fcompleting_read): Set Qminibuffer_completion_confirm to nil
+ when require_match is nil.
+ (Ftest_completion): Rename from `test_completion' and export to elisp.
+ Call the predicate also when alist is a list.
+ Obey Vcompletion_regexp_list.
+ (do_completion, Fminibuffer_complete_and_exit): Use it.
+ (Fassoc_string): Rename from `assoc_for_completion'.
+ Allow list of strings as well and export to elisp.
+
+2002-04-08 Stefan Monnier <[email protected]>
+
+ * puresize.h (BASE_PURESIZE): Increase to 900KB.
+
+2002-04-08 Juanma Barranquero <[email protected]>
+
+ * w32.c (sys_accept): Don't hide variable `s'.
+
+2002-04-05 Gerd Moellmann <[email protected]>
+
+ * callint.c (Fcall_interactively): Use INTEGERP instead of
+ NUMBERP for checking Vhistory_length.
+
+2002-04-05 Pavel Jan,Am(Bk <[email protected]>
+
+ * sound.c (Fplay_sound_internal): Renamed from Fplay_sound.
+ Doc fix to reflect it.
+
+2002-04-04 Richard M. Stallman <[email protected]>
+
+ * xdisp.c (display_mode_element): New arg RISKY.
+ Disregard text props found or specified within a variable
+ that isn't marked risky-local-variable.
+ (Qrisky_local_variable): New variable.
+ (syms_of_xdisp): Init and staticpro it.
+
+2002-04-04 Stefan Monnier <[email protected]>
+
+ * undo.c (record_point): New fun.
+ (record_delete, record_insert): Use it.
+
+2002-04-03 Juanma Barranquero <[email protected]>
+
+ * doc.c (Fdocumentation): Add missing parentheses.
+ (Fdocumentation_property): Likewise.
+
+2002-04-03 Stefan Monnier <[email protected]>
+
+ * doc.c (Fdocumentation, Fdocumentation_property): When the doc
+ data is 0, just return nil.
+
+2002-04-03 Eli Zaretskii <[email protected]>
+
+ * msdos.c (syms_of_msdos): Fix last change with
+ mouse_autoselect_window.
+
+2002-04-03 Pavel Jan,Am(Bk <[email protected]>
+
+ * w32term.c, xterm.c, msdos.c: Rename autoselect_window_p to
+ mouse_autoselect_window.
+
+2002-04-02 Stefan Monnier <[email protected]>
+
+ * keyboard.c (make_lispy_event): Handle unknown keysyms together
+ with system-specific keysyms. Use it also for unknown function keys.
+
+ * doc.c (reread_doc_file): Return whether reload was attempted.
+ (Fdocumentation, Fdocumentation_property): Don't try to reload
+ if the doc is 0 and only ask once.
+
+ * Makefile.in (lisp, shortlisp): Add ucs-tables.elc.
+
+2002-04-02 Eli Zaretskii <[email protected]>
+
+ * keyboard.c (read_char): If the event was Qselect_window,
+ restore timer_idleness_start_time to its previous value.
+
+ * msdos.c (dos_rawgetc): Generate SELECT_WINDOW_EVENTs when required.
+
+2002-04-01 Stefan Monnier <[email protected]>
+
+ * region-cache.c (new_region_cache): Use BEG.
+
+ * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
+ Use BEG and BEG_BYTE.
+
+ * doc.c (get_doc_string): Return nil if the location is wrong.
+ (reread_doc_file): New fun.
+ (Fdocumentation, Fdocumentation_property):
+ Call it if get_doc_string fails.
+ (Fsnarf_documentation): Make it work for a dumped Emacs.
+
+ * charset.h (DEC_POS, BUF_DEC_POS): Use BEG_BYTE.
+ Bound the search with MAX_MULTIBYTE_LENGTH to avoid pathological case.
+
+ * charset.c (Fstring): Allow 0 arguments.
+
+ * xterm.c (XTread_socket): Fix int/Lisp_Object confusion.
+
+ * process.c (DATAGRAM_CONN_P, list_processes_1)
+ (Fprocess_datagram_address, Fset_process_datagram_address)
+ (Fset_network_process_options, server_accept_connection):
+ Fix some int/Lisp_Object confusions (thank you union types).
+
+2002-04-01 Pavel Jan,Am(Bk <[email protected]>
+
+ * msdos.c: Rename x_autoselect_window_p to autoselect_window_p.
+
+ * w32term.c: Likewise.
+ (note_mouse_movement): Put code for x_autoselect_window_p in #if 0.
+
+ * keyboard.c (Qselect_window): New symbol.
+ (head_table): Use it.
+ (keys_of_keyboard): Bound select-window event to handle-select-window.
+ (kbd_buffer_get_event): Make a Lisp event from SELECT_WINDOW_EVENT.
+
+ * xterm.c: Rename x_autoselect_window_p to autoselect_window_p.
+ (last_window): New variable.
+ (XTread_socket): Generate SELECT_WINDOW_EVENTs.
+ (note_mouse_movement): Remove reimplemented code in #if 0.
+ (XTread_socket): Generate SELECT_WINDOW_EVENTs only for
+ Emacs windows.
+
+ * termhooks.h (enum event_kind): New event type `SELECT_WINDOW_EVENT'.
+
+2002-03-31 Gerd Moellmann <[email protected]>
+
+ * xterm.c (x_get_char_face_and_encoding): Add parameter DISPLAY_P.
+ Callers changed.
+
+2002-03-30 Richard M. Stallman <[email protected]>
+
+ * window.c (window_scroll_pixel_based): Exit the move_it_by_lines
+ loop whenever it stops making progress.
+
+ * widget.c (set_frame_size): Don't call change_frame_size.
+
+2002-03-30 Gerd Moellmann <[email protected]>
+
+ * dispnew.c (direct_output_for_insert):
+ Call mark_window_display_accurate.
+
+2002-03-29 Jason Rumney <[email protected]>
+
+ * w32term.c (w32_draw_relief_rect): Fix calculations of line lengths.
+
+2002-03-29 Eli Zaretskii <[email protected]>
+
+ * Makefile.in (lread.o): Depend on coding.h.
+
+ * lread.c (openp, Fload): Encode the file name before passing it
+ to `stat', `access', and `emacs_open'.
+ (openp): GCPRO the encoded file name. Don't recompute Lisp
+ strings unnecessarily.
+
+2002-03-29 Kim F. Storm <[email protected]>
+
+ * fns.c (Flax_plist_put): Doc fix.
+
+2002-03-28 Miles Bader <[email protected]>
+
+ * process.c (DATAGRAM_CONN_P): Make sure PROC is really a process.
+
+2002-03-27 Pavel Jan,Am(Bk <[email protected]>
+
+ * process.c (set-network-process-options): Add usage.
+ (make-network-process): Doc fix.
+
+2002-03-26 Eli Zaretskii <[email protected]>
+
+ * emacs.c (Fdump_emacs): Fix a typo in "command-line-processed".
+
+2002-03-26 Richard M. Stallman <[email protected]>
+
+ * fns.c (Fsubstring_no_properties): New function.
+ (Flax_plist_get, Flax_plist_put): New functions.
+ (syms_of_fns): defsubr them.
+
+ * xdisp.c (update_menu_bar): Test only update_mode_lines;
+ don't test or alter w->update_mode_line.
+
+ * window.c (Fdisplay_buffer): Doc fix.
+
+2002-03-24 Richard M. Stallman <[email protected]>
+
+ * regex.c (GET_UNSIGNED_NUMBER): Give proper error for spaces.
+
+2002-03-24 Gerd Moellmann <[email protected]>
+
+ * eval.c (Qdeclare, Vmacro_declaration_function): New variables.
+ (Fdefmacro): Handle `(declare ...)'.
+ (syms_of_eval) <Qdeclare>: Initialize and staticpro.
+ (syms_of_eval) <Vmacro_declaration_function>: DEFVAR_LISP.
+
+2002-03-24 Jason Rumney <[email protected]>
+
+ * w32fns.c (xbm_scan, xbm_load_image, xbm_read_bitmap_data)
+ (xbm_file_p): Add prototypes.
+ (xbm_format, xbm_image_p): Sync with xfns.c.
+ (reflect_byte): New function.
+ (xbm_read_bitmap_data): Sync with xfns.c, adapt for Windows.
+ (xbm_load_image): Create bitmaps with a depth of 1.
+ (init_xfns): Enable XBM images.
+
+2002-03-23 Jason Rumney <[email protected]>
+
+ * w32term.c (w32_handle_tool_bar_click): Detect up and down events
+ correctly. Do not pass up_modifier to keyboard buffer.
+
+ * w32fns.c [HAVE_IMAGES, HAVE_PBM]: Remove conditionals.
+
+2002-03-22 Stefan Monnier <[email protected]>
+
+ * Makefile.in (bootstrapclean): New target.
+ (bootstrap-temacs, bootstrap-doc): Remove.
+ (bootstrap-emacs): Use a bog-standard `temacs'.
+ Don't bother to build a DOC file.
+
+ * sysdep.c (wait_for_termination): Use sigsuspend rather than sigpause.
+
+ * emacs.c (main): Handle --unibyte, --multibyte, and --no-loadup
+ in temacs even if !CANNOT_DUMP.
+ (standard_args): Keep --no-loadup even if !CANNOT_DUMP.
+
+ * alloc.c (check_pure_size): Only output a warning.
+
+2002-03-22 Jason Rumney <[email protected]>
+
+ * w32fns.c (Fx_create_frame): Enable tool-bar when images are
+ supported.
+
+ * w32term.c (zv_bits): Declare as short, for word alignment.
+ (w32_read_socket) <WM_XBUTTONUP>: Fix last change.
+ (syms_of_w32term): Define x-use-underline-position-properties.
+
+ * w32fns.c (x_set_cursor_color): Set cursor_gc as well.
+ (clear_image_cache): Block input, fix logic, clear matrices in
+ all frames that share this cache.
+
+2002-03-22 Eli Zaretskii <[email protected]>
+
+ * emacs.c (main): Update the Copyright year in the blurb printed
+ by "emacs --version".
+
+ * xdisp.c (message_with_string): Fix syntax of a call to GCPRO2.
+
+ * xterm.c (XTread_socket): If XK_ISO_Lock and
+ XK_ISO_Last_Group_Lock are defined, handle keysyms between
+ XK_ISO_Lock and XK_ISO_Last_Group_Lock similarly to Mode_switch.
+
+2002-03-21 Kim F. Storm <[email protected]>
+
+ * keyboard.c (menu_bar_items): Mostly undo 2002-02-20 patch, so
+ menu-bar bindings in keymap and local-map properties _are_ used.
+ But try keymap property first in accordance with 2002-01-03 patch.
+ Added comment describing why this is not always reliable.
+ (tool_bar_items): Ditto for tool-bar.
+
+2002-03-21 Jason Rumney <[email protected]>
+
+ * w32fns.c (x_clear_image_1): Disable color table code.
+
+2002-03-21 Kim F. Storm <[email protected]>
+
+ * lisp.h (DEFUN) [USE_NONANSI_DEFUN]: The 2001-10-17 patch
+ removed the wrong version of the DEFUN macro; fixed it.
+
+ * fns.c (Ffeaturep): Allow subfeature to be a list (test using
+ Fmember rather than Fmemq).
+ (Fprovide): Check that subfeatures is a list.
+
+ * process.c (QCfeature, QCdatagram): Removed variables.
+ (QCtype, Qdatagram): New variables.
+ (network_process_featurep): Removed function.
+ (Fmake_network_process): Removed :feature check.
+ Use :type 'datagram instead of :datagram t to create a datagram
+ socket. This allows us to add other connection types (e.g. raw
+ sockets) later in a consistent manner.
+ (init_process) [subprocess, HAVE_SOCKETS]: Provide list of
+ supported subfeatures for feature make-network-process.
+ (syms_of_process) [subprocess]: Remove QCfeature and QCdatagram.
+ Intern and staticpro QCtype and Qdatagram.
+ (syms_of_process) [!subprocess]: Intern and staticpro QCtype.
+
+ * xfns.c (QCtype): Remove duplicate declaration and
+ initialization (is now declared in process.c).
+
+ * w32fns.c (QCtype): Remove duplicate declaration and
+ initialization (is now declared in process.c).
+
+2002-03-21 Richard M. Stallman <[email protected]>
+
+ * regex.c (DISCARD_FAILURE_REG_OR_COUNT): New macro.
+ (CHECK_INFINITE_LOOP): Use DISCARD_FAILURE_REG_OR_COUNT
+ when jumping to `fail' to avoid undoing reg changes in the
+ last iteration of the loop.
+ (GET_UNSIGNED_NUMBER): Skip spaces around the number.
+
+ * Makefile.in (dispnew.o, sysdep.o, xdisp.o, xselect.o, alloc.o):
+ Depend on process.h.
+
+2002-03-20 Jason Rumney <[email protected]>
+
+ Most of the following changes are still conditional on HAVE_IMAGES
+ which is not set by default on Windows.
+
+ * emacs.c (main) [WINDOWSNT]: Call init_xfns.
+
+ * w32fns.c (x_set_cursor_color): Set foreground of cursor, not frame.
+ (Fimage_size, Fimage_mask_p, XPutPixel): New functions.
+ (four_corners_best, x_clear_image_1, x_clear_image)
+ (x_alloc_image_color, postprocess_image)
+ (x_create_x_image_and_pixmap, x_destroy_x_image, xbm_load_image)
+ (x_from_x_colors, x_disable_image, pbm_load): Adapt for Windows.
+ (init_xfns, syms_of_w32fns): Initialize image functions and constants.
+
+ * w32gui.h (struct XImage): Define.
+
+ * w32term.c (w32_read_socket) <WM_XBUTTONUP>: Use XFASTINT to
+ extract mouse co-ordinates.
+
+2002-03-20 Jason Rumney <[email protected]>
+
+ * w32.c (init_winsock): Dynamically load new server and UDP
+ socket functions.
+ (socket_to_fd): New function.
+ (sys_socket): Use it.
+ (sys_setsockopt, sys_listen, sys_getsockname, sys_accept)
+ (sys_recvfrom, sys_sendto): New wrapper functions.
+
+ * process.c (QCfamily, QCfilter): Remove duplicate declaration
+ and initialization.
+
+ * makefile.w32-in (LIBS): Remove $(WSOCK32).
+
+2002-03-20 Eli Zaretskii <[email protected]>
+
+ * process.c (conv_sockaddr_to_lisp, conv_lisp_to_sockaddr):
+ Don't use "sun" as a variable, it's a predefined constant on Sun
+ machines.
+
+2002-03-20 Pavel Jan,Am(Bk <[email protected]>
+
+ * bytecode.c (Fbyte_code): Revert last change.
+
+2002-03-19 Kim F. Storm <[email protected]>
+
+ * makefile.w32-in (LIBS): Add $(WSOCK32).
+ From David Ponce <[email protected]>.
+
+2002-03-18 Pavel Jan,Am(Bk <[email protected]>
+
+ * process.c (wait_reading_process_input): Move variables `pname'
+ and `pnamelen' down where they are used.
+
+ * bytecode.c (Fbyte_code): Discard unused computed value to
+ prevent gcc warning.
+
+ * lisp.h (Fplist_member): Add prototype.
+
+2002-03-18 Kim F. Storm <[email protected]>
+
+ * config.in: Add HAVE_SENDTO, HAVE_RECVFROM, HAVE_SETSOCKOPT,
+ HAVE_GETSOCKOPT, HAVE_GETPEERNAME, HAVE_GETSOCKNAME, and HAVE_SYS_UN_H.
+
+ * process.c: Define HAVE_LOCAL_SOCKETS based on HAVE_SYS_UN_H.
+ Remove explicit GNU_LINUX settings for datagram support.
+
+2002-03-18 Pavel Jan,Am(Bk <[email protected]>
+
+ * process.c (Fmake_network_process): Remove unused variable `sa'.
+ Doc fix. Add usage:.
+ (set_socket_options): Remove unused variables `optnum' and `opttype'.
+
+2002-03-17 Richard M. Stallman <[email protected]>
+
+ * xdisp.c (cursor_type_changed): New variable.
+ (redisplay_internal): Redisplay all windows if cursor_type_changed.
+ Clear it when clearing windows_or_buffers_changed.
+ (try_cursor_movement, redisplay_window, try_window_id)
+ (try_window_reusing_current_matrix): Test cursor_type_changed
+ along with windows_or_buffers_changed.
+
+ * window.h (cursor_type_changed): New variable.
+
+ * xfns.c (x_set_cursor_type): Set cursor_type_changed,
+ not update_mode_lines, and always set it to 1.
+
+ * xdisp.c (clear_garbaged_frames): Don't set windows_or_buffers_changed
+ if no frames needed redrawing.
+
+2002-03-17 Kim F. Storm <[email protected]>
+
+ The following changes add support for network server processes,
+ datagram connections, and local (unix) sockets.
+
+ * process.h (struct Lisp_Process): New member log.
+ Doc fix: Member command used to indicate stopped network process.
+ Doc fix: Member childp contains plist for network process.
+ Doc fix: Member kill_without_query is inverse of query-on-exit flag.
+
+ * process.c (Qlocal, QCname, QCbuffer, QChost, QCservice, QCfamily)
+ (QClocal, QCremote, QCserver, QCdatagram, QCnowait, QCnoquery, QCstop)
+ (QCcoding, QCoptions, QCfilter, QCsentinel, QClog, QCfeature): New
+ variables.
+ (NETCONN1_P): New macro.
+ (DATAGRAM_SOCKETS): New conditional symbol.
+ (datagram_address): New array.
+ (DATAGRAM_CONN_P, DATAGRAM_CHAN_P): New macros.
+ (status_message): Use concat3.
+ (Fprocess_status): Add `listen' status to doc string. Return
+ `stop' for a stopped network process.
+ (Fset_process_buffer): Update contact plist for network process.
+ (Fset_process_filter): Ditto. Don't enable input for stopped
+ network processes. Server must listen, even if filter is t.
+ (Fset_process_query_on_exit_flag, Fprocess_query_on_exit_flag):
+ New functions.
+ (Fprocess_kill_without_query): Removed. Now defined in simple.el.
+ (Fprocess_contact): Added KEY argument. Handle datagrams.
+ (list_processes_1): Optionally show only processes with the query
+ on exit flag set. Dynamically adjust column widths. Omit tty
+ column if not needed. Report stopped network processes. Identify
+ server and datagram network processes.
+ (Flist_processes): New optional arg `query-only'.
+ (conv_sockaddr_to_lisp, get_lisp_to_sockaddr_size)
+ (conv_lisp_to_sockaddr, set_socket_options)
+ (network_process_featurep, unwind_request_sigio): New helper
+ functions.
+ (Fprocess_datagram_address, Fset_process_datagram_address):
+ (Fset_network_process_options): New lisp functions.
+ (Fopen_network_stream): Removed. Now defined in simple.el.
+ (Fmake_network_process): New lisp function. Code is based on
+ previous Fopen_network_stream, but heavily reworked with new
+ property list based argument list, support for datagrams, server
+ processes, and local sockets in addition to old client-only
+ functionality.
+ (server_accept_connection): New function.
+ (wait_reading_process_input): Use it to handle incoming connects.
+ Do not enable input on a new connection if process is stopped.
+ (read_process_output): Handle datagram sockets. Use 2k buffer for
+ them.
+ (send_process): Handle datagram sockets.
+ (Fstop_process, Fcontinue_process): Apply to network processes. A
+ stopped network process is indicated by setting command field to t.
+ (Fprocess_send_eof): No-op if datagram connection.
+ (Fstatus_notify): Don't read input for a stream server socket or a
+ stopped network process.
+ (init_process): Initialize datagram_address array.
+ (syms_of_process): Intern and staticpro new variables, defsubr new
+ functions.
+
+2002-03-16 Jason Rumney <[email protected]>
+
+ * w32fns.c (w32_to_all_x_charsets): Return correct type in
+ startup case.
+
+2002-03-16 Richard M. Stallman <[email protected]>
+
+ * xdisp.c (redisplay_internal, redisplay_windows):
+ Use list_of_error to call internal_condition_case_1.
+ (safe_eval, safe_call): Pass Qt to internal_condition_case_{1,2}
+ so as to catch all errors with no possibility of debugger redisplay.
+ (list_of_error): New variable.
+ (syms_of_xdisp): Init and staticpro it.
+
+ * print.c (print_object): Delete `\ ' from printed rep of frame.
+
+2002-03-15 Eli Zaretskii <[email protected]>
+
+ * msdos.c (dos_rawgetc): Disable the x-autoselect-window feature,
+ until its implementation is fixed.
+
+2002-03-14 Pavel Jan,Am(Bk <[email protected]>
+
+ * xfns.c (png_load): Remove unused variable `gamma_str'.
+
+2002-03-14 Richard M. Stallman <[email protected]>
+
+ * xfns.c (x_real_positions): Handle failure in XQueryTree.
+
+2002-03-14 Miles Bader <[email protected]>
+
+ * intervals.c (adjust_for_invis_intang): New function.
+ (set_point_both): Use `adjust_for_invis_intang' to do most of the
+ work for dealing with invisible+intangible regions. Do so before
+ and after both forward and backward movements, to handle both
+ front-sticky and rear-sticky cases.
+ * textprop.c (text_property_stickiness): Function moved here from
+ `editfns.c'.
+ * intervals.h (text_property_stickiness): New declaration.
+ * editfns.c (char_property_eq): Function removed.
+ (text_property_stickiness): Function moved to `textprop.c'.
+
+2002-03-13 Jason Rumney <[email protected]>
+
+ * config.in: Add STRFTIME_NO_POSIX2.
+
+ * strftime.c (my_strftime) [STRFTIME_NO_POSIX2]: Handle %h, %EX
+ and %OX when underlying strftime does not.
+
+2002-03-13 Stefan Monnier <[email protected]>
+
+ * xterm.c (x_set_toolkit_scroll_bar_thumb) <USE_MOTIF>:
+ Use a fixed-size thumb (based on an ad-hoc estimate of 30 chars per
+ line) to avoid annoying flicker.
+ (xm_scroll_callback): Get rid of the now unnecessary kludge.
+ (XTread_socket): Mark it static.
+
+ * xdisp.c (display_mode_element): Fix int/Lisp_Object mixup.
+
+2002-03-13 Kim F. Storm <[email protected]>
+
+ * puresize.h (BASE_PURESIZE): Increase to 775000.
+
+2002-03-12 Juanma Barranquero <[email protected]>
+
+ * editfns.c (syms_of_editfns): Fix typo.
+
+2002-03-12 Gerd Moellmann <[email protected]>
+
+ * xsmfns.c: Include stdio.h because termhooks.h needs it.
+ Include termopt.h for interrupt_input.
+
+2002-03-11 Andreas Schwab <[email protected]>
+
+ * coding.c (syms_of_coding) <file-coding-system-alist>: Doc fix.
+
+2002-03-11 Gerd Moellmann <[email protected]>
+
+ * xterm.c (note_mouse_movement): Put code for
+ x_autoselect_window_p in #if 0.
+
+ * lread.c (Fload): Don't assume that message_with_string uses the
+ string it is given like a C string.
+
+2002-03-10 Jan Dj,Ad(Brv <[email protected]>
+
+ * xterm.h (x_session_check_input, x_session_initialize): Declare.
+
+ * xterm.c (XTread_socket): Add call to x_session_check_input and
+ x_session_have_connection.
+ (x_initialize): Add call to x_session_initialize.
+
+ * termhooks.h (enum event_kind): Add save_session_event.
+
+ * keyboard.c: Add Emacs event save_session_event.
+
+ * emacs.c (main): Add call to syms_of_xsmfns.
+
+ * lisp.h (syms_of_xsmfns): Declare extern.
+
+ * config.in: Add HAVE_X_SM.
+
+ * Makefile.in (LIBXT): Add -lSM -lICE
+ if HAVE_X_SM and not USE_X_TOOLKIT.
+ (XOBJ): New file xsmfns.c added.
+
+ * xsmfns.c: New file for X session management.
+
+2002-03-09 Jason Rumney <[email protected]>
+
+ * fileio.c (Fcopy_file) [WINDOWS_NT]: Ensure file is not
+ read-only when setting modified time.
+
+2002-03-08 Gerd Moellmann <[email protected]>
+
+ * xdisp.c (move_it_vertically_backward): At the end of the function,
+ when moving forward by lines, treat terminal frames specially.
+
+ * keyboard.c (echo_char): Make sure to add a separator between
+ keys even if echo_dash hasn't been called.
+
+ * xdisp.c: Use new string macros.
+ (update_echo_area): Pass number of bytes to message3 instead of
+ number of chars.
+ (set_message_1): Don't access a string's size_byte directly.
+ (decode_mode_spec_coding): Use number of bytes of eoltype string
+ instead number of chars.
+
+ * lisp.h (SREF, SDATA, SCHARS, SBYTES, SMBP): New macros.
+
+2002-03-08 Juanma Barranquero <[email protected]>
+
+ * w32fns.c (Fx_display_color_cells): Force 24+ bit color depths to
+ 24-bit.
+
+2002-03-06 Jason Rumney <[email protected]>
+
+ * w32term.c (x_draw_hollow_cursor): Draw same size as block cursor.
+
+2002-03-06 Gerd Moellmann <[email protected]>
+
+ * keyboard.c (echo_prompt, echo_char, echo_dash, echo_now)
+ (cancel_echoing, echo_length, echo_truncate): Changed to
+ work with new kboard definition.
+ (echo_now): Use message3_nolog instead of message2_nolog.
+
+ * alloc.c (mark_kboards): Mark echo_string.
+
+ * keyboard.h (ECHOBUFSIZE): Removed.
+ (struct kboard): Member echoptr removed, member echobuf renamed
+ to echo_string.
+
+ * xdisp.c (message_with_string): Use Fformat instead of doprnt and
+ message3 instead of message2 to display the message using STRING's
+ text properties.
+
+2002-03-05 Andreas Schwab <[email protected]>
+
+ * xdisp.c (hscroll_margin): Change to EMACS_INT.
+
+2002-03-05 Per Abrahamsen <[email protected]>
+
+ * frame.c (default-frame-alist): Explain that setting it doesn't
+ affect existing frames.
+
+2002-03-05 Stefan Monnier <[email protected]>
+
+ * indent.c (skip_invisible): Fix my brain fart.
+
+ * dispnew.c (sit_for): Don't wait if executing a kbd macro.
+
+2002-03-04 Stefan Monnier <[email protected]>
+
+ * dosfns.c, dosfns.h, dispnew.c, dispextern.h, commands.h, charset.c,
+ * alloc.c, abbrev.c, emacs.c, eval.c, keyboard.c, keyboard.h,
+ * lisp.h, lread.c, sysdep.c, termcap.c, termchar.h, w32term.c,
+ * window.c, xdisp.c, xselect.c, xterm.c: Change defvar_int definition
+ and variables to use EMACS_INT instead of just int.
+
+ * buffer.c (syms_of_buffer): Allow non-string `mode-name'.
+
+2002-03-04 Eli Zaretskii <[email protected]>
+
+ * sysdep.c (sys_subshell) [MSDOS]: If PWD is set in the
+ environment, pass it down with corrected value.
+
+2002-03-04 Pavel Jan,Am(Bk <[email protected]>
+
+ * lread.c (read_filtered_event): Do not call start_hourglass
+ before returning.
+
+2002-03-04 Juanma Barranquero <[email protected]>
+
+ * w32term.c (x_display_and_set_cursor): Fix typo.
+
+2002-03-03 Richard M. Stallman <[email protected]>
+
+ * fileio.c (Fmake_temp_name): Doc fix.
+
+2002-03-03 Gary Wong <[email protected]>
+
+ * termcap.c [!emacs]: Replace ospeed for building standalone
+ libtermcap, for binary compatibility.
+
+ * tparam.c [!emacs]: Move #define of bcopy to after string.h.
+
+2002-03-03 Richard M. Stallman <[email protected]>
+
+ * xrdb.c (file_p): Rename arg `path' to `filename'.
+
+ * abbrev.c (Fexpand_abbrev): Increment plist as use count
+ only if it is an integer.
+
+ * xfns.c (png_load): Set screen_gamma based on f->gamma.
+ If png_get_sRGB gives an answer, call png_set_gamma
+ using the default image gamma value.
+
+ * lread.c (read1): When reading from a file, default string to
+ multibyte only if it has some multibyte characters.
+
+ * print.c (print_object): Output multibyte chars 128...255
+ using \x even if ! print_escape_multibyte.
+
+ * xdisp.c (display_mode_element): Move the places where
+ bytepos, charpos, this, and lisp_string are set.
+ Use lisp_string to set bytepos.
+
+ * xdisp.c (redisplay_internal):
+ Call clear_image_cache only if HAVE_WINDOW_SYSTEM.
+
+ * xdisp.c (display_mode_element): Merge properties specified with
+ :propertize onto those that come with the string.
+
+2002-03-03 Eli Zaretskii <[email protected]>
+
+ * xdisp.c (syms_of_xdisp) <auto-hscroll-mode>: Renamed from
+ automatic-hscrolling. Users changed.
+ <hscroll-margin>: Renamed from automatic-hscroll-margin.
+ Users changed.
+ <hscroll-step>: Renamed from automatic-hscroll-step. Users changed.
+
+2002-03-02 Eli Zaretskii <[email protected]>
+
+ * buffer.c (syms_of_buffer) <buffer-file-coding-system>: Doc fix.
+
+2002-03-02 Kim F. Storm <[email protected]>
+
+ * window.c (Fminibuffer_selected_window): New function.
+ (syms_of_window): Defsubr it.
+
+2002-03-01 Kim F. Storm <[email protected]>
+
+ * window.h (struct window): New member phys_cursor_width.
+
+ * window.c (make_window, replace_window): Init phys_cursor_width.
+
+ * xterm.c (x_display_and_set_cursor): Blink box cursor using
+ hollow box cursor. Blink bar cursor using 1 pixel wide bar.
+
+ * w32term.c (x_display_and_set_cursor): Blink box cursor using
+ hollow box cursor. Blink bar cursor using 1 pixel wide bar.
+
+ * lisp.h (GCPRO6): New macro.
+
+ * process.c (Fopen_network_stream): Use GCPRO6.
+
+2002-03-01 Kim F. Storm <[email protected]>
+
+ * process.c (Qconnect, Qfailed): New variables.
+ (syms_of_process): Intern and staticpro them.
+ (Fprocess_status): Document connect and failed return values.
+ [NON_BLOCKING_CONNECT]: New conditional.
+ (connect_wait_mask, num_pending_connects): New variables.
+ (status_message): Convert Qfailed status.
+ (Fopen_network_stream): Added support for non-blocking connect.
+ New optional args: filter, sentinel, non_blocking. Doc updated.
+ [HAVE_GETADDRINFO, !HAVE_GETADDRINFO]: Merged common code.
+ (deactivate_process): Handle pending non-blocking connect.
+ (wait_reading_process_input): Poll for status of non-blocking
+ connects. Exec sentinel directly when connect succeeds.
+ (status_notify): Don't read process output if not yet connected.
+
+2002-02-28 Kim F. Storm <[email protected]>
+
+ * window.c (minibuf_selected_window): Renamed from
+ Vminibuf_selected_window. Users changed.
+ (syms_of_window): Staticpro it.
+
+2002-02-26 Kim F. Storm <[email protected]>
+
+ The following changes add a new Vminibuf_selected_window variable
+ which is similar to Vminibuf_scroll_window, but which is only set
+ on entry to the minibuffer (from a non-minibuffer window):
+
+ * window.c (Vminibuf_selected_window): New variable.
+ (struct save_window_data): New member minibuf_selected_window.
+ (Fset_window_configuration): Restore Vminibuf_selected_window.
+ (Fcurrent_window_configuration): Save Vminibuf_selected_window.
+ Set minibuf_scroll_window member to nil if minibuf_level is 0.
+ (compare_window_configurations): Compare minibuf_selected_window.
+
+ * window.h (Vminibuf_selected_window): Declare extern.
+
+ * minibuf.c (read_minibuf): Set Vminibuf_selected_window on first
+ entry to minibuffer or on entry from a non-minibuffer window.
+
+ * dispextern.h (CURRENT_MODE_LINE_FACE_ID_3): Compare with
+ Vminibuf_selected_window instead of Vminibuf_scroll_window.
+
+ * xdisp.c (init_iterator): Compare with Vminibuf_selected_window
+ instead of Vminibuf_scroll_window when deciding in which window
+ the region should be highlighted. Consequently, the region remains
+ highlighteded even when a completion buffer is also displayed.
+
+2002-02-26 Eli Zaretskii <[email protected]>
+
+ * fileio.c (Fsubstitute_in_file_name): Fix the change from 2002-02-08.
+
+ * xselect.c (Qcompound_text_with_extensions): Renamed from
+ Qcompound_text_no_extensions.
+ (lisp_data_to_selection_data, syms_of_xselect): Use the new name.
+
+2002-02-26 Juanma Barranquero <[email protected]>
+
+ * w32proc.c (syms_of_ntproc): Doc fix.
+
+2002-02-24 Pavel Jan,Am(Bk <[email protected]>
+
+ * intervals.h: Include "dispextern.h" unconditionally.
+
+2002-02-24 Jason Rumney <[email protected]>
+
+ * Makefile.in (WINNT_SUPPORT) [WINDOWSNT]: Add w32-vars.elc
+ and disp-table.elc.
+ (lisp): Add emacs-lisp/backquote.elc.
+
+2002-02-24 Kim F. Storm <[email protected]>
+
+ * keymap.c (Flookup_key): Fix problem in 2001-12-28 patch:
+ The validation of the event type was too strict as it didn't
+ allow string events; buffer names are used in bindings for
+ menu-bar-select-buffer (see `menu-bar-update-buffers').
+
+2002-02-23 Kim F. Storm <[email protected]>
+
+ The following changes rework my patch of 2002-02-06 which
+ added command remapping by entering the commands directly into
+ the keymaps. Now, command remapping uses an explicit `remap'
+ prefix in the keymaps, i.e. [remap COMMAND].
+
+ * keymap.c (Qremap, remap_command_vector): New variables.
+ (is_command_symbol): Remove function.
+ (Fdefine_key): No longer accept a symbol for KEY.
+ Added validation of [remap COMMAND] argument for KEY.
+ The DEF is no longer required to be a symbol when remapping a command.
+ (Fremap_command): New function to remap command through keymaps.
+ (Flookup_key): Perform command remapping initiated by
+ Fremap_command directly for speed.
+ (Fkey_binding): Use Fremap_command for command remapping.
+ (where_is_internal): Handle new command remapping representation.
+ (syms_of_keymap): Intern Qremap, initialize remap_command_vector,
+ staticpro them. Defsubr Fremap_command.
+
+ * keymap.h (Fremap_command): Declare extern.
+ (is_command_symbol): Remove extern.
+
+ * keyboard.c (command_loop_1): Use Fremap_command for command
+ remapping; now try command remapping for all symbols.
+
+2002-02-23 Eli Zaretskii <[email protected]>
+
+ * coding.h (run_pre_post_conversion_on_str): Add prototype.
+
+2002-02-23 Jason Rumney <[email protected]>
+
+ * w32select.c (Fw32_set_clipboard_data): Run pre-write-conversion
+ on the string before encoding it.
+ (Fw32_get_clipboard_data): Run post-read-conversion on the string
+ after decoding it.
+
+ * w32fns.c (w32_wnd_proc) <WM_TIMER>: Fix last change.
+
+2002-02-23 Pavel Jan,Am(Bk <[email protected]>
+
+ * w32term.c (enter_timestamp): Remove unused static variable to
+ prevent warning.
+
+ * xterm.c (enter_timestamp): Put in #if 0 to prevent warning.
+
+2002-02-23 Eli Zaretskii <[email protected]>
+
+ * w16select.c (Fw16_get_clipboard_data): Fix last change.
+
+ * xselect.c (selection_data_to_lisp_data): Fix last change.
+
+2002-02-22 Jason Rumney <[email protected]>
+
+ * w32term.h (struct w32_output): New member menu_command_in_progress.
+
+ * w32menu.c (menubar_selection_callback): Free the menu and
+ clear the menu_command_in_progress flag.
+
+ * w32fns.c (mouse_move_timer, mouse_button_timer): Initialize.
+ (menu_free_timer): New variable.
+ (MENU_FREE_ID, MENU_FREE_DELAY): New constants.
+ (w32_wnd_proc) <WM_TIMER>: Handle menu_free_timer.
+ <WM_EXITMENULOOP>: Delay before freeing menu. Do nothing if a
+ menu command is in progress.
+ <WM_COMMAND>: Set the menu_command_in_progress flag.
+ Kill any menu_free_timer that is running.
+
+ * w32term.c (w32_text_out): Renamed from W32_TEXTOUT.
+ Call ExtTextOutA rather than ExtTextOut.
+
+2002-02-22 Eli Zaretskii <[email protected]>
+
+ * puresize.h (BASE_PURESIZE): Increase to 755000.
+
+2002-02-22 Eli Zaretskii <[email protected]>
+
+ * w16select.c (Fw16_set_clipboard_data): Run pre-write-conversion
+ on the string before encoding it.
+ (Fw16_get_clipboard_data): Run post-read-conversion on the string
+ after decoding it.
+
+2002-02-22 Eli Zaretskii <[email protected]>
+
+ Support for ICCCM Extended Segments in X selections:
+
+ * xselect.c <Qcompound_text_no_extensions>: New variable.
+ (syms_of_xselect): Intern and staticpro it.
+ (selection_data_to_lisp_data): Run post-read-conversion on decoded
+ selection text.
+ (lisp_data_to_selection_data): If next-selection-coding-system is
+ compound-text-no-extensions, set the type of selection to be
+ compound-text.
+
+ * xterm.h (x_encode_text): Update prototype.
+
+ * xfns.c (x_encode_text): Accept additional arg SELECTIONP; all
+ callers changed. If SELECTIONP is non-zero, run the
+ pre-write-conversion function before encoding the selection text.
+
+2002-02-21 Kim F. Storm <[email protected]>
+
+ * frame.c (syms_of_frame): Change mouse-highlight default to t.
+
+ * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
+ Correct composing of language-change event.
+
+2002-02-20 Kim F. Storm <[email protected]>
+
+ * keyboard.c (menu_bar_items): Don't include keymap or local-map
+ bindings at PT when building menu (the menu is not updated often
+ enough for this to work reliable).
+ (tool_bar_items): Likewise.
+ (current_active_maps): Removed unused (and buggy) function.
+
+2002-02-20 Pavel Jan,Am(Bk <[email protected]>
+
+ * xfns.c (gif_load): Use correct width and height for GIF images.
+
+2002-02-19 Eli Zaretskii <[email protected]>
+
+ * floatfns.c (Fatan): Accept an optional second arg and call
+ atan2 if passed 2 args.
+
+2002-02-18 Jason Rumney <[email protected]>
+
+ * w32term.c (glyph_rect): Determine the row and glyph more precisely.
+
+2002-02-17 Jason Rumney <[email protected]>
+
+ * w32term.c (x_autoselect_window_p): New variable.
+ (syms_of_w32term): DEFVAR_BOOL and initialize it.
+ (note_mouse_movement): Use it.
+
+ * w32fns.c (w32_load_system_font): Never set fonts_changed_p to zero.
+
+ * w32bdf.c (w32_load_bdf_font): Maybe set fonts_changed_p.
+
+ * w32fns.c (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth):
+ New variables.
+ (syms_of_w32fns): Intern and staticpro them.
+ (x_frame_parms) <"fullscreen">: New parameter.
+ (x_fullscreen_move, x_set_fullscreen): New functions.
+ (x_set_frame_parameters): Support Qfullscreen.
+ (x_real_positions): Save x/y_pixels_diff frame params.
+ (x_figure_window_size): Support full-screen frames.
+ (Fx_create_frame): Default the fullscreen parameter.
+
+ * w32term.c (x_check_fullscreen, x_check_fullscreen_move)
+ (x_fullscreen_adjust): New functions.
+ (w32_read_socket) <WM_WINDOWPOSCHANGED>: Don't resize to
+ fullscreen. Call x_check_fullscreen_move, and set the
+ want_fullscreen member of output_data.w32
+ <WM_ACTIVATE, WM_ACTIVATEAPP>: Call x_check_fullscreen.
+
+ * w32term.h: New enum for FULLSCREEN_* constants.
+ (struct w32_output): New members want_fullscreen, x_pixels_diff,
+ y_pixels_diff, x_pixels_outer_diff, and y_pixels_outer_diff.
+ (x-fullscreen-adjust): New prototype.
+
+2002-02-17 Kim F. Storm <[email protected]>
+
+ * frame.c (Vmouse_highlight): New variable.
+ (syms_of_frame): DEFVAR_LISP it.
+
+ * frame.h (Vmouse_highlight): Declare extern.
+
+ * xterm.h (struct x_display_info): Add mouse_face_hidden.
+
+ * xterm.c (disable_mouse_highlight): Removed variable.
+ (note_mouse_highlight): Don't highlight if Vmouse_highlight is nil.
+ (show_mouse_face): Don't show highlight if mouse_face_hidden is set.
+ (XTread_socket): Turn mouse_face_hidden off after mouse movement,
+ and on after keyboard input.
+ (x_term_init): Initialize mouse_face_hidden.
+
+ * msdos.h (struct display_info): Add mouse_face_hidden.
+
+ * msdos.c (disable_mouse_highlight): Removed variable.
+ (show_mouse_face): Don't show highlight if mouse_face_hidden is set.
+ (IT_note_mouse_highlight): Don't highlight if Vmouse_highlight is nil.
+ (internal_terminal_init): Initialize mouse_face_hidden.
+ (dos_rawgetc): Turn mouse_face_hidden off after mouse movement,
+ and on after keyboard input.
+
+ * w32term.h (struct w32_display_info): Add mouse_face_hidden.
+
+ * w32term.c (disable_mouse_highlight): Removed variable.
+ (note_mouse_highlight): Disable highlight if Vmouse_highlight is nil.
+ (show_mouse_face): Don't show highlight if mouse_face_hidden is set.
+ (w32_read_socket): Turn mouse_face_hidden off after mouse movement,
+ and on after keyboard input.
+ (w32_initialize_display_info): Initialize mouse_face_hidden.
+
+2002-02-16 Eli Zaretskii <[email protected]>
+
+ * msdos.c (last_mouse_window): New variable.
+ (dos_rawgetc): Fix last change--if the mouse is in the same window
+ as recorded in last_mouse_window, don't select this window.
+
+ * Makefile.in (lisp, shortlisp): Use cus-start.elc, not cus-start.el.
+
+ * msdos.c (x_autoselect_window_p): New variable.
+ (syms_of_msdos): Defvar it.
+ (dos_rawgetc): If x_autoselect_window_p is set, select the window in
+ which the last mouse movement occured, unless it is already selected.
+
+ * xdisp.c (automatic_hscroll_margin, Vautomatic_hscroll_step):
+ New variables.
+ (syms_of_xdisp): DEVFAR them.
+ (hscroll_window_tree): Use automatic_hscroll_margin and
+ Vautomatic_hscroll_step to compute the amount of window scrolling.
+
+2002-02-16 Pavel Jan,Am(Bk <[email protected]>
+
+ * xterm.c (x-autoselect-window): New variable.
+ (note_mouse_movement): Use it.
+
+ * keyboard.c: Do not include "systime.h" twice.
+
+2002-02-15 Andreas Schwab <[email protected]>
+
+ * puresize.h (PURESIZE_RATIO): Increase to 9/5.
+
+ * alloc.c (NSTATICS): Increase to 1280.
+
+2002-02-15 Kai Gro,A_(Bjohann <[email protected]>
+
+ * alloc.c (NSTATICS): Bump to 1026.
+
+ * xterm.c (Vx_alt_keysym, Vx_hyper_keysym, Vx_meta_keysym)
+ (Vx_super_keysym): New variables.
+ (syms_of_xterm): DEFVAR_LISP them.
+ (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Use the
+ variables to determine which keys to use for the various modifiers.
+
+2002-02-13 Kim F. Storm <[email protected]>
+
+ * window.c (Vmode_line_in_non_selected_windows): Removed.
+ (mode_line_in_non_selected_windows): New variable.
+ (syms_of_window): DEFVAR_BOOL it.
+
+ * dispextern.h (CURRENT_MODE_LINE_FACE_ID_3):
+ Use mode_line_in_non_selected_windows.
+ (mode_line_in_non_selected_windows): Declare extern.
+ (Vmode_line_in_non_selected_windows): Removed extern.
+
+2002-02-13 Richard M. Stallman <[email protected]>
+
+ * keyboard.c (Fthis_command_keys, Fthis_command_keys_vector)
+ (Fthis_single_command_keys, Fthis_single_command_raw_keys)
+ (Fclear_this_command_keys): Doc fixes.
+
+ * xfaces.c (Finternal_make_lisp_face, Finternal_copy_lisp_face)
+ (update_face_from_frame_parameter): Increment face_change_count
+ and windows_or_buffers_changed to force redisplay using changed faces.
+
+ * xdisp.c (QCpropertize): New variable.
+ (mode_line_proptrans_alist): New variable.
+ (display_mode_element): New arg PROPS; all calls changed.
+ Implement this, for strings.
+ Handle literal output of strings by sharing the
+ main-line code for strings, using local var `literal'.
+ Handle :propertize feature.
+ (syms_of_xdisp): Initialze and staticpro QCpropertize and
+ mode_line_proptrans_alist.
+
+2002-02-11 Kim F. Storm <[email protected]>
+
+ * window.c (Vmode_line_in_non_selected_windows): New variable.
+ (syms_of_window): DEFVAR_LISP it.
+
+ * dispextern.h (CURRENT_MODE_LINE_FACE_ID_3): New macro.
+ (CURRENT_MODE_LINE_FACE_ID): Use it.
+ (Vmode_line_in_non_selected_windows): Declare extern.
+
+ * xdisp.c (display_mode_lines): Use CURRENT_MODE_LINE_FACE_ID_3
+ to get mode line face.
+
+2002-02-11 Eli Zaretskii <[email protected]>
+
+ * msdos.c (Vx_bitmap_file_path, x_stretch_cursor_p): Remove these
+ variables; cus-start.el doesn't need them anymore.
+
+2002-02-09 Kim F. Storm <[email protected]>
+
+ * insdel.c (make_gap_smaller): Preserve BEG_UNCHANGED during gap
+ reduction. This fixes a display problem where stray newlines were
+ inserted in the window (corrected by C-l). Clarified code (IMHO).
+
+2002-02-09 Eli Zaretskii <[email protected]>
+
+ * dispextern.h (CURRENT_MODE_LINE_FACE_ID): Fix last change.
+
+ * xdisp.c (display_mode_lines): Fix last change.
+
+2002-02-09 Jason Rumney <[email protected]>
+
+ * w32fns.c (enum_font_cb2): Don't let charsets unknown to Windows
+ match each other.
+ (w32_load_system_font): Prevent Cleartype fonts from loading.
+ (Fx_show_tip): Ensure tip frames are above other topmost windows.
+
+2002-02-09 Kim F. Storm <[email protected]>
+
+ * dispextern.h (CURRENT_MODE_LINE_FACE_ID): New macro.
+ (CURRENT_MODE_LINE_HEIGHT): Use it.
+ (enum face_id): Add MODE_LINE_INACTIVE_FACE_ID.
+
+ * xdisp.c (window_box_height): Use CURRENT_MODE_LINE_FACE_ID.
+ (pos_visible_p, handle_face_prop): Likewise.
+ (display_mode_lines): Likewise, but for the real selected window.
+ (init_iterator) [row == NULL]: Handle MODE_LINE_INACTIVE_FACE_ID.
+
+ * xfaces.c (Qmode_line_inactive): New face variable for mode-line
+ in non-selected windows.
+ (realize_basic_faces): Realize it.
+ (syms_of_term): Intern and staticpro it.
+
+2002-02-08 Kim F. Storm <[email protected]>
+
+ * alloc.c (SETJMP_WILL_LIKELY_WORK, SETJMP_WILL_NOT_WORK):
+ Changed mail addresses to [email protected].
+
+2002-02-08 Eli Zaretskii <[email protected]>
+
+ * fileio.c (Fsubstitute_in_file_name): If the file name includes
+ ~user, and there's no such user, don't discard everything before ~user.
+
+ * floatfns.c (Fround): Doc fix.
+
+2002-02-08 Pavel Jan,Am(Bk <[email protected]>
+
+ * sysdep.c (init_system_name): Put unused variable `p' in #if 0.
+
+2002-02-07 Stefan Monnier <[email protected]>
+
+ * lisp.h (Fx_file_dialog): Add extern decl (used in fileio.c).
+
+2002-02-07 Kim F. Storm <[email protected]>
+
+ * keymap.c (where_is_internal): Only check whether definition is
+ remapped if it fulfills is_command_symbol.
+
+2002-02-07 Andreas Schwab <[email protected]>
+
+ * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT): Define to 2 for m68k.
+
+ * alloc.c (mark_stack): Don't assume sizeof (Lisp_Object) is 4.
+
+2002-02-06 Kim F. Storm <[email protected]>
+
+ * keymap.c (Fdefine_key): Allow symbol as KEY argument for
+ defining command remapping. Doc updated.
+ (Flookup_key): Remap command through keymap if KEY is a symbol.
+ (is_command_symbol): New function.
+ (Fkey_binding): Use it. New optional argument NO-REMAP.
+ Doc updated. Callers changed. Perform command remapping via
+ recursive call unless that arg is non-nil.
+ (where_is_internal): New argument no_remap. Callers changed.
+ Call recursively to find original key bindings for a remapped
+ comand unless that arg is non-nil.
+ (Fwhere_is_internal): New optional argument NO-REMAP.
+ Doc updated. Callers changed. Pass arg to where_is_internal.
+
+ * keymap.h (Fkey_binding, Fwhere_is_internal): Update prototype.
+ (is_command_symbol): Add prototype.
+
+ * keyboard.c (Vthis_original_command): New variable.
+ (syms_of_keyboard): DEFVAR_LISP it.
+ (command_loop_1): Set it, and perform command remapping.
+
+2002-02-06 Pavel Jan,Am(Bk <[email protected]>
+
+ * keyboard.c (recursive_edit_1): Call cancel_hourglass unconditionally.
+
+2002-02-06 Jason Rumney <[email protected]>
+
+ * w32term.c (w32_native_per_char_metric): Disable 2002-01-20 change.
+
+2002-02-06 Eli Zaretskii <[email protected]>
+
+ * charset.c (get_charset_id): Use if-else instead of ?:.
+
+2002-02-06 Richard M. Stallman <[email protected]>
+
+ * filelock.c (S_ISLNK): Define if not defined.
+
+2002-02-03 Richard M. Stallman <[email protected]>
+
+ * fileio.c (Fdo_auto_save): Improve "auto save disabled" msg.
+
+ * lread.c (read1): Redesign strategy for force_multibyte and
+ force_singlebyte. Now is_multibyte records whether read_buffer
+ is multibyte. Encountering any multibyte character makes it so.
+
+2002-02-02 Stefan Monnier <[email protected]>
+
+ * term.c (term_get_fkeys_1): If `k0' and `k;' are both specified and
+ with the same sequence, map that sequence to f10 rather than f0.
+
+2002-02-03 Andreas Schwab <[email protected]>
+
+ * s/gnu-linux.h: Check for __mc68000__ instead of __m68k__, the
+ latter never being defined on GNU/Linux.
+
+2002-02-02 Eli Zaretskii <[email protected]>
+
+ * xfaces.c (realize_default_face): Don't set the weight and slant of
+ the default face to Qnormal, unless these attributes are unspecified.
+
+2002-02-02 Pavel Jan,Am(Bk <[email protected]>
+
+ * keyboard.c (command_loop_1) [HAVE_X_WINDOWS]:
+ Call cancel_hourglass unconditionally.
+
+ * eval.c (Fsignal): Remove duplicated declaration of
+ the variable `display_hourglass_p'.
+
+2002-01-31 Richard M. Stallman <[email protected]>
+
+ * editfns.c (region_limit): Nicer error message.
+
+ * coding.c (decode_composition_emacs_mule):
+ Give up if NCOMPONENT gets too large to index `component'.
+
+ * callint.c (check_mark): New arg to specify clearer error message.
+ Callers changed.
+
+2002-01-27 Richard M. Stallman <[email protected]>
+
+ * minibuf.c (Fcompleting_read): Doc fix.
+
+2002-01-27 Pavel Jan,Am(Bk <[email protected]>
+
+ * minibuf.c (Fread_from_minibuffer, Fread_command, Fread_function)
+ (Fread_variable, Fread_buffer, minibuffer-completion-confirm):
+ Fix doc-strings.
+
+2002-01-26 Richard M. Stallman <[email protected]>
+
+ * buffer.c (syms_of_buffer): Doc fixes for scroll-...-aggressively.
+
+ * xdisp.c (try_scrolling): Exchange uses of scroll_down_aggressively
+ and scroll_up_aggressively.
+
+2002-01-26 Pavel Jan,Am(Bk <[email protected]>
+
+ * keyboard.c (parse_tool_bar_item): Remove duplicated prototypes.
+
+2002-01-25 Stefan Monnier <[email protected]>
+
+ * textprop.c (Fnext_property_change, Fnext_single_property_change)
+ (Fprevious_property_change, Fprevious_single_property_change):
+ Stay within the narrowed-buffer boundaries.
+
+2002-01-25 Eli Zaretskii <[email protected]>
+
+ * term.c (Ftty_display_color_cells): New function.
+ (syms_of_term): Defsubr it.
+ (Ftty_display_color_cells, Ftty_display_color_p): Change the
+ argument name to DISPLAY. Doc fix.
+
+ * dispextern.h: Add prototype for set_tty_color_mode and
+ tty_setup_colors.
+
+2002-01-24 Jason Rumney <[email protected]>
+
+ * w32term.c (x_scroll_run): Use ScrollWindowEx in place of BitBlt.
+ If region left to draw is not what was expected, mark the frame as
+ garbaged.
+
+ * w32fns.c (w32_wnd_proc) <WM_PAINT>: Initialize update_rect.
+ Combine the regions returned by BeginPaint and GetUpdateRect.
+
+2002-01-23 Jason Rumney <[email protected]>
+
+ * w32term.c (x_update_window_begin): Only hide caret if
+ w32_use_visible_system_caret is set.
+ (x_update_window_end): Only show caret if
+ w32_use_visible_system_caret is set.
+ (syms_of_w32term): Handle SystemParametersInfo call failing.
+
+ * w32fns.c (syms_of_w32fns): Initialize w32_visible_system_caret_hwnd.
+
+2002-01-22 Richard M. Stallman <[email protected]>
+
+ * unexelf.c (unexec): Define n so as to cause compilation error
+ for the code where people have often written n instead of nn.
+
+ * .gdbinit (hookpost-run): Defined.
+
+2002-01-22 Jan Dj,Ad(Brv <[email protected]>
+
+ * xfns.c (x_set_frame_parameters): Typo in previous fix corrected.
+
+2002-01-21 Jan Dj,Ad(Brv <[email protected]>
+
+ * xfns.c (x_set_frame_parameters): Just call x_fullscreen_adjust
+ if fullscreen is being set.
+
+2002-01-21 Pavel Jan,Am(Bk <[email protected]>
+
+ * minibuf.c (Fminibuffer_contents)
+ (Fminibuffer_contents_no_properties, Fread_from_minibuffer)
+ (Fread_string, Fread_no_blanks_input, Fcompleting_read): Doc fixes.
+
+2002-01-21 Richard M. Stallman <[email protected]>
+
+ * window.c (check_frame_size): Fix minimum height calculation.
+
+2002-01-20 Ken Raeburn <[email protected]>
+
+ * dispextern.h (WINDOW_WANTS_MODELINE_P): Use XFASTINT on window
+ height before comparison.
+ (WINDOW_WANTS_HEADER_LINE_P): Likewise.
+
+2002-01-20 Jason Rumney <[email protected]>
+
+ * w32term.c (w32_system_caret_width): Remove.
+ (w32_use_visible_system_caret): New user flag.
+ (syms_of_w32term): DEFVAR_BOOL it. Initialize based on whether
+ Windows reports a screen reader running.
+ (x_update_window_begin): Hide the system caret.
+ (x_update_window_end): Show the system caret.
+ (x_display_and_set_cursor): Don't draw a cursor when
+ w32_use_visible_system_caret is set. Do not adjust width.
+
+ * w32fns.c (w32_visible_system_caret_hwnd): New static variable.
+ (w32_wnd_proc) <WM_KILL_FOCUS, WM_EMACS_DESTROY_CARET>: Set it.
+ <WM_EMACS_TRACK_CARET>: Arrange for system caret to be visible if
+ the user requests it. Use system default width when creating.
+ <WM_EMACS_HIDE_CARET, WM_EMACS_SHOW_CARET>: Handle new messages.
+
+ * w32term.h (WM_EMACS_SHOW_CARET, WM_EMACS_HIDE_CARET):
+ New window messages.
+
+2002-01-20 Richard M. Stallman <[email protected]>
+
+ * window.c (MIN_SAFE_WINDOW_HEIGHT): Value now 1.
+
+2002-01-20 Pavel Jan,Am(Bk <[email protected]>
+
+ * doprnt.c (doprnt1): Fix typos in error call.
+
+2002-01-20 Eli Zaretskii <[email protected]>
+
+ * unexelf.c (unexec) [__sgi]: Support the .got sections.
+
+2002-01-20 Jason Rumney <[email protected]>
+
+ * w32term.c (w32_native_per_char_metric): Don't trust the metrics
+ that Windows returns. If a double check fails, try to guess how
+ ExtTextOut is going to act.
+
+ * w32fns.c (w32_load_system_font, w32_to_x_charset): Use strnicmp
+ in place of stricmp.
+ (w32_list_synthesized_fonts): Removed.
+ (w32_to_all_x_charsets, enum_font_maybe_add_to_list): New functions.
+ (struct enumfont_t): New element; list.
+ (enum_font_cb2): List all style and charset variations of a font.
+ (Fw32_select_font): New optional argument; include_proportional.
+ Exclude vertical fonts. Exclude proportional fonts unless
+ include_proportional is non-nil.
+ (w32_enable_synthesized_fonts): Change to a boolean.
+ (Fw32_send_sys_command): Doc fix.
+
+2002-01-19 Pavel Jan,Am(Bk <[email protected]>
+
+ * dispnew.c (update_frame): Move the variable `tem' to the block
+ where it is used.
+
+2002-01-19 Jason Rumney <[email protected]>
+
+ * w32fns.c (Fx_create_frame): Bind redisplay-dont-pause around
+ call to face-set-after-frame-default.
+
+2002-01-18 Richard M. Stallman <[email protected]>
+
+ * dispextern.h (WINDOW_WANTS_MODELINE_P): Check window height > 1.
+ (WINDOW_WANTS_HEADER_LINE_P): Check window height provides room.
+
+2002-01-17 Richard M. Stallman <[email protected]>
+
+ * window.c (enlarge_window): When exceeding size of parent,
+ directly delete all the siblings instead of trying to resize it.
+
+2002-01-17 Pavel Jan,Am(Bk <[email protected]>
+
+ * term.c (set_tty_color_mode): Remove unused variable `tem'.
+
+2002-01-16 Henrik Enberg <[email protected]>
+
+ * lread.c (init_lread): Move the installed-lisp dirs later in the path.
+
+2002-01-16 Kim F. Storm <[email protected]>
+
+ * xterm.c (x_erase_phys_cursor): Don't erase cursor if cursor row
+ is invisible. This can happen if cursor is on top line of a
+ window, and we switch to a buffer with a header line.
+
+ * w32term.c (x_erase_phys_cursor): Ditto.
+
+2002-01-16 Pavel Jan,Am(Bk <[email protected]>
+
+ * xterm.c (XTread_socket) [!USE_X_TOOLKIT]: Compute the value of
+ `dont_resize' only when used.
+
+ * xdisp.c: Remove forgotten extern declaration of `Qimage'.
+
+2002-01-15 Eli Zaretskii <[email protected]>
+
+ * xdisp.c (display_mode_element): When computing charpos, depend
+ on multibyteness of elt, not the text in field.
+
+2002-01-15 Pavel Jan,Am(Bk <[email protected]>
+
+ * buffer.c (Fkill_all_local_variables):
+ Increment `update_mode_lines' only once.
+
+2002-01-14 Pavel Jan,Am(Bk <[email protected]>
+
+ * lisp.h (adjust_after_replace_noundo)
+ (Fupdate_coding_systems_internal): Add prototypes.
+
+ * sound.c (Fplay_sound): Initialize header_size also for :data case.
+
+2002-01-14 Eli Zaretskii <[email protected]>
+
+ Support for the --color command-line argument and tty-color-mode
+ frame parameter:
+
+ * term.c (tty_default_color_capabilities, tty_setup_colors)
+ (set_tty_color_mode): New functions.
+ (term_init): Call tty_default_color_capabilities.
+ (Qtty_color_mode_alist): New variable.
+ (syms_of_term): Intern and staticpro it.
+
+ * frame.c (store_frame_param): Call set_tty_color_mode for termcap
+ frames.
+ (do_switch_frame): For termcap frames, switch the tty
+ color mode as specified by the frame's parameters.
+ (Qtty_color_mode): New variable.
+ (syms_of_frame): Intern and staticpro it.
+
+ * emacs.c (USAGE2): Add the --color option.
+ (standard_args): Ditto.
+
+2002-01-13 Jan Dj,Ad(Brv <[email protected]>
+
+ * xterm.h (struct x_output): New members want_fullscreen,
+ x_pixels_diff, y_pixels_diff, x_pixels_outer_diff, and
+ y_pixels_outer_diff.
+ New enum for FULLSCREEN_* constants.
+ (FRAME_OUTER_WINDOW): Handle the case where output_data.x->widget
+ is NULL.
+ (x_fullscreen_adjust): Add prototype.
+
+ * emacs.c (USAGE2): Add the new full-screen arguments.
+ (standard_args): Ditto.
+
+ * xfns.c (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth):
+ New variables.
+ (syms_of_xfns): Intern and staticpro them.
+ (x_frame_parms) <"fullscreen">: New parameter.
+ (x_fullscreen_move, x_set_fullscreen): New functions.
+ (x_set_frame_parameters): Support for Qfullscreen.
+ (x_real_positions): More accurate computation of the frame position.
+ (x_figure_window_size): Support full-screen frames.
+ (Fx_create_frame): Default the fullscreen parameter.
+
+ * xterm.c (x_check_fullscreen, x_fullscreen_adjust): New functions.
+ (XTread_socket) <Expose>: Call x_check_fullscreen.
+ <ConfigureNotify>: Don't resize to fullscreen.
+ Call x_check_fullscreen_move, and set the want_fullscreen member of
+ output_data.x.
+
+2002-01-13 Jason Rumney <[email protected]>
+
+ * w32term.h (WM_XBUTTONDOWN, WM_XBUTTONUP): New window messages
+ for mice with more than 3 buttons.
+
+ * w32term.c (parse_button): New parameter xbutton. Callers changed.
+ (w32_read_socket): Handle new "XBUTTON" messages.
+
+ * w32fns.c (w32_pass_extra_mouse_buttons_to_system): New user option.
+ (syms_of_w32fns): DEFVAR_BOOL it.
+ (w32_wnd_proc): Handle new "XBUTTON" messages.
+
+2002-01-13 Pavel Jan,Am(Bk <[email protected]>
+
+ * keyboard.c (read_key_sequence): Remove unused variable `extra_maps'.
+
+2002-01-13 Andreas Schwab <[email protected]>
+
+ * xterm.c (x_load_font): Never set fonts_changed_p to zero.
+
+2002-01-12 Andreas Schwab <[email protected]>
+
+ * .gdbinit (xbuffer): Remove address operator since data is now a
+ pointer.
+
+2002-01-11 Richard M. Stallman <[email protected]>
+
+ * insdel.c (adjust_after_replace_noundo): New function.
+
+ * coding.c (code_convert_region): Don't copy old text if undo disabled.
+
+2002-01-09 Jason Rumney <[email protected]>
+
+ * xdisp.c (x_consider_frame_title): Don't count the tooltip frame
+ when checking for multiple frames.
+
+2002-01-08 Richard M. Stallman <[email protected]>
+
+ * window.c (delete_window): Rewrite the code for changing the
+ selected window to handle the case where WINDOW is not a leaf.
+
+2002-01-07 Eli Zaretskii <[email protected]>
+
+ * process.c (send_process): Set src_multibyte to 1 after the call
+ top setup_coding_system, not before the call.
+
+2002-01-07 Jason Rumney <[email protected]>
+
+ * xmenu.c (set_frame_menubar, xmenu_show):
+ (xdialog_show): Initialize wv->help to Qnil.
+
+ * w32menu.c (single_submenu, set_frame_menubar, w32_menu_show):
+ (w32_dialog_show): Initialize wv->help to Qnil.
+
+2002-01-06 Jason Rumney <[email protected]>
+
+ * xmenu.c (single_submenu): Initialize wv->help to Qnil.
+
+ * w32menu.c (w32_menu_display_help): Revert last change.
+
+ * xmenu.c (menu_highlight_callback): Revert last change.
+
+2002-01-06 Andreas Schwab <[email protected]>
+
+ * insdel.c (make_gap_larger): Make sure buffer size does not
+ overflow range of int.
+
+2002-01-05 Jason Rumney <[email protected]>
+
+ * w32term.c (x_draw_glyphs): Don't call notice_overwritten_cursor if
+ OVERLAPS_P.
+
+ * w32menu.c (w32_menu_display_help): Hide any tooltip window.
+
+ * w32fns.c (compute_tip_xy): If tooltip won't fit on the screen
+ to the left or to the right of the pointer, put it against
+ the left screen edge.
+ (x_frame_parms): Add missing braces around initializer.
+
+ * w32term.c (x_setup_relief_colors): Don't compute an image's
+ background color if it doesn't have a Pixmap.
+ (notice_overwritten_cursor): Don't depend on
+ output_cursor and updated_area. Compare pixel coordinates with
+ window's cursor pixel coordinates.
+ (x_draw_glyphs, x_clear_end_of_line, show_mouse_face):
+ Call notice_overwritten_cursor with new arg list.
+ (show_mouse_face): Fix bug setting a row's mouse_face_p flag
+ unconditionally.
+ (x_draw_image_relief): Use predefined macro instead of
+ constant when the value of `tool_bar_button_relief' is negative.
+
+ * w32term.c (x_display_and_set_cursor): Fix PostMessage arg types.
+
+2002-01-04 Richard M. Stallman <[email protected]>
+
+ * xmenu.c (menu_highlight_callback): Hide any tooltip window.
+
+2002-01-03 Richard M. Stallman <[email protected]>
+
+ * keymap.c (Fcurrent_active_maps): Put the `keymap' property map first.
+ (Fkey_binding): Try the `keymap' property map first.
+ (Fdescribe_buffer_bindings): Show `keymap' property bindings before
+ minor mode bindings.
+
+2002-01-03 Kim F. Storm <[email protected]>
+
+ * keyboard.c (read_key_sequence): Fix cast of submaps arg to bcopy.
+
+2002-01-02 Richard M. Stallman <[email protected]>
+
+ * keyboard.c (read_key_sequence): Handle the keymap property
+ before minor mode maps.
+
+ * editfns.c (Fformat): Update thissize from field_width
+ based on the actual width, in the string case.
+
+2002-01-01 Pavel Jan,Am(Bk <[email protected]>
+
+ * charset.h (UNIBYTE_STR_AS_MULTIBYTE_P): Parenthesize assignment
+ when used as truth value to prevent gcc warnings.
+
+ * sysdep.c, unexapollo.c, w32.c, w32bdf.c, w32heap.c, w32inevt.c,
+ * w32proc.c: Include <config.h>.
+
+2002-01-01 Andreas Schwab <[email protected]>
+
+ * eval.c (max_specpdl_size, max_lisp_eval_depth): Define as int,
+ not EMACS_INT, to make them compatible with DEFVAR_INT.
+ * lisp.h (max_specpdl_size): Adjust declaration.
+
+2002-01-01 Richard M. Stallman <[email protected]>
+
+ * print.c (print_object): Test print_escape_nonascii only for
+ unibyte strings.
+ (PRINTPREPARE): Once again bind Qprint_escape_nonascii
+ when outputting to a multibyte buffer.
+
+2001-12-29 Richard M. Stallman <[email protected]>
+
+ * print.c (print_object): In multibyte string, use hex escapes.
+ Use octal only for unibyte strings.
+ (PRINTPREPARE): Don't ever set Qprint_escape_nonascii.
+
+ * lread.c (read_escape): New arg BYTEREP for reporting whether
+ escape forces unibyte or multibyte.
+ (read1): When reading a string, take note of that info.
+
+2001-12-29 Ken Raeburn <[email protected]>
+
+ * abbrev.c (Fexpand_abbrev): Use NILP instead of implicit zero
+ comparison to test lisp value returned by Fget.
+
+2001-12-29 Richard M. Stallman <[email protected]>
+
+ * lisp.h (max_specpdl_size): Add declaration.
+
+ * fileio.c (Fdo_auto_save): If NO_MESSAGE, don't call push_message.
+
+ * keymap.c (silly_event_symbol_error): New subrtn, from Fdefine_key.
+ Handle modifier bits. Correct typo in error message.
+
+2001-12-28 Richard M. Stallman <[email protected]>
+
+ * abbrev.c: Use the plist of an abbrev for multiple params if nec.
+ (Fdefine_abbrev): New arg SYSTEM-FLAG for a system abbrev.
+ (Fdefine_global_abbrev, Fdefine_mode_abbrev):
+ Update calls to Fdefine_abbrev.
+ (write_abbrev): Update for changed data format.
+ Don't list "system" abbrevs.
+ (Fexpand_abbrev): Update use count with new data format.
+ (describe_abbrev): Update for changed data format.
+ (Fdefine_abbrev_table): Handle the new SYSTEM-FLAG.
+
+ * config.in (HAVE_MBSINIT): Add #undef.
+
+ * strftime.c (mbsinit): Define as no-op if not available.
+
+ * s/sco5.h (LIBX11_SYSTEM) [MOTIF]: Add -lgen.
+ (sigprocmask_set): Conditionalize decl on ! NOT_C_CODE.
+
+ * keymap.c (Flookup_key): Error message if key has wrong data type.
+ (Fdefine_key): Add error message for trying to bind [DEL], [RET], etc.
+ (exclude_key): New variable.
+
+2001-12-28 Gerd Moellmann <[email protected]>
+
+ * xterm.c (x_setup_relief_colors): Don't compute an image's
+ background color if it doesn't have a Pixmap.
+
+ * xterm.c (notice_overwritten_cursor): Don't depend on
+ output_cursor and updated_area. Compare pixel coordinates with
+ window's cursor pixel coordinates.
+ (x_draw_glyphs, x_clear_end_of_line, show_mouse_face):
+ Call notice_overwritten_cursor with new arg list.
+ (show_mouse_face): Fix bug setting a row's mouse_face_p flag
+ unconditionally.
+
+ * xdisp.c (try_scrolling) <PT below scroll margin>: Add the
+ height of the cursor line to the amount to scroll.
+
+2001-12-27 Richard M. Stallman <[email protected]>
+
+ * intervals.c (set_point_both): The position after an invisible,
+ intangible character is not an acceptable stopping point.
+
+2001-12-27 Ken Raeburn <[email protected]>
+
+ * window.c (enlarge_window): In new preserve_before code, convert
+ CURBEG from lisp object to integer before doing arithmetic.
+
+2001-12-27 Richard M. Stallman <[email protected]>
+
+ * bytecode.c (Fbyte_code): Undo previous change.
+
+2001-12-26 Kim F. Storm <[email protected]>
+
+ * keyboard.c (record_char): Ignore duplicate help-echo events only
+ separated by mouse-movement. When tracking mouse, only record
+ first and last mouse-movement event in same window.
+ Don't record mouse-movement events in keyboard macros.
+
+2001-12-25 Richard M. Stallman <[email protected]>
+
+ * window.c (enlarge_window): New arg PRESERVE_BEFORE. Callers changed.
+ (Fenlarge_window): New arg PRESERVE_BEFORE.
+
+ * bytecode.c (Fbyte_code): Use Fstring_make_unibyte
+ instead of Fstring_as_unibyte.
+
+2001-12-22 Pavel Jan,Am(Bk <[email protected]>
+
+ The following changes remove mocklisp support:
+
+ * mocklisp.h, mocklisp.c: Files removed.
+
+ * lisp.h: Remove declarations of variables `Vmocklisp_arguments',
+ `Qmocklisp' and `Qmocklisp_arguments'.
+ Remove prototype of syms_of_mocklisp.
+
+ * makefile.nt, makefile.w32-in, Makefile.in: Remove mocklisp files.
+
+ * callint.c: Do not include mocklisp.h.
+ (Fcall_interactively): Do not test for mocklisp case.
+
+ * eval.c: Remove variables `Qmocklisp_arguments',
+ `Vmocklisp_arguments' and `Qmocklisp'. Remove prototype of ml_apply.
+ (Fprogn, Fwhile, Fcommandp, Feval, Ffuncall, funcall_lambda):
+ Do not test for mocklisp case.
+ (Fwhile): Remove unused variable `tem'.
+ (syms_of_eval): Remove variable `moclisp-arguments'.
+
+ * data.c (wrong_type_argument): Remove mocklisp case.
+
+ * doc.c (Fdocumentation): Remove mocklisp case.
+
+ * emacs.c (main): Do not call syms_of_mocklisp.
+
+2001-12-21 Richard M. Stallman <[email protected]>
+
+ * xfns.c (compute_tip_xy): If tooltip won't fit on the screen
+ to the left or to the right of the pointer, put it against
+ the left screen edge.
+
+2001-12-21 Eli Zaretskii <[email protected]>
+
+ * Makefile.in (distclean): Remove .gdbinit if we are building
+ outside the source tree.
+
+2001-12-19 Eli Zaretskii <[email protected]>
+
+ * w32.c (emacs_root_dir): New function.
+
+ * msdos.c (emacs_root_dir): New function.
+
+ * fileio.c (Fexpand_file_name) [DOS_NT]: Use the root directory
+ of the current drive as the fallback for default_directory.
+
+ * dired.c (file_name_completion): Run the elements of
+ completion-ignored-extensions through ENCODE_FILE.
+
+ * lisp.h (scmp): Remove prototype, since it's now a static
+ function private to dired.c.
+
+2001-12-18 Richard M. Stallman <[email protected]>
+
+ * dired.c (scmp): Function moved from minibuf.c.
+ Delete multibyte handling--used only on encoded strings.
+
+ * minibuf.c (scmp): Function moved to dired.c.
+
+ * fns.c (merge): Add QUIT call.
+
+2001-12-18 Dave Love <[email protected]>
+
+ * Makefile.in (lisp, shortlisp): Add language/utf-8-lang.el,
+ language/georgian.el.
+
+2001-12-18 Eli Zaretskii <[email protected]>
+
+ * Makefile.in (lisp, shortlisp): Synchronize with changes to
+ lisp/Makefile.in:DONTCOMPILE.
+
+2001-12-18 Pavel Jan,Am(Bk <[email protected]>
+
+ * xdisp.c (window_box_height): Do not return negative values.
+ From Gerd Moellmann <[email protected]>.
+
+ * keyboard.c (head_table): Add missing braces around initializer.
+
+ * term.c (keys): Likewise.
+
+ * xfns.c (x_frame_parms, visual_classes): Likewise.
+
+2001-12-17 Sam Steingold <[email protected]>
+
+ * coding.c (DECODE_COMPOSITION_END): Fixed a typo in the last
+ patch (COMPOSING_P, not COMPOSING).
+
+2001-12-17 Richard M. Stallman <[email protected]>
+
+ * editfns.c (Fcompare_buffer_substrings): Add QUIT to main loop.
+
+ * coding.c (code_convert_region): Update coding->cmp_data->char_offset
+ before calling decode_coding.
+
+ * charset.c (Fdefine_charset): Call Fupdate_coding_systems_internal.
+
+ * coding.c (DECODE_COMPOSITION_END): Check for ! COMPOSING_P (coding)
+ instead of only for COMPOSITION_DISABLED.
+
+2001-12-16 Richard M. Stallman <[email protected]>
+
+ * alloc.c (pure_alloc): After overflow, allocate just a small block.
+
+ * Makefile.in (xmenu.o, xterm.o, fontset.o): Depend on buffer.h.
+
+ * buffer.h (struct buffer): New field `display_error_modiff'.
+ * buffer.c (reset_buffer): Initialize `display_error_modiff'.
+
+ * window.c (Frecenter): Clear display_error_modiff field.
+
+ * xdisp.c (redisplay_window_0, redisplay_window_1): New functions.
+ Call redisplay_window, but not if display_error_modiff field says no.
+ (redisplay_window_error): New function.
+ (displayed_buffer): New variable.
+ (redisplay_internal, redisplay_windows): Call the new functions
+ instead of redisplay_window directly.
+
+2001-12-15 Richard M. Stallman <[email protected]>
+
+ * keyboard.c (syms_of_keyboard) <double-click-fuzz>: Doc fix.
+
+2001-12-14 Andrew Innes <[email protected]>
+
+ * makefile.w32-in (EMACSLOADPATH): Define.
+ ($(EMACS)): Run `list-load-path-shadows' after dumping Emacs.
+ (bootstrap-temacs): Remove dependency on bootstrap-clean.
+
+2001-12-13 Eli Zaretskii <[email protected]>
+
+ * xfns.c (x_report_frame_params): Make the scroll-bar-width frame
+ parameter have a numeric value all the time.
+
+ * w32fns.c (x_report_frame_params): Likewise.
+
+2001-12-12 Richard M. Stallman <[email protected]>
+
+ * fileio.c (Fwrite_region): Doc fix.
+
+ * xdisp.c (CLEAR_FACE_CACHE_COUNT): Redefine as 500.
+ (redisplay_internal): Call clear_image_cache only for window terminals.
+
+2001-12-12 Gerd Moellmann <[email protected]>
+
+ * xdisp.c (move_it_vertically_backward): Change heuristic
+ for the case that we didn't move far enough initially.
+
+ * window.c (Frecenter): Simplify computation in the case of window
+ system frames and ARG < 0; use window_box_height.
+
+2001-12-11 Richard M. Stallman <[email protected]>
+
+ * Makefile.in, mem-limits.h, dispnew.c, emacs.c, fileio.c:
+ * process.c, sysdep.c, unexec.c: Test GNU_LINUX, not LINUX.
+
+2001-12-11 Andrew Innes <[email protected]>
+
+ * insdel.c (make_gap) [DOUG_LEA_MALLOC]: Call make_gap_smaller if
+ arg is negative.
+
+2001-12-11 Richard M. Stallman <[email protected]>
+
+ * m/hp800.h: Split the __hpux conditional into the parts
+ that are right for GNU/Linux too and the parts that are not.
+ Use the former if GNU_LINUX.
+ (HAVE_ALLOCA, LOAD_AVE_TYPE, LOAD_AVE_CVT): New defs for GNU/Linux.
+
+ * s/gnu-linux.h (GNU_LINUX): Defined.
+
+2001-12-11 Pavel Jan,Am(Bk <[email protected]>
+
+ * macros.c, msdos.c, w16select.c: Change doc-string comments to
+ `new style' [w/`doc:' keyword].
+
+2001-12-10 Jason Rumney <[email protected]>
+
+ * w32menu.c (w32_free_submenu_strings): Clear menu item struct
+ before using.
+
+2001-12-09 Pavel Jan,Am(Bk <[email protected]>
+
+ * dosfns.c: Change doc-string comments to `new style' [w/`doc:'
+ keyword].
+
+2001-12-09 Eli Zaretskii <[email protected]>
+
+ * dosfns.c (dos-display-scancodes, dos-decimal): Doc fix.
+
+ * s/hpux10.h (srand48): Don't undefine.
+
+2001-12-09 Jason Rumney <[email protected]>
+
+ * w32menu.c (_widget_value): Make `help' field a Lisp_Object.
+ Add comment to explain where the struct came from.
+ (single_submenu, w32_menu_show): Set `help' field as Lisp_Object.
+ (add_menu_item): Process pop-up menus first to avoid memory leak.
+ (add_menu_item, w32_menu_display_help): Use `help' field as
+ Lisp_Object.
+ (w32_free_submenu_strings): Only free owner-drawn strings.
+
+2001-12-09 Pavel Jan,Am(Bk <[email protected]>
+
+ * COPYING: Moved back.
+
+ * charset.c (char_to_string_1, translate_char, Fdefine_charset):
+ Add parentheses around && within ||.
+
+ * indent.c (compute_motion): Likewise.
+
+ * intervals.c (merge_properties_sticky): Likewise.
+
+ * coding.c (setup_coding_system, shrink_encoding_region)
+ (Fdecode_sjis_char): Likewise.
+
+2001-12-07 Andreas Schwab <[email protected]>
+
+ * xdisp.c (display_mode_element): Don't read past end of string if
+ it ends with '%'.
+
+ * alloc.c (inhibit_garbage_collection): Don't exceed value an int
+ can hold.
+
+ * data.c (Vmost_positive_fixnum, Vmost_negative_fixnum):
+ Rename from most_positive_fixnum and most_negative_fixnum, resp., and
+ type changed to Lisp_Object.
+ (syms_of_data): DEFVAR_LISP them.
+
+2001-12-07 Richard M. Stallman <[email protected]>
+
+ * callproc.c (init_callproc): Set Vdata_directory based on the source
+ location whenever Emacs was run uninstalled.
+
+2001-12-06 Paul Eggert <[email protected]>
+
+ * config.in (HAVE_WORKING_VFORK): New #undefs.
+ * process.c (create_process):
+ Use HAVE_WORKING_VFORK, not HAVE_VFORK.
+ * m/cnvrgnt.h (HAVE_VFORK): Remove #define.
+ * m/ibm370aix.h (HAVE_VFORK): Remove #undef.
+ * m/ibmps2-aix.h (HAVE_VFORK): Remove #define.
+ * m/intel386.h (HAVE_VFORK): Likewise.
+ * m/mips-siemens.h (HAVE_VFORK): Likewise.
+ * m/mips.h (HAVE_VFORK): Likewise.
+ * s/freebsd.h (vfork): Remove #define.
+ * s/lynxos.h (HAVE_VFORK): Remove #undef.
+ * s/usg5-4-2.h: Fix comment about vfork.
+
+2001-12-06 Richard M. Stallman <[email protected]>
+
+ * s/hpux10.h (random): Add undef.
+ (HAVE_RANDOM): Define it just once.
+
+2001-12-06 Stefan Monnier <[email protected]>
+
+ * eval.c: Undo last change: the standard syntax is not wanted.
+
+2001-12-06 Eli Zaretskii <[email protected]>
+
+ * xterm.c (x_free_frame_resources) [USE_X_TOOLKIT]: Remove all the
+ scroll bars of the frame before deleting the frame itself. If the
+ frame has a widget, delete the frame with XtDestroyWidget, and do
+ not call XDestroyWindow before that.
+
+2001-12-06 Kim F. Storm <[email protected]>
+
+ * xfns.c (x_report_frame_params): Return actual fringe widths.
+
+ * w32fns.c (x_report_frame_params): Return actual fringe widths.
+
+2001-12-05 Andrew Innes <[email protected]>
+
+ * alloc.c (Fgarbage_collect): Shrink buffer gaps that are
+ excessively large.
+
+ * insdel.c (make_gap_larger): New function.
+ (make_gap_smaller): New function.
+ (make_gap) [USE_MMAP_FOR_BUFFERS || REL_ALLOC]:
+ Call make_gap_smaller if arg is negative.
+
+2001-12-04 Stefan Monnier <[email protected]>
+
+ * keyboard.c (kbd_buffer_store_event): Fix interrupt_signal prototype.
+ Pass a dummy argument when calling interrupt_signal.
+ (parse_menu_item): Mark disabled items before checking for empty def.
+ (read_char_minibuf_menu_prompt): Make safety more visible.
+ (read_key_sequence): Add a `first_unbound' variable.
+ Use it to detect C-c ESC ESC ESC ESC ... cases and drop the
+ unbound prefix as soon as we can detect it.
+
+ * doc.c (Fsnarf_documentation): Add prototype.
+ (get_doc_string): Handle negative arguments.
+ (Fdocumentation): Use AREF and ASIZE.
+ Move the calls to get_doc_string to a single place.
+ Don't confuse an interactive-spec for a docstring reference.
+ (Fdocumentation_property): Take advantage of the fact that
+ get_doc_string now ignores the sign of the docstring position.
+
+ * eval.c: Use standard syntax for usage in docstrings.
+
+2001-12-03 Pavel Jan,Am(Bk <[email protected]>
+
+ * xdisp.c (syms_of_xdisp): Make `tool-bar-button-relief' an option.
+
+2001-12-02 Pavel Jan,Am(Bk <[email protected]>
+
+ * xterm.c (x_draw_image_relief): Use predefined macro instead of
+ constant when the value of `tool_bar_button_relief' is negative.
+
+2001-12-02 Richard M. Stallman <[email protected]>
+
+ * xmenu.c (menu_highlight_callback): Use `help' field as Lisp_Object.
+ (single_submenu, xmenu_show): Set `help' field as Lisp_Object.
+
+ * fileio.c (read_non_regular): Delete Fsignal call.
+
+2001-12-01 Stefan Monnier <[email protected]>
+
+ * lisp.h (run_hook_list_with_args): Undo last change.
+
+2001-12-01 Gerd Moellmann <[email protected]>
+
+ * xterm.c (x_draw_fringe_bitmap): Always undo clipping.
+
+2001-12-01 Jason Rumney <[email protected]>
+
+ * window.c (Qleft_fringe, Qright_fringe): Remove. Now in frame.c.
+
+ * w32term.h (WM_MOUSELEAVE, TME_LEAVE, TRACKMOUSEEVENT)
+ [!WM_MOUSELEAVE]: Define.
+
+ * w32menu.c (current_popup_menu, get_menu_item_info):
+ (set_menu_item_info): New vars.
+ (set_frame_menubar): Doc fix clarifying GC interaction with menus.
+ (w32_menu_show): Set current_popup_menu.
+ (add_menu_item): Allocate new strings for owner-drawn menu items
+ and help strings.
+ Use owner-draw for disabled menu items again.
+ (w32_menu_display_help): Ignore owner-drawn items and popup menus.
+ (w32_free_submenu_strings, w32_free_menu_strings): New functions.
+
+ * w32fns.c (trackmouse_window, track_mouse_event_fn): New vars.
+ (w32_wnd_proc) <WM_MOUSEMOVE>: Notice when mouse enters frame.
+ <WM_EXITMENULOOP>: Free menu strings.
+ <WM_MOUSELEAVE>: Stop tracking mouse.
+ (x_create_tip_frame): Specify no minibuffer, modeline or fringes.
+
+ * w32term.c (w32_read_socket) <WM_MOUSELEAVE>: Cancel help echo
+ and mouse face.
+
+2001-12-01 Kim F. Storm <[email protected]>
+
+ The following changes add left-fringe and right-fringe
+ frame parameters to adjust fringe widths, or remove one or
+ both fringes.
+
+ * frame.h (struct frame): Remove trunc_area_pixel_width and
+ trunc_area_cols fields.
+ (Qleft_fringe, Qright_fringe): Declare.
+ (FRAME_RIGHT_FRINGE_WIDTH): New macro.
+
+ * frame.c (Qleft_fringe, Qright_fringe): New vars.
+ (syms_of_frame): Initialize them.
+
+ * window.c (coordinates_in_window): Handle separate left and right
+ fringe widths.
+
+ * xterm.h (struct x_output): Add left_fringe_width, right_fringe_width,
+ and fringe_cols fields.
+ (FRAME_FRINGE_BITMAP_WIDTH, FRAME_FRINGE_BITMAP_HEIGHT): Remove macros.
+ (FRAME_X_FRINGE_COLS): Use fringe_cols field.
+ (FRAME_X_FRINGE_WIDTH): Use fringes_extra field.
+ (FRAME_X_LEFT_FRINGE_WIDTH): Use left_fringe_width field.
+ (FRAME_X_RIGHT_FRINGE_WIDTH): Use right_fringe_width field.
+ (x_compute_fringe_widths): Add prototype.
+
+ * xterm.c (zv_height, zv_bits, zv_period): Changed zv bitmap to
+ fill fringe evenly with small dashes.
+ (x_draw_fringe_bitmap): Clear background if necessary. Align and
+ clip the new ZV bitmap to avoid jitter between rows.
+ (x_draw_row_fringe_bitmaps): Rely on x_draw_fringe_bitmap to clear
+ background. Don't draw fringe bitmaps if fringe width is zero.
+ (x_compute_fringe_widths): New function.
+ (x_new_font, x_set_window_size_1): Use it.
+
+ * xfns.c (x_frame_parms): Add `left-fringe' and `right-fringe' parms.
+ (x_set_frame_parameters): Process `font' parameter before other
+ parameters as fringe widths depend on it.
+ (x_set_fringe_width): New function.
+ (x_figure_window_size): Use x_compute_fringe_widths.
+ (Fx_create_frame): Process `left-fringe' and `right-fringe' frame
+ parameters.
+
+ * widget.c (set_frame_size): Use x_compute_fringe_widths.
+ (EmacsFrameSetCharSize): Ditto.
+
+ * w32term.h: Merged changes from xterm.h.
+ * w32term.c: Merged changes from xterm.c.
+ * w32fns.c: Merged changes from xfns.c.
+
+2001-11-29 Pavel Jan,Am(Bk <[email protected]>
+
+ * COPYING: Removed.
+
+2001-11-29 Dave Love <[email protected]>
+
+ * coding.c (syms_of_coding) <Qchar_coding_system>: Give it an
+ extra extra slot.
+ (detect_coding_mask): Fix call of detect_coding_iso2022.
+
+2001-11-29 Pavel Jan,Am(Bk <[email protected]>
+
+ * fileio.c (file-name-coding-system)
+ (default-file-name-coding-system): Doc fix (links to referenced
+ variables added).
+
+2001-11-28 Stefan Monnier <[email protected]>
+
+ * lisp.h (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5):
+ Add dummy uses of gcproN variables.
+
+ * category.c (describe_category, describe_category_1)
+ (Fdescribe_categories): Remove. (Moved to lisp/help-fns.el.)
+ (syms_of_category): Don't defsubr Sdescribe_categories.
+
+2001-11-28 Richard M. Stallman <[email protected]>
+
+ * fileio.c (Ffind_file_name_handler): Avoid initializer for `result'.
+
+ * Makefile.in (lispdir): New variable, referring to build dir.
+ (TAGS-LISP): Find Makefile in $(lispdir), not $(lispsource).
+
+2001-11-28 Andrew Innes <[email protected]>
+
+ * w32menu.c (w32_menu_display_help): Actually add the new argument
+ OWNER.
+
+2001-11-28 Jason Rumney <[email protected]>
+
+ * w32menu.c (add_menu_item): Do not use owner-draw for disabled
+ menu items. From David Ponce <[email protected]>.
+ (w32_dialog_show) [HAVE_DIALOGS]: Compile whole function
+ conditionally.
+ (w32_menu_display_help): New argument OWNER. Rewritten to store a
+ help event in the owner frame's keyboard buffer.
+
+ * w32fns.c (w32_wnd_proc) <WM_MENUSELECT>: Display help directly.
+ (Fx_show_tip): Don't subtract last width from row width.
+
+ * w32term.c (w32_read_socket) <WM_MENUSELECT>: Remove.
+ (w32_read_socket): Use EQ to compare frames.
+
+2001-11-28 Gerd Moellmann <[email protected]>
+
+ * xterm.c (x_draw_glyphs): Don't call notice_overwritten_cursor if
+ OVERLAPS_P.
+
+2001-11-28 Pavel Jan,Am(Bk <[email protected]>
+
+ * xdisp.c (message_dolog): Remove unused variables `gcpro2',
+ `gcpro3' and `gcpro4'.
+
+ * coding.c (decode_coding_string): Remove unused variable `gcpro1'.
+
+2001-11-28 Stefan Monnier <[email protected]>
+
+ * ccl.c: Use AREF and ASIZE.
+
+2001-11-27 Stefan Monnier <[email protected]>
+
+ * lisp.h (run_hook_list_with_args): Remove.
+ (LIST_END_P): Fix call to wrong_type_argument.
+ (make_fixnum_or_float): Use EMACS_INT rather than int.
+
+2001-11-26 Stefan Monnier <[email protected]>
+
+ * syntax.c (syms_of_syntax): Remove defsubr of Sdescribe_syntax.
+ (describe_syntax, describe_syntax_1, Fdescribe_syntax): Remove.
+
+ * eval.c: Use AREF and ASIZE.
+ (Ffetch_bytecode): Add the file name to the error message.
+
+ * fileio.c (Ffind_file_name_handler): Give precedence to handlers
+ which match the end of the file-name.
+ (Fsubstitute_in_file_name): Don't signal an error if $ENVVAR
+ is not a valid env var, but leave it as is instead.
+
+ * keymap.c (access_keymap): Handle t bindings like nil bindings.
+ Make nil bindings in char-tables transparent.
+ (store_in_keymap): Turn a nil binding into a t binding for char-tables.
+
+2001-11-26 Richard M. Stallman <[email protected]>
+
+ * textprop.c (set_text_properties_1): Allow START, END in either order.
+ Do nothing if range is empty.
+
+ * Makefile.in (mallocobj): Simplify logic using auxiliary vars.
+
+ * Makefile.in (mostlyclean): Delete bootstrap-emacs here.
+ (clean): Not here.
+
+2001-11-25 Stefan Monnier <[email protected]>
+
+ * textprop.c (set_text_properties_1): Clearly mark that the
+ interval should not be empty.
+
+ * intervals.c (graft_intervals_into_buffer):
+ Don't call set_text_properties_1 on an empty interval.
+
+2001-11-25 Richard M. Stallman <[email protected]>
+
+ * unexelf.c (unexec): Index by n, not nn, when checking for ".sbss".
+
+ * callproc.c (Fcall_process): When we make a bigger buffer for bufptr,
+ don't lose the data in it.
+
+2001-11-25 Juanma Barranquero <[email protected]>
+
+ * abbrev.c (Fexpand_abbrev): Use Frun_hooks instead of Vrun_hooks.
+
+ * buffer.c (Fkill_buffer): Likewise.
+
+ * print.c (temp_output_buffer_setup): Likewise.
+
+2001-11-25 Stefan Monnier <[email protected]>
+
+ * xfaces.c (merge_face_heights): Coerce back to int explicitly.
+
+2001-11-25 Eli Zaretskii <[email protected]>
+
+ * window.c (Fset_window_vscroll): Doc fix. From Kalle Olavi
+ Niemitalo <[email protected]>.
+
+2001-11-25 Jason Rumney <[email protected]>
+
+ * w32term.h (FRAME_X_FRINGE_COLS): No fringe on tip frames.
+
+ * w32fns.c (x_create_tip_frame): Set frame's fringes_extra to 0.
+ (Fx_show_tip): Block input during frame creation.
+ (Fx_show_tip, Fx_hide_tip): Enable.
+
+2001-11-24 Richard M. Stallman <[email protected]>
+
+ * lread.c (Fload): Detect recursive load error for more than 3
+ nestings of the same file.
+ (Vrecursive_load_depth_limit): Variable deleted.
+ (syms_of_lread) <recursive-load-depth-limit>: Variable deleted.
+
+2001-11-24 Jason Rumney <[email protected]>
+
+ * xfns.c (compute_tip_xy): Initialize root_x and root_y from
+ mouse position if either left or top is not specified.
+
+ * w32fns.c (w32_wnd_proc) <WM_MENUSELECT>: Revert last change.
+ <WM_WINDOWPOSCHANGING>: Let tip frames resize without restriction.
+ (my_create_tip_window, Fx_show_tip): Adjust size for external border.
+ (my_create_tip_window): Assign tip_window.
+ (x_create_tip_frame): Use same defaults as X.
+ (compute_tip_xy): Remove unused variable. Use full screen width.
+ (Fx_show_tip): Do not double height. Call ShowWindow directly.
+
+ * w32term.c (x_after_update_window_line): Doc fix.
+ (w32_read_socket): Doc fix. Avoid SET_FRAME_GARBAGED for tip
+ frames.
+ <WM_SHOWWINDOW>: Redo mouse highlight when hiding tip frame.
+
+ * xdisp.c (prepare_menu_bars) [HAVE_WINDOW_SYSTEM]: Use tip_frame
+ for all Windowed systems.
+
+2001-11-23 Eli Zaretskii <[email protected]>
+
+ * msdos.c (IT_clear_screen): If the frame's faces are not yet
+ realized, use the initial screen colors to clear the screen.
+
+2001-11-23 Pavel Jan,Am(Bk <[email protected]>
+
+ * textprop.c (Fset_text_properties): Remove unused variables
+ `unchanged', `prev_changed', `s' and `len'.
+
+ * search.c (Freplace_match): Remove unused variable `inslen'.
+
+ * keymap.c (access_keymap): Remove unused variables `c1' and `c2'.
+
+2001-11-22 Jason Rumney <[email protected]>
+
+ * w32fns.c (x_window_to_frame): Remove irrelevant TODO comment.
+ (w32_wnd_proc) <WM_MENUSELECT>: Show help echo directly.
+ (my_create_tip_window): New function.
+ (x_create_tip_frame, compute_tip_xy): Adapt for Windows.
+ (Fx_show_tip, Fx_hide_tip) [TEST_TOOLTIPS]: Adapt for Windows.
+
+2001-11-20 Jason Rumney <[email protected]>
+
+ * coding.h (Vw32_system_coding_system) [WINDOWSNT]: Remove.
+ (ENCODE_SYSTEM, DECODE_SYSTEM) [WINDOWSNT]: Use Vlocale_coding_system.
+
+ * w32fns.c (Vw32_system_coding_system): Remove.
+ (w32_to_x_font, x_to_w32_font): Use Vlocale_coding_system.
+
+2001-11-19 Stefan Monnier <[email protected]>
+
+ * fileio.c (Fwrite_region): Move choose_write_coding_system to
+ after build_annotations.
+
+ * syntax.c (describe_syntax): Add dummy arg.
+ (describe_syntax_1): Update call to describe_vector.
+
+ * category.c (describe_category): Add dummy arg.
+ (describe_category_1): Update call to describe_vector.
+
+ * keymap.c (Fdescribe_vector): Add `describer' parameter.
+ (describe_command, describe_translation): Add dummy second param.
+ (describe_map): Call elt_describer with two arguments.
+ (describe_vector_princ): Add `fun' parameter.
+ Call it instead of the hardcoded `princ'.
+ (describe_vector): Add arg `args'.
+ Pass it as a new second argument to elt_describer.
+
+ * keymap.h (describe_vector): Update prototype.
+
+ * frame.c: Don't include keymap.h any more.
+ (keys_of_frame): Remove.
+
+ * lisp.h (keys_of_frame): Remove declaration.
+
+ * emacs.c (main): Don't call `keys_of_frame' any more.
+
+2001-11-14 Andreas Schwab <[email protected]>
+
+ * unexelf.c [!defined MAP_ANON]: Define MAP_ANON to MAP_ANONYMOUS
+ if defined, 0 otherwise.
+ (MAP_FAILED): Define if not defined and use it to test mmap failure.
+ (unexec) [!MAP_ANON]: Use /dev/zero as file to map.
+
+2001-11-19 Richard M. Stallman <[email protected]>
+
+ * indent.c (current_column_1): Fix handling of scan_bytes for mb chars.
+
+2001-11-18 Jason Rumney <[email protected]>
+
+ * w32term.c (note_mouse_highlight): Fix type of variable `ignore'.
+ (x_draw_bar_cursor): If the background color of the glyph under
+ the cursor equals the frame's cursor color, use the glyph's
+ foreground color for drawing the bar cursor.
+ (x_after_update_window_line): Clear internal border in different
+ circumstances.
+ (w32_set_vertical_scroll_bar): Check for width and height > 0.
+ (w32_draw_relief_rect): Correct relief by 1 pixel.
+ (x_set_glyph_string_background_width):
+ Set extends_to_end_of_line_p if the row's fill_line_p is set and
+ drawing the last glyph with DRAW_IMAGE_{RAISED,SUNKEN}.
+ (x_display_and_set_cursor): If cursor_in_echo_area, use NO_CURSOR
+ if cursor_in_non_selected_windows is false.
+ (show_mouse_face): Clean up. Recognize overwritten cursor differently.
+ (x_draw_glyphs): Remove parameters REAL_START and REAL_END.
+ Notice if cursor gets overwritten.
+ (notice_overwritten_cursor): Renamed from
+ note_overwritten_text_cursor. Rewritten to take glyph widths
+ into account, and to take X positions as parameters.
+ (x_draw_phys_cursor_glyph): Save state of w->phys_cursor_on_p
+ around call to x_draw_glyphs.
+ (x_setup_relief_colors): Use `IMAGE_BACKGROUND' and
+ `IMAGE_BACKGROUND_TRANSPARENT' to calculate the correct background
+ color to use for image glyph reliefs.
+ (x_draw_image_relief): Accept zero tool_bar_button_relief.
+ (glyph_rect): Remove unused variable `area'.
+
+ * w32fns.c (x_set_frame_parameters): Avoid infinite recursion for
+ some items.
+ (x_set_internal_border_width): Set frame garbaged when window
+ doesn't exist yet.
+ (Fx_create_frame): Accept zero tool_bar_button_relief.
+ (x_clear_image_1, four_corners_best, image_background)
+ (image_background_transparent): New functions.
+ (xpm_format, png_format, jpeg_format, tiff_format, gif_format)
+ (gs_format): Add `:background' entry.
+ (lookup_image): Set IMG's background color if specified.
+ (pbm_load, xbm_load_image, png_load): Set IMG's background field
+ when appropriate.
+ (x_clear_image_1): Reset `background_valid' and
+ `background_transparent_valid' fields.
+ (x_build_heuristic_mask): Use IMAGE_BACKGROUND instead of
+ calculating it here. Set IMG's background_transparent field.
+ (enum xpm_keyword_index): Add XPM_BACKGROUND.
+ (enum png_keyword_index): Add PNG_BACKGROUND.
+ (enum jpeg_keyword_index): Add JPEG_BACKGROUND.
+ (enum tiff_keyword_index): Add TIFF_BACKGROUND.
+ (enum gif_keyword_index): Add GIF_BACKGROUND.
+ (enum gs_keyword_index): Add GS_BACKGROUND.
+ (pbm_load, png_load, jpeg_load, tiff_load, gif_load):
+ Pre-calculate image background color where necessary.
+ (x_create_x_image_and_pixmap, xbm_load, gs_load):
+ Use display info's n_cbits entry for screen depth.
+ (Fx_show_tip): Remove unused variables `buffer', `top',
+ `left', `max_width' and `max_height'.
+
+ * w32menu.c (w32_menu_show, push_menu_pane): Doc fixes.
+
+2001-11-18 Gerd Moellmann <[email protected]>
+
+ * puresize.h (BASE_PURESIZE): Increase to 750000.
+
+2001-11-18 Pavel Jan,Am(Bk <[email protected]>
+
+ * frame.c (Fframe_live_p): Doc fix.
+
+2001-11-18 Richard M. Stallman <[email protected]>
+
+ * xdisp.c (message_dolog_marker1, message_dolog_marker2)
+ (message_dolog_marker3): New static variables hold three markers.
+ (syms_of_xdisp): Initialize and staticpro them.
+ (message_dolog): Use message_dolog_marker1..3 instead of
+ allocating markers each time. Unchain them when done.
+
+2001-11-17 Richard M. Stallman <[email protected]>
+
+ * doc.c (Fsnarf_documentation): Doc fix.
+
+2001-11-17 Andreas Schwab <[email protected]>
+
+ * xterm.c (note_mouse_highlight): Fix type of variable `ignore'.
+
+2001-11-17 Richard M. Stallman <[email protected]>
+
+ * fileio.c (Fwrite_region): Avoid initializer for Lisp_Object.
+
+2001-11-17 Jason Rumney <[email protected]>
+
+ * xterm.c (notice_overwritten_cursor): Take care of end < 0 case.
+
+2001-11-17 Gerd Moellmann <[email protected]>
+
+ * xdisp.c (tool_bar_item_info): Avoid calling Fget_text_property
+ with invalid position.
+
+2001-11-16 Richard M. Stallman <[email protected]>
+
+ * syswait.h: Delete conditionals for HPUX7, ISC 4.1, and convex.
+
+ * s/isc4-1.h (HAVE_SYS_WAIT_H): Add #undef.
+ * s/hpux.h (HAVE_SYS_WAIT_H): Add #undef.
+ * s/hpux8.h (HAVE_SYS_WAIT_H): Define it.
+
+ * m/convex.h (HAVE_SYS_WAIT_H): Add #undef.
+
+2001-11-16 Stefan Monnier <[email protected]>
+
+ * fileio.c (build_annotations): Split off the tail.
+ (build_annotations_2): New fun. Extracted from build_annotations.
+ (Fwrite_region): Split the call to build_annotations into two
+ calls to build_annotations and build_annotations_2.
+
+2001-11-16 Pavel Jan,Am(Bk <[email protected]>
+
+ * sysdep.c (wait_for_kbd_input) [VMS]: Do not call
+ clear_waiting_for_input with argument.
+
+ * xterm.h (x_update_cursor): Remove duplicated prototype.
+
+ * keyboard.h (clear_waiting_for_input): Remove duplicated prototype.
+
+ * xterm.c (waiting_for_input): Remove unnecessary declaration.
+
+ * data.c (Ftimes, Fquo, Frem, Fmod): Doc fix.
+
+2001-11-16 Stefan Monnier <[email protected]>
+
+ * fileio.c (choose_write_coding_system): New fun, extracted
+ from Fwrite_region.
+ (Fwrite_region): Use it.
+
+ * eval.c (max_specpdl_size, max_lisp_eval_depth): Use EMACS_INT.
+ (funcall_lambda, run_hook_with_args): Make static and add prototype.
+ (ml_apply, find_handler_clause): Add prototype.
+
+2001-11-16 Eli Zaretskii <[email protected]>
+
+ * config.in: Add #undef HAVE_COFF_H.
+
+ * unexec.c (coff.h): Don't include unless HAVE_COFF_H is defined.
+ Required for ISC 4.1.
+
+2001-11-16 Eli Zaretskii <[email protected]>
+
+ * syswait.h (HAVE_SYS_WAIT_H): Undef for ISC 4.1. Reported by
+ Andrew Wiseman <[email protected]>.
+
+2001-11-16 Kim F. Storm <[email protected]>
+
+ The following changes are made to clean up the various internal
+ references to the fringes to actually use the term `fringe' for
+ them. Previously, they were called `flags areas', `bitmap areas',
+ `left/right side of windows', or implicitly as `flags' or
+ `bitmaps':
+
+ * dispextern.h (FRINGE_FACE_ID): Renamed from BITMAP_AREA_FACE_ID.
+ Comments fixed. Use renamed symbols.
+
+ * dispnew.c: Comment fix. Use renamed symbols.
+
+ * frame.h (FRAME_FRINGE_COLS): Renamed from FRAME_FLAGS_AREA_COLS.
+ (FRAME_FRINGE_WIDTH): Renamed from FRAME_FLAGS_AREA_WIDTH.
+ (FRAME_LEFT_FRINGE_WIDTH): Renamed from FRAME_LEFT_FLAGS_AREA_WIDTH.
+
+ * msdos.c: Comment fix.
+
+ * w32fns.c: Use renamed symbols.
+
+ * w32term.c: Comment fixes. Use renamed symbols.
+ (fringe_bitmap_type): Renamed from bitmap_type.
+ (NO_FRINGE_BITMAP): Renamed from NO_BITMAP.
+ (w32_draw_fringe_bitmap): Renamed from w32_draw_bitmap.
+ (x_draw_row_fringe_bitmaps): Renamed from x_draw_row_bitmaps.
+
+ * w32term.h: Comment fixes. Use renamed symbols.
+ (fringes_extra): Renamed from flags_areas_extra.
+ (FRAME_FRINGE_BITMAP_WIDTH): Renamed from FRAME_FLAGS_BITMAP_WIDTH.
+ (FRAME_FRINGE_BITMAP_HEIGHT): Renamed from FRAME_FLAGS_BITMAP_HEIGHT.
+ (FRAME_X_FRINGE_COLS): Renamed from FRAME_X_FLAGS_AREA_COLS.
+ (FRAME_X_FRINGE_WIDTH): Renamed from FRAME_X_FLAGS_AREA_WIDTH.
+ (FRAME_X_LEFT_FRINGE_WIDTH):
+ Renamed from FRAME_X_LEFT_FLAGS_AREA_WIDTH.
+ (FRAME_X_RIGHT_FRINGE_WIDTH):
+ Renamed from FRAME_X_RIGHT_FLAGS_AREA_WIDTH.
+
+ * widget.c: Use renamed symbols.
+
+ * window.c: Comment fixes. Use renamed symbols.
+ (coordinates-in-window-p): Doc fix.
+
+ * xdisp.c: Comment fixes. Use renamed symbols.
+
+ * xfaces.c (realize_basic_faces): Use FRINGE_FACE_ID.
+
+ * xfns.c: Use renamed symbols.
+
+ * xterm.c: Comment fixes. Use renamed symbols.
+ (fringe_bitmap_type): Renamed from bitmap_type.
+ (NO_FRINGE_BITMAP): Renamed from NO_BITMAP.
+ (x_draw_fringe_bitmap): Renamed from x_draw_bitmap.
+ (x_draw_row_fringe_bitmaps): Renamed from x_draw_row_bitmaps.
+
+ * xterm.h: Comment fixes. Use renamed symbols.
+ (fringes_extra): Renamed from flags_areas_extra.
+ (FRAME_FRINGE_BITMAP_WIDTH): Renamed from FRAME_FLAGS_BITMAP_WIDTH.
+ (FRAME_FRINGE_BITMAP_HEIGHT): Renamed from FRAME_FLAGS_BITMAP_HEIGHT.
+ (FRAME_X_FRINGE_COLS): Renamed from FRAME_X_FLAGS_AREA_COLS.
+ (FRAME_X_FRINGE_WIDTH): Renamed from FRAME_X_FLAGS_AREA_WIDTH.
+ (FRAME_X_LEFT_FRINGE_WIDTH):
+ Renamed from FRAME_X_LEFT_FLAGS_AREA_WIDTH.
+ (FRAME_X_RIGHT_FRINGE_WIDTH):
+ Renamed from FRAME_X_RIGHT_FLAGS_AREA_WIDTH.
+
+2001-11-15 Jason Rumney <[email protected]>
+
+ * w32menu.c (add-menu-item): Make help_echo and radio buttons
+ work for most menu items. From David Ponce
+
+2001-11-15 Gerd Moellmann <[email protected]>
+
+ * xfns.c (x_set_frame_parameters): Revert change of 2001-11-07.
+ Some x_set_* function expect to be called even if old and new
+ value are equal.
+
+ * xdisp.c (build_desired_tool_bar_string): Accept zero
+ tool_bar_button_relief.
+
+ * xfns.c (Fx_create_frame): Accept zero tool_bar_button_relief.
+
+ * xterm.c (x_draw_image_relief): Accept zero tool_bar_button_relief.
+
+ * xterm.c (x_draw_bar_cursor): If the background color of the
+ glyph under the cursor equals the frame's cursor color, use
+ the glyph's foreground color for drawing the bar cursor.
+
+ * dispnew.c (direct_output_forward_char): Fix character/byte
+ position comparison.
+
+2001-11-15 Miles Bader <[email protected]>
+
+ * editfns.c (find_field): Add BEG_LIMIT and END_LIMIT parameters.
+ (Fdelete_field, Ffield_string, Ffield_string_no_properties):
+ Update arguments to find_field.
+ (Ffield_beginning, Ffield_end): Add LIMIT param, pass to find_field.
+ (Fconstrain_to_field): Use LIMIT arg to shorten search time.
+ * lisp.h (Ffield_beginning, Ffield_end): Update EXFUN decl.
+ * minibuf.c (Fminibuffer_prompt_end): Update args to Ffield_end.
+
+2001-11-14 Richard M. Stallman <[email protected]>
+
+ * editfns.c (Fpropertize): Allow call with 1 arg.
+
+ * dispextern.h (image_background, image_background_transparent):
+ Conditionalize on HAVE_X_WINDOWS.
+
+2001-11-13 Richard M. Stallman <[email protected]>
+
+ * print.c (Fprin1_to_string): Doc fix.
+
+ * sunfns.c (Fsun_change_cursor_icon): Doc fix.
+
+ * floatfns.c (Fceiling, Ffloor): Doc fixes.
+
+ * filelock.c (Funlock_buffer, Ffile_locked_p): Doc fixes.
+
+ * fileio.c (Ffile_accessible_directory_p): Doc fix.
+
+ * eval.c (syms_of_eval): Doc fix.
+
+ * coding.c (syms_of_coding): Doc fix.
+
+ * doc.c (Fsnarf_documentation): Doc fix.
+
+ * dispnew.c (syms_of_display): Doc fix.
+
+ * category.c (Fget_unused_category): Doc fix.
+
+ * buffer.c (syms_of_buffer): Doc fixes.
+
+2001-11-14 Eli Zaretskii <[email protected]>
+
+ * print.c (prin1, print): Doc fix.
+
+2001-11-14 Pavel Jan,Am(Bk <[email protected]>
+
+ * fontset.h: Remove declarations of variables
+ `Vhighlight_wrong_size_font' and `Vclip_large_size_font'.
+
+ * fontset.c: Remove variables `Vhighlight_wrong_size_font' and
+ `Vclip_large_size_font'.
+
+2001-11-13 Jason Rumney <[email protected]>
+
+ * w32fns.c: Doc fix.
+
+2001-11-13 Pavel Jan,Am(Bk <[email protected]>
+
+ * xfaces.c (Fface_attributes_as_vector): Doc fix.
+
+ * fns.c: Doc fix.
+
+ * emacs.c: Doc fix.
+
+ * coding.c: Doc fix.
+
+ * cmds.c, composite.c, dired.c, doc.c, filelock.c, floatfns.c,
+ * fontset.c, insdel.c, keymap.c: Change doc-string comments to
+ `new style' [w/`doc:' keyword].
+
+2001-11-12 Richard M. Stallman <[email protected]>
+
+ * xterm.c (XTread_socket): Don't update focus for EnterNotify or
+ LeaveNotify events. Only FocusIn and FocusOut do that now.
+ (x_display_and_set_cursor): Do display hollow cursors in active
+ minibuffer windows when they are not selected.
+
+2001-11-12 Jason Rumney <[email protected]>
+
+ * w32console.c, w32fns.c, w32menu.c, w32proc.c, w32select.c,
+ * w32term.c: Change doc-string comments to `new style'
+ [w/`doc:' keyword]. Doc fixes.
+
+ * w32fns.c: Don't define max.
+ (Fx_open_connection): Only execute once.
+
+2001-11-12 Pavel Jan,Am(Bk <[email protected]>
+
+ * ccl.c: Change macros to use do-while block instead of if-else.
+ Use braces to follow GNU Coding Standards.
+
+2001-11-11 Richard M. Stallman <[email protected]>
+
+ * sysdep.c (child_setup_tty): Don't clear ICRNL or INLCR.
+
+ * lread.c (read_escape): Use end_of_file_error for reporting eof.
+
+ * insdel.c (replace_range): Use adjust_markers_for_replace
+ instead of adjust_markers_for_delete and adjust_markers_for_insert.
+
+ * intervals.h (set_text_properties, set_text_properties_1): Declare.
+
+ * textprop.c (set_text_properties_1): New subroutine
+ broken out of set_text_properties.
+ (set_text_properties): Use set_text_properties_1.
+
+ * intervals.c (graft_intervals_into_buffer):
+ Use set_text_properties_1 to clear out properties.
+
+ * search.c (Freplace_match): Use replace_range to insert
+ and delete. Don't request property inheritance from
+ surrounding text.
+
+2001-11-10 Jason Rumney <[email protected]>
+
+ * w32fns.c (enum_font_cb2): Use leading @ on face name to detect
+ vertical fonts. Allow them if face name is explicitly specified.
+ Do not give up if we find a font that cannot be converted to an xlfd.
+
+2001-11-10 Gerd Moellmann <[email protected]>
+
+ * unexelf.c (unexec): Use mmap/munmap to allocate buffers
+ instead of malloc/free.
+
+2001-11-09 Pavel Jan,Am(Bk <[email protected]>
+
+ * xfaces.c (merge_face_vectors): Use braces to follow GNU
+ Coding Standards.
+ (Finternal_set_lisp_face_attribute): Likewise.
+
+ * buffer.c (Fbury_buffer): Likewise.
+
+ * indent.c (current_column_1): Remove unused variable `prev_col'.
+
+ * coding.c (encode_coding): Use precomputed value of `src'.
+ (encode_coding): Remove unused variable `src_end'.
+ (code_convert_region): Remove unused variables `count'.
+
+2001-11-07 Jason Rumney <[email protected]>
+
+ * w32term.c (x_display_and_set_cursor): Do not move system caret
+ if cursor_glyph is NULL.
+
+2001-11-07 Pavel Jan,Am(Bk <[email protected]>
+
+ * keymap.c (access_keymap): Fix compilation error.
+
+2001-11-07 Miles Bader <[email protected]>
+
+ * xfns.c (x_set_frame_parameters): Avoid infinite recursion.
+
+2001-11-07 Pavel Jan,Am(Bk <[email protected]>
+
+ * intervals.c (graft_intervals_into_buffer):
+ Remove #ifdef'd-out code.
+ (graft_intervals_into_buffer): Remove unused variable `middle'.
+
+ * lread.c (Feval_region): Remove obsolete #ifdef'd-out
+ code (eval-current-buffer).
+ Change doc-string comments to `new style' [w/`doc:' keyword].
+
+2001-11-06 Richard M. Stallman <[email protected]>
+
+ * keymap.c (access_keymap): Don't use initializers on Lisp_Object.
+
+2001-11-06 Stefan Monnier <[email protected]>
+
+ * lread.c (read1): Fix behavior with nested backquoting.
+
+ * keyboard.c (make_lispy_event): Check integerness and fix
+ Lisp_Object/int mixup.
+
+2001-11-06 Pavel Jan,Am(Bk <[email protected]>
+
+ * fns.c (copy_hash_table): Remove unused variable `v'.
+
+ * fontset.c (fontset_font_pattern): Remove unused variable
+ `family_registry'.
+
+ * indent.c (current_column_1): Remove unused variable `prev_col'.
+
+2001-11-05 Richard M. Stallman <[email protected]>
+
+ * m/news-risc.h (BROKEN_PROTOTYPES): Defined.
+
+ * buffer.c (Fkill_buffer): Don't delete auto save file
+ if buffer is modified.
+
+2001-11-05 Andrew Innes <[email protected]>
+
+ * w32proc.c (Fw32_set_keyboard_layout): Use CHECK_NUMBER_CAR and
+ CHECK_NUMBER_CDR.
+
+2001-11-05 Richard M. Stallman <[email protected]>
+
+ * unexelf.c (unexec): Minor changes; clean up comments.
+
+2001-11-05 Sam Steingold <[email protected]>
+
+ * w32term.c (x_display_and_set_cursor): Fix w32 compilation error.
+
+2001-11-05 Andreas Schwab <[email protected]>
+
+ * sound.c (sound_perror): Save errno from being clobbered.
+
+2001-11-05 Dale Hagglund <[email protected]>
+
+ * unexelf.c (unexec): Don't use `mmap'. Instead, read and write
+ the program image directly.
+
+2001-11-05 Pavel Jan,Am(Bk <[email protected]>
+
+ * buffer.h (Fbuffer_local_value): Add prototype.
+
+2001-11-04 Richard M. Stallman <[email protected]>
+
+ * buffer.c (Fbuffer_local_value): Remove extra args from CHECK_SYMBOL
+ and CHECK_BUFFER.
+
+ * keyboard.c (read_char): Use Fcar and Fcdr, not Fnth.
+ (record_char): Likewise.
+
+ * keyboard.c (make_lispy_event): Don't insist a drag event must
+ move to a different buffer position. Instead, check for moving at
+ least double_click_fuzz.
+
+ * fns.c (Fmake_hash_table): Use XCAR and XCDR, not Fnth and Flength.
+
+ * keyboard.c (echo-area-clear-hook): Undo Oct 29 change.
+
+ * indent.c (current_column_1, Fmove_to_column): Separate the code
+ for display-table glyphs from the code for buffer text, to fix
+ bugs in the former.
+
+2001-11-04 Michael Welsh Duggan <[email protected]>
+
+ * buffer.c (Fbuffer_local_value): New function.
+ (syms_of_buffer): Defsubr it.
+
+ * xterm.c, w32term.c (x_display_and_set_cursor): Use buffer-local
+ value of `cursor-in-non-selected-windows'.
+
+ * lisp.h (Qcursor_in_non_selected_windows): New declaration.
+ * xdisp.c (Qcursor_in_non_selected_windows): New variable.
+ (syms_of_xdisp): Initialize it.
+
+2001-11-04 Pavel Jan,Am(Bk <[email protected]>
+
+ * xfns.c (Fx_create_frame): Doc fix.
+
+ * coding.c: Change doc-string comments to `new style' [w/`doc:'
+ keyword].
+
+ * eval.c (top_level_value, top_level_set): Remove commented and
+ #ifdef'd-out code.
+ (Fdefvar): Fix usage in doc-string.
+
+2001-11-03 Richard M. Stallman <[email protected]>
+
+ * xfns.c: Include unistd.h, if it exists.
+
+ * editfns.c: Move the include of ctype.h after unistd.h.
+
+ * gmalloc.c: Test BROKEN_PROTOTYPES.
+
+2001-11-03 Ken Raeburn <[email protected]>
+
+ * lisp.h (CHECK_STRING_CAR): New macro.
+ * lread.c (Fload): Use XSETCARFASTINT, XSETCDRFASTINT instead of
+ treating XCAR and XCDR as lvalues.
+ (openp): Use CHECK_STRING_CAR.
+ (read_list): Use XSETCDR instead of treating XCDR as lvalue.
+
+2001-11-03 Eli Zaretskii <[email protected]>
+
+ * s/sco5.h (sigprocmask_set): Declare as extern SIGMASKTYPE.
+ (SIGMASKTYPE): Define.
+
+ * syssignal.h (sigunblock): Don't define if already defined.
+
+2001-11-02 Pavel Jan,Am(Bk <[email protected]>
+
+ * eval.c (debugger_may_continue, Vdebug_ignored_errors)
+ (call_debugger, Fcondition_case, skip_debugger, unbind_to):
+ Fix typos in comments.
+
+ * mocklisp.c (Fml_defun, Fml_while, Fml_substr): Remove commented
+ and #ifdef'd-out code.
+ Fix and reindent comments.
+
+ * mocklisp.h: Remove comment which is a copy of comment in mocklisp.c.
+
+ * category.h (CHECK_CATEGORY, CHECK_CATEGORY_SET): Remove unused
+ argument `i' in macros.
+
+ * frame.h (CHECK_FRAME, CHECK_LIVE_FRAME): Remove unused argument
+ `i' in macros.
+
+ * lisp.h (CHECK_STRING_OR_BUFFER, CHECK_HASH_TABLE, CHECK_LIST)
+ (CHECK_STRING, CHECK_CONS, CHECK_SYMBOL, CHECK_CHAR_TABLE)
+ (CHECK_VECTOR, CHECK_VECTOR_OR_CHAR_TABLE, CHECK_BUFFER)
+ (CHECK_WINDOW, CHECK_LIVE_WINDOW, CHECK_PROCESS, CHECK_NUMBER)
+ (CHECK_NATNUM, CHECK_MARKER, CHECK_NUMBER_COERCE_MARKER)
+ (CHECK_FLOAT, CHECK_NUMBER_OR_FLOAT)
+ (CHECK_NUMBER_OR_FLOAT_COERCE_MARKER, CHECK_OVERLAY)
+ (CHECK_NUMBER_CAR, CHECK_NUMBER_CDR): Remove unused argument `i'
+ in macros.
+
+ * abbrev.c, alloc.c, buffer.c, bytecode.c, callint.c, callproc.c,
+ * casefiddle.c, category.c, ccl.c, charset.c, cmds.c, coding.c,
+ * composite.c, data.c, dired.c, dispnew.c, doc.c, dosfns.c, emacs.c,
+ * eval.c, fileio.c, filelock.c, fns.c, fontset.c, frame.c, frame.h,
+ * indent.c, keyboard.c, keymap.c, lread.c, macros.c, marker.c,
+ * minibuf.c, mocklisp.c, msdos.c, print.c, process.c, search.c,
+ * sunfns.c, syntax.c, textprop.c, undo.c, w16select.c, w32console.c,
+ * w32fns.c, w32menu.c, w32proc.c, w32select.c, window.c, xdisp.c,
+ * xfaces.c, xmenu.c, xselect.c: Update usage of CHECK_ macros
+ (remove unused second argument).
+
+2001-11-02 Stefan Monnier <[email protected]>
+
+ * syntax.c (describe_syntax): New wrapper.
+ (Finternal_describe_syntax_value): Rename from describe_syntax.
+ Don't insert space at front and \n at the end.
+ (syms_of_syntax): Defsubr Sinternal_describe_syntax_value.
+
+ * regex.c (re_wctype): Try to fix some warnings.
+ (regcomp, regexec): Don't forget the __restrict.
+
+2001-11-02 Richard M. Stallman <[email protected]>
+
+ * textprop.c (Fget_char_property): Doc fix.
+
+2001-11-02 Pavel Jan,Am(Bk <[email protected]>
+
+ * process.c (Fstart_process): Add usage to doc-string.
+
+ * data.c (Fsetq_default): Ditto.
+
+ * callint.c (Finteractive): Ditto.
+
+2001-11-01 Stefan Monnier <[email protected]>
+
+ * macros.c: Don't include keymap.h any more.
+
+2001-11-01 Richard M. Stallman <[email protected]>
+
+ * data.c (Fmake_local_variable): Doc fix.
+
+ * eval.c (Frun_hooks, Frun_hook_with_args_until_failure): Doc fix.
+ (Frun_hook_with_args_until_success, Frun_hook_with_args): Doc fix.
+
+ * keymap.c (Fdescribe_buffer_bindings): Print character property
+ bindings along with or instead of the buffer local map.
+ Make the overriding maps override what they should.
+
+2001-11-01 Pavel Jan,Am(Bk <[email protected]>
+
+ * window.c (grow_mini_window): Fix typo in comment.
+
+2001-11-01 Gerd Moellmann <[email protected]>
+
+ * xterm.c (x_scroll_bar_create): Check for width and height > 0.
+ (XTset_vertical_scroll_bar): Likewise.
+
+ * xfns.c (x_build_heuristic_mask): Use four_corners_best
+ instead of IMAGE_BACKGROUND.
+
+ * xfns.c (four_corners_best): Reindent.
+
+ * xfaces.c (Finternal_set_lisp_face_attribute_from_resource):
+ Handle :box so that it is possible to specify sexprs.
+
+2001-10-31 Eli Zaretskii <[email protected]>
+
+ * s/hpux11.h: New file.
+
+2001-10-31 Pavel Jan,Am(Bk <[email protected]>
+
+ * emacs.c (USAGE1): Show command line option --no-window-system
+ instead of --no-windows in usage.
+ (standard_args): Rename --no-windows to --no-window-system.
+ (bug_reporting_address): Follow Emacs coding conventions.
+
+ * eval.c (Fcommandp): Doc fix.
+ Change doc-string comments to `new style' [w/`doc:' keyword].
+
+ * frame.c (Fframe_live_p): Doc fix.
+
+ * buffer.c (selective-display-ellipses): Doc fix.
+
+2001-10-31 Gerd Moellmann <[email protected]>
+
+ * lread.c (to_multibyte): Fix computation of new read_buffer_size.
+
+ * xfaces.c (realize_x_face): If C is not a single-byte character,
+ set the face's colors_copied_bitwise_p instead of the defaulted_p
+ members which have a different meaning.
+ (free_face_colors): Do nothing for a face whose colors have been
+ copied bitwise.
+
+ * dispextern.h (struct face) <colors_copied_bitwise_p>: New member.
+
+2001-10-31 Pavel Jan,Am(Bk <[email protected]>
+
+ * marker.c, mocklisp.c: Change doc-string comments to `new style'
+ [w/`doc:' keyword].
+
+2001-10-31 Gerd Moellmann <[email protected]>
+
+ * fns.c (require_unwind): Return Lisp_Object.
+
+2001-10-31 Pavel Jan,Am(Bk <[email protected]>
+
+ * keyboard.c (lucid-menu-bar-dirty-flag): Doc fix.
+ (last-input-char): Revert doc-string to be the same as the
+ doc-string of `last-input-event'.
+
+ * xdisp.c: Fix typos in comments.
+
+2001-10-31 Gerd Moellmann <[email protected]>
+
+ * window.c (grow_mini_window): Handle case that the root
+ window is already smaller than the nominal mininum height.
+
+2001-10-30 Stefan Monnier <[email protected]>
+
+ * emacs.c (main): Don't call keys_of_macros any more.
+
+ * lisp.h (keys_of_macros): Remove.
+
+ * macros.c (keys_of_macros): Remove.
+
+ * xfaces.c (Fface_attribute_relative_p): Declare args.
+
+2001-10-30 Jason Rumney <[email protected]>
+
+ * w32fns.c (w32_to_x_charset): Increase size of XLFD charset buffer.
+ (enum_font_cb2): Ignore fonts with vertical orientation.
+
+2001-10-30 Richard M. Stallman <[email protected]>
+
+ * keyboard.c (Finput_pending_p): Doc fix.
+
+2001-10-30 Gerd Moellmann <[email protected]>
+
+ * xterm.c (x_after_update_window_line): Don't run the code
+ clearing in borders for rows whose visible height is 0.
+
+ * xdisp.c (clear_garbaged_frames): Redraw the frame only if its
+ resized_p flag is set. If not set, use the much less flickering
+ method previously used.
+
+ * dispnew.c (change_frame_size_1): Set frame's resized_p.
+
+ * frame.h (struct frame) <resized_p>: New member.
+
+ * lread.c (to_multibyte): Ensure read_buffer is at least twice
+ as large as the number of bytes to convert.
+
+ * lread.c (to_multibyte): New function.
+ (read1): Use it.
+
+2001-10-30 Eli Zaretskii <[email protected]>
+
+ * msdos.h (FRAME_LINE_HEIGHT): Define (it's used by xmenu.c).
+
+2001-10-30 Gerd Moellmann <[email protected]>
+
+ * xterm.c (x_draw_relief_rect): Correct bottom relief by 1 pixel.
+ (x_set_glyph_string_background_width): Set extends_to_end_of_line_p
+ if the row's fill_line_p is set and drawing the last glyph with
+ DRAW_IMAGE_{RAISED,SUNKEN}.
+
+ * xdisp.c (clear_garbaged_frames): Call Fredraw_frame.
+
+2001-10-29 Stefan Monnier <[email protected]>
+
+ * xmenu.c: Include coding.h and charset.h.
+ (Fx_popup_menu): Use FRAME_PTR and FRAME_FONT and FRAME_LINE_HEIGHT.
+ (Fx_popup_dialog): Use FRAME_PTR and enum scroll_bar_part.
+ (single_submenu, xmenu_show): Use ENCODE_SYSTEM.
+ Explicitly set wv->help. Use `TRUE' rather than `True'.
+ (menu_help_callback): Use empty_string.
+
+ * w32menu.c (Fx_popup_menu): Explicitly init f, xpos, and ypos.
+ (Fx_popup_dialog): Explicitly init f.
+ (w32_menu_display_help): Use empty_string.
+
+2001-10-29 Richard M. Stallman <[email protected]>
+
+ * fns.c (Frequire): Detect recursive try to require the same
+ feature 3 or more levels deep, and get error.
+ (require_unwind): New subroutine.
+ (require_nesting_list): New variable.
+ (syms_of_fns): Init and staticpro it.
+
+ * print.c (print_object): Clarify indication of insertion type.
+
+2001-10-29 Eli Zaretskii <[email protected]>
+
+ * coding.c (syms_of_coding): Document that locale-coding-system is
+ used for decoding input on X.
+
+ * window.c (Fscroll_left, Fscroll_right): Doc fix.
+
+2001-10-29 Pavel Jan,Am(Bk <[email protected]>
+
+ * keyboard.c (Finput_pending_p): Fix typo in doc-string.
+ (echo-area-clear-hook): Properly DEFVAR_LISP and staticpro it.
+
+2001-10-29 Gerd Moellmann <[email protected]>
+
+ * xterm.c (x_display_and_set_cursor): If cursor_in_echo_area,
+ use NO_CURSOR if cursor_in_non_selected_windows is false.
+
+ * xfaces.c (Fface_font): Use UNSPECIFIEDP instead of NILP for
+ the slant attribute if FRAME is t.
+
+ * xfns.c (x_set_internal_border_width): Set frame garbaged
+ when X window doesn't exist yet.
+
+ * xterm.c (x_after_update_window_line): Clear internal border
+ in different circumstances.
+
+ * xterm.c (XTread_socket) <KeyPress>: Don't use
+ STRING_CHAR_AND_LENGTH if nchars == nbytes. From Kenichi Handa
+
+2001-10-28 Eli Zaretskii <[email protected]>
+
+ * m/ibms390.h: New file. From Adam Thornton
+
+2001-10-28 Gerd Moellmann <[email protected]>
+
+ * xfns.c (x_build_heuristic_mask): Use x_alloc_image_color.
+
+ * xfns.c (x_build_heuristic_mask): Fix a bug not incrementing
+ a loop counter.
+
+2001-10-28 Pavel Jan,Am(Bk <[email protected]>
+
+ * emacs.c: Use argv[0] instead of "emacs" when -t was specified.
+
+ * keyboard.c: Change doc-string comments to `new style' [w/`doc:'
+ keyword].
+ Fix typos in comments.
+
+ * emacs.c (bug_reporting_address): New function.
+ Use it when displaying usage message.
+
+ * minibuf.c (read_minibuf): Remove unused external declaration of
+ variable `Qread_only'.
+
+ * keymap.c (access_keymap): Remove unused variable `charset'.
+
+2001-10-28 Miles Bader <[email protected]>
+
+ * xfaces.c (merge_face_heights): Handle TO being relative as well.
+ Remove #ifdef'd-out code.
+ (Fface_attribute_relative_p, Fmerge_face_attribute): New functions.
+ (syms_of_xfaces): Initialize them.
+
+2001-10-27 Jason Rumney <[email protected]>
+
+ * w32fns.c (w32_wnd_proc) <WM_KILLFOCUS>: Destroy the system caret.
+ <WM_EMACS_DESTROY_CARET, WM_EMACS_TRACK_CARET>: Track cursor
+ position using the system caret.
+
+ * w32term.c (w32_system_caret_hwnd, w32_system_caret_width)
+ (w32_system_caret_height, w32_system_caret_x)
+ (w32_system_caret_y): New variables for tracking system caret.
+ (w32_initialize): Initialize them.
+ (x_display_and_set_cursor): Make system caret follow the active cursor.
+
+ * w32term.h (WM_EMACS_TRACK_CARET, WM_EMACS_DESTROY_CARET):
+ New messages types.
+
+ * w32term.c (note_mouse_highlight): Clear old help_echo.
+
+2001-10-27 Pavel Jan,Am(Bk <[email protected]>
+
+ * xterm.c: Fix typo in a comment.
+
+ * emacs.c: Fix typos in comments.
+ Remove unnecessary spaces.
+ Change doc-string comments to `new style' [w/`doc:' keyword].
+ (USAGE2): Fix typos in usage string.
+
+ * xterm.c: Fix typo in a comment.
+
+ * lisp.h (gdb_lisp_params): Remove code in #if 0 which is now in
+ emacs.c.
+
+2001-10-27 Gerd Moellmann <[email protected]>
+
+ * xdisp.c (move_it_vertically_backward): Use 2/3 line_height
+ instead of 1/2 line_height in the heuristic for skipping
+ farther backward when target_y was not reached.
+
+ * sound.c (sound_perror): Unblock SIGIO, turn on atimers.
+ Display errno only if non-zero.
+ (sound_warning): New function.
+ (vox_configure): Don't treat failing to set sample rate as error.
+ (various places): Improve error messages.
+
+2001-10-26 Eli Zaretskii <[email protected]>
+
+ * fileio.c (Faccess_file): Run the argument filename through
+ Fexpand_file_name, before using it.
+
+ * dispnew.c (syms_of_display) <visible-bell>: Add a reference to
+ ring-bell-function. Suggested by Alf-Ivar Holm <[email protected]>
+
+2001-10-26 Gerd Moellmann <[email protected]>
+
+ * insdel.c (insert_1_both): Do nothing if NCHARS == 0.
+
+ * xterm.c (XTset_vertical_scroll_bar) [!USE_TOOLKIT_SCROLL_BARS]:
+ Fix clearing in the case of scroll bars on the right.
+
+2001-10-26 Juanma Barranquero <[email protected]>
+
+ * w32gui.h (XImage): Add a dummy typedef.
+
+2001-10-26 Gerd Moellmann <[email protected]>
+
+ * xfns.c (XScreenNumberOfScreen): Fix struct to pointer comparison.
+
+2001-10-25 Eli Zaretskii <[email protected]>
+
+ * frame.c (Fframe_parameter): Fix last change.
+
+ * fileio.c: Revert last change (which removed old commented-out
+ version of expand-file-name). Add a comment that explains why
+ this old version should not be removed.
+
+2001-10-25 Gerd Moellmann <[email protected]>
+
+ * frame.c (Fframe_parameter): Fix a bug whereby some
+ ``artificial'' frame parameters, like `minibuffer' were not
+ obtained by calling Fframe_parameters.
+
+ * xterm.c (show_mouse_face): Clean up. Recognize overwritten
+ cursor differently.
+
+ * xdisp.c (move_it_vertically_backward): Compute line height
+ differently. Add heuristic to try to be more compatible to 20.x.
+
+2001-10-25 Stefan Monnier <[email protected]>
+
+ * lisp.h (make_fixnum_or_float): Coerce double to int explicitly.
+
+ * editfns.c (text_property_stickiness): Fix Lisp_Object used as
+ boolean.
+
+2001-10-25 Miles Bader <[email protected]>
+
+ * xfns.c (png_load): Make sure SPECIFIED_BG is a string.
+ BG is a pointer to a structure, not a structure.
+ (gif_format, png_format): Add missing commas.
+
+2001-10-24 Richard M. Stallman <[email protected]>
+
+ * xfaces.c (Fface_attributes_as_vector): New function.
+ (syms_of_xfaces): Defsubr it.
+
+2001-10-24 Pavel Jan,Am(Bk <[email protected]>
+
+ * dispnew.c (sync_window_with_frame_matrix_rows): Remove unused
+ variable `area'.
+
+2001-10-25 Pavel Jan,Am(Bk <[email protected]>
+
+ * search.c (scan_newline): Remove unused variable `selective_display'.
+
+2001-10-25 Miles Bader <[email protected]>
+
+ * dispextern.h (struct image): Add `background',
+ `background_valid', and `background_transparent' fields.
+ (image_background, image_background_transparent): New declarations.
+ (IMAGE_BACKGROUND, IMAGE_BACKGROUND_TRANSPARENT): New macros.
+ * xfns.c (image_background, image_background_transparent)
+ (four_corners_best): New functions.
+ (xpm_format, png_format, jpeg_format, tiff_format, gif_format)
+ (gs_format): Add `:background' entry.
+ (lookup_image): Set IMG's background color if specified.
+ (pbm_load, xbm_load_image, png_load): Set IMG's background field
+ when appropriate.
+ (x_clear_image_1): Reset `background_valid' and
+ `background_transparent_valid' fields.
+ (x_build_heuristic_mask): Use IMAGE_BACKGROUND instead of
+ calculating it here. Set IMG's background_transparent field.
+ (enum xpm_keyword_index): Add XPM_BACKGROUND.
+ (enum png_keyword_index): Add PNG_BACKGROUND.
+ (enum jpeg_keyword_index): Add JPEG_BACKGROUND.
+ (enum tiff_keyword_index): Add TIFF_BACKGROUND.
+ (enum gif_keyword_index): Add GIF_BACKGROUND.
+ (enum gs_keyword_index): Add GS_BACKGROUND.
+ (pbm_load, png_load, jpeg_load, tiff_load, gif_load):
+ Pre-calculate image background color where necessary.
+ * xterm.c (x_setup_relief_colors): Use `IMAGE_BACKGROUND' and
+ `IMAGE_BACKGROUND_TRANSPARENT' to calculate the correct background
+ color to use for image glyph reliefs.
+
+2001-10-24 Gerd Moellmann <[email protected]>
+
+ * xterm.c (x_draw_glyphs): Don't check for cursor overwriting
+ in full-width rows.
+
+ * xterm.c (XTset_vertical_scroll_bar) [!USE_TOOLKIT_SCROLL_BARS]:
+ Fix clearing of area not covered by scroll bar.
+
+2001-10-24 Pavel Jan,Am(Bk <[email protected]>
+
+ * xterm.c (x_insert_glyphs): Remove unused variables `real_end'
+ and `real_start'.
+ (x_draw_image_foreground): Remove unused variables `mask' and `xgcv'.
+ (glyph_rect): Remove unused variable `area'.
+
+2001-10-24 Gerd Moellmann <[email protected]>
+
+ * xdisp.c: Change #ifdef GLYPH_DEBUG to #if.
+
+ * xdisp.c (try_window_reusing_current_matrix): Use row_containing_pos.
+ (row_containing_pos): Take additional argument DY.
+ Treat rows ending in middle of char differently.
+ (display_line): Handle tabs on window systems differently.
+
+ * xterm.c, w32term.c (fast_find_position): Call row_containing_pos
+ with additional argument.
+
+ * dispextern.h (row_containing_pos): Adjust prototype.
+
+ * xdisp.c (inhibit_try_window_id, inhibit_try_window_reusing)
+ (inhibit_try_cursor_movement) [GLYPH_DEBUG]: New variables.
+ (try_window_id, try_window_reusing_current_matrix)
+ (try_cursor_movement) [GLYPH_DEBUG]: Don't run if inhibited.
+ (syms_of_xdisp) [GLYPH_DEBUG]: DEFVAR_BOOL the variables.
+
+2001-10-24 Pavel Jan,Am(Bk <[email protected]>
+
+ * xmenu.c: Spell the name of Emacs properly (GNU Emacs instead of
+ gnuemacs).
+ (HAVE_BOXES): Fix typo in comment.
+ (push_menu_pane): Fix typo in comment.
+
+ * xdisp.c (display_prop_string_p): Remove unused local declaration
+ of `Qwhen'.
+ (single_display_prop_string_p): Remove unused local declarations
+ of `Qwhen' and `Qmargin'.
+ (string_buffer_position): Remove unused variable `around'.
+ (store_frame_title): Remove unused variable `width'.
+
+ * window.c: Don't define max.
+ (coordinates_in_window): Remove unused variable `uy'.
+
+ * widget.c: Don't define max.
+
+ * process.c: Don't define max.
+ (create_process): Remove unused variable `buffer'.
+
+2001-10-23 Gerd Moellmann <[email protected]>
+
+ * xfaces.c (Finternal_set_lisp_face_attribute): Fix compilation error.
+
+2001-10-23 Eli Zaretskii <[email protected]>
+
+ * xfaces.c (Finternal_set_lisp_face_attribute)
+ [HAVE_WINDOW_SYSTEM]: Don't do anything for QCfont unless the
+ frame is on a windowed display.
+
+2001-10-23 Gerd Moellmann <[email protected]>
+
+ * dispnew.c (sync_window_with_frame_matrix_rows):
+ Fix handling of windows which aren't full-width, fix handling
+ of marginal areas.
+
+ * lread.c (syms_of_lread) <recursive-load-depth-limit>: Raise to 50.
+
+2001-10-23 Andreas Schwab <[email protected]>
+
+ * m/macppc.h [LINUX]: Undef LD_SWITCH_SYSTEM_TEMACS and override
+ LD_SWITCH_MACHINE_TEMACS with "-Xlinker -znocombreloc".
+
+2001-10-23 Gerd Moellmann <[email protected]>
+
+ * xterm.c (x_draw_glyphs): Remove parameters READ_START and
+ REAL_END. Notice if cursor gets overwritten.
+ (notice_overwritten_cursor): Take X positions as parameters.
+ (x_draw_phys_cursor_glyph): Save state of w->phys_cursor_on_p
+ around call to x_draw_glyphs.
+
+2001-10-23 Pavel Jan,Am(Bk <[email protected]>
+
+ * syntax.c (modify-syntax-entry): Fix argument names (use CHAR
+ instead of C) and usage.
+
+ * editfns.c (char-to-string): Fix argument names (use CHAR instead
+ of C) and usage.
+
+ * xfns.c (Fx_show_tip): Remove unused variables `buffer', `top',
+ `left', `max_width' and `max_height'.
+
+2001-10-23 Gerd Moellmann <[email protected]>
+
+ * xdisp.c (display_line): For a tab continued to the next line,
+ set row's ends_in_middle_of_char_p.
+
+2001-10-22 Gerd Moellmann <[email protected]>
+
+ * xdisp.c (display_line): Fix computation of continuation lines
+ width for TABs.
+
+2001-10-22 Pavel Jan,Am(Bk <[email protected]>
+
+ * xdisp.c (build_desired_tool_bar_string): Remove unused variable
+ `Qlaplace'.
+
+ * fileio.c: Remove unused code.
+
+2001-10-22 Miles Bader <[email protected]>
+
+ * lisp.h (DEFVAR_LISP, DEFVAR_LISP_NOPRO, DEFVAR_BOOL)
+ (DEFVAR_INT, DEFVAR_PER_BUFFER, DEFVAR_KBOARD):
+ Remove `DOC_STRINGS_IN_COMMENTS' cases.
+
+2001-10-21 Jason Rumney <[email protected]>
+
+ * w32term.c (x_erase_phys_cursor): Remove inverse_p again.
+
+2001-10-21 Eli Zaretskii <[email protected]>
+
+ * mocklisp.c (Fml_if, Fml_provide_prefix_argument)
+ (Finsert_string): Avoid the multi-line string literals warning.
+
+2001-10-22 Miles Bader <[email protected]>
+
+ * doc.c (Vhelp_manyarg_func_alist): Variable removed.
+ (Fdocumentation): Don't use it.
+ (syms_of_doc): Don't initialize it.
+
+ * keyboard.c (Ftrack_mouse): Add usage: string to doc string.
+ * print.c (Fwith_output_to_temp_buffer): Likewise.
+ * window.c (Fsave_window_excursion): Likewise.
+ * editfns.c (Fsave_excursion, Fsave_current_buffer)
+ (Fsave_restriction): Likewise.
+ * eval.c (Frun_hooks, Frun_hook_with_args)
+ (Frun_hook_with_args_until_failure)
+ (Frun_hook_with_args_until_success, Ffuncall, For, Fand, Fif)
+ (Fcond, Fprogn, Fprog1, Fprog2, Fsetq, Fquote, Ffunction, Fdefun)
+ (Fdefmacro, Fdefvar, Fdefconst, FletX, Flet, Fwhile, Fcatch)
+ (Funwind_protect, Fcondition_case): Likewise.
+ * coding.c (Ffind_operation_coding_system): Likewise.
+ * keyboard.c (Ftrack_mouse): Likewise.
+
+2001-10-21 Miles Bader <[email protected]>
+
+ * fns.c (Fappend, Fconcat, Fvconcat, Fnconc, Fwidget_apply)
+ (Fmake_hash_table): Add usage: string to doc string.
+ * editfns.c (Finsert, Finsert_and_inherit, Finsert_before_markers)
+ (Fmessage, Fmessage_box, Fmessage_or_box, Fpropertize, Fformat)
+ (Fencode_time, Finsert_and_inherit_before_markers): Likewise.
+ * mocklisp.c (Finsert_string, Fml_if, Fml_provide_prefix_argument)
+ (Fml_prefix_argument_loop): Likewise.
+
+2001-10-21 Pavel Jan,Am(Bk <[email protected]>
+
+ * fileio.c (Finsert_file_contents): Remove unused variable `gap_size'.
+
+ * sysdep.c (init_sys_modes): Change doc-string comments to `new
+ style' [w/`doc:' keyword].
+
+ * data.c, fileio.c, indent.c, print.c, search.c, sound.c,
+ * sunfns.c, textprop.c, undo.c, xselect.c: Change doc-string
+ comments to `new style' [w/`doc:' keyword].
+
+2001-10-21 Jason Rumney <[email protected]>
+
+ * w32fns.c (Fx_file_dialog): Pass a filter to GetOpenFileName.
+
+ * w32term.c (remember_mouse_glyph): New function.
+ (w32_mouse_position): Use it.
+ (note_mouse_movement): If the mouse moved off the glyph, remember
+ its new position.
+
+ * w32term.h (struct w32_output): Correct spelling of x_compatible.
+ (w32_display_info): Add mouse_face_overlay.
+
+ * w32term.c (notice_overwritten_cursor): Renamed from
+ note_overwritten_text_cursor. Rewritten to take glyph widths into
+ account.
+ (x_y_to_hpos_vpos): Add parameter BUFFER_ONLY_P.
+ (fast_find_string_pos): New function.
+ (fast_find_position): Return the correct vpos. Add parameter
+ STOP. In the final row, stop before glyphs having STOP as object.
+ Don't consider glyphs that are not from a buffer.
+ (fast_find_position) [0]: Add a presumably more correct version
+ for after 21.1.
+ (expose_window_tree, expose_frame): Don't compute intersections here.
+ (expose_window): Do it here instead.
+ (expose_window_tree, expose_window, expose_line): Return 1 when
+ overwriting mouse-face.
+ (expose_window): If W is the window currently being updated, mark
+ the frame garbaged.
+ (expose_frame): If mouse-face was overwritten, redo it.
+ (x_use_underline_position_properties): New variable.
+ (syms_of_xterm): DEFVAR_BOOL it.
+ (x_draw_glyph_string): Add comment to use it in future.
+ (x_draw_glyph_string): Restore clipping after drawing box.
+ Fix a computation of the underline position.
+ (w32_get_glyph_string_clip_rect): Minor cleanup.
+ (x_fill_stretch_glyph_string): Remove an assertion.
+ (x_produce_glyphs): Don't convert multibyte characters
+ to unibyte characters in unibyte buffers.
+ (cursor_in_mouse_face_p): New function.
+ (x_draw_stretch_glyph_string): Use it to choose a different GC
+ when drawing a cursor within highlighted text. Don't draw
+ background again if it has already been drawn.
+ (x_draw_glyph_string_box): Don't draw a full-width
+ box just because the glyph row's full_width_p flag is set.
+ (x_draw_glyphs): Fix computation of rightmost x for
+ full-width rows.
+ (x_dump_glyph_string): Put in #if GLYPH_DEBUG.
+ (w32_draw_relief_rect): Extend left shadow to the bottom and left;
+ change bottom shadow accordingly. Some cleanup.
+ (x_update_window_end): Handle overwritten mouse face
+ also for tool bar windows.
+ (show_mouse_face): Set the glyph row's mouse_face_p flag also when
+ DRAW is DRAW_IMAGE_RAISED.
+ (clear_mouse_face): Return 1 if text with mouse face was
+ actually redrawn. Make the function static.
+ Reset dpyinfo->mouse_face_overlay otherwise note_mouse_highlight might
+ optimize away highlighting if we pass over that same overlay again.
+ (note_mouse_highlight): Call mouse_face_overlay_overlaps
+ to detect a case where we have to highlight a different region
+ despite not having left the currently highlighted region.
+ Set mouse_face_overlay in the x_display_info. Avoid changing the
+ mouse pointer shape when show_mouse_face has already done it, or
+ there is no need. Handle mouse-face and help-echo in strings.
+ (glyph_rect): New function.
+ (w32_mouse_position): Use it to raise the threshold for mouse
+ movement event generation.
+ (w32_initialize_display_info): Initialize the x_display_info's
+ mouse_face_overlay.
+ (w32_set_vertical_scroll_bar): Don't clear a zero height
+ or width area.
+ (w32_set_vertical_scroll_bar, x_scroll_bar_create): Don't configure
+ a widget to zero height.
+
+ * w32menu.c (single_submenu, w32_menu_show) [!HAVE_MULTILINGUAL_MENU]:
+ Protect unibyte strings created by replacing their multibyte
+ equivalents in menu_items.
+ (w32_menu_show): Don't overwrite an item's name with its key
+ description in case the description is a multibyte string.
+ (single_submenu): Some cleanup.
+
+ * w32fns.c (x_laplace_read_row, x_laplace_write_row): Removed.
+ (postprocess_image): New function.
+ (lookup_image): Call it for all image types except PostScript.
+ (x_kill_gs_process): Call postprocess_image.
+ (tiff_error_handler, tiff_warning_handler): New functions.
+ (tiff_load): Install them as handlers.
+ (x_kill_gs_process): Recognize if someone has cleared the image
+ cache under us.
+ (valid_image_p): Protect better against invalid image
+ specifications. Previous code could signal an error.
+ (Fx_hide_tip, Fshow_tip): Doc fix.
+ (Fv_max_tooltip_size): New variable.
+ (syns_of_xfns): DEFVAR_LISP it.
+ (Fx_show_tip): Add parameter TEXT. Set the tip frame's root
+ window buffer to *tip* right after creating the frame. Set frame's
+ window_width. Use a maximum tooltip size specified by
+ Vx_max_tooltip_size, if that has valid contents.
+ (compute_tip_xy): Add parameters WIDTH and HEIGHT.
+ Make sure the tooltip is completely visible.
+ (x_create_tip_frame): Set tooltip buffer's truncate-lines to nil.
+ (Fx_create_frame): Adjust the frame's height for presence
+ of the tool bar before calling x_figure_window_size.
+ (x_set_tool_bar_lines): Clear the tool bar window's current matrix
+ when the window gets smaller.
+ (x_set_foreground_color): Set frame's cursor_pixel.
+ (x_set_foreground_color, x_set_background_color): Cleaned up.
+ (x_set_font): Handle case of x_new_fontset returning the same name
+ as before, although there was a change in fontsets.
+
+2001-10-21 Miles Bader <[email protected]>
+
+ * data.c (Fplus, Fminus, Fmax, Ftimes, Fquo, Flogand, Flogior)
+ (Flogxor): Add usage: string to doc string.
+ * charset.c (Fstring): Likewise.
+ * callproc.c (Fcall_process_region, Fcall_process): Likewise.
+ * alloc.c (Fmake_byte_code, Fvector, Flist): Likewise.
+
+2001-10-21 Pavel Jan,Am(Bk <[email protected]>
+
+ * buffer.c: Reindent DEFUNs and DEFVARs with doc: keywords.
+
+ * alloc.c: Reindent DEFUNs with doc: keywords.
+
+ * abbrev.c (Finsert_abbrev_table_description): Reindent.
+
+ * frame.c: Change doc-string comments to `new style' [w/`doc:'
+ keyword].
+
+See ChangeLog.9 for earlier changes.
;; Local Variables:
;; coding: iso-2022-7bit
;; add-log-time-zone-rule: t
;; End:
- Copyright (C) 2007 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2003, 2004, 2005,
+ 2006, 2007 Free Software Foundation, Inc.
This file is part of GNU Emacs.
@@ -2448,4 +29074,4 @@ See ChangeLog.10 for earlier changes.
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
-;; arch-tag: dfb6ad96-1550-4905-9e53-d2059ee84c40
+;;; arch-tag: 5dcc435f-4038-4141-b3bf-5be51cd76bd4
diff --git a/src/ChangeLog.10 b/src/ChangeLog.10
deleted file mode 100644
index 8dbf09269d..0000000000
--- a/src/ChangeLog.10
+++ /dev/null
@@ -1,28326 +0,0 @@
-<<<<<<< TREE
-2007-04-24 Chong Yidong <[email protected]>
-=======
-2007-10-06 Martin Rudalics <[email protected]>
-
- * keyboard.c (kbd_buffer_get_event): Break loop waiting for input
- when there's an unread command event.
-
- * frame.c (focus_follows_mouse): Moved here from frame.el to allow
- window autoselection act appropriately when leaving selected frame.
- (syms_of_frame): Initialize focus_follows_mouse.
- * frame.h (focus_follows_mouse): Extern it.
- * macterm.c (XTread_socket): When focus_follows_mouse is nil
- make SELECT_WINDOW_EVENT only if we don't leave the selected
- frame.
- * msdos.c (dos_rawgetc): Likewise.
- * w32term.c (w32_read_socket): Likewise.
- * xterm.c (handle_one_xevent): Likewise.
- * xdisp.c (syms_of_xdisp): In doc-string of
- mouse-autoselect-window mention focus-follows-mouse.
-
-2007-10-06 Andreas Schwab <[email protected]>
-
- * fileio.c (Fwrite_region): Ignore EINVAL error from fsync.
-
-2007-10-05 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.c (mac_load_query_font): Fix missing return value.
- [USE_CG_DRAWING] (mac_define_fringe_bitmap, mac_destroy_fringe_bitmap):
- Add BLOCK_INPUT.
-
-2007-10-04 Juanma Barranquero <[email protected]>
-
- * image.c (syms_of_image) <image-types>: Fix typo in docstring.
-
-2007-10-02 Richard Stallman <[email protected]>
-
- * xdisp.c (get_window_cursor_type): Implement documented behavior
- for cursor-in-non-selected-windows = t.
-
-2007-10-01 Juanma Barranquero <[email protected]>
-
- * lread.c (Fload): Fix typo in docstring.
-
-2007-09-29 Juri Linkov <[email protected]>
-
- * emacs.c (standard_args): Change priority of "--no-splash"
- from 40 to 3. Add "--no-desktop" with the same priority.
-
-2007-09-29 Jason Rumney <[email protected]>
-
- * w32.c (w32_get_resource): Always close registry keys.
-
-2007-09-27 Jason Rumney <[email protected]>
-
- * makefile.w32-in (LIBS): Add COMCTL32.
-
- * w32fns.c (globals_of_w32fns): Init common controls.
-
-2007-09-21 Richard Stallman <[email protected]>
-
- * image.c (our_memory_buffer): Renamed from omfib_buffer.
-
-2007-09-21 Juanma Barranquero <[email protected]>
-
- * w32term.c (x_draw_glyph_string): Use strike_through_color, not
- underline_color, to draw strike-through.
-
-2007-09-20 Glenn Morris <[email protected]>
-
- * process.c (Fmake_network_process): Doc fix.
-
-2007-09-19 Richard Stallman <[email protected]>
-
- * buffer.c (Foverlays_at): Doc fix.
-
-2007-09-18 Stefan Monnier <[email protected]>
-
- * fns.c (Fplist_put): Preserve uneven tail data.
-
-2007-09-16 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (xg_get_image_for_pixmap): Always create a GdkPixbuf
- when we have no file name for the icon.
- (xg_tool_bar_expose_callback): Remove.
- (xg_create_tool_bar): Don't connect expose signal to
- xg_tool_bar_expose_callback.
-
-2007-09-16 Andreas Schwab <[email protected]>
-
- * alloc.c (reset_malloc_hooks): Set the hooks to the previous
- values instead of zapping them.
-
-2007-09-15 Glenn Morris <[email protected]>
-
- * s/hpux.h: No longer define `static' as nothing.
-
-2007-09-14 Glenn Morris <[email protected]>
-
- * fringe.c (init_fringe_bitmap) <swap nibble>: Move to file scope.
- * gtkutil.c (xg_separator_p) <separator_names>: Move to file scope.
- * image.c (our_memory_fill_input_buffer) <buffer>: Move to file
- scope and rename to omfib_buffer for clarity.
- (gif_load) <interlace_start, interlace_increment>: Move to file scope.
-
-2007-09-14 Peter O'Gorman <[email protected]> (tiny change)
-
- * gtkutil.c (xg_get_file_with_chooser): Move GCPRO1 after declarations.
-
- * termhooks.h (enum event_kind): Remove trailing comma.
-
- * frame.h (enum): Remove trailing comma.
-
-2007-09-14 Jan Dj,Ad(Brv <[email protected]>
-
- * keyboard.c, xterm.c, xfaces.c (abs): #undef before #define.
-
-2007-09-12 Glenn Morris <[email protected]>
-
- * gtkutil.c (cnt): Rename to menu_grab_callback_cnt for clarity.
- (menu_grab_callback): All uses changed.
-
- * xselect.c (cnt): Rename to x_reply_selection_request_cnt for clarity.
- (x_reply_selection_request): All uses changed.
-
-2007-09-06 Pixel <[email protected]> (tiny change)
-
- * image.c (gif_load): Fix bug: Handle nonexistent colormap.
-
-2007-09-06 Glenn Morris <[email protected]>
-
- * gtkutil.c (menu_grab_callback) <cnt>:
- * xselect.c (x_reply_selection_request) <cnt>: Move static
- variable to file scope.
-
-2007-09-02 Dhuvra Krishnamurthy <[email protected]> (tiny change)
-
- * w32proc.c (delete_child): Don't terminate threads of zombies.
-
-2007-09-02 Jan Dj,Ad(Brv <[email protected]>
-
- * keyboard.c: Qrtl is new.
- (parse_tool_bar_item): Handle :rtl keyword.
- (syms_of_keyboard): Intern :rtl keyword.
-
- * dispextern.h (enum tool_bar_item_idx): Add TOOL_BAR_ITEM_RTL_IMAGE.
-
- * gtkutil.c (file_for_image, find_rtl_image): New functions.
- (xg_get_image_for_pixmap): Use file_for_image
- (update_frame_tool_bar): If direction is RTL, use RTL image if
- defined. Use Gtk stock images or named theme icons if defined.
-
-2007-08-29 Martin Rudalics <[email protected]>
-
- * keyboard.h (struct kboard): New elt Vlast_repeatable_command.
-
- * keyboard.c (syms_of_keyboard): Set up new Lisp variable
- last-repeatable-command.
- (init_kboard): Initialize Vlast_repeatable_command.
- (command_loop_1): Set it to real_this_command unless that was
- bound to an input event.
- (mark_kboards): Mark it.
-
-2007-08-28 Juanma Barranquero <[email protected]>
-
- * image.c (syms_of_image) <image-library-alist, cross-disabled-images>:
- Doc fixes.
-
-2007-08-28 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (xg_tool_bar_expose_callback): Just do SET_FRAME_GARBAGED
- so no Lisp code is executed.
-
-2007-08-27 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.c (x_draw_composite_glyph_string_foreground): Draw rectangle
- for nonexistent or zero-width glyph in composition glyph.
-
-2007-08-27 Richard Stallman <[email protected]>
-
- * eval.c (condition-case): Doc fix.
-
-2007-08-27 Masatake YAMATO <[email protected]>
-
- * xfaces.c (tty_supports_face_attributes_p): Fix code
- for LFACE_INVERSE_INDEX and LFACE_BACKGROUND_INDEX; code
- was copied and not edited.
-
-2007-08-23 Stefan Monnier <[email protected]>
-
- * lread.c (load_warn_old_style_backquotes): Fix up array size typo.
-
-2007-08-22 Stefan Monnier <[email protected]>
-
- * lread.c (Qold_style_backquotes): New var.
- (syms_of_lread): Init and staticpro it.
- (load_warn_old_style_backquotes): New fun.
- (Fload): Use them to warn about old style backquotes.
- (end_of_file_error, Fload): Remove unused vars.
-
- * lisp.h (Fclear_face_cache, Fx_send_client_event): Declare.
-
- * lread.c (Vold_style_backquotes): New var.
- (syms_of_lread): Init and export it to Elisp.
- (read1): Set it when we find an old-style (back)quote.
-
-2007-08-22 Jason Rumney <[email protected]>
-
- * w32reg.c (SYSTEM_DEFAULT_RESOURCES): Add missing NULL terminator.
-
-2007-08-21 Stefan Monnier <[email protected]>
-
- * insdel.c (reset_var_on_error): New fun.
- (signal_before_change, signal_after_change):
- Use it to reset (after|before)-change-functions to nil in case of error.
- Bind inhibit-modification-hooks to t.
- Don't bind (after|before)-change-functions to nil while they run.
-
-2007-08-19 Andreas Schwab <[email protected]>
-
- * alloc.c (pure): Round PURESIZE up.
-
-2007-08-17 Jan Dj,Ad(Brv <[email protected]>
-
- * xterm.c (handle_one_xevent): Remove check that mouse click is in
- active frame.
-
-2007-08-15 Philippe Waroquiers <[email protected]>
-
- * term.c (tty_default_color_capabilities): Declare static
- variables in file scope, to avoid HPUX compiler problem.
-
-2007-08-13 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (update_frame_tool_bar): Use -1 as index
- to gtk_toolbar_insert.
-
-2007-08-11 YAMAMOTO Mitsuharu <[email protected]>
-
- * xterm.c (x_draw_image_glyph_string): Adjust stipple origin when
- filling pixmap with stippled background.
-
-2007-08-10 Stefan Monnier <[email protected]>
-
- * print.c (new_backquote_output): Rename from old_backquote_output.
- (print): Inverse its logic (according to its name) so as to match the
- behavior of new_backquote_flag in lread.c.
-
-2007-08-09 YAMAMOTO Mitsuharu <[email protected]>
-
- * gmalloc.c (posix_memalign): New function.
-
-2007-08-08 Glenn Morris <[email protected]>
-
- * Replace `iff' in doc-strings and comments.
-
-2007-08-07 Chong Yidong <[email protected]>
-
- * dispextern.h (struct image): New members.
-
- * image.c: Sync to trunk version.
- (search_image_cache, uncache_image, image-refresh): New functions.
- Check for fg and bg colors.
- (lookup_image): Use search_image_cache. Cache fg and bg colors.
- (pbm_load): Another check for invalid image data.
- (png_load): Ignore default background field.
-
- * xdisp.c (move_it_by_lines): Remove incorrect optimization.
-
-2007-08-07 Jan Dj,Ad(Brv <[email protected]>
-
- * gmalloc.c (__malloc_initialize): Remove pthread_once. Not needed.
-
-2007-08-07 Sam Steingold <[email protected]>
-
- * gmalloc.c (__morecore): Fix the declaration to comply with the
- definition.
-
-2007-08-07 YAMAMOTO Mitsuharu <[email protected]>
-
- * emacs.c (main)
- [HAVE_GTK_AND_PTHREAD && !SYSTEM_MALLOC && !DOUG_LEA_MALLOC]:
- Call malloc_enable_thread on interactive startup.
-
- * gmalloc.c (_malloc_thread_enabled_p) [USE_PTHREAD]: New variable.
- (LOCK, UNLOCK, LOCK_ALIGNED_BLOCKS, UNLOCK_ALIGNED_BLOCKS)
- [USE_PTHREAD]: Conditionalize with it.
- (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
- (malloc_atfork_handler_child, malloc_enable_thread) [USE_PTHREAD]:
- New functions.
-
-2007-08-06 Chong Yidong <[email protected]>
-
- * xdisp.c (redisplay_window): When restoring original buffer
- position, make sure it is still valid.
-
-2007-08-06 Martin Rudalics <[email protected]>
-
- * window.c (window_min_size_2): New function.
- (window_min_size_1, size_window, Fdisplay_buffer)
- (Fsplit_window, adjust_window_trailing_edge): Use it to avoid
- windows without mode- or header-lines when window-min-height is
- too small.
- (size_window): Reset nodelete_p after testing it, following an
- earlier note by Kim F. Storm.
- (display_buffer): Do not set split_height_threshold to twice the
- value of window_min_height to avoid changing the value of a
- customizable variable. Rather explicitly check whether the
- height of the window that shall be splitted is at least as large
- as split_height_threshold.
- (Fwindow_full_width_p): New defun.
- (syms_of_window): Defsubr it.
-
- * window.h: Add EXFUN for Fwindow_full_width_p.
-
-2007-08-06 Andreas Schwab <[email protected]>
-
- * window.c (Fdisplay_buffer): Use NILP.
- (Fset_window_scroll_bars): Likewise.
-
-2007-08-03 Richard Stallman <[email protected]>
-
- * fileio.c (Fvisited_file_modtime): Use make_time.
-
-2007-08-01 Ryo Yoshitake <[email protected]> (tiny change)
-
- * mac.c (init_mac_osx_environment): Adjust load-path on self-contained
- build.
-
-2007-07-30 Stefan Monnier <[email protected]>
-
- * eval.c (init_eval_once): Bump max_lisp_eval_depth to 400.
-
-2007-07-25 Glenn Morris <[email protected]>
-
- * Relicense all FSF files to GPLv3 or later.
-
- * COPYING: Switch to GPLv3.
-
-2007-07-24 Jason Rumney <[email protected]>
-
- * w32fns.c (x_real_positions): Get real position from OS instead of
- calculating it.
-
-2007-07-23 Jason Rumney <[email protected]>
-
- * filelock.c (current_lock_owner): Allow for @ sign in username.
-
-2007-07-20 Eli Zaretskii <[email protected]>
-
- * makefile.w32-in (clean): Don't delete *~.
-
- * w32proc.c (IMAGE_NT_OPTIONAL_HDR32_MAGIC, IMAGE_OPTIONAL_HEADER32):
- Define if not defined.
-
-2007-07-18 Jason Rumney <[email protected]>
-
- * w32proc.c (w32_executable_type): Handle 64 bit executables.
-
-2007-07-16 Juanma Barranquero <[email protected]>
-
- * coding.c (Ffind_operation_coding_system):
- * eval.c (For, Fand, Fprogn):
- * keyboard.c (Ftrack_mouse):
- * print.c (Fwith_output_to_temp_buffer):
- * window.c (Fsave_window_excursion): Doc fixes (some reported
- by Johan Bockg,Ae(Brd).
-
-2007-07-15 Richard Stallman <[email protected]>
-
- * data.c (Fsetq_default): Doc fix.
-
- * eval.c (Fsetq): Doc fix.
-
-2007-07-11 Jason Rumney <[email protected]>
-
- * makefile.w32-in (LIBS): Include OLE32.
-
- * w32fns.c (w32_msg_pump) <WM_EMACS_CREATEWINDOW>: Initialize COM.
- (w32_msg_pump) <WM_DESTROY>: Uninitialize COM.
-
-2007-06-28 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.c [USE_MAC_TSM] (mac_handle_text_input_event):
- Check WINDOWP before using XWINDOW.
-
-2007-06-27 Juanma Barranquero <[email protected]>
->>>>>>> MERGE-SOURCE
-
- * Branch for 22.1.
-
-2007-04-24 Chong Yidong <[email protected]>
-
- * xdisp.c (redisplay_window): Use BEG_UNCHANGED and END_UNCHANGED
- values of the actual window.
-
-2007-04-23 Richard Stallman <[email protected]>
-
- * process.c (Fstart_process): Doc fix.
-
-2007-04-23 Eli Zaretskii <[email protected]>
-
- * process.c (Fstart_process): Doc fix.
-
-2007-04-22 Richard Stallman <[email protected]>
-
- * abbrev.c (Fdefine_abbrev): Doc fix.
-
- * keymap.c (Fdefine_key): Minor doc fix.
-
-2007-04-21 Glenn Morris <[email protected]>
-
- * keymap.c (Fdefine_key): Fix info ref in doc string.
-
-2007-04-20 Glenn Morris <[email protected]>
-
- * sysdep.c (init_system_name): Don't accept localhost.localdomain.
-
-2007-04-19 Juanma Barranquero <[email protected]>
-
- * minibuf.c (Fminibuffer_contents, Fminibuffer_contents_no_properties)
- (Fminibuffer_completion_contents, Fdelete_minibuffer_contents):
- Doc fixes.
-
-2007-04-16 Chong Yidong <[email protected]>
-
- * dispnew.c (adjust_frame_glyphs_for_frame_redisplay):
- Set garbaged flag in presence of window margins.
- (showing_window_margins_p): New function.
-
- * xdisp.c (cursor_row_p): Only end row on newline if it's a
- display string. Suggested by Lennart Borgman.
-
-2007-04-16 YAMAMOTO Mitsuharu <[email protected]>
-
- * alloc.c (mem_insert): Set min_heap_address and max_heap_address
- if they are not yet initialized.
-
-2007-04-15 Chong Yidong <[email protected]>
-
- * xdisp.c (redisplay_window): When deciding whether or not to
- recenter, don't use the reset values of BEG_UNCHANGED and
- END_UNCHANGED.
-
-2007-04-13 Kim F. Storm <[email protected]>
-
- * buffer.c (Fkill_buffer): gcpro BUF during kill_buffer_processes
- and check that buffer is still alive upon return.
-
-2007-04-13 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.c [!TARGET_API_MAC_CARBON]: Include Displays.h.
- (mac_screen_config_changed): New variable.
- (mac_handle_dm_notification, init_dm_notification_handler)
- (mac_get_screen_info): New functions.
- [MAC_OS8] (main): Call init_dm_notification_handler.
- (mac_initialize) [MAC_OSX]: Likewise.
- (XTread_socket): Call mac_get_screen_info if screen config changed.
- (mac_initialized): Make static.
- (mac_initialize_display_info): Remove function.
- (mac_term_init): Call mac_get_screen_info. Add partial contents of
- mac_initialize_display_info.
-
-2007-04-12 YAMAMOTO Mitsuharu <[email protected]>
-
- * mac.c (xrm_get_preference_database, Fmac_get_preference)
- [TARGET_API_MAC_CARBON]: Use CFPreferencesAppSynchronize.
-
- * macterm.c [TARGET_API_MAC_CARBON] (mac_post_mouse_moved_event):
- Use GetGlobalMouse instead of GetMouse and LocalToGlobal.
- (mac_initialize_display_info) [MAC_OSX]: Use CGRectZero.
- (mac_initialize_display_info) [!MAC_OSX]: dpyinfo->height and
- dpyinfo->width are those of whole screen.
-
-2007-04-10 Chong Yidong <[email protected]>
-
- * xdisp.c (note_mode_line_or_margin_highlight): Don't decrement
- glyph pointer before start of glyph row.
-
-2007-04-09 YAMAMOTO Mitsuharu <[email protected]>
-
- * s/darwin.h (__restrict, struct kboard): Remove outdated workarounds.
- (C_SWITCH_SYSTEM): Remove `-I../mac/src'.
-
-2007-04-09 Martin Rudalics <[email protected]>
-
- * indent.c (Fmove_to_column): Set next_boundary with correct start pt.
-
-2007-04-08 Richard Stallman <[email protected]>
-
- * xdisp.c (syms_of_xdisp) <message-log-max>: Default 100.
-
-2007-04-07 Chong Yidong <[email protected]>
-
- * editfns.c (Ftranspose_regions): Validate interval before setting
- text properties.
-
-2007-04-03 Eli Zaretskii <[email protected]>
-
- * emacs.c (main): Fix instructions for building Emacs for profiling.
-
-2007-04-03 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (xg_update_menubar): Call g_list_next after moving
- menu bar item.
-
-2007-04-02 Juanma Barranquero <[email protected]>
-
- * print.c (Fprin1_to_string): Use macro SPECPDL_INDEX.
-
-2007-04-01 Chong Yidong <[email protected]>
-
- * keymap.c (Fcommand_remapping): New optional argument.
- (where_is_internal): Use new keymaps argument.
- (Fkey_binding): Caller changed.
-
- * keyboard.c (command_loop_1): Caller changed.
-
-2007-03-31 Eli Zaretskii <[email protected]>
-
- * window.c (Fget_lru_window): Doc fix.
-
-2007-03-30 Chong Yidong <[email protected]>
-
- * undo.c (Fprimitive_undo): Give clearer error message when trying
- to change text properties outside accessible part of buffer.
-
-2007-03-29 Kim F. Storm <[email protected]>
-
- * process.c (wait_reading_process_output) [HAVE_PTYS]:
- When EIO happens, clear channel from descriptor masks before raising
- SIGCHLD signal to avoid busy loop between read and sigchld_handler.
- (sigchld_handler): Remove sleep (2007-03-11 & 2007-03-26 changes).
-
-2007-03-29 Juanma Barranquero <[email protected]>
-
- * buffer.c (Fset_buffer_major_mode): Check that BUFFER is valid.
-
- * process.c (Fformat_network_address): Return nil when the
- argument vector contains invalid values.
-
-2007-03-28 YAMAMOTO Mitsuharu <[email protected]>
-
- * gmalloc.c [HAVE_GTK_AND_PTHREAD]: Define USE_PTHREAD.
- [USE_PTHREAD]: Include pthread.h.
- (malloc_init_once_control, _malloc_mutex) [USE_PTHREAD]: New variables.
- (malloc_initialize_1): New function created from __malloc_initialize.
- (__malloc_initialize): Use it.
- (LOCK, UNLOCK): New macros to make malloc etc. thread safe.
- (_malloc_internal, _free_internal, _realloc_internal): Use them.
-
- * lread.c (readchar): Extend BLOCK_INPUT block to ferror/clearerr.
-
-2007-03-27 Juanma Barranquero <[email protected]>
-
- * process.c (Fformat_network_address): Make args array big enough
- to format IPv6 addresses.
-
-2007-03-27 Glenn Morris <[email protected]>
-
- * m/hp800.h: Restore HP-UX support (removed 2007-01-29).
-
-2007-03-26 YAMAMOTO Mitsuharu <[email protected]>
-
- * macfns.c (Fx_display_mm_height, Fx_display_mm_width): Scale whole
- screen size in pixels by millimeters per pixel of main display.
-
- * macselect.c (get_scrap_target_type_list, x_own_selection):
- Move assignments outside predicate macros.
- (Vselection_converter_alist): Doc fix.
-
- * macterm.c (create_text_encoding_info_alist): Move assignments
- outside predicate macros.
- (mac_initialize_display_info) [MAC_OSX]: dpyinfo->height and
- dpyinfo->width are those of whole screen.
-
-2007-03-26 Sam Steingold <[email protected]>
-
- * process.c (sigchld_handler): Delay by 1ms instead of 1s to
- alleviate sluggishness (the original problem is still fixed).
-
-2007-03-25 Kim F. Storm <[email protected]>
-
- * intervals.c (merge_properties): Use explicit loop instead of
- Fplist_member to avoid QUIT. Don't use Fcdr.
- (intervals_equal): Likewise. Rewrite loop to perform length check
- on the fly rather than calling Flength. Don't use Fcar.
-
-2007-03-24 Eli Zaretskii <[email protected]>
-
- * editfns.c (Fgoto_char): Doc fix.
-
- * indent.c (Findent_to): Doc fix.
-
-2007-03-24 Chong Yidong <[email protected]>
-
- * editfns.c (Ftranspose_regions): Use set_text_properties_1
- instead of Fset_text_properties to avoid GC. Signal after change.
-
-2007-03-24 Eli Zaretskii <[email protected]>
-
- * xfns.c (Fx_show_tip): Doc fix.
-
- * macfns.c (Fx_show_tip): Doc fix.
-
- * w32fns.c (Fx_show_tip): Doc fix.
-
-2007-03-23 Kim F. Storm <[email protected]>
-
- * intervals.c (merge_properties, intervals_equal):
- Use Fplist_member instead of Fmemq to find properties.
-
-2007-03-23 Glenn Morris <[email protected]>
-
- * unexhp9k800.c: Restore file with clarified legal status.
- * m/sr2k.h: Restore since dependency unexhp9k800.c is restored.
-
-2007-03-22 Chong Yidong <[email protected]>
-
- * widget.c (EmacsFrameSetCharSize): Catch X errors.
-
-2007-03-22 Kenichi Handa <[email protected]>
-
- * fileio.c (Fcopy_file): Call barf_or_query_if_file_exists with
- non-encoded file name.
- (Frename_file): Likewise.
- (Fadd_name_to_file): Likewise.
- (Fmake_symbolic_link): Likewise.
-
-2007-03-20 YAMAMOTO Mitsuharu <[email protected]>
-
- * Makefile.in (alloca.o, gtkutil.o): Depend on systime.h.
- (dired.o, editfns.o, fileio.o, msdos.o): Depend on atimer.h.
- (dosfns.o, window.o, fns.o, macselect.o): Depend on atimer.h and
- systime.h.
- (term.o, print.o, lread.o): Depend on blockinput.h, atimer.h, and
- systime.h.
- (macfns.o): Remove duplicate dependency on systime.h.
-
- * dispnew.c (Fopen_termscript): Add BLOCK_INPUT around fclose.
- (Fsend_string_to_terminal): Add BLOCK_INPUT around fwrite.
-
- * fileio.c (do_auto_save_unwind): Add BLOCK_INPUT around fclose.
- (Fdo_auto_save): Add BLOCK_INPUT around fwrite.
-
- * keyboard.c (record_char): Add BLOCK_INPUT around fwrite.
- (Fopen_dribble_file): Add BLOCK_INPUT around fclose.
-
- * lread.c: Include blockinput.h.
- (readchar, Fget_file_char): Add BLOCK_INPUT around getc.
- (unreadchar): Add BLOCK_INPUT around ungetc.
- (load_unwind): Add BLOCK_INPUT around fclose.
-
- * print.c: Include blockinput.h.
- (Fredirect_debugging_output): Add BLOCK_INPUT around fclose.
-
- * process.c (Fmake_network_process) [HAVE_GETADDRINFO]:
- Clear immediate_quit before calling freeaddrinfo.
- Add BLOCK_INPUT around freeaddrinfo.
-
- * term.c: Include blockinput.h.
- (write_glyphs, insert_glyphs): Add BLOCK_INPUT around fwrite.
-
-2007-03-19 Richard Stallman <[email protected]>
-
- * keyboard.c (NUM_RECENT_KEYS): Bump up to 300.
-
- * buffer.c (syms_of_buffer): Doc fix.
-
-2007-03-18 Chong Yidong <[email protected]>
-
- * image.c (pbm_load): Signal error for invalid image size.
-
-2007-03-18 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.c (note_mouse_movement): Don't return immediately for
- LeaveNotify case.
-
- * macmenu.c (popup_activated_flag): New variable.
- (x_activate_menubar, mac_menu_show): Set it during menu tracking.
- (popup_activated): New function.
-
- * xdisp.c (redisplay_internal, note_mouse_highlight):
- Check popup_activated for MAC_OS.
-
-2007-03-17 Juanma Barranquero <[email protected]>
-
- * buffer.c (syms_of_buffer) <buffer-display-table>: Doc fix.
- Reported by Nikolaj Schumacher <[email protected]>.
-
-2007-03-17 Richard Stallman <[email protected]>
-
- * dired.c (file_name_completion): gcpro NAME.
-
-2007-03-17 Chong Yidong <[email protected]>
-
- * xdisp.c (try_window_id): Increment matrix positions if the
- buffer's byte count has increased, but not the character count.
-
-2007-03-12 Andreas Schwab <[email protected]>
-
- * lisp.h: Declare check_obarray.
-
- * process.c (Fdelete_process): Properly handle deletion of first
- element of deleted_pid_list.
- (create_process): Declare pid as pid_t.
-
-2007-03-12 Kim F. Storm <[email protected]>
-
- * process.c (sigchld_handler): Change type of pid to pid_t.
- Scan deleted_pid_list explicitly to avoid using Fmember which don't
- know about mark bits and make_fixnum_or_float which may malloc.
- Reported by Andreas Schwab.
-
- * keyboard.c (read_key_sequence): Store original event into keybuf
- when replaying sequence with local keymap(s) from string.
-
-2007-03-12 Glenn Morris <[email protected]>
-
- * editfns.c (Fdecode_time, Fencode_time): Doc fix ("daylight
- savings" to "daylight saving").
-
-2007-03-11 Sam Steingold <[email protected]>
-
- * process.c (sigchld_handler): Sleep before wait3 to avoid a busyloop.
-
-2007-03-11 YAMAMOTO Mitsuharu <[email protected]>
-
- * macfns.c (Fx_server_vendor): Change vendor string to "Apple Inc.".
-
-2007-03-10 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.c [USE_CARBON_EVENTS] (mac_handle_mouse_event):
- Ignore mouse wheel movement on title bar or tool bar.
-
-2007-03-10 Chong Yidong <[email protected]>
-
- * keyboard.c (help_form_saved_window_configs): New var.
- (read_char_help_form_unwind): New function.
- (read_char): Don't restore window configuration if a mouse click
- arrives while the help form is being displayed.
-
-2007-03-10 Kim F. Storm <[email protected]>
-
- * xdisp.c (redisplay_window): Don't automatically select a new window
- start for a contination line during mouse-click.
-
-2007-03-09 Jan Dj,Ad(Brv <[email protected]>
-
- * xterm.c (handle_one_xevent): Ignore buttons > 3 for the tool bar.
-
-2007-03-09 Juanma Barranquero <[email protected]>
-
- * keymap.c (Fdescribe_buffer_bindings): Check that BUFFER is valid.
-
-2007-03-08 Richard Stallman <[email protected]>
-
- * keyboard.c (syms_of_keyboard): Doc fix.
-
-2007-03-08 Chong Yidong <[email protected]>
-
- * minibuf.c (Ftry_completion): Don't short circuit if
- completion-ignore-case is non-nil.
-
-2007-03-07 YAMAMOTO Mitsuharu <[email protected]>
-
- * macfns.c (mac_set_scroll_bar_width, mac_frame_parm_handlers):
- Undo 2006-03-06 changes.
-
- * macterm.c (XTset_vertical_scroll_bar) [MAC_OSX]: Don't show scroll
- bar if its width is smaller than that of Aqua small scroll bar.
-
-2007-03-07 Stefan Monnier <[email protected]>
-
- * minibuf.c (read_minibuf): Bind inhibit-read-only a bit longer so as
- to handle correctly prompts with read-only property.
-
-2007-03-06 Jan Dj,Ad(Brv <[email protected]>
-
- * sound.c (wav_play): Check header->data_length to see how much we
- shall read.
- (alsa_period_size): Convert ALSA period size in frames to bytes.
- (alsa_write): Return if frames is zero.
-
-2007-03-06 Kenichi Handa <[email protected]>
-
- * xselect.c (Vselection_coding_system): Documentation improved.
-
-2007-03-05 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.c (x_scroll_bar_create, XTread_socket): Replace #if
- USE_TOOLKIT_SCROLL_BARS with #ifdef USE_TOOLKIT_SCROLL_BARS.
- (x_set_window_size): Call SET_FRAME_GARBAGED. Clear window if
- internal border width has changed.
-
- * macterm.h (struct mac_output): New member `internal_border_width'.
-
-2007-03-04 Richard Stallman <[email protected]>
-
- * window.c (Fdisplay_buffer): Doc fix.
-
-2007-03-03 Glenn Morris <[email protected]>
-
- * Makefile.in: Don't clear out LIB_X11_LIB, since XFT_LIBS does
- not include -lX11 on Solaris.
-
-2007-03-02 Stuart D. Herring <[email protected]>
-
- * keymap.c (Fkey_binding): Don't consider one-element lists as events.
-
-2007-03-01 Kenichi Handa <[email protected]>
-
- * process.c (send_process_object): Check the process status and
- signal an error if something is wrong.
-
-2007-02-28 Chong Yidong <[email protected]>
-
- * insdel.c (Fcombine_after_change_execute): Return nil if
- combine_after_change_buffer has been invalidated.
-
-2007-02-25 Dan Nicolaescu <[email protected]>
-
- * m/xtensa.h: New file.
-
-2007-02-24 Nick Roberts <[email protected]>
-
- * .gdbinit (xprintstr): Ensure GDB (> 6.6) prints symbol name
- as strings and not character arrays.
-
-2007-02-24 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.c [USE_TOOLKIT_SCROLL_BARS] (x_scroll_bar_handle_drag)
- (x_set_toolkit_scroll_bar_thumb): Add bar->min_handle as margin to
- scroll bar handle size in order to avoid `scroll backward' problem.
- (x_scroll_bar_create, XTset_vertical_scroll_bar)
- [USE_TOOLKIT_SCROLL_BARS]: Initialize bar->min_handle.
-
- * macterm.h (struct scroll_bar) [USE_TOOLKIT_SCROLL_BARS]:
- New member `min_handle'.
-
-2007-02-23 Kim F. Storm <[email protected]>
-
- * print.c (print): Reset print_number_index if Vprint_number_table
- is nil.
-
-2007-02-23 Eli Zaretskii <[email protected]>
-
- * w32.c (stat, get_long_basename, is_unc_volume): Use _mbspbrk
- instead of strpbrk.
-
-2007-02-23 YAMAMOTO Mitsuharu <[email protected]>
-
- * macmenu.c (mac_menu_show): Call unbind_to early. Use variable
- `menu_item_selection' as in W32 version.
- [TARGET_API_MAC_CARBON] (mac_handle_dialog_event): Add explicit
- braces to avoid ambiguous `else'.
-
- * macterm.c (mac_display_info_for_display): Remove function.
- (mac_flush_display_optional) [USE_CG_DRAWING]: New function.
- (x_redisplay_interface) [USE_CG_DRAWING]: Set it as handler for
- flush_display_optional.
- [USE_TOOLKIT_SCROLL_BARS] (x_scroll_bar_handle_press):
- New argument MOUSE_POS. All uses changed. Set bar->dragging to
- negative integer if scroll bar handle is pressed.
- [USE_TOOLKIT_SCROLL_BARS] (x_scroll_bar_handle_release):
- Negative bar->dragging means scroll bar handle is not dragged.
- [USE_TOOLKIT_SCROLL_BARS] (x_scroll_bar_handle_drag): Get initial
- offset of scroll bar handle from negative bar->dragging.
- (XTread_socket) [USE_TOOLKIT_SCROLL_BARS]: Modifiers for scroll
- bar click is compared against mapped one. Set down/up_modifier
- for scroll bar click event with control key.
-
- * macterm.h (x_display_info_for_display): Remove extern.
- (SCROLL_BAR_UNPACK, SET_SCROLL_BAR_CONTROL_HANDLE): Don't limit
- value to be unpacked to 32-bit on LP64 model.
-
-2007-02-23 Kenichi Handa <[email protected]>
-
- * process.c (send_process_object_unwind): New function.
- (send_process_object): New function.
- (Fprocess_send_region): Call send_process_object.
- (Fprocess_send_string): Likewise.
-
-2007-02-22 Jason Rumney <[email protected]>
-
- * w32menu.c (w32_menu_show): Mark the frame's menu as inactive
- when popup menu finishes.
-
- * w32fns.c (menubar_in_use): New flag.
- (w32_wnd_proc) <WM_INITMENU, WM_EXITMENULOOP, WM_TIMER, WM_COMMAND>:
- Use it.
-
- * w32menu.c (Fx_popup_menu): Don't free menu strings here.
- (w32_menu_show): Do it here instead.
-
- * w32fns.c (w32_wnd_proc) <WM_INITMENU>: Set menubar_active frame
- parameter.
-
- * w32menu.c (current_popup_menu): Make available globally.
- (menubar_selection_callback): Free menu strings before pushing the
- menu event into the keyboard buffer. Remove menu_command_in_progress.
-
- * w32fns.c (current_popup_menu): Use from w32menu.c.
- (w32_wnd_proc) <WM_EXITMENULOOP, WM_TIMER>: Use menubar_active
- and current_popup_menu to determine whether a menubar menu has
- been cancelled.
-
- * w32term.h (w32_output): Remove menu_command_in_progress.
-
-2007-02-22 Kim F. Storm <[email protected]>
-
- * dispnew.c (update_frame, update_single_window): Set force_p here if
- redisplay_dont_pause is set or Vredisplay_preemption_period is nil...
- (update_window, update_frame_1): ... instead of here.
- (update_text_area): Clear mouse face on header lines.
-
-2007-02-21 Kim F. Storm <[email protected]>
-
- * minibuf.c (Fassoc_string): Doc fix. Allow symbol for KEY too.
-
-2007-02-21 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.c (WINDOW_RESOURCE, TERM_WINDOW_RESOURCE): Remove macros.
- [USE_MAC_TSM] (mac_handle_text_input_event): Remove unused variable
- `mapped_modifiers'.
- (XTread_socket) [MAC_OS_X_VERSION_MAX_ALLOWED >= 1020]: Use Keyboard
- Layout Services routines to get current Unicode keyboard layout.
-
-2007-02-20 Chong Yidong <[email protected]>
-
- * frame.c (x_set_screen_gamma): Apply gamma value to the frame's
- bgcolor.
-
-2007-02-19 Kim F. Storm <[email protected]>
-
- * minibuf.c (Fassoc_string): Allow symbols as keys.
-
- * w32term.c (w32_set_scroll_bar_thumb): Don't resize scroll-bar
- handle while dragging, except when we get close to eob.
- Fix position and size calculations so we don't scroll backwards
- just by clicking on the handle.
-
-2007-02-17 YAMAMOTO Mitsuharu <[email protected]>
-
- * Makefile.in (${emacsapp}Contents/Resources/Emacs.rsrc)
- [HAVE_CARBON]: Remove target.
- (macosx-app) [HAVE_CARBON]: Don't depend on it.
-
-2007-02-17 Juanma Barranquero <[email protected]>
-
- * callproc.c (syms_of_callproc) <doc-directory>:
- <configure-info-directory>:
- (Fgetenv_internal): Fix typos in docstrings.
-
- * doc.c (Fsubstitute_command_keys): Fix typo in docstring.
-
-2007-02-16 Andreas Schwab <[email protected]>
-
- * frame.c (Fmodify_frame_parameters): Return a value.
-
- * editfns.c (Fformat): Add support for '+' flag.
- * doprnt.c (doprnt1): Likewise. Fix overflow checking.
-
-2007-02-14 Chong Yidong <[email protected]>
-
- * s/umips.h: Unused file removed.
-
-2007-02-14 Juanma Barranquero <[email protected]>
-
- * xfaces.c (Fcolor_distance): Don't continue checking a color for
- errors after it has been correctly parsed as an RGB list.
-
-2007-02-14 Jan Dj,Ad(Brv <[email protected]>
-
- * xterm.c (do_ewmh_fullscreen): Also check for _NET_WM_STATE_FULLSCREEN.
-
-2007-02-13 YAMAMOTO Mitsuharu <[email protected]>
-
- * macfns.c (Fx_focus_frame): Move current process to foreground if
- it is not.
- [TARGET_API_MAC_CARBON] (Fx_file_dialog): Replace #if MAC_OSX with
- #ifdef MAC_OSX.
- (Fmac_set_font_panel_visible_p) [USE_MAC_FONT_PANEL]: Rename from
- Fmac_set_font_panel_visibility. All uses changed. Rename argument
- VISIBLE to FLAG.
-
- * macterm.c (MakeMeTheFrontProcess) [MAC_OSX]: Remove function.
- (mac_initialize) [MAC_OSX]: Call SetFrontProcess instead of
- MakeMeTheFrontProcess.
-
-2007-02-12 Chong Yidong <[email protected]>
-
- * frame.c (x_set_screen_gamma): Clear face cache.
-
-2007-02-11 Juanma Barranquero <[email protected]>
-
- * buffer.c (Fgenerate_new_buffer_name, Fbuffer_modified_tick):
- Reflow docstrings.
-
-2007-02-10 Eli Zaretskii <[email protected]>
-
- * window.c (Fwindow_height, Fwindow_hscroll)
- (Fwindow_redisplay_end_trigger, Fwindow_point, Fwindow_start)
- (Fwindow_end, Fwindow_display_table, Fwindow_text_height):
- Document the effect of WINDOW arg being nil.
-
-2007-02-08 Kim F. Storm <[email protected]>
-
- * minibuf.c (read_minibuf): Fix 2007-01-30 change.
- Use Qlambda as interim value of Vminibuffer_completing_file_name.
- (Fcompleting_read): Use non-filename maps if value is Qlambda (or Qnil).
- (syms_of_minibuf) <minibuffer-completing-file-name>: Document lambda.
-
-2007-02-07 Juanma Barranquero <[email protected]>
-
- * makefile.w32-in ($(TRES)): Use literal "../nt/emacs.rc" instead
- of $(ALL_DEPS).
-
-2007-02-07 Eli Zaretskii <[email protected]>
-
- * makefile.w32-in ($(TRES)): Depend on stamp_BLD, since $(TRES) is
- put into $(BLD).
-
-2007-02-06 Chong Yidong <[email protected]>
-
- * frame.c (Fmodify_frame_parameters): Don't bind
- Qinhibit_default_face_x_resources, which has no effect.
- (Qinhibit_default_face_x_resources): Symbol deleted.
-
-2007-02-03 Eli Zaretskii <[email protected]>
-
- * indent.c (Fmove_to_column): Document that the argument COLUMN is
- taken from prefix numeric argument.
-
-2007-02-03 Juanma Barranquero <[email protected]>
-
- * lread.c (syms_of_lread) <load-history>: Doc fix.
-
-2007-01-29 Andreas Seltenreich <[email protected]> (tiny change)
-
- * xterm.c [!USE_TOOLKIT_SCROLL_BARS] (x_scroll_bar_expose):
- Use the foreground color of the scroll-bar face when drawing
- the scroll-bar's border.
-
-2007-02-02 Jan Dj,Ad(Brv <[email protected]>
-
- * xterm.c (do_ewmh_fullscreen): Check that what != NULL before
- calling wm_supports.
-
-2007-02-01 Juanma Barranquero <[email protected]>
-
- * lread.c (syms_of_lread) <user-init-file>: Doc fix.
- Wording by Eli Zaretskii.
-
-2007-01-31 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (update_frame_tool_bar): Initialize h/vmargin to 0.
-
-2007-01-30 Richard Stallman <[email protected]>
-
- * minibuf.c (read_minibuf):
- Save and clear Vminibuffer_completing_file_name.
- (read_minibuf_unwind): Restore it.
- (Vminibuffer_completion_table, Qminibuffer_completion_table)
- (Vminibuffer_completion_predicate, Qminibuffer_completion_predicate)
- (Vminibuffer_completion_confirm, Qminibuffer_completion_confirm)
- (Vminibuffer_completing_file_name): Definitions moved up.
-
-2007-01-29 Chong Yidong <[email protected]>
-
- * m/hp800.h: Restore, removing HP-UX support.
-
-2007-01-29 Jan Dj,Ad(Brv <[email protected]>
-
- * Makefile.in: Use a variable, XFT_LIBS, instead #define LIB_X11_LIB.
-
-2007-01-28 Richard Stallman <[email protected]>
-
- * minibuf.c (Ftry_completion, Fall_completions)
- (Fcompleting_read, Ftest_completion):
- Rename arg ALIST or TABLE to COLLECTION.
-
-2007-01-27 Chong Yidong <[email protected]>
-
- * unexhp9k800.c: Remove due to lack of legal papers.
-
- * m/sr2k.h, m/hp800.h: Remove due to dependence on above.
-
-2007-01-27 Eli Zaretskii <[email protected]>
-
- * keyboard.c (Fthis_command_keys, Fthis_command_keys_vector): Doc fix.
-
- * minibuf.c (Fcompleting_read): Doc fix.
-
-2007-01-26 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (xg_initialize): Call XftInit if HAVE_XFT.
-
- * Makefile.in: Use XFT_LIBS if defined.
-
-2007-01-26 YAMAMOTO Mitsuharu <[email protected]>
-
- * alloc.c (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Use
- BLOCK_INPUT/UNBLOCK_INPUT.
-
- * blockinput.h (interrupt_input_blocked): Declare volatile.
-
- * keyboard.c (interrupt_input_blocked): Declare volatile.
-
- * syssignal.h (SIGNAL_THREAD_CHECK): Use pthread_equal.
-
-2007-01-24 Kim F. Storm <[email protected]>
-
- * keymap.c (describe_map): Don't consider prefix keys to be shadowed.
-
-2007-01-23 Juanma Barranquero <[email protected]>
-
- * editfns.c (Finsert_char): Doc fix.
- (Fget_internal_run_time, Fdecode_time): Fix typos in docstrings.
-
-2007-01-22 YAMAMOTO Mitsuharu <[email protected]>
-
- * macselect.c [TARGET_API_MAC_CARBON] (mac_do_receive_drag):
- Don't pass keyboard modifiers to mac_store_drag_event, but put
- them as kEventParamKeyModifiers Apple event parameter.
-
-2007-01-21 Chong Yidong <[email protected]>
-
- * xdisp.c (try_window): Revert previous change.
-
- * dispnew.c (update_text_area): Revert 2006-09-17 change.
- Always redraw non-mode-line rows with mouse-face.
-
-2007-01-20 Chong Yidong <[email protected]>
-
- * xdisp.c (try_window): Clear mouse-face highlights first.
-
- * window.c (set_window_buffer): Revert 2006-11-22 change.
-
-2007-01-20 Eli Zaretskii <[email protected]>
-
- * .gdbinit (ppt, xtype, xmisctype, xint, xptr, xmarker, xframe)
- (xbuffer, xcons, xcar, xcdr): Fix doc strings.
-
-2007-01-20 Chong Yidong <[email protected]>
-
- * keyboard.c (read_key_sequence): Extract local map only if the
- given position is in an accessible buffer region.
-
-2007-01-19 Nick Roberts <[email protected]>
-
- * .gdbinit: Reformat documentation so that first sentence
- displays properly with "help user-defined" (like apropos).
-
-2007-01-18 Bruno Haible <[email protected]> (tiny change)
-
- * epaths.in: Move PATH_DOC from local/info to local/share/info.
-
-2007-01-15 YAMAMOTO Mitsuharu <[email protected]>
-
- * macmenu.c (create_and_show_dialog) [TARGET_API_MAC_CARBON]:
- Create movable modal window instead of movable alert window.
- (create_and_show_dialog) [!MAC_OSX]: Use DeactivateControl instead
- of DisableControl.
-
- * macselect.c (Fmac_resume_apple_event): Set error number when
- descriptor type of reply is non-null.
-
-2007-01-14 YAMAMOTO Mitsuharu <[email protected]>
-
- * macmenu.c (create_and_show_dialog) [TARGET_API_MAC_CARBON]:
- Use DisableControl for disabled items. Set default button to first
- enabled one. Use icon of application in execution.
-
-2007-01-13 Eli Zaretskii <[email protected]>
-
- * process.c (Fdelete_process, Fprocess_id, sigchld_handler):
- Copy PID into EMACS_INT to avoid GCC warnings.
-
- * fns.c (maybe_resize_hash_table): Copy new size of hash table
- into EMACS_INT to avoid GCC warnings.
-
- * editfns.c (Fuser_uid, Fuser_real_uid): Copy values returned by
- geteuid and getuid into EMACS_INT to avoid GCC warnings.
-
- * dired.c (Ffile_attributes): Fix last change.
-
-2007-01-12 Eli Zaretskii <[email protected]>
-
- * dired.c (Ffile_attributes): Copy some members of `struct stat'
- into int's to avoid GCC warnings about limited range of short in
- arguments to FIXNUM_OVERFLOW_P.
-
-2007-01-12 YAMAMOTO Mitsuharu <[email protected]>
-
- * macmenu.c (HAVE_DIALOGS): Define if TARGET_API_MAC_CARBON.
- (mac_handle_dialog_event, install_dialog_event_handler)
- (create_and_show_dialog) [TARGET_API_MAC_CARBON]: New functions.
- (DIALOG_LEFT_MARGIN, DIALOG_TOP_MARGIN, DIALOG_RIGHT_MARGIN)
- (DIALOG_BOTTOM_MARGIN, DIALOG_MIN_INNER_WIDTH)
- (DIALOG_MAX_INNER_WIDTH, DIALOG_BUTTON_BUTTON_HORIZONTAL_SPACE)
- (DIALOG_BUTTON_BUTTON_VERTICAL_SPACE, DIALOG_BUTTON_MIN_WIDTH)
- (DIALOG_TEXT_MIN_HEIGHT, DIALOG_TEXT_BUTTONS_VERTICAL_SPACE)
- (DIALOG_ICON_WIDTH, DIALOG_ICON_HEIGHT, DIALOG_ICON_LEFT_MARGIN)
- (DIALOG_ICON_TOP_MARGIN) [TARGET_API_MAC_CARBON]: New macros.
- (mac_dialog) [TARGET_API_MAC_CARBON]: Remove function.
- (mac_dialog_show) [TARGET_API_MAC_CARBON]: Use create_and_show_dialog.
-
- * macterm.c (x_free_frame_resources) [USE_CG_DRAWING]:
- Call mac_prepare_for_quickdraw.
- (quit_char, make_ctrl_char) [TARGET_API_MAC_CARBON]: Move externs
- outside #ifdef MAC_OSX.
- (mac_quit_char_key_p) [TARGET_API_MAC_CARBON]: Move function
- outside #ifdef MAC_OSX.
- (mac_check_bundle) [MAC_OSX]: Remove unused function.
-
- * macterm.h (mac_quit_char_key_p): Move extern outside #ifdef MAC_OSX.
- (HOURGLASS_WIDTH, HOURGLASS_HEIGHT): Parenthesize definitions.
-
-2007-01-11 Jan Dj,Ad(Brv <[email protected]>
-
- * alloc.c (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Use pthread_equal,
- block/unblock SIGIO.
-
-2007-01-10 Stefan Monnier <[email protected]>
-
- * editfns.c (Fformat): Allow integer-format to work with floats of size
- larger than most-positive-fixnum (but still smaller than MAXINT).
-
- * dired.c (Ffile_attributes): Use floats for large uids/gids.
-
-2007-01-09 Eli Zaretskii <[email protected]>
-
- * emacs.c (syms_of_emacs) <path-separator>: Doc fix.
-
-2007-01-09 YAMAMOTO Mitsuharu <[email protected]>
-
- * callproc.c (Fcall_process_region) [HAVE_MKSTEMP]: Add BLOCK_INPUT
- around mkstemp.
-
- * image.c (XDrawLine) [MAC_OS]: Remove macro.
- (XCreateGC_pixmap) [!HAVE_NTGUI]: Likewise.
- (x_disable_image) [!HAVE_NTGUI]: Use XCreateGC instead of
- XCreateGC_pixmap.
-
- * macgui.h (Display): Typedef to opaque type.
-
- * macmenu.c (mac_dialog_modal_filter) [MAC_OSX]: New function.
- (Fx_popup_dialog) [MAC_OSX]: Use standard alert if called from
- Fmessage_box, Fyes_or_no_p, or Fy_or_n_p.
- [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030] (menu_quit_handler):
- Use mac_quit_char_key_p.
-
- * macterm.c (XDrawLine): Rename from mac_draw_line_to_pixmap.
- (XCreateGC): Change type of 2nd argument to void *.
- (XFreeGC) [USE_CG_DRAWING && MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]:
- Fix last change.
- (mac_to_emacs_modifiers): Change return type to int.
- [USE_CARBON_EVENTS] (mac_event_to_emacs_modifiers): Likewise.
- (mac_mapped_modifiers): New function.
- (XTread_socket): Use it.
- [USE_TSM] (mac_handle_text_input_event): Likewise.
- (do_window_update) [USE_CG_DRAWING]: Call mac_prepare_for_quickdraw.
- (mac_quit_char_modifiers, mac_quit_char_keycode) [MAC_OSX]:
- Remove variables.
- (mac_determine_quit_char_modifiers, init_quit_char_handler)
- [MAC_OSX]: Remove functions.
- (make_ctrl_char) [MAC_OSX]: Add extern.
- (mac_quit_char_key_p) [MAC_OSX]: New function.
- (mac_initialize) [MAC_OSX]: Don't call init_quit_char_handler.
-
- * macterm.h (FONT_MAX_WIDTH): Remove unused macro.
- (XCreateGC): Change type in extern.
- (XDrawLine): Rename from mac_draw_line_to_pixmap.
- (mac_quit_char_key_p) [MAC_OSX]: Add extern.
-
-2007-01-08 Jan Dj,Ad(Brv <[email protected]>
-
- * keyboard.c (init_keyboard): Initialize interrupt_input_blocked and
- interrupt_input_pending.
-
- * xterm.h (x_display_info): New: net_supported_atoms,
- nr_net_supported_atoms and net_supported_window.
-
- * xterm.c (last_user_time): New variable.
- (handle_one_xevent): Set last_user_time from events that have Time.
- Set net_supported_window to 0 when reparented.
- (wm_supports): New function.
- (do_ewmh_fullscreen): Use wm_supports to check for _NET_WM_STATE.
- (x_term_init): Initialize net_supported_atoms, nr_net_supported_atoms
- and net_supported_window.
-
-2007-01-05 Kim F. Storm <[email protected]>
-
- * indent.c (Fvertical_motion): Fix it overshoot check for overlay
- strings without embedded newlines immediately followed by newline.
-
-2007-01-05 YAMAMOTO Mitsuharu <[email protected]>
-
- * editfns.c (Fformat_time_string, Fdecode_time, Fencode_time)
- (Fcurrent_time_string, Fcurrent_time_zone): Add BLOCK_INPUT around
- gmtime/localtime/emacs_memftimeu/mktime.
-
- * mac.c (Fmac_set_file_creator): Use MAC_EMACS_CREATOR_CODE
- instead of 'EMAx'.
- [!MAC_OSX] (sys_open, sys_creat, sys_fopen): Likewise.
-
- * macgui.h (struct _XGC) [USE_CG_DRAWING
- && MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]: New members cg_fore_color
- and cg_back_color.
-
- * macmenu.c (Vshow_help_function) [TARGET_API_MAC_CARBON]: Add extern.
- (restore_show_help_function, menu_target_item_handler)
- [TARGET_API_MAC_CARBON]: New functions.
- (install_menu_target_item_handler): New function.
- (add_menu_item) [TARGET_API_MAC_CARBON]: Set help string as menu
- item property.
-
- * macterm.c (CG_SET_FILL_COLOR_MAYBE_WITH_CGCOLOR)
- (CG_SET_FILL_COLOR_WITH_GC_FOREGROUND)
- (CG_SET_FILL_COLOR_WITH_GC_BACKGROUND)
- (CG_SET_STROKE_COLOR_MAYBE_WITH_CGCOLOR)
- (CG_SET_STROKE_COLOR_WITH_GC_FOREGROUND): New macros.
- (mac_cg_color_space_rgb) [USE_CG_DRAWING]: New variable.
- (mac_cg_color_black) [USE_CG_DRAWING
- && MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]: New variable.
- (init_cg_color) [USE_CG_DRAWING]: New function.
- (mac_draw_line, mac_draw_rectangle) [USE_CG_DRAWING]: Use
- CG_SET_STROKE_COLOR_WITH_GC_FOREGROUND instead of CG_SET_STROKE_COLOR.
- (mac_erase_rectangle, mac_clear_window, mac_draw_cg_image)
- (mac_fill_rectangle, mac_draw_image_string_cg) [USE_CG_DRAWING]:
- Use CG_SET_FILL_COLOR_WITH_GC_FOREGROUND or
- CG_SET_FILL_COLOR_WITH_GC_BACKGROUND instead of CG_SET_FILL_COLOR.
- (mac_draw_string_common) [MAC_OSX && USE_ATSUI]: Likewise.
- (XCreateGC, XFreeGC, XSetForeground, XSetBackground) [USE_CG_DRAWING
- && MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]: Use gc->cg_fore_color and/or
- gc->cg_back_color.
- (install_drag_handler, remove_drag_handler): Make extern.
- (install_menu_target_item_handler): Add extern.
- (install_window_handler): Call install_menu_target_item_handler.
- [MAC_OS8] (main): Use MAC_EMACS_CREATOR_CODE instead of 'EMAx'.
- (mac_initialize) [USE_CG_DRAWING]: Call init_cg_color.
-
- * macterm.h (MAC_EMACS_CREATOR_CODE): New enumerator.
-
-2007-01-04 Juanma Barranquero <[email protected]>
-
- * window.c (Fwindow_end): Fix use of >= operator.
-
-2007-01-03 Richard Stallman <[email protected]>
-
- * window.c (Fwindow_end): Check BUF_OVERLAY_MODIFF like BUF_MODIFF.
-
-2007-01-02 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.h (xg_menu_item_cb_data_): Remove highlight_id and
- unhighlight_id.
-
- * gtkutil.c (menuitem_highlight_callback): Invoked widget is the
- parent of the menu item. Get menu item widget from event.
- (xg_create_one_menuitem, xg_update_menu_item): highlight_id and
- unhighlight_id has been removed.
- (create_menus): Connect enter/leave-notify-event to the menu instead
- of individual items.
-
-2006-12-31 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (update_frame_tool_bar): Connect create-menu-proxy with
- xg_tool_bar_menu_proxy.
- (xg_tool_bar_menu_proxy): New function.
- (xg_tool_bar_proxy_callback): New function.
-
-2006-12-30 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (xg_tool_bar_button_cb): Save last modifier on widget.
- (xg_tool_bar_callback): Remove check for button.
- (update_frame_tool_bar): Put an event box in the tool bar and a button
- in the event box. Attach enter/leave-notify-event to the event box.
-
-2006-12-30 Richard Stallman <[email protected]>
-
- * keymap.c (Fdefine_key): Doc fix.
-
-2006-12-29 Kim F. Storm <[email protected]>
-
- * frame.h (struct frame): New member minimize_tool_bar_window_p.
-
- * xdisp.c (auto_resize_tool_bars_p): Replace with ...
- (Vauto_resize_tool_bars): ... this.
- (syms_of_xdisp): DEFVAR_LISP and initialize it. Update doc string
- to describe new value `grow-only', and use of C-l.
- (display_tool_bar_line): Only use default face for border below
- toolbar if not grow-only (to get acceptable visual appearence).
- Explicitly set visible_height for empty toolbar lines.
- (redisplay_tool_bar): Handle `grow-only' setting. Check and clear
- minimize_tool_bar_window_p flag.
-
- * window.c (Frecenter): Set minimize_tool_bar_window_p flag
- when called without arg to redraw with minimum toolbar height.
- Update doc string.
-
-2006-12-29 Jason Rumney <[email protected]>
-
- * s/ms-w32.h (tzname): Do not define in msvc8.
- (utime): Do not define in msvc8.
-
- * regex.c (regerror): Change parameter name err_code.
-
-2006-12-26 Richard Stallman <[email protected]>
-
- * search.c (Fsearch_forward): Doc fix.
-
- * callint.c (Finteractive): Doc fix.
-
-2006-12-25 Kim F. Storm <[email protected]>
-
- * s/ms-w32.h (BROKEN_DATAGRAM_SOCKETS): Define it.
-
-2006-12-23 Eli Zaretskii <[email protected]>
-
- * keyboard.c (some_mouse_moved): Fix last change.
-
-2006-12-22 Eli Zaretskii <[email protected]>
-
- * callproc.c (syms_of_callproc) <shell-file-name>: Doc fix.
-
-2006-12-22 Mark Davies <[email protected]>
-
- * m/amdx86-64.h, m/hp800.h: Add support for NetBSD.
- * m/sh3el.h: New file.
-
-2006-12-22 Eli Zaretskii <[email protected]>
-
- * makefile.w32-in (emacs, temacs): Depend on stamp_BLD instead of
- $(BLD).
- ($(OBJ0) $(OBJ1) $(WIN32OBJ)): New dependency on stamp_BLD.
- (bootstrap-temacs): Pass $(XMFLAGS) to sub-make.
- ($(OBJ0) $(OBJ1) $(WIN32OBJ)): Add lastfile.$(O) and firstfile.$(O).
- (clean): Delete stamp_BLD.
-
-2006-12-22 YAMAMOTO Mitsuharu <[email protected]>
-
- * macfns.c (mac_update_title_bar) [TARGET_API_MAC_CARBON]:
- Call mac_update_proxy_icon also when buffer modification flag changed.
- [TARGET_API_MAC_CARBON] (mac_update_proxy_icon): Don't update alias,
- but compare FSRef/FSSpec of resolved alias.
-
-2006-12-21 Kim F. Storm <[email protected]>
-
- * w32.c (_sys_wait_accept): Fix handle leak.
-
-2006-12-20 Jan Dj,Ad(Brv <[email protected]>
-
- * sound.c: Include <alsa/asoundlib.h> if ALSA_SUBDIR_INCLUDE is
- defined.
-
-2006-12-20 Kim F. Storm <[email protected]>
-
- * s/ms-w32.h (BROKEN_NON_BLOCKING_CONNECT): Define it.
-
-2006-12-19 Juanma Barranquero <[email protected]>
-
- * keyboard.c (syms_of_keyboard) <double-click-time>:
- * mac.c (Fmac_code_convert_string):
- * search.c (Fsearch_forward): Doc fixes.
-
-2006-12-19 Kim F. Storm <[email protected]>
-
- Rework 2006-12-04 change. A SIGUSR1 (SIGUSR2) signal now generates
- a sigusr1 event instead of [signal usr1] sequence, and signal events
- are now supposed to be handled via special-event-map.
-
- * keyboard.c (kbd_buffer_store_event_hold): Undo 2006-12-04 change.
- (make_lispy_event): Don't generate Qsignal prefix for code 0.
- Abort if signal code is unknown.
- (store_user_signal_events): Don't make Qsignal prefix (code 0).
- (Qsignal): Move declaration back to process.c.
- (syms_of_keyboard): Don't intern or staticpro it here.
-
- * process.c (Qsignal): Declare here.
- (syms_of_process): Intern or staticpro it.
-
- * emacs.c (main): Rename user signals to sigusr1 and sigusr2.
-
- * .gdbinit: Pass on SIGUSR1 and SIGUSR2 to Emacs.
-
-2006-12-19 Juanma Barranquero <[email protected]>
-
- * buffer.c (syms_of_buffer) <buffer-display-table>:
- <scroll-up-aggressively, scroll-down-aggressively>: Doc fixes.
-
-2006-12-17 Richard Stallman <[email protected]>
-
- * fileio.c (Fread_file_name_internal): Pass Vread_file_name_predicate
- to Ffile_name_completion.
-
- * dired.c (file_name_completion): New arg PREDICATE. Some cleanup.
- (Ffile_name_completion): New arg PREDICATE.
-
-2006-12-17 Juanma Barranquero <[email protected]>
-
- * buffer.c (Fkill_buffer): Doc fix.
- (syms_of_buffer) <kill-buffer-query-functions>: Doc fix.
-
-2006-12-16 Juanma Barranquero <[email protected]>
-
- * minibuf.c (Ftry_completion): Check that obarray buckets are symbols.
-
-2006-12-16 Eli Zaretskii <[email protected]>
-
- * w32fns.c (w32-window-exists-p): New function.
- (syms_of_w32fns): Defsubr it.
-
- * prefix-args.c [STDC_HEADERS]: Include stdlib.h.
-
-2006-12-16 Juanma Barranquero <[email protected]>
-
- * minibuf.c (Ftry_completion): Use `check_obarray' if ALIST is a vector.
-
-2006-12-15 Eli Zaretskii <[email protected]>
-
- * emacs.c (USAGE3): Clarify documentation of --color.
-
-2006-12-15 YAMAMOTO Mitsuharu <[email protected]>
-
- * mac.c (wakeup_from_rne_enabled_p) [TARGET_API_MAC_CARBON]:
- New variable.
- (ENABLE_WAKEUP_FROM_RNE, DISABLE_WAKEUP_FROM_RNE): New macros.
- [!MAC_OSX] (select): Use them.
- [MAC_OSX] (select_and_poll_event, sys_select): Likewise.
- (mac_wakeup_from_rne) [TARGET_API_MAC_CARBON]: New function.
-
- * macfns.c (mac_atsu_font_face_attributes) [USE_ATSUI]: Add extern.
- (Fmac_atsu_font_face_attributes) [USE_ATSUI]: New function.
- (syms_of_macfns) [USE_ATSUI]: Defsubr it.
-
- * macselect.c [TARGET_API_MAC_CARBON] (mac_do_receive_drag):
- Use mac_wakeup_from_rne instead of mac_post_mouse_moved_event.
-
- * macterm.c (mac_query_char_extents) [USE_ATSUI]: Don't call
- ATSUGetGlyphBounds if not necessary.
- (Vmac_atsu_font_table) [USE_ATSUI]: Remove variable.
- (syms_of_macterm) [USE_ATSUI]: Don't defvar it.
- (fm_get_style_from_font, atsu_find_font_from_family_name)
- (atsu_find_font_family_name, mac_atsu_font_face_attributes)
- [USE_ATSUI]: New functions.
- (init_font_name_table) [USE_ATSUI]: Use atsu_find_font_family_name.
- (mac_load_query_font) [USE_ATSUI]: Use atsu_find_font_from_family_name.
- Don't get metrics for Latin-1 right half characters.
- (mac_load_query_font): Don't load font if space width is not positive.
- [TARGET_API_MAC_CARBON] (mac_store_event_ref_as_apple_event):
- Use mac_wakeup_from_rne instead of mac_post_mouse_moved_event.
- (XTread_socket): Call SelectWindow when unfocused frame is clicked.
-
- * macterm.h (mac_wakeup_from_rne) [TARGET_API_MAC_CARBON]: Add extern.
-
-2006-12-15 Kim F. Storm <[email protected]>
-
- * keyboard.c (ignore_mouse_drag_p): New global var.
- (some_mouse_moved): Return 0 if it is non-zero.
- (make_lispy_event): Generate click event on mouse up if
- ignore_mouse_drag_p is non-zero, even if mouse moved.
- Clear ignore_mouse_drag_p on mouse down/up.
-
- * xdisp.c (redisplay_window): Set ignore_mouse_drag_p if tool-bar
- is resized to avoid generating a mouse drag event.
-
-2006-12-14 Juanma Barranquero <[email protected]>
-
- * w32fns.c (w32_wnd_proc): Force non-tooltip frames to respect the
- minimum tracking size. Remove non-working old hack to do the same.
-
-2006-12-14 YAMAMOTO Mitsuharu <[email protected]>
-
- * emacs.c (handle_user_signal): Move function to keyboard.c.
- (main): Use add_user_signal for SIGUSR1 and SIGUSR2.
-
- * keyboard.c (make_lispy_event): Use find_user_signal_name.
- (read_avail_input): Store pending user signal events.
- (struct user_signal_info): New struct.
- (user_signals): New variable.
- (add_user_signal, store_user_signal_events)
- (find_user_signal_name): New functions.
- (handle_user_signal): Move function from emacs.c. Don't store
- USER_SIGNAL_EVENT here, but increment number of pending signals.
-
- * keyboard.h (add_user_signals): Add extern.
-
-2006-12-11 Juanma Barranquero <[email protected]>
-
- * buffer.c (syms_of_buffer) <cursor-in-non-selected-windows>:
- <default-scroll-up-aggressively, default-scroll-down-aggressively>:
- <line-spacing, left-margin>: Doc fixes.
-
- * xdisp.c (syms_of_xdisp) <mode-line-inverse-video>: Doc fix.
-
-2006-12-10 Kim F. Storm <[email protected]>
-
- * xdisp.c (show_mouse_face): Never use text cursor in tool-bar.
-
-2006-12-10 Juanma Barranquero <[email protected]>
-
- * abbrev.c (syms_of_abbrev) <last-abbrev-text>:
- * buffer.c (syms_of_buffer) <default-major-mode>:
- * keymap.c (Flookup_key):
- * lread.c (Feval_buffer, Feval_region):
- * macterm.c (syms_of_macterm) <x-use-underline-position-properties>:
- <x-underline-at-descent-line, mac-emulate-three-button-mouse>:
- * marker.c (Fmarker_insertion_type):
- * minibuf.c (syms_of_minibuf) <minibuffer-completion-table>:
- * msdos.c (syms_of_msdos) <delete-exited-processes>:
- * w32term.c (syms_of_w32term) <x-use-underline-position-properties>:
- <x-underline-at-descent-line>:
- * xdisp.c (format-mode-line):
- * xterm.c (syms_of_xterm) <x-use-underline-position-properties>:
- <x-underline-at-descent-line>: Doc fixes.
-
-2006-12-10 Andreas Schwab <[email protected]>
-
- * systime.h (EMACS_GET_TIME): Remove check for
- HAVE_STRUCT_TIMEZONE which is never defined.
-
-2006-12-10 Alan Mackenzie <[email protected]>
-
- * syntax.c (Fpartial_parse_sexp): Correct Docco: Elt 8 of the
- result is now neither the last elt nor optional for OLDSTATE.
-
-2006-12-09 Eli Zaretskii <[email protected]>
-
- * process.c (Fsignal_process): Doc fix. Use XFLOAT_DATA to
- extract the process ID from a Lisp float.
-
-2006-12-09 Chong Yidong <[email protected]>
-
- * xterm.c (XTframe_raise_lower): Comment out _NET_ACTIVE_WINDOW code.
-
-2006-12-08 Eli Zaretskii <[email protected]>
-
- * frame.h (PIX_TYPE): Redefine as `unsigned long', for 64-bit
- platforms where long is 64-bit.
-
- * msdos.h (PIX_TYPE): Redefine as `unsigned long'.
-
-2006-12-08 NAKAJI Hiroyuki <[email protected]> (tiny change)
-
- * m/amdx86-64.h: Add support for Solaris 10 on x86-64.
-
-2006-12-08 Kenichi Handa <[email protected]>
-
- * xterm.c (x_query_font): Use xstricmp instead off strcasecmp.
-
-2006-12-08 Juanma Barranquero <[email protected]>
-
- * emacs.c (syms_of_emacs) <system-type>: Doc fix.
-
-2006-12-07 Kim F. Storm <[email protected]>
-
- * process.c (parse_signal): Use xstricmp instead of strcasecmp.
- (Fsignal_process): Don't use strncasecmp.
-
-2006-12-05 Glenn Morris <[email protected]>
-
- * abbrev.c (Qforce): New Lisp_Object.
- (Fdefine_abbrev): Do not overwrite non-system abbrevs with system
- abbrevs, unless 'force is applied.
- (syms_of_abbrev): Add Qforce.
-
-2006-12-04 Kim F. Storm <[email protected]>
-
- * process.c (parse_signal): Rename macro from handle_signal.
- (Fsignal_process): Also accept lower-case variants of signal
- names (to align with signal names generated by Emacs itself).
-
- * emacs.c (handle_USR1_signal, handle_USR2_signal): Replace by...
- (handle_user_signal): ... this, which generates two USER_SIGNAL_EVENTs
- first with code == 0 [signal] and one with code == sig number.
- (main): Use it as handler for SIGUR1 and SIGUSR2.
-
- * keyboard.c (kbd_buffer_store_event_hold): Don't throw-on-input
- if first event in [signal xxx] sequence.
- (lispy_user_signals, Qusr1_signal, Qusr2_signal): Remove.
- (syms_of_keyboard): Don't intern and staticpro them.
- (Qsignal): Declare here.
- (syms_of_keyboard): Intern and staticpro it.
- (make_lispy_event): Use it. Intern symbols on the fly for other
- USER_SIGNAL_EVENTs events.
-
- * process.c (Qsignal): Declare extern.
- (syms_of_process): Don't intern/staticpro it here.
-
- * process.c (read_process_output): Abort if carryover < 0.
-
-2006-12-04 YAMAMOTO Mitsuharu <[email protected]>
-
- * config.in: Regenerate.
-
- * fileio.c [__NetBSD__]: Don't define `unix'.
- (Funix_sync, syms_of_fileio): Use `#ifdef HAVE_SYNC' instead of
- `#ifdef unix'.
-
-2006-12-04 Glenn Morris <[email protected]>
-
- * Makefile.in (version): New variable, set by configure.
- (bootstrapclean, mostlyclean): Also remove emacs-${version}.
-
-2006-12-03 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (update_frame_tool_bar): Handle modifying a toolbar item
- without an image.
-
-2006-12-01 Eli Zaretskii <[email protected]>
-
- * w32fns.c (Fw32_shell_execute): Doc fix.
-
-2006-11-30 Chong Yidong <[email protected]>
-
- * xdisp.c (move_it_to): Correctly count tab glyphs for continued
- lines ending in tab.
-
-2006-11-30 Jan Dj,Ad(Brv <[email protected]>
-
- * xterm.c (x_raise_frame): Move setting of _NET_ACTIVE_WINDOW
- property ...
- (XTframe_raise_lower): ... to here.
-
-2006-11-30 Kenichi Handa <[email protected]>
-
- * regex.c (regex_compile): Fix previous change.
-
-2006-11-29 Juanma Barranquero <[email protected]>
-
- * sound.c (Fplay_sound_internal): Remove spurious newline in docstring.
-
-2006-11-28 Chong Yidong <[email protected]>
-
- * config.in: Regenerate.
-
-2006-11-28 Kenichi Handa <[email protected]>
-
- * regex.c (regex_compile): Don't call SET_LIST_BIT with a
- multibyte character.
-
-2006-11-27 Chong Yidong <[email protected]>
-
- * s/aix4-2.h: Undefine _NO_PROTO. Suggested by Joe Buehler.
-
-2006-11-27 Kim F. Storm <[email protected]>
-
- * window.c (set_window_buffer): Refactor recent changes.
-
-2006-11-27 Jason Rumney <[email protected]>
-
- * w32term.c (w32_msg_worker): Declare correctly.
- (w32_initialize): Don't cast w32_msg_worker.
-
- * w32fns.c (w32_msg_worker): Define as WINAPI and arg as void pointer.
-
-2006-11-26 Chong Yidong <[email protected]>
-
- * m/amdx86-64.h: Look for standard libs in /usr/lib64 only if that
- directory exists.
-
-2006-11-25 Eli Zaretskii <[email protected]>
-
- * w16select.c (Fw16_set_clipboard_data): Fix the call to sit_for
- as per the calling sequence change on 2006-07-11.
-
-2006-11-25 Chong Yidong <[email protected]>
-
- * window.c (set_window_buffer): Use BLOCK_INPUT.
-
-2006-11-24 Juanma Barranquero <[email protected]>
-
- * fns.c (substring_both): Add missing address operator.
-
-2006-11-24 Stefan Monnier <[email protected]>
-
- * fns.c: Use AREF/ASIZE macros.
- (concat): Provide the full ANSI prototype.
-
-2006-11-24 Juanma Barranquero <[email protected]>
-
- * buffer.c (syms_of_buffer) <buffer-undo-list>: Doc fix.
-
-2006-11-23 William Smith <[email protected]> (tiny change)
-
- * strftime.c (HAVE_SYS__MBSTATE_T_H): Fix typo.
-
-2006-11-22 Alfred M. Szmidt <[email protected]> (tiny change)
-
- * s/openbsd.h (LD_SWITCH_SYSTEM): Remove /usr/pkg/lib and
- /usr/pkg/lib from the library search path.
- (LD_SWITCH_X_DEFAULT): New macro.
-
-2006-11-22 Chong Yidong <[email protected]>
-
- * window.c (set_window_buffer): Clear mouse highlight if it is in
- this window.
-
-2006-11-21 Chong Yidong <[email protected]>
-
- * xfaces.c (realize_default_face): Check if the default font name
- exists on this display before trying to use it.
-
-2006-11-21 Richard Stallman <[email protected]>
-
- * fileio.c: Break line before &&, not after.
-
-2006-11-20 Eli Zaretskii <[email protected]>
-
- * fns.c (concat) [!__GNUC__]: Add prototype.
-
-2006-11-20 Kenichi Handa <[email protected]>
-
- * fileio.c (Fread_file_name_internal): Use SBYTES (not SCHARS) to
- check the tailing slash of a filename.
-
-2006-11-20 KOBAYASHI Yasuhiro <[email protected]> (tiny change)
-
- * indent.c (Fvertical_motion): Include composition in the case of
- overshoot expected.
-
-2006-11-19 Andreas Schwab <[email protected]>
-
- * xfaces.c (Fdisplay_supports_face_attributes_p): Initialize supports.
-
- * xmenu.c (Fx_popup_menu): Initialize selection.
-
-2006-11-18 Andreas Schwab <[email protected]>
-
- * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Update call to mark_memory.
-
-2006-11-17 Tetsurou Okazaki <[email protected]> (tiny change)
-
- * xterm.c (do_ewmh_fullscreen): Declare variable before XSETFRAME
- to avoid gcc 2.96 error.
-
-2006-11-17 NIIMI Satoshi <[email protected]> (tiny change)
-
- * search.c (simple_search): In the loop of backward searching,
- check also the byte position against the limit.
-
-2006-11-14 Romain Francoise <[email protected]>
-
- * minibuf.c (Fcompleting_read): Fix typo in docstring.
-
-2006-11-14 Kenichi Handa <[email protected]>
-
- * coding.c (code_convert_region): Initialize coding->heading_ascii.
- (decode_coding_string, code_convert_region): Likewise.
-
-2006-11-14 YAMAMOTO Mitsuharu <[email protected]>
-
- * config.in: Regenerate.
-
- * macfns.c (Fx_display_mm_height, Fx_display_mm_width)
- [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- && MAC_OS_X_VERSION_MIN_REQUIRED == 1020]: Check if
- CGDisplayScreenSize is available.
-
- * macmenu.c (menu_quit_handler, install_menu_quit_handler):
- Replace `#ifdef HAVE_CANCELMENUTRACKING' with
- `#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030'.
- (install_menu_quit_handler) [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- && MAC_OS_X_VERSION_MIN_REQUIRED == 1020]: Check if
- CancelMenuTracking is available.
-
- * macterm.c [USE_CG_TEXT_DRAWING] (mac_draw_image_string_cg)
- [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- && MAC_OS_X_VERSION_MIN_REQUIRED == 1020]: Check if
- CGContextShowGlyphsWithAdvances is available.
-
-2006-11-13 Jason Rumney <[email protected]>
-
- * s/ms-w32.h: Define HAVE_INET_SOCKETS.
-
-2006-11-13 Nozomu Ando <[email protected]>
-
- * alloc.c (mark_memory): New argument OFFSET. All uses changed.
- Fix address calculations for case END < START.
- (mark_stack): Impose Lisp_Object alignment on jmp_buf.
-
-2006-11-12 Juanma Barranquero <[email protected]>
-
- * coding.c (Fencode_sjis_char, Fencode_big5_char):
- Improve argument/docstring consistency.
-
- * editfns.c (Fmessage): Doc fixes.
-
- * process.c (syms_of_process) <delete-exited-processes>: Doc fix.
-
-2006-11-12 Chong Yidong <[email protected]>
-
- * xmenu.c (popup_activated): Define outside HAVE_MENUS.
-
-2006-11-12 Romain Francoise <[email protected]>
-
- * xselect.c (selection-coding-system): Fix docstring.
-
-2006-11-12 Juanma Barranquero <[email protected]>
-
- * category.c (Fchar_category_set): Improve arg/docstring consistency.
-
- * data.c (Flogxor):
- * fns.c (Frandom, Flength, Fsafe_length, Fstring_bytes)
- (Fstring_equal, Fcompare_strings, Fstring_lessp, Fcopy_sequence)
- (Fstring_make_unibyte): Fix typos in docstrings.
-
-2006-11-10 Jan Dj,Ad(Brv <[email protected]>
-
- * xterm.h (struct x_display_info): Fix indentation.
-
- * xterm.c (do_ewmh_fullscreen, XTfullscreen_hook): New functions.
- (x_check_fullscreen): Call do_ewmh_fullscreen.
- (x_initialize): Set fullscreen_hook to XTfullscreen_hook.
-
- * frame.c (x_set_fullscreen): Call fullscreen_hook if set.
-
- * term.c: Define fullscreen_hook.
- (syms_of_term): Initialize fullscreen_hook to NULL.
-
- * termhooks.h: Add fullscreen_hook.
-
-2006-11-08 Juanma Barranquero <[email protected]>
-
- * bytecode.c (Fbyte_code):
- * data.c (Fmakunbound): Use SYMBOL_CONSTANT_P macro.
-
-2006-11-06 Juanma Barranquero <[email protected]>
-
- * lread.c (syms_of_lread):
- * xsmfns.c (syms_of_xsmfns): Fix typo in docstring.
-
-2006-11-06 Martin Rudalics <[email protected]>
-
- * macmenu.c (Fmenu_or_popup_active_p): Define outside HAVE_MENUS.
-
- * w32menu.c (Fmenu_or_popup_active_p): Define outside HAVE_MENUS.
- Return nil if building without menus.
-
- * xmenu.c (Fmenu_or_popup_active_p): Define outside HAVE_MENUS.
- Return nil if building without menus.
-
-2006-11-05 Mark Davies <[email protected]> (tiny change)
-
- * s/netbsd.h (POSIX_SIGNALS): Define.
-
-2006-11-05 Martin Rudalics <[email protected]>
-
- * macmenu.c (Fmenu_or_popup_active_p): New function.
- (syms_of_macmenu): Defsubr it.
-
- * w32menu.c (Fmenu_or_popup_active_p): New function.
- (syms_of_w32menu): Defsubr it.
- (popup_activated_flag, popup_activated): Remove.
-
- * xdisp.c (note_mouse_highlight) [HAVE_NTGUI]: Don't bother to
- check popup_activated.
-
- * xmenu.c (Fmenu_or_popup_active_p): New function.
- (syms_of_xmenu): Defsubr it.
-
-2006-11-05 YAMAMOTO Mitsuharu <[email protected]>
-
- * unexmacosx.c (malloc_cookie): Remove unused variable.
- (region_list_head, region_list_tail, lca, nlc, infile_lc_highest_addr)
- (text_seg_lowest_offset, mh, curr_header_offset, infd, outfd)
- (emacs_zone, data_segment_old_fileoff, data_segment_scp)
- (num_unexec_regions, unexec_regions): Make variables static.
- (print_regions, find_emacs_zone_regions): Make static.
- (unexec_region_info): New typedef.
- (unexec_regions): Change type from vm_range_t[] to unexec_region_info[].
- All uses changed.
- (unexec_regions_recorder): Subtract size of trailing null pages from
- filesize. Show filesize.
- (unexec_regions_merge): Don't merge if null pages of preceding region
- is not too small. Use long format in printf.
- (copy_segment, copy_data_segment): Show filesize.
- (copy_data_segment): Write filesize bytes of region data.
- Adjust filesize in segment command accordingly.
- (dump_it): Use long format in printf.
-
-2006-11-05 Juanma Barranquero <[email protected]>
-
- * dosfns.c (Finsert_startup_screen):
- * fns.c (Ffeaturep, syms_of_fns):
- * frame.c (syms_of_frame): Fix typos in docstrings.
-
- * unexcw.c (unexec): Fix typo in output message.
-
-2006-11-04 Ralf Angeli <[email protected]>
-
- * w32fns.c (w32_createwindow): Remove code for handling -geometry
- command line option and `initial-frame-alist' which is superfluous
- after the last change to `w32_createwindow'.
-
-2006-11-04 Slawomir Nowaczyk <[email protected]> (tiny change)
-
- * w32proc.c (sys_wait): Only wait for processes with fd<0.
- Others should be handled by sys_select instead. Fixes problems
- with (progn (start-process "" nil "ls") (call-process "ls")).
-
-2006-11-04 Giorgos Keramidas <[email protected]> (tiny change)
-
- * xmenu.c (Fmenu_bar_open): Declare variable before BLOCK_INPUT to
- avoid gcc 2.95 error.
-
-2006-11-04 Chong Yidong <[email protected]>
-
- * gtkutil.c (update_frame_tool_bar): If icon image is invalid and
- wicon is null, insert an empty button.
-
-2006-11-03 Jan Dj,Ad(Brv <[email protected]>
-
- * xterm.c (x_raise_frame): Send _NET_ACTIVE_WINDOW when raising the
- window.
-
-2006-11-02 Juanma Barranquero <[email protected]>
-
- * emacs.c (Fkill_emacs): Fix typo in docstring.
-
-2006-11-02 Nozomu Ando <[email protected]>
-
- * unexmacosx.c (mach_header, segment_command, vm_region, section)
- [_LP64]: New defines.
- (VM_REGION_BASIC_INFO_COUNT, VM_REGION_BASIC_INFO, LC_SEGMENT)
- (MH_MAGIC) [_LP64]: Redefine.
- (delta): Remove variable.
- (curr_file_offset, pagesize): New variables.
- (ROUNDUP_TO_PAGE_BOUNDARY): New macro.
- (data_segment_old_fileoff): Initialize explicitly.
- (print_region, unexec_regions_recorder, print_load_command_name)
- (copy_segment, copy_data_segment): Use long format in printf.
- (MAX_UNEXEC_REGIONS): Increase to 400.
- (unexec_regions_recorder): Don't warn too many regions here.
- (find_emacs_zone_regions): Warn too many regions here.
- (print_load_command_name) [_LP64]: Show correct load command name.
- (copy_segment, copy_data_segment): Use variable `curr_file_offset'.
- Show starting virtual memory address. Don't show ending file offset.
- (copy_symtab, copy_dysymtab, copy_twolevelhints): New argument DELTA.
- (dump_it): Use new local variable `linkedit_delta' and pass to them.
- Error if trying to handle multiple DATA segments.
- (unexec): Initialize variable `pagesize'.
-
-2006-11-01 Juanma Barranquero <[email protected]>
-
- * eval.c (Fcatch): Doc fix.
-
-2006-10-31 YAMAMOTO Mitsuharu <[email protected]>
-
- * image.c [MAC_OS] (image_load_qt_1, xpm_scan, xpm_make_color_table_v)
- (xpm_put_color_table_v, xpm_get_color_table_v, xpm_make_color_table_h)
- (xpm_put_color_table_h, xpm_get_color_table_h, xpm_str_to_color_key)
- (xpm_load_image): Add const qualifier to arguments.
- [MAC_OS] (xpm_color_key_strings): Make static const.
-
- * mac.c (create_apple_event_from_event_ref)
- (create_apple_event_from_drag_ref, skip_white_space, parse_comment)
- (parse_include_file, parse_binding, parse_component)
- (parse_resource_name, parse_value, parse_resource_line)
- (xrm_merge_string_database, xrm_get_resource)
- (xrm_get_preference_database): Add const qualifier to arguments.
- [MAC_OSX] (sys_select): Make variable `context' static const.
-
- * macfns.c (mac_color_map): Make static const.
- (mac_color_map_lookup): Add const qualifier to arguments.
-
- * macmenu.c (install_menu_quit_handler): Make variable `typesList'
- static const.
- (name_is_separator): Add const qualifier to arguments.
-
- * macselect.c (init_service_handler): Make variable `specs' static
- const.
-
- * macterm.c (mac_create_bitmap_from_bitmap_data): Make variable
- `swap_nibbles' static const.
- (atsu_get_text_layout_with_text_ptr): Make variables `lengths',
- `tags', `sizes', `values' static const.
- (mac_draw_string_common): Make variables `context' static.
- Make variables `tags', `sizes', and `values' static const.
- (pcm_get_status, x_detect_focus_change, x_scroll_bar_handle_click)
- (xlfdpat_create, xlfdpat_block_match_1, xlfdpat_match)
- (mac_to_x_fontname, parse_x_font_name, add_mac_font_name)
- (mac_do_list_fonts, is_fully_specified_xlfd, do_grow_window)
- (mac_store_event_ref_as_apple_event, mac_make_rdb): Add const
- qualifier to arguments.
- (xlfd_scalable_fields, keycode_to_xkeysym_table)
- (fn_keycode_to_keycode_table): Make static const.
- (mac_load_query_font): Make variables `tags', `sizes', `values',
- `types', and `selectors' static const.
- (mac_handle_command_event, mac_handle_window_event):
- Make variables `names' and `types' static const.
- (init_command_handler, install_window_handler): Make variables
- `specs*' static const.
- (mac_handle_font_event, mac_handle_text_input_event)
- (mac_store_service_event): Make variables `names' and `types'
- const. Make variables `names_*' and `types_*' static const.
-
- * macterm.h (create_apple_event_from_event_ref)
- (create_apple_event_from_drag_ref, xrm_merge_string_database)
- (xrm_get_resource, xrm_get_preference_database): Add const
- qualifier to arguments in externs.
-
-2006-10-31 Kenichi Handa <[email protected]>
-
- * xfns.c (xic_create_xfontset): Fix previous change.
-
-2006-10-30 Chong Yidong <[email protected]>
-
- * s/openbsd.h (LD_SWITCH_SYSTEM): Add /usr/pkg/lib and
- /usr/pkg/lib to library search path.
-
-2006-10-29 Mark Davies <[email protected]> (tiny change)
-
- * ralloc.c (relinquish): Use a long for excess space counter to
- handle 64-bit case correctly.
-
-2006-10-29 Jeramey Crawford <[email protected]>
-
- * m/amdx86-64.h: Add defines for OpenBSD x86-64.
-
-2006-10-29 Juanma Barranquero <[email protected]>
-
- * window.c (Fdisplay_buffer): Fix typo in docstring.
-
-2006-10-27 Ben North <[email protected]> (tiny change)
-
- * w32term.c (x_draw_glyph_string_foreground): Set background mode
- to TRANSPARENT before using overstrike to simulate bold faces.
-
- * xfaces.c (best_matching_font): Fix logic to decide whether to
- use overstriking to simulate bold-face (it was reversed).
-
-2006-10-23 Kim F. Storm <[email protected]>
-
- * xdisp.c (remember_mouse_glyph): Do nothing if glyphs are not
- initialized.
-
- * keyboard.c (read_char): Make an element (t . EVENT) in
- unread-command-events add EVENT to the current command's key sequence.
- (syms_of_keyboard) <unread-command-events>: Update doc.
-
-2006-10-21 Richard Stallman <[email protected]>
-
- * minibuf.c (Vread_expression_map): Define here.
- (Qread_expression_history): New variable.
- (syms_of_minibuf): Initialize them.
- (Feval_minibuffer): Use Vread_expression_map and
- Qread_expression_history.
-
-2006-10-21 Kenichi Handa <[email protected]>
-
- * xfns.c (xic_create_fontsetname): If ADSTYLE field is not a wild
- card, change it to "*".
- (xic_create_xfontset): Call XCreateFontSet for each single
- fontname in fontsetname.
-
-2006-10-19 Chong Yidong <[email protected]>
-
- * callint.c (callint_message): Convert to a Lisp string.
- (syms_of_callint): Initialize it.
- (callint_message_size): Var deleted.
- (Fcall_interactively): Use Fformat instead of doprnt to construct
- prompt string.
-
-2006-10-19 YAMAMOTO Mitsuharu <[email protected]>
-
- * xdisp.c (display_mode_line): Clear enabled_p flag on mode-line row.
-
-2006-10-19 YAMAMOTO Mitsuharu <[email protected]>
-
- * macfns.c (Vmac_carbon_version_string) [TARGET_API_MAC_CARBON]:
- New variable.
- (syms_of_macfns) [TARGET_API_MAC_CARBON]: Defvar it.
-
-2006-10-19 Jan Dj,Ad(Brv <[email protected]>
-
- * xselect.c (x_handle_selection_request): If the converted_selection
- is nil or XCDR (converted_selection) is nil, decline the request.
-
-2006-10-16 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (get_utf8_string): Remove warnings with casts.
- (xg_tool_bar_button_cb): Ditto.
- (xg_tool_bar_callback): Ditto.
-
-2006-10-16 YAMAMOTO Mitsuharu <[email protected]>
-
- * dispnew.c (adjust_frame_glyphs_for_frame_redisplay): Remove unused
- variable ch_dim.
- (adjust_frame_glyphs_for_window_redisplay): Likewise. Don't allocate
- menu bar window matrices on non-X systems.
-
- * mac.c (Fmac_get_preference, Fmac_code_convert_string): Add GCPROs.
-
- * macterm.c (mac_query_char_extents): Don't return glyph ID if layout
- adjustment is needed.
- (mac_load_query_font): Check if width and height are positive.
-
-2006-10-14 Richard Stallman <[email protected]>
-
- * sysdep.c (init_sys_modes): Delete DEFVAR_LISP in the wrong place.
-
-2006-10-13 Chong Yidong <[email protected]>
-
- * xdisp.c (decode_mode_spec): Ignore %c and %l constructs in frame
- title.
-
-2006-10-12 Chong Yidong <[email protected]>
-
- * keymap.c (Fkey_binding): Check Lisp_Object types before doing
- XCAR and XINT.
-
-2006-10-12 Romain Francoise <[email protected]>
-
- * image.c (xbm_read_bitmap_data): Delete extra semicolon.
-
-2006-10-10 Stefan Monnier <[email protected]>
-
- * eval.c: Include xterm.h for x_fully_uncatch_errors and friends.
-
- * dispextern.h: Declare x_create_bitmap_from_xpm_data.
-
- * xterm.c (x_check_expected_move): Remove unused var `count'.
-
- * xmenu.c (syms_of_xmenu): Use Ffset rather than Fdefalias, since
- Fdefalias is not declared in any *.h file.
-
-2006-10-09 Chong Yidong <[email protected]>
-
- * dispnew.c (sit_for): Sit forever if TIMEOUT is t.
-
- * keyboard.c (command_loop_1): Handle non-number values of
- `minibuffer-message-timeout'.
- (Fexecute_extended_command): Fix typo.
-
- * minibuf.c (temp_echo_area_glyphs): Sit for
- `minibuffer-message-timeout' seconds.
-
-2006-10-08 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.c (mac_draw_image_string, mac_draw_image_string_16):
- Add argument OVERSTRIKE_P.
- (mac_draw_string_common, mac_draw_image_string_cg): Likewise.
- Support overstrike.
- (mac_draw_string, mac_draw_string_16): Remove functions.
- (x_draw_glyph_string_foreground): Use overstrike when needed.
- (x_draw_composite_glyph_string_foreground): Likewise.
- Use mac_draw_image_string_16 instead of mac_draw_string_16.
- (mac_load_query_font): Rename from XLoadQueryFont. Take argument
- F instead of DPY. All uses changed. Don't save/restore font.
-
-2006-10-07 Ralf Angeli <[email protected]>
-
- * w32fns.c (w32_createwindow): Honour left and top positions if
- supplied explicitly.
-
-2006-10-06 Kim F. Storm <[email protected]>
-
- * xdisp.c (pos_visible_p): Fix value when EOB is visible.
-
-2006-10-05 Chong Yidong <[email protected]>
-
- * frame.c (Qinhibit_face_set_after_frame_default): New var.
- (syms_of_frame): Initialize it.
- (x_set_frame_parameters): Avoid resetting :font attributes to the
- new-frame defaults.
-
-2006-10-03 Stefan Monnier <[email protected]>
-
- * lisp.h (clear_regexp_cache): Declare.
-
- * search.c (compile_pattern): Only check `cp->syntax_table' if needed.
- (compile_pattern_1): Remember `used_syntax' in `cp->syntax_table'.
- (clear_regexp_cache): Only flush those regexps which depend on
- a syntax-table.
-
- * regex.c (regex_compile): Set the new `used_syntax' bit.
-
- * regex.h: Remove file local variables.
- (struct re_pattern_buffer): New field `used_syntax'.
-
-2006-10-03 Kim F. Storm <[email protected]>
-
- * process.c (list_processes_1): Run sentinels before removing dead
- processes. Also remove `closed' network connections.
-
-2006-10-01 Stefan Monnier <[email protected]>
-
- * xdisp.c (handle_fontified_prop): Don't fontify at EOB.
-
-2006-09-30 Eli Zaretskii <[email protected]>
-
- * config.in: Regenerated.
-
-2006-09-29 Juri Linkov <[email protected]>
-
- * buffer.c (syms_of_buffer): Reorder coding systems in the
- docstring of %z to the real order displayed in the modeline.
-
-2006-09-28 Stefan Monnier <[email protected]>
-
- * keymap.c (Fdefine_key): Yet another int/Lisp_Object mixup (YAILOM).
-
-2006-09-26 Chong Yidong <[email protected]>
-
- * indent.c (Fvertical_motion): Do move back if the Lisp string
- being displayed contains newlines.
-
-2006-09-26 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.c (mac_compute_glyph_string_overhangs, XLoadQueryFont)
- [USE_CG_DRAWING]: Call mac_prepare_for_quickdraw before QDTextBounds.
-
-2006-09-26 Kenichi Handa <[email protected]>
-
- * keymap.c (Fsingle_key_description): For an invalid char, return
- "Invalid char code NNNNN".
-
-2006-09-25 Chong Yidong <[email protected]>
-
- * callint.c (Fcall_interactively): Doc fix.
-
-2006-09-25 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.c (x_underline_at_descent_line): New variable.
- (syms_of_macterm): DEFVAR_BOOL it.
- (x_draw_glyph_string): Use it.
- (XLoadQueryFont): Calculate min_bounds.descent and max_bounds.descent.
-
-2006-09-25 Kenichi Handa <[email protected]>
-
- * keymap.c (Fsingle_key_description): Return unique names for
- generic characters.
-
-2006-09-24 Richard Stallman <[email protected]>
-
- * search.c (compile_pattern_1): Don't BLOCK_INPUT.
-
-2006-09-24 Eli Zaretskii <[email protected]>
-
- * makefile.w32-in ($(BLD)/fns.$(O), $(BLD)/w32proc.$(O)):
- Depend on nt/inc/langinfo.h and nt/inc/nl_types.h.
-
- * w32proc.c (nl_langinfo): New function.
-
- * w32fns.c (w32-pass-alt-to-system, w32-alt-is-meta)
- (w32-pass-lwindow-to-system, w32-enable-num-lock)
- (w32-enable-caps-lock, w32-scroll-lock-modifier)
- (w32-lwindow-modifier, w32-rwindow-modifier)
- (w32-apps-modifier, w32-mouse-button-tolerance): Doc fix.
-
-2006-09-23 Juanma Barranquero <[email protected]>
-
- * minibuf.c (Finternal_complete_buffer, Fread_minibuffer)
- (Fdisplay_completion_list): Fix typos in docstrings.
-
-2006-09-23 Romain Francoise <[email protected]>
-
- * s/gnu-linux.h (MAIL_USE_FLOCK): Check for HAVE_LIBLOCKFILE too.
-
-2006-09-23 Kenichi Handa <[email protected]>
-
- * keymap.c (Fmap_keymap): Docstring mentions about generic character.
-
-2006-09-22 Stefan Monnier <[email protected]>
-
- * regex.c (analyse_first): For eight-bit-control chars, mark both the
- char's value and its leading byte in the fastmap.
- (re_search_2): When fast-scanning without translation, be careful to
- check that we only match the leading byte of a multibyte char.
-
- * charset.h (PREV_CHAR_BOUNDARY): Make it work from within a char's
- byte sequence.
- (AT_CHAR_BOUNDARY): New macro.
-
-2006-09-22 Kenichi Handa <[email protected]>
-
- * fns.c (optimize_sub_char_table): Don't optimize a sub-char-table
- whose default value is non-nil.
-
-2006-09-22 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (xg_get_file_with_chooser): Only show C-l help for
- Gtk+ versions < 2.10.
-
- * xfns.c (syms_of_xfns): Fix typo in help text for
- x-gtk-file-dialog-help-text.
-
-2006-09-21 Kim F. Storm <[email protected]>
-
- * fns.c (Fmemq): Refill doc string.
- (Fmemql): New defun, like memq but using eql.
- (syms_of_fns): Defsubr it.
-
-2006-09-20 Kim F. Storm <[email protected]>
-
- * xdisp.c (pos_visible_p): CHARPOS < 0 means return info for
- last visible glyph in window.
-
- * window.c (Fset_window_hscroll, Fwindow_line_height):
- Doc fix. Use "off-window" instead of "off-screen".
- (Fpos_visible_in_window_p): Likewise.
- If POS is t, return info for last visible glyph in window.
-
-2006-09-19 Chong Yidong <[email protected]>
-
- * search.c (struct regexp_cache): New entry syntax_table.
- (compile_pattern_1): Set it.
- (syms_of_search): Initialize it.
- (compile_pattern): Require the syntax_table entry of the cache
- element to match the current syntax table entry.
-
-2006-09-19 Stefan Monnier <[email protected]>
-
- * window.c (Fwindow_end): Fix recent change.
-
-2006-09-19 Kim F. Storm <[email protected]>
-
- * window.c (Fset_window_hscroll, Fpos_visible_in_window_p):
- Doc fix. Use "off-screen" instead of "invisible".
- (Fwindow_line_height): Make line numbers 0-based. Make line arg
- optional; if nil, use current cursor row. Handle text terminals
- properly. Return nil if non-interactive or pseudo-window.
-
-2006-09-19 Stefan Monnier <[email protected]>
-
- * keymap.c: Include alloca.h if available.
- (Fkey_binding): Only use AREF after checking it's a vector.
- Remove unused var `window'.
-
-2006-09-19 YAMAMOTO Mitsuharu <[email protected]>
-
- * emacs.c (shut_down_emacs) [!subprocesses]: Don't set
- inhibit_sentinels.
-
- * mac.c [!MAC_OSX] (select): Fix argument name.
-
- * macmenu.c (enum mac_menu_kind, min_menu_id): New enumerator and
- menu ID for Apple menu.
- (menubar_selection_callback): Remove function.
- (find_and_call_menu_selection): New function from xmenu.c.
- (x_activate_menubar): Use it.
- (set_frame_menubar): Don't use f->output_data.mac->menubar_active.
-
- * macterm.c (menubar_selection_callback): Remove extern.
- (M_APPLE): Change to 234.
- (do_apple_menu) [!TARGET_API_MAC_CARBON]: Make non-static.
- (do_menu_choice): Remove function.
-
- * macterm.h (struct mac_output): Remove member menubar_active.
- (do_menu_choice): Remove extern.
- (do_apple_menu) [!TARGET_API_MAC_CARBON]: Add extern.
-
-2006-09-18 Jan Dj,Ad(Brv <[email protected]>
-
- * xfns.c (syms_of_xfns): Rename x_gtk_show_chooser_help_text to
- x_gtk_file_dialog_help_text.
-
- * gtkutil.c (xg_uses_old_file_dialog): Rename x-use-old-gtk-file-dialog
- to x-gtk-use-old-file-dialog.
- (xg_get_file_with_chooser): Rename x_gtk_show_chooser_help_text to
- x_gtk_file_dialog_help_text.
-
- * xfns.c (syms_of_xfns): Ditto.
-
-2006-09-18 Kim F. Storm <[email protected]>
-
- * window.c (Fwindow_line_visibility): Remove.
- (Fwindow_line_height): New defun replacing it.
- (syms_of_window): Defsubr it.
-
-2006-09-18 YAMAMOTO Mitsuharu <[email protected]>
-
- * mac.c (SELECT_USE_CFSOCKET) [MAC_OSX]: Set default to 1.
- [MAC_OSX] (sys_select) [SELECT_USE_CFSOCKET]: Fix pointer type.
-
-2006-09-17 Jay Belanger <[email protected]>
-
- * gmalloc.c:
- * md5.c:
- * md5.h:
- * strftime.c: Replace "GNU Library General Public License" by "GNU
- General Public License" throughout.
-
-2006-09-17 Kim F. Storm <[email protected]>
-
- * dispnew.c (update_text_area): Undo 2000-07-18 change.
- Always redrawing whole row if line has mouse-face in it causes
- excessive flickering of the mode line.
-
-2006-09-17 Chong Yidong <[email protected]>
-
- * search.c (clear_regexp_cache): New function.
-
- * syntax.c (Fmodify_syntax_entry): Clear regexp cache.
-
-2006-09-16 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (xg_get_file_with_chooser):
- Check x-gtk-show-chooser-help-text before adding the help text.
-
- * xfns.c (syms_of_xfns): New variable: x-gtk-show-chooser-help-text.
-
- * gtkutil.c (get_utf8_string): Try harder to convert to UTF8. Gtk+
- will simply crash if we fail.
-
-2006-09-16 Richard Stallman <[email protected]>
-
- * regex.c (re_compile_pattern): Set gl_state.current_syntax_table.
-
-2006-09-15 Kim F. Storm <[email protected]>
-
- * window.c (Fwindow_line_visibility): New defun for line-move-partial.
- (syms_of_window): Defsubr it.
- (Fwindow_end): Use window's buffer rather than current buffer.
-
-2006-09-15 Jay Belanger <[email protected]>
-
- * COPYING: Replace "Library Public License" by "Lesser Public
- License" throughout.
-
-2006-09-15 David Kastrup <[email protected]>
-
- * Makefile.in (keymap.o): Add "keymap.h" and "window.h" dependencies.
-
- * keymap.c: include "window.h".
- (Fcommand_remapping): New optional POSITION argument.
- (Fkey_binding): New optional POSITION argument. Completely rework
- handling of mouse clicks to get the same order of keymaps as
- `read-key-sequence' and heed POSITION. Also temporarily switch
- buffers to location of mouse click and back.
-
- * keyboard.c (command_loop_1): Adjust call of `Fcommand_remapping'
- for additional argument.
- (parse_menu_item): Adjust call of `Fkey_binding' for additional
- argument.
- (read_key_sequence): If there are both `local-map' and `keymap'
- text properties at some buffer position, heed both.
-
- * keymap.h: Declare additional optional arguments of
- `Fcommand_remapping' and `Fkey_binding'.
-
-2006-09-15 Juanma Barranquero <[email protected]>
-
- * indent.c (Fcurrent_column, Findent_to): Fix typos in docstring.
-
-2006-09-14 Andreas Schwab <[email protected]>
-
- * print.c: Whitespace fixup.
-
-2006-09-14 Kim F. Storm <[email protected]>
-
- * xdisp.c (produce_image_glyph): Automatically crop wide images at
- right window edge so we can draw the cursor on the same row to
- avoid confusing redisplay by placing the cursor outside the visible
- window area.
-
-2006-09-13 YAMAMOTO Mitsuharu <[email protected]>
-
- * xterm.c (x_initialize): Don't install Xt event timer here.
- (x_timeout_atimer_activated_flag): New var.
- (x_activate_timeout_atimer): New function to install Xt timer.
- (x_send_scroll_bar_event, x_process_timeouts): Use it.
-
- * xmenu.c (x_menu_set_in_use, popup_activate_callback)
- (create_and_show_popup_menu, create_and_show_dialog): Use it.
-
- * xterm.h (x_activate_timeout_atimer): Add prototype.
-
-2006-09-13 Richard Stallman <[email protected]>
-
- * print.c (print_string): When printcharfun is t,
- copy string contents and call strout on the copy.
-
- * keyboard.c (read_char): If end_time specified, don't put the
- event into this_command_keys.
- (read_key_sequence): If Voverriding_terminal_local_map is specified,
- don't check Voverriding_local_map at all.
-
-2006-09-12 Stefan Monnier <[email protected]>
-
- * textprop.c (Fnext_property_change, Fnext_single_property_change)
- (Fprevious_property_change, Fprevious_single_property_change):
- Avoid changing limit, so we can correctly catch the case where the
- property is constant up to limit.
-
-2006-09-12 YAMAMOTO Mitsuharu <[email protected]>
-
- * macfns.c (mac_window) [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]:
- * macterm.c (XTread_socket) [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]:
- Undo 2006-09-08 change.
-
-2006-09-11 Chong Yidong <[email protected]>
-
- * keymap.c (Fkey_binding): Use string position for string objects.
-
-2006-09-11 Kim F. Storm <[email protected]>
-
- * keymap.c (Fkey_binding): Fix last change.
-
- * editfns.c (Fmessage): Recommend using (message "%s" ...).
-
-2006-09-10 Chong Yidong <[email protected]>
-
- * keymap.c (Fkey_binding): Check for local keymap for mouse click
- events.
-
-2006-09-10 Kim F. Storm <[email protected]>
-
- * keyboard.c (Finput_pending_p): Check Vunread_input_method_events
- and Vunread_post_input_method_events.
-
- * dispnew.c (Fredisplay): Document return value.
-
-2006-09-10 Jan Dj,Ad(Brv <[email protected]>
-
- * xfns.c (Fx_close_connection): Call xg_display_close when USE_GTK.
-
- * gtkutil.c (xg_display_close): Always change default display if needed,
- check for < Gtk+ version 2.10 before calling gdk_display_close.
-
-2006-09-10 YAMAMOTO Mitsuharu <[email protected]>
-
- * mac.c [MAC_OSX] (sys_select): Check argument `nfds' more rigidly.
- Make variable `ofds' static. Remove variable `maxfd'.
-
- * macfns.c (Fx_file_dialog): Remove unused variable `f'.
- Call check_mac.
-
- * macmenu.c (Vmenu_updating_frame, syms_of_macmenu):
- * w32menu.c (Vmenu_updating_frame, syms_of_w32menu):
- Apply 2006-09-08 change for xmenu.c.
-
- * xfns.c (Fx_file_dialog): Call check_x.
-
-2006-09-10 Kim F. Storm <[email protected]>
-
- * xdisp.c (get_window_cursor_type): Use hollow cursor on
- non-transparent images.
-
-2006-09-09 Eli Zaretskii <[email protected]>
-
- * editfns.c (Fsystem_name): Mention "host" in the doc string.
- (syms_of_editfns) <system-name>: Likewise.
-
-2006-09-08 Martin Rudalics <[email protected]>
-
- * xdisp.c (mouse_autoselect_window): Remove.
- (Vmouse_autoselect_window): New variable. DEFVAR_LISP it.
-
- * dispextern.h (mouse_autoselect_window): Remove extern.
- (Vmouse_autoselect_window): Add extern.
-
- * macterm.c (XTread_socket): Test Vmouse_autoselect_window
- instead of mouse_autoselect_window.
-
- * msdos.c (dos_rawgetc): Likewise.
-
- * w32term.c (w32_read_socket): Likewise.
-
- * xterm.c (handle_one_xevent): Likewise.
-
-2006-09-08 Richard Stallman <[email protected]>
-
- * xdisp.c (Vmenu_updating_frame): Define here.
- (syms_of_xdisp): DEFVAR it here.
- (update_menu_bar): Always return hooks_run.
- Set Vmenu_updating_frame.
-
- * xdisp.c (redisplay_internal): Test Vinhibit_redisplay
- before calculating SELECTED_FRAME.
-
- * xmenu.c (Vmenu_updating_frame): Don't define here.
- (syms_of_xmenu): Don't DEFVAR it here.
-
- * xterm.c (x_error_quitter): For BadName error, just return.
-
- * eval.c (find_handler_clause): Give up on debugger if INPUT_BLOCKED_P.
-
- * casetab.c (init_casetab_once): Call set_case_table.
-
- * emacs.c (shut_down_emacs): Set inhibit_sentinels.
-
- * process.c (inhibit_sentinels): New variable.
- (exec_sentinel): Test inhibit_sentinels.
- (init_process): Initialize it.
-
- * process.h (inhibit_sentinels): Add decl.
-
- * search.c (looking_at_1, string_match_1, search_command):
- Make syntax table's canon table point to eqv table.
-
-2006-09-08 Andreas Schwab <[email protected]>
-
- * print.c (strout): Fix whitespace.
-
-2006-09-08 Kim F. Storm <[email protected]>
-
- * xterm.c (x_draw_glyph_string): Fix 2006-08-24 change.
-
-2006-09-08 YAMAMOTO Mitsuharu <[email protected]>
-
- * mac.c [!MAC_OSX]: Don't include keyboard.h.
- [!MAC_OSX] (select): Try detect_input_pending before ReceiveNextEvent
- in the same BLOCK_INPUT block, in case that some input has already
- been read asynchronously. Pretend to be interrupted by a signal
- if some input is available.
- [MAC_OSX] (select_and_poll_event, sys_select): Likewise.
- (SELECT_POLLING_PERIOD_USEC) [SELECT_USE_CFSOCKET]: Change to 100000.
- Now used for ReceiveNextEvent timeout instead of select timeout.
- (EVENT_CLASS_SOCK) [SELECT_USE_CFSOCKET]: Remove macro.
- [SELECT_USE_CFSOCKET] (socket_callback): Add non-blocking connect
- support. Quit event loop.
- [MAC_OSX] (sys_select) [SELECT_USE_CFSOCKET]: Add non-blocking
- connect support. Reuse previously allocated CFRunLoopSource.
- (Fmac_process_hi_command) [TARGET_API_MAC_CARBON]: New function.
- (syms_of_mac) [TARGET_API_MAC_CARBON]: Defsubr it.
-
- * macfns.c (mac_window) [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]:
- Specify kWindowAsyncDragAttribute.
-
- * macterm.c (mac_handle_origin_change, mac_handle_size_change)
- (mac_get_ideal_size): New functions.
- (x_set_offset, x_set_window_size, x_make_frame_visible)
- (do_zoom_window, mac_handle_window_event, XTread_socket): Use them.
- (install_window_handler, mac_handle_window_event)
- [USE_CARBON_EVENTS]: Handle kEventWindowGetIdealSize and
- kEventWindowBoundsChanged.
- (XTread_socket) [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]: Don't call
- DragWindow.
-
-2006-09-07 Andreas Schwab <[email protected]>
-
- * m/ibms390x.h (START_FILES, LIB_STANDARD): Override to
- use lib64 instead of lib.
-
-2006-09-06 Stefan Monnier <[email protected]>
-
- * Makefile.in: Avoid double quotes when possible.
-
-2006-09-06 Kenichi Handa <[email protected]>
-
- * editfns.c (Fformat_time_string): Use make_unibyte_string to make
- a Lisp string from the result of emacs_memftimeu call.
-
-2006-09-06 Kim F. Storm <[email protected]>
-
- * xdisp.c (pos_visible_p): Remove exact_mode_line_heights_p arg;
- so calculate heights even when pos-visible-in-window-p is called
- with partially = t. Don't overshoot last_visible_y in move_it_to.
- Return row height and row number in new rowh and vpos args.
- (cursor_row_fully_visible_p): First line is always "fully visible".
- (try_window): Don't clear matrix if vscrolled.
-
- * lisp.h (pos_visible_p): Update prototype.
-
- * window.c (Fpos_visible_in_window_p): Adapt to new pos_visible_p.
- Return row height and row number for partially visible rows.
- Modify return value to a 2 element list for fully visible rows and
- 6 for partially visible row.
- (window_scroll_pixel_based): Use pos_visible_p directly instead of
- Fpos_visible_in_window_p. Fix auto vscrolling for partially
- visible lines. Only vscroll backwards if already vscrolled
- forwards. Unconditionally vscroll forwards if PT is first (and
- only) line. Set new window start instead of scrolling at
- start/end of tall line.
-
-2006-09-05 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.c (install_window_handler, mac_handle_window_event)
- [USE_CARBON_EVENTS]: Handle kEventWindowClose.
- [USE_MAC_TSM] (mac_handle_text_input_event): Set modifiers for
- ASCII keystroke event.
-
-2006-09-04 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (xg_get_file_with_chooser): Don't mention specific keys in
- the file chooser message. Only call gtk_file_chooser_set_current_name
- when action is SAVE.
-
-2006-09-04 Andreas Schwab <[email protected]>
-
- * Makefile.in: Double all single and back quotes in C-style
- comments to help fontifier.
-
-2006-09-03 Jason Rumney <[email protected]>
-
- * w32.c (shutdown_handler): New function to exit cleanly on shutdown.
- (globals_of_w32): Register it as a signal handler.
-
-2006-09-02 Juri Linkov <[email protected]>
-
- * marker.c (Fmarker_position): Doc fix.
-
-2006-09-03 Eli Zaretskii <[email protected]>
-
- * window.c (syms_of_window) <split-height-threshold>:
- <window-min-height, window-min-width>: Doc fix.
-
-2006-09-02 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (xg_get_file_with_chooser): Change file chooser message
- for writing files. Call gtk_file_chooser_set_current_name to keep
- default filename.
-
- * minibuf.c (Finternal_complete_buffer): Move after DEFUN:s it calls.
-
-2006-09-02 Jindrich Makovicka <[email protected]> (tiny change)
-
- * fns.c (concat) [__GNUC__]: Declare with
- `__attribute__((noinline))'.
-
- * eval.c (apply1, call2) [__GNUC__]: Declare with
- `__attribute__((noinline))'.
-
-2006-09-02 Stuart D. Herring <[email protected]>
-
- * minibuf.c (Finternal_complete_buffer): New function.
- (syms_of_minibuf): Defsubr it.
- (Fread_buffer): Use it, instead of Vbuffer_alist.
-
-2006-09-01 Martin Rudalics <[email protected]>
-
- * buffer.h (struct buffer_text): New field chars_modiff.
- (CHARS_MODIFF, BUF_CHARS_MODIFF): New macros.
- * buffer.c (Fbuffer_chars_modified_tick): New function returning
- value of BUF_CHARS_MODIFF.
- (syms_of_buffer): Defsubr it.
- (Fget_buffer_create): Initialize BUF_CHARS_MODIFF.
- * insdel.c (modify_region): New argument preserve_chars_modiff.
- Set CHARS_MODIFF to MODIFF provided preserve_chars_modiff is zero.
- (insert_1_both, insert_from_string_1, insert_from_buffer_1)
- (adjust_after_replace, adjust_after_replace_noundo)
- (replace_range, replace_range_2, del_range_2): Reset CHARS_MODIFF.
- * lisp.h (modify_region): Add fourth argument in extern.
- * casefiddle.c (casify_region): Call modify_region with fourth
- argument zero to assert that CHARS_MODIFF is updated.
- * editfns.c (Fsubst_char_in_region, Ftranslate_region_internal)
- (Ftranspose_regions): Likewise.
- * textprop.c (Fadd_text_properties, Fset_text_properties)
- (Fremove_text_properties, Fremove_list_of_text_properties):
- Call modify_region with fourth argument 1 to avoid that
- CHARS_MODIFF is updated.
-
-2006-08-31 Richard Stallman <[email protected]>
-
- * editfns.c (Fformat): Don't sign-extend for %o or %x.
-
-2006-08-29 Chong Yidong <[email protected]>
-
- * indent.c (Fvertical_motion): Don't move back if we were
- displaying a Lisp string, either.
-
-2006-08-28 Kim F. Storm <[email protected]>
-
- * xdisp.c (get_window_cursor_type) [!HAVE_WINDOW_SYSTEM]:
- Don't attempt to replace cursor on image glyphs.
-
-2006-08-28 Kenichi Handa <[email protected]>
-
- * coding.c (Fdetect_coding_region, Fdetect_coding_string):
- Fix docstring about ISO-2022 control characters.
-
-2006-08-28 Kim F. Storm <[email protected]>
-
- * xdisp.c (get_window_cursor_type): Replace BOX cursor on images
- with a hollow box cursor if image is larger than 32x32 (or the default
- frame font if that is bigger). Replace any other cursor on images
- with hollow box cursor, as redisplay doesn't support bar and hbar
- cursors on images.
-
-2006-08-27 YAMAMOTO Mitsuharu <[email protected]>
-
- * alloc.c (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Undo previous
- change. Move mutex lock/unlock operations inside BLOCK_INPUT.
-
- * dired.c (directory_files_internal_unwind, directory_files_internal)
- (file_name_completion): Add BLOCK_INPUT around opendir/closedir.
-
- * image.c [MAC_OS] (image_load_qt_1): Use ComponentResult instead
- of OSErr.
-
- * keyboard.c (in_sighandler): Remove variable.
- (Fcurrent_idle_time): Add missing `doc:'.
- (input_available_signal, init_keyboard): Undo previous change.
-
- * keyboard.h (in_sighandler): Remove extern.
-
- * mac.c (create_apple_event_from_event_ref, select)
- (Fmac_get_file_creator, Fmac_get_file_type, Fmac_set_file_creator)
- (Fmac_set_file_type, cfstring_create_normalized)
- (mac_get_system_locale, select_and_poll_event, sys_select):
- Use OSStatus instead of OSErr.
-
- * macfns.c [TARGET_API_MAC_CARBON] (mac_update_proxy_icon):
- Don't use FRAME_FILE_NAME. Use (FS)UpdateAlias.
- (Fx_create_frame): Apply 2006-07-03 for xfns.c.
-
- * macselect.c (get_scrap_from_symbol, clear_scrap, put_scrap_string)
- (put_scrap_private_timestamp, scrap_has_target_type, get_scrap_string)
- (get_scrap_private_timestamp, get_scrap_target_type_list)
- (x_own_selection, x_get_foreign_selection)
- (Fx_disown_selection_internal, Fx_selection_owner_p)
- (Fx_selection_exists_p): Use OSStatus instead of OSErr.
-
- * macterm.c (mac_draw_string_common, mac_query_char_extents)
- (x_iconify_frame, XLoadQueryFont, install_window_handler)
- (mac_handle_command_event, init_command_handler, init_menu_bar):
- Use OSStatus instead of OSErr.
- (x_free_frame_resources) [TARGET_API_MAC_CARBON]: Don't use
- FRAME_FILE_NAME.
- (x_query_font): Apply 2006-08-04 change for xterm.c.
- (Qhi_command): Rename from Qhicommand. All uses changed.
-
- * macterm.h (struct mac_output) [TARGET_API_MAC_CARBON]: Remove member
- file_name.
- (FRAME_FILE_NAME): Remove macro.
- (install_window_handler, create_apple_event_from_event_ref):
- Return OSStatus instead of OSErr.
-
-2006-08-26 Kim F. Storm <[email protected]>
-
- * buffer.c (Fset_buffer_multibyte):
- * editfns.c (Fcurrent_time, Fget_internal_run_time):
- * macfns.c (Fxw_color_values):
- * w32fns.c (Fxw_color_values):
- * xfns.c (Fxw_color_values): Simplify; use list3.
-
- * fileio.c (Fmake_directory_internal, Fdelete_directory)
- (Fdelete_file): Simplify; use list1.
- (Frename_file, Fadd_name_to_file, Fmake_symbolic_link):
- Simplify; remove NO_ARG_ARRAY stuff, use list2.
-
-2006-08-25 Richard Stallman <[email protected]>
-
- * buffer.c (Fswitch_to_buffer): Fix previous change.
-
-2006-08-25 Kim F. Storm <[email protected]>
-
- * keyboard.c (Fcurrent_idle_time): Simplify.
-
-2006-08-25 Richard Stallman <[email protected]>
-
- * fns.c (sxhash_string): Rotate properly; don't lose bits.
-
-2006-08-24 Francesc Rocher <[email protected]>
-
- * xdisp.c (overline_margin): New variable.
- (x_produce_glyphs): Use it.
- (syms_of_xdisp): DEFVAR_INT it.
-
- * xterm.c (x_underline_at_descent_line): New variable.
- (syms_of_xterm): DEFVAR_BOOL it.
- (x_draw_glyph_string): Use it.
- Draw underline and overline up to the end of line if the face
- extends to the end of line.
-
- * macterm.c: Likewise.
-
- * w32term.c: Likewise.
-
-2006-08-24 Nick Roberts <[email protected]>
-
- * buffer.c (Fswitch_to_buffer): Move buffer to front of
- buffer-alist if necessary.
-
-2006-08-22 Kim F. Storm <[email protected]>
-
- * xdisp.c (update_tool_bar): Redisplay toolbar also when only
- number of items changes.
-
-2006-08-22 Stefan Monnier <[email protected]>
-
- * buffer.c (Fset_buffer_multibyte): Record proper undo entry.
-
-2006-08-21 Jan Dj,Ad(Brv <[email protected]>
-
- * keyboard.c: Clarify difference between in_sighandler and
- handling_signal.
-
-2006-08-21 Kim F. Storm <[email protected]>
-
- * macterm.c (x_draw_stretch_glyph_string):
- * w32term.c (x_draw_stretch_glyph_string):
- * xterm.c (x_draw_stretch_glyph_string): It is ok to draw a
- stretch glyph in left marginal areas on header and mode lines.
-
-2006-08-21 Kenichi Handa <[email protected]>
-
- * keyboard.c (syms_of_keyboard): Docstring of
- Vunread_post_input_method_events and Vunread_input_method_events
- fixed.
-
-2006-08-20 Chong Yidong <[email protected]>
-
- * keyboard.c (show_help_echo): Preserve mouse movement flag if
- tracking mouse.
-
-2006-08-20 Richard Stallman <[email protected]>
-
- * xfaces.c (load_pixmap): Add quotes in error message.
-
- * keyboard.c (Fcurrent_idle_time): New function.
- (syms_of_keyboard): defsubr it.
-
-2006-08-18 Nick Roberts <[email protected]>
-
- * window.c (Fset_window_fringes): Do nothing on a tty.
- (Fwindow_fringes): Put ? operator after the line break.
-
-2006-08-16 Andreas Schwab <[email protected]>
-
- * print.c (debug_output_compilation_hack): Fix return type.
-
-2006-08-16 Richard Stallman <[email protected]>
-
- * print.c (debug_output_compilation_hack): New function.
-
-2006-08-16 Kenichi Handa <[email protected]>
-
- * fileio.c (choose_write_coding_system): Use LF for end-of-line
- in auto-saving.
-
-2006-08-15 Chong Yidong <[email protected]>
-
- * keyboard.c (read_char): Don't change idle timer state at all if
- end_time is supplied.
-
-2006-08-15 Kenichi Handa <[email protected]>
-
- * coding.c (ONE_MORE_BYTE_CHECK_MULTIBYTE): New arg RET. If SRC
- is exhausted, return with RET.
- (detect_coding_emacs_mule, detect_coding_iso2022)
- (detect_coding_sjis, detect_coding_big5, detect_coding_utf_8)
- (detect_coding_utf_16, detect_coding_ccl): Adjusted for the above
- change.
-
-2006-08-14 Chong Yidong <[email protected]>
-
- * keyboard.c (read_char): Don't reset idle timers if a time limit
- is supplied.
-
-2006-08-14 Kim F. Storm <[email protected]>
-
- * .gdbinit (pitx): Print iterator position.
- Limit stack dump in case iterator is not initialized.
-
-2006-08-12 Eli Zaretskii <[email protected]>
-
- * frame.c (Fmouse_position, Fmouse_pixel_position)
- (Fset_mouse_position, Fset_mouse_pixel_position): Doc fix.
-
-2006-08-11 Jan Dj,Ad(Brv <[email protected]>
-
- * xselect.c (Fx_register_dnd_atom): New function.
- (syms_of_xselect): Defsubr it.
- (x_handle_dnd_message): Check that message_type is in
- dpyinfo->x_dnd_atoms before generating lisp event.
-
- * xterm.h (struct x_display_info): Add x_dnd_atoms* to keep track
- of drag and drop Atoms.
-
- * xterm.c (x_term_init): Initialize dpyinfo->x_dnd_atoms*.
-
-2006-08-10 Jan Dj,Ad(Brv <[email protected]>
-
- * keyboard.c: Define in_sighandler.
- (input_available_signal): Set in_sighandler.
- (init_keyboard): Initialize in_sighandler.
-
- * keyboard.h: Declare in_sighandler.
-
- * alloc.c (UNBLOCK_INPUT_ALLOC, BLOCK_INPUT_ALLOC): Use in_sighandler
- to check if mutex should be locked or not.
-
-2006-08-09 Richard Stallman <[email protected]>
-
- * keyboard.c (keyremap_step): No-op if fkey->parent = nil.
- (read_key_sequence): Always start fkey.start and fkey.end at 0,
- and likewise for keytran.
-
-2006-08-09 Kenichi Handa <[email protected]>
-
- * coding.c (syms_of_coding): Improve the docstring
- of file-coding-system-alist.
-
-2006-08-07 Andreas Schwab <[email protected]>
-
- * puresize.h (BASE_PURESIZE): Increase to 1120000.
-
-2006-08-06 Chong Yidong <[email protected]>
-
- * buffer.c (Vchange_major_mode_hook, Qchange_major_mode_hook): New vars.
- (Fkill_all_local_variables): Use it.
- (syms_of_buffer): Defvar it.
-
-2006-08-05 Eli Zaretskii <[email protected]>
-
- * w32.c (w32_valid_pointer_p): New function.
-
- * w32.h: Add prototype for w32_valid_pointer_p.
-
- * alloc.c: Include w32.h.
- (valid_lisp_object_p) [WINDOWSNT]: Call w32_valid_pointer_p to do
- the job.
-
- * keyboard.c (kbd_buffer_get_event): Return Qnil when current time
- is exactly equal to end_time, not only when it is past that.
-
-2006-08-04 Chong Yidong <[email protected]>
-
- * keyboard.c (read_char): Rebalance specpdl after receiving jump.
-
- * process.c: Reapply 2006-08-01 change.
-
-2006-08-04 Eli Zaretskii <[email protected]>
-
- * w32fns.c (w32_query_font): Fix last change: use stricmp.
-
-2006-08-04 Stefan Monnier <[email protected]>
-
- * editfns.c (Fsubst_char_in_region): Redo the setup work after running
- the before-change-functions since they may have altered the buffer.
-
-2006-08-04 Ralf Angeli <[email protected]>
-
- * w32fns.c (w32_createwindow): Handle -geometry command line option
- and the geometry settings in the Registry.
-
-2006-08-04 Kenichi Handa <[email protected]>
-
- * w32fns.c (w32_query_font): Compare names by ignoring case.
-
- * xterm.c (x_query_font): Compare names by ignoring case.
-
-2006-08-03 Jason Rumney <[email protected]>
-
- * w32menu.c (w32_menu_show, w32_dialog_show): Call Fsignal to quit
- when no option selected.
-
-2006-08-03 Chong Yidong <[email protected]>
-
- * process.c: Revert last change.
-
-2006-08-01 Kim F. Storm <[email protected]>
-
- * process.c (wait_reading_process_output_unwind): New function.
- Restores waiting_for_user_input_p to saved value.
- (wait_reading_process_output): Unwind protect waiting_for_user_input_p
- instead of save/restore old value on stack.
-
-2006-07-30 Thien-Thi Nguyen <[email protected]>
-
- * editfns.c: Undo 2006-06-27 change.
-
-2006-07-29 Eli Zaretskii <[email protected]>
-
- * coding.c (Ffind_operation_coding_system): Revert the change from
- 2006-05-29.
-
- * alloc.c [WINDOWSNT]: Include fcntl.h, to fix last change.
-
-2006-07-28 Richard Stallman <[email protected]>
-
- * xfaces.c (lookup_named_face, Fdisplay_supports_face_attributes_p):
- Add conditional aborts for clarity.
-
- * xdisp.c (update_menu_bar): New arg HOOKS_RUN. Callers changed.
- Used to avoid running the hooks over and over for each frame.
- (prepare_menu_bars): Pass value from update_menu_bar
- as HOOKS_RUN of next call.
-
- * keyboard.c (safe_run_hooks_1): Don't crash if Vrun_hooks is nil.
-
-2006-07-28 Kim F. Storm <[email protected]>
-
- * alloc.c (valid_pointer_p): New function (from valid_lisp_object_p).
- (valid_lisp_object_p): Use it to check for valid SUBRP obj.
-
-2006-07-26 Chong Yidong <[email protected]>
-
- * keyboard.c (read_char): New arg END_TIME specifying timeout.
- All callers changed. Turn off echoing if END_TIME is non-NULL.
- (kbd_buffer_get_event): New arg END_TIME.
-
- * lread.c (read_filtered_event): New arg SECONDS to wait until.
- (Fread_char, Fread_event, Fread_char_exclusive): New arg SECONDS.
-
- * lisp.h: Update read-char, read-event, and read_filtered_event
- prototypes.
-
- * keyboard.h: Include systime.h. Update read_char prototype.
-
-2006-07-25 YAMAMOTO Mitsuharu <[email protected]>
-
- * alloc.c (find_string_data_in_pure): New function.
- (make_pure_string): Use it to reuse existing string data if possible.
-
- * puresize.h (BASE_PURESIZE): Decrease to 1102000.
-
-2006-07-22 Stefan Monnier <[email protected]>
-
- * keymap.c (Fdefine_key): If the key binding definition looks like an
- XEmacs-style key sequence, convert it to Emacs's format.
-
-2006-07-22 Ralf Angeli <[email protected]>
-
- * w32fns.c (w32_createwindow): If `left' and/or `top' frame
- parameters are bound to some values, use that instead of
- CW_USEDEFAULT.
-
-2006-07-21 Eli Zaretskii <[email protected]>
-
- * w32.c (convert_time): Use explicit long double constants to
- ensure long double arithmetics is used throughout.
-
-2006-07-20 YAMAMOTO Mitsuharu <[email protected]>
-
- * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp): New vars.
- (init_alloc_once): Initialize them.
- (pure_alloc): Allocate non-Lisp objects from the end of pure storage
- without alignment.
-
- * puresize.h (BASE_PURESIZE): Decrease to 1141000.
-
-2006-07-18 Francis Litterio <[email protected]>
-
- * w32term.c (x_calc_absolute_position): Fix frame positioning
- with negative X/Y coordinates.
-
-2006-07-18 Dan Nicolaescu <[email protected]>
-
- * xterm.c (x_connection_closed, x_error_quitter): Mark as NO_RETURN.
-
- * textprop.c (text_read_only): Likewise.
-
- * lread.c (end_of_file_error): Likewise.
-
- * lisp.h (circular_list_error, memory_full, buffer_memory_full):
- Likewise.
-
- * eval.c (unwind_to_catch): Likewise.
-
- * buffer.h (buffer_slot_type_mismatch): Likewise.
-
-2006-07-18 Kim F. Storm <[email protected]>
-
- Cleanup Fsignal calls that never returns; now only use it for Qquit.
-
- * eval.c (xsignal): New func. Like Fsignal, but marked no-return.
- (xsignal0, xsignal1, xsignal2, xsignal3): New no-return functions.
- (signal_error): New no-return function (from xfaces.c).
- (Fthrow): Use xsignal2 instead of Fsignal + abort.
- (error): Use xsignal1 instead of Fsignal + abort.
- (FletX, Flet, grow_specpdl): Use signal_error.
- (Feval, Ffuncall, funcall_lambda): Use xsignal1, xsignal2.
-
- * alloc.c (buffer_memory_full, memory_full): Use xsignal. Remove loop.
- (list1): New function.
-
- * lisp.h (list1): Add EXFUN.
- (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error):
- Add prototypes. Mark them as no-return.
-
- * buffer.c (Fbuffer_local_value, Fbarf_if_buffer_read_only):
- Use xsignal1.
-
- * callint.c (check_mark): Use xsignal0.
-
- * casefiddle.c (casify_object): wrong_type_argument is no-return.
-
- * cmds.c (Fforward_char, Fdelete_char): Use xsignal0.
-
- * coding.c (Fcheck_coding_system): Use xsignal1. Remove loop.
- (Fdefine_coding_system_internal): Use xsignal1.
-
- * data.c (circular_list_error): Use xsignal.
- (wrong_type_argument): Use xsignal2. Don't care about return value.
- (args_out_of_range, args_out_of_range_3): Use xsignal2, xsignal3.
- Remove loop around Fsignal.
- (indirect_variable, Fsymbol_value, set_internal, Fdefault_value)
- (indirect_function, Findirect_function, Fstring_to_number)
- (Fmakunbound, Ffmakunbound, Fsymbol_function, Ffset): Use xsignal1.
- (arith_driver, float_arith_driver, Frem, Fmod, arith_error):
- Use xsignal0.
-
- * doc.c (Fdocumentation): Use xsignal1.
-
- * editfns.c (region_limit, Fget_internal_run_time): Use xsignal0.
-
- * fileio.c (report_file_error): Use xsignal.
- (barf_or_query_if_file_exists, Fcopy_file, Fdelete_file)
- (Finsert_file_contents): Use xsignal2.
- (syms_of_fileio): Use list2, list3.
-
- * floatfns.c (arith_error, range_error, domain_error): Use xsignal2.
- (range_error2, domain_error2): Use xsignal3.
- (rounding_driver, fmod_float): Use xsignal0.
- (float_error): Use xsignal1.
- (matherr): Use xsignal.
-
- * fns.c (Flength): wrong_type_argument is no-return.
- (hashfn_user_defined, Fmake_hash_table): Use signal_error.
- (Fmd5): Use xsignal1.
-
- * frame.c (x_set_line_spacing, x_set_screen_gamma): Use signal_error.
-
- * keyboard.c (recursive_edit_1): Use xsignal1.
-
- * keymap.c (Fmap_keymap): Use xsignal1.
-
- * lread.c (Fload): Use xsignal2, signal_error.
- (end_of_file_error): Use xsignal0, xsignal1.
- (read0): Use xsignal1.
- (invalid_syntax): New error function marked no-return.
- (read_integer, read1, read_list): Use it.
-
- * macselect.c (x_get_local_selection): Use signal_error.
-
- * msdos.c (Fmsdos_set_mouse_buttons): Use xsignal2.
-
- * search.c (compile_pattern_1): Use xsignal1.
- (signal_failure): Remove (was only called once).
- (search_command): Use xsignal1 instead of signal_failure.
-
- * syntax.c (scan_lists): Use xsignal3.
-
- * textprop.c (text_read_only): Use xsignal0, xsignal1.
-
- * unexsol.c (unexec): Use xsignal.
-
- * window.c (window_scroll_pixel_based, window_scroll_line_based):
- Use xsignal0.
-
- * xfaces.c (signal_error): Move to eval.c.
- (resolve_face_name): Use xsignal1.
-
- * xfns.c (x_decode_color): Use signal_error.
-
- * xselect.c (x_get_local_selection, copy_multiple_data)
- (x_get_window_property_as_lisp_data)
- (lisp_data_to_selection_data, CHECK_CUT_BUFFER)
- (Fx_get_cut_buffer_internal): Use signal_error.
-
-2006-07-18 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.c (XTread_socket): Undo previous change.
-
-2006-07-18 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.c (keycode_to_xkeysym): Remove function. All uses now
- directly lookup keycode_to_xkeysym_table.
- [USE_MAC_TSM] (mac_handle_text_input_event): Don't construct
- ASCII_KEYSTROKE_EVENT for non-zero keycode_to_xkeysym_table entries.
- (XTread_socket): Use character codes to construct keypad key events.
- (mac_initialize_display_info) [MAC_OSX]: Use CGDisplaySamplesPerPixel.
- (x_delete_display): Apply 2006-07-04 change for xterm.c.
-
-2006-07-17 Richard Stallman <[email protected]>
-
- * keyboard.c (Vcommand_error_function): New variable.
- (syms_of_keyboard): Defvar it.
- (cmd_error_internal): Simplify, and handle Vcommand_error_function.
-
- * dispnew.c (init_display): Mention DISPLAY as well as TERM in err msg.
-
-2006-07-17 Kim F. Storm <[email protected]>
-
- * xdisp.c (handle_single_display_spec): Ensure the right value of
- it->position is saved by push_it.
- (pop_it): Restore it->object for GET_FROM_BUFFER and GET_FROM_STRING.
- (reseat_1): Don't setup it->object twice.
- (set_iterator_to_next): No need to set it->object after pop_it.
- (move_it_to): Explicitly check to see if last move reached to_charpos.
-
-2006-07-17 Thien-Thi Nguyen <[email protected]>
-
- * xdisp.c (display_mode_line): Preserve match data.
-
-2006-07-14 Kim F. Storm <[email protected]>
-
- * w32.c (pfn_WSACreateEvent, pfn_WSACloseEvent): New func ptrs.
- (init_winsock): Load them. Use ws2_32.dll.
- (sys_listen): Undo last change. Just set FILE_LISTEN flag.
- (sys_accept): Undo last change. Instead, set child status to
- STATUS_READ_ACKNOWLEDGED and reset char_avail event so next
- sys_select will wakeup the reader thread.
- (_sys_wait_accept): New function used by reader thread to wait for
- an incoming connection on a server socket.
-
- * w32.h (_sys_read_ahead, _sys_wait_accept): Add prototypes.
-
- * w32proc.c (reader_thread): Use _sys_wait_accept to wait on a
- server socket (FILE_LISTEN flag).
-
-2006-07-14 Jan Dj,Ad(Brv <[email protected]>
-
- * sound.c (alsa_init): Call snd_pcm_close after successful snd_pcm_open.
-
-2006-07-14 Kim F. Storm <[email protected]>
-
- * w32.c: Fix high cpu load for server sockets.
- (pfn_WSAEventSelect): New function ptr.
- (init_winsock): Load it.
- (sys_listen): Set FILE_LISTEN flag. Set event mask for socket's
- char_avail event object to FD_ACCEPT.
- (sys_accept): Check FILE_LISTEN flag. Set event mask on new
- socket's char_avail event object to FD_READ|FD_CLOSE.
-
- * w32.h (FILE_LISTEN): New filedesc flag value.
-
-2006-07-13 Kim F. Storm <[email protected]>
-
- * bytecode.c (Fbyte_code): Use CAR, CDR for Bcar, Bcdr.
- Use CAR_SAFE, CDR_SAFE for Bcar_safe, Bcdr_safe.
- Simplify loops and use CAR for Bnth and Belt.
-
- * data.c (Findirect_function): Optimize for no indirection.
-
- * eval.c (Fthrow): Remove loop around Fsignal.
- (Feval, Fapply, Ffuncall): Optimize for no function indirection.
- Use original function name in all signaled errors.
- Simplify Fsignal calls (no return).
- (funcall_lambda): Simplify Fsignal calls (no return).
-
-2006-07-13 Andreas Schwab <[email protected]>
-
- * syntax.c (scan_sexps_forward): Use EMACS_INT for out_bytepos and
- out_charpos.
-
-2006-07-13 Kenichi Handa <[email protected]>
-
- * editfns.c (Fformat): Fix calculation of text property positions
- of format string.
-
-2006-07-12 Kim F. Storm <[email protected]>
-
- * lisp.h (CHECK_TYPE): New macro for generic type checking.
- (CAR_SAFE, CDR_SAFE): New macros.
- (ARRAYP, CHECK_ARRAY): New macros.
- (CHECK_VECTOR_OR_STRING, CHECK_SUBR): New macros.
- (CHECK_WINDOW_CONFIGURATION): New macro.
- (CHECK_LIST_CONS, CHECK_LIST_END): New checks for list traversal.
- (CHECK_STRING_OR_BUFFER, CHECK_HASH_TABLE, CHECK_LIST)
- (CHECK_STRING, CHECK_STRING_CAR, CHECK_CONS, CHECK_SYMBOL)
- (CHECK_CHAR_TABLE, CHECK_VECTOR, CHECK_VECTOR_OR_CHAR_TABLE)
- (CHECK_BUFFER, CHECK_WINDOW, CHECK_LIVE_WINDOW, CHECK_PROCESS)
- (CHECK_NUMBER, CHECK_NATNUM, CHECK_MARKER, CHECK_OVERLAY)
- (CHECK_NUMBER_COERCE_MARKER, CHECK_FLOAT, CHECK_NUMBER_OR_FLOAT)
- (CHECK_NUMBER_OR_FLOAT_COERCE_MARKER): Use CHECK_TYPE.
-
- * category.h (CHECK_CATEGORY, CHECK_CATEGORY_SET):
- * frame.h (CHECK_FRAME, CHECK_LIVE_FRAME): Use CHECK_TYPE.
-
- * callint.c (Fcall_interactively):
- * casefiddle.c (casify_object):
- * editfns.c (general_insert_function):
- * fns.c (Flength, Felt, Ffillarray):
- * data.c (Fcar, Fcdr): Remove loop around wrong_type_argument.
-
- * data.c (wrong_type_argument): Remove loop around Fsignal.
- (Farrayp, Fsequencep): Use ARRAYP.
- (Fcar): Use CAR.
- (Fcar_safe): Use CAR_SAFE.
- (Fcdr): Use CDR.
- (Fcdr_safe): Use CDR_SAFE.
- (Fsetcar, Fsetcdr): Use CHECK_CONS.
- (Fsubr_arity, Fsubr_name): Use CHECK_SUBR.
- (Faset): Use CHECK_ARRAY.
-
- * fns.c (Felt): Use CHECK_ARRAY.
- (concat): Use CHECK_NUMBER.
- (Fsubstring, substring_both): Use CHECK_VECTOR_OR_STRING.
- (Fmemq): Use CHECK_LIST.
- (Fassq, Fassoc, Frassq, Frassoc): Use CAR.
- (assq_no_quit): Use CAR_SAFE.
- (Fnthcdr, Fmember, Fdelq, Fdelete, Fnreverse, Fnconc):
- Use CHECK_LIST_CONS.
- (Freverse, Fplist_get, Flax_plist_get): Use CHECK_LIST_END.
-
- * bytecode.c (Fbyte_code): Use CHECK_VECTOR.
-
- * casetab.c (check_case_table):
- * category.c (check_category_table):
- * marker.c (Fcopy_marker):
- * syntax.c (check_syntax_table):
- * xfaces.c (load_pixmap): Use CHECK_TYPE.
-
- * fns.c (Fcopy_sequence, concat):
- * fringe.c (Fdefine_fringe_bitmap):
- * lread.c (check_obarray): Cleanup wrong_type_argument use.
-
- * keyboard.c (access_keymap_keyremap): Use ARRAYP.
-
- * keymap.c (Fdefine_key, Flookup_key):
- * macros.c (Fstart_kbd_macro): Use CHECK_VECTOR_OR_STRING.
-
- * mac.c (Fmac_get_preference): Use CHECK_LIST_END.
-
- * search.c (Fset_match_data): Use CHECK_LIST.
-
- * sunfns.c (sun_item_create): Use CHECK_LIST_CONS.
-
- * window.c (Fwindow_configuration_frame, Fset_window_configuration):
- (compare_window_configurations): Use CHECK_WINDOW_CONFIGURATION.
-
-2006-07-12 YAMAMOTO Mitsuharu <[email protected]>
-
- * Makefile.in (dired.o, editfns.o, fileio.o): Depend on blockinput.h.
-
- * dired.c: Include blockinput.h.
- (Ffile_attributes): Add BLOCK_INPUT around getpwuid/getgrgid.
-
- * editfns.c: Include blockinput.h.
- (Fuser_login_name, Fuser_full_name): Add BLOCK_INPUT around
- getpwuid/getpwnam.
-
- * fileio.c: Include blockinput.h.
- (Fexpand_file_name, search_embedded_absfilename): Add BLOCK_INPUT
- around getpwnam.
- (search_embedded_absfilename): Remove spurious xfree.
-
-2006-07-11 Kim F. Storm <[email protected]>
-
- * dispnew.c (sit_for): Reduce number of args from 5 to 3.
- Now just one TIMEOUT arg that can be a Lisp float or Lisp int.
- Combine args DISPLAY and INITIAL_DISPLAY into one arg DO_DISPLAY.
- Signal error if TIMEOUT is not a number.
- Undo 2006-06-14 change for non-preemptive display if TIMEOUT < 0.
- The rework of sit_for args also fixes several incorrect Qt args
- which should have been 1.
- (Fredisplay): Pass 1 instead of Qt to swallow_events and
- detect_input_pending_run_timers.
-
- * lisp.h (sit_for): Update prototype.
- (Fredisplay): Add EXFUN.
-
- * dispextern.h (sit_for): Remove prototype.
-
- * callint.c (Fcall_interactively):
- * minibuf.c (temp_echo_area_glyphs):
- * keyboard.c (command_loop_1, read_char, Fexecute_extended_command):
- * fileio.c (Fdo_auto_save): Update/simplify sit_for calls.
-
-2006-07-11 Stefan Monnier <[email protected]>
-
- * syntax.c (forw_comment): Also use EMACS_INT for buffer positions.
-
-2006-07-11 Kim F. Storm <[email protected]>
-
- * dispnew.c (Fredisplay): Add FORCE argument to force redisplay when
- input is available. Fix test for redisplay_dont_pause non-nil.
- Specbind redisplay-dont-pause to t if FORCE non-nil.
-
-2006-07-10 Chong Yidong <[email protected]>
-
- * puresize.h (BASE_PURESIZE): Increment to 1211000.
-
- * dispnew.c (Fredisplay): New function, equivalent to (sit-for 0).
- (Fsit_for): Function deleted.
-
- * keyboard.c (command_loop_1, Fexecute_extended_command):
- Call sit_for instead of Fsit_for.
-
- * minibuf.c (temp_echo_area_glyphs): Likewise.
-
-2006-07-09 Stefan Monnier <[email protected]>
-
- * syntax.c (Fforward_comment): Revert the reversion.
- (back_comment, scan_lists): Also use EMACS_INT for buffer positions.
-
-2006-07-09 John Paul Wallington <[email protected]>
-
- * syntax.c (Fforward_comment): Revert previous change.
-
-2006-07-09 Kim F. Storm <[email protected]>
-
- * window.c (Fforce_window_update): Doc fix.
-
-2006-07-08 Stephen Gildea <[email protected]>
-
- * fileio.c (do_auto_save_make_dir): Make the auto-save-list-file
- directory unreadable for better user privacy.
-
-2006-07-07 Stefan Monnier <[email protected]>
-
- * syntax.c (Fforward_comment): Fix int-32 vs EMACS_INT-64 mixup.
-
- * lread.c (read_filtered_event): Remove `register' qualifier because it
- causes compilation problem with gcc-4.0.2-20051125 on amd64.
- (readevalloop): Remove unused var `bpos'.
- Yet another int/Lisp_Object mixup (YAILOM).
-
-2006-07-07 Eli Zaretskii <[email protected]>
-
- * keyboard.c (Fexecute_extended_command): Mention the argument
- PREFIXARG in the doc string.
-
-2006-07-07 Kim F. Storm <[email protected]>
-
- * fringe.c (Fdefine_fringe_bitmap): Doc fix.
-
-2006-07-05 Chong Yidong <[email protected]>
-
- * insdel.c (prepare_to_modify_buffer): For an indirect buffer, do
- clash detection using the base buffer.
-
- * puresize.h (BASE_PURESIZE): Increment to 1210500.
-
-2006-07-04 Kim F. Storm <[email protected]>
-
- * xterm.c (x_delete_display): Don't free or derefence NULL pointers.
-
-2006-07-04 Kenichi Handa <[email protected]>
-
- * fontset.c (Fset_overriding_fontspec_internal): Check if we need
- to update Voverriding_fontspec_alist.
-
-2006-07-03 Richard Stallman <[email protected]>
-
- * xfns.c (Fx_create_frame): Move unwind_create_frame setup down.
-
- * xfaces.c (Fface_attribute_relative_p): Doc fix.
-
- * textprop.c (Fget_char_property_and_overlay): Doc fix.
-
- * eval.c (Fdefvaralias): Doc fix.
-
-2006-07-03 Kim F. Storm <[email protected]>
-
- * dispnew.c (sit_for): Fix preempt condition.
-
-2006-07-02 Stefan Monnier <[email protected]>
-
- * lread.c (read_filtered_event): Treat select-window just like
- switch-frame.
-
-2006-07-02 Kim F. Storm <[email protected]>
-
- * xdisp.c (display_tool_bar_line): Skip glyphs which are too big
- to ever fit the tool-bar,
- (MAX_FRAME_TOOL_BAR_HEIGHT): New macro.
- (tool_bar_lines_needed): Use unused mode-line row as temp_row.
- (redisplay_tool_bar): Only clear desired matrix if we actually
- change the tool-bar window height. Only try to make the tool-bar
- window bigger if there is actually room for it.
-
-2006-06-30 Ralf Angeli <[email protected]>
-
- * w32term.c (x_make_frame_visible): Use SystemParametersInfo with
- SPI_GETWORKAREA to find the dimensions of the screen work area,
- and adjust vertical position of the frame in order to avoid being
- covered by the task bar.
-
- * w32fns.c (w32_createwindow): Use CW_USEDEFAULT instead of
- f->left_pos and SH_SHOW instead of f->top_pos in the call to
- CreateWindow. Record the actual position in f->left_pos and
- f->top_pos.
-
-2006-06-30 John Paul Wallington <[email protected]>
-
- * w32console.c (syms_of_ntterm) <w32-use-full-screen-buffer>:
- Doc fix - default value has changed.
-
-2006-06-28 YAMAMOTO Mitsuharu <[email protected]>
-
- * mac.c [!TARGET_API_MAC_CARBON]: Don't include FixMath.h or Scrap.h.
-
- * macfns.c (Fx_create_frame): Apply 2006-06-24 change for xfns.c.
-
- * macgui.h (USE_MAC_TSM) [TARGET_API_MAC_CARBON]: Set default to 1.
-
- * macterm.c (Qeql): Add extern.
- (x_set_mouse_pixel_position) [MAC_OSX]: Use CGWarpMouseCursorPosition.
- (fm_style_face_attributes_alist) [USE_ATSUI]: New variable.
- (syms_of_macterm) [USE_ATSUI]: Initialize and staticpro it.
- Change keys of Vmac_atsu_font_table from strings to numbers.
- (fm_style_to_face_attributes) [USE_ATSUI]: New function.
- (init_font_name_table) [USE_ATSUI]: Use it.
- (saved_ts_script_language_on_focus) [USE_MAC_TSM]: New variable.
- (syms_of_macterm) [USE_MAC_TSM]: Initialize and staticpro it.
- [USE_MAC_TSM] (mac_tsm_resume): Restore script and language codes
- only when saved_ts_script_language_on_focus coincides with
- Vmac_ts_script_language_on_focus.
- [USE_MAC_TSM] (mac_tsm_suspend): Save value of
- Vmac_ts_script_language_on_focus to saved_ts_script_language_on_focus.
- (XTread_socket) [USE_MAC_TSM]: Add Mac OS Classic support.
- [USE_MAC_TSM] (mac_handle_text_input_event, init_tsm): Likewise.
-
-2006-06-27 Chong Yidong <[email protected]>
-
- * editfns.c (Fdelete_field, Ffield_string, Ffield_beginning)
- (Ffield_string_no_properties, Ffield_end): Mention
- args-out-of-range error condition in docstring.
-
-2006-06-27 Kim F. Storm <[email protected]>
-
- * xdisp.c (handle_composition_prop): Set stop_charpos before push_it.
-
-2006-06-25 Kim F. Storm <[email protected]>
-
- * s/gnu-linux.h (SIGNALS_VIA_CHARACTERS): Define for Linux kernel
- version 2.4 and later.
-
-2006-06-24 Chong Yidong <[email protected]>
-
- * xfns.c (Fx_create_frame): Set font parameter directly instead of
- using x_default_parameter, since x_get_args clears the parm alist.
-
-2006-06-24 Eli Zaretskii <[email protected]>
-
- * dired.c (directory_files_internal) [WINDOWSNT]: Find files
- case-insensitively.
-
-2006-06-24 Aidan Kehoe <[email protected]>
-
- * lread.c (read_escape): When an unknown Unicode code point is
- encountered as a string or character escape, signal an error.
-
-2006-06-23 Kim F. Storm <[email protected]>
-
- * .gdbinit (pitx): Dump iterator stack.
-
- * xdisp.c (handle_composition_prop): Push iterator on stack.
- (set_iterator_to_next): Pop iterator at end of composition.
-
-2006-06-23 Martin Rudalics <[email protected]>
-
- * fileio.c (Frename_file) [DOS_NT]: Don't try to move directory to
- itself on DOS_NT platforms, if the old and new names are identical
- but for the letter-case.
-
-2006-06-21 Kim F. Storm <[email protected]>
-
- * dispextern.h (struct it): Add `position' member to iterator stack.
- Rename `pos' member to `current'. Rearrange and add comments.
-
- * xdisp.c (handle_stop): Set it->ignore_overlay_strings_at_pos_p
- if we get any overlays.
- (set_cursor_from_row): Don't clobber `end' if we rescan from
- start_string.
- (push_it, pop_it): Save it->position.
-
-2006-06-19 Richard Stallman <[email protected]>
-
- * window.c (size_window): New arg FIRST_ONLY. All callers changed.
- (adjust_window_trailing_edge): Specially compute FIRST_PARALLEL
- for the case of a top-level window and the following minibuffer.
- Don't exit because of no `next' when there is a parent.
- Use the FIRST_ONLY feature when resizing following windows.
-
- * syntax.c (init_syntax_once): Give most control chars' syntax Spunct.
-
-2006-06-17 Kim F. Storm <[email protected]>
-
- * dispnew.c (update_frame): Check for input pending on entry.
- (update_window, update_frame_1): Break loop if input is detected.
-
-2006-06-16 Francis Litterio <[email protected]>
-
- * xterm.c (x_check_expected_move, handle_one_xevent)
- (x_set_offset, x_check_fullscreen): Extensive changes to make
- frame positioning deterministic under X.
-
- * xterm.h (x_output): Add members left_before_move and
- top_before_move. Removed members expected_left and expected_top.
-
-2006-06-16 Kim F. Storm <[email protected]>
-
- * dispextern.h (struct it): Add union to iterator stack to save
- image, composition, and stretch specific paramters.
-
- * xdisp.c (next_overlay_string): Fix assert.
- (push_it, pop_it): Handle composition and stretch specific values.
- Only handle it->slice in image (for now).
- (back_to_previous_visible_line_start): Continue search if newline is
- part of a compisition. Simplify.
- (reseat_1): Set it->object to buffer.
- (set_iterator_to_next): Set it->object to string or buffer, when
- setting it->method to GET_FROM_STRING or GET_FROM_BUFFER.
- (next_element_from_composition): Set it->object to buffer if not
- from string.
- (set_cursor_from_row): Only save start of string if not already
- done to handle multiple strings in a row.
-
- * .gdbinit (pitx): Show composition parameters.
- (pgx, pg): New commands to print a glyph structure.
- (pgi, pgn): New commands to print specific/next glyph.
- (pgrowx, pgrow): New commands to print all glyphs in a row.
-
-2006-06-16 YAMAMOTO Mitsuharu <[email protected]>
-
- * macfns.c (Fx_display_mm_height, Fx_display_mm_width)
- [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]: Use CGDisplayScreenSize.
-
- * macterm.c (do_app_resume, do_app_suspend): Remove functions.
- (mac_tsm_resume, mac_tsm_suspend) [USE_MAC_TSM]: New functions.
- (mac_handle_window_event, XTread_socket) [USE_MAC_TSM]: Use them.
- (Vmac_ts_script_language_on_focus) [USE_MAC_TSM]: New variable.
- (syms_of_macterm) [USE_MAC_TSM]: Defvar it.
- (saved_ts_language, saved_ts_component) [USE_MAC_TSM]: New variables.
- (mac_initialize_display_info) [MAC_OSX]: Use Quartz Display
- Services functions to get size of main display in pixels.
-
-2006-06-14 Chong Yidong <[email protected]>
-
- * xdisp.c (back_to_previous_visible_line_start):
- Reset it->continuation_lines_width.
-
-2006-06-14 Richard Stallman <[email protected]>
-
- * eval.c (Fdefconst): Mark variable as risky.
-
- * callproc.c (Fcall_process): Doc fix.
-
- * window.c (adjust_window_trailing_edge): Don't break out of the loop
- because there's no next window, if there are parallel windows.
- Do break out when WINDOW is nil.
-
-2006-06-14 Kim F. Storm <[email protected]>
-
- * dispextern.h (IT_STACK_SIZE): New macro specifying size of
- iterator stack (instead of hardcoded number). Increase from 2 to
- 4 to make room for propertized overlay strings before and after a
- display string, image or composition.
- (struct it): Add image_id and method members to iterator stack.
-
- * xdisp.c (init_from_display_pos): Don't set it->method and
- overlay_string_index after pop_it. Add asserts.
- (handle_stop): Look for overlay strings around a display string,
- image, or composition. Handle properties on those strings.
- (next_overlay_string): Don't set string, pos or method after pop_it.
- (get_overlay_strings_1): Split from get_overlay_strings; don't
- modify it if no overlay strings are found.
- (get_overlay_strings): Use get_overlay_strings_1. Always set
- it->string and it->method.
- (push_it): Push it->image_id and it->method. Push it->object
- instead of it->string if method is GET_FROM_IMAGE.
- (pop_it): Pop it->image_id and it->method. Ppo it->object
- instead of it->string if method is GET_FROM_IMAGE.
- Reset it->current.string_pos if popped it->string is nil.
- (reseat_1): Remove comment dated 19 May 2003. It expressed doubt
- whether a given change was correct; but the change is correct.
- Clear it->string_from_display_prop_p.
- (set_iterator_to_next): Rely on it->method and it->image_id from
- iterator stack, instead of setting them explicitly after pop_it.
-
- * dispnew.c (sit_for): Undo 2006-06-01 change. Instead, a
- negative time forces redisplay even when input is available.
- (Fsit_for): Doc fix.
-
-2006-06-13 Kim F. Storm <[email protected]>
-
- * dispnew.c: Modify preemptive redisplay to be based on periodic
- checks for input.
- (PERIODIC_PREEMPTION_CHECKING): Define to 1 iff EMACS_HAS_USECS.
- (Vredisplay_preemption_period): New variable.
- (syms_of_display): DEFVAR_LISP and initialize it.
- (preemption_period, preemption_next_check): New variables.
- (update_frame, update_single_window): Initialize them based on
- Vredisplay_preemption_period if !force_p.
- (update_window, update_frame_1): Use them to determine when to
- check for input.
-
-2006-06-03 Aidan Kehoe <[email protected]>
-
- * lread.c (read_escape): Provide a Unicode character escape
- syntax; \u followed by exactly four or \U followed by exactly
- eight hex digits in a comment or string is read as a Unicode
- character with that code point.
-
-2006-06-09 Eli Zaretskii <[email protected]>
-
- * window.c (window_scroll_pixel_based): Signal "Beginning of
- buffer" when scroll-down at the beginning of an empty buffer.
-
-2006-06-06 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.c [USE_MAC_TSM] (mac_handle_text_input_event):
- Exclude 0x7f from ASCII range.
-
-2006-06-05 Jason Rumney <[email protected]>
-
- * w32term.c (w32_set_scroll_bar_thumb, x_scroll_bar_create)
- (w32_set_vertical_scroll_bar, w32_scroll_bar_handle_click)
- (x_scroll_bar_report_motion): Remove workarounds for
- versions of Windows NT < 3.51.
- [!SIF_ALL]: Remove.
- (pfnSetScrollInfo, pfnGetScrollInfo): Remove.
- (w32_initialize): Don't dynamically load Get/SetScrollInfo.
-
-2006-06-04 David Kastrup <[email protected]>
-
- * dispnew.c: Mention `redisplay-dont-pause' in doc string of
- `sit-for'.
-
-2006-06-03 YAMAMOTO Mitsuharu <[email protected]>
-
- * macfns.c (x_set_icon_name): Apply 2006-06-02 change for xfns.c.
-
- * macgui.h (USE_MAC_TSM): Set default to 1 on Mac OS X.
-
- * macterm.c (tsm_document_id) [USE_MAC_TSM]: New variable.
- (Qtext_input, Qupdate_active_input_area, Qunicode_for_key_event)
- [USE_MAC_TSM]: Likewise.
- (syms_of_macterm) [USE_MAC_TSM]: Intern and staticpro them.
- (Qbefore_string) [USE_MAC_TSM]: Add extern.
- (do_app_resume, do_app_suspend) [USE_MAC_TSM]: Call
- ActivateTSMDocument/DeactivateTSMDocument.
- (mac_store_event_ref_as_apple_event): Call mac_post_mouse_moved_event.
- (mac_handle_window_event) [USE_MAC_TSM]: Handle
- kEventWindowFocusAcquired/kEventWindowFocusRelinquish.
- (mac_handle_text_input_event) [USE_MAC_TSM]: New function.
- (install_window_handler) [USE_MAC_TSM]: Install it. Register
- kEventWindowFocusAcquired/kEventWindowFocusRelinquish.
- (keycode_to_xkeysym_table): Add entry for f16.
- (XTread_socket) [USE_MAC_TSM]: Set/reset read_socket_inev
- before/after passing keystroke event to toolbox dispatcher.
- (init_tsm) [USE_MAC_TSM]: New function.
- (mac_initialize) [USE_MAC_TSM]: Call it.
- (Vmac_ts_active_input_overlay) [USE_MAC_TSM]: New defvar.
-
- * macterm.h (EVENT_PARAM_TEXT_INPUT_SEQUENCE_NUMBER): New enumerator.
-
-2006-06-02 John Paul Wallington <[email protected]>
-
- * xfns.c (x_set_name_internal): Set icon to `text', derived from
- name, when frame's icon_name isn't a string rather than only when
- it is nil.
-
-2006-06-03 Eli Zaretskii <[email protected]>
-
- * w32fns.c (x_set_icon_name): Don't use arg if it's not a string
- and not nil.
-
-2006-06-02 Chong Yidong <[email protected]>
-
- * xfns.c (x_set_icon_name): No-op if arg is non-nil and not a
- string.
-
-2006-06-02 YAMAMOTO Mitsuharu <[email protected]>
-
- * xdisp.c (next_element_from_composition): Set it->object to
- it->string if composition is coming from string.
- (set_cursor_from_row): Don't return 0 unless row displays a
- continued line.
- (dump_glyph): Dump composite glyph.
-
-2006-06-02 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (menu_nav_ended): Check that menubar_widget is not NULL.
-
-2006-06-01 Richard Stallman <[email protected]>
-
- * window.c (Fsplit_window): Doc fix.
-
-2006-06-01 Micha,Ak(Bl Cadilhac <[email protected]>
-
- * process.c (deleted_pid_list): New variable to store the pids
- of deleted processes. Declare it only if SIGCHLD is defined.
- (init_process): Initialize it.
- (syms_of_process): Staticpro it.
- (Fdelete_process): Add pid of the deleted process to it. Check after
- the addition and before the kill if the process is already stopped,
- in which case it is deleted from the list and not killed.
- (sigchld_handler): Define it only if SIGCHLD is. Search the process
- that signaled Emacs in `deleted_pid_list' before `Vprocess_alist'.
- Original idea by Stefan Monnier.
-
-2006-06-01 Kim F. Storm <[email protected]>
-
- * dispnew.c (sit_for): Perform redisplay even if input is pending
- when redisplay-dont-pause is non-nil.
-
-2006-06-01 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.c (mac_handle_visibility_change): Set buf.arg to Qnil.
- (XTread_socket): Remove obsolete comment.
-
-2006-06-01 Jan Dj,Ad(Brv <[email protected]>
-
- * xmenu.c (syms_of_xmenu): Make accelerate-menu an alias for
- menu-bar-open.
-
-2006-06-01 Jan Dj,Ad(Brv <[email protected]>
-
- * xmenu.c (Fmenu_bar_open, syms_of_xmenu): Change menu-bar-start to
- menu-bar-open.
-
- * gtkutil.c (menu_nav_ended): Change x-menu-bar-start to menu-bar-open.
-
-2006-05-31 Juri Linkov <[email protected]>
-
- * minibuf.c (Vhistory_add_new_input): New variable.
- (read_minibuf): Use it.
- (syms_of_minibuf) <history-add-new-input>: New Lisp variable.
- (syms_of_minibuf) <history-delete-duplicates>: Doc fix.
-
-2006-05-31 Kim F. Storm <[email protected]>
-
- * process.c (select_wrapper): Add wrapper around select to work around
- "incomplete backtrace" bug in gdb 5.3, when emacs is stopped inside
- select called from wait_reading_process_output.
-
-2006-05-30 Andreas Schwab <[email protected]>
-
- * xmenu.c (Fmenu_bar_start): Return a value.
-
-2006-05-30 Richard Stallman <[email protected]>
-
- * coding.c (Ffind_operation_coding_system): Doc fix.
-
-2006-05-30 Eli Zaretskii <[email protected]>
-
- * w32term.c (x_draw_hollow_cursor): Fix last change.
-
-2006-05-29 Kim F. Storm <[email protected]>
-
- * w32term.c (x_draw_stretch_glyph_string): Fix last change.
-
-2006-05-29 Eli Zaretskii <[email protected]>
-
- * coding.c (Ffind_operation_coding_system): Doc fix.
-
-2006-05-29 YAMAMOTO Mitsuharu <[email protected]>
-
- * macfns.c [USE_MAC_FONT_PANEL] (Fmac_set_font_panel_visibility):
- Call mac_set_font_info_for_selection if font panel is made visible.
-
- * macterm.c (font_panel_shown_p) [USE_MAC_FONT_PANEL]: New variable.
- (mac_font_panel_visible_p, mac_show_hide_font_panel)
- [USE_MAC_FONT_PANEL]: New functions.
- [USE_MAC_FONT_PANEL] (mac_set_font_info_for_selection):
- Return immediately if font panel is not visible.
-
- * macterm.h (mac_font_panel_visible_p, mac_show_hide_font_panel):
- Add externs.
-
-2006-05-29 Dan Nicolaescu <[email protected]>
-
- * search.c (matcher_overflow): Mark as NO_RETURN.
-
- * xterm.c (x_connection_closed): Likewise.
-
- * sysdep.c (croak): Likewise.
-
- * sound.c (sound_perror, alsa_sound_perror): Likewise.
-
- * lisp.h (die, nsberror): Likewise.
-
-2006-05-29 Jan Dj,Ad(Brv <[email protected]>
-
- * sound.c (alsa_open, alsa_configure, alsa_write):
- Move assignment to err out of if-statement.
-
- * gtkutil.c (menu_nav_ended): New function.
- (create_menus): Connect menu_nav_ended to "selection-done" to fix
- grabs.
-
- * xmenu.c (Fmenu_bar_start): New function for USE_GTK and USE_X_TOOLKIT.
-
-2006-05-28 Dan Nicolaescu <[email protected]>
-
- * charset.h (invalid_character): Mark as NO_RETURN.
-
-2006-05-29 Kenichi Handa <[email protected]>
-
- * coding.c (Ffind_operation_coding_system): Call a function by
- safe_call1 instead of call1.
-
-2006-05-28 Stefan Monnier <[email protected]>
-
- * window.c (struct saved_window): Add `dedicated'.
- (Fset_window_configuration, save_window_save): Save/restore the
- `dedicated' flag.
-
-2006-05-28 Kim F. Storm <[email protected]>
-
- * xdisp.c (set_cursor_from_row): If cursor cannot be set in row,
- don't update w->cursor and return 0. Return 1 on success.
- (try_cursor_movement): Repeat set_cursor_from_row on successive rows
- until it succeeds.
-
- * dispextern.h (set_cursor_from_row): Update prototype.
-
-2006-05-28 Kim F. Storm <[email protected]>
-
- * xdisp.c (get_phys_cursor_geometry): Return computed x and y through
- parameters. Adjust x and width in case cursor in on a partially
- visible stretch glyph on the left edge.
- (erase_phys_cursor): Don't erase into left fringe/margin in case
- previous cursor glyph is a partially visible stretch glyph on left.
-
- * dispextern.h (get_phys_cursor_geometry): Update prototype.
-
- * xterm.c (x_draw_stretch_glyph_string): Fix problems with invisible
- cursor and erasing cursor on partially visible stretch glyph on left.
- (x_draw_hollow_cursor): Compute x via get_phys_cursor_geometry.
-
- * macterm.c: Likewise.
-
- * w32term.c: Likewise.
-
-2006-05-27 YAMAMOTO Mitsuharu <[email protected]>
-
- * macselect.c (mac_handle_apple_event):
- Return errAEEventNotHandled if key binding is not found.
-
-2006-05-26 Eli Zaretskii <[email protected]>
-
- * emacs.c (main) [PROFILING]: Enable also for __MINGW32__.
- [__MINGW32__]: MinGW-specific declaration of `etext'.
-
- * w32heap.c (etext, edata): Remove unused definitions.
-
-2006-05-26 Chong Yidong <[email protected]>
-
- * fileio.c (Fcopy_file): Delete argument MUSTBENEW.
- Incorporate the exclusive file-opening functionality into the behavior
- when OK-IF-ALREADY-EXISTS is nil.
- (Frename_file): Call Fcopy_file without MUSTBENEW argument.
-
-2006-05-26 Jan Dj,Ad(Brv <[email protected]>
-
- * sound.c (alsa_configure): Move get period/buffer_size after
- setting hwparams.
-
-2006-05-26 Kenichi Handa <[email protected]>
-
- * coding.c (Ffind_operation_coding_system): Allow (FILENAME
- . BUFFER) in TARGET.
-
-2006-05-25 Chong Yidong <[email protected]>
-
- * image.c (png_load): Don't call fclose on NULL.
-
-2006-05-25 Luc Teirlinck <[email protected]>
-
- * fns.c (Fyes_or_no_p):
- * callint.c (Fcall_interactively): Fread_from_minibuffer now takes
- only seven args.
-
-2006-05-25 Juri Linkov <[email protected]>
-
- * lisp.h (Fread_from_minibuffer): Decrement number of args.
-
- * minibuf.c (read_minibuf): Remove arg KEEP_ALL. Callers changed.
- (Fread_from_minibuffer): Remove arg KEEP_ALL. Callers changed.
-
- * buffer.c (mode-line-format): Fix docstring.
-
-2006-05-25 Richard Stallman <[email protected]>
-
- * emacs.c (main, Fdump_emacs): Don't test __linux or __linux__.
-
-2006-05-24 Luc Teirlinck <[email protected]>
-
- * puresize.h (BASE_PURESIZE): Increase to 1210000.
-
-2006-05-24 Alan Mackenzie <[email protected]>
-
- * lread.c (Vload_history): Enhance doc-string to say that the file
- is the absolute truename of the loaded file.
-
- * lread.c (Vafter_load_alist): doc-string: state that an element
- now has a regexp to match file names, not a file name as such.
-
- * lread.c (readevalloop): Call file-truename on the name for
- load-history, except at preloading time.
-
- * lread.c (Fload): At preloading time, preserve the extension of
- the filename which goes into load-history. New var hist_file_name.
-
- * lread.c (Fload): Do eval-after-load stuff by calling the lisp
- function do-after-load-evaluation.
-
-2006-05-24 YAMAMOTO Mitsuharu <[email protected]>
-
- * mac.c (ae_attr_table): New variable.
- (syms_of_mac): Intern and staticpro its elements.
- (mac_aelist_to_lisp): Also convert Apple event attributes.
- (mac_ae_put_lisp): New function.
- (create_apple_event_from_event_ref) [MAC_OSX]: Use typeUTF8Text.
-
- * macfns.c (Fx_server_version): Use gestaltSystemVersionMajor etc.
-
- * macselect.c (Qemacs_suspension_id): New variable.
- (syms_of_macselect): Intern and staticpro it.
- (struct suspended_ae_info): New struct.
- (deferred_apple_events, defer_apple_events)
- (Fmac_process_deferred_apple_events): Use it.
- (suspended_apple_events): New variable.
- (mac_handle_apple_event_1): New function.
- (mac_handle_apple_event): Use it. Don't process previously
- suspended events.
- (cleanup_suspended_apple_events, get_suspension_id)
- (cleanup_all_suspended_apple_events): New functions.
- (init_apple_event_handler): Call cleanup_all_suspended_apple_events
- at exit.
- (Fmac_cleanup_expired_apple_events, Fmac_ae_set_reply_parameter)
- (Fmac_resume_apple_event): New defuns.
- (syms_of_macselect): Defsubr them.
-
- * macterm.c (fn_keycode_to_keycode_table, XTread_socket) [MAC_OSX]:
- Fix last change. Don't map `fn' modifier if pressed with F1 ... F12.
-
- * macterm.h (TYPE_FILE_NAME): Change from macro to enumerator.
- (KEY_EMACS_SUSPENSION_ID_ATTR): New enumerator.
- (keyReplyRequestedAttr) [MAC_OS_X_VERSION_MAX_ALLOWED < 1030]: Likewise.
- (gestaltSystemVersionMajor, gestaltSystemVersionMinor)
- (gestaltSystemVersionBugFix) [MAC_OS_X_VERSION_MAX_ALLOWED < 1040]:
- Likewise.
- (typeUTF8Text, kEventParamWindowMouseLocation)
- [MAC_OSX && MAC_OS_X_VERSION_MAX_ALLOWED < 1020]: Likewise.
- (x_get_focus_frame, mac_ae_put_lisp): Add externs.
-
-2006-05-23 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.c (fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
- (fn_keycode_to_keycode_table) [MAC_OSX]: New variable.
- (mac_set_unicode_keystroke_event) [TARGET_API_MAC_CARBON]: New function.
- (XTread_socket) [TARGET_API_MAC_CARBON]: Use it.
- (XTread_socket) [MAC_OSX]: Try 'uchr' Unicode keyboard-layout
- resource to backtranslate key with modifiers.
- (XTread_socket): Don't set read_socket_inev around AEProcessAppleEvent.
-
-2006-05-23 Jan Dj,Ad(Brv <[email protected]>
-
- * xterm.c: Remove declarations already in xterm.h.
-
- * xterm.h: Add extern declarations for x_clear_errors,
- x_fully_uncatch_errors, x_catching_errors and
- x_alloc_lighter_color_for_widget. Remove duplicated declarations.
-
-2006-05-21 Richard Stallman <[email protected]>
-
- * xfaces.c (best_matching_font): Abort for best == NULL
- before we start to use it.
-
- * buffer.c (syms_of_buffer, Fmake_overlay): Doc fixes.
-
-2006-05-20 Kim F. Storm <[email protected]>
-
- * xfaces.c (best_matching_font): Fix crash in 2006-05-17 change.
-
-2006-05-20 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.c (convert_fn_keycode): Fix last change.
-
-2006-05-19 Eli Zaretskii <[email protected]>
-
- * w32.c (init_environment): Perform the processing of environment
- variables on a copy of default variables and their values, not on
- the original. Simplify code that calls ExpandEnvironmentStrings
- and make buf1[] and buf2[] more visible for easier debugging.
-
-2006-05-19 YAMAMOTO Mitsuharu <[email protected]>
-
- * frame.c (x_set_border_width): Remove #ifndef MAC_OS.
-
- * image.c [MAC_OS] (gif_load): Allocate Lisp string first.
-
- * macfns.c (Fx_focus_frame): Don't check dpyinfo->x_focus_frame.
-
- * macterm.c (XTread_socket) [TARGET_API_MAC_CARBON && MAC_OSX]:
- Forward keyUp events to toolbox_dispatcher.
-
- * window.c (foreach_window): Check WINDOWP (FRAME_ROOT_WINDOW (f)).
-
-2006-05-18 Jan Dj,Ad(Brv <[email protected]>
-
- * config.in: Regenerated (HAVE_ALSA).
-
- * sound.c (alsa_sound_perror, alsa_open, alsa_period_size)
- (alsa_configure, alsa_close, alsa_choose_format, alsa_write)
- (snd_error_quiet, alsa_init): New functions.
- (vox_init): Return 0 if unable to open device.
- (Fplay_sound_internal): Test for alsa first and use vox (oss) as
- a fallback.
- (struct sound_device): Add period_size.
- (wav_play, au_play): Use period_size if set.
-
- * Makefile.in (CFLAGS_SOUND): New flags for ALSA.
- (ALL_CFLAGS): Add CFLAGS_SOUND.
-
-2006-05-18 Kenichi Handa <[email protected]>
-
- * callproc.c (Fcall_process): Reject encoding arguments by
- ascii-incompatible coding systems (e.g. utf-16).
-
- * coding.c (Qascii_incompatible): New variable.
- (syms_of_coding): Setup Qascii_incompatible.
- (setup_coding_system): Be sure to initialize coding->common_flags.
- Check `ascii-incompatible' property of the coding system.
-
- * coding.h (CODING_ASCII_INCOMPATIBLE_MASK): New macro.
-
-2006-05-18 Kim F. Storm <[email protected]>
-
- * xdisp.c (display_tool_bar_line): Restore entire tool-bar
- geometry when backtracking in case last image doesn't fit on line.
-
-2006-05-18 MIYOSHI Masanori <[email protected]> (tiny change)
-
- * xdisp.c (display_tool_bar_line): Don't adjust tool-bar height by
- more than height of one frame default line.
-
-2006-05-17 Richard Stallman <[email protected]>
-
- * xfaces.c (better_font_p): Any font beats no font.
- (best_matching_font): Simplify based on above change.
-
- * buffer.c (Fprevious_overlay_change, Fnext_overlay_change): Doc fixes.
-
-2006-05-16 Kim F. Storm <[email protected]>
-
- * xterm.c (handle_one_xevent): Check that f is not NULL before
- calling x_kill_gs_process.
-
-2006-05-14 Richard Stallman <[email protected]>
-
- * textprop.c (Fnext_single_char_property_change)
- (Fprevious_single_char_property_change): Don't allow returning
- value beyond LIMIT in any cases.
- (Fnext_char_property_change, Fprevious_char_property_change): Doc fix.
-
- * intervals.c (get_local_map): Abort if POSITION outside BEGV, ZV.
-
-2006-05-14 Jan Dj,Ad(Brv <[email protected]>
-
- * xterm.c (handle_one_xevent): Check that f is not NULL before
- calling _XEditResCheckMessages.
-
-2006-05-14 Kim F. Storm <[email protected]>
-
- * xterm.c (handle_one_xevent): Fix crash in 2006-03-24 change.
-
-2006-05-13 Eli Zaretskii <[email protected]>
-
- * frame.c (x_set_border_width): Fix error message to say "frame",
- not "window".
-
- * Makefile.in (SOME_MACHINE_LISP): Add fringe.elc.
-
-2006-05-12 Chong Yidong <[email protected]>
-
- * intervals.c (set_point_both): Fix mixup before before and after
- in variable names.
-
- * editfns.c (Fline_beginning_position): Inhibit point-motion hooks
- while setting point temporarily.
-
-2006-05-11 Richard Stallman <[email protected]>
-
- * lread.c (readevalloop): Abort if START non-nil for non-buffer input.
-
-2006-05-11 Kim F. Storm <[email protected]>
-
- * xdisp.c (redisplay_tool_bar): Handle large tool-bar-border values.
-
-2006-05-11 Kenichi Handa <[email protected]>
-
- * fileio.c (Finsert_file_contents): Fix for the case of IO error
- while handling replace operation.
-
-2006-05-10 Kenichi Handa <[email protected]>
-
- * xfaces.c (realize_default_face) [HAVE_X_WINDOWS]: If the font
- chosen for the default face was different from the frame font,
- adjust the frame font.
-
-2006-05-10 YAMAMOTO Mitsuharu <[email protected]>
-
- * image.c (Qduration) [MAC_OS]: Undo previous change.
- (syms_of_image) [MAC_OS]: Likewise.
- [MAC_OS] (gif_load): Emulate Graphic Control Extension block.
-
- * macfns.c (x_to_mac_color): Fix shift amount change.
- (mac_set_font) [USE_MAC_FONT_PANEL]: Use x_get_focus_frame.
- [USE_MAC_FONT_PANEL] (Fmac_set_font_panel_visibility): Doc fix.
-
- * macselect.c (Vmac_service_selection) [MAC_OSX]: Rename from
- Vmac_services_selection. All uses changed.
- (mac_store_service_event): Rename from mac_store_services_event in
- extern and calls.
-
- * macterm.c (Qservice) [MAC_OSX]: Rename from Qservices. All uses
- changed.
- [MAC_OSX] (mac_store_service_event): Rename from
- mac_store_services_event. All callers changed.
- [USE_MAC_FONT_PANEL] (mac_set_font_info_for_selection): Add args
- FACE_ID and C. All callers changed.
- (x_free_frame_resources) [USE_MAC_FONT_PANEL]: Call
- mac_set_font_info_for_selection when focus frame is destroyed.
- (XTread_socket): Revert to FrontNonFloatingWindow/FrontWindow.
-
- * macterm.h (mac_set_font_info_for_selection): Add 2nd and 3rd
- args in extern.
-
-2006-05-09 Chong Yidong <[email protected]>
-
- * keymap.c (describe_map): Avoid generating duplicate entries if
- the shadowed binding has the same definition.
-
-2006-05-09 Kenichi Handa <[email protected]>
-
- * keymap.c (push_key_description): Handle invalid character key.
-
-2006-05-08 Kenichi Handa <[email protected]>
-
- * callproc.c (Fcall_process): Use system_eol_type for encoding
- arguments if eol_type is not yet decided.
-
- * coding.h (system_eol_type): Extern it.
-
- * coding.c (setup_coding_system): For invalid coding-system, set
- coding->eol_type to CODING_EOL_UNDECIDED.
- (encode_coding): Cancel previous change.
- (shrink_encoding_region): Likewise.
- (code_convert_region1): Likewise.
- (code_convert_string1): Likewise.
- (code_convert_string_norecord): Likewise.
-
- * fileio.c (choose_write_coding_system): Use system_eol_type for
- encoding if eol_type is not yet decided.
-
- * process.c (setup_process_coding_systems): Use system_eol_type
- for encoding if eol_type is not yet decided.
- (read_process_output): Likewise.
- (send_process): Likewise.
-
-2006-05-07 Juanma Barranquero <[email protected]>
-
- * minibuf.c (syms_of_minibuf) <history-length>: Fix typo in doc.
-
-2006-05-07 YAMAMOTO Mitsuharu <[email protected]>
-
- * mac.c (Fmac_clear_font_name_table): Move defun to macfns.c.
- (syms_of_mac): Likewise for defsubr.
-
- * macfns.c (mac_set_font): New function.
- (mac_frame_parm_handlers, syms_of_macfns): Replace x_set_font with it.
- (mac_window) [TARGET_API_MAC_CARBON && MAC_OSX]: Specify
- kWindowToolbarButtonAttribute when creating window.
- (Fmac_clear_font_name_table): Move from macfns.c.
- (syms_of_macfns): Likewise for defsubr.
- [USE_MAC_FONT_PANEL] (Fmac_set_font_panel_visibility): New defun.
- (syms_of_macfns) [USE_MAC_FONT_PANEL]: Defsubr it.
-
- * macgui.h (USE_MAC_FONT_PANEL): Define to 1 if USE_ATSUI is set
- and build is done on Mac OS X 10.2 and later.
-
- * macselect.c (mac_do_receive_drag): Remove unused variable `index'.
- (mac_store_services_event): Change return type in extern.
-
- * macterm.c (XLoadQueryFont) [USE_ATSUI]: Set font->mac_fontnum to
- FMFontFamily value.
- [USE_MAC_FONT_PANEL] (mac_set_font_info_for_selection): New function.
- (x_new_focus_frame) [USE_MAC_FONT_PANEL]: Use it.
- (QCfamily, QCweight, QCslant, Qnormal, Qbold, Qitalic): Add extern.
- (QWindow) [MAC_OSX]: Likewise.
- (Qfont) [USE_MAC_FONT_PANEL]: Likewise.
- (Vmac_atsu_font_table) [USE_ATSUI]: New variable.
- (syms_of_macterm) [USE_ATSUI]: Defvar it.
- (Qtoolbar_switch_mode) [MAC_OSX]: New variable.
- (Qpanel_closed, Qselection) [USE_MAC_FONT_PANEL]: Likewise.
- (syms_of_macterm): Intern and staticpro them.
- (init_font_name_table) [USE_ATSUI]: Add data to Vmac_atsu_font_table.
- [TARGET_API_MAC_CARBON] (mac_store_event_ref_as_apple_event):
- New function.
- [USE_CARBON_EVENTS] (mac_handle_command_event): Use it.
- [MAC_OSX] (mac_store_services_event): Likewise.
- [USE_CARBON_EVENTS] (mac_handle_window_event) [MAC_OSX]: Handle
- kEventWindowToolbarSwitchMode event.
- (install_window_handler) [USE_CARBON_EVENTS && MAC_OSX]: Register it.
- [MAC_OSX] (mac_store_services_event): Change return type to OSStatus.
- [USE_MAC_FONT_PANEL] (mac_handle_font_event): New function.
- (install_window_handler) [USE_MAC_FONT_PANEL]: Install it.
- (XTread_socket): Select window on mouse click if x_focus_frame is NULL.
-
- * macterm.h (mac_set_font_info_for_selection): Add extern.
-
-2006-05-06 YAMAMOTO Mitsuharu <[email protected]>
-
- * image.c (Qduration) [MAC_OS]: New variable.
- (syms_of_image) [MAC_OS]: Intern and staticpro it.
- [MAC_OS] (gif_load): Save image extension data in img->data.lisp_val.
- [MAC_OSX] (image_load_quartz2d): Use cfstring_create_with_utf8_cstring
- instead of cfstring_create_with_string.
-
-2006-05-06 Kim F. Storm <[email protected]>
-
- * .gdbinit (xframe): Print frame name.
- (xlist): New command to print a list (max 10 elements).
- (xpr): Print lisp object of any type.
- (pitx): Print it->pixel_width.
-
-2006-05-05 Kenichi Handa <[email protected]>
-
- * xdisp.c (handle_composition_prop): Fix for the case of empty
- composition component.
-
-2006-05-05 YAMAMOTO Mitsuharu <[email protected]>
-
- * keyboard.c (make_lispy_event) [MAC_OS]: Get Apple event info
- from event->arg.
-
- * termhooks.h (enum event_kind) [MAC_OS]: Update comment for
- MAC_APPLE_EVENT.
-
- * macterm.h (mac_make_lispy_event_code): Remove extern.
- (mac_post_mouse_moved_event): Add extern.
- (mac_aelist_to_lisp, mac_aedesc_to_lisp): Change arg 1 to
- `const AEDesc *' in externs.
- (create_apple_event_from_drag_ref) [TARGET_API_MAC_CARBON]: New extern.
-
- * mac.c (mac_aelist_to_lisp, mac_aedesc_to_lisp): Change arg 1 to
- `const AEDesc *'.
- [TARGET_API_MAC_CARBON] (create_apple_event): New function.
- [TARGET_API_MAC_CARBON] (create_apple_event_from_event_ref): Use it.
- Use xrealloc instead of repeated xmalloc/xfree.
- [TARGET_API_MAC_CARBON] (create_apple_event_from_drag_ref):
- New function.
-
- * macmenu.c (restore_menu_items, cleanup_popup_menu): Return a value.
-
- * macselect.c: Update copyright year.
- (mac_store_apple_event): Change return type to void in extern.
- (mac_handle_apple_event): Don't get return value from
- mac_store_apple_event.
- [TARGET_API_MAC_CARBON] (Vmac_dnd_known_types): New variable.
- (syms_of_macselect) [TARGET_API_MAC_CARBON]: Defvar it.
- [TARGET_API_MAC_CARBON] (mac_do_track_drag): Move function from
- macterm.c. Use Vmac_dnd_known_types as acceptable flavors.
- [TARGET_API_MAC_CARBON] (mac_do_receive_drag): Likewise. New
- implementation using create_apple_event_from_drag_ref.
- [TARGET_API_MAC_CARBON] (mac_do_track_dragUPP)
- (mac_do_receive_dragUPP): Move variables from macterm.c.
- (install_drag_handler, remove_drag_handler): New functions.
-
- * macterm.c (XTread_socket) [TARGET_API_MAC_CARBON]: Try window
- path select also for proxy icon click.
- [TARGET_API_MAC_CARBON] (mac_post_mouse_moved_event): New function.
- [USE_TOOLKIT_SCROLL_BARS] (scroll_bar_timer_callback): Use it.
- (xlfdpat_create): Remove unused label `error' and trailing sentences.
- (mac_do_track_drag, mac_do_receive_drag): Move functions to macselect.c.
- (mac_do_track_dragUPP, mac_do_receive_dragUPP): Move variables to
- macselect.c.
- (install_drag_handler, remove_drag_handler): Add extern.
- (mac_store_apple_event): Change return type to void. All uses changed.
- Create Lisp object from Apple event and store it into input event.
- (mac_make_lispy_event_code): Remove function.
- [TARGET_API_MAC_CARBON] (mac_store_drag_event): New function.
- (install_window_handler): Call install_drag_handler.
- (remove_window_handler): Call remove_drag_handler.
-
-2006-05-03 Richard Stallman <[email protected]>
-
- * sound.c (Fplay_sound_internal): Dynamically allocate
- current_sound_device and current_sound.
- (sound_cleanup): Free them.
-
- * minibuf.c (read_minibuf): Don't use read_minibuf_noninteractive
- when inside a keyboard macro.
-
-2006-05-02 Andreas Schwab <[email protected]>
-
- * xmenu.c (restore_menu_items): Return a value.
-
-2006-05-01 Martin Rudalics <[email protected]>
-
- * syntax.c (Fforward_comment): Detect generic comment at beginning of
- buffer when moving backwards.
-
-2006-05-01 YAMAMOTO Mitsuharu <[email protected]>
-
- * dispnew.c (update_window): Don't set changed_p when mode/header
- line is updated.
-
- * xdisp.c (prepare_menu_bars) [MAC_OS]: Call mac_update_title_bar.
- (get_glyph_face_and_encoding, get_char_face_and_encoding):
- Don't distinguish known faces from others.
-
- * mac.c (mac_coerce_file_name_ptr): Try typeFSRef if coercion
- through typeFileURL failed.
-
- * macfns.c (mac_update_title_bar): New function.
- [TARGET_API_MAC_CARBON] (mac_update_proxy_icon): New function.
- (show_hourglass, hide_hourglass) [USE_CG_DRAWING]:
- Call mac_prepare_for_quickdraw.
-
- * macgui.h (USE_ATSUI): Set default to 1 if MAC_OSX is defined.
- (USE_CG_DRAWING): Don't define if compiled on Mac OS X 10.1.
- (enum pcm_status): New enum.
- (XCHARSTRUCTROW_CHAR_VALID_P, XCHARSTRUCTROW_SET_CHAR_VALID)
- (XCharStructRow): Remove. Now validity is represented by
- non-negativeness of sum of ascent and descent.
- (struct MacFontStruct): Change type of member `rows'.
- (struct _XGC) [USE_CG_DRAWING]: Add member `clip_rects'.
-
- * macterm.c (mac_draw_line, mac_draw_line_to_pixmap):
- Adjust endpoints of strictly horizontal/vertical lines.
- (mac_set_clip_rectangles) [USE_CG_DRAWING]: Set clip_rects.
- (pcm_init, pcm_get_status): New functions.
- (x_per_char_metric, XLoadQueryFont): Use them instead of
- XCharStructRow and related macros.
- (x_draw_relief_rect): Don't adjust arguments of mac_draw_line.
- (x_free_frame_resources) [TARGET_API_MAC_CARBON]: Free FRAME_FILE_NAME.
- (XTread_socket) [TARGET_API_MAC_CARBON]: Handle proxy icon drag
- and window path pop-up menu on title bar.
- (mac_use_core_graphics) [USE_CG_DRAWING]: Set default to 1.
-
- * macterm.h (mac_update_title_bar): Add extern.
- (struct mac_output) [TARGET_API_MAC_CARBON]: New member `file_name'.
- (FRAME_FILE_NAME): New macro.
-
- * unexmacosx.c (unexec): Error if trying unexec from dumped executable.
-
-2006-04-30 Richard Stallman <[email protected]>
-
- * keymap.c (Fdefine_key): Improve error message
- when KEY begins with a non-prefix key.
-
-2006-04-30 Martin Rudalics <[email protected]>
-
- * syntax.c (Fforward_comment): Don't forget to break out of the loop
- when we skipped backward over a generic comment.
-
-2006-04-27 Nick Roberts <[email protected]>
-
- * .gdbinit (pp1, pv1): Only print value as expression is now
- printed out by gud-print.
- (pv1): Correct doc string.
-
-2006-04-26 Stefan Monnier <[email protected]>
-
- * keymap.c (store_in_keymap): Change `def' arg to not be `register'.
- Seems to trigger a bug in gcc-amd64 4.0.2 20051125 (Red Hat 4.0.2-8):
- keymap.c:895: error: address of register variable `def' requested.
-
-2006-04-26 Jason Rumney <[email protected]>
-
- * w32term.c (construct_mouse_wheel): Handle negative coordinates.
-
- * w32fns.c (w32_wnd_proc) <WM_LBUTTONDOWN, WM_RBUTTONDOWN>:
- <WM_LBUTTONUP, WM_RBUTTONUP>: Call signal_user_input in the cases
- where we preempt mouse_button_timer.
-
-2006-04-25 Miles Bader <[email protected]>
-
- * editfns.c (Ffield_beginning, find_field): Undo change of 2006-04-23.
-
-2006-04-24 Stefan Monnier <[email protected]>
-
- * process.h: Include headers for pid_t.
-
-2006-04-24 Kim F. Storm <[email protected]>
-
- * xdisp.c (fill_stretch_glyph_string): Set s->nchars = 1 for code which
- does last_glyph=s->first_glyph+s->nchars-1, e.g. if stretch has relief.
- (produce_stretch_glyph): Assume that face box height and width is
- already included in stretch glyph size so caller doesn't have to
- consider the extra space otherwise added (fixes problem in ses.el).
-
- * frame.c (x_set_font): Clear f->n_tool_bar_rows and current frame
- matrices to force recalculation of tool-bar height after font change.
-
- * xdisp.c (tool_bar_lines_needed): New local `temp_row' for clarity.
- Clear it when done, so we don't accidentally draw a second copy of
- the tool-bar after resetting f->n_tool_bar_rows.
- (redisplay_tool_bar): Update tool-bar-lines frame parameter whenever
- we recalculate f->n_tool_bar_rows.
-
-2006-04-23 Lars Hansen <[email protected]>
-
- * editfns.c (find_field): Fix comment.
- (Ffield_beginning): Fix bug when POS is at field beginning.
-
-2006-04-22 Eli Zaretskii <[email protected]>
-
- * puresize.h (BASE_PURESIZE): Increase to 1205000.
-
-2006-04-21 Kim F. Storm <[email protected]>
-
- * xdisp.c (redisplay_window): Fix last change. Don't recenter if
- window start is at BEGV.
-
- * dispextern.h (struct image): New member `corners'.
- (TOP_CORNER, LEFT_CORNER, BOT_CORNER, RIGHT_CORNER): New macros.
-
- * image.c (four_corners_best): New arg CORNERS specifies what pixels
- to look at in case image has margin.
- (x_create_bitmap_mask): Pass NULL for CORNERS to four_corners_best.
- (image_background, image_background_transparent)
- (x_build_heuristic_mask): Pass img->corners to four_corners_best.
- (gif_load): Set img->corners according to image's margin spec.
- Use img->corners values directly where applicable.
- Save image extension data in img->data.lisp_val.
- (gif_clear_image): New function to free img->data.lisp_val.
- (gif_type): Use it instead of generic x_clear_image.
- (Fimage_extension_data): New defun.
- (syms_of_image): Defsubr it.
-
-2006-04-21 John Sullivan <[email protected]> (tiny change)
-
- * window.c (Fdisplay_buffer): Doc fix.
-
-2006-04-21 Eli Zaretskii <[email protected]>
-
- * s/ms-w32.h (SYSTEM_PURESIZE_EXTRA): Increase to 25000.
-
-2006-04-21 YAMAMOTO Mitsuharu <[email protected]>
-
- * image.c [MAC_OS] (xpm_load_image): Fill in background field
- while we have ximg handy.
-
- * macmenu.c (restore_menu_items, save_menu_items): New functions
- from xmenu.c.
- (set_frame_menubar, digest_single_submenu): Apply 2006-04-18
- changes for xmenu.c.
-
- * macterm.c (x_per_char_metric): Return NULL if glyph width is 0.
- (add_mac_font_name): New function.
- (init_font_name_table): Use it. Adopt the first found font from
- those having the same family name.
-
-2006-04-21 Nick Roberts <[email protected]>
-
- * xdisp.c (note_mouse_highlight): Use build_string.
-
-2006-04-20 Lars Hansen <[email protected]>
-
- * textprop.c (Fremove_list_of_text_properties):
- Ensure modify_region is called only when buffer is modified and that
- signal_after_change is allways called in that case.
-
- * print.c (PRINTFINISH): Call signal_after_change.
-
-2006-04-20 Kim F. Storm <[email protected]>
-
- * xdisp.c (redisplay_window): Fix last change.
-
- * xdisp.c (redisplay_window): If current window start is not at the
- beginning of a line, select a new window start if buffer is modified
- and window start is in the modified region, but the first change is
- before window start.
-
-2006-04-18 Richard Stallman <[email protected]>
-
- * xmenu.c (restore_menu_items, save_menu_items): New fns.
- (set_frame_menubar): Use save_menu_items. Save updated vector in
- the frame before unwinding it. Don't use unuse_menu_items.
- Don't use discard_menu_items.
- (digest_single_submenu): Abort if an item is not in a pane.
- (init_menu_items): Put the error check at the top.
-
- * keymap.c (describe_map): Make "shadowed" warning more verbose.
-
- * window.c (adjust_window_trailing_edge): Correctly distinguish
- series vs parallel cases, even when window has no parent.
-
- * abbrev.c (record_symbol): New function.
- (Finsert_abbrev_table_description): Sort the abbrevs alphabetically.
-
-2006-04-18 YAMAMOTO Mitsuharu <[email protected]>
-
- * image.c (x_create_bitmap_from_data) [MAC_OS]: Don't check return
- value of xmalloc.
-
- * mac.c (mac_coerce_file_name_ptr, mac_coerce_file_name_desc)
- (create_apple_event_from_event_ref, xrm_get_preference_database)
- (cfstring_create_normalized): Don't check return value of xmalloc.
-
- * macselect.c (get_scrap_target_type_list, defer_apple_events)
- (copy_scrap_flavor_data, mac_handle_service_event): Don't check
- return value of xmalloc/xrealloc.
-
- * macterm.c (XCreateGC, x_per_char_metric, xlfdpat_create)
- (init_font_name_table, init_font_name_table, mac_do_list_fonts)
- (XLoadQueryFont, mac_store_apple_event): Don't check return value
- of xmalloc.
-
-2006-04-17 Kim F. Storm <[email protected]>
-
- * window.c (coordinates_in_window): On the vertical border,
- calculate the row number measured from the top of the window, not
- the top of the frame.
- (window_loop): Test w->dedicated with !NILP instead of EQ Qt.
- (window_scroll_pixel_based): Fix off-by-one bug in 2002-12-23 change.
-
-2006-04-16 Eli Zaretskii <[email protected]>
-
- * s/ms-w32.h (SYSTEM_PURESIZE_EXTRA): Reduce to 24000.
-
-2006-04-16 Romain Francoise <[email protected]>
-
- * puresize.h (BASE_PURESIZE): Decrement back to 1200000.
-
-2006-04-16 Andreas Schwab <[email protected]>
-
- * puresize.h (PURESIZE_RATIO): Reduce to 10/6.
-
-2006-04-15 Romain Francoise <[email protected]>
-
- * puresize.h (BASE_PURESIZE): Increment to 1210000.
-
-2006-04-13 Micha,Ak(Bl Cadilhac <[email protected]>
-
- * print.c (Fprin1_to_string): Mention in the `doc' that the
- behavior is modified by `print-level' and `print-length'.
-
-2006-04-13 Kenichi Handa <[email protected]>
-
- * coding.c (setup_coding_system): If eol-type is not yet decided
- and system_eol_type is not LF, set CODING_REQUIRE_ENCODING_MASK.
- If coding_system is nil, return 0.
- (code_convert_region1): Even if coding_system is nil, don't skip
- conversion if system_eol_type is not LF.
- (code_convert_string1): Likewise.
- (code_convert_string_norecord): Likewise.
-
-2006-04-13 Kenichi Handa <[email protected]>
-
- * coding.c (setup_coding_system): Fix previous change.
- (encode_coding): If eol_type is not yet decided, use system_eol_type.
- (shrink_encoding_region): If eol_type is not yet decided and
- system_eol_type is not LF, don't shrink.
-
-2006-04-13 Nick Roberts <[email protected]>
-
- * xdisp.c (note_mouse_highlight): Add help echo for dragging vertical
- line.
-
-2006-04-12 Richard Stallman <[email protected]>
-
- * keyboard.c (read_key_sequence): Explicitly avoid keybuf[-1].
-
- * process.c (conv_lisp_to_sockaddr): If FAMILY unknown, just return.
- (Fprocess_send_eof): Abort if fail to open null device.
-
-2006-04-12 YAMAMOTO Mitsuharu <[email protected]>
-
- * fns.c [HAVE_MENUS && MAC_OS]: Include macterm.h.
-
- * image.c [MAC_OS] (xpm_load_image): Add parentheses around
- assignment used as truth value. Add explicit braces to avoid
- ambiguous `else'.
- [MAC_OS] (gif_load): Remove unused variable `gcpro1'.
-
- * lisp.h (syms_of_fontset, Fset_fontset_font): Put extern and
- EXFUN in #ifdef HAVE_WINDOW_SYSTEM.
- (syms_of_xfns, syms_of_xsmfns, syms_of_xselect, syms_of_xterm):
- Put externs in #ifdef HAVE_X_WINDOWS.
- (syms_of_macfns, syms_of_macselect, syms_of_macterm)
- (syms_of_macmenu, syms_of_mac) [MAC_OS]: Add externs.
- (init_mac_osx_environment) [MAC_OSX]: Add extern.
-
- * mac.c (init_process): Remove undef.
- (select) [MAC_OSX]: Undefine before including sysselect.h.
- (posix_pathname_to_fsspec, fsspec_to_posix_pathname) [MAC_OSX]:
- Remove functions and prototypes.
- (parse_value): Add parentheses around + inside shift.
- (path_from_vol_dir_name): Make static.
- (get_temp_dir_name): Remove unused variables `cpb' and `dir_name'.
- [!MAC_OSX] (get_path_to_system_folder): Likewise.
- (Fmac_get_file_creator, Fmac_get_file_type): Remove unused
- variable `cCode'.
- (Fmac_coerce_ae_data): Remove unused variables `fref' and `fs'.
- (Fmac_get_preference): Add explicit braces to avoid ambiguous `else'.
-
- * macfns.c (x_to_mac_color): Remove unused variable `tail'.
- (x_set_mouse_color): Remove unused variable `dpy'.
- (Fx_create_frame): Remove unused variable `x_frame_count'.
- (Fx_server_version): Add explicit braces to avoid ambiguous `else'.
- (x_sync): Move from macterm.c.
- (Fx_file_dialog): Remove unused variable `default_filter_index'.
-
- * macmenu.c (min_menu_id): Make element type explicit.
-
- * macselect.c (get_flavor_type_from_symbol): Remove unused
- variable `val'.
- (get_scrap_private_timestamp, x_get_foreign_selection)
- (copy_scrap_flavor_data): Add explicit braces to avoid ambiguous `else'.
- (Fmac_process_deferred_apple_events): Remove unused variables
- `keyword', `reply', `apple_event', `count', and `err'.
-
- * macterm.c: Don't include gnu.h.
- (x_io_error_quitter, x_draw_image_foreground_1): Remove prototypes.
- (x_sync): Move to macfns.c.
- [USE_CG_DRAWING] (mac_define_fringe_bitmap): Remove unused
- variable `mask_bits'.
- (mac_compute_glyph_string_overhangs): Avoid ambiguous `else'.
- (x_draw_image_glyph_string): Remove unused variable `pixmap'.
- (x_mac_to_emacs_modifiers): Remove function.
- (XTset_vertical_scroll_bar, mac_handle_visibility_change)
- (x_make_frame_visible, xlfdpat_create, mac_handle_command_event):
- Add explicit braces to avoid ambiguous `else'.
- (x_make_frame_visible): Remove unused variables `type',
- `original_top', and `original_left'.
- (mac_do_list_fonts, XTread_socket): Add parentheses around && within ||.
- (x_load_font): Remove unused variables `full_name', and `value'.
- (do_get_menus, do_init_managers, do_check_ram_size) [!MAC_OS8]:
- Remove functions.
- (do_zoom_window): Reorganize variables with respect to conditionals.
- (init_command_handler): Remove unused variable `err'.
- [MAC_OSX] (mac_check_bundle): Remove unused variable `child'.
-
- * macterm.h (x_set_mouse_position, x_set_mouse_pixel_position)
- (x_make_frame_invisible, x_iconify_frame, x_free_frame_resources)
- (x_destroy_window, x_wm_set_size_hint, x_delete_display, XFreeGC)
- (do_menu_choice, have_menus_p, x_real_positions)
- (x_set_menu_bar_lines, x_pixel_width, x_pixel_height, x_char_width)
- (x_char_height, x_sync, x_set_tool_bar_lines, x_activate_menubar)
- (free_frame_menubar): Add externs.
-
- * unexmacosx.c: Include config.h before using HAVE_MALLOC_MALLOC_H.
- (malloc, realloc, free): Add undefs.
- (read_load_commands): Remove unused variable `n' and `j'.
- (copy_data_segment): Remove unused variable `r'.
-
- * xdisp.c (get_glyph_string_clip_rects): Add parentheses around &&
- within ||. Add explicit braces to avoid ambiguous `else'.
- (dump_glyph_row): Remove label for `inverse_p' from legend.
-
- * xfaces.c (Finternal_merge_in_global_face, try_font_list):
- Add explicit braces to avoid ambiguous `else'.
-
-2006-04-11 Micha,Ak(Bl Cadilhac <[email protected]>
-
- * dispnew.c (init_display): Don't init X display if the user asked
- for a non-X display.
-
-2006-04-12 Kenichi Handa <[email protected]>
-
- * coding.c (setup_coding_system): Use system_eol_type for default
- coding->eol_type.
-
-2006-04-11 Dan Nicolaescu <[email protected]>
-
- * lisp.h (wrong_type_argument): Mark as NO_RETURN.
-
- * data.c (wrong_type_argument): Try to avoid compiler warnings due
- to the fact the function is now marked as NO_RETURN.
-
-2006-04-10 Eli Zaretskii <[email protected]>
-
- * s/ms-w32.h (pid_t) [_MSC_VER]: New typedef.
-
-2006-04-10 Romain Francoise <[email protected]>
-
- * xrdb.c (gethomedir): Use xstrdup.
-
-2006-04-10 Andreas Schwab <[email protected]>
-
- * xrdb.c (gethomedir): Make sure to always return a pointer that
- can be passed to free.
-
-2006-04-09 Richard Stallman <[email protected]>
-
- * lisp.h (Fkill_emacs): Undo previous change.
-
-2006-04-08 Richard Stallman <[email protected]>
-
- * search.c (boyer_moore): Test ch >= 0400, not >.
-
-2006-04-09 Dan Nicolaescu <[email protected]>
-
- * puresize.h (pure_write_error): Mark as NO_RETURN.
-
- * lisp.h (args_out_of_range, args_out_of_range_3, Fkill_emacs):
- Likewise.
-
-2006-04-08 Eli Zaretskii <[email protected]>
-
- * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Ignore mouse movements
- if a menu is active on this frame.
-
-2006-04-08 Dan Nicolaescu <[email protected]>
-
- * lisp.h (report_file_error): Mark as NO_RETURN.
-
-2006-04-08 Eli Zaretskii <[email protected]>
-
- * alloc.c [STDC_HEADERS]: Include stddef.h.
-
- * lisp.h (PSEUDOVECSIZE): Fix last change.
-
-2006-04-08 Stefan Monnier <[email protected]>
-
- * process.h (struct Lisp_Process): Replace Lisp_Objects `pid',
- `raw_status_high', and `raw_status_low' with plain integers, and move
- them to the end of the structure.
-
- * alloc.c (allocate_process): Use PSEUDOVECSIZE to initialize the
- pseudovector's size field so only the Lisp_Object fields get GC'd.
-
- * process.c (update_status, make_process, Fdelete_process)
- (Fprocess_status, list_processes_1, start_process_unwind)
- (create_process, Fmake_network_process, server_accept_connection)
- (wait_reading_process_output, send_process, Fprocess_running_child_p)
- (process_send_signal, proc_encode_coding_system, Fprocess_send_eof)
- (sigchld_handler, status_notify): Adjust to new non-Lisp fields for
- `pid' and `raw_status'.
- (Fprocess_id, Fsignal_process): Same, and additionally use floats when
- representing PIDs that are larger than most-positive-fixnum.
-
- * keymap.c (describe_map): Only use XINT if we checked INTEGERP.
-
- * lisp.h (OFFSETOF, PSEUDOVECSIZE): New macros.
-
-2006-04-08 Eli Zaretskii <[email protected]>
-
- * w32fns.c (Fx_show_tip): Add 3 to the 5th arg of SetWindowPos.
-
-2006-04-03 Paul Eggert <[email protected]>
-
- * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): New macro, identical to
- ../lib-src/b2m.c and ../lib-src/editfns.c.
- (Fcurrent_time_string): Use it.
- Document that the year might not consume 4 columns if it's outside
- the range 1000-9999.
- Check for asctime failure.
- Don't assume that the output string length is always exactly 24.
-
-2006-04-03 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.c (XTread_socket): Initialize variable `f' before its use.
-
-2006-04-03 Kenichi Handa <[email protected]>
-
- * image.c: Include "charset.h" and "coding.h".
- (x_find_image_file): Return an encoded file name.
-
-2006-04-01 Eli Zaretskii <[email protected]>
-
- * configure: Regenerated.
-
-2006-03-31 Kenichi Handa <[email protected]>
-
- * xfns.c (xg_set_icon): Delete superfluous UNGCPRO.
-
-2006-03-30 Dan Nicolaescu <[email protected]>
-
- * xdisp.c (syms_of_xdisp): Fix variable name.
-
-2006-03-30 Kenichi Handa <[email protected]>
-
- * xterm.c (x_term_init): Delete superfluous UNGCPRO.
-
-2006-03-29 Juanma Barranquero <[email protected]>
-
- * keyboard.c (process_tool_bar_item): Reorder dummy args.
-
-2006-03-29 Stefan Monnier <[email protected]>
-
- * keyboard.c (tool_bar_items): Use map_keymap.
- (process_tool_bar_item): Add dummy args to fit the required interface.
-
-2006-03-25 Eli Zaretskii <[email protected]>
-
- * .gdbinit (pr, pp, pp1, pv, pv1): Force print_output_debug_flag
- to zero before calling debug_print or safe_debug_print.
-
- * print.c (print_output_debug_flag): New global variable.
- (Fexternal_debugging_output) [WINDOWSNT]: Don't call
- OutputDebugString if print_output_debug_flag is zero.
-
-2006-03-24 Paul Eggert <[email protected]>
-
- * editfns.c (TM_YEAR_BASE): Move up, so the changes below can use it.
- (Fdecode_time, Fencode_time): Use TM_YEAR_BASE instead of 1900.
- (Fdecode_time): Cast tm_year to EMACS_INT.
- (Fcurrent_time_string): Report an invalid time specification if
- the argument is invalid. Also, check for out-of-range time stamps.
-
-2006-03-24 Kim F. Storm <[email protected]>
-
- * xterm.c (handle_one_xevent):
- * w32term.c (w32_read_socket):
- * macterm.c (XTread_socket): Don't let key-press clear mouse face
- on in toolbar window if mouse-highlight is an integer.
-
- * fns.c (sxhash_list): Include last non-nil CDR in hash.
-
-2006-03-24 YAMAMOTO Mitsuharu <[email protected]>
-
- * macmenu.c (enum mac_menu_kind): New enum.
- (min_menu_id): New variable.
- (POPUP_SUBMENU_ID, MIN_POPUP_SUBMENU_ID, MIN_MENU_ID)
- (MIN_SUBMENU_ID): Remove defines. All uses are replaced with
- min_menu_id and enumerators in enum mac_menu_kind.
- (fill_menu, dispose_menus, install_menu_quit_handler): New arg KIND.
- All uses changed. Add range check for menu ID.
- (fill_menubar): Add range check for menu ID.
- [HAVE_CANCELMENUTRACKING] (menu_quit_handler): Check error code of
- GetEventParameter.
- (set_frame_menubar, mac_menu_show): Call install_menu_quit_handler
- for each menu kind.
-
-2006-03-22 Kim F. Storm <[email protected]>
-
- * xdisp.c: Undo 2006-03-21 change.
-
- * term.c: Define aliases for append_glyph and produce_stretch_glyph
- when `static' is defined to avoid name clash with those in xdisp.c.
-
- * process.c (Faccept_process_output): Fix to comply with lisp
- reference. Change arg "timeout" to "seconds" and allow both
- integer and float value. Change arg "timeout-msec" to "millisec"
- and interpret" as milliseconds rather than microseconds. Fix doc
- string accordingly.
-
-2006-03-21 Ken Raeburn <[email protected]>
-
- * xdisp.c (store_next_glyph): Rename from append_glyph.
- (generate_stretch_glyph): Rename from produce_stretch_glyph.
- All callers changed accordingly.
-
-2006-03-21 Jan Dj,Ad(Brv <[email protected]>
-
- * xterm.c: x_session_initialized new variable.
- (x_term_init): Use x_session_initialized to check if
- x_session_initialize should be called.
- (x_initialize): Initialize x_session_initialized.
-
-2006-03-21 Kim F. Storm <[email protected]>
-
- * fringe.c (draw_fringe_bitmap): Don't calculate default overlay arrow
- bitmap here, but ...
- (update_window_fringes): ... here, so we can test if it has changed.
-
-2006-03-20 Andreas Schwab <[email protected]>
-
- * dispnew.c (init_display): Check DISPLAY here.
-
- * emacs.c (main): Don't check here.
-
- * xterm.c (x_display_ok): Don't use DISPLAY env var.
-
-2006-03-20 Stefan Monnier <[email protected]>
-
- * window.c (window_scroll_pixel_based): Yet another int/Lisp_Object
- mixup (YAILOM).
-
-2006-03-20 Eli Zaretskii <[email protected]>
-
- * emacs.c (main): Fix last change.
-
-2006-03-20 Kenichi Handa <[email protected]>
-
- * fileio.c (Fwrite_region): Set visit_file to Qnil before GCPRO it.
-
- * keymap.c (map_keymap): Set tail to Qnil before GCPRO it.
-
- * xfns.c (xg_set_icon): Remove unnecessary GCPRO.
-
- * xterm.c (x_term_init): Remove unnecessary GCPRO.
-
-2006-03-19 Kim F. Storm <[email protected]>
-
- * xdisp.c (set_cursor_from_row): Fix cursor property on overlay string,
- so it doesn't associate overlay string with following glyph by default.
- Allow integer property value to specify explicit number of buffer
- positions associate with overlay string.
-
-2006-03-18 Chong Yidong <[email protected]>
-
- * xterm.c (x_display_ok): Fix minor bug and compilation warnings.
-
-2006-03-18 Nozomu Ando <[email protected]>
-
- * m/pmax.h (BROKEN_NOCOMBRELOC) [__NetBSD__]: Define.
- (LIB_STANDARD, START_FILES) [__NetBSD__]: Don't define.
- (START_FILES, RUN_TIME_REMAP, UNEXEC) [__NetBSD__, __OpenBSD__]:
- Don't redefine.
-
- * m/mips.h: Don't use unexmips on NetBSD.
- (LIBS_MACHINE): Move definition lower, so it doesn't use
- LD_SWITCH_MACHINE, START_FILES, LIB_STANDARD, LIBS_TERMCAP,
- C_SWITCH_MACHINE, and C_DEBUG_SWITCH.
-
- * unexelf.c [BROKEN_NOCOMBRELOC]: Include assert.h.
- (unexec) [BROKEN_NOCOMBRELOC]: Handle platforms whose nocombreloc
- option is broken (e.g., MIPS/NetBSD).
-
-2006-03-18 Craig McDaniel <[email protected]> (tiny change)
-
- * sheap.c (STATIC_HEAP_SIZE): Enlarge STATIC_HEAP_SIZE to 12MB.
- Remove the HAVE_X_WINDOWS conditional.
-
-2006-03-18 Vivek Dasmohapatra <[email protected]> (tiny change)
-
- * emacs.c (main): If user asks for a display that is unavailable,
- simulate -nw.
-
- * xterm.c (x_display_ok): New function.
-
- * xterm.h: Add prototype for x_display_ok.
-
-2006-03-18 Eli Zaretskii <[email protected]>
-
- * w32fns.c (Fw32_select_font): Doc fix.
-
-2006-03-16 YAMAMOTO Mitsuharu <[email protected]>
-
- * image.c [MAC_OS] (XPutPixel, XGetPixel)
- [!WORDS_BIG_ENDIAN && USE_CG_DRAWING]: Don't use specialized
- version when depth is 32.
- (mac_create_cg_image_from_image) [MAC_OS && USE_CG_DRAWING]:
- New function.
- (prepare_image_for_display) [MAC_OS && USE_CG_DRAWING]: Use it.
- (x_clear_image_1) [MAC_OS && USE_CG_DRAWING]: Release CGImage.
-
- * macterm.c (XCreatePixmap) [!WORDS_BIG_ENDIAN && USE_CG_DRAWING]:
- Create GWorld in ARGB pixel format.
- (mac_copy_area, mac_copy_area_with_mask) [USE_CG_DRAWING]:
- Remove functions.
- (x_draw_image_foreground) [USE_CG_DRAWING]: Use mac_draw_cg_image
- instead of mac_copy_area/mac_copy_area_with_mask.
-
-2006-03-15 Kim F. Storm <[email protected]>
-
- * xdisp.c (extend_face_to_end_of_line): Always add space glyph to
- empty row. Fixes memory corruption revealed by 2006-03-02 change.
- (display_tool_bar_line): Skip empty tool-bar line if HEIGHT < 0.
- (tool_bar_lines_needed): Fix tool-bar display in case the tool-bar
- width is exactly the same as the window width. Don't count a final
- empty tool-bar line (pass HEIGHT = -1 to display_tool_bar_line).
-
-2006-03-15 Juanma Barranquero <[email protected]>
-
- * fringe.c (w32_init_fringe, w32_reset_fringes): Revert to being
- conditional on HAVE_NTGUI, not WINDOWS_NT.
-
-2006-03-15 YAMAMOTO Mitsuharu <[email protected]>
-
- * dispextern.h (mac_init_fringe) [MAC_OS]: Add prototype.
-
- * fringe.c (mac_init_fringe) [MAC_OS]: New function.
-
- * macterm.c (mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
- (max_fringe_bmp, fringe_bmp) [USE_CG_DRAWING]: New variables.
- (mac_define_fringe_bitmap, mac_destroy_fringe_bitmap)
- (mac_draw_cg_image) [USE_CG_DRAWING]: New functions.
- (mac_draw_bitmap) [USE_CG_DRAWING]: Remove function.
- (x_draw_fringe_bitmap) [USE_CG_DRAWING]: Use mac_draw_cg_image
- instead of mac_draw_bitmap.
- (x_redisplay_interface) [USE_CG_DRAWING]: Set handlers for
- define_fringe_bitmap and destroy_fringe_bitmap.
-
-2006-03-14 Chong Yidong <[email protected]>
-
- * xterm.c (x_uncatch_errors): Block input for entire function.
-
-2006-03-12 Jason Rumney <[email protected]>
-
- * w32fns.c (Fx_create_frame): Remove call to
- Qface_set_after_frame_default (from xfns.c 2003-05-26).
-
- * w32menu.c (Fx_popup_menu): Call w32_free_menu_strings when
- finished with the menu.
-
- * w32term.c: Sync 2005-10-24 xterm.c changes.
- (last_mouse_glyph_frame): New var.
- (note_mouse_movement): Say mouse moved if current frame differs
- from last_mouse_glyph_frame, and update last_mouse_glyph_frame.
- (w32_mouse_position): Set last_mouse_glyph_frame.
- Remove OLD_REDISPLAY_CODE block.
-
-2006-03-12 YAMAMOTO Mitsuharu <[email protected]>
-
- * macgui.h [USE_ATSUI && MAC_OSX]: Define USE_CG_TEXT_DRAWING to 1.
-
- * macterm.h (struct mac_output) [USE_CG_DRAWING]: New member cg_context.
- (mac_prepare_for_quickdraw) [USE_CG_DRAWING]: Add prototype.
-
- * mac.c (sys_select) [USE_CG_DRAWING]: Call mac_prepare_for_quickdraw.
-
- * macfns.c (x_create_tip_frame): Apply 2006-03-11 change for xfns.c.
-
- * macterm.c (mac_draw_rectangle, x_draw_glyph_string_foreground)
- (x_draw_composite_glyph_string_foreground)
- (x_draw_image_foreground): Undo previous changes.
- (x_draw_hollow_cursor): Likewise. Subtract 1 from the last
- argument of mac_draw_rectangle.
- (CG_SET_FILL_COLOR, CG_SET_STROKE_COLOR): New macros.
- (mac_draw_string_common, mac_draw_image_string_cg): Use them.
- (FRAME_CG_CONTEXT) [USE_CG_DRAWING]: New macro.
- (mac_begin_cg_clip, mac_end_cg_clip, mac_prepare_for_quickdraw)
- [USE_CG_DRAWING]: New functions.
- (mac_draw_line, mac_erase_rectangle, mac_clear_window)
- (mac_fill_rectangle, mac_draw_rectangle, mac_draw_string_common)
- (mac_draw_image_string_cg) [USE_CG_DRAWING]: Add Quartz 2D drawing part.
- (mac_draw_bitmap, mac_invert_rectangle, mac_draw_string_common)
- (mac_copy_area, mac_scroll_area, x_scroll_bar_create)
- (x_scroll_bar_remove, XTset_vertical_scroll_bar, x_set_window_size)
- (XTread_socket) [USE_CG_DRAWING]: Call mac_prepare_for_quickdraw.
-
-2006-03-12 L$,1 q(Brentey K,Aa(Broly <[email protected]>
-
- * xfns.c (x_icon): Disable redundant call to `x_wm_set_window_state'.
-
-2006-03-11 Jason Rumney <[email protected]>
-
- * w32fns.c (signal_user_input): New function.
- (post_character_message): Use it for keyboard input.
- (w32_msg_pump): Use it for mouse input.
-
-2006-03-11 Luc Teirlinck <[email protected]>
-
- * window.c: Rename preserve_y to window_scroll_pixel_based_preserve_y.
- (window_scroll_pixel_based, syms_of_window): Adapt to above change.
-
-2006-03-11 Eli Zaretskii <[email protected]>
-
- * w32fns.c (w32_wnd_proc): Ignore middle and extra button events
- if a menu is already active (the menubar_active flag is on).
-
-2006-03-11 David Ponce <[email protected]>
-
- * xfns.c (x_create_tip_frame): Preserve received parms by copying them.
-
-2006-03-11 Eli Zaretskii <[email protected]>
-
- * w32term.c: Add x_fully_uncatch_errors and x_catching_errors to
- the list of unused display error handling functions.
-
- * eval.c (unwind_to_catch): Call x_fully_uncatch_errors only if
- HAVE_X_WINDOWS.
- (internal_condition_case, internal_condition_case_1)
- (internal_condition_case_2): Call x_catching_errors only if
- HAVE_X_WINDOWS.
-
- * vm-limit.c [HAVE_GETRLIMIT]: Don't define unconditionally.
- Don't include sys/resource.h unless defined.
-
-2006-03-11 Richard Stallman <[email protected]>
-
- * keymap.c (describe_map): Shorten string to indicate shadowed binding.
-
- * vm-limit.c (get_lim_data, lim_data, data_space_start):
- Move from mem-limits.h.
- (enum warnlevel): New data type.
- (check_memory_limits): Rewrite the logic about warnings.
- Use standard `struct rlimit'. Check return values for nonsense.
- (memory_warnings): Always clear lim_data.
-
- * mem-limits.h (get_lim_data, lim_data, data_space_start):
- Move to vm-limit.c.
-
- * xterm.c (x_fully_uncatch_errors, x_catching_errors): New functions.
-
- * eval.c (unwind_to_catch): Call x_fully_uncatch_errors.
- (internal_condition_case_1, internal_condition_case_2):
- Abort if within unclosed x_catch_errors.
-
-2006-03-11 Romain Francoise <[email protected]>
-
- * process.c (Vprocess_adaptive_read_buffering): Doc fix.
-
-2006-03-11 Giorgos Keramidas <[email protected]> (tiny change)
-
- * lisp.h: Remove duplicate prototypes. Make the prototype of
- getloadavg be conditioned on HAVE_GETLOADAVG being undefined.
-
-2006-03-11 Eli Zaretskii <[email protected]>
-
- * xterm.c (x_draw_hollow_cursor): Subtract 1 from the last
- argument of XDrawRectangle.
-
- * xdisp.c (get_phys_cursor_geometry): Don't decrease height by 1.
-
- * macterm.c (mac_draw_rectangle): Don't add 1 to width and height.
- (x_draw_glyph_string_foreground)
- (x_draw_composite_glyph_string_foreground)
- (x_draw_image_foreground): Don't subtract 1 from width and height
- arguments to mac_draw_rectangle.
- (x_draw_hollow_cursor): Add 1 to w->phys_cursor_width.
-
-2006-03-10 Kim F. Storm <[email protected]>
-
- * alloc.c (USE_POSIX_MEMALIGN): Fix last change.
-
-2006-03-09 Stefan Monnier <[email protected]>
-
- * alloc.c (USE_POSIX_MEMALIGN): New macro.
- (ABLOCKS_BASE, lisp_align_malloc, lisp_align_free): Use it.
-
-2006-03-09 Kenichi Handa <[email protected]>
-
- * coding.c (DECODE_EMACS_MULE_COMPOSITION_CHAR): Fix decoding
- ASCII component of a composition.
-
-2006-03-08 Luc Teirlinck <[email protected]>
-
- * window.c: Declare preserve_y as a static global variable.
- (window_scroll_pixel_based): No longer declare preserve_y;
- it is global now.
- (syms_of_window): Set preserve_y to -1.
-
-2006-03-08 YAMAMOTO Mitsuharu <[email protected]>
-
- * image.c [MAC_OS] (XPutPixel): Set alpha channel bits if pixmap
- depth is 32.
- [MAC_OS] (XGetPixel): Strip off alpha channel bits if pixmap
- depth is 32.
-
-2006-03-06 Chong Yidong <[email protected]>
-
- * xdisp.c (handle_invisible_prop): Don't update it->position with
- a buffer position if we're in a display string.
-
-2006-03-06 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.h (MAC_AQUA_VERTICAL_SCROLL_BAR_WIDTH)
- (MAC_AQUA_SMALL_VERTICAL_SCROLL_BAR_WIDTH): New defines.
-
- * macfns.c (x_default_scroll_bar_color_parameter)
- (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
- Remove unnecessary prototypes.
- (x_set_scroll_bar_default_width):
- Use MAC_AQUA_VERTICAL_SCROLL_BAR_WIDTH.
- (mac_set_scroll_bar_width): New function.
- (mac_frame_parm_handlers): Set it as handler for scroll-bar-width.
-
- * macterm.c (get_control_part_bounds): Fix type of return value.
- (x_set_toolkit_scroll_bar_thumb, x_scroll_bar_create)
- (XTset_vertical_scroll_bar) [USE_TOOLKIT_SCROLL_BARS]: Don't show
- scroll bar if it is not tall enough to display scroll bar thumb.
- [USE_CARBON_EVENTS] (mac_convert_event_ref)
- (mac_handle_command_event, mac_handle_window_event)
- (mac_handle_mouse_event): Check error code of GetEventParameter.
- (convert_fn_keycode) [MAC_OSX]: Likewise.
-
-2006-03-05 Andreas Schwab <[email protected]>
-
- * xselect.c (x_catch_errors_unwind): Fix missing return value.
-
-2006-03-02 Kim F. Storm <[email protected]>
-
- * frame.h (struct frame): New member n_tool_bar_rows.
-
- * xdisp.c: Minimize the unpleasent visual impact of the requirement
- that non-toolkit tool-bars must occupy an integral number of screen
- lines, by distributing the rows evenly over the tool-bar screen area.
- (Vtool_bar_border): New variable.
- (syms_of_xdisp): DEFVAR_LISP it.
- (display_tool_bar_line): Add HEIGHT arg for desired row height.
- Make tool-bar row the desired height. Use default face for border
- below tool-bar.
- (tool_bar_lines_needed): Add N_ROWS arg. Use it to return number of
- actual tool-bar rows.
- (redisplay_tool_bar): Calculate f->n_tool_bar_rows initially.
- Adjust the height of the tool-bar rows to fill tool-bar screen area.
- (redisplay_tool_bar): Calculate f->n_tool_bar_rows when tool-bar area
- is resized.
-
-2006-03-01 Luc Teirlinck <[email protected]>
-
- * search.c (Fregexp_quote): Do not precede a literal `]' with two
- backslashes to try to make clear that it has a literal meaning; it
- does not do that. (It could close a character alternative
- containing a backslash.)
-
-2006-02-28 Chong Yidong <[email protected]>
-
- * xselect.c (x_catch_errors_unwind): New function.
- (x_reply_selection_request): Put x_uncatch_errors in an unwind.
- (Fx_get_atom_name): Call x_uncatch_errors earlier.
-
- * window.c (Qscroll_up, Qscroll_down): New syms.
- (window_scroll_pixel_based): Make preserve_y static to avoid
- getting point stuck when scrolling 1 line.
-
-2006-02-26 Chong Yidong <[email protected]>
-
- * xterm.h, xterm.c (x_uncatch_errors): Delete unneccessary argument.
-
- * xterm.c (x_load_font, x_term_init, XTmouse_position)
- (handle_one_xevent, x_connection_closed, x_list_fonts):
- No arg for x_uncatch_errors.
-
- * xselect.c (x_own_selection, x_decline_selection_request)
- (x_reply_selection_request, x_get_foreign_selection)
- (Fx_get_atom_name, Fx_send_client_event): Likewise.
-
- * xfns.c (x_real_positions, x_set_mouse_color, Fx_focus_frame):
- Likewise.
-
-2006-02-26 Luc Teirlinck <[email protected]>
-
- * lread.c: Declare Vload_file_rep_suffixes instead of
- deleted variable default_suffixes.
- (Fget_load_suffixes): New function.
- (Fload): Use Fget_load_suffixes and Vload_file_rep_suffixes.
- No longer use deleted variable default_suffixes. Update docstring.
- (syms_of_lread): defsubr Sget_load_suffixes.
- Expand `load-suffixes' docstring.
- Delete default_suffixes and DEFVAR_LISP the new variable
- `load-file-rep-suffixes'.
-
- * w32.c (check_windows_init_file): Use Fget_load_suffixes instead
- of Vload_suffixes.
-
- * lisp.h: EXFUN Fget_load_suffixes.
- Extern Vload_file_rep_suffixes.
-
- * eval.c (specpdl_ptr): Remove volatile qualifier for consistency
- with lisp.h.
-
-2006-02-26 Stefan Monnier <[email protected]>
-
- * lisp.h (struct specbinding, specpdl_ptr): Remove the volatile
- qualifier which was trying to avoid the bug that was fixed by
- yesterday's changes to xterm.c.
-
-2006-02-25 Chong Yidong <[email protected]>
-
- * xterm.h (x_catch_errors) Return value changed to void.
- (x_uncatch_errors): Delete unused count argument.
-
- * xterm.c (x_catch_errors): Don't use record_unwind_protect, since
- it can be called in a signal handler.
- (x_catch_errors_unwind): Function deleted.
- (x_uncatch_errors): Deallocate last x_error_message_stack struct.
- (x_check_errors): Call x_uncatch_errors before signalling error.
-
- (x_load_font, x_term_init, XTmouse_position, handle_one_xevent)
- (x_connection_closed, x_list_fonts): Use new versions of
- x_catch_errors and x_uncatch_errors.
-
- * xselect.c (x_own_selection, x_decline_selection_request)
- (x_reply_selection_request, x_get_foreign_selection)
- (Fx_get_atom_name, Fx_send_client_event): Likewise.
-
- * xfns.c (x_real_positions, x_set_mouse_color, Fx_focus_frame):
- Likewise.
-
- * eval.c (record_unwind_protect): Add an assertion.
-
-2006-02-25 Stefan Monnier <[email protected]>
-
- * process.c (Fmake_network_process): Init the process's mark.
-
-2006-02-25 Kim F. Storm <[email protected]>
-
- * buffer.c (modify_overlay): Force redisplay if we modify an
- overlay at the end of the buffer.
-
-2006-02-24 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (xg_get_image_for_pixmap): If x_find_image_file returns
- nil the image file has been removed, in that case use the (cached)
- pixmap.
-
-2006-02-24 Kenichi Handa <[email protected]>
-
- * fileio.c (Finsert_file_contents): When a text is replaced
- partially, be sure to set point before the inserted characters.
-
-2006-02-23 Zhang Wei <[email protected]> (tiny change)
-
- * xfns.c (Fx_file_dialog): Return a decoded file name.
-
-2006-02-23 YAMAMOTO Mitsuharu <[email protected]>
-
- * dispnew.c (update_text_area): Avoid needless redraw of rightmost
- glyph whose face is extended to the text area end.
-
- * macterm.c (x_set_toolkit_scroll_bar_thumb): Don't set control
- values if control is not visible or values are not changed.
-
-2006-02-22 Stefan Monnier <[email protected]>
-
- * window.c (Fwindow_list): Check `window' before doing XWINDOW.
- The default `window' should not be "on a different frame".
-
-2006-02-22 Kim F. Storm <[email protected]>
-
- * indent.c (Fvertical_motion): Only try to move back if we can.
-
-2006-02-22 YAMAMOTO Mitsuharu <[email protected]>
-
- * macgui.h (struct _XGC) [!MAC_OSX || !USE_ATSUI]: New member
- n_clip_rects.
-
- * macmenu.c (digest_single_submenu): Apply 2006-02-19 change for
- xmenu.c.
-
- * macterm.c (GC_CLIP_REGION): Remove macro.
- (mac_begin_clip, mac_end_clip): Take arg GC instead of REGION.
- All uses changed. Don't do clipping if n_clip_rects is zero.
- (mac_set_clip_rectangles): Use xassert instead of abort.
- Set n_clip_rects. Don't make clip_region empty when number of
- clipping rectangles is zero.
- (mac_reset_clip_rectangles): Set n_clip_rects directly instead of
- calling mac_set_clip_rectangles.
- (x_set_toolkit_scroll_bar_thumb): Temporarily hide scroll bar to
- avoid multiple redraws.
-
-2006-02-22 Kim F. Storm <[email protected]>
-
- * fringe.c (draw_fringe_bitmap): Fix overlay-arrow display.
-
-2006-02-21 Kim F. Storm <[email protected]>
-
- * fringe.c (syms_of_fringe) <fringe-bitmaps>: Doc fix.
-
-2006-02-21 Zhang Wei <[email protected]>
-
- * xfns.c (Fx_file_dialog, Motif and GTK): DECODE_FILE before
- returning it.
-
-2006-02-21 Giorgos Keramidas <[email protected]> (tiny change)
-
- * fringe.c (horizontal_bar_bits): Rename from `horisontal_bar_bits'.
- (standard_bitmaps): Use it.
-
-2006-02-21 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.c (mac_draw_string_common): Remove arg MODE. New arg
- BG_WIDTH. All uses changed. Draw background if BG_WIDTH is not zero.
- (mac_draw_image_string, mac_draw_image_string_16): New arg BG_WIDTH.
- [USE_CG_TEXT_DRAWING] (mac_draw_image_string_cg): Rename from
- mac_draw_string_cg. New arg BG_WIDTH. All uses changed.
- Draw background if BG_WIDTH is not zero. Use float constants as
- divisors instead of double. Use alloca instead of xmalloc/xfree.
- (x_draw_glyph_string_background, x_draw_glyph_string_foreground)
- [!MAC_OS8 || USE_ATSUI]: Background may be drawn using
- mac_draw_image_string* functions.
- (XLoadQueryFont) [MAC_OS8 && USE_ATSUI]: Don't adjust heights of
- some fonts when srcCopy text transfer mode might be used.
- (mac_begin_clip, mac_end_clip): Check if region is empty.
- (mac_set_clip_rectangles): When resetting clip region, make it
- empty instead of disposing of it.
-
-2006-02-20 Kim F. Storm <[email protected]>
-
- * Makefile.in: Add fringe.elc to WINDOW_SUPPORT.
-
- * buffer.h (struct buffer): New members fringe_indicator_alist and
- fringe_cursor_alist.
-
- * buffer.c (init_buffer_once): Set dummy default values for
- fringe-indicator-alist and fringe-cursor-alist. The proper
- default values are set by pre-loading fringe.el.
- (syms_of_buffer): defvar_per_buffer new fringe-indicator-alist and
- fringe-cursor-alist buffer-local variables and defvar_lisp_nopro
- corresponding default- variables.
-
- * fringe.c (enum fringe_bitmap_type): Remove. Change all uses
- to use `int'.
- (NO_FRINGE_BITMAP, UNDEF_FRINGE_BITMAP, MAX_STANDARD_FRINGE_BITMAPS):
- Define explicitly.
- (Qtruncation, Qcontinuation, Qempty_line, Qtop_bottom)
- (Qhollow_small): New variables.
- (syms_of_fringe): Intern and staticpro them.
- (question_mark_bits): Rename from unknown_bits.
- (left_curly_arrow_bits): Rename from continuation_bits.
- (right_curly_arrow_bits): Rename from continued_bits.
- (left_triangle_bits): Rename from ov_bits.
- (right_triangle_bits): Add.
- (filled_rectangle_bits): Rename from filled_box_cursor_bits.
- (hollow_rectangle_bits): Rename from hollow_box_cursor_bits.
- (filled_square_bits): Add.
- (vertical_bar_bits): Rename from bar_cursor_bits.
- (horizontal_bar_bits): Rename from hbar_cursor_bits.
- (empty_line_bits): Rename from zv_bits.
- (standard_bitmaps): Update to use new names.
- (draw_fringe_bitmap_1): Make static.
- (get_logical_cursor_bitmap, get_logical_fringe_bitmap): New functions
- to map from logical cursors and indicators to physical bitmaps.
- (draw_fringe_bitmap): Resolve fringe cursor and overlay-arrow
- bitmaps using symbol names instead of bitmap numbers.
- (update_window_fringes): Use logical indicator symbol names
- instead of bitmap numbers for logical. Add bitmap cache.
- (LEFT_FRINGE, RIGHT_FRINGE): New helper macros.
-
-2006-02-20 Chong Yidong <[email protected]>
-
- * regex.c: Revert 2006-02-19 change.
- (xmalloc, xrealloc): Define these when not linked to Emacs.
- Redefine malloc -> xmalloc, realloc -> xrealloc as in Emacs case.
-
-2006-02-19 Luc Teirlinck <[email protected]>
-
- * regex.c (extend_range_table_work_area): Fix typo.
-
-2006-02-19 Richard M. Stallman <[email protected]>
-
- * xterm.c (x_catch_errors): Use xmalloc.
-
- * regex.c (extend_range_table_work_area): Call xmalloc and xrealloc.
- (regex_compile): Likewise.
- (regcomp): Use xmalloc.
-
- * gtkutil.c (malloc_widget_value): Use xmalloc.
-
- * vm-limit.c [HAVE_GETRLIMIT]: Include sys/resource.h.
- (check_memory_limits) [HAVE_GETRLIMIT]: Use getrlimit.
-
- * xmenu.c (digest_single_submenu): When pane_string is empty,
- do initialize save_wv.
-
-2006-02-19 YAMAMOTO Mitsuharu <[email protected]>
-
- * xdisp.c (update_menu_bar) [MAC_OS]: Don't set
- w->update_mode_line if arg F is not the selected frame.
-
- * macmenu.c (popup_activated_flag, submenu_id)
- (next_menubar_widget_id): Remove variables.
- (initialize_frame_menubar): Remove function.
- (pop_down_menu, mac_menu_show): Simplify save value.
- (dispose_menus): New function.
- (pop_down_menu, fill_menubar): Use it.
- (fill_submenu): Remove function. All uses changed to fill_menu.
- (add_menu_item): Remove args SUBMENU and FORCE_DISABLE. New arg
- POS. Don't call SetMenuItemHierarchicalID here.
- (fill_menu): Add arg SUBMENU_ID. Return submenu_id that is to be
- used next. Call SetMenuItemHierarchicalID here.
- (fill_menubar): Add arg DEEP_P. All uses changed. Clean up menu
- objects if needed. Reuse existing menu bar titles if possible.
- (set_frame_menubar): Don't clean up menu objects here.
-
-2006-02-18 Chong Yidong <[email protected]>
-
- * window.c (window_min_size_1): Ensure room for the scroll bar and
- fringes.
-
-2006-02-17 Romain Francoise <[email protected]>
-
- * puresize.h (BASE_PURESIZE): Increment to 1200000.
-
-2006-02-17 Stefan Monnier <[email protected]>
-
- * alloc.c (Fmake_symbol): Comment-out left-over assert from before the
- addition of the BLOCK_INPUTs.
-
-2006-02-17 Juanma Barranquero <[email protected]>
-
- * window.c (Fset_window_scroll_bars): Doc fix.
-
-2006-02-17 Kenichi Handa <[email protected]>
-
- * xdisp.c (display_mode_element): Call display_string with correct
- PREC arg (which must be a number of characters, not column width).
-
-2006-02-15 YAMAMOTO Mitsuharu <[email protected]>
-
- * frame.c (x_get_arg): Clear out PARAM in ALIST also on Mac.
-
- * macfns.c (x_set_menu_bar_lines): Menu bar is always shown on Mac.
-
- * macmenu.c (set_frame_menubar): Don't call DrawMenuBar.
-
-2006-02-14 Richard M. Stallman <[email protected]>
-
- * frame.c (x_get_arg): Clear out all occurrences of PARAM in ALIST.
-
- * m/ibms390x.h: New file.
-
-2006-02-14 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (xg_tool_bar_detach_callback): Set show-arrow to the
- value of x-gtk-whole-detached-tool-bar.
- (xg_tool_bar_attach_callback): Set show-arrow to TRUE.
-
- * xfns.c (syms_of_xfns): New variable: x-gtk-whole-detached-tool-bar.
-
-2006-02-14 Jan Dj,Ad(Brv <[email protected]>
-
- * xterm.c (x_x_to_emacs_modifiers): Make non-static.
-
- * xterm.h: Declare x_x_to_emacs_modifiers.
-
- * gtkutil.c (xg_tool_bar_button_cb): New function.
- (xg_tool_bar_callback): Call x_x_to_emacs_modifiers to
- store modifiers in event.
- (update_frame_tool_bar): Connect button-release-event to
- xg_tool_bar_button_cb.
-
-2006-02-13 Richard M. Stallman <[email protected]>
-
- * .gdbinit (xwindow): Update the code to show the window box.
-
-2006-02-13 Jan Dj,Ad(Brv <[email protected]>
-
- * xterm.c (note_mouse_movement): Check for NULL FRAME_X_OUTPUT (frame).
-
-2006-02-12 Richard M. Stallman <[email protected]>
-
- * cmds.c (internal_self_insert): Handle weird auto-fill-function.
-
-2006-02-11 Eli Zaretskii <[email protected]>
-
- * keyboard.c (Venable_disabled_menus_and_buttons): New variable.
- (syms_of_keyboard): DEVFAR_LISP and initialize it.
- (parse_tool_bar_item, parse_menu_item): If that variable is
- non-nil, don't disable menu items and tool-bar buttons.
-
-2006-02-11 Juanma Barranquero <[email protected]>
-
- * doc.c (Fsubstitute_command_keys): Doc fix.
-
-2006-02-10 Thien-Thi Nguyen <[email protected]>
-
- * data.c (Findirect_function): Rewrite docstring.
- Fix omission bug: Declare new arg NOERROR.
-
-2006-02-10 YAMAMOTO Mitsuharu <[email protected]>
-
- * macfns.c (x_set_mouse_color): Don't call rif->define_frame_cursor
- if window_desc is not set yet.
- (Fx_create_frame): Remove variable x_frame_name. Apply 2005-12-07
- and 2006-01-26 changes for xfns.c. Call x_iconify_frame if frame
- parameter `visibility' is `icon'.
- (Fx_create_frame, x_create_tip_frame): Use "fontset-standard"
- instead of "fontset-mac".
- (Fx_focus_frame): New defun.
- (syms_of_macfns): Defsubr it.
-
- * macterm.c (mac_define_frame_cursor): Don't change pointer shape
- for unfocused frame.
- (x_raise_frame): Call BringToFront instead of SelectWindow.
- (x_lower_frame): Use NULL instead of nil.
- (x_make_frame_visible): Don't call SelectWindow.
- (XTread_socket): Increment handling_signal at the start, decrement
- it at the end.
- [USE_CG_TEXT_DRAWING] (init_cg_text_anti_aliasing_threshold): Use
- CFPreferencesGetAppIntegerValue instead of Fmac_get_preference.
-
-2006-02-10 Kim F. Storm <[email protected]>
-
- * data.c (Findirect_function): Add NOERROR arg. All callers changed
- to pass Qnil for NOERROR.
-
- * keymap.c (current_minor_maps_error): Remove.
- (current_minor_maps): Pass Qt for NOERROR to Findirect_function
- instead of using internal_condition_case_1+current_minor_maps_error.
-
-2006-02-09 Jan Dj,Ad(Brv <[email protected]>
-
- * xterm.c (handle_one_xevent): Must note mouse movement even for nil
- frames for GTK, in that case it is the tool bar. This is so that
- highlighted text get reset properly.
-
-2006-02-09 Juanma Barranquero <[email protected]>
-
- * alloc.c (Fmake_bool_vector, Fpurecopy): Doc fixes.
-
-2006-02-08 Jan Dj,Ad(Brv <[email protected]>
-
- * window.c (adjust_window_trailing_edge): Check that shrinking
- does not set a window to size zero or less.
-
-2006-02-08 Miles Bader <[email protected]>
-
- * editfns.c (Fconstrain_to_field): Use Fget_char_property instead
- of Fget_text_property (other field functions work with overlays as
- well as text-properties).
-
-2006-02-07 Kenichi Handa <[email protected]>
-
- * dispextern.h (unibyte_display_via_language_environment): Extern it.
-
- * xterm.h (unibyte_display_via_language_environment):
- * w32term.h (unibyte_display_via_language_environment):
- * macterm.h (unibyte_display_via_language_environment): Delete extern.
-
-2006-02-07 Kenichi Handa <[email protected]>
-
- * term.c (append_glyph): Refer to it->char_to_display instead of it->c.
- (produce_glyphs): Set the character to print in
- it->char_to_display. Handle unibyte-display-via-language-environment.
- (produce_stretch_glyph): Set character to print in it->char_to_display.
-
-2006-02-06 Kenichi Handa <[email protected]>
-
- * lread.c (openp): Initialize encoded_fn before GCPRO it.
-
-2006-02-05 Ken Raeburn <[email protected]>
-
- * editfns.c (Fconstrain_to_field): Fix int/Lisp_Object mixup.
-
- * lisp.h (XPNTR) [!NO_UNION_TYPE && !HAVE_SHM && !DATA_SEG_BITS]:
- Cast bitfield value to EMACS_INT, to suppress gcc warning.
-
- * xrdb.c (malloc, realloc, free) [emacs]: Undefine macros before
- defining.
-
-2006-02-03 Kim F. Storm <[email protected]>
-
- * xdisp.c: Cache last merged escape glyph face.
- (last_escape_glyph_frame, last_escape_glyph_face_id)
- (last_escape_glyph_merged_face_id): New variables.
- (get_next_display_element): Use/update them.
- (redisplay_internal): Reset them before redisplay.
-
- * xdisp.c (set_iterator_to_next): Optimize 2004-12-13 fix.
- Only recheck faces after displaying ellipsis.
-
-2006-02-02 Kenichi Handa <[email protected]>
-
- * coding.c (decode_composition_emacs_mule): Fix handling of
- incorrect format data.
-
-2006-01-31 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (update_frame_tool_bar): Use new tool bar function
- gtk_toolbar_insert() so we can have tool bars of different sizes.
-
-2006-01-30 Luc Teirlinck <[email protected]>
-
- * data.c (Flistp): Doc fix.
-
-2006-01-30 Juanma Barranquero <[email protected]>
-
- * window.c (Fother_window, Fwindow_vscroll, Fset_window_vscroll):
- Fix typos in docstrings.
-
-2006-01-28 Luc Teirlinck <[email protected]>
-
- * data.c (Fcar, Fcdr): Add links to Elisp manual to the docstrings.
-
-2006-01-27 Chong Yidong <[email protected]>
-
- * alloc.c (make_interval, allocate_string)
- (allocate_string_data, make_float, Fcons, allocate_vectorlike)
- (Fmake_symbol, allocate_misc): Use BLOCK_INPUT when accessing
- global variables.
-
-2006-01-27 Eli Zaretskii <[email protected]>
-
- * dired.c (DIRENTRY_NONEMPTY) [__CYGWIN__]: Don't use d_ino; use
- the MSDOS definition.
-
-2006-01-26 Richard M. Stallman <[email protected]>
-
- * alloc.c (check_pure_size): Make overflow message an "error message".
-
- * keymap.c (Fmap_keymap): Doc fix.
-
- * xfns.c (Fx_create_frame): Put all specified parms into f->param_alist
- unless they were cleared out.
-
- * frame.c (x_get_arg): "Clear out" the parm in ALIST if found there.
-
-2006-01-26 L$,1 q(Brentey K,Aa(Broly <[email protected]>
-
- * editfns.c (Fconstrain_to_field): Fix behaviour on field boundaries.
- (find_field): Set before_field to after_field when pos is at BEGV.
- (Fline_beginning_position, Fline_end_position):
- Clarify confusing doc string.
-
- * cmds.c (Fbeginning_of_line, Fend_of_line): Clarify confusing doc
- string.
-
-2006-01-26 Kenichi Handa <[email protected]>
-
- * callproc.c (Fcall_process): GCPRO error_file. Encode infile,
- current_dir, and error_file. On reporting an error, decode them
- back.
-
-2006-01-24 Stefan Monnier <[email protected]>
-
- * regex.c (IMMEDIATE_QUIT_CHECK): Use it with SYNC_INPUT as well.
- (re_match_2_internal) <on_failure_jump, on_failure_jump_smart>:
- Don't check for quit, since any loop will go through fail or jump.
-
-2006-01-24 Chong Yidong <[email protected]>
-
- * alloc.c (allocate_string_data): Update next_free immediately, to
- reduce risk of memory clobberage.
-
-2006-01-24 L$,1 q(Brentey K,Aa(Broly <[email protected]>
-
- * xdisp.c (handle_invisible_prop): Set it->position to fix cursor
- display when point moves across an ellipsis. If there are
- adjacent invisible texts, don't lose the second one's ellipsis.
- (x_produce_glyphs): Doc fix.
-
-2006-01-23 Stefan Monnier <[email protected]>
-
- * xterm.c (x_catch_errors_unwind): Yet another int/Lisp_Object mixup.
-
-2006-01-23 Kim F. Storm <[email protected]>
-
- * xdisp.c (handle_single_display_spec): Fix handling of space
- property on char from string: set *position rather than
- it->current.pos.
- (produce_stretch_glyph): Reduce width of stretch glyphs so they
- don't get wider than the window (unless truncate-lines is on).
-
-2006-01-22 Stefan Monnier <[email protected]>
-
- * xterm.c: Avoid allocating Lisp data from a signal handler.
- (x_error_message): New var to replace x_error_message_string.
- (x_error_catcher, x_catch_errors, x_catch_errors_unwind)
- (x_check_errors, x_had_errors_p, x_clear_errors, x_error_handler)
- (syms_of_xterm): Use it instead of x_error_message_string.
-
- * alloc.c (lisp_align_free): Add an assertion.
- (make_interval, allocate_string, make_float, Fcons, Fmake_symbol)
- (allocate_misc): If ENABLE_CHECKING is on, check we're not called from
- a signal handler.
-
-2006-01-21 Luc Teirlinck <[email protected]>
-
- * dired.c (syms_of_dired) <completion-ignored-extensions>: Doc fix.
-
-2006-01-21 Romain Francoise <[email protected]>
-
- * xdisp.c (get_window_cursor_type): Fix last change.
- Update copyright year.
-
-2006-01-20 Eli Zaretskii <[email protected]>
-
- * lread.c (Fload): Don't leak the file descriptor returned by
- openp if we are going to signal an error.
-
- * w32.c (sys_close): If FD is outside [0..MAXDESC) limits, pass it
- directly to _close.
- (sys_dup): Protect against new_fd larger than fd_info[] can handle.
- (sys_read): If FD is outside [0..MAXDESC) limits, pass it directly
- to _read.
- (sys_write): If FD is outside [0..MAXDESC) limits, pass it
- directly to _write.
-
- * .gdbinit: Don't dereference Vsystem_type's Lisp_Symbol pointer
- if it is NULL.
-
-2006-01-20 Kenichi Handa <[email protected]>
-
- * puresize.h (BASE_PURESIZE): Increment to 1190000.
-
-2006-01-19 Chong Yidong <[email protected]>
-
- * xdisp.c (get_window_cursor_type): Use cursor type specified by
- the selected buffer for the echo area too.
-
-2006-01-19 Richard M. Stallman <[email protected]>
-
- * keymap.c (Fmap_keymap): Doc fix.
-
- * s/irix6-5.h (GC_SETJMP_WORKS, GC_MARK_STACK): New definitions.
-
- * keyboard.c (echo_char): Don't omit the space between first two
- echoed chars.
-
- * minibuf.c (read_minibuf): Fix previous change.
-
-2006-01-19 Kenichi Handa <[email protected]>
-
- * xterm.c (handle_one_xevent): Handle keysyms 0x1000000..0x10000FF.
-
-2006-01-17 Richard M. Stallman <[email protected]>
-
- * frame.c (x_frame_get_and_record_arg): Don't record Qunbound
- value in f->param_alist.
-
-2006-01-15 Andreas Schwab <[email protected]>
-
- * search.c (Freplace_match): Use UPPERCASEP instead of !NOCASEP.
-
-2006-01-13 Richard M. Stallman <[email protected]>
-
- * Makefile.in: Define new macro WINDOW_SUPPORT.
- (lisp): Use it.
- (SOME_MACHINE_LISP): Add conditionally loaded files.
-
-2006-01-12 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.c [USE_ATSUI] (atsu_get_text_layout_with_text_ptr)
- [MAC_OS_X_VERSION_MAX_ALLOWED >= 1020]: Specify kATSLineUseQDRendering.
- (XLoadQueryFont) [USE_ATSUI]: Display diacritical marks in
- decomposed form.
-
- * process.c [HAVE_INTTYPES_H]: Include inttypes.h.
- (ifflag_table): Fix typo (IFF_OACTIV -> IFF_OACTIVE).
- (Fnetwork_interface_info): Use HAVE_STRUCT_IFREQ_IFR_NETMASK
- macro. Also try member ifr_addr when getting netmask.
-
-2006-01-10 Stefan Monnier <[email protected]>
-
- * fileio.c (Fexpand_file_name): Remove redundant tests.
- Fix elimination of // so that it doesn't prevent elimination of an
- immediately following /. or /..
-
-2006-01-09 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (xg_toggle_notify_cb): New function.
- (xg_toggle_visibility_cb): Move setting of x_gtk_show_hidden_files to
- xg_toggle_notify_cb.
- (xg_get_file_with_chooser): Add callback to xg_toggle_notify_cb when
- parameter value changes so the toggle button gets updated.
-
-2006-01-06 Nick Roberts <[email protected]>
-
- * .gdbinit: Fix typo.
-
-2006-01-05 Eli Zaretskii <[email protected]>
-
- * .gdbinit: Fix last change.
-
-2006-01-05 Kim F. Storm <[email protected]>
-
- * process.c (Fmake_network_process): Use AF_INET instead of
- AF_UNSPEC when AF_INET6 is not defined.
-
-2006-01-05 YAMAMOTO Mitsuharu <[email protected]>
-
- * mac.c (mac_coerce_file_name_ptr, mac_coerce_file_name_desc):
- Don't check that the other type is known file-related one.
-
- * macfns.c (Fx_server_version): Use gestaltSystemVersionMajor,
- gestaltSystemVersionMinor, and gestaltSystemVersionBugFix on Mac
- OS X 10.4 and later.
-
-2006-01-04 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (xg_get_image_for_pixmap): If the image is from a file,
- let GTK do all image processing. Importing Emacs own pixmaps to GTK
- looks bad for inactive tool bar items with some Gnome themes.
-
-2006-01-04 Eli Zaretskii <[email protected]>
-
- * .gdbinit: Avoid a warning message when x_error_quitter is not
- compiled in.
-
- * process.c [WINDOWSNT]: Undef AF_INET6 to disable IPv6 support
- for w32.
-
-2006-01-04 Kim F. Storm <[email protected]>
-
- * process.c: Add IPv6 support.
- (Qipv4, Qipv6): New vars.
- (syms_of_process): Intern and staticpro them.
- (Fformat_network_address): Handle 9 or 8 element vector as IPv6 address
- with or without port number. Handle 4 element vector as IPv4 address
- without port number.
- (conv_sockaddr_to_lisp, get_lisp_to_sockaddr_size)
- (conv_lisp_to_sockaddr): Handle IPv6 addresses.
- (Fmake_network_process): Use :family 'ipv4 and 'ipv6 to explicitly
- request that address family only. :family nil or omitted means to
- determine address family from the specified :host and :service.
- (ifflag_table): Add missing OpenBSD IFF_ flags.
- (server_accept_connection): Handle IPv6 addresses.
- (init_process): Add (:family ipv4) and (:family ipv6) sub-features.
-
- * .gdbinit: Undo last change. Instead, look at Vsystem_type to
- determine which breakpoints to set.
-
-2006-01-03 Stefan Monnier <[email protected]>
-
- * keymap.c (describe_map_compare): Yet another int/Lisp_Object mixup.
-
- * window.h (Fwindow_minibuffer_p): Declare (for use in minibuf.c).
-
-2006-01-03 Romain Francoise <[email protected]>
-
- * emacs.c (main): Update copyright year.
-
-2006-01-03 Ken Raeburn <[email protected]>
-
- * callproc.c (delete_temp_file): Bind file-name-handler-alist to
- nil for the call to internal_delete_file.
-
-2006-01-01 Ken Raeburn <[email protected]>
-
- * callproc.c (Fcall_process_region): Bind file-name-handler-alist
- to nil for the call to Fwrite_region.
-
-2005-12-31 Richard M. Stallman <[email protected]>
-
- * minibuf.c (read_minibuf): Clear out all other minibuffer windows.
-
-2005-12-31 Eli Zaretskii <[email protected]>
-
- * emacs.c (gdb_pvec_type): A dummy variable for GDB's sake.
-
-2005-12-30 Luc Teirlinck <[email protected]>
-
- * textprop.c (set_text_properties): Reword description of return value.
- Return Qnil if caller wants to remove all text properties from a
- string and the string already has no intervals.
-
-2005-12-30 Stefan Monnier <[email protected]>
-
- * term.c (visible_cursor): New boolean var.
- (set_terminal_modes, tty_show_cursor): Use "vs" or "ve" depending on
- visible_cursor.
- (syms_of_term): Export the new var as "visible-cursor".
-
-2005-12-30 Eli Zaretskii <[email protected]>
-
- * .gdbinit: Tell users not to worry about GDB warnings that some
- functions do not exist in the binary.
-
-2005-12-30 Andreas Schwab <[email protected]>
-
- * process.c (Fnetwork_interface_info): Correctly terminate the
- loop over ifflag_table.
-
-2005-12-29 Richard M. Stallman <[email protected]>
-
- * lread.c (readevalloop): Test for reading a whole buffer
- before actually reading anything. Handle all cases, including
- START = END = nil and an already-narrowed buffer.
- Convert END to a marker if it is a number.
-
- * keymap.c (describe_map): Put sparse map elements into an array,
- sort them, then output a sequence of identical bindings on one line.
- (struct describe_map_elt): New data type.
- (describe_map_compare): New function.
-
-2005-12-28 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (xg_get_file_with_chooser): Change message shown
- in file chooser.
-
-2005-12-27 Richard M. Stallman <[email protected]>
-
- * lread.c (readevalloop): Set PT and ZV in the proper buffer,
- not the current one.
-
- * minibuf.c (Fminibuffer_message): Doc fix.
- (read_minibuf): Set current_buffer->enable_multibyte_characters sooner.
-
- * eval.c (do_autoload): Ignore elements of Vautoload_queue
- where car is not symbol.
-
-2005-12-27 Kenichi Handa <[email protected]>
-
- * charset.c (lisp_string_width): Check multibyteness of STRING.
-
-2005-12-27 Jan Dj,Ad(Brv <[email protected]>
-
- * xfns.c (x_show_hidden_files): New variable.
- (syms_of_xfns): Defvar it.
-
- * gtkutil.c (xg_toggle_visibility_cb): New function.
- (xg_get_file_with_chooser): Add toggle hidden files and a message
- to the new file chooser dialog. Show hidden files if
- x_show_hidden_files is non-zero.
-
-2005-12-26 Richard M. Stallman <[email protected]>
-
- * keyboard.h: Undo previous change.
-
- * Makefile.in (undo.o): Undo previous change.
-
- * undo.c: Undo previous change.
-
-2005-12-26 Luc Teirlinck <[email protected]>
-
- * keyboard.h: extern last_point_position_window.
-
- * undo.c: include keyboard.h.
-
- * Makefile.in (undo.o): Depend on keyboard.h.
-
-2005-12-26 Richard M. Stallman <[email protected]>
-
- * commands.h (last_point_position_window): Declare.
-
- * undo.c: Depend on window.h.
- (record_point): Save old point from the correct window.
-
- * keyboard.c (last_point_position_window): New variable.
- (command_loop_1): Set last_point_position_window.
- (syms_of_keyboard): Init it.
-
- * Makefile.in (undo.o): Depend on window.h.
-
-2005-12-25 Richard M. Stallman <[email protected]>
-
- * eval.c (un_autoload): Expect (0 . OFEATURES) in Vautoload_queue
- to undo a `provide'.
-
- * fns.c (Fprovide): Store (0 . OFEATURES) in Vautoload_queue.
-
-2005-12-25 Giorgos Keramidas <[email protected]>
-
- * m/amdx86-64.h [__FreeBSD__] (START_FILES, LIB_STANDARD):
- define for FreeBSD on this platform.
-
-2005-12-24 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.h (TYPE_FILE_NAME): New define.
- (posix_pathname_to_fsspec, fsspec_to_posix_pathname): Remove externs.
-
- * mac.c (posix_pathname_to_fsspec, fsspec_to_posix_pathname):
- Add prototypes. Make static.
- (mac_aedesc_to_lisp): Initialize err to noErr.
- (mac_coerce_file_name_ptr, mac_coerce_file_name_desc)
- (init_coercion_handler): New functions.
- (Fmac_coerce_ae_data): Use coercion of Apple event data for
- translation from/to file names.
-
- * macterm.c: Don't include sys/param.h.
- (init_coercion_handler): Add extern.
- [MAC_OS8] (main): Call init_coercion_handler.
- (mac_initialize) [MAC_OSX]: Likewise.
- [TARGET_API_MAC_CARBON] (mac_do_receive_drag): Use coercion of
- Apple event data for translation from/to file names.
-
- * macfns.c [TARGET_API_MAC_CARBON] (Fx_file_dialog): Likewise.
-
- * image.c [MAC_OS] (find_image_fsspec): Likewise.
-
-2005-12-23 Martin Rudalics <[email protected]>
-
- * insdel.c (insert, insert_and_inherit, insert_before_markers)
- (insert_before_markers_and_inherit): Make sure FROM is correct
- when `after-change-functions' are called.
-
-2005-12-23 Jan Dj,Ad(Brv <[email protected]>
-
- * xfns.c (Fx_uses_old_gtk_dialog): New function.
-
- * gtkutil.c (xg_uses_old_file_dialog): New function.
- (xg_get_file_name): Use xg_uses_old_file_dialog.
-
- * gtkutil.h: Declare xg_uses_old_file_dialog.
-
-2005-12-22 Richard M. Stallman <[email protected]>
-
- * xmenu.c (xmenu_show): Call inhibit_garbage_collection.
-
-2005-12-22 YAMAMOTO Mitsuharu <[email protected]>
-
- * mac.c (Fmac_coerce_ae_data) [MAC_OSX]: Fix memory leak.
-
- * macgui.h (XCharStruct): Remove member `valid_p'.
- (STORE_XCHARSTRUCT): Don't set member `valid_p'.
- (XCharStructRow): New typedef.
- (XCHARSTRUCTROW_CHAR_VALID_P, XCHARSTRUCTROW_SET_CHAR_VALID):
- New macros.
- (struct MacFontStruct): Add member `bounds'. Remove member
- `per_char'. All uses for QuichDraw Text fonts are changed to
- `bounds.per_char'. ATSUI font bounds are represented as an array
- `bounds.rows' of XCharStructRow's, each of which consists of a
- bitmap of valid entries and an array of char bounds.
-
- * macterm.c (mac_per_char_metric): Add prototype.
- (x_per_char_metric) [USE_CG_TEXT_DRAWING]: Remove prototype.
- (mac_query_char_extents): New function.
- (x_per_char_metric): Use it.
- (XLoadQueryFont): Likewise. Consolidate min/max_bounds calculations.
- [USE_CG_TEXT_DRAWING] (mac_draw_string_cg):
- Use mac_per_char_metric instead of x_per_char_metric.
- (mac_text_extents_16): New function.
- (mac_compute_glyph_string_overhangs): Use it.
- (mac_unload_font): Free member `bounds' in struct MacFontStruct.
-
-2005-12-21 Stefan Monnier <[email protected]>
-
- * minibuf.c (Fdisplay_completion_list): Use XCAR/XCDR.
- (Fminibuffer_completion_help): Remove duplicates before display.
-
-2005-12-21 L$,1 q(Brentey K,Aa(Broly <[email protected]>
-
- * print.c (print_preprocess): Don't lose print_depth levels while
- iterating.
-
-2005-12-21 YAMAMOTO Mitsuharu <[email protected]>
-
- * macmenu.c (Qmac_apple_event): Add extern.
- (set_frame_menubar, mac_menu_show keymp_panes)
- (single_keymap_panes, list_of_panes, list_of_item)
- (single_menu_item): Add argument types to prototypes.
- (mac_dialog_show) [HAVE_DIALOGS]: Likewise.
- (struct skp): New struct (from xmenu.c).
- (single_keymap_panes, single_menu_item, list_of_panes)
- (list_of_item): Sync with xmenu.c.
- (Fx_popup_menu, Fx_popup_dialog): Likewise. Don't get window from
- POSITION if it is mac-apple-event event.
- (menubar_selection_callback): Don't use menu_command_in_progress.
- (set_frame_menubar): First parse all submenus, then make
- widget_value trees from them. Don't allocate any widget_value
- objects until we are done with the parsing.
- (parse_single_submenu, digest_single_submenu): New functions.
- (single_submenu): Function deleted, replaced by those two.
- (install_menu_quit_handler) [HAVE_CANCELMENUTRACKING]: Don't create
- or dispose of EventHandlerUPP. Install hander to all submenus.
- (mac_menu_show) [!HAVE_MULTILINGUAL_MENU]: Use ENCODE_MENU_STRING
- instead of ENCODE_SYSTEM.
- (free_frame_menubar, fill_submenu, fill_menu): Don't use NULL for
- integer values.
- [HAVE_DIALOGS] (mac_dialog_show): Sync with xdialog_show (in xmenu.c).
- (add_menu_item) [TARGET_API_MAC_CARBON]: Use CFString functions to
- format menu item string. Don't use NULL for integer value.
-
- * macterm.h (struct mac_output): Remove unused member
- menu_command_in_progress.
-
-2005-12-20 Juri Linkov <[email protected]>
-
- * xmenu.c (Fx_popup_menu): Set Vmenu_updating_frame to f if
- position is non-nil, else set it to nil.
-
- * macmenu.c (Fx_popup_menu): Add `else' to set
- Vmenu_updating_frame to nil only if position is nil.
-
- * w32menu.c (Fx_popup_menu): Add `else' to set
- Vmenu_updating_frame to nil only if position is nil.
-
-2005-12-19 YAMAMOTO Mitsuharu <[email protected]>
-
- * keyboard.c (make_lispy_event): Drag-and-drop items are now
- stored in member `args' of struct input_event.
-
- * termhooks.h (struct input_event): Fix comment for DRAG_N_DROP_EVENT.
-
- * xselect.c (x_handle_dnd_message): Drag-and-drop items are now
- stored in member `args' of struct input_event.
-
- * w32term.c (construct_drag_n_drop): Likewise.
-
- * macterm.c (mac_do_receive_drag): Likewise.
- (x_use_underline_position_properties): Undo 2005-07-13 change.
- (syms_of_macterm) <x-use-underline-position-properties>: Likewise.
- (mac_use_core_graphics, mac_wheel_button_is_mouse_2)
- (mac_pass_command_to_system, mac_pass_control_to_system):
- New boolean variables renamed from Lisp_Object ones
- Vmac_use_core_graphics, Vmac_wheel_button_is_mouse_2,
- Vmac_pass_command_to_system, and Vmac_pass_control_to_system.
- All uses changed.
- (syms_of_macterm): DEFVAR_BOOL them. Remove previous DEFVAR_LISPs.
- Make them user options.
- (mac_handle_command_event, mac_store_services_event):
- Call create_apple_event_from_event_ref without 5th argument.
- (backtranslate_modified_keycode): Mask off modifier keys that are
- mapped to some Emacs modifiers before passing it to KeyTranslate.
- (syms_of_macterm): Make variables `mac-emulate-three-button-mouse',
- `mac-wheel-button-is-mouse-2', and `mac-*-modifier' user options.
- Fix docstrings of `mac-*-modifier'.
-
- * mac.c (create_apple_event_from_event_ref): Remove arg `types'.
- (do_applescript): Change argument types to Lisp_Object.
- All uses changed.
-
- * macterm.h (create_apple_event_from_event_ref): Remove 5th
- argument from extern.
-
-2005-12-18 Dan Nicolaescu <[email protected]>
-
- * xfns.c (Fx_backspace_delete_keys_p): In case we cannot determine
- the answer, return `lambda', not nil.
-
-2005-12-17 Eli Zaretskii <[email protected]>
-
- * makefile.w32-in (bootstrap-temacs): Warn that parts of commands
- enclosed in $(ARGQUOTE)s should not be split between two lines, as
- that will break with GNU Make >3.80, when sh.exe is used and
- arg quoting is with '..'.
-
-2005-12-17 Chong Yidong <[email protected]>
-
- * print.c (print_preprocess): Just signal an error if print_depth
- is exceeded.
-
-2005-12-17 Eli Zaretskii <[email protected]>
-
- * .gdbinit: Set a breakpoint on w32_abort.
-
-2005-12-16 Juri Linkov <[email protected]>
-
- * minibuf.c (Fminibuffer_completion_contents): New Lisp function
- created from minibuffer_completion_contents.
- (minibuffer_completion_contents): Remove.
- (do_completion, Fminibuffer_complete_word)
- (Fminibuffer_completion_help): Replace minibuffer_completion_contents
- with Fminibuffer_completion_contents.
- (syms_of_minibuf): Add Sminibuffer_completion_contents.
- (Fdisplay_completion_list): Doc fix.
- (display_completion_list_1): Use `nil' for second arg of
- `Fdisplay_completion_list'.
-
-2005-12-14 Jan Dj,Ad(Brv <[email protected]>
-
- * xfns.c (compute_tip_xy): Handle negative dx and dy.
-
- * w32fns.c (compute_tip_xy): Ditto.
-
- * macfns.c (compute_tip_xy): Ditto.
-
-2005-12-14 Chong Yidong <[email protected]>
-
- * print.c (print_preprocess): Go to a deeper print_depth to avoid
- print_object loop.
-
-2005-12-14 Kyotaro HORIGUCHI <[email protected]> (tiny change)
-
- * coding.c (code_convert_region_unwind): GCPRO arg.
-
-2005-12-12 Jan Dj,Ad(Brv <[email protected]>
-
- * xfns.c (compute_tip_xy): Calculate root_y the same way as root_x,
- i.e. dy is offset from top of frame instead of bottom.
-
- * macfns.c (compute_tip_xy): Ditto.
-
- * w32fns.c (compute_tip_xy): Ditto.
-
- * gtkutil.c (SSDATA): New macro to remove compiler warnings.
- (xg_get_image_for_pixmap, xg_create_frame_widgets)
- (xg_get_file_with_chooser): Use SSDATA instead of SDATA.
-
- * xmenu.c (menubar_selection_callback): Do nothing if the callback
- is for an unselected radio menu item.
-
-2005-12-11 Richard M. Stallman <[email protected]>
-
- * xdisp.c (syms_of_xdisp) <blink-cursor-alist>: Doc fix.
-
- * lisp.h [! NO_UNION_TYPE] (EQ): Use == so args are computed just once.
-
- * keymap.c (Fset_keymap_parent, store_in_keymap): Use CHECK_IMPURE.
- (Flookup_key): Doc fix.
- (syms_of_keymap) <function-key-map>: Doc fix.
-
- * fns.c (Frequire): Treat evaluating from a source file
- like loading the file.
-
- * floatfns.c (Flog): Doc fix.
-
- * fileio.c (Finsert_file_contents): Set Vdeactivate_mark
- when we change the buffer.
-
-2005-12-11 Juri Linkov <[email protected]>
-
- * minibuf.c (display_completion_list_1):
- Call `minibuffer_completion_contents' instead of using `nil' as
- second arg of `Fdisplay_completion_list'.
- (keys_of_minibuf): Unbind SPC in
- Vminibuffer_local_filename_completion_map (see also related
- change on 2005-12-06).
-
-2005-12-11 YAMAMOTO Mitsuharu <[email protected]>
-
- * emacs.c (main) [MAC_OS8]: Undo previous change.
-
- * macselect.c (syms_of_macselect) <mac-apple-event-map>:
- Initialize to nil. Keymap is now created in lisp/term/mac-win.el.
-
-2005-12-10 YAMAMOTO Mitsuharu <[email protected]>
-
- * Makefile.in (macselect.o): Depend on keymap.h.
-
- * emacs.c (main) [MAC_OS8]: Call syms_of_keymap before
- syms_of_macselect.
-
- * image.c (init_image) [MAC_OS]: Don't call EnterMovies.
- [!HAVE_GIF && MAC_OS] (gif_load): Call EnterMovies.
-
- * keyboard.c (Qmac_apple_event) [MAC_OS]: New variable.
- (syms_of_keyboard) [MAC_OS]: Initialize it.
- (make_lispy_event) [MAC_OS]: Build lisp event for MAC_APPLE_EVENT.
-
- * mac.c (Qundecoded_file_name): New variable.
- (syms_of_mac): Initialize it.
- (mac_aelist_to_lisp, mac_aedesc_to_lisp): New functions.
- [TARGET_API_MAC_CARBON] (create_apple_event_from_event_ref): New fun.
- (Fmac_coerce_ae_data): New defun.
- (syms_of_mac): Defsubr it.
-
- * macselect.c: Include keymap.h.
- (mac_ready_for_apple_events): New variable.
- (Vmac_apple_event_map, Qmac_apple_event_class)
- (Qmac_apple_event_id): New variables.
- (syms_of_macselect): Initialize them.
- (Qundefined, mac_store_apple_event): Add externs.
- (struct apple_event_binding): New struct.
- (find_event_binding_fun, find_event_binding)
- (mac_find_apple_event_spec, defer_apple_events)
- (mac_handle_apple_event, init_apple_event_handler)
- (copy_scrap_flavor_data): New functions.
- (Fmac_process_deferred_apple_events): New defun.
- (syms_of_macselect): Defsubr it.
- (mac_store_services_event): Fix extern.
- (mac_handle_service_event): Don't allocate Lisp objects during
- asynchronous input processing. Use mac_store_services_event
- instead of mac_store_application_menu_event.
-
- * macterm.c (Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
- (Qpreferences): Remove variables.
- (syms_of_macterm): Don't initialize them.
- (Qhicommand) [USE_CARBON_EVENTS]: New variable.
- (syms_of_macterm) [USE_CARBON_EVENTS]: Initialize it.
- (init_required_apple_events, do_ae_open_application)
- (do_ae_print_documents, do_ae_open_documents)
- (do_ae_quit_application): Remove functions and prototypes.
- (mac_ready_for_apple_events, Qundefined, init_apple_event_handler)
- (mac_find_apple_event_spec): Add externs.
- (mac_store_application_menu_event): Remove function.
- (mac_store_apple_event, mac_make_lispy_event_code): New functions.
- (mac_handle_command_event): Create Apple event from Carbon event.
- Use mac_store_apple_event instead of mac_store_application_menu_event.
- [MAC_OSX] (mac_store_services_event): Likewise.
- (struct SelectionRange, SelectionRange): Remove struct and typedef.
- [MAC_OS8] (main): Call init_apple_event_handler instead of
- init_required_apple_events.
- (mac_initialize) [MAC_OSX]: Likewise.
- [!USE_CARBON_EVENTS] (mac_wait_next_event):
- Use mac_ready_for_apple_events instead of Qmac_ready_for_drag_n_drop.
-
- * macterm.h (mac_make_lispy_event_code, mac_aedesc_to_lisp):
- Add externs.
- (create_apple_event_from_event_ref) [TARGET_API_MAC_CARBON]: Likewise.
- (Fmac_get_preference): Add EXFUN.
-
- * termhooks.h (enum event_kind) [MAC_OS]: Add new MAC_APPLE_EVENT
- event.
-
-2005-12-09 Richard M. Stallman <[email protected]>
-
- * xfns.c (Fx_create_frame): Reinstate previous change.
-
-2005-12-09 Eli Zaretskii <[email protected]>
-
- * w32fns.c (w32_abort) [__GNUC__]: Add instructions for attaching
- GDB to the abort dialog.
-
-2005-12-09 Kyotaro HORIGUCHI <[email protected]> (tiny change)
-
- * indent.c (Fvertical_motion): Force move if starting on
- stretch glyph.
-
-2005-12-08 Richard M. Stallman <[email protected]>
-
- * lread.c (read_escape) <\s>: Don't treat strings specially.
-
- * xfns.c (Fx_create_frame): Comment out previous change.
-
-2005-12-07 L$,1 q(Brentey K,Aa(Broly <[email protected]>
-
- * xfns.c (Fx_create_frame): Initialize Vdefault_minibuffer_frame,
- when needed.
-
-2005-12-06 Stefan Monnier <[email protected]>
-
- * minibuf.c (keys_of_minibuf): Just unbind SPC in
- Vminibuffer_local_filename_completion_map rather than forcing it
- explicitly to the same binding as the global map.
-
-2005-12-06 Ken Raeburn <[email protected]>
-
- * buffer.c (Fkill_buffer): Avoid dangerous side effects in NILP args.
- * bytecode.c (Fbyte_code): Likewise.
- * fileio.c (internal_delete_file, Fread_file_name_internal): Likewise.
- * minibuf.c (Fminibuffer_complete_and_exit): Likewise.
- * undo.c (truncate_undo_list): Likewise.
-
-2005-12-05 Richard M. Stallman <[email protected]>
-
- * window.c (enlarge_window): Eliminate arg preserve_before.
- Assume it is 0. All callers changed.
- (Fenlarge_window, Fshrink_window): Likewise.
-
-2005-12-02 Eli Zaretskii <[email protected]>
-
- * w32fns.c (compute_tip_xy): Put tip above pointer if it doesn't
- fit below.
-
-2005-12-02 Jan Dj,Ad(Brv <[email protected]>
-
- * xterm.h: Add prototype for xg_set_icon_from_xpm_data.
-
- * xfns.c (x_real_positions): int ign => unsigned int.
- (xg_set_icon_from_xpm_data): Remove unused variable err.
- (x_set_name_internal, Fx_create_frame, xg_set_icon): Add cast
- to remove compiler warning.
- (compute_tip_xy): Put tip above pointer if it doesn't fit below.
-
-2005-12-02 David Reitter <[email protected]>
-
- * minibuf.c (Fcompleting_read): If Vminibuffer_completing_file_name is
- non-nil, use the new keymaps Vminibuffer_local_filename_completion_map
- and Vminibuffer_local_must_match_filename_map keymaps.
- (keys_of_minibuf): Bind SPC in the new file-name completion keymaps.
-
- * keymap.c (Vminibuffer_local_filename_completion_map)
- (Vminibuffer_local_must_match_filename_map): New variables.
- (syms_of_keymap): DEFVAR_LISP them, initialize them, and set their
- parent to be Vminibuffer_local_completion_map and
- Vminibuffer_local_must_match_map, respectively.
-
- * commands.h (Vminibuffer_local_filename_completion_map)
- (Vminibuffer_local_must_match_filename_map): Declare the new keymaps.
-
-2005-12-01 Stefan Monnier <[email protected]>
-
- * window.c (Fset_window_configuration): Don't accidentally copy the
- window-point of one window to another.
-
-2005-11-30 L$,1 q(Brentey K,Aa(Broly <[email protected]>
-
- * buffer.c (Fpop_to_buffer): Remove superfluous call to record_buffer.
-
-2005-11-30 Kim F. Storm <[email protected]>
-
- * alloc.c: Include fcntl.h. Define O_WRONLY if not defined.
- (valid_lisp_object_p) [!GC_MARK_STACK]: Validate pointer by
- passing it to `emacs_write'.
-
-2005-11-29 Ari Roponen <[email protected]> (tiny change)
-
- * atimer.c (stop_other_atimers): Fix loop to correctly compute `prev'.
-
-2005-11-27 Richard M. Stallman <[email protected]>
-
- * window.c (adjust_window_trailing_edge): New function.
- (Fadjust_window_trailing_edge): New function.
- (syms_of_window): Defsubr it.
- (window_deletion_count): New variable.
- (delete_window): Update window_deletion_count.
-
-2005-11-26 Eli Zaretskii <[email protected]>
-
- * minibuf.c (syms_of_minibuf): Mention the extension of
- `completion-auto-help's meaning by complete.el.
-
-2005-11-26 Henrik Enberg <[email protected]>
-
- * xfaces.c (Finternal_set_lisp_face_attribute_from_resource):
- Handle :inherit property as a lisp expression.
-
-2005-11-24 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.c (Qcontrol): Rename from Qctrl. All uses changed.
- (syms_of_macterm): Staticpro Qcontrol, Qmeta, Qalt, Qhyper,
- Qsuper, and Qmodifier_value.
- (Vmac_control_modifier, Vmac_option_modifier)
- (Vmac_command_modifier, Vmac_function_modifier)
- (Vmac_emulate_three_button_mouse, Vmac_wheel_button_is_mouse_2)
- (Vmac_pass_command_to_system, Vmac_pass_control_to_system)
- (Vmac_charset_info_alist): Doc fixes.
-
-2005-11-23 YAMAMOTO Mitsuharu <[email protected]>
-
- * emacs.c (main) [MAC_OSX]: Change working directory to home
- directory if `-psn_*' option is specified.
-
- * mac.c (DECODE_UTF_8): Remove macro.
- [TARGET_API_MAC_CARBON] (cfstring_to_lisp_nodecode): New function
- created from cfstring_to_lisp.
- [TARGET_API_MAC_CARBON] (cfstring_to_lisp): Use it.
- (xrm_get_preference_database) [TARGET_API_MAC_CARBON]: Likewise.
-
- * macterm.h (cfstring_to_lisp_nodecode) [TARGET_API_MAC_CARBON]:
- Add prototype.
-
-2005-11-21 Ken Raeburn <[email protected]>
-
- * keymap.c (shadow_lookup): Use make_number to pass a number to
- Fsubstring.
-
-2005-11-21 Juri Linkov <[email protected]>
-
- * puresize.h (BASE_PURESIZE): Increment to 1180000.
-
-2005-11-20 Chong Yidong <[email protected]>
-
- * xfaces.c (Finternal_set_lisp_face_attribute):
- Use :ignore-defface for new frame defaults when `unspecified' is
- supplied.
- (Finternal_get_lisp_face_attribute): Hide :ignore-defface.
- (merge_face_vectors): Don't do :ignore-defface overwriting here.
- (Finternal_merge_in_global_face): Do it here.
-
-2005-11-20 Juri Linkov <[email protected]>
-
- * charset.c (invalid_character): Use Lisp-readable syntax
- for octal and hex. Reorder decimal, octal and hex values.
-
-2005-11-20 Nick Roberts <[email protected]>
-
- * lisp.h: Use typedef when Lisp_Object is EMACS_INT so that
- this type is recognised when debugging.
-
-2005-11-19 Andreas Schwab <[email protected]>
-
- * .gdbinit (nextcons, xcdr, xfloat): Update for changes in
- Lisp_Cons and Lisp_Float.
-
-2005-11-19 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.c [USE_CG_TEXT_DRAWING] (cg_text_anti_aliasing_threshold):
- New variable.
- [USE_CG_TEXT_DRAWING] (init_cg_text_anti_aliasing_threshold): New fun.
- (init_font_name_table) [USE_ATSUI && USE_CG_TEXT_DRAWING]: Use it.
- [USE_CG_TEXT_DRAWING] (mac_draw_string_cg): Don't do antialiasing if
- font size is smaller than or equal to cg_text_anti_aliasing_threshold.
-
-2005-11-17 Chong Yidong <[email protected]>
-
- * image.c (x_create_bitmap_from_xpm_data): Free attributes on fail.
-
- * xfaces.c (Qignore_defface): New variable.
- (syms_of_xfaces): Provide `:ignore-defface'.
- (IGNORE_DEFFACE_P): New macro.
- (check_lface_attrs, lface_fully_specified_p)
- (Finternal_set_lisp_face_attribute)
- (Fface_attribute_relative_p, Fmerge_face_attribute):
- Handle Qignore_defface as a possible value.
- (merge_face_vectors): The merged face is `unspecified' if the
- mergee specifies `:ignore-defface'.
-
-2005-11-16 Stefan Monnier <[email protected]>
-
- * lread.c (readevalloop): Add missing GCPROs.
-
-2005-11-16 Chong Yidong <[email protected]>
-
- * xfns.c (xg_set_icon_from_xpm_data): New function.
-
- * gnu.h (gnu_xpm_bits): Rename from gnu_bits.
- (gnu_xbm_bits): Rename from gnu_bits (xbm version).
-
- * xterm.c (x_bitmap_icon): Use the xpm if available.
-
- * image.c (x_create_bitmap_from_xpm_data): New function.
- (x_create_bitmap_from_xpm_data): Initialize XpmAttributes.
-
-2005-11-15 Luc Teirlinck <[email protected]>
-
- * Makefile.in (lisp, shortlisp): Add rfn-eshadow.
-
-2005-11-16 Nick Roberts <[email protected]>
-
- * .gdbinit: Make SIGTSTP work like SIGINT normally does.
-
-2005-11-15 Andreas Schwab <[email protected]>
-
- * lisp.h (struct Lisp_Cons): Make cdr a union.
- (XCDR_AS_LVALUE): Adjust.
- (struct Lisp_Float): Make data a union.
- (XFLOAT_DATA): Adjust.
-
- * alloc.c (free_float): Make free list chaining aliasing-safe.
- (make_float): Likewise.
- (free_cons): Likewise.
- (Fcons): Likewise.
- (check_cons_list): Likewise.
- (Fmake_symbol): Likewise.
- (allocate_misc): Likewise.
- (free_misc): Likewise.
- (gc_sweep): Likewise.
-
-2005-11-15 YAMAMOTO Mitsuharu <[email protected]>
-
- * mac.c (HASHKEY_QUERY_CACHE): New define.
- (xrm_create_database, xrm_q_put_resource): Empty query cache.
- (xrm_get_resource): Use query cache.
-
- * image.c (init_image) [MAC_OS]: Don't call EnterMovies if
- inhibit_window_system is set.
-
-2005-11-13 YAMAMOTO Mitsuharu <[email protected]>
-
- * macgui.h (USE_CG_TEXT_DRAWING): New define.
- (struct MacFontStruct) [USE_CG_TEXT_DRAWING]: New members cg_font
- and cg_glyphs.
-
- * macterm.c [USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
- (x_draw_glyph_string_foreground) [USE_CG_TEXT_DRAWING]: Use it.
- (XLoadQueryFont) [USE_CG_TEXT_DRAWING]: Set members cg_font and
- cg_glyphs in struct MacFontStruct if synthesized bold or italic is
- not used and font substitution never occurs for ASCII and Latin-1
- characters.
- (XLoadQueryFont): Maximum and minimum metrics are now those among
- ASCII characters.
- (XLoadQueryFont) [!MAC_OS8 || USE_ATSUI]: Apply WebKit-style
- height adjustments for Courier, Helvetica, and Times.
-
- * s/darwin.h (LIBS_CARBON) [!HAVE_CARBON]: Remove `-framework Carbon'.
-
-2005-11-11 David Reitter <[email protected]>
-
- * macterm.c (syms_of_macterm): Remove macCtrlKey, macShiftKey,
- macMetaKey, macAltKey. Introduce Qctrl, Qmeta,
- Vmac_control_modifier / mac-control-modifier,
- Vmac_option_modifier / mac-option-modifier,
- Vmac_command_modifier / mac-command-modifier.
- (mac_to_emacs_modifiers): Use the new style modifier
- variables. Return UInt32 (modifiers are longs now.)
- (backtranslate_modified_keycode): New function (refactoring).
- (XTread_socket): Use new modifier variables and refactored function.
- (mac_determine_quit_char_modifiers): Remove macMetaKey (there is
- no dedicated meta key. Not in use anyway.)
- (convert_fn_keycode): Map Fn-keys to their original keycode
- using a table (english keyboard only).
-
-2005-11-11 Kim F. Storm <[email protected]>
-
- * .gdbinit (pitx): Fix output format if n_overlay_strings > 0.
- Add post hook to "backtrace" to always dump lisp call stack to
- increase chance of people sending it to us when reporting bugs.
-
- * doc.c (Fsubstitute_command_keys): Doc fix.
-
- * dispextern.h (struct it): New member ignore_overlay_strings_at_pos_p.
-
- * xdisp.c (handle_stop): Skip overlay string handling if
- ignore_overlay_strings_at_pos_p is set.
- (set_iterator_to_next): At end of display vector, set
- ignore_overlay_strings_at_pos_p if dpvec came from an overlay
- string, so we skip those overlay strings at current pos.
-
-2005-11-10 Lars Hansen <[email protected]>
-
- * fileio.c (file-regular-p): Doc fix.
-
-2005-11-10 Kim F. Storm <[email protected]>
-
- * alloc.c (valid_lisp_object_p): New function to validate that
- an object is really a valid Lisp_Object.
-
- * lisp.h (valid_lisp_object_p): Add prototype.
-
- * print.c (safe_debug_print): New function to be called from gdb
- to print Lisp objects; use valid_lisp_object_p to avoid crashing
- if user tries to print something which is not a Lisp object.
-
- * .gdbinit (pp, pp1): Use safe_debug_print.
- (pv, pv1): New commands to print value of a lisp variable.
-
-2005-11-10 Nick Roberts <[email protected]>
-
- * .gdbinit (pp1): New user-defined function.
-
-2005-11-09 YAMAMOTO Mitsuharu <[email protected]>
-
- * image.c [MAC_OSX] (image_load_quartz2d): Fix memory leak.
-
- * mac.c [MAC_OSX] (init_mac_osx_environment): Reinitialize locale
- related variables for dumped executable.
-
- * unexmacosx.c (unexec_write_zero): New function.
- (copy_data_segment): Clear uninitialized local variables in
- statically linked libraries.
-
- * s/darwin.h (C_SWITCH_SYSTEM): Remove -fno-common.
-
-2005-11-09 Juri Linkov <[email protected]>
-
- * keymap.c (shadow_lookup): If Flookup_key returns a number,
- call it again with a sub-key-sequence, and if its return value
- is non-nil (sub-key is bound), return nil.
-
-2005-11-08 Kim F. Storm <[email protected]>
-
- * process.c (Fsignal_process): Recognize signal names with and
- without SIG prefix, e.g. SIGHUP and HUP.
-
- * search.c (search_buffer): No need to initialize base_pat.
-
-2005-11-04 Stefan Monnier <[email protected]>
-
- * window.c (Fget_lru_window, Fget_largest_window, window_loop):
- Don't abuse the `mini' arg. Use the `obj' arg instead.
-
-2005-11-04 Kim F. Storm <[email protected]>
-
- * xdisp.c (show_mouse_face): Clear mouse face to eol.
-
-2005-11-03 Dan Nicolaescu <[email protected]>
-
- * Makefile.in (lisp, shortlisp): Add emacs-lisp/syntax.elc,
- font-lock.elc and jit-lock.elc.
-
-2005-11-03 Richard M. Stallman <[email protected]>
-
- * window.c (Fenlarge_window): Rename SIDE to HORIZONTAL.
- (enlarge_window): Rename WIDTHFLAG to HORIZ_FLAG.
- (CURBEG, CURSIZE): Use HORIZ_FLAG instead of WIDTHFLAG.
-
- * sheap.c (STATIC_HEAP_SIZE): Increment both definitions.
-
- * alloc.c (refill_memory_reserve): Move decl out of conditionals.
-
-2005-11-03 Stefan Monnier <[email protected]>
-
- * window.c (Fdisplay_buffer): Fix last change to not use
- a dedicated window.
-
-2005-11-01 Kim F. Storm <[email protected]>
-
- * fringe.c (update_window_fringes): Undo 2005-10-27 change.
- Instead, rotate the bottom angle bitmap 180 degrees to indicate
- that the bottom row does not end in a newline.
-
-2005-11-01 Andreas Schwab <[email protected]>
-
- * unexelf.c (unexec): Handle .plt section in BSS segment.
-
-2005-11-01 Stefan Monnier <[email protected]>
-
- * lread.c (readevalloop): Yet another int/Lisp_Object mixup (YAILOM).
-
- * window.c (window_loop): For LRU and LARGEST, let the `mini' argument
- determine whether to consider dedicated windows as well.
- (Fget_lru_window, Fget_largest_window): Add `dedicated' argument.
- (Fdisplay_buffer): Do consider dedicated windows in those cases where
- we will split the window rather than reuse it.
- Don't try to use windows on other displays.
-
-2005-10-31 Dan Nicolaescu <[email protected]>
-
- * puresize.h (BASE_PURESIZE): Increment to 1170000.
-
-2005-10-31 Romain Francoise <[email protected]>
-
- * macfns.c: Update copyright year.
- * m/gould.h: Likewise.
-
-2005-10-30 Kim F. Storm <[email protected]>
-
- * xdisp.c (display_line): Restore it->current_x and call
- extend_face_to_end_of_line when last glyph doesn't fit on line.
- (set_glyph_string_background_width): Remove specific tests here
- to see if face background should extend to end of line. Simplify.
-
-2005-10-30 Richard M. Stallman <[email protected]>
-
- * alloc.c (BYTES_USED): Use uordblks, not arena.
- (bytes_used_when_reconsidered): New variable.
- (emacs_blocked_free): Set that.
-
-2005-10-29 Chong Yidong <[email protected]>
-
- * alloc.c (emacs_blocked_free): Fix typo.
-
-2005-10-29 Richard M. Stallman <[email protected]>
-
- * data.c (Fmake_variable_frame_local): Doc fix.
-
- * xdisp.c (handle_fontified_prop): Do nothing if memory full.
- (format_mode_line_unwind_data): New arg SAVE_PROPTRANS
- controls whether to save and restore mode_line_proptrans_alist.
- Callers changed.
- (unwind_format_mode_line): Work with that feature.
- (redisplay_internal): Don't call prepare_menu_bars if memory full.
- (move_elt_to_front): New function.
- (display_mode_element): Use move_elt_to_front.
- Don't bother munging text props on a null string.
- Delete obsolete elts from mode_line_proptrans_alist.
- (decode_mode_spec): Test Vmemory_full, not spare_memory.
- (Fformat_mode_line): Clear mode_line_proptrans_alist after saving.
-
- * lisp.h (memory_full_cons_threshold): Declare.
- (internal_lisp_condition_case): Declare.
-
- * alloc.c (syms_of_alloc) <memory-full>: Doc fix.
- (Fmemory_full_p): Function deleted.
- (syms_of_alloc): Don't defsubr it.
- (memory_full_cons_threshold): New variable.
- (spare_memory): Now a vector of 7 elts.
- (buffer_memory_full): Don't set Vmemory_full here.
- (xfree): Don't try to refill here.
- (emacs_blocked_free): Record BYTES_USED in local var.
- (memory_full): Now free all the slots in spare_memory.
- (refill_memory_reserve): Allocate each slot in spare_memory.
- (init_alloc_once): Call refill_memory_reserve.
-
- * keyboard.c (command_loop_1): Don't set Vmemory_full here.
-
- * eval.c (internal_lisp_condition_case): New function.
- (Fcondition_case): Use internal_lisp_condition_case.
- (Feval): Test Vmemory_full and memory_full_cons_threshold.
- (Ffuncall): Likewise.
-
- * bytecode.c (Fbyte_code): Use internal_lisp_condition_case.
-
-2005-10-29 Stefan Monnier <[email protected]>
-
- * syntax.c (Fparse_partial_sexp): Fix docstring.
-
-2005-10-28 Romain Francoise <[email protected]>
-
- * puresize.h (BASE_PURESIZE): Increment to 1130000.
-
-2005-10-28 Richard M. Stallman <[email protected]>
-
- * xfns.c (syms_of_xfns): Provide `x' as feature.
-
- * xdisp.c (decode_mode_spec): Define %e to indicate memory full.
-
- * editfns.c (Fformat): Don't include string padding
- between info[n].start and info[n].end.
-
- * alloc.c (spare_memory): No longer static.
- (xfree) [!SYSTEM_MALLOC]: Call refill_memory_reserve.
-
- * puresize.h (BASE_PURESIZE): Increment to 1120000.
-
-2005-10-27 Chong Yidong <[email protected]>
-
- * data.c (Fmake_variable_frame_local): Add clarification to docstring.
-
- * fringe.c (update_window_fringes): Handle case where buffer ends
- with a newline.
-
-2005-10-27 Kenichi Handa <[email protected]>
-
- * coding.h (DECODE_SYSTEM): Fix argument name; name->str.
-
-2005-10-24 Kenichi Handa <[email protected]>
-
- * charset.h (charset_mule_unicode_0100_24ff)
- (charset_mule_unicode_2500_33ff, charset_mule_unicode_e000_ffff):
- Extern them.
-
- * charset.c (charset_mule_unicode_0100_24ff)
- (charset_mule_unicode_2500_33ff, charset_mule_unicode_e000_ffff):
- New variables.
- (Fsetup_special_charsets): Initialize them.
-
- * xterm.c (handle_one_xevent): Handle keysyms directly mapped to
- supported Unicode characters.
-
-2005-10-25 Jason Rumney <[email protected]>
-
- * w32fns.c (w32_to_x_font): Avoid forcing font widths.
-
-2005-10-25 YAMAMOTO Mitsuharu <[email protected]>
-
- * image.c [MAC_OS] (image_load_qt_1): Check image size.
- Use GraphicsImportGetImageDescription instead of
- GraphicsImportGetNaturalBounds.
- [MAC_OSX] (image_load_quartz2d): Check image size.
- [MAC_OS] (xpm_load_image): Likewise.
-
- * macterm.c (last_mouse_glyph_frame): New var.
- (note_mouse_movement): Say mouse moved if current frame differs
- from last_mouse_glyph_frame, and update last_mouse_glyph_frame.
- (XTmouse_position): Set last_mouse_glyph_frame.
- (XTread_socket): Clear last_mouse_glyph_frame on mouse up/down event.
- (mac_draw_string_common) [USE_ATSUI && WORDS_BIG_ENDIAN]: Fix typo.
- Use EndianU16_BtoN.
- (mac_draw_string_common) [MAC_OSX]: Don't use ATSUClearLayoutControls.
- (x_per_char_metric, XLoadQueryFont)
- [MAC_OS_X_VERSION_MAX_ALLOWED < 1020]: Use device origins to get
- glyph bounds.
- (mac_to_x_fontname, mac_do_list_fonts)
- (mac_initialize_display_info): Change screen resolutions to 72dpi.
-
-2005-10-25 Masatake YAMATO <[email protected]>
-
- * minibuf.c (Fdisplay_completion_list): Small doc fix.
-
-2005-10-24 Kim F. Storm <[email protected]>
-
- * xterm.c: Undo 2005-10-23 change.
- (last_mouse_glyph_frame): New var.
- (note_mouse_movement): Say mouse moved if current frame differs
- from last_mouse_glyph_frame, and update last_mouse_glyph_frame.
- (XTmouse_position): Set last_mouse_glyph_frame.
- (handle_one_xevent): Clear last_mouse_glyph_frame [instead of
- last_mouse_glyph] on mouse up/down event.
-
- * editfns.c (Fcompare_buffer_substrings): Fix last change.
-
-2005-10-23 Stefan Monnier <[email protected]>
-
- * editfns.c (Fcompare_buffer_substrings): Handle multibyte chars.
-
-2005-10-23 Jan Dj,Ad(Brv <[email protected]>
-
- * xterm.c (note_mouse_movement): Always call note_mouse_highlight
- so tool tips don't interfere with press on tool bar button.
-
-2005-10-23 Richard M. Stallman <[email protected]>
-
- * casetab.c (Fset_case_table): Doc fix.
-
- * lread.c (build_load_history): Replace STREAM arg with ENTIRE.
- (readevalloop): Compute ENTIRE properly.
- (syms_of_lread) <load-history>: Doc fix.
-
-2005-10-21 Richard M. Stallman <[email protected]>
-
- * lread.c (Fload): Simplify gcpro structure.
- Gcpro FOUND as well as FILE, but not EFOUND.
- Unless preloading, record FOUND instead of FILE in Vload_history.
- Rename repeat local FILE to MSG_FILE.
- (syms_of_lread) <load-history>: Doc fix.
-
-2005-10-21 Kenichi Handa <[email protected]>
-
- * search.c (boyer_moore): Add parens to fix and/or precedence bug.
-
-2005-10-20 Kim F. Storm <[email protected]>
-
- * buffer.c (clone_per_buffer_values): Remove unused var tem.
- (init_buffer): Remove unused vars dotstat, pwdstat.
-
- * ccl.c (check_ccl_update): Remove unused var vp.
-
- * fileio.c (auto_save_error): Call SAFE_FREE.
-
- * fns.c (Fchar_table_range): Remove unused var i.
-
- * minibuf.c (display_completion_list_1): New wrapper function
- for Fdisplay_completion_list.
- (Fminibuffer_completion_help): Use it.
-
- * term.c (encode_terminal_code): Remove unused var src_start.
-
- * window.c (Fwindow_tree): Remove unused var alist.
-
- * xterm.c (x_calc_absolute_position): Remove unused vars win_x, win_y.
-
-2005-10-20 Aubrey Jaffer <[email protected]> (tiny change)
-
- * unexelf.c (unexec): Fix calls to `fatal' with less than 3 arguments.
-
-2005-10-20 Olli Savia <[email protected]> (tiny change)
-
- * syssignal.h [__Lynx__]: Undef SIGPOLL along with SIGIO.
-
-2005-10-20 Andreas Schwab <[email protected]>
-
- * minibuf.c (Fdisplay_completion_list): Doc fix.
-
-2005-10-19 Kim F. Storm <[email protected]>
-
- * image.c (check_image_size): Handle integer Vmax_image_size value
- directly as max pixel value. Use default frame size for null frame.
- (syms_of_image) <max-image-size>: Describe integer value.
-
-2005-10-19 Romain Francoise <[email protected]>
-
- * emacs.c (main): Update copyright year.
-
-2005-10-18 Chong Yidong <[email protected]>
-
- * image.c (Vmax_image_size): New variable.
- (check_image_size): New function.
- (xbm_read_bitmap_data, pbm_load, png_load, jpeg_load, tiff_load)
- (gif_load, gs_load): Use it.
- (lookup_image): Try loading again if previous load failed.
- (xbm_read_bitmap_data): Add a new argument, a pointer to the frame
- to display in, NULL if none.
- (xbm_load_image, xbm_file_p): Pass xbm_read_bitmap_data the new
- argument.
-
-2005-10-18 Richard M. Stallman <[email protected]>
-
- * search.c (Fstring_match): Doc fix.
-
-2005-10-18 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.c (note_mouse_movement): Use PtInRect.
- (XTread_socket): Also ignore mouse motion just before a button
- release event. Don't process button release event when mouse is
- not grabbed.
-
-2005-10-16 Masatake YAMATO <[email protected]>
-
- * minibuf.c (Fdisplay_completion_list): Add new optional
- argument COMMON_SUBSTRING. Bind `completion-common-substring'
- to the optional argument during running `completion-setup-hook'.
-
-2005-10-16 YAMAMOTO Mitsuharu <[email protected]>
-
- * mac.c [TARGET_API_MAC_CARBON] (get_cfstring_encoding_from_lisp):
- Allow nil as argument.
- [TARGET_API_MAC_CARBON] (Fmac_code_convert_string): Regard nil
- for encoding arguments as UTF-16 in native byte order, no BOM.
-
- * macfns.c (Fx_create_frame): Add debugging code.
- (Fx_show_tip): Set frame pixel width and height.
-
- * macterm.c (MAC_WINDOW_NORMAL_GC): Remove macro.
- (FRAME_NORMAL_GC): New macro.
- (mac_draw_line, mac_clear_area, mac_clear_window)
- (mac_fill_rectangle, mac_draw_string, mac_draw_string_16)
- (mac_draw_image_string, mac_draw_image_string_16): Rename from
- XDrawLine, XClearArea, XClearWindow, XFillRectangle, XDrawString,
- XDrawString16, XDrawImageString, and XDrawImageString16, respectively.
- All uses changed.
- (mac_draw_line, mac_erase_rectangle, mac_clear_area)
- (mac_clear_window, mac_draw_bitmap, mac_draw_rectangle)
- (mac_invert_rectangle, mac_draw_string_common, mac_draw_string)
- (mac_draw_string_16, mac_draw_image_string)
- (mac_draw_image_string_16, mac_copy_area, mac_copy_area_with_mask)
- (mac_scroll_area): Drawing functions now take frame as destination.
- All uses changed.
- (mac_draw_string_common): Get port height with FRAME_PIXEL_HEIGHT.
- (x_draw_fringe_bitmap): Set clipping area in face->gc.
-
- * macterm.h (mac_clear_area): Add extern.
-
-2005-10-14 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.c (note_mouse_movement, XTread_socket): Apply 2005-10-14
- changes for xterm.c.
-
- * w32term.c (note_mouse_movement, w32_read_socket): Likewise.
-
-2005-10-14 Kenichi Handa <[email protected]>
-
- * search.c (search_buffer): Give up BM search on case-fold-search
- if one of a target character has a case-equivalence of different
- charset even if that target charcter is an ASCII.
-
- * casefiddle.c (casify_object): Fix for the case that case
- conversion change the byte length.
-
-2005-10-14 Kim F. Storm <[email protected]>
-
- * xterm.c (note_mouse_movement): Return 1 if mouse moved; 0 otherwise.
- (handle_one_xevent): Only clear help_echo_string; restore it if
- note_mouse_movement didn't record any mouse movement.
-
- * xdisp.c (pos_visible_p): Convert w->hscroll to pixels before use.
- (remember_mouse_glyph): Clear RECT if mouse is over an image glyph.
-
- * keyboard.c (make_lispy_position): Adjust wx for left margin if
- ON_TEXT.
- (Fposn_at_x_y): Fix calculation of x coordinate.
- (Fposn_at_point): Return nil if point is hscrolled out of view.
-
-2005-10-13 Andreas Schwab <[email protected]>
-
- * sysdep.c (request_sigio, unrequest_sigio): Do nothing in
- non-interactive mode.
-
-2005-10-12 YAMAMOTO Mitsuharu <[email protected]>
-
- * xterm.c, w32term.c, macterm.c (note_mouse_movement): Undo last change.
-
-2005-10-12 Kim F. Storm <[email protected]>
-
- * xterm.c (handle_one_xevent): Clear last_mouse_glyph on mouse up/down.
-
-2005-10-12 Romain Francoise <[email protected]>
-
- * buffer.c (init_buffer): Rename `rc' to `len' for clarity.
-
-2005-10-12 YAMAMOTO Mitsuharu <[email protected]>
-
- * xdisp.c (remember_mouse_glyph): Use MATRIX_BOTTOM_TEXT_ROW to
- get end of text rows. Obtain header-line/mode-line rows directly.
-
- * xterm.c, w32term.c, macterm.c (note_mouse_movement):
- Restore help_echo_string if mouse is moved inside last_mouse_glyph.
-
-2005-10-12 Kim F. Storm <[email protected]>
-
- * xdisp.c (remember_mouse_glyph): New generic version based on
- glyph_rect and remember_mouse_glyph from xterm.c enhanced to
- properly handle all different window areas.
-
- * dispextern.h (remember_mouse_glyph): Add prototype.
-
- * xterm.c (glyph_rect, remember_mouse_glyph): Remove X versions.
- (note_mouse_movement, XTmouse_position): Use generic
- remember_mouse_glyph, add last_mouse_glyph arg.
-
- * w32term.c (note_mouse_movement): Fix last_mouse_glyph check.
- (glyph_rect, remember_mouse_glyph): Remove w32 specific versions.
- (note_mouse_movement, w32_mouse_position): Use generic
- remember_mouse_glyph, add last_mouse_glyph arg.
-
- * macterm.c (note_mouse_movement): Add call to remember_mouse_glyph.
- (glyph_rect, remember_mouse_glyph): Remove mac specific versions.
- (XTmouse_position): Adapt to use generic remember_mouse_glyph
- instead of pixel_to_glyph_coords.
-
- * window.c (coordinates_in_window): Fix x position for ON_RIGHT_MARGIN.
- Fix x position for ON_TEXT when left margin width > 0.
-
-2005-10-11 Kim F. Storm <[email protected]>
-
- * window.c (coordinates_in_window): Fix y position for ON_SCROLL_BAR.
-
- * keyboard.c (make_lispy_position): Fix buffer calculations for
- mouse click or movement in right fringe and the margins.
-
-2005-10-11 Juanma Barranquero <[email protected]>
-
- * image.c (fn_jpeg_stdio_src): Don't define it.
- (init_jpeg_functions): Don't initialize `fn_jpeg_stdio_src'.
- (our_common_init_source): Rename from `our_init_source'.
- (our_common_term_source): Rename from `our_term_source'.
- (our_memory_fill_input_buffer): Rename from
- `our_fill_input_buffer'.
- (our_memory_skip_input_data): Rename from `our_skip_input_data'.
- (jpeg_memory_src): Use the new names.
- (struct jpeg_stdio_mgr): New struct.
- (JPEG_STDIO_BUFFER_SIZE): New constant.
- (our_stdio_fill_input_buffer, our_stdio_skip_input_data)
- (jpeg_file_src): New functions.
- (jpeg_load): Use `jpeg_file_src' instead of `fn_jpeg_stdio_src'.
-
-2005-10-11 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.c (PER_CHAR_METRIC): Remove unused macro.
- (fm_font_family_alist): New variable.
- (syms_of_macterm): Initialize and staticpro it.
- (decode_mac_font_name): Replace '-' in family name with '_' if it
- occurs just once. Lower family name.
- (parse_x_font_name): Rename from x_font_name_to_mac_font_name.
- All uses changed. Remove argument MF and code conversion for it.
- Add argument SIZE. Rename argument MF_DECODED to FAMILY, and CS
- to CHARSET. Parse font size. Lower family name. Return integer
- value for status of parsing.
- (init_font_name_table) [USE_ATSUI]: Use decode_mac_font_name.
- Don't use Fdowncase because family name is already lowered by
- decode_mac_font_name.
- (init_font_name_table): Always call decode_mac_font_name.
- Add pair of family name and its reference to fm_font_family_alist.
- (mac_clear_font_name_table): Clear fm_font_family_alist.
- (XLoadQueryFont): Move font size parsing part to parse_x_font_name.
- Lookup fm_font_family_alist to get font family reference.
- (XLoadQueryFont) [USE_ATSUI]: Don't use Fdowncase because family
- name is already lowered by parse_x_font_name.
-
-2005-10-11 Kim F. Storm <[email protected]>
-
- * xterm.c (glyph_rect): Return 0 if position is outside text area.
-
- * keyboard.c (make_lispy_position): Fix buffer position calculation for
- mouse click or movement in fringe.
-
-2005-10-10 Jason Rumney <[email protected]>
-
- * xterm.c (remember_mouse_glyph): New function.
- (note_mouse_movement): Use it to remember the current glyph if changed.
- (XTmouse_position): Fix calculation of fake glyph under mouse.
- Move code to calculate glyph under mouse into remember_mouse_glyph.
-
-2005-10-10 Jan Dj,Ad(Brv <[email protected]>
-
- * emacs.c (USAGE3, standard_args): -nb => -nbi.
-
-2005-10-10 Juanma Barranquero <[email protected]>
-
- * frame.c (Fredirect_frame_focus): Fix typos in docstring.
- (next_frame, prev_frame, set_term_frame_name): Make static.
-
- * window.c (Fwindow_tree): Fix spelling.
-
-2005-10-09 Romain Francoise <[email protected]>
-
- * window.c (Fwindow_end): Don't try to redisplay if non-interactive.
-
-2005-10-09 Jan Dj,Ad(Brv <[email protected]>
-
- * emacs.c (standard_args): Remove options -i, -itype, --icon-type.
- Add options -nb, --no-bitmap-icon.
-
- * xfns.c (Fx_create_frame): Make bitmapIcon have default on.
-
-2005-10-08 YAMAMOTO Mitsuharu <[email protected]>
-
- * macgui.h (MAX_CLIP_RECTS): New define.
- (struct _XGC): New member clip_region.
- (struct _XGC) [MAC_OSX && USE_ATSUI]: New members n_clip_rects and
- clip_rects.
-
- * macterm.c (GC_CLIP_REGION): New macro.
- (saved_port_clip_region): New variable.
- (mac_begin_clip, mac_end_clip): New functions.
- (XDrawLine, mac_erase_rectangle, mac_draw_bitmap, XFillRectangle)
- (mac_draw_rectangle, mac_draw_string_common, mac_copy_area)
- (mac_copy_area_with_mask, mac_scroll_area): Use them.
- (mac_set_clip_rectangle, mac_reset_clipping): Remove functions.
- [USE_ATSUI] (atsu_get_text_layout_with_text_ptr)
- [MAC_OS_X_VERSION_MAX_ALLOWED < 1020]: Specify kATSLineFractDisable.
- (mac_draw_string_common) [MAC_OSX && USE_ATSUI]: Clip to clipping
- rectangles stored in gc.
- (XFreeGC): Dispose of clipping region.
- (mac_set_clip_rectangles, mac_reset_clip_rectangles): New functions.
- (x_draw_fringe_bitmap, x_set_glyph_string_clipping)
- (x_draw_relief_rect, x_draw_box_rect, x_draw_stretch_glyph_string)
- (x_draw_glyph_string, x_clip_to_row, x_draw_hollow_cursor)
- (x_draw_bar_cursor): Use them.
- (x_set_glyph_string_clipping): Use get_glyph_string_clip_rects to
- get multiple clipping rectangles.
-
- * macterm.h (mac_term_init): Add types to extern.
- (struct mac_output): Remove members mWP and pending_menu_activation.
- Put members scroll_bar_foreground_pixel and
- scroll_bar_background_pixel in #if 0.
- (FRAME_MAC_WINDOW, FRAME_X_WINDOW): Use window_desc.
-
- * xfaces.c (x_create_gc, x_free_gc) [MAC_OS]: Add BLOCK_INPUT.
- Add debugging code.
-
-2005-10-08 Kim F. Storm <[email protected]>
-
- * window.c (window_tree, Fwindow_tree): Rename fns added 2005-10-04.
-
-2005-10-07 Kim F. Storm <[email protected]>
-
- * dispnew.c (redraw_overlapped_rows, redraw_overlapping_rows)
- [!HAVE_WINDOW_SYSTEM]: Don't declare them...
- (update_window) [!HAVE_WINDOW_SYSTEM]: ...and don't call them.
-
-2005-10-07 YAMAMOTO Mitsuharu <[email protected]>
-
- * dispextern.h (struct glyph_string): Rename member for_overlaps_p
- to for_overlaps. Now occupy 3 bits.
- (OVERLAPS_PRED, OVERLAPS_SUCC, OVERLAPS_BOTH)
- (OVERLAPS_ERASED_CURSOR): New defines.
- (struct redisplay_interface): Add new OVERLAPS arg to member
- fix_overlapping_area.
- (x_fix_overlapping_area): Add new OVERLAPS arg.
- (get_glyph_string_clip_rects): Add extern.
-
- * dispnew.c (redraw_overlapping_rows):
- Call rif->fix_overlapping_area with new OVERLAPS arg as redrawn part.
-
- * xdisp.c: Rename member for_overlaps_p in struct glyph_string to
- for_overlaps.
- (get_glyph_string_clip_rects): New function created from
- get_glyph_string_clip_rect. Set clipping rectangles according to the
- value of for_overlaps. Enable to store multiple clipping rectangles.
- (get_glyph_string_clip_rect): Use get_glyph_string_clip_rects.
- (fill_composite_glyph_string, fill_glyph_string, draw_glyphs):
- Rename argument OVERLAPS_P to OVERLAPS. All uses in macros changed.
- (x_fix_overlapping_area): Add OVERLAPS arg. Pass it to draw_glyphs.
- (draw_phys_cursor_glyph): Set width of erased cursor to use it for
- calculating clipping rectangles later. Call x_fix_overlapping_area
- with new OVERLAPS arg to draw only erased cursor area.
- (expose_overlaps): Call x_fix_overlapping_area with new OVERLAPS arg
- to draw overlaps in both preceding and succeeding rows.
-
- * xterm.c, w32term.c, macterm.c: Rename member for_overlaps_p in
- struct glyph_string to for_overlaps.
-
-2005-10-04 Richard M. Stallman <[email protected]>
-
- * alloc.c (refill_memory_reserve): Conditionalize the body,
- not the function's existence.
-
-2005-10-04 Kim F. Storm <[email protected]>
-
- * window.c (window_split_tree): New function.
- (Fwindow_split_tree): New defun.
- (syms_of_window): Defsubr it.
-
-2005-10-04 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.c (mac_invert_rectangle): New function.
- (XTflash): Use it.
-
-2005-10-04 Stefan Monnier <[email protected]>
-
- * regex.h (re_char): Don't expose it in the interface.
- (re_set_whitespace_regexp): Adjust the arg's type to not use it.
-
- * regex.c (re_char): Move it back here.
- (re_set_whitespace_regexp): Change the arg's type to not use it.
-
- * keyboard.c (make_lispy_event): If point has moved between down and up
- event, make it a drag, not a click, to mirror what
- mouse-drag-region expects.
-
-2005-10-02 Dan Nicolaescu <[email protected]>
-
- * lisp.h (fatal): Undo previous change.
- * term.c (fatal): Undo previous change.
-
-2005-10-01 Richard M. Stallman <[email protected]>
-
- * xfaces.c (face_color_gray_p): Colors close to black count as gray.
-
-2005-10-01 Kim F. Storm <[email protected]>
-
- * xdisp.c (try_window): Skip scroll-margin check if ZV is visible.
-
-2005-10-01 YAMAMOTO Mitsuharu <[email protected]>
-
- * keyboard.c (init_keyboard) [MAC_OSX]: Don't install SIGINT handler.
-
- * macfns.c (start_hourglass): Apply 2005-05-07 change for xfns.c.
- (x_create_tip_frame) [GLYPH_DEBUG]: Uncomment debugging code.
- (Fx_create_frame, x_create_tip_frame) [USE_ATSUI]:
- Try ATSUI-compatible 12pt Monaco font first.
-
- * macgui.h (struct _XCharStruct): New member valid_p.
- (STORE_XCHARSTRUCT): Set valid_p.
- (struct MacFontStruct) [USE_ATSUI]: New member mac_style.
-
- * macterm.c (mac_draw_string_common, x_per_char_metric)
- (mac_compute_glyph_string_overhangs, init_font_name_table)
- (XLoadQueryFont, mac_unload_font) [USE_ATSUI]: Add ATSUI support.
- (atsu_get_text_layout_with_text_ptr) [USE_ATSUI]: New function.
- (x_draw_glyph_string_background)
- (x_draw_glyph_string_foreground) [MAC_OS8 && USE_ATSUI]: Don't use
- XDrawImageString. Always draw background and foreground separately.
- (x_draw_glyph_string_foreground) [USE_ATSUI]: Don't use 8-bit
- functions for one-byte chars when using ATSUI-compatible fonts.
- (atsu_font_id_hash) [USE_ATSUI]: New variable.
- (syms_of_macterm) [USE_ATSUI]: Initialize and staticpro it.
- (XLoadQueryFont): Set min_byte1, max_byte1, min_char_or_byte2, and
- max_char_or_byte2 more in detail.
- (quit_char_comp, mac_check_for_quit_char) [MAC_OSX]: Remove functions.
-
-2005-09-30 Dan Nicolaescu <[email protected]>
-
- * image.c (slurp_file, xbm_read_bitmap_data): Cast to the correct type.
- * xterm.c (handle_one_xevent, handle_one_xevent): Likewise.
-
- * unexelf.c (fatal): Fix prototype.
-
- * term.c (fatal): Implement using varargs.
-
- * regex.c (re_char): Move typedef ...
- * regex.h (re_char): ... here.
- (re_iswctype, re_wctype, re_set_whitespace_regexp): New prototypes.
-
- * emacs.c (malloc_set_state): Fix return type.
- (endif): Fix type.
-
- * lisp.h (fatal): Add argument types.
-
- * dispextern.h (fatal): Delete prototype.
-
- * systime.h (make_time): Prototype moved from ...
- * editfns.c (make_time): ... here.
-
- * editfns.c: Move systime.h include after lisp.h.
- * dired.c:
- * xsmfns.c:
- * process.c: Likewise.
-
- * alloc.c (old_malloc_hook, old_realloc_hook, old_realloc_hook):
- Add parameter types.
- (__malloc_hook, __realloc_hook, __free_hook): Fix prototypes.
- (emacs_blocked_free): Change definition to match __free_hook.
- (emacs_blocked_malloc): Change definition to match __malloc_hook.
- (emacs_blocked_realloc): Change definition to match __realloc_hook.
-
-2005-09-30 Romain Francoise <[email protected]>
-
- * minibuf.c (Fread_buffer): Follow convention for reading from the
- minibuffer with a default value. Doc fix.
-
-2005-09-29 Juri Linkov <[email protected]>
-
- * editfns.c (Fmessage, Fmessage_box, Fmessage_or_box):
- Rename argument name `string' to `format-string'.
- (Fformat): Doc fix.
-
-2005-09-28 Kim F. Storm <[email protected]>
-
- * image.c (gif_load): Fix size of allocated image buffer
- for images where a sub-image may be larger than the image's
- total height/width specifications.
-
-2005-09-28 YAMAMOTO Mitsuharu <[email protected]>
-
- * macgui.h (struct _XCharStruct): Each member now takes short value.
-
-2005-09-27 Dan Nicolaescu <[email protected]>
-
- * xfaces.c (lookup_derived_face): Add parameter type.
-
- * xdisp.c (cursor_row_fully_visible_p): Add parameter type.
-
- * marker.c (verify_bytepos): Add parameter type.
-
- * process.c (get_operating_system_release): Move prototype ...
-
- * systime.h (get_operating_system_release): ... here.
-
- * xterm.c (handle_one_xevent): Refer to union field to match the
- type required by the function definition.
- (set_vertical_scroll_bar): Move prototype ...
-
- * xterm.h: ... here.
-
- * fns.c (internal_equal, seed_random): Fix prototypes.
- (internal_equal): Add missing parameter.
-
-2005-09-25 Richard M. Stallman <[email protected]>
-
- * keyboard.c (update_menu_bindings): Variable deleted.
- (syms_of_keyboard): Don't defvar it.
- (parse_menu_item): Don't test it.
-
-2005-09-23 Richard M. Stallman <[email protected]>
-
- * editfns.c (Fformat): Explicitly test for end of format string
- and don't use `index'.
-
-2005-09-23 Dan Nicolaescu <[email protected]>
-
- * s/aix4-2.h (BROKEN_GET_CURRENT_DIR_NAME):
- Define BROKEN_GET_CURRENT_DIR_NAME.
-
- * sysdep.c (get_current_dir_name): Also define if
- BROKEN_GET_CURRENT_DIR_NAME.
-
- * m/ibmrs6000.h: Test for USG5, not USG5_4.
-
-2005-09-22 Kim F. Storm <[email protected]>
-
- * xdisp.c (message_dolog): Add warning about GC and Lisp strings.
- (message2): Fix commentary. Ok to use alloca'ed memory.
- Still not ok to use Lisp string data (because of GC).
- (set_message): Add comment why GC cannot happen.
-
-2005-09-22 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.c (xlfdpat_block_match_1): Fix assertion.
- (init_font_name_table) [TARGET_API_MAC_CARBON]: Don't add style
- variants for a scalable font multiple times.
-
-2005-09-21 YAMAMOTO Mitsuharu <[email protected]>
-
- * process.c (create_process) [RTU || UNIPLUS || DONT_REOPEN_PTY]:
- Setup slave tty options before forking.
-
-2005-09-20 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (xg_set_geometry): Do a gtk_window_move if program
- positions have been set for the frame (as is done for frames in
- special-display-buffer-names).
-
-2005-09-19 Kim F. Storm <[email protected]>
-
- * editfns.c (Fformat): Don't scan past end of format string that
- ends in %. Reported by Johan Bockg,Ae(Brd.
-
-2005-09-18 Andreas Schwab <[email protected]>
-
- * window.h (struct window): Remove height_fixed_p, no longer set.
-
- * window.c (make_window): Don't initialize height_fixed_p.
- (window_fixed_size_p): Don't use it.
-
-2005-09-18 John Paul Wallington <[email protected]>
-
- * data.c (Fdefalias): Signal an error if SYMBOL is not a symbol.
-
-2005-09-18 YAMAMOTO Mitsuharu <[email protected]>
-
- * Makefile.in (SOME_MACHINE_OBJECTS): Undo previous change.
-
- * macfns.c (image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
- New variables.
- [TARGET_API_MAC_CARBON] (Fx_file_dialog): Don't allow multiple
- file selection.
-
- * sysdep.c [MAC_OS8]: Don't include stdlib.h. Include sys/param.h.
-
-2005-09-17 Eli Zaretskii <[email protected]>
-
- * Makefile.in (XMENU_OBJ) [!HAVE_CARBON]: Reinstate variable.
- (obj): Use XMENU_OBJ, not a literal xmenu.o.
-
-2005-09-16 Romain Francoise <[email protected]>
-
- * fileio.c (syms_of_fileio) <write-region-inhibit-fsync>: Doc fix.
-
-2005-09-15 Richard M. Stallman <[email protected]>
-
- * xdisp.c (overlay_arrow_at_row): Add HAVE_WINDOW_SYSTEM conditional.
- (display_mode_element): Instead of `lisp_string' and `this',
- record `offset' and increment that.
- `last_offset' replaces `last'.
-
- * Makefile.in (XMENU_OBJ): Variable deleted.
- (obj): Use xmenu.o unconditionally.
- (SOME_MACHINE_OBJECTS): Delete xmenu.o.
-
- * emacs.c (main): Don't conditionalize syms_of_xmenu on HAVE_XMENU.
-
-2005-09-15 Kim F. Storm <[email protected]>
-
- * xdisp.c (move_it_vertically): Don't try to fetch byte BEGV-1.
- (reseat_at_next_visible_line_start): Likewise (in xassert).
-
-2005-09-14 Romain Francoise <[email protected]>
-
- * fileio.c (write_region_inhibit_fsync): New variable.
- (Fwrite_region): Use it to skip call to fsync.
- (syms_of_fileio): Initialize it.
-
-2005-09-14 Kenichi Handa <[email protected]>
-
- * coding.c (code_convert_region_unwind): Argument format changed.
- (run_pre_post_conversion_on_str): If pre-write-conversion function
- changed the current buffer, delete the new buffer.
- (run_pre_write_conversin_on_c_str): Likewise.
-
- * fileio.c (Fexpand_file_name): Check multibyteness of
- default_directory.
-
-2005-09-13 Kenichi Handa <[email protected]>
-
- * composite.c (compose_chars_in_text): Delete it.
-
- * composite.h (compose_chars_in_text): Delete extern.
-
-2005-09-13 Kim F. Storm <[email protected]>
-
- * print.c (print_error_message): Fix last change.
-
-2005-09-12 Kim F. Storm <[email protected]>
-
- * composite.c (compose_chars_in_text): Fix setup of `pend'.
- Unconditionally reload `ptr' and `pend' after eval.
-
- * xdisp.c (message3): Pass copy of lisp string to message_dolog.
-
- * print.c (print_error_message): Pass copy of caller name to
- message_dolog.
-
- * fileio.c (auto_save_error): Pass copy of lisp string to message2.
-
-2005-09-12 Kenichi Handa <[email protected]>
-
- * xdisp.c (display_mode_element): Be sure to make variables THIS
- and LISP_STRING point into a string data of ELT.
-
-2005-09-12 Kim F. Storm <[email protected]>
-
- * editfns.c (Ftranslate_region_internal): Reload `tt' after
- signal_after_change that may have GC'ed.
- (Fmessage, Fmessage_box, Fmessage_or_box): Doc fix.
-
- * keymap.c (Fdescribe_buffer_bindings): Reload `translate'
- after insert while runs signal_after_change.
-
- * minibuf.c (Fminibuffer_complete_word): Move `completion_string'
- declaration to where it is used.
-
- * w32.c (check_windows_init_file): Fix allocation of error buffer.
-
- * xfns.c (x_encode_text): Declare static. Add FREEP arg.
- (x_set_name_internal): Call x_encode_text with new FREEP arg to
- know if xfree is needed instead of guessing.
-
- * xterm.h (x_encode_text): Remove prototype.
-
-2005-09-11 Chris Prince <[email protected]> (tiny change)
-
- * w32term.c (x_bitmap_icon): Load small icons too.
-
-2005-09-10 Romain Francoise <[email protected]>
-
- * buffer.c (init_buffer): Grow buffer to add directory separator
- and terminal zero. Fix typos.
-
-2005-09-10 Eli Zaretskii <[email protected]>
-
- * buffer.c (init_buffer): Fix error message for failed call to
- get_current_dir_name.
- (get_current_dir_name): Remove prototype.
-
- * xsmfns.c (get_current_dir_name): Remove prototype.
-
- * lisp.h (get_current_dir_name) [!HAVE_GET_CURRENT_DIR_NAME]:
- Add prototype.
-
- * sysdep.c [WINDOWSNT]: Add prototype for getwd.
- Don't #undef NULL after including blockinput.h.
-
- * config.in: Regenerated.
-
-2005-09-10 Giuseppe Scrivano <[email protected]>
-
- Remove the MAXPATHLEN limitations:
-
- * sysdep.c (get_current_dir_name) [!HAVE_GET_CURRENT_DIR_NAME]:
- New function.
-
- * buffer.c (init_buffer): Use it.
-
- * xsmfns.c (smc_save_yourself_CB): Ditto.
-
-2005-09-09 Kim F. Storm <[email protected]>
-
- * doc.c (Fsubstitute_command_keys): Lookup key binding for
- commands that are remapped from some other command.
-
- * xdisp.c (try_window_reusing_current_matrix): Clear mode_line_p
- flag in disabled rows below the window.
-
- * frame.h (struct frame): New member updated_p.
-
- * xdisp.c (redisplay_internal): Mark updated frames in new updated_p
- member. Remove local `updated' array and associated variables.
-
-2005-09-07 Kim F. Storm <[email protected]>
-
- * xdisp.c (handle_display_prop): Respect overlay window property.
-
- * xdisp.c (try_window): Remove superfluous cursor_height calculation.
- Fixes crash reported by YAMAMOTO Mitsuharu.
-
-2005-09-06 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.c (struct xlfdpat_block, struct xlfdpat): New structs.
- (xlfdpat_destroy, xlfdpat_create, xlfdpat_exact_p)
- (xlfdpat_block_match_1, xlfdpat_match): New functions.
- (xlfdpat_block_match): New macro.
- (mac_to_x_fontname): Don't use tolower for non-ASCII characters.
- (x_font_name_to_mac_font_name): Set coding.dst_multibyte to 0.
- (add_font_name_table_entry): Increase font_name_table_size more
- rapidly.
- (mac_c_string_match): Remove function.
- (mac_do_list_fonts): Use XLFD pattern match instead of regular
- expression match.
-
- * xfaces.c (xstrlwr): Don't use tolower for non-ASCII characters.
-
-2005-09-03 Richard M. Stallman <[email protected]>
-
- * xdisp.c (redisplay_internal): Make UPDATED as long as needed.
- (move_it_in_display_line_to): Stop after last char on line even
- on a windowing terminal, if that's the specified stop position.
-
- * fns.c (Fsort): Doc fix.
-
- * editfns.c (Fpropertize): Don't insist that properties be symbols.
-
-2005-09-02 Stefan Monnier <[email protected]>
-
- * dired.c (directory_files_internal_unwind, directory_files_internal)
- (file_name_completion): Use a Save_Value object rather than a cons of
- two 16bit ints to store the DIR*.
- (directory_files_internal, file_name_completion): Handle both EINTR and
- EAGAIN consistently after `readdir'.
-
-2005-09-01 Stefan Monnier <[email protected]>
-
- * intervals.c (update_interval): Add position info in error.
-
- * dispnew.c (window_to_frame_hpos, update_window):
- Avoid gcc warning about unused variable `f'.
-
-2005-08-31 Jason Rumney <[email protected]>
-
- * w32menu.c (add_menu_item): If unicode_append_menu returns an
- error, revert to using AppendMenu.
-
-2005-08-31 YAMAMOTO Mitsuharu <[email protected]>
-
- * image.c (PIX_MASK_DRAW, PIX_MASK_RETAIN): Remove argument.
- All uses changed.
- [MAC_OS] (XPutPixel, XGetPixel): Add efficient versions for common
- cases.
- (x_create_x_image_and_pixmap) [MAC_OS]: Don't call x_destroy_x_image.
- [MAC_OS] (find_image_fsspec) [!MAC_OSX]: Don't use FSRef.
- Use posix_pathname_to_fsspec.
- [MAC_OS] (xpm_load_image): Fill in background_transparent field
- while we have mask.
-
- * macgui.h [!TARGET_API_MAC_CARBON] (GetPixDepth): New define.
-
- * macterm.h (PIX_MASK_DRAW, PIX_MASK_RETAIN): Move defines to image.c.
-
-2005-08-29 Stefan Monnier <[email protected]>
-
- * syntax.c (update_syntax_table): Properly reproduce the special +1
- setting of e_property at the end of the buffer when bumping into the
- INTERVALS_AT_ONCE limit.
-
-2005-08-27 Eli Zaretskii <[email protected]>
-
- * emacs.c (USAGE1): Fix the description of the -Q option.
-
-2005-08-26 Stefan Monnier <[email protected]>
-
- * xdisp.c (pos_visible_p): Yet another int/Lisp_Object mixup (YAILOM).
-
-2005-08-26 Kim F. Storm <[email protected]>
-
- * xdisp.c (resize_mini_window): Fix 2005-08-20 change.
- Don't move PT to new window start.
-
-2005-08-25 YAMAMOTO Mitsuharu <[email protected]>
-
- * keyboard.c (kbd_buffer_get_event) [MAC_OS]: Make events for
- ICONIFY/DEICONIFY_EVENT.
-
- * macterm.c (mac_copy_area, mac_copy_area_with_mask):
- Restore background color.
- (mac_handle_visibility_change): New function.
- (x_make_frame_invisible, x_iconify_frame)
- (XTread_socket) [!USE_CARBON_EVENTS]: Use it.
- [USE_CARBON_EVENTS] (mac_handle_window_event)
- (install_window_handler): Handle visibility change events.
- (x_make_frame_visible): Don't reposition window if it is iconified
- or asked for visible before. Select and uncollapse window when it
- is made visible.
- (x_make_frame_invisible): Don't reset x_highlight_frame.
- (x_iconify_frame): Likewise. Make invisible frame visible before
- it is iconified.
- (read_socket_inev): Move variable outside #if USE_CARBON_EVENTS.
- (do_window_update): Don't change visibility of invisible frame.
-
-2005-08-22 Juri Linkov <[email protected]>
-
- * term.c (turn_on_face): Check for TS_set_foreground and
- TS_set_background depending on standout_mode. Simplify.
-
-2005-08-21 Kim F. Storm <[email protected]>
-
- * fringe.c (update_window_fringes): Only put TOP and BOTTOM
- bitmaps on fully visible rows.
-
- * fringe.c (update_window_fringes): Replace FORCE_P arg with
- KEEP_CURRENT_P arg; if non-zero, don't update current row fringes,
- and return 0.
-
- * xdisp.c (redisplay_window): Call update_window_fringes with
- KEEP_CURRENT_P non-0 if we are going to refresh fringes later.
-
-2005-08-20 Richard M. Stallman <[email protected]>
-
- * xdisp.c (display_echo_area_1): Get display start pos from w->start.
- (resize_mini_window): Set w->start, and PT, so as to display the tail
- end of the buffer, if it doesn't all fit.
-
-2005-08-18 Kim F. Storm <[email protected]>
-
- * xdisp.c (calc_pixel_width_or_height): Use actual display
- resolution when available instead of Vdisplay_pixels_per_inch.
-
-2005-08-17 Kim F. Storm <[email protected]>
-
- * xdisp.c (pos_visible_p): Adjust X value if window is hscrolled.
-
- * dispnew.c (buffer_posn_from_coords): Check that target row is
- within matrix.
-
-2005-08-16 Jan Dj,Ad(Brv <[email protected]>
-
- * xterm.c (x_wm_set_icon_pixmap): Move GTK specific code to
- xg_set_frame_icon and call it.
-
- * gtkutil.c (xg_set_frame_icon): New function.
-
- * gtkutil.h (xg_set_frame_icon): Declare it.
-
-2005-08-16 Kim F. Storm <[email protected]>
-
- * dispnew.c (increment_row_positions): Skip non-enabled rows.
-
- * window.c (SAVED_WINDOW_VECTOR_SIZE): Remove dangerous define.
- (Fcurrent_window_configuration): Use VECSIZE macro instead.
-
-2005-08-15 Richard M. Stallman <[email protected]>
-
- * xdisp.c (message3_nolog): Clear echo_message_buffer.
-
-2005-08-15 Kim F. Storm <[email protected]>
-
- * lisp.h (QUIT) [!SYNC_INPUT]: Throw t to Vthrow_on_input.
-
- * process.c (deactivate_process, status_notify, read_process_output)
- (update_status, status_convert, decode_status, allocate_pty)
- (make_process, remove_process, list_processes_1)
- (create_process_1, unwind_request_sigio, read_process_output)
- (send_process, keyboard_bit_set): Declare static.
- (Fdelete_process): Simplify. Pass process to status_notify, so we
- don't try to read output from it.
- (status_notify): New arg deleting_process--don't try to read
- output from that process.
-
- * lisp.h (deactivate_process, status_notify, read_process_output):
- Remove prototypes.
-
-2005-08-14 Richard M. Stallman <[email protected]>
-
- * image.c (syms_of_image): Init Qxbm, Qpbm before calling
- define_image_type.
-
-2005-08-13 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (xg_get_pixbuf_from_pix_and_mask): New function.
- (xg_get_image_for_pixmap): Move some code to
- xg_get_pixbuf_from_pix_and_mask, and call it.
-
- * gtkutil.h (xg_get_pixbuf_from_pix_and_mask): Declare.
-
- * xterm.c (x_wm_set_icon_pixmap): Call xg_get_pixbuf_from_pix_and_mask
- to get an GTK icon and set it with GTK functions to avoid having GTK
- override an icon set with just X functions.
-
-2005-08-11 Richard M. Stallman <[email protected]>
-
- * image.c (syms_of_image): Init image_types here, and call
- define_image_type.
- (init_image): Not here.
-
-2005-08-09 Richard M. Stallman <[email protected]>
-
- * bytecode.c (BYTE_CODE_QUIT): Throw t to Vthrow_on_input.
-
- * lisp.h (QUIT): Throw t to Vthrow_on_input.
-
-2005-08-09 Thien-Thi Nguyen <[email protected]>
-
- * floatfns.c (Fexpt): Use floats for negative exponent.
-
-2005-08-08 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (xg_modify_menubar_widgets): Remove semicolon that
- should not be there, causing menu display errors with GTK 2.6.9.
-
-2005-08-07 Richard M. Stallman <[email protected]>
-
- * floatfns.c (Fexpt): Undo previous change.
-
- * dispnew.c (Fframe_or_buffer_changed_p): Take an arg
- so it can be used with various state vectors.
-
- * emacs.c (endif): Convert -script into -scriptload.
- (standard_args): Add -scriptload. Allow -basic-display with one dash.
-
- * fns.c (syms_of_fns): Add `emacs' to features.
-
- * term.c (set_terminal_modes): If no TS_termcap_modes string,
- output newlines to scroll the old screen contents off the screen.
-
-2005-08-06 Thien-Thi Nguyen <[email protected]>
-
- * floatfns.c (Fexpt): Use floats for negative exponent.
- Reported by D Goel.
-
-2005-08-02 Richard M. Stallman <[email protected]>
-
- * frame.c (Fframe_char_width): Doc fix.
-
-2005-07-30 Juanma Barranquero <[email protected]>
-
- * xdisp.c (syms_of_xdisp) <redisplay-end-trigger-functions>:
- Defvar it.
-
-2005-07-28 Juanma Barranquero <[email protected]>
-
- * w32fns.c (my_set_window_pos, my_show_window): Don't declare.
- (my_create_window, my_create_tip_window): Make static.
-
- * w32term.c (my_show_window, my_set_window_pos, my_set_focus)
- (my_set_foreground_window, my_destroy_window): Make static.
-
-2005-07-26 Paul Eggert <[email protected]>
-
- Merge gnulib getopt implementation into Emacs.
-
- * s/cygwin.h (C_SWITCH_SYSTEM): Remove, since gettext.h is
- now part of lib-src.
-
-2005-07-26 Stefan Monnier <[email protected]>
-
- * eval.c (Fdefvar): Allow (defvar enable-multibyte-characters).
-
-2005-07-25 Jason Rumney <[email protected]>
-
- * w32menu.c (w32_menu_display_help): Suppress tooltip when
- navigating menus with the keyboard.
-
-2005-07-23 Richard M. Stallman <[email protected]>
-
- * insdel.c (syms_of_insdel): staticpro combine_after_change_buffer.
-
- * bytecode.c (MAYBE_GC): Test gc_cons_threshold and
- gc_relative_threshold, one by one.
-
- * keyboard.c (read_char): Test gc_cons_threshold.
- (syms_of_keyboard): staticpro Qecho_area_clear_hook.
-
- * eval.c (Feval, Ffuncall): Test gc_cons_threshold and
- gc_relative_threshold, one by one.
-
- * alloc.c (gc_cons_threshold): Not static.
- (gc_cons_combined_threshold): Var deleted.
- (gc_relative_threshold): New variable.
- (Fgarbage_collect, init_alloc_once): Compute gc_relative_threshold
- instead of gc_cons_combined_threshold.
-
- * lisp.h (gc_cons_threshold, gc_relative_threshold): Declare.
- (gc_cons_combined_threshold): Declaration deleted.
-
-2005-07-23 YAMAMOTO Mitsuharu <[email protected]>
-
- * mac.c: Don't include stdlib.h or string.h.
- (Fdo_applescript, Fmac_file_name_to_posix)
- (Fmac_file_name_to_posix): Doc fixes.
- [TARGET_API_MAC_CARBON] (Fmac_get_preference)
- (Fmac_code_convert_string): Likewise.
- [MAC_OSX] (init_mac_osx_environment): Fall back on terminal mode
- if the executable is not contained in a bundle.
-
- * macfns.c: Don't include stdlib.h or string.h. Include atimer.h.
- (gray_width, gray_height): Remove defines.
- (gray_bits, gray_bitmap_width, gray_bitmap_height)
- (gray_bitmap_bits): Remove variables.
- (lispy_function_keys): Remove extern.
- (free_frame_menubar): Add extern.
- (x_window_to_frame): Remove function.
- (unwind_create_tip_frame): Add declaration.
- (x_set_name_internal): New function.
- (x_set_name, x_set_title): Use it.
- (Fx_create_frame, Fx_display_grayscale_p, Fx_display_pixel_width)
- (Fx_display_pixel_height, Fx_display_planes)
- (Fx_display_color_cells, Fx_server_max_request_size)
- (Fx_server_vendor, Fx_server_version, Fx_display_screens)
- (Fx_display_mm_height, Fx_display_mm_width)
- (Fx_display_backing_store, Fx_display_visual_class)
- (Fx_display_save_under, Fx_synchronize, Fx_show_tip): Doc fixes.
-
- * macmenu.c (Fx_popup_menu, Fx_popup_dialog): Doc fixes.
-
- * macselect.c (Fx_own_selection_internal): Follow error conventions.
- (Fx_get_selection_internal, Fx_selection_owner_p)
- (Fx_selection_exists_p): Doc fixes.
- (syms_of_macselect) <selection-converter-alist>: Likewise.
-
-2005-07-21 Juanma Barranquero <[email protected]>
-
- * buffer.c (syms_of_buffer) <cursor-type>: Doc fix.
-
- * ccl.c (Fregister_ccl_program): Fix typos in docstring.
- (Fccl_execute_on_string): Likewise; add usage info.
-
- * composite.c (Fcompose_region_internal)
- (Fcompose_string_internal):
- Improve argument/docstring consistency.
-
- * minibuf.c (Fminibuffer_prompt_end, Feval_minibuffer):
- Fix typos in docstrings.
-
- * textprop.c (Fnext_char_property_change)
- (Fprevious_char_property_change): Doc fixes.
-
- * window.c (Fset_window_margins, Fset_window_fringes):
- Improve argument/docstring consistency.
-
- * xfaces.c (Finternal_lisp_face_p): Doc fix.
-
-2005-07-21 Andreas Schwab <[email protected]>
-
- * eval.c (restore_stack_limits): Return a value.
-
-2005-07-20 Juanma Barranquero <[email protected]>
-
- * eval.c (Fdefvar): Doc fix.
-
-2005-07-20 Kim F. Storm <[email protected]>
-
- * fileio.c (Fdo_auto_save, do_auto_save_unwind):
- Use make_save_value to unwind protect stream.
-
- * lread.c (Fload, load_unwind):
- Use make_save_value to unwind protect stream.
-
-2005-07-19 Juanma Barranquero <[email protected]>
-
- * eval.c (Fprog2, Fcalled_interactively_p),
- (syms_of_eval) <debug-on-quit>: Doc fixes.
- (syms_of_eval) <max-specpdl-size>:
- (Finteractive_p): Fix typos in docstrings.
-
-2005-07-19 Kim F. Storm <[email protected]>
-
- * w32fns.c (Vx_hand_shape): Variable removed.
- (syms_of_w32fns): Intern and staticpro Qw32_charset_default.
-
-2005-07-19 Kenichi Handa <[email protected]>
-
- * fns.c (Fstring_as_multibyte): Escape backslashes in the docstring.
-
-2005-07-18 Stefan Monnier <[email protected]>
-
- * buffer.h (Fgenerate_new_buffer_name): Declare (for use in coding.c).
-
-2005-07-18 Kim F. Storm <[email protected]>
-
- * frame.h (struct frame): New member already_hscrolled_p.
-
- * xdisp.c (redisplay_internal): Only try to hscroll each frame once
- to avoid redisplay looping hscrolling back and forth ad infinitum.
-
-2005-07-18 Juri Linkov <[email protected]>
-
- * buffer.c (scroll-up-aggressively, scroll-down-aggressively):
- * keymap.c (Fminor_mode_key_binding):
- * macterm.c (mac-emulate-three-button-mouse):
- Delete duplicate duplicate words.
-
-2005-07-18 Ken Raeburn <[email protected]>
-
- * minibuf.c (Ftest_completion): Fix odd syntax in test.
-
-2005-07-18 YAMAMOTO Mitsuharu <[email protected]>
-
- * macfns.c (x_set_cursor_color): Use XSetBackground and XSetForeground.
-
- * macgui.h (struct _XGC): New struct.
- (GC): Use it.
- (GCForeground, GCBackground, GCFont): Use X11 mask values.
- (XCreateGC, XParseGeometry): Move externs to macterm.h.
-
- * macterm.c (x_bitmap_icon, x_make_frame_visible): Remove declarations.
- (XSetFont): Add declaration.
- (mac_set_forecolor, mac_set_backcolor, mac_set_colors):
- Remove functions.
- (GC_FORE_COLOR, GC_BACK_COLOR, GC_FONT, MAC_WINDOW_NORMAL_GC):
- New defines.
- (XDrawLine, mac_draw_line_to_pixmap, XClearWindow)
- (mac_draw_bitmap, XCreatePixmapFromBitmapData, XFillRectangle)
- (mac_draw_rectangle, mac_draw_string_common, mac_scroll_area):
- Use them.
- (mac_erase_rectangle): New function.
- (XClearArea, x_draw_fringe_bitmap, x_clear_glyph_string_rect)
- (x_draw_stretch_glyph_string): Use it.
- (XChangeGC, XCreateGC, XGetGCValues, XSetForeground)
- (XSetBackground, XSetFont): Adjust for new GC implementation.
- (x_draw_fringe_bitmap, x_draw_box_rect): Use GC to set colors.
- (XTset_vertical_scroll_bar): Clear area under scroll bar.
-
- * macterm.h (struct mac_display_info): Change types of
- scratch_cursor_gc black_relief.gc, and white_relief.gc to GC.
- (XCreateGC, XParseGeometry): Move externs from macgui.h.
-
- * xfaces.c [MAC_OS] (XCreateGC): Remove extern.
-
-2005-07-16 Richard M. Stallman <[email protected]>
-
- * buffer.c (Fmake_overlay): Doc fix.
-
-2005-07-16 Eli Zaretskii <[email protected]>
-
- * w32proc.c (syms_of_ntproc): staticpro Qhigh, Qlow,
- Vw32_valid_locale_ids, and Vw32_valid_codepages.
-
-2005-07-16 YAMAMOTO Mitsuharu <[email protected]>
-
- * mac.c [TARGET_API_MAC_CARBON] (Fmac_code_convert_string):
- Use Fstring_as_unibyte instead of string_make_unibyte.
-
-2005-07-15 Richard M. Stallman <[email protected]>
-
- * xdisp.c (select_frame_for_redisplay): Use find_symbol_value.
-
-2005-07-15 Kim F. Storm <[email protected]>
-
- * xdisp.c: Fix redisplay loop in last change.
- (IT_POS_VALID_AFTER_MOVE_P): New macro.
- (move_it_vertically_backward, move_it_by_lines): Use it.
-
-2005-07-14 Jason Rumney <[email protected]>
-
- * w32.c (init_environment): Default HOME directory to user's
- appdata directory if possible.
-
-2005-07-14 Kim F. Storm <[email protected]>
-
- * .gdbinit (pitx): Fix output format. Print string charpos.
-
- * lread.c (syms_of_lread): Initialize seen_list.
-
- * search.c (syms_of_search): Staticpro searchbuf.whitespace_regexp.
-
- * syntax.c (syms_of_syntax): Staticpro lisp objects in gl_state.
- Staticpro re_match_object.
-
-2005-07-14 YAMAMOTO Mitsuharu <[email protected]>
-
- * macselect.c (get_scrap_target_type_list): Avoid NULL pointer
- dereference.
-
- * macterm.c (mac_window_to_frame): Remove duplicate define.
-
-2005-07-14 Kenichi Handa <[email protected]>
-
- * coding.c (code_convert_region_unwind): ARG is changed to a cons.
- (code_convert_region): Adjust for the above change.
- (set_conversion_work_buffer): If the work buffer is already in
- use, generate a new buffer and return it. Otherwise return Qnil.
- (run_pre_post_conversion_on_str): Adjust for the above change.
- (run_pre_write_conversin_on_c_str): Likewise.
-
-2005-07-13 Kim F. Storm <[email protected]>
-
- * xdisp.c (start_display): Don't reseat to next visible line start
- if current start position is in a string or image.
- (move_it_vertically_backward): Be sure to move out of strings and
- images when moving it2 forward.
- (move_it_by_lines): When moving forward, move to next buffer
- position if we end up in a string or image. When moving backward,
- count rows moved over when moving to start of current row in case
- row starts in middle of a string or image. Also move further
- backward if we end up in a string or image.
- (try_cursor_movement): If overlay string spans multiple lines,
- move backward to set cursor on start of an overlay string.
- (cursor_row_p): Row is ok if cursor is at newline from string, but
- string starts on this line (so we always position cursor at start
- of string).
-
- * indent.c (Fvertical_motion): If start position is on an image,
- don't move back if we move too far (that's almost certain to happen).
-
- * xdisp.c (cursor_row_fully_visible_p): Allow partially visible
- row in minibuffer windows.
- (try_window): Don't check margins in minibuffer windows.
-
-2005-07-13 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.c: Don't include stdlib.h or composite.h.
- (x_use_underline_position_properties, last_mouse_press_frame)
- (x_noop_count, Qvendor_specific_keysyms): Remove unused variables.
- (syms_of_macterm, mac_initialize): Don't initialize them.
- (waiting_for_input, initial_argv, initial_argc)
- (Vcommand_line_args, Vx_no_window_manager, errno, window_scroll)
- (set_frame_menubar, path_from_vol_dir_name): Remove externs.
- (extra_keyboard_modifiers): Fix type in extern.
- (x_window_to_frame, x_window_to_scroll_bar): Remove declarations.
- (x_scroll_bar_report_motion): Add argument types to declaration.
- (mac_compute_glyph_string_overhangs): Add declaration.
- (disable_mouse_highlight): Remove unused variable.
- [USE_TOOLKIT_SCROLL_BARS] (construct_scroll_bar_click)
- (x_scroll_bar_handle_press, x_scroll_bar_handle_release)
- (x_scroll_bar_handle_drag): Remove argument `timestamp'.
- All callers changed.
- [USE_TOOLKIT_SCROLL_BARS] (construct_scroll_bar_click): Don't set
- timestamp.
- [USE_CARBON_EVENTS] (mac_handle_mouse_event): Likewise.
- (x_scroll_bar_create, XTset_vertical_scroll_bar): Show scroll bar
- only when its width is less than the height.
- (XTredeem_scroll_bar): Sync with xterm.c.
- (font_name_table, font_name_table_size, font_name_count):
- Make static.
- (drag_and_drop_file_list): Remove variable. Previous use is now
- local to function.
- (do_ae_open_documents): Move DRAG_N_DROP event construction part
- from XTread_socket.
- (XTread_socket): Consolidate setting of event timestamp.
- Move DRAG_N_DROP event construction part to do_ae_open_documents.
- Support extra_keyboard_modifiers.
-
- * xfaces.c (try_font_list) [MAC_OS]: Try font family name
- beginning with that for ASCII.
-
-2005-07-13 Stefan Monnier <[email protected]>
-
- * alloc.c (gc_cons_combined_threshold, Vgc_cons_percentage): New vars.
- (Fgarbage_collect, init_alloc_once): Set gc_cons_combined_threshold.
- (syms_of_alloc): Declare gc-cons-percentage.
-
- * eval.c (Feval, Ffuncall):
- * keyboard.c (read_char):
- * bytecode.c (MAYBE_GC): Use gc_cons_combined_threshold.
-
- * lisp.h (gc_cons_combined_threshold): Declare.
-
-2005-07-12 Kim F. Storm <[email protected]>
-
- * coding.c (Qprocess_argument):
- * coding.h (Qprocess_argument): Remove unused var.
-
- * xselect.c (intern): Remove dup. intern and staticpro for QTIMESTAMP.
-
-2005-07-12 YAMAMOTO Mitsuharu <[email protected]>
-
- * mac.c [!TARGET_API_MAC_CARBON]: Include charset.h, coding.h, and
- Endian.h.
- [!MAC_OSX] (fchmod, fchown): New functions.
- (mac_get_code_from_arg): Don't accept Lisp integer as argument.
- Use SBYTES and EndianU32_BtoN.
- (mac_get_object_from_code): Return 4 byte string even if argument
- is 0. Use make_unibyte_string and EndianU32_NtoB.
- (Fmac_get_file_creator, Fmac_get_file_type, Fmac_set_file_creator)
- (Fmac_set_file_type): Fix documents and argument declarations.
- Don't specify kFSCatInfoNodeFlags. Support Mac OS Classic.
-
-2005-07-11 Stefan Monnier <[email protected]>
-
- * window.c (Frecenter): Yet another int/Lisp_Object mixup (YAILOM).
-
-2005-07-11 Jan Dj,Ad(Brv <[email protected]>
-
- * xfaces.c (x_update_menu_appearance): Use fontSet resource for
- Lucid if X_I18N, font otherwise.
-
-2005-07-10 Steven Tamm <[email protected]>
-
- * mac.c (Fmac_get_file_type, Fmac_get_file_creator): Add.
- (Fmac_set_file_type, Fmac_set_file_creator): Add.
- (mac_get_object_from_code, mac_get_code_from_arg): Add.
-
-2005-07-10 Richard M. Stallman <[email protected]>
-
- * lread.c (Qeval_buffer_list, Veval_buffer_list): New vars.
- (syms_of_lread): Set up eval-buffer-list.
- (Feval_buffer, Feval_region): Bind eval-buffer-list.
-
-2005-07-08 Richard M. Stallman <[email protected]>
-
- * eval.c (Fdefvar): Allow defvaring a constant to itself quoted.
-
-2005-07-08 Kim F. Storm <[email protected]>
-
- * keyboard.c (menu_bar_items): Don't GCPRO menu_bar_items_vector here.
- (syms_of_keyboard): Initialize and staticpro menu_bar_items_vector.
-
-2005-07-07 Kim F. Storm <[email protected]>
-
- * window.c (Frecenter): Fix last change (set iarg before use).
-
-2005-07-06 Richard M. Stallman <[email protected]>
-
- * window.c (Frecenter): When arg is inside the scroll margin,
- move it out of the margin.
-
-2005-07-06 Jason Rumney <[email protected]>
-
- * w32console.c (initialize_w32_display): Detect when the console
- dimensions are insane, and default to 80x25 instead.
- (w32_use_full_screen_buffer): Default to nil.
-
-2005-07-06 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.c (mac_draw_vertical_window_border): Use foreground of
- VERTICAL_BORDER_FACE_ID for vertical border line.
- (mac_encode_char): Call check_ccl_update in advance.
- (mac_to_x_fontname, x_font_name_to_mac_font_name)
- (init_font_name_table, mac_do_list_fonts, XLoadQueryFont):
- Don't assume that font family length is less than 32.
- (x_compute_min_glyph_bounds): Make static.
- (x_load_font): Never set fonts_changed_p to zero.
-
-2005-07-04 Lute Kamstra <[email protected]>
-
- * Update FSF's address in GPL notices.
-
-2005-07-03 Richard M. Stallman <[email protected]>
-
- * xdisp.c (try_window): Fix previous change in how it handles
- a partially-visible line or one only partly past the margin.
-
- * window.c (window_scroll_pixel_based): Take account
- of this_scroll_margin when finding point when scrolling up.
-
-2005-06-29 Ralf Angeli <[email protected]>
-
- * window.c (window_scroll_pixel_based, window_scroll_line_based):
- Handle `scroll-preserve-screen-position' non-nil, non-t specially.
- (syms_of_window) <scroll-preserve-screen-position>: Doc fix.
-
-2005-07-02 Juri Linkov <[email protected]>
-
- * w32term.c (w32_draw_vertical_window_border): Use foreground of
- VERTICAL_BORDER_FACE_ID for vertical border line.
-
-2005-07-02 Eli Zaretskii <[email protected]>
-
- * fileio.c (Fcopy_file): Rearrange the code that calls fchown and
- fchmod so that chmod doesn't get called on MSDOS before the file
- is closed.
-
-2005-07-01 Jason Rumney <[email protected]>
-
- * w32term.c (cleartype_active): New flag for enabling sub-pixel
- workaround.
- (w32_initialize): Initialize it.
- (w32_native_per_char_metric): Allow a couple of extra pixels when
- Cleartype is active.
-
- * w32term.c (w32_initialize): Move check for screen reader here
- from syms_of_w32term.
-
-2005-06-30 Jan Dj,Ad(Brv <[email protected]>
-
- * xterm.c (handle_one_xevent): bzero compose_status when nbytes
- is not zero.
-
-2005-07-01 Masatake YAMATO <[email protected]>
-
- * emacs.c (main): Passing ADD_NO_RANDOMIZE to `personality'.
-
-2005-06-30 Juri Linkov <[email protected]>
-
- * xdisp.c (x_draw_vertical_border): If left fringe is not present
- decrease x coord of vertical border by 1 pixel to not occupy text
- area of the right window.
-
- * xterm.c (x_draw_vertical_window_border): Use foreground of
- VERTICAL_BORDER_FACE_ID for vertical border line.
-
- * term.c (turn_on_face): In standout mode apply specified
- fg to bg, and specified bg to fg (this makes the logic of
- inversion on terminal consistent with X).
-
-2005-06-29 Juanma Barranquero <[email protected]>
-
- * eval.c (user_variable_p_eh): New function.
- (Fuser_variable_p): Use it. Clarify docstring.
- Return t for aliases of user options, nil for alias loops.
-
-2005-06-27 Richard M. Stallman <[email protected]>
-
- * eval.c (Fdefvar): Improve error message.
-
-2005-06-27 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.c [USE_CARBON_EVENTS] (mac_convert_event_ref): Fix last
- change.
-
-2005-06-27 Juanma Barranquero <[email protected]>
-
- * eval.c (Fdefvar): Don't try to set constant symbols.
-
-2005-06-25 Richard M. Stallman <[email protected]>
-
- * macfns.c (Fx_show_tip): Pass new arg to try_window.
-
- * w32fns.c (Fx_show_tip): Pass new arg to try_window.
-
- * xfns.c (Fx_show_tip): Pass new arg to try_window.
-
- * xdisp.c (try_window): New arg CHECK_MARGINS. Calls changed.
- (redisplay_window): Handle try_window reporting point in scroll margin.
-
- * dispextern.h (try_window): Declare new arg.
-
- * fileio.c (Fcopy_file): New arg PRESERVE_UID_GID.
- Use fchmod to copy the file modes.
- (Frename_file): Don't copy UID and GID here;
- instead, specify t for PRESERVE_UID_GID when calling Fcopy_file.
-
- * eval.c (call_debugger): Take full care of extending stack limits
- to make space for the debugger, and restore the change afterward.
- Bind debug-on-error to nil.
- (restore_stack_limits): New subroutine.
- (Fsignal): Extend specpdl bound along with eval depth bound,
- for calling edebug. Don't do either one, for calling debugger.
- (find_handler_clause): Don't bind debug-on-error here.
- Don't unbind anything either.
- Temporarily advance max_specpdl_size for calling
- internal_with_output_to_temp_buffer.
- (grow_specpdl): Don't alter max_specpdl_size before signaling
- an error.
- (syms_of_eval) <max-specpdl-size>: Doc fix.
-
- * lread.c (read1): 0.0e+NaN should make a "positive" NaN.
-
-2005-06-24 Eli Zaretskii <[email protected]>
-
- * fileio.c (Frename_file): Undo last change: no need to ifdef away
- chown on DOS_NT platforms.
-
- * w32.c (sys_chown): New function.
-
- * s/ms-w32.h (chown): New; define to sys_chown.
-
-2005-06-24 Juanma Barranquero <[email protected]>
-
- * xdisp.c (syms_of_xdisp) <nobreak-char-display>: Doc fix.
- (syms_of_xdisp) <void-text-area-pointer>: Doc fix.
-
- * fileio.c (Frename_file)[!DOS_NT]: Don't call chown on MSDOS/Windows.
-
-2005-06-23 Richard M. Stallman <[email protected]>
-
- * xdisp.c (get_next_display_element): Finish reversing the tests of
- Vnobreak_char_display.
-
- * xdisp.c (Vnobreak_char_display): Rename from Vshow_nonbreak_escape.
- All uses changed.
- (Qnobreak_space): Rename from Qno_break_space. All uses changed.
- (syms_of_xdisp): Define nobreak-char-display and nobreak-space.
-
- * fileio.c (Frename_file): Preserve owner and group, if possible,
- when copying.
-
-2005-06-23 Juanma Barranquero <[email protected]>
-
- * abbrev.c (Funexpand_abbrev):
- * category.c (Fmake_category_set):
- * dispnew.c (Fsleep_for, Fsit_for):
- * editfns.c (Fsubst_char_in_region):
- * eval.c (Fdefvar, Fdefconst, Feval, Ffuncall):
- * frame.c (make_frame_without_minibuffer):
- * lread.c (read_vector):
- * macfns.c (check_x_frame):
- * process.c (Fstop_process, Fcontinue_process):
- * search.c (Freplace_match):
- * syntax.c (Fstring_to_syntax):
- * w32fns.c (check_x_frame, check_x_display_info):
- * xfaces.c (x_supports_face_attributes_p):
- * xselect.c (Fx_own_selection_internal): Follow error conventions.
-
- * image.c (fn_png_init_io): Don't define it.
- (init_png_functions) [HAVE_NTGUI]: Don't initialize fn_png_init_io.
- (png_read_from_file): New function, based on png_read_from_memory.
- (png_load): Use it, instead of fn_png_init_io.
-
-2005-06-23 Kim F. Storm <[email protected]>
-
- * search.c (Fmatch_data): Remove evaporate option.
- (Fset_match_data): Do not mention evaporate option in doc string.
- Add commentary explaining evaporate arg (for internal use only).
- (unwind_set_match_data): Add comment on evaporate use.
-
-2005-06-22 Miles Bader <[email protected]>
-
- * xfaces.c (Qvertical_border): Rename from `Qvertical_divider'.
- (realize_basic_faces, syms_of_xfaces): Update references to it.
- * dispextern.h (enum face_id): Rename `VERTICAL_DIVIDER_FACE_ID'
- to `VERTICAL_BORDER_FACE_ID'.
- * dispnew.c (build_frame_matrix_from_leaf_window): Update references.
-
-2005-06-21 Juri Linkov <[email protected]>
-
- * dispextern.h: Add extern Qframe_set_background_mode.
-
- * xfaces.c: Rename obsolete function Qframe_update_face_colors to
- Qframe_set_background_mode.
-
- * frame.c (Fmodify_frame_parameters):
- Call frame-set-background-mode after changing the background color
- on non-window non-dos branch.
-
-2005-06-21 Juanma Barranquero <[email protected]>
-
- * fns.c (Fchar_table_range):
- * process.c (Fmake_network_process): Fix spellings.
-
-2005-06-20 Kim F. Storm <[email protected]>
-
- * fns.c (Fsort): Doc fix.
-
-2005-06-20 Miles Bader <[email protected]>
-
- * xfaces.c (Qvertical_divider): New variable.
- (realize_basic_faces): Realize its face.
- (syms_of_xfaces): Initialize it.
-
- * dispextern.h (enum face_id): Add `VERTICAL_DIVIDER_FACE_ID'.
-
- * dispnew.c (build_frame_matrix_from_leaf_window): Display vertical
- window-separator on ttys using `vertical-divider' face by default.
-
-2005-06-17 Richard M. Stallman <[email protected]>
-
- * xdisp.c (get_next_display_element):
- Reverse test of Vshow_nonbreak_escape.
-
- * term.c (produce_special_glyphs): Use spec_glyph_lookup_face.
- (Ftty_no_underline): New function.
- (syms_of_term): defsubr it.
-
- * keyboard.c (read_char): Call restore_getcjmp after jump occurs.
-
- * dispnew.c (spec_glyph_lookup_face): New function.
- (build_frame_matrix_from_leaf_window): Use it.
-
- * dispextern.h (spec_glyph_lookup_face): Add declaration.
-
- * buffer.c (syms_of_buffer) <cursor-type>: Doc fix.
-
-2005-06-12 Richard M. Stallman <[email protected]>
-
- * keyboard.c (read_char): After catching a longjmp,
- call restore_getcjmp.
-
-2005-06-17 Juanma Barranquero <[email protected]>
-
- * xselect.c (lisp_data_to_selection_data): Fix spelling.
-
-2005-06-15 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.c (mac_compute_glyph_string_overhangs): Don't set
- overhangs unless the given glyph type is noncomposite CHAR_GLYPH.
- [USE_CARBON_EVENTS] (mac_convert_event_ref): Convert dead key down
- events.
- (XTread_socket): Don't pass keyboard events with the option
- modifier to the system when Vmac_command_key_is_meta is nil or
- Vmac_option_modifier is non-nil.
- [USE_CARBON_EVENTS] (read_socket_inev): New variable.
- [USE_CARBON_EVENTS] (init_command_handler): Fix argument.
- [USE_CARBON_EVENTS] (mac_handle_mouse_event): New Carbon event
- handler function.
- (install_window_handler) [USE_CARBON_EVENTS]: Install it.
- (XTread_socket) [USE_CARBON_EVENTS]: Move mouse wheel event
- handler part to mac_handle_mouse_event.
-
-2005-06-14 Juanma Barranquero <[email protected]>
-
- * eval.c (Fdefvaralias): Rename arguments SYMBOL and ALIASED to
- NEW-ALIAS and BASE-VARIABLE, respectively.
-
-2005-06-13 Stefan Monnier <[email protected]>
-
- * xdisp.c (note_mode_line_or_margin_highlight): Lisp_Object/int mixup.
- (get_phys_cursor_geometry, format_mode_line_unwind_data)
- (get_line_height_property, x_produce_glyphs): Remove unused vars.
-
- * coding.c (run_pre_post_conversion_on_str): Remove unused var `buf'.
-
-2005-06-13 Eli Zaretskii <[email protected]>
-
- * w32term.c (x_use_underline_position_properties): New variable.
- (x_draw_glyph_string): Remind in a comment to change doc string of
- x-use-underline-position-properties if/when underline positioning
- is implemented.
- (syms_of_w32term): DEFVAR_BOOL x-use-underline-position-properties,
- and initialize it to nil.
-
-2005-06-12 Jason Rumney <[email protected]>
-
- * w32fns.c (NEWOPENFILENAME): New struct.
- (Fx_file_dialog): Use it to trick the system into giving us up to
- date dialogs on systems that are documented to support it.
- Do not set OFN_FILEMUSTEXIST flag if looking for a directory.
-
-2005-06-12 Eli Zaretskii <[email protected]>
-
- * w32fns.c (w32_abort): Use the MB_YESNO dialog instead of
- MB_ABORTRETRYIGNORE. Never return, even if DebugBreak does.
-
-2005-06-11 Eli Zaretskii <[email protected]>
-
- * image.c (x_create_x_image_and_pixmap) [HAVE_NTGUI]: Cast 4th arg
- to CreateDIBSection to avoid a compiler warning.
- (pbm_load): Cast 3rd arg to IMAGE_BACKGROUND to avoid a compiler
- warning.
- (png_load): Cast return values of fn_png_create_read_struct and
- fn_png_create_info_struct, to avoid compiler warnings on W32.
- Cast 3rd arg to IMAGE_BACKGROUND and image_background_transparent
- to avoid compiler warnings.
- (jpeg_load): Cast return value of fn_jpeg_std_error to avoid a
- compiler warning on W32. Cast 3rd arg to IMAGE_BACKGROUND to
- avoid a compiler warning.
- (tiff_load): Cast return values of fn_TIFFOpen and
- fn_TIFFClientOpen to avoid compiler warning on W32. Cast 3rd arg
- to IMAGE_BACKGROUND to avoid a compiler warning.
- (gif_load): Cast return values of fn_DGifOpenFileName and
- fn_DGifOpen to avoid compiler warnings on W32. Cast 3rd arg to
- IMAGE_BACKGROUND to avoid a compiler warning.
- (DrawText) [HAVE_NTGUI || MAC_OS]: If already defined, undef
- before redefining.
-
- * w32bdf.c (create_offscreen_bitmap): Cast `bitsp' to `void **' in
- the call to CreateDIBSection, to avoid a compiler warning.
-
-2005-06-11 Jason Rumney <[email protected]>
-
- * w32fns.c (Fx_file_dialog): Unblock input before falling back to
- minibuffer.
- * macfns.c (Fx_file_dialog): Likewise.
-
-2005-06-10 Eli Zaretskii <[email protected]>
-
- * makefile.w32-in ($(TEMACS)): Depend on addsection.exe.
-
-2005-06-10 Juanma Barranquero <[email protected]>
-
- * process.c (syms_of_process) [ADAPTIVE_READ_BUFFERING]:
- * w32fns.c (syms_of_w32fns): Fix spellings.
-
-2005-06-10 Eli Zaretskii <[email protected]>
-
- * unexw32.c (COPY_CHUNK, COPY_PROC_CHUNK): Add a new argument
- `verbose'; print diagnostic messages only if it is non-zero.
- All callers changed to pass a zero value unless DEBUG_DUMP is defined
- in the environment.
- (copy_executable_and_dump_data): Print section names with %.8s.
-
-2005-06-10 Masatake YAMATO <[email protected]>
-
- * xdisp.c (note_mode_line_or_margin_highlight): Call clear_mouse_face
- when mouse_face is not given.
-
-2005-06-09 Luc Teirlinck <[email protected]>
-
- * window.c (Fselect_window): Adapt call to Fselect_frame.
-
- * lisp.h: Update EXFUN of Fselect_frame.
-
- * keyboard.c (command_loop_1): Adapt call to Fselect_frame.
-
- * frame.c (Fhandle_switch_frame, Fselect_frame): Delete unused arg
- no_enter.
- (Fset_mouse_position, Fset_mouse_pixel_position, Ficonify_frame):
- Adapt to above change.
-
-2005-06-10 Juanma Barranquero <[email protected]>
-
- * fns.c (Fmemq, Fmaphash): Doc fixes.
-
-2005-06-09 Juanma Barranquero <[email protected]>
-
- * xfaces.c (Fdisplay_supports_face_attributes_p):
- Fix typo in docstring.
-
-2005-06-08 Steven Tamm <[email protected]>
-
- * unexmacosx.c (copy_data_segment): Copy __la_sym_ptr2 section
- used by gcc4 on intel mac.
-
-2005-06-09 Kim F. Storm <[email protected]>
-
- * search.c (Fmatch_data): Add optional RESEAT arg. Unchain markers
- in REUSE list if non-nil; free them if equal to evaporate.
- (Fset_match_data): Add optional RESEAT arg. Unchain markers in LIST
- if non-nil; free them if equal to evaporate. Use XCAR/XCDR.
- (restore_search_regs): Rename from restore_match_data. Uses changed.
- (unwind_set_match_data): New function.
- (record_unwind_save_match_data): New function like save-match-data.
-
- * lisp.h (Fmatch_data, Fset_match_data): Fix EXFUN.
- (record_unwind_save_match_data): Add prototype.
- (restore_search_regs): Rename from restore_match_data.
-
- * composite.c (compose_chars_in_text):
- * eval.c (do_autoload):
- * macmenu.c (set_frame_menubar):
- * process.c (read_process_output, exec_sentinel):
- * xmenu.c (set_frame_menubar):
- * xdisp.c (prepare_menu_bars, update_menu_bar, update_tool_bar):
- * w32menu.c (set_frame_menubar):
- Use record_unwind_save_match_data.
-
-2005-06-08 Richard M. Stallman <[email protected]>
-
- * xdisp.c (get_next_display_element): Alter previous change:
- Distinguish Vshow_nonbreak_escape = t or not t.
- For t, use escape_glyph once again, as before previous change.
- Use space or hyphen for display, instead of the non-ASCII char.
- (syms_of_xdisp) <show-nonbreak-escape>: Doc fix.
-
- * process.c (Fstart_process): Don't touch command_channel_p slot.
-
- * process.h (struct process): Delete command_channel_p.
-
-2005-06-07 Masatake YAMATO <[email protected]>
-
- * xdisp.c (note_mode_line_or_margin_highlight):
- Check the overlapping of re-rendering area to avoid flickering.
- (note_mouse_highlight): Call clear_mouse_face if PART
- is not ON_MODE_LINE nor ON_HEADER_LINE.
-
-2005-06-07 Kim F. Storm <[email protected]>
-
- * process.c: Improve commentary for adaptive read buffering.
-
-2005-06-06 Stefan Monnier <[email protected]>
-
- * xterm.c (x_create_toolkit_scroll_bar): Use XtNarrowScrollbars
- if available.
-
-2005-06-06 Jan Dj,Ad(Brv <[email protected]>
-
- * macmenu.c (menu_quit_handler, install_menu_quit_handler):
- New functions for popping down menus on C-g.
- (set_frame_menubar, mac_menu_show): Call install_menu_quit_handler.
-
- * macterm.c: Make mac_quit_char_modifiers and mac_quit_char_keycode
- non-static.
-
- * config.in: Add HAVE_CANCELMENUTRACKING.
-
-2005-06-06 Eli Zaretskii <[email protected]>
-
- * w32heap.h (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_PTR): Remove macros.
-
- * unexw32.c (RVA_TO_PTR): Move here from w32heap.h.
-
- * w32proc.c (RVA_TO_PTR): New macro.
-
- * w32heap.c (RVA_TO_PTR): No need to #undef now.
-
- * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/w32select.$(O)):
- Depend on w32heap.h.
-
-2005-06-06 Luc Teirlinck <[email protected]>
-
- * keyboard.c (command_loop_1): Update Vthis_original_command.
-
-2005-06-06 Richard M. Stallman <[email protected]>
-
- * xmenu.c (popup_get_selection): Undo previous change.
-
-2005-06-06 Juri Linkov <[email protected]>
-
- * xdisp.c (Qno_break_space): New variable.
- (syms_of_xdisp): Initialize it.
- (get_next_display_element): Add no-break space and soft hypen
- codes for iso8859-2 and iso8859-5. Don't add `\' for them.
- Use `no-break-space' face for no-break spaces.
-
-2005-06-06 Jan Dj,Ad(Brv <[email protected]>
-
- * window.c (delete_window): Handle the case where a h/vchild has
- a h/vchild.
-
-2005-06-05 Eli Zaretskii <[email protected]>
-
- * w32.c (sys_setsockopt): Change arg 4 to `const void *'. In the
- call to pfn_setsockopt, cast optval to `const char *'.
-
-2005-06-04 Eli Zaretskii <[email protected]>
-
- * w32.c (gettimeofday): Use struct _timeb, not struct timeb.
- (open_unc_volume): Cast return value of map_w32_filename, to avoid
- compiler warnings.
-
- * s/ms-w32.h (fileno): Don't define if already defined.
-
- * emacs.c: Include w32heap.h, to avoid compiler warning about sbrk.
-
- * makefile.w32-in (DOC): Define to point to the generated DOC-X.
-
-2005-06-04 Richard M. Stallman <[email protected]>
-
- * xmenu.c (popup_get_selection): Click not in menu deactivates menu.
-
-2005-06-04 Jan Dj,Ad(Brv <[email protected]>
-
- * macmenu.c (cleanup_popup_menu): New function.
- (Fx_popup_menu): Unwind protect cleanup_popup_menu in case
- mac_menu_show Quit:s.
- (mac_menu_show): Quit on cancel if not popped up on click (i.e.
- a dialog).
-
-2005-06-04 Kim F. Storm <[email protected]>
-
- * coding.c (decode_coding_string): Handle CODING_FINISH_INTERRUPT.
-
- * callproc.c (Fcall_process): Don't use alloca to gradually
- increase size of buf, as it effectively uses twice the necessary
- space on the stack. Instead, pre-allocate buf of full size, and
- gradually increase the read size.
-
- * bytecode.c (BYTE_CODE_QUIT): Check Vthrow_on_input.
-
- * eval.c (unbind_to): Preserve value of Vquit_flag.
-
- * xterm.c (handle_one_xevent): Also ignore mouse motion just
- before a button release event.
-
-2005-06-03 Juanma Barranquero <[email protected]>
-
- * xfaces.c (Finternal_lisp_face_equal_p): Really report
- on faces in a frame, if the argument FRAME is non-nil.
- Improve argument/docstring consistency.
-
-2005-06-02 Kim F. Storm <[email protected]>
-
- * xdisp.c (MODE_LINE_NOPROP_LEN): New macro.
- (x_consider_frame_title, Fformat_mode_line): Save offset into
- mode_line_noprop_buf rather than pointer, in case buffer is relocated.
-
-2005-06-01 Kim F. Storm <[email protected]>
-
- * fns.c (mapcar1): Maybe exit loop if original sequence was modified.
-
-2005-06-01 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.c (mac_to_x_fontname, mac_do_list_fonts): Set XLFD
- resolution fields for scalable fonts to 0.
-
- * xfaces.c (build_scalable_font_name): Round pixel size to the
- nearest integer.
-
-2005-06-01 Kim F. Storm <[email protected]>
-
- * xdisp.c (display_mode_line): Support nested calls to redisplay
- and format-mode-line. Set mode_line_target to MODE_LINE_DISPLAY.
-
-2005-05-31 Stefan Monnier <[email protected]>
-
- * fileio.c (Finsert_file_contents):
- * xdisp.c (note_mode_line_or_margin_highlight): Lisp_Object/int mixup.
-
-2005-05-31 Kim F. Storm <[email protected]>
-
- * xdisp.c (mode_line_noprop_buf, mode_line_noprop_buf_end)
- (mode_line_noprop_ptr): Rename from frame_title_*.
- (store_mode_line_noprop_char): Rename from store_frame_title_char.
- (store_mode_line_noprop): Rename from store_frame_title.
- (mode_line_target): New enum to specify current output target
- for mode line formatting.
- (display_mode_element): Test it rather than frame_title_ptr and
- mode_line_string_list to determine where output should go.
- (mode_line_proptrans_alist, mode_line_string_alist): Make static.
- (Vmode_line_unwind_vector): New variable.
- (format_mode_line_unwind_data, unwind_format_mode_line):
- New functions for unwind protection in mode line formatting.
- (x_consider_frame_title): Use them and new local var 'title_start'
- to support nested calls to format-mode-line and redisplay.
- Set mode_line_target to MODE_LINE_TITLE.
- (Fformat_mode_line): Use them and new local var 'string_start' to
- support nested calls to format-mode-line and redisplay.
- Set mode_line_target to MODE_LINE_NOPROP or MODE_LINE_STRING.
- Don't trim trailing dashes.
- (decode_mode_spec): Don't make infinite number of trailing dashes
- for MODE_LINE_NOPROP and MODE_LINE_STRING targets.
- (syms_of_xdisp): Initialize and staticpro mode_line_string_face,
- mode_line_string_face_prop, and Vmode_line_unwind_vector.
- (init_xdisp): Initialize mode_line_noprop_ptr to start of _buf.
- Initialize mode_line_target to MODE_LINE_DISPLAY.
-
-2005-05-29 Richard M. Stallman <[email protected]>
-
- * buffer.c (Fbuffer_local_value): Call indirect_variable.
-
-2005-05-28 Masatake YAMATO <[email protected]>
-
- * xdisp.c (note_mode_line_or_margin_highlight): Change the
- pointer to a hand cursor when hoovering over a mouse-face.
-
-2005-05-27 Kenichi Handa <[email protected]>
-
- * xterm.c (x_encode_char): Call check_ccl_update in advance.
-
- * ccl.c: Now an element of Vccl_program_table is a vector of
- length 4, not 3.
- (ccl_get_compiled_code): New arg idx. Caller changed.
- Adjust for the change of Vccl_program_table.
- (setup_ccl_program): Adjust for the change of Vccl_program_table.
- (check_ccl_update): New function.
- (Fregister_ccl_program): Use ASET to set an element of a vector.
- Adjusted for the change of Vccl_program_table.
-
- * ccl.h (struct ccl_program): New member idx.
- (check_ccl_update): Extern it.
-
-2005-05-27 Juanma Barranquero <[email protected]>
-
- * image.c (Vimage_library_alist): Move from image.el.
- (syms_of_image): Defvar it.
- (lookup_image_type): Use it.
-
- * buffer.c (Fbuffer_local_value): Make argument name match its use
- in docstring.
-
-2005-05-26 Juanma Barranquero <[email protected]>
-
- * keyboard.c (Frecursive_edit): Fix typo in docstring.
- (Fposn_at_x_y): Make argument name match its use in docstring.
-
-2005-05-26 Lute Kamstra <[email protected]>
-
- * eval.c (Frun_hooks): Mention run-mode-hooks in docstring.
-
-2005-05-24 Masatake YAMATO <[email protected]>
-
- * xdisp.c (note_mode_line_or_margin_highlight): Use b and e
- as loop sentinels.
-
-2005-05-24 Nick Roberts <[email protected]>
-
- * xmenu.c (Fx_popup_dialog): Add a third boolean argument to
- select frame title ("Question"/"Information").
- (xdialog_show): Use it.
-
- * macmenu.c (Fx_popup_dialog, mac_dialog_show): As for xmenu.c.
-
- * w32menu.c (Fx_popup_dialog, w32_dialog_show): As for xmenu.c.
-
- * fns.c (Fyes_or_no_p, Fy_or_n_p): Call Fx_popup_dialog with
- a third argument (Qnil).
-
- * lisp.h: x-popup-dialog can have three arguments.
-
- * editfns.c (Fmessage_box): Use "Information" for frame title.
-
-2005-05-23 Thien-Thi Nguyen <[email protected]>
-
- * termcap.c [VMS]: Include <starlet.h>.
-
-2005-05-23 Masatake YAMATO <[email protected]>
-
- * xdisp.c (note_mode_line_or_margin_highlight): Add code
- for mouse-face. Change the type of the first argument from `window'
- to `Lisp_Object'.
- (note_mouse_highlight): Call note_mode_line_or_margin_highlight with
- window instead of w.
-
-2005-05-22 Andreas Schwab <[email protected]>
-
- * process.c (send_process): Move misplaced volatile.
-
-2005-05-21 Richard M. Stallman <[email protected]>
-
- * xdisp.c (display_mode_element): If we're processing a list and
- padding is specified, put it after the last element.
-
-2005-05-21 Eli Zaretskii <[email protected]>
-
- * fileio.c (Fexpand_file_name) [DOS_NT]: Don't try to support
- "superroot" on DOS_NT systems.
-
-2005-05-21 David Hunter <[email protected]> (tiny change)
-
- * process.c (send_process): Restore the SIGPIPE handler if we
- catch a SIGPIPE.
-
-2005-05-20 Juanma Barranquero <[email protected]>
-
- * image.c (lookup_image, png_read_from_memory): Remove hacks (and
- misleading comments).
- (DEF_IMGLIB_FN): Use C calling convention for image libraries.
-
-2005-05-20 KOBAYASHI Yasuhiro <[email protected]>
-
- * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges):
- Correct the right value.
-
-2005-05-19 Nick Roberts <[email protected]>
-
- * keyboard.c (syms_of_keyboard): Remove Lisp variables
- post-command-idle-hook and post-command-idle-delay.
- (command_loop_1): Don't try to execute post-command-idle-hook.
-
-2005-05-16 Kim F. Storm <[email protected]>
-
- * xdisp.c (handle_display_prop): Handle empty replacement.
- (handle_single_display_spec): Return -1 for empty replacement.
-
- * keyboard.c (adjust_point_for_property): Skip empty overlay string.
-
- * .gdbinit (pitx): Print more info about iterator.
-
-2005-05-16 Andreas Schwab <[email protected]>
-
- * unexmacosx.c (unexec_realloc): Move declarations before statements.
-
-2005-05-14 Richard M. Stallman <[email protected]>
-
- * xdisp.c (message3): Call cancel_echoing.
-
- * alloc.c (Fmemory_full_p): New function.
- (syms_of_alloc): defsubr it.
-
- * process.c (send_process_trap): Unblock SIGPIPE.
- (send_process): Reset SIGPIPE handler before reporting error.
-
-2005-05-14 Nick Roberts <[email protected]>
-
- * emacs.c (syms_of_emacs): Fix doc string for system-type.
-
-2005-05-13 Richard M. Stallman <[email protected]>
-
- * fileio.c (Ffind_file_name_handler): Handle lambda-exp as handler.
- (Finsert_file_contents): If we read 0 bytes from a special file,
- unlock the visited file if we locked it.
- (Fmake_symbolic_link, Frecent_auto_save_p): Doc fixes.
- (Ffile_exists_p, Ffile_symlink_p): Doc fixes.
-
-2005-05-13 YAMAMOTO Mitsuharu <[email protected]>
-
- * emacs.c (main) [MAC_OS8]: Call init_atimer before mac_term_init.
-
- * keyboard.c (readable_events) [USE_TOOLKIT_SCROLL_BARS]:
- Regard toolkit scroll bar thumb drag events as squeezable and prevent
- redisplay from being paused by them.
-
- * mac.c [!MAC_OSX]: Include keyboard.h and syssignal.h.
- [!MAC_OSX] (target_ticks): Remove variable.
- [!MAC_OSX] (check_alarm, pause, index): Remove functions.
- [!MAC_OSX && __MRC__] (sys_strftime): Likewise.
- [!MAC_OSX] (select): If fd 0 is not set in rfds and some input
- event occurs before timeout, behave as if the function were interrupted.
- [!MAC_OSX] (sigblock, sigsetmask, alarm): Simulate SIGALRM
- handling using Time Manager routines.
- [!MAC_OSX] (mac_atimer_task, mac_atimer_qlink, signal_mask):
- New variables.
- [!MAC_OSX] (mac_atimer_handler, set_mac_atimer, remove_mac_atimer)
- (setitimer): New functions.
-
- * macfns.c, macmenu.c: Don't include signal.h.
-
- * macterm.c [USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
- Rename from get_control_part_bound. All callers changed.
- (x_scroll_bar_clear): New function.
- (x_clear_frame): Use it.
- (XTset_vertical_scroll_bar): Don't call Draw1Control.
- (x_scroll_bar_handle_click): Change type of second argument from
- int to ControlPartCode.
- (check_alarm): Remove declaration.
- (XTread_socket) [!TARGET_API_MAC_CARBON]: Don't call it.
- (XTread_socket): Use ControlPartCode instead of SInt16.
-
-2005-05-13 Nozomu Ando <[email protected]>
-
- * unexmacosx.c: Include assert.h.
- (MACOSX_MALLOC_MULT16): New define.
- [MACOSX_MALLOC_MULT16] (ptr_in_unexec_regions): Determine whether
- ptr is in unexec regions by checking it is multiple of 16.
- (unexec_malloc_header_t): New typedef.
- (unexec_malloc, unexec_realloc, unexec_free): Store and use
- allocated size information in unexec_malloc_header.
-
-2005-05-10 Richard M. Stallman <[email protected]>
-
- * xterm.c (noinclude): Add #undef.
-
- * image.c, xfns.c, xmenu.c: Don't include signal.h.
-
-2005-05-09 Juanma Barranquero <[email protected]>
-
- * fileio.c (Fexpand_file_name, Frename_file, Fadd_name_to_file)
- (Fmake_symbolic_link, Faccess_file, Frecent_auto_save_p):
- Doc fixes.
-
- * dired.c (Ffile_name_completion): Make argument name
- match its use in docstring.
-
-2005-05-08 Luc Teirlinck <[email protected]>
-
- * eval.c (Fdefvaralias): Remove any pre-existing
- variable-documentation property of the alias.
-
-2005-05-07 Thien-Thi Nguyen <[email protected]>
-
- * xfns.c (start_hourglass): Do nothing when running on a tty.
-
-2005-05-07 Juanma Barranquero <[email protected]>
-
- * fns.c (Fchar_table_range): Fix typos in docstring.
-
-2005-05-06 Stefan Monnier <[email protected]>
-
- * fns.c (Fchar_table_range): Yet Another Int/Lisp_Object Mixup.
-
-2005-05-06 Eli Zaretskii <[email protected]>
-
- * lread.c (Flocate_file_internal): Doc fix.
-
- * Makefile.in (lisp, shortlisp): Add jka-cmpr-hook.elc.
-
-2005-05-06 YAMAMOTO Mitsuharu <[email protected]>
-
- * macselect.c (x_own_selection): Accept Lisp string as result of
- selection converter function.
- (x_clear_frame_selections): Don't call x-lost-selection-functions
- if Emacs is not owner of the selection.
- (Vmac_services_selection): Put variable and initialization in
- #ifdef MAC_OSX.
- (syms_of_macselect) [MAC_OSX]: Set default value of
- Vmac_services_selection to PRIMARY.
-
- * macterm.c (toolkit_scroll_bar_interaction): Remove unused variable.
- (mac_handle_tool_bar_click): Remove unused function and declaration.
- [USE_TOOLKIT_SCROLL_BARS] (scroll_bar_timer_callback)
- (install_scroll_bar_timer, set_scroll_bar_timer)
- (control_part_code_to_scroll_bar_part, construct_scroll_bar_click)
- (get_control_part_bound, x_scroll_bar_handle_press)
- (x_scroll_bar_handle_release, x_scroll_bar_handle_drag)
- (x_set_toolkit_scroll_bar_thumb): New functions and declarations.
- [USE_TOOLKIT_SCROLL_BARS] (last_scroll_bar_part, scroll_bar_timer)
- (scroll_bar_timer_event_posted_p): New variables.
- [USE_TOOLKIT_SCROLL_BARS] (SCROLL_BAR_FIRST_DELAY)
- (SCROLL_BAR_CONTINUOUS_DELAY): New macros.
- (x_scroll_bar_create): Set control reference with NewControl.
- (x_scroll_bar_create) [USE_TOOLKIT_SCROLL_BARS]:
- Initialize track_top and track_height to nil.
- (x_scroll_bar_set_handle, x_scroll_bar_note_movement):
- Put functions in #ifndef USE_TOOLKIT_SCROLL_BARS.
- (XTset_vertical_scroll_bar): Don't make space between scroll bar
- and associated window.
- (XTset_vertical_scroll_bar) [MAC_OSX]: Get scroll bar area width
- from window config.
- (XTset_vertical_scroll_bar) [USE_TOOLKIT_SCROLL_BARS]:
- Set track_top and track_height to nil when scroll bar size is changed.
- Recalculate them if they are nil.
- (XTread_socket) [MAC_OSX]: Use control kind to determine if the
- clicked control is a scroll bar.
- (XTread_socket) [USE_TOOLKIT_SCROLL_BARS]: Use toolkit scroll bar
- event handler functions. Don't add modifiers to scroll bar click
- events. Call scroll bar release handler when window is deactivated.
- (mac_initialize): Remove unused code for X toolkit.
- (syms_of_macterm) [!USE_TOOLKIT_SCROLL_BARS]:
- Initialize Vx_toolkit_scroll_bars to nil.
-
- * macterm.h (struct scroll_bar) [USE_TOOLKIT_SCROLL_BARS]:
- New members track_top and track_height.
-
- * sysselect.h [DARWIN || MAC_OSX]: Temporarily undefine
- init_process when including sys/select.h.
-
-2005-05-05 Luc Teirlinck <[email protected]>
-
- * eval.c (Fdefvaralias): Doc fix.
-
- * xmenu.c (Fx_popup_menu, Fx_popup_dialog): Doc fixes.
-
-2005-05-05 Kim F. Storm <[email protected]>
-
- * buffer.c (init_buffer_once): Set cursor_in_non_selected_windows
- default value.
- (syms_of_buffer): Add default-cursor-in-non-selected-windows.
- Fix type of cursor-in-non-selected-windows.
-
-2005-05-03 Jan Dj,Ad(Brv <[email protected]>
-
- * mac.c: #undef init_process so not to conflict with system headers.
-
-2005-05-02 Richard M. Stallman <[email protected]>
-
- * buffer.c (syms_of_buffer): Define cursor-in-non-selected-windows.
-
- * buffer.h (struct buffer): Add cursor_in_non_selected_windows slot.
-
- * xdisp.c (Vcursor_in_non_selected_windows)
- (Qcursor_in_non_selected_windows): Vars deleted.
- (syms_of_xdisp): Don't initialize them.
- (get_window_cursor_type): Use cursor_in_non_selected_windows
- buffer slot.
-
-2005-05-02 Kim F. Storm <[email protected]>
-
- * macros.c (executing_kbd_macro_index): Rename from
- executing_macro_index. All uses changed.
- (executing_kbd_macro_iterations): Rename from
- executing_macro_iterations. All uses changed.
- (executing_kbd_macro): Rename from executing_macro.
- All uses changed.
- (syms_of_macros): Rename Lisp var executing-macro-index to
- executing-kbd-macro-index.
-
- * xdisp.c (move_it_in_display_line_to): Fix last change.
-
-2005-05-01 Luc Teirlinck <[email protected]>
-
- * xmenu.c (Fx_popup_menu): Doc fix.
-
- * charset.c (syms_of_charset): Delete defsubr for Schars_in_region.
-
-2005-05-02 Jason Rumney <[email protected]>
-
- * emacs.c (USAGE3, USAGE4): Keep strings below 2048 bytes.
-
-2005-05-02 Nozomu Ando <[email protected]>
-
- * sysselect.h: Fix typo.
-
-2005-05-02 Nick Roberts <[email protected]>
-
- * charset.c (Fchars_in_region): Remove as obsolete.
-
-2005-05-01 Kim F. Storm <[email protected]>
-
- * xdisp.c (move_it_in_display_line_to): Stop if we move beyond
- TO_CHARPOS. This may happen if last glyphs was an image or stretch
- glyph.
-
-2005-05-01 Luc Teirlinck <[email protected]>
-
- * dispnew.c (sit_for): Vexecuting_macro -> Vexecuting_kbd_macro.
-
-2005-05-01 Richard M. Stallman <[email protected]>
-
- * xmenu.c [not HAVE_X_TOOLKIT] (xmenu_show):
- If user cancels the menu, quit unless FOR_CLICK.
-
- * macros.c (Vexecuting_kbd_macro): Rename from Vexecuting_macro.
- All uses changed.
- (syms_of_macros): Define only executing-kbd-macro, not executing-macro.
- * keyboard.c: Change Vexecuting_macro to Vexecuting_kbd_macro.
- * macros.h (Vexecuting_kbd_macro): Declare instead of Vexecuting_macro.
- * commands.h (Vexecuting_kbd_macro): Likewise.
-
-2005-05-01 Thien-Thi Nguyen <[email protected]>
-
- * sysdep.c (get_frame_size) [VMS]: Use a fresh i/o channel.
-
-2005-04-30 Richard M. Stallman <[email protected]>
-
- * fileio.c (Ffind_file_name_handler): Handle the `operations'
- property of the file name handler.
- (Qoperations): New variable.
- (syms_of_fileio): Initialize and staticpro it.
-
- * xdisp.c (set_message_1): Delete xassert.
-
-2005-04-29 YAMAMOTO Mitsuharu <[email protected]>
-
- * mac.c: Don't include time.h. Include sysselect.h after systime.h.
-
- * macfns.c (Fx_server_version): Add BLOCK_INPUT around Gestalt.
-
- * macgui.h [HAVE_CARBON && MAC_OSX]: Don't undefine/define mktime
- before/after including Carbon.h if there is a working mktime.
-
-2005-04-28 Kim F. Storm <[email protected]>
-
- * xfaces.c (resolve_face_name): Add arg SIGNAL_P. Calls changed.
- Fix cyclic alias check. If alias loop is detected, signal
- circular-list error if SIGNAL_P, and return Qdefault if !SIGNAL_P.
-
-2005-04-28 Lute Kamstra <[email protected]>
-
- * eval.c (do_autoload): Record only autoloads in the autoload
- property of symbols.
-
-2005-04-28 Nick Roberts <[email protected]>
-
- * emacs.c (USAGE1): Add --basic-display and --quick options.
-
-2005-04-27 Kim F. Storm <[email protected]>
-
- * data.c (syms_of_data) Staticpro Qcyclic_variable_indirection.
-
-2005-04-26 Richard M. Stallman <[email protected]>
-
- * window.c (Fsame_window_p, Fspecial_display_p): Doc fixes.
- (syms_of_window): Doc fixes.
-
- * indent.c (Fvertical_motion): Undo previous change.
-
-2005-04-26 Kenichi Handa <[email protected]>
-
- * fns.c (char_table_range): New function.
- (Fchar_table_range): Signal an error if characters in the range
- have inconsistent values. Don't check the parent.
-
-2005-04-25 Kenichi Handa <[email protected]>
-
- * fontset.c (fontset_set): Fix previous change.
-
-2005-04-24 Richard M. Stallman <[email protected]>
-
- * indent.c (Fvertical_motion): Bind fontification-functions to nil.
-
-2005-04-24 Eli Zaretskii <[email protected]>
-
- * regex.c (re_search_2, re_match_2_internal): Convert second arg
- of RE_TRANSLATE to int, to shut up GCC warnings.
-
- * fileio.c (Fcopy_file): Doc fix.
- [MSDOS]: Fix call to emacs_open: buffer_file_type not defined and
- not needed.
-
-2005-04-24 YAMAMOTO Mitsuharu <[email protected]>
-
- * Makefile.in [HAVE_CARBON] (MAC_OBJ): Add macselect.o.
- (SOME_MACHINE_OBJECTS): Likewise.
- (mac.o): Depend on ccl.h.
- (macselect.o): New target.
-
- * emacs.c (main) [MAC_OS8 || MAC_OSX && HAVE_CARBON]:
- Call syms_of_macselect.
-
- * frame.c (Fdelete_frame) [MAC_OS]: Call x_clear_frame_selections.
-
- * mac.c [!TARGET_API_MAC_CARBON]: Don't include charset.h or coding.h.
- (QCLIPBOARD): Remove variable.
- (syms_of_mac): Don't initialize it.
- (Fmac_paste_function, Fmac_cut_function, Fx_selection_exists_p):
- Remove functions.
- (syms_of_mac): Don't defsubr them.
- [TARGET_API_MAC_CARBON] (Qmime_charset, QNFD, QNFKD, QNFC, QNFKC)
- (QHFS_plus_D, QHFS_plus_C): New variables.
- (syms_of_mac) [TARGET_API_MAC_CARBON]: Initialize them.
- [TARGET_API_MAC_CARBON] (get_cfstring_encoding_from_lisp)
- (cfstring_create_normalized): New functions.
- [TARGET_API_MAC_CARBON] (Fmac_code_convert_string): Likewise.
- (syms_of_mac) [TARGET_API_MAC_CARBON]: Defsubr it.
-
- * macterm.c (handling_window_update, terminate_flag):
- Remove variables.
- (do_window_update, do_ae_quit_application, XTread_socket):
- Don't use them.
- (WNE_SLEEP_AT_SUSPEND, WNE_SLEEP_AT_RESUME): Don't define.
- [USE_CARBON_EVENTS && MAC_OSX] (mac_handle_service_event)
- (init_service_handler): Move to macselect.c. Remove declarations.
- [USE_CARBON_EVENTS && MAC_OSX] (init_service_handler): Add extern.
- (Qapplication, Qabout): New variables.
- (syms_of_mac): Initialize them.
- [USE_CARBON_EVENTS && MAC_OSX] (Qpreferences, Qservices, Qpaste)
- (Qperform): New variables.
- (syms_of_mac) [USE_CARBON_EVENTS && MAC_OSX]: Initialize them.
- (do_get_menus) [TARGET_API_MAC_CARBON]: Don't call AppendResMenu.
- (do_menu_choice): Unhighlight menu bar also when menu_id is 0.
- (mac_store_application_menu_event, init_menu_bar): New functions.
- [USE_CARBON_EVENTS] (mac_handle_command_event)
- (init_command_handler): New functions.
- (mac_handle_window_event): Return noErr on window update event.
- (do_ae_quit_application): Call mac_store_application_menu_event.
- (mac_initialize) [USE_CARBON_EVENTS]: Call init_command_handler
- and init_menu_bar.
-
- * macterm.h (x_clear_frame_selections): Add extern.
-
- * macselect.c: New file for selection processing on Mac OS.
-
-2005-04-23 Richard M. Stallman <[email protected]>
-
- * fileio.c (Fcopy_file): New arg MUSTBENEW.
- (Frename_file): Pass new arg to Fcopy_file.
-
- * window.c (window_size_fixed): Variable deleted.
- (syms_of_window): Initialize window-size-fixed to nil.
- But don't DEFVAR window_size_fixed.
-
-2005-04-23 Andreas Schwab <[email protected]>
-
- * m/macppc.h (LD_SWITCH_MACHINE) [LINUX]: Don't define.
- (START_FILES, LIB_STANDARD) [LINUX && _ARCH_PPC64]: Override to
- use lib64 instead of lib.
- (_LP64) [_ARCH_PPC64]: Define if not defined.
-
-2005-04-23 David Hunter <[email protected]> (tiny change)
-
- * s/ms-w32.h (HAVE_PWD_H): Define.
-
-2005-04-22 Kenichi Handa <[email protected]>
-
- * fns.c (copy_sub_char_table): Explicitly copy the default value
- of the sub-chartable.
-
- * fontset.c (fontset_set): When a sub-chartable is created,
- explicitly sets the defalt value.
-
-2005-04-22 Kim F. Storm <[email protected]>
-
- * fns.c (Fplist_get): Replace by Fsafe_plist_get.
- (Fsafe_plist_get): Rename to Fplist_get.
- (Fsafe_get): Remove, as Fget now uses safe Fplist_get.
- (defsubr): Remove defsubr for Fsafe_plist_get and Fsafe_get.
-
- * lisp.h (Fsafe_plist_get, Fsafe_get): Remove EXFUN.
-
- * xdisp.c (store_mode_line_string, produce_stretch_glyph)
- (note_mode_line_or_margin_highlight, note_mouse_highlight):
- Use Fplist_get instead of Fsafe_plist_get.
-
- * xfaces.c (resolve_face_name): Use Fget instead of Fsafe_get.
-
-2005-04-21 Miles Bader <[email protected]>
-
- * xdisp.c (dump_glyph_row): Don't display overlay_arrow_p field.
-
-2005-04-20 Thien-Thi Nguyen <[email protected]>
-
- * sysdep.c: Remove reference to defunct vms-pwd.h.
- * dired.c: Likewise. Also, for pwd.h, use HAVE_PWD_H, not !VMS.
- * editfns.c, fileio.c, filelock.c, sysdep.c, xrdb.c: Likewise.
-
- * config.in: Regenerate.
-
-2005-04-20 Kenichi Handa <[email protected]>
-
- * lisp.h (CHAR_TABLE_DEFAULT_SLOT_ASCII): New macro.
- (CHAR_TABLE_DEFAULT_SLOT_8_BIT_CONTROL): New macro.
- (CHAR_TABLE_DEFAULT_SLOT_8_BIT_GRAPHIC): New macro.
-
- * alloc.c (make_sub_char_table): Argument changed to initial
- value of the slots.
-
- * data.c (Faref): Handle special slots used as default values of
- ascii, eight-bit-control, eight-bit-control. Don't ignore a
- default value set for a group of characters.
- (Faset): Signal an error if IDXVAL is not a valid character code.
- Make a sub-chartable with correct initial value.
-
- * fns.c (Fset_char_table_range): Don't set slots used as default
- values for ascii, eight-bit-control, eight-bit-graphic.
- Don't call Faref with charset-id.
- (Fset_char_table_default): Document how to treat normal character
- argument. Handle special slots used as default values of ascii,
- eight-bit-control, eight-bit-control. Make a sub chartable if
- necessary.
-
-2005-04-20 Kenichi Handa <[email protected]>
-
- * search.c (boyer_moore): Fix previous change.
-
-2005-04-19 Kim F. Storm <[email protected]>
-
- * xdisp.c (setup_for_ellipsis): Reset saved_face_id to use default
- face unless last visible char and first invisible char have the
- same face. Also use default face if saved_face_id is undefined.
-
-2005-04-19 YAMAMOTO Mitsuharu <[email protected]>
-
- * macgui.h (MacFontStruct): Remove member `fontname'. Add member
- `full_name'.
- [TARGET_API_MAC_CARBON] (MacFontStruct): Use type int for
- mac_scriptcode member.
-
- * macterm.c (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
- (syms_of_mac): Don't initialize them.
- (Vmac_charset_info_alist): New variable.
- (syms_of_mac): Defvar it.
- (create_text_encoding_info_alist): New function.
- (decode_mac_font_name, mac_to_x_fontname)
- (x_font_name_to_mac_font_name, init_font_name_table): Don't hard
- code the correspondence among XLFD charsets, Mac script codes, and
- Emacs coding systems. Use Vmac_charset_info_alist and result of
- create_text_encoding_info_alist instead.
- (init_font_name_table) [TARGET_API_MAC_CARBON]: Use Font Manager
- routines also on Mac OS Classic.
- (init_font_name_table) [!TARGET_API_MAC_CARBON]:
- Use add_font_name_table_entry.
- (mac_do_list_fonts): Regard 0 in XLFD scaleble fields as
- specified. Derive unspecified scalable fields from specified one.
- (x_list_fonts): Consider Valternate_fontname_alist.
- (kDefaultFontSize): Change value from 9 to 12.
- (XLoadQueryFont): Get decoded font family, font face, and charset
- from x_font_name_to_mac_font_name. Set full name of loaded font.
- (mac_unload_font): Free `full_name' member.
- (x_load_font): Don't try XLoadQueryFont if x_list_fonts returns
- NULL. Copy full_name member of struct MacFontStruct to that of
- struct font_info.
-
-2005-04-19 Kim F. Storm <[email protected]>
-
- * xdisp.c (handle_stop): Set saved_face_id to current face if
- selective_display_ellipsis_p so ellipsis will be shown in same
- face as preceding text.
- (setup_for_ellipsis): Don't set saved_face_id here.
- (next_element_from_display_vector): Default to saved_face_id.
-
- * fns.c (Fsafe_get): New function.
- (syms_of_fns): Defsubr it.
-
- * lisp.h (Fsafe_get): EXFUN it.
-
- * xfaces.c (resolve_face_name): Use Fsafe_get to avoid redisplay
- loops in case of bad face property lists. Limit number of face
- alias lookups to 10 (in case of face alias loops).
-
-2005-04-18 Kim F. Storm <[email protected]>
-
- * dispextern.h (struct glyph_row): New member overlay_arrow_bitmap.
- It replaces the corresponding member from struct window, as a
- window may now show multiple overlay arrows.
- Remove member overlay_arrow_p, superseeded by overlay_arrow_bitmap.
-
- * dispnew.c (row_equal_p, update_window_line, scrolling_window):
- Compare overlay_arrow_bitmap than overlay_arrow_p members.
-
- * fringe.c (draw_fringe_bitmap): Use overlay_arrow_bitmap from row
- rather than from window.
- (update_window_fringes): Compare overlay_arrow_bitmap rather than
- overlay_arrow_p members.
- (Ffringe_bitmaps_at_pos): Return fringe overlay_arrow_bitmap name
- if not default.
-
- * window.h (struct window): Remove member overlay_arrow_bitmap.
-
- * window.c (make_window): Don't initialize overlay_arrow_bitmap.
-
- * xdisp.c (overlay_arrow_string_or_property): Remove PBITMAP arg.
- Calls changed. Don't check for overlay-arrow-bitmap property here.
- (overlay_arrow_at_row): Remove PBITMAP arg. Instead, if left
- fringe is present, return Lisp integer for bitmap (or -1 for default).
- Fix value of overlay-arrow-bitmap property to be a symbol, use
- lookup_fringe_bitmap to parse it.
- (display_line): Change call to overlay_arrow_at_row. Store integer
- return value as overlay bitmap in row rather than window.
- Only show overlay arrow if row displays text, or if no other overlay
- arrow is seen in window (if overlay marker is at point-max).
-
-2005-04-18 Thien-Thi Nguyen <[email protected]>
-
- * xfaces.c (realize_x_face) [!HAVE_WINDOW_SYSTEM]: Return NULL.
-
-2005-04-18 Lute Kamstra <[email protected]>
-
- * lread.c (Vloads_in_progress): Static.
- * fns.c (Vloads_in_progress): Remove extern.
- (load_in_progress): Add extern.
- (Frequire): Use load_in_progress instead of Vloads_in_progress.
-
-2005-04-18 Thien-Thi Nguyen <[email protected]>
-
- * xmenu.c (Fx_popup_menu): Initialize error_name to NULL.
-
-2005-04-18 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.c (XTread_socket): Don't beep on keyboard input even if
- no frame is visible.
-
-2005-04-16 Dan Nicolaescu <[email protected]>
-
- * term.c (struct keys): Add support for shifted keys.
-
-2005-04-16 Richard M. Stallman <[email protected]>
-
- * xdisp.c (with_echo_area_buffer): Delete WHICH < 0 case.
- (set_message): Call with_echo_area_buffer with WHICH = 0.
- (set_message_1): Erase the echo area buffer first thing.
- (echo_area_display): Don't clear echo_message_buffer.
-
-2005-04-16 YAMAMOTO Mitsuharu <[email protected]>
-
- * Makefile.in (mac.o): Depend on charset.h and coding.h.
-
- * mac.c: Include charset.h and coding.h.
- [TARGET_API_MAC_CARBON] (Qutf_8): Remove extern.
- [TARGET_API_MAC_CARBON] (cfstring_create_with_string): New function.
- [TARGET_API_MAC_CARBON] (Fmac_get_preference): Use it.
-
- * macfns.c [TARGET_API_MAC_CARBON] (Fx_file_dialog): Likewise.
-
- * image.c [MAC_OSX] (image_load_quartz2d): Likewise.
-
- * macterm.c (x_autoselect_window_p): Remove variable.
- (last_window): New variable.
- (XTreassert_line_highlight, x_change_line_highlight):
- Remove declarations.
- (mac_focus_changed, x_detect_focus_change): New functions and
- declarations.
- (XTextExtents16, front_emacs_window): Remove function.
- (mac_focus_frame): New function.
- (XTmouse_position, do_menu_choice, do_zoom_window, XTread_socket)
- (mac_check_for_quit_char): Use it instead of front_emacs_window.
- (x_scroll_bar_report_motion): Obtain window from control owner.
- (x_make_frame_invisible): Set window manager size hint.
- (do_mouse_moved): Remove function.
- (XTread_socket): Move its contents here. Generate select-window
- event on mouse movement if needed. Use x_detect_focus_change on
- activate/deactivate events. Don't deiconify frame or invalidate
- window rectangle when dnd items are dropped.
- Don't activate/deactivate root control.
- (frame_highlight, frame_unhighlight): Activate/deactivate root
- control here.
- (syms_of_macterm): Delete DEFVAR_BOOL for x_autoselect_window_p.
-
- * macterm.h (cfstring_create_with_string) [TARGET_API_MAC_CARBON]:
- New extern.
-
-2005-04-15 Luc Teirlinck <[email protected]>
-
- * Makefile.in: Define new macro TOOLTIP_SUPPORT.
- (lisp): Use it.
- (SOME_MACHINE_LISP): Add tooltip.
-
-2005-04-14 YAMAMOTO Mitsuharu <[email protected]>
-
- * mac.c [!TARGET_API_MAC_CARBON]: Include MacLocales.h.
- Don't include TextEncodingConverter.h.
- (mac_system_script_code, Vmac_system_locale): New variables.
- (syms_of_mac): Defvar them.
- (mac_get_system_locale): New function.
-
- * macfns.c (x_set_name, x_set_title) [!TARGET_API_MAC_CARBON]:
- Use ENCODE_SYSTEM to encode title bar string.
- (x_create_tip_frame): Apply 2005-03-18 change for xfns.c.
- (Fx_file_dialog) [TARGET_API_MAC_CARBON && !MAC_OSX]:
- Use CFStringGetSystemEncoding to get system default string encoding.
-
- * macterm.c [!TARGET_API_MAC_CARBON]: Don't include
- TextEncodingConverter.h.
-
-2005-04-13 Steven Tamm <[email protected]>
-
- * macterm.c (syms_of_macterm): Remove redundant definition of
- mac-pass-control-to-system.
-
-2005-04-12 Stefan Monnier <[email protected]>
-
- * window.c (Fset_window_configuration): Be careful when you choose
- among several possible points for the new_current_buffer.
-
-2005-04-12 YAMAMOTO Mitsuharu <[email protected]>
-
- * keyboard.c (poll_for_input) [SYNC_INPUT]: Don't call
- poll_for_input_1. Set interrupt_input_pending to 1 instead.
- (Qlanguage_change) [MAC_OS]: New variable.
- (syms_of_keyboard) [MAC_OS]: Intern and staticpro it.
- (kbd_buffer_get_event) [MAC_OS]: Make event for LANGUAGE_CHANGE_EVENT.
-
- * macterm.c (mac_keyboard_text_encoding)
- (current_mac_keyboard_text_encoding): Remove variables.
- (XTread_socket): Store language-change event if keyboard script change
- is detected. Don't convert input to `mac_keyboard_text_encoding'.
- (syms_of_macterm): Delete DEFVAR_INT for mac-keyboard-text-encoding.
-
- * termhooks.h (enum event_kind) [MAC_OS]: Add LANGUAGE_CHANGE_EVENT.
-
-2005-04-10 Richard M. Stallman <[email protected]>
-
- * emacs.c (standard_args): Rename --bare-bones to --quick.
- Add -D aka --basic-display.
-
- * buffer.c (Fmake_indirect_buffer): Clear out some local variables.
-
-2005-04-09 Richard M. Stallman <[email protected]>
-
- * keymap.c (where_is_internal): Convert a string used as event type
- into "(any string)".
-
- * lread.c (Vloads_in_progress): Not static.
- * fns.c (Vloads_in_progress): Add extern.
- (Frequire): Don't do LOADHIST_ATTACH if Vloads_in_progress is nil.
-
-2005-04-09 Thien-Thi Nguyen <[email protected]>
-
- * dispnew.c (mirror_line_dance): Avoid crash if W2 is null.
-
-2005-04-09 Lute Kamstra <[email protected]>
-
- * print.c (PRINTPREPARE): Check if the marker PRINTCHARFUN is
- within the accessible part of the buffer.
-
-2005-04-09 Kim F. Storm <[email protected]>
-
- * lread.c (readevalloop): Add args START and END as region in
- current buffer to read. Callers changed.
- When specified, narrow to this region only when reading,
- not during eval. Track next point to read from during eval.
- Also restore point to "real" buffer position before eval.
- (Feval_region): Don't save excursion and restriction here, and
- don't narrow to region. Just pass region to readevalloop.
- Note: Point is now preserved even when PRINTFLAG is nil.
-
-2005-04-08 Kim F. Storm <[email protected]>
-
- * xdisp.c (syms_of_xdisp): Init overlay-arrow-string to "=>".
-
-2005-04-06 Kim F. Storm <[email protected]>
-
- * emacs.c (standard_args): Add -Q, --bare-bones, -bare-bones.
-
-2005-04-06 YAMAMOTO Mitsuharu <[email protected]>
-
- * mac.c (cfdate_to_lisp): Add `const' for variable `epoch_gdate'.
- (Fmac_get_preference): Doc fix.
-
- * macfns.c (Fx_create_frame, x_create_tip_frame):
- Add "fontset-mac" to fallback font/fontsets.
-
-2005-04-04 Kim F. Storm <[email protected]>
-
- * alloc.c (Fgarbage_collect): Call CHECK_CONS_LIST before and after gc.
-
- * eval.c (Ffuncall): Always call CHECK_CONS_LIST on entry.
- Call it again after autoload.
-
-2005-04-02 Jan Dj,Ad(Brv <[email protected]>
-
- * alloc.c (allocate_string_data): Call BLOCK_INPUT before calling
- mallopt.
-
- * ralloc.c (r_alloc_init): Ditto.
-
-2005-04-01 Kenichi Handa <[email protected]>
-
- * lisp.h (Vascii_upcase_table, Vascii_canon_table)
- (Vascii_eqv_table): Extern them.
-
- * casetab.c (set_case_table): If standard is nonzero, setup
- Vascii_upcase_table, Vascii_canon_table, and Vascii_eqv_table.
-
- * search.c (looking_at_1): Use current_buffer->case_canon_table,
- not DOWNCASE_TABLE.
- (string_match_1): Likewise.
- (fast_c_string_match_ignore_case): Use Vascii_canon_table, not
- Vascii_downcase_table.
- (fast_string_match_ignore_case): Likewise.
- (search_buffer): Fix checking of boyer-moore usability.
- (boyer_moore): Calculate translate_prev_byte1/2/3 in advance.
- No need of tranlating characters in PAT. Fix calculation of
- simple_translate.
-
-2005-03-31 Stefan Monnier <[email protected]>
-
- * xterm.c [HAVE_XAW3D]: Include ThreeD.h for XtNbeNiceToColormap.
- (x_create_toolkit_scroll_bar): Test XtNbeNiceToColormap before using it.
- Use XtNtopShadowPixel and XtNbottomShadowPixel.
- (x_set_toolkit_scroll_bar_thumb): Remove ugly old hack that didn't
- really work and that breaks with some versions of Xaw3d.
-
-2005-03-31 Kenichi Handa <[email protected]>
-
- * coding.c (syms_of_coding): Fix previous change.
-
-2005-03-30 Stefan Monnier <[email protected]>
-
- * fileio.c (search_embedded_absfilename): Fix last change.
-
-2005-03-25 Kenichi Handa <[email protected]>
-
- * coding.c (syms_of_coding): Suggest to use set-coding-category in
- the docstring of coding-category-list.
-
-2005-03-31 Kim F. Storm <[email protected]>
-
- * keyboard.c (Qmouse_fixup_help_message): New var.
- (syms_of_keyboard): Intern and staticpro it.
- (show_help_echo): Apply mouse-fixup-help-message to help string.
-
-2005-03-30 Kim F. Storm <[email protected]>
-
- * xdisp.c (display_line): Allow multiple overlay arrows in window.
-
-2005-03-28 Stefan Monnier <[email protected]>
-
- * fileio.c (Fexpand_file_name): Use IS_DEVICE_SEP.
- (file_name_absolute_p): New fun, extracted from Ffile_name_absolute_p.
- (Ffile_name_absolute_p): Use it.
- (search_embedded_absfilename): New fun, extracted from
- Fsubstitute_in_file_name. Use file_name_absolute_p.
- Free the pw data after use.
- (Fsubstitute_in_file_name): Use it.
- After cutting a prefix, re-check file-name-handler.
-
-2005-03-26 Lennart Borgman <[email protected]>
-
- * w32term.h (x_output): Add focus_state.
-
- * w32term.c (x_focus_changed, w32_detect_focus_change): New functions.
- (w32_read_socket) <WM_SETFOCUS>: Call w32_detect_focus_change.
-
-2005-03-25 Stefan Monnier <[email protected]>
-
- * minibuf.c (Fminibuffer_complete_and_exit, Fself_insert_and_exit):
- Use Fexit_minibuffer.
- (Fexit_minibuffer): Mark it as no-return, deactivate the mark.
-
-2005-03-24 Stefan Monnier <[email protected]>
-
- * dired.c (Ffile_attributes): Add a missing gcpro.
-
- * alloc.c (make_number): The arg can be bigger than `int'.
- * lisp.h (make_number): Make prototype more precise.
-
- * process.c, dired.c (Vfile_name_coding_system)
- (Vdefault_file_name_coding_system):
- * callproc.c (Vdoc_file_name, Vfile_name_coding_system)
- (Vdefault_file_name_coding_system): Remove unused declarations.
-
-2005-03-24 Jan Dj,Ad(Brv <[email protected]>
-
- * xmenu.c (create_and_show_popup_menu): Just remove menu and return
- if it failed to pop up (Gnome "show pointer on ctrl" option makes
- menus fail to pop up).
-
-2005-03-24 Stefan Monnier <[email protected]>
-
- * xdisp.c (get_next_display_element): Also use `\ ' & `\-' for latin-9.
- Just prepend a backslash without replacing the NBSP by an SPC.
-
-2005-03-22 Kim F. Storm <[email protected]>
-
- * xfaces.c (lookup_derived_face): Add arg SIGNAL_P.
- * dispextern.h (lookup_derived_face): Fix prototype.
- * msdos.c (XMenuActivate): Fix call to lookup_derived_face.
-
- * xdisp.c (handle_single_display_spec): Derive left-fringe and
- right-fringe face from fringe face.
-
- * fringe.c (draw_fringe_bitmap_1, Fset_fringe_bitmap_face):
- Derive face from fringe face.
-
-2005-03-22 Jan Dj,Ad(Brv <[email protected]>
-
- * xrdb.c (x_load_resources): Undo previous change (2005-03-18).
-
-2005-03-22 David Kastrup <[email protected]>
-
- * textprop.c (Fnext_char_property_change)
- (Fprevious_char_property_change): Allow marker as limit.
- (Fnext_single_char_property_change)
- (Fprevious_single_char_property_change): Check that limit is a
- number in strings.
- (Fnext_single_char_property_change): Coerce position to integer.
- (Fprevious_single_char_property_change): Same here.
-
-2005-03-21 Thien-Thi Nguyen <[email protected]>
-
- * s/openbsd.h (LD_SWITCH_SYSTEM_tmp): Define if undefined.
-
-2005-03-19 Stefan Monnier <[email protected]>
-
- * frame.c (Fignore_event): Remove.
- (syms_of_frame): Don't defsubr it.
-
- * keyboard.c (keys_of_keyboard): Just use `ignore' instead of the
- redundant `ignore-event'.
-
-2005-03-19 Eli Zaretskii <[email protected]>
-
- * unexec.c (write_segment, unexec): Move these functions to avoid
- forward references (which cause errors with "gcc -gcoff").
-
-2005-03-18 Jan Dj,Ad(Brv <[email protected]>
-
- * xfns.c (x_create_tip_frame): Remove setting of Vx_resource_name so
- that it doesn't become "tooltip". The specbind is enough.
-
- * xrdb.c (x_load_resources): Use different char *helv when I18N
- is present.
-
-2005-03-17 Kenichi Handa <[email protected]>
-
- * coding.c (syms_of_coding): Docstring of coding-category-list fixed.
-
-2005-03-17 Stefan Monnier <[email protected]>
-
- * xfaces.c (x_update_menu_appearance) [HAVE_X_I18N]:
- Use xic_create_fontsetname even for non-Motif menus.
- Don't forget to free the fontsetname.
-
- * xfns.c (xic_create_fontsetname): Add a final catch-all font pattern.
-
-2005-03-17 Richard M. Stallman <[email protected]>
-
- * dispnew.c (mirror_line_dance): Set W2 according to FRAME_FROM.
-
- * fileio.c (Fcopy_file, Frename_file, Fadd_name_to_file)
- (Fmake_symbolic_link): Use G to read the new file name.
-
- * callint.c (Finteractive): Document G option.
- (Fcall_interactively): Implement G option.
-
- * buffer.c (buffer_lisp_local_variables): New function,
- broken out from Fbuffer_local_variables.
- (clone_per_buffer_values): Use buffer_lisp_local_variables.
-
-2005-03-17 Stefan Monnier <[email protected]>
-
- * xfns.c (xic_create_fontsetname): Add `motif' argument.
- Always return a freshly allocated string.
- (xic_create_xfontset): Adjust call.
-
- * xfaces.c (x_update_menu_appearance) [USE_MOTIF]:
- Use xic_create_fontsetname to create a fontset so utf-8 locales work.
- (dump_realized_face): Fix warning.
-
- * emacs.c (Fkill_emacs): YAILOM.
-
- * frame.c (Fignore_event): Fix ancient obscure C-u handling bug.
-
-2005-03-17 YAMAMOTO Mitsuharu <[email protected]>
-
- * mac.c (HASHKEY_TERMINAL): Remove.
- (HASHKEY_MAX_NID): New macro.
- (xrm_q_get_resource_1): Rename from xrm_q_get_resource. Add extra
- argument.
- (xrm_q_get_resource): Call xrm_q_get_resource_1 with extra argument.
- (xrm_create_database, xrm_q_put_resource)
- (xrm_merge_string_database, xrm_q_get_resource_1)
- (xrm_q_get_resource): Change resource database representation so
- that it may not use multiple hash tables for a single database.
- [TARGET_API_MAC_CARBON] (xrm_cfproperty_list_to_value): YAILOM.
-
-2005-03-16 Stefan Monnier <[email protected]>
-
- * xmenu.c (ENCODE_MENU_STRING) [HAVE_X_I18N]: Use ENCODE_SYSTEM.
-
- * coding.h (ENCODE_SYSTEM, DECODE_SYSTEM) [!WINDOWSNT]: Use the
- locale-coding-system, as was already done for WINDOWSNT.
-
- * keyboard.c (read_char): Only do the 7-bit-meta -> 27-bit-meta
- translation for chars in the 0-255 range.
-
-2005-03-16 Lute Kamstra <[email protected]>
-
- * floatfns.c (Ffloor): Doc fix.
-
-2005-03-16 YAMAMOTO Mitsuharu <[email protected]>
-
- * mac.c: Include macterm.h instead of directly including Carbon.h.
- [TARGET_API_MAC_CARBON] (Qstring, Qnumber, Qboolean, Qdate, Qdata)
- (Qarray, Qdictionary): New variables.
- (syms_of_mac) [TARGET_API_MAC_CARBON]: Initialize them.
- [TARGET_API_MAC_CARBON] (Qutf_8): Add extern.
- [TARGET_API_MAC_CARBON] (DECODE_UTF_8): New macro.
- [TARGET_API_MAC_CARBON] (struct cfdict_context): New struct used
- in callback for CFDictionaryApplyFunction.
- [TARGET_API_MAC_CARBON] (cfdata_to_lisp, cfstring_to_lisp)
- (cfnumber_to_lisp, cfdate_to_lisp, cfboolean_to_lisp)
- (cfobject_desc_to_lisp, cfdictionary_add_to_list)
- (cfdictionary_puthash, cfproperty_list_to_lisp): New functions.
- [TARGET_API_MAC_CARBON] (Fmac_get_preference): New function.
- (syms_of_mac) [TARGET_API_MAC_CARBON]: Defsubr it.
- (P, LOOSE_BINDING, SINGLE_COMPONENT, HASHKEY_TERMINAL): New macro.
- (skip_white_space, parse_comment, parse_include_file)
- (parse_binding, parse_component, parse_resource_name, parse_value)
- (parse_resource_line, xrm_create_database, xrm_q_put_resource)
- (xrm_merge_string_database, xrm_q_get_resource, xrm_get_resource)
- (xrm_cfproperty_list_to_value, xrm_get_preference_database):
- New functions.
-
- * macfns.c (mac_get_rdb_resource): Remove function.
- (x_get_string_resource): Use xrm_get_resource.
-
- * macgui.h (XrmDatabase): Typedef to Lisp_Object.
-
- * macterm.c (x_list_fonts): FONT-LIST-CACHE is now cadr part of
- name_list_element.
- (mac_make_rdb): Create resource database from preferences and
- argument string.
- (mac_term_init): Save resource database to cddr part of
- name_list_element.
-
- * macterm.h (xrm_merge_string_database, xrm_get_resource)
- (xrm_get_preference_database): Add externs.
- [TARGET_API_MAC_CARBON] (cfdata_to_lisp, cfstring_to_lisp)
- (cfnumber_to_lisp, cfdate_to_lisp, cfboolean_to_lisp)
- (cfobject_desc_to_lisp, cfproperty_list_to_lisp): Likewise.
-
- * process.c (init_process): Change `#ifdef DARWIN' to `#if
- defined (DARWIN) || defined (MAC_OSX)'.
-
- * s/darwin.h (DARWIN): Don't define.
-
-2005-03-16 YAMAMOTO Mitsuharu <[email protected]>
-
- * macfns.c (Qhyper, Qsuper, Qmeta, Qalt, Qctrl, Qcontrol, Qshift):
- Remove unused variables.
- (syms_of_macfns): Don't initialize them. Likewise for
- Qface_set_after_frame_default. Defvar and initialize
- Vx_window_horizontal_drag_shape.
- (x_set_mouse_color): Change mouse pointer shape.
- (mac_window) [!MAC_OSX]: Create root control.
- (Fx_create_frame): Remove initializations of mouse pointer shapes.
- (hourglass_started): New function (from xfns.c).
- (start_hourglass, cancel_hourglass): Put function body in #ifdef
- MAC_OSX.
- (show_hourglass) [TARGET_API_MAC_CARBON]: Create progress
- indicator for each non-tooltip frame if needed, and show it.
- (hide_hourglass) [TARGET_API_MAC_CARBON]: Hide progress indicators.
-
- * macgui.h [!TARGET_API_MAC_CARBON]: Include Appearance.h and
- Controls.h. Use ThemeCursor instead of CursHandle.
-
- * macterm.c (activate_scroll_bars, deactivate_scroll_bars):
- Remove functions and declarations.
- (mac_set_colors): Take argument for saving background color.
- All callers changed.
- (XDrawLine, XClearArea, mac_draw_bitmap, XFillRectangle)
- (mac_draw_rectangle, mac_draw_string_common): Save and Restore
- background color.
- (x_update_end, mac_do_track_drag): Don't reset background color.
- (mac_define_frame_cursor) [!TARGET_API_MAC_CARBON]:
- Use SetThemeCursor.
- (x_set_window_size) [TARGET_API_MAC_CARBON]: Move progress
- indicator control to the upper-right corner of the window.
- (arrow_cursor) [!TARGET_API_MAC_CARBON]: Remove variable.
- (do_init_managers) [!TARGET_API_MAC_CARBON]: Don't initialize it.
- (do_window_update): Update controls after updating content area.
- (mac_handle_window_event): Remove unused extern.
- (XTread_socket): Check both control handle and control part code
- to determine whether a scroll bar is clicked. Activate/deactivate
- root control instead of contained scroll bar controls.
- (make_mac_terminal_frame): Use ThemeCursor constants.
-
- * macterm.h (struct mac_output) [TARGET_API_MAC_CARBON]:
- New member hourglass_control.
- (HOURGLASS_WIDTH, HOURGLASS_HEIGHT): New defines.
- (activate_scroll_bars, deactivate_scroll_bars): Remove declarations.
-
-2005-03-15 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.c (keycode_to_xkeysym_table): Change mapping so that it
- coincides with that in Apple X11 except `clear', `enter' on
- laptops, and fn + `enter' on laptops.
-
-2005-03-12 Stefan Monnier <[email protected]>
-
- * xmenu.c (ENCODE_MENU_STRING): Explicitly use string_make_unibyte.
- (list_of_panes, list_of_items, Fx_popup_menu): Use XCAR/XCDR.
- (digest_single_submenu, xmenu_show): Use ENCODE_MENU_STRING.
-
- * xfns.c (xic_defaut_fontset): New constant.
- (xic_create_fontsetname): New function.
- Extracted from create_frame_xic. Try to generate a slightly
- better fontset.
- (xic_create_xfontset): Use it.
- (create_frame_xic): Simplify.
-
-2005-03-11 Stefan Monnier <[email protected]>
-
- * fileio.c (Fmake_symbolic_link): Fix last change.
-
-2005-03-11 Richard M. Stallman <[email protected]>
-
- * fileio.c (Frename_file, Fadd_name_to_file)
- (Fmake_symbolic_link): If NEWNAME or LINKNAME is a directory,
- expand the basename of FILE relative to it.
-
-2005-03-11 Kenichi Handa <[email protected]>
-
- * fileio.c (Finsert_file_contents): Call Fcheck_coding_system
- before calling setup_coding_system so that autoloading of a coding
- system work.
-
-2005-03-10 Jan Dj,Ad(Brv <[email protected]>
-
- * xfns.c (hourglass_started): New function.
-
- * dispextern.h: Declare hourglass_started.
-
- * keyboard.c (Fexecute_extended_command): Restart hourglass
- after call to Fcompleting_read if already started.
-
- * gtkutil.c (xg_update_scrollbar_pos): Call x_sync so that the
- GTK main loop is entered in xterm.c, thus doing the redraw.
-
-2005-03-10 Kim F. Storm <[email protected]>
-
- * xdisp.c (pos_visible_p): Fix X value in last line of buffer.
-
-2005-03-08 Kenichi Handa <[email protected]>
-
- * frame.c (x_set_font): Call set_default_ascii_font if an
- available font is found.
-
- * fontset.c (set_default_ascii_font): New function.
- (syms_of_fontset): Don't set FONTSET_ASCII (Vdefault_fontset) here.
-
- * fontset.h (set_default_ascii_font): Extern it.
-
-2005-03-07 Kim F. Storm <[email protected]>
-
- * xdisp.c (CLEAR_IMAGE_CACHE_COUNT): New const.
- (clear_image_cache_count): New var.
- (redisplay_internal): Don't clear face and image caches in the
- middle of redisplay; do it afterwards.
-
- * blockinput.h (TOTALLY_UNBLOCK_INPUT): Avoid dangling else.
-
- * xdisp.c (notice_overwritten_cursor): Check that phys_cursor.vpos
- is valid. If not, clear phys_cursor_on_p and return.
-
-2005-03-07 Andreas Schwab <[email protected]>
-
- * blockinput.h (UNBLOCK_INPUT_TO): Always call UNBLOCK_INPUT.
-
-2005-03-06 Richard M. Stallman <[email protected]>
-
- * keyboard.c (Ftop_level): Let Fthrow deal with UNBLOCK_INPUT.
-
- * eval.c (unwind_to_catch): Use UNBLOCK_INPUT_TO.
- (Feval, Ffuncall): Use CHECK_CONS_LIST.
-
- * lisp.h (CHECK_CONS_LIST): New macro (two definitions).
-
- * blockinput.h (UNBLOCK_INPUT_TO): New macro.
- (TOTALLY_UNBLOCK_INPUT): Handle a pending signal if any.
-
-2005-03-05 Juri Linkov <[email protected]>
-
- * emacs.c (USAGE1): Replace Info node name "command arguments"
- with "emacs invocation".
- (USAGE3): Fix usage of `--color=MODE' which actually doesn't
- allow arguments `--color' and `MODE' to be separated by space.
- Add --no-blinking-cursor, -nbc.
- (standard_args): Add -nbc, --no-blinking-cursor.
-
-2005-03-04 Thien-Thi Nguyen <[email protected]>
-
- * s/vms.h: Define NO_HYPHENS_IN_FILENAMES.
- * s/vms4-4.h, s/vms5-5.h: Undefine NO_HYPHENS_IN_FILENAMES.
- * fileio.c (Fexpand_file_name) [VMS]:
- Use NO_HYPHENS_IN_FILENAMES, not VMS4_4.
- * doc.c (munge_doc_file_name) [VMS]: Likewise.
- (Fsnarf_documentation): Call munge_doc_file_name.
-
-2005-03-04 Thien-Thi Nguyen <[email protected]>
-
- * s/vms.h (FILE_SYSTEM_CASE): New macro.
- * fileio.c (Fexpand_file_name) [VMS]: Don't upcase the name
- "manually"; this is now handled generally via FILE_SYSTEM_CASE.
-
-2005-03-04 YAMAMOTO Mitsuharu <[email protected]>
-
- * emacs.c (main): Change `#ifdef HAVE_CARBON' to `#if
- defined (MAC_OSX) && defined (HAVE_CARBON)'.
-
- * image.c [!MAC_OSX && TARGET_API_MAC_CARBON]: Include QuickTime.h.
-
- * mac.c [!MAC_OSX && HAVE_CARBON]: Include Carbon.h.
- [!MAC_OSX] (select) [TARGET_API_MAC_CARBON]: Use ReceiveNextEvent.
- (posix_pathname_to_fsspec, fsspec_to_posix_pathname): New functions.
- (mac_clear_font_name_table): Move extern to macterm.h.
-
- * macfns.c (install_window_handler): Move extern to macterm.h.
- (Fx_file_dialog): Check STRINGP (default_filename) to see it is
- valid. Don't check !NILP (dir) because it is already checked with
- CHECK_STRING.
- (Fx_file_dialog) [!MAC_OSX]: Use FSSpec instead of FSRef for
- specifying the default location and obtaining the selected filename.
-
- * macgui.h [!MAC_OSX && HAVE_CARBON]: Include Carbon.h.
-
- * macmenu.c [TARGET_API_MAC_CARBON]: Don't include headers that
- are included via Carbon.h.
-
- * macterm.c [TARGET_API_MAC_CARBON && !MAC_OSX]:
- Define USE_CARBON_EVENTS to 1.
- (qd) [__MRC__ && TARGET_API_MAC_CARBON]: Don't declare.
- (x_free_frame_resources): Call remove_window_handler for
- non-tooltip windows.
- [TARGET_API_MAC_CARBON]: Don't include headers that are included
- via Carbon.h.
- [TARGET_API_MAC_CARBON] (mac_do_track_dragUPP)
- (mac_do_receive_dragUPP): New variables.
- (mac_handle_service_event, init_service_handler): Put declarations
- and definitions in #ifdef MAC_OSX.
- (install_window_handler) [TARGET_API_MAC_CARBON]: Create UPPs for
- drag-and-drop handler functions and register them.
- (remove_window_handler): New function.
- (do_ae_open_documents, mac_do_receive_drag) [!MAC_OSX]:
- Use fsspec_to_posix_pathname.
- (main): Change #if !TARGET_API_MAC_CARBON to #ifdef MAC_OS8.
- (XTread_socket) [!MAC_OSX]: Don't pass keyboard events to TSM.
- [MAC_OS8] (make_mac_terminal_frame) [TARGET_API_MAC_CARBON]:
- Set default cursors.
- (mac_initialize) [USE_CARBON_EVENTS && !MAC_OSX]: Don't call
- init_service_handler or init_quit_char_handler.
- (mac_initialize) [!MAC_OSX]: Don't call MakeMeTheFrontProcess.
-
- * macterm.h (install_window_handler, remove_window_handler)
- (posix_pathname_to_fsspec, fsspec_to_posix_pathname)
- (mac_clear_font_name_table): New externs.
-
-2005-03-03 Thien-Thi Nguyen <[email protected]>
-
- * fileio.c (FILE_SYSTEM_CASE): Define macro if not already defined.
- (Ffile_name_directory): Use FILE_SYSTEM_CASE unconditionally.
- (Fexpand_file_name): Likewise.
-
-2005-03-03 Thien-Thi Nguyen <[email protected]>
-
- * emacs.c (Fkill_emacs): Use EXIT_SUCCESS;
- no longer special-case VMS. Add bogus return value.
-
-2005-03-02 Kim F. Storm <[email protected]>
-
- * dispextern.h (XASSERTS): Define to 0 if not already defined.
- (xassert) [!XASSERTS]: Define dummy version.
-
-2005-03-02 Kim F. Storm <[email protected]>
-
- * xdisp.c (redisplay_window): YABX (yet another bogus xassert).
- Reported by David Kastrup.
-
-2005-03-01 Ehud Karni <[email protected]>
-
- * xdisp.c (get_next_display_element): Fix control and escape
- glyph from display vector.
-
-2005-03-01 Stefan Monnier <[email protected]>
-
- * keyboard.c (Fposn_at_x_y): Check integerness of X and Y.
-
-2005-02-27 Richard M. Stallman <[email protected]>
-
- * xdisp.c (fast_find_position): Rename END to BEG.
- (syms_of_xdisp) <menu-bar-update-hook>: Doc fix.
-
-2005-02-27 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (xg_resize_outer_widget): Remove unneeded call to
- gtk_window_resize and x_wm_set_size_hint.
-
-2005-02-25 Kim F. Storm <[email protected]>
-
- * dispextern.h (OVERLAY_STRING_CHUNK_SIZE): Increase from 3 to 16.
-
- * xdisp.c (init_from_display_pos): Don't read past end of
- it->overlay_strings array.
-
-2005-02-25 Stephan Stahl <[email protected]> (tiny change)
-
- * buffer.c (syms_of_buffer): Fix typo.
-
-2005-02-23 Lute Kamstra <[email protected]>
-
- * buffer.c (Foverlay_buffer): Doc fix.
-
-2005-02-22 Kim F. Storm <[email protected]>
-
- * minibuf.c (Ftry_completion, Fall_completions): Allow both string
- and symbol keys in alists and hash tables.
-
- * xdisp.c (fast_find_position): Fix search for start of overlay.
-
-2005-02-21 Kim F. Storm <[email protected]>
-
- * window.c (window_scroll_pixel_based): When scrolling backwards,
- handle partial visible line at end of window even when we hit PT.
-
-2005-02-21 Stefan Monnier <[email protected]>
-
- * keymap.h: Declare Fcurrent_active_maps, used in doc.c.
-
-2005-02-21 Kim F. Storm <[email protected]>
-
- * xdisp.c (move_it_vertically_backward): Eliminate two xasserts.
- I think those asserts are bogus if buffer contains invisible text
- or images.
-
-2005-02-21 David Kastrup <[email protected]>
-
- * gtkutil.c (xg_create_frame_widgets): UNBLOCK_INPUT on error.
-
-2005-02-20 Kim F. Storm <[email protected]>
-
- * xdisp.c (pos_visible_p): Be sure to move to the specified
- position. Always get the full ascent / descent of the
- corresponding row, to return reliable rtop and rbot values.
- (back_to_previous_visible_line_start): Fix 2005-01-18 change.
- Must look one character back, as back_to_previous_line_start
- returns position after the newline.
- (move_it_vertically_backward): Fix heuristic for when to move further
- back in case line_height * 2/3 is larger than window height.
- (cursor_row_fully_visible_p): Rename make_cursor_line_fully_visible_p
- as it does not do anything anymore. Add arg current_matrix_p to
- use current matrix rather than desired matrix when set.
- (try_cursor_movement): Don't scroll to make cursor row fully
- visible if cursor didn't move. This avoids unexpected recentering
- in case of blinking cursor or accepting process output.
- Use current matrix to check cursor row visibility.
- (redisplay_window): Fix whether to recenter or move to top in case
- cursor line is taller than window height.
- (find_first_unchanged_at_end_row): Stop search if we reach a row
- which not enabled (instead of abort).
-
-2005-02-18 Kim F. Storm <[email protected]>
-
- * xfaces.c (Finternal_set_lisp_face_attribute): Allow :color property
- to be nil in a :box attribute value list; customize prints that
- as lisp value when no box color is specified.
-
- * .gdbinit (pitx, pit): Pretty print display iterator.
- (prowx, prow): Pretty print glyph row.
- (pcursorx, pcursor): Pretty print a window cursor.
- (pwinx, pwin): Pretty print struct window.
-
-2005-02-18 Stefan Monnier <[email protected]>
-
- * alloc.c (BLOCK_BYTES): Harmless typo.
-
-2005-02-17 Andreas Schwab <[email protected]>
-
- * xfns.c (hack_wm_protocols): Use correct type for last parameter
- of XGetWindowProperty to avoid aliasing issues.
- (Fx_window_property): Likewise.
-
- * xselect.c (Fx_disown_selection_internal): Use union of struct
- input_event and struct selection_input_event to avoid aliasing issues.
-
- * xterm.c (handle_one_xevent): Use union of struct input_event and
- struct selection_input_event to avoid aliasing issues.
- (SET_SAVED_MENU_EVENT): Adapt reference to inev.
-
-2005-02-17 Kim F. Storm <[email protected]>
-
- * dispextern.h (enum it_method): New enum.
- (GET_FROM_*): Its members.
- (struct it): Change member method from function pointer to enum.
-
- * xdisp.c (check_it, init_from_display_pos, handle_stop)
- (setup_for_ellipsis, handle_single_display_spec)
- (handle_composition_prop, next_overlay_string)
- (get_overlay_strings, reseat_1, reseat_to_string)
- (next_element_from_ellipsis, BUFFER_POS_REACHED_P)
- (in_display_vector_p, display_line, get_next_display_element):
- Change it->method from function pointer to enum.
- (get_next_element): New array to map it->method to function.
- (get_next_display_element): Use it.
- (set_iterator_to_next): Use switch instead of if/else chain.
-
-2005-02-15 Benjamin Riefenstahl <[email protected]>
-
- * w32select.c: Summary: Thorough rework to implement Unicode
- clipboard operations and delayed rendering.
-
- Drop last_clipboard_text and related code, keep track of
- ownership via clipboard_owner instead. Drop old #if0 sections.
-
- (DEFAULT_LCID, ANSICP, OEMCP, QUNICODE, QANSICP, QOEMCP)
- (clipboard_owner, modifying_clipboard, cfg_coding_system)
- (cfg_codepage, cfg_lcid, cfg_clipboard_type, current_text)
- (current_coding_system, current_requires_encoding)
- (current_num_nls, current_clipboard_type, current_lcid):
- New static variables.
-
- (convert_to_handle_as_ascii, convert_to_handle_as_coded)
- (render, render_all, run_protected, lisp_error_handler)
- (owner_callback, create_owner, setup_config)
- (enum_locale_callback, cp_from_locale, coding_from_cp):
- New local functions.
-
- (term_w32select, globals_of_w32select): New global functions.
-
- (Fw32_set_clipboard_data): Ignore parameter FRAME, use
- clipboard_owner instead. Use delayed rendering and provide
- all text formats. Provide CF_LOCALE if necessary.
-
- (Fw32_get_clipboard_data): Handle CF_UNICODETEXT and
- CF_LOCALE. Fall back to CF_TEXT, if CF_UNICODETEXT is not
- available. Force DOS line-ends for decoding.
-
- (Fx_selection_exists_p): Handle CF_UNICODETEXT.
-
- (syms_of_w32select): Init and register new variables.
-
- * w32.h: Add prototypes for globals_of_w32select and
- term_w32select. Make the neighboring K&R declarations into
- prototypes, too.
-
- * emacs.c: Include w32.h to get function prototypes.
- (main): Call globals_of_w32select.
-
- * w32.c (term_ntproc): Call term_w32select.
-
- * s/ms-w32.h: Guard MSC-specific #pragmas with an #ifdef.
-
-2005-02-16 Kim F. Storm <[email protected]>
-
- * xdisp.c (BUFFER_POS_REACHED_P): Return true if pos reached and
- at end of display vector.
-
-2005-02-15 Richard M. Stallman <[email protected]>
-
- * xdisp.c (get_next_display_element): Fix escape-glyph criterion
- for mode and header lines.
-
- * lread.c (syms_of_lread) <user-init-file>: Doc fix.
-
- * keymap.h (describe_map_tree): Change decl.
-
- * keyboard.c (command_loop_1): Always use safe_run_hooks
- to run Qdeferred_action_function.
-
- * keymap.c (describe_map_tree): New arg MENTION_SHADOW. Calls changed.
- (describe_map, describe_vector): Likewise. When it's 1,
- don't omit shadowed bindings, instead mark them as shadowed.
-
- * doc.c (Fsubstitute_command_keys): Compute list of shadowing maps
- for describe_map_tree. Pass 1 for MENTION_SHADOW.
-
- * data.c (Fsetq_default): Allow no arg case.
-
-2005-02-14 Kenichi Handa <[email protected]>
-
- * coding.c (encode_coding_string): Always return a unibyte string.
- If NOCOPY is nonzero and there's no need of encoding, make STR
- unibyte directly.
-
- * xselect.c (lisp_data_to_selection_data): If OBJ is a non-ASCII
- multibyte string, signal an error instead of aborting.
-
-2005-02-12 Dan Nicolaescu <[email protected]>
-
- * keyboard.c: If HAVE_FCNTL_H include fcntl.h.
-
-2005-02-12 Kim F. Storm <[email protected]>
-
- * xdisp.c (expose_window): Don't fix overlaps for mode lines.
-
-2005-02-10 Kim F. Storm <[email protected]>
-
- * xdisp.c (try_window_id): Set first_unchanged_at_end_row to NULL
- if it moves outside window or it doesn't display text.
-
-2005-02-09 Kim F. Storm <[email protected]>
-
- * undo.c (Fprimitive_undo): Check that undo function does not
- switch buffer.
-
-2005-02-08 Jan Dj,Ad(Brv <[email protected]>
-
- * xselect.c (selection_data_to_lisp_data): For the special case
- type == XA_ATOM, data contains array of int, not array of Atom.
- (x_property_data_to_lisp, selection_data_to_lisp_data):
- Comment update: data must be array of int for format == 32.
-
-2005-02-08 Stefan Monnier <[email protected]>
-
- * undo.c (Fprimitive_undo): Check veracity of delta,start,end.
-
-2005-02-07 Jan Dj,Ad(Brv <[email protected]>
-
- * xfns.c (Fx_change_window_property): Use long array when format is 32.
- (Fx_window_property): If format is 32 and long is bigger than 32 bits,
- convert long array returned from XGetWindowProperty to an int array.
- (x_set_tool_bar_lines): Check that width and height is greater than
- zero before clearing area.
-
- * xselect.c (x_reply_selection_request): Pass long array to
- XChangeProperty so that 64 bit longs are handeled correctly.
- (x_get_window_property): If format is 32 and long is bigger than 32
- bits convert data from XGetWindowProperty from long array to int array.
- (lisp_data_to_selection_data): When the input is a vector and the
- format is 32, allocate a long array even if long is bigger than 32 bits.
- (x_fill_property_data): Use char, short and long as the man page
- for XChangeProperty specifies. This way the data returned is OK for
- both 32 and 64 bit machines.
- (x_handle_dnd_message): Calculate size correctly even for 64 bit
- machines.
- (Fx_send_client_event): Undo change from 2005-02-05,
- x_fill_property_data now handles that case.
-
- * xfns.c (Fx_backspace_delete_keys_p): Add comment about the
- reason for the approach in the code.
-
-2005-02-07 Kim F. Storm <[email protected]>
-
- * undo.c (Fprimitive_undo): Record max one dummmy apply element.
-
-2005-02-06 Richard M. Stallman <[email protected]>
-
- * eval.c (Frun_hook_with_args)
- (Frun_hook_with_args_until_success)
- (Frun_hook_with_args_until_failure): Doc fixes.
-
-2005-02-05 Andreas Schwab <[email protected]>
-
- * sysdep.c (sys_subshell): Properly terminate execlp argument list.
-
-2005-02-05 Jan Dj,Ad(Brv <[email protected]>
-
- * xselect.c (Fx_send_client_event, x_handle_dnd_message): Handle
- the longs in a XClientMessageEvent correctly when long is 64 bits.
-
-2005-02-05 Eli Zaretskii <[email protected]>
-
- * xfaces.c (face_color_supported_p): Use HAVE_WINDOW_SYSTEM
- instead of HAVE_X_WINDOWS, for non-X windowed sessions.
-
-2005-02-03 Jan Dj,Ad(Brv <[email protected]>
-
- * xmenu.c (menubar_selection_callback): Force out GTK buffered
- events so the menu event comes after them. This is to prevent sit-for
- from exiting on buffered events directly after a menu selection,
- lisp code for Help => About Emacs uses sit-for.
-
- * gtkutil.c (create_menus): Connect selection-done event instead of
- the deactivate event to deactivate_cb. This will make the last
- leave event come before the call to deactivate_cb, so the leave
- event does not make sit-for exit after a menu selection.
-
-2005-02-03 Kim F. Storm <[email protected]>
-
- * dispnew.c (build_frame_matrix_from_leaf_window)
- [!GLYPH_DEBUG]: Fix xassert.
-
- * xfaces.c (x_free_gc) [!GLYPH_DEBUG]: Fix xassert.
-
- * xfns.c (unwind_create_frame) [!GLYPH_DEBUG]: Fix xassert.
-
-2005-02-03 YAMAMOTO Mitsuharu <[email protected]>
-
- * mac.c: Use MAC_OS_X_VERSION_MAX_ALLOWED to conditionalize by
- the compiling OS version.
-
- * macfns.c (x_create_tip_frame): Likewise.
-
- * macterm.c (mac_draw_string_common, x_make_frame_visible): Likewise.
-
-2005-02-03 Richard M. Stallman <[email protected]>
-
- * xterm.c (x_error_quitter): On GCC 3 and up, specify noinline.
-
- * xdisp.c (echo_area_display): Clear echo_message_buffer.
-
- * buffer.c (Fbury_buffer): Doc fix.
-
-2005-02-02 Steven Tamm <[email protected]>
-
- * macfns.c (unwind_create_frame): Fix compile error due to
- xassert being uncondition, but predicate is.
- * dispnew.c (update_window): Fix compile error due to
- xassert being uncondition, but predicate is.
-
-2005-02-02 Miles Bader <[email protected]>
-
- * dispextern.h (xassert): Enable unconditionally.
-
-2005-02-02 Kim F. Storm <[email protected]>
-
- * undo.c (Fprimitive_undo): Fix dummy apply undo entry.
-
-2005-02-02 Kenichi Handa <[email protected]>
-
- * casefiddle.c (casify_object): Enable changing characters of
- different byte length.
- (casify_region): Fix loop condition, args to replace_range_2, and
- update opoint_byte.
-
- * insdel.c (replace_range_2): Fix bugs in adjusting markers and point.
-
-2005-02-01 Kim F. Storm <[email protected]>
-
- * xdisp.c (back_to_previous_visible_line_start): Reset iterator
- stack before calling handle_display_prop.
-
-2005-01-31 Kim F. Storm <[email protected]>
-
- * undo.c (Qapply): New lisp var.
- (syms_of_undo): Intern and staticpro it.
- (Fprimitive_undo): Support formats (apply FUNNAME . ARGS) and
- (apply DELTA BEG END FUNNAME . ARGS) instead of (FUNNAME . ARGS).
-
- * buffer.c (syms_of_buffer) <buffer-undo-list>: Doc fix.
-
-2005-01-30 Jesper Harder <[email protected]>
-
- * macterm.c (syms_of_macterm) <mac-reverse-ctrl-meta>
- <mac-emulate-three-button-mouse>: Fix docstring indentation.
-
-2005-01-29 Luc Teirlinck <[email protected]>
-
- * undo.c (syms_of_undo) <undo-outer-limit>: Doc update.
- Increase value to 3 Meg.
-
-2005-01-29 Jan Dj,Ad(Brv <[email protected]>
-
- * xfns.c (show_hourglass): Use FRAME_X_WINDOW as parent for GTK,
- button events are not received otherwise.
-
-2005-01-29 Richard M. Stallman <[email protected]>
-
- * buffer.c (syms_of_buffer) <buffer-undo-list>: Doc fix.
-
- * undo.c (Fprimitive_undo): Handle (FUNNAME . ARGS) by calling FUNNAME.
-
-2005-01-28 Stefan Monnier <[email protected]>
-
- * keymap.c (access_keymap): YAILOM.
-
-2005-01-27 Kim F. Storm <[email protected]>
-
- * xdisp.c (get_phys_cursor_geometry): New function to calculate
- phys cursor position and size for hollow cursor. Position is
- aligned with get_glyph_string_clip_rect and ensures that a hollow
- cursor is shown, even when the actual glyph is not visible.
-
- * dispextern.h (get_phys_cursor_geometry): Add prototype.
-
- * xterm.c (x_clip_to_row): Ensure y >= 0.
- (x_draw_hollow_cursor): Use get_phys_cursor_geometry.
-
- * w32term.c (x_draw_hollow_cursor): Use get_phys_cursor_geometry.
-
- * macterm.c (x_draw_hollow_cursor): Use get_phys_cursor_geometry.
-
-2005-01-27 Stefan Monnier <[email protected]>
-
- * xterm.c (x_error_quitter): Add a prototype. Make it static again.
-
-2005-01-27 Kim F. Storm <[email protected]>
-
- * xdisp.c (get_glyph_string_clip_rect): Always show a cursor
- glyph, even when row is only partially visible and actual cursor
- position is not visible.
-
-2005-01-24 Richard M. Stallman <[email protected]>
-
- * xterm.c (x_error_quitter): No longer static, and moved after
- x_error_handler.
-
-2005-01-24 Kim F. Storm <[email protected]>
-
- * xdisp.c (move_it_by_lines): If we move forward after going too
- far back, cancel move if end position is same as start position.
-
-2005-01-24 YAMAMOTO Mitsuharu <[email protected]>
-
- * dispextern.h (struct glyph_string): New members clip_head and
- clip_tail.
-
- * xdisp.c (get_glyph_string_clip_rect): Restrict horizontal clip
- region to the area between clip_head and clip_tail.
- (draw_glyphs): Record the area that need to be actually redrawn to
- the new variables clip_head and clip_tail when there are
- overhangs. Set values of these variables to the corresponding
- members in struct glyph_string. Refine x coordinates for
- notice_overwritten_cursor using clip_head and clip_tail.
-
- * macgui.h (STORE_XCHARSETSTRUCT): New macro.
-
- * macterm.c (mac_compute_glyph_string_overhangs): Implement with
- QDTextBounds.
- (x_draw_glyph_string): Don't fill the background of the successor
- of a glyph with a right overhang if the successor will draw a cursor.
- (XLoadQueryFont): Obtain font metrics using QDTextBounds.
- (x_redisplay_interface): Add entry for compute_glyph_string_overhangs.
-
-2005-01-24 Kim F. Storm <[email protected]>
-
- * window.c (window_scroll_pixel_based): Fix scrolling in the wrong
- direction if window height was smaller than next-screen-context-lines.
- Now always scroll at least one line in the requested direction.
- Ensure that we actually do scroll backwards when requested to do so.
-
- * xdisp.c (redisplay_window): Only try to make cursor line fully
- visible once (to avoid redisplay loop).
-
-2005-01-23 Kim F. Storm <[email protected]>
-
- * window.c (Fpos_visible_in_window_p): Simplify return value for
- partially visible rows.
- (window_scroll_pixel_based): Adapt to that change.
-
- * window.c (window_scroll_pixel_based): Force moving to next line
- if scrolling doesn't move start point, e.g. if looking at tall image.
-
- * xdisp.c (pos_visible_p): Return 0 if non-interactive.
- Clear last_height before calling line_bottom_y to get real height.
- Fix calculation of y.
-
-2005-01-22 Steven Tamm <[email protected]>
-
- * s/darwin.h: Removed PTY_ITERATION from here.
- (DARWIN): Define.
-
- * process.c (init_process): Default process-connection-type to
- nil on darwin 6 or less, t if it is 7 or higher. This way the
- broken pty behavior is still allowed on darwin 6 for interactive
- processes for people that know what they are doing.
-
-2005-01-22 Kim F. Storm <[email protected]>
-
- * window.c (auto_window_vscroll_p): New boolean.
- (syms_of_window): DEFVAR_BOOL it.
- (Fpos_visible_in_window_p): Extend return value to include RTOP
- and RBOT values if FULLY is nil.
- (window_scroll_pixel_based): Adjust vscroll for partially visible
- rows if auto_window_vscroll_p is set.
- (Fset_window_vscroll): Do nothing if vscroll is not modified.
-
- * xdisp.c (pos_visible_p): Replace FULLY arg by RTOP and RBOT args
- to return number of partially invisible pixels at top and bottom
- of the dislay row at POS.
-
- * lisp.h (pos_visible_p): Fix prototype.
-
-2005-01-21 Richard M. Stallman <[email protected]>
-
- * fileio.c (Fcopy_file): Doc fix.
-
-2005-01-21 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (xg_tool_bar_detach_callback): Remove unused variable bw.
- (xg_get_file_name): Move declaration ofx_use_old_gtk_file_dialog to
- start of function for older compilers.
-
-2005-01-20 Richard M. Stallman <[email protected]>
-
- * editfns.c (Fmessage): If arg is "", return "" (as before).
-
- * keymap.c (access_keymap): Protect from bad value of meta_prefix_char.
-
- * .gdbinit (xgetptr, xgetint, xgettype): Copy $arg0 into a temp
- variable.
-
-2005-01-20 Steven Tamm <[email protected]>
-
- * editfns.c (Voperating_system_release): Add.
- (init_editfns): Assign new variable operating-system-release
- based on call to uname if available.
- (get_operating_system_release): Add function to
- allow c-level access to operating system release.
-
- * config.h: Regenerated.
-
- * s/darwin.h (PTY_ITERATION): Don't allow PTYs on darwin 6 or less.
- (MIN_PTY_KERNEL_VERSION): Define minimum kernel version for
- using ptys as '7'.
-
-2005-01-20 Kim F. Storm <[email protected]>
-
- * alloc.c (STRING_MARKED_P, VECTOR_MARKED_P): Return boolean.
-
- * xterm.c (x_draw_glyph_string_box): Fix last_x for full width rows.
- Thanks to Chong Yidong <[email protected]> for debugging this.
-
- * macterm.c (x_draw_glyph_string_box): Likewise.
-
- * w32term.c (x_draw_glyph_string_box): Likewise.
-
- * indent.c (Fvertical_motion): Temporarily disable selective display.
-
-2005-01-19 Kim F. Storm <[email protected]>
-
- * xdisp.c (note_mode_line_or_margin_highlight): Fix :pointer
- image property.
-
- * fns.c (sweep_weak_table): Advance prev pointer when we keep a pair.
-
-2005-01-18 Kim F. Storm <[email protected]>
-
- * xdisp.c (fast_find_position): Backtrack to find first row if
- charpos is inside a display overlay that spans multiple lines.
-
-2005-01-18 Kenichi Handa <[email protected]>
-
- * coding.c (decode_coding_iso2022): Translate invalid codes if
- translation-table is specified.
-
-2005-01-18 Kim F. Storm <[email protected]>
-
- * xdisp.c (back_to_previous_visible_line_start): Undo 2004-12-28
- change. If handle_display_prop indicates newline is replaced by
- image or text, move back to start of relevant overlay or interval
- and continue scan from there. Simplify.
-
-2005-01-17 Kim F. Storm <[email protected]>
-
- * dispnew.c (mode_line_string, marginal_area_string):
- Fix off-by-one error in search for glyph.
-
-2005-01-16 Kim F. Storm <[email protected]>
-
- * macterm.c (syms_of_macterm) <mac-allow-anti-aliasing>: Doc fix.
-
-2005-01-16 Steven Tamm <[email protected]>
-
- * macterm.c (mac_to_x_fontname): Remove spurious argument.
-
-2005-01-16 Andreas Schwab <[email protected]>
-
- * macterm.c (mac_draw_string_common): Fix compilation on OSX 10.1.
-
-2005-01-16 Jan Dj,Ad(Brv <[email protected]>
-
- * fringe.c (Fdefine_fringe_bitmap, init_fringe): When assigning
- fringe_faces, cast result from xmalloc/xrealloc to Lisp_Object *.
-
-2005-01-16 YAMAMOTO Mitsuharu <[email protected]>
-
- * keyboard.c (READABLE_EVENTS_DO_TIMERS_NOW)
- (READABLE_EVENTS_FILTER_EVENTS, READABLE_EVENTS_IGNORE_SQUEEZABLES):
- New flags for readable_events.
- (get_filtered_input_pending, readable_filtered_events): Remove.
- (tracking_off): Call readable_events and get_input_pending with
- flag READABLE_EVENTS_DO_TIMERS_NOW.
- (readable_events): Move code from old readable_filtered_events here,
- but check new READABLE_EVENTS_* in argument flags instead of previous
- two boolean arguments do_timers_now and filter_events.
- If we are doing mouse tracking and the mouse moved, return only if
- READABLE_EVENTS_IGNORE_SQUEEZABLES is not set in flags.
- (swallow_events): Call get_input_pending with flag
- READABLE_EVENTS_DO_TIMERS_NOW.
- (get_input_pending): Move code from old get_filtered_input_pending
- here. Replace boolean arguments do_timers_now, filter_events with
- flags, and pass flags to readable_events. Document new
- READABLE_EVENTS_* flags.
- (detect_input_pending_ignore_squeezables): New function.
- (detect_input_pending_run_timers): Call get_input_pending with flag
- READABLE_EVENTS_DO_TIMERS_NOW.
- (Finput_pending_p): Call get_input_pending with flags
- READABLE_EVENTS_DO_TIMERS_NOW and READABLE_EVENTS_FILTER_EVENTS.
-
- * dispnew.c (update_window, update_frame_1): Replace calls to
- detect_input_pending with detect_input_pending_ignore_squeezables
- so that redisplay is not paused if the event queue contains only
- mouse movements.
-
- * lisp.h: Declare detect_input_pending_ignore_squeezables.
-
-2005-01-15 Steven Tamm <[email protected]>
-
- * macterm.c (Vmac_use_core_graphics): Declare variable for
- mac-allow-anti-aliasing.
- (syms_of_macterm): DEFVAR_LISP and initialize it.
- (mac_draw_string_common): Use core graphics text rendering if
- mac-allow-anti-aliasing is enabled.
-
- * macfns.c (Fx_file_dialog): Save As dialog includes only the
- file name in the text box.
-
-2005-01-15 YAMAMOTO Mitsuharu <[email protected]>
-
- * macfns.c (x_set_foreground_color, x_set_background_color):
- Sync with xfns.c.
- (mac_window, x_create_tip_frame): Use XSetWindowBackground.
- * macterm.c (XSetBackground, XSetWindowBackground): New functions.
- * macterm.h (XSetBackground, XSetWindowBackground): Add externs.
-
-2005-01-14 Kim F. Storm <[email protected]>
-
- * keyboard.c (Fposn_at_x_y): Add optional arg WHOLE.
-
-2005-01-13 Richard M. Stallman <[email protected]>
-
- * keymap.c (Fcurrent_active_maps): Ignore Voverriding_local_map
- if Voverriding_terminal_local_map is non-nil.
-
- * keyboard.c (syms_of_keyboard): Doc fix.
-
-2005-01-13 Kim F. Storm <[email protected]>
-
- * xdisp.c (Fformat_mode_line): Fix last change. Remove NO_PROPS arg
- (specify 0 for FACE instead). Reorder arg list. Doc fix.
-
-2005-01-12 Richard M. Stallman <[email protected]>
-
- * xdisp.c (Fformat_mode_line): New arg FACE specifies a default
- face property for characters that don't specify one.
-
- * fns.c (Frequire): Record in load-history unconditionally.
-
-2005-01-10 Kim F. Storm <[email protected]>
-
- * dispextern.h (merge_faces): Rename from merge_into_realized_face.
-
- * xfaces.c (merge_faces): Rename from merge_into_realized_face.
- Callers changed.
- Add support to merge with lisp face id too (if face_name is t).
-
- * xdisp.c (get_next_display_element, next_element_from_display_vector):
- Don't lookup lface_id from display table glyphs here; instead use
- merge_faces to merge the lisp face id into current face.
-
-2005-01-09 Kim F. Storm <[email protected]>
-
- * dispextern.h (struct it): New member dpvec_face_id.
- (merge_into_realized_face): Add prototype.
-
- * xfaces.c (merge_into_realized_face): New function. Used to
- merge escape-glyph face or face from display table into current face.
-
- * xdisp.c (Vshow_nonbreak_escape): New lisp var.
- (syms_of_xdisp): DEFVAR_LISP it.
- (escape_glyph_face): Remove var.
- (redisplay_window): Don't initialize it.
- (setup_for_ellipsis, get_next_display_element):
- Set it->dpvec_face_id to -1.
- (get_next_display_element): Test Vshow_nonbreak_escape.
- Do not setup escape_glyph_face.
- Properly merge escape-glyph face or face from display table with
- current face for escape and control characters.
- Set it->dpvec_face_id to relevant face id instead of adding it to each
- element of display vector.
- (next_element_from_display_vector): If it->dpvec_face_id is set,
- use that instead of lface_id from glyph itself.
-
-2005-01-08 Jan Dj,Ad(Brv <[email protected]>
-
- * xterm.h (struct x_output): New member, toolbar_detached.
-
- * gtkutil.c (xg_create_frame_widgets): Set initial tool bar height to
- 38.
- (xg_tool_bar_detach_callback): Set toolbar_detached to 1.
- (xg_tool_bar_attach_callback): Set toolbar_detached to 0.
- (xg_create_tool_bar): Initialize toolbar_detached.
- (update_frame_tool_bar): Only set FRAME_TOOLBAR_HEIGHT (f) if
- toolbar_detached is zero.
-
-2005-01-07 Jan Dj,Ad(Brv <[email protected]>
-
- * xmenu.c (create_and_show_popup_menu): Pass zero as button to
- gtk_menu_popup if not for_click, so callbacks for the menu are called.
-
- * gtkutil.c (xg_gtk_scroll_destroy, xg_create_scroll_bar)
- (xg_tool_bar_callback, xg_tool_bar_help_callback)
- (update_frame_tool_bar): Cast to EMACS_INT to avoid compiler warning.
-
- * xselect.c (x_get_foreign_selection, x_fill_property_data)
- (Fx_get_atom_name, Fx_send_client_event): Replace XFLOAT with
- XFLOAT_DATA to get extract number from Lisp object.
-
-2005-01-07 Kim F. Storm <[email protected]>
-
- * xdisp.c (set_iterator_to_next): Fix 2004-12-13 change.
- Set stop_charpos to current charpos instead of 0.
-
-2005-01-06 Nick Roberts <[email protected]>
-
- * xdisp.c (Fformat_mode_line): First arg now required.
-
-2005-01-06 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.c (XLoadQueryFont): Correctly handle 0 size
- font widths that are returned from some Japanese fonts.
-
-2005-01-06 Kim F. Storm <[email protected]>
-
- * fringe.c (fringe_faces): Change to Lisp_Object pointer.
- (draw_fringe_bitmap_1): Lookup user defined fringe faces here.
- (destroy_fringe_bitmap): Set fringe_faces element to nil.
- (Fdefine_fringe_bitmap, init_fringe): Change allocation of
- fringe_faces array and init elements to nil.
- (Fset_fringe_bitmap_face): Set fringe_faces to face name instead of
- non-persistent face id.
- (mark_fringe_data): New function for GC.
-
- * alloc.c (mark_fringe_data): Declare extern.
- (Fgarbage_collect): Call mark_fringe_data.
-
- * alloc.c (overrun_check_free): Invalidate freed memory if
- XMALLOC_CLEAR_FREE_MEMORY is defined.
-
-2005-01-05 YAMAMOTO Mitsuharu <[email protected]>
-
- * macfns.c: Include sys/param.h.
- [TARGET_API_MAC_CARBON] (mac_nav_event_callback): New declaration
- and function.
- [TARGET_API_MAC_CARBON] (Fx_file_dialog): Use MAXPATHLEN for size
- of filename string. Set event callback function when creating
- dialog boxes. Add code conversions for filenames. Don't dispose
- of apple event descriptor record if failed to create it.
-
- * macterm.c: Include sys/param.h.
- [USE_CARBON_EVENTS] (mac_handle_window_event): Add handler for
- kEventWindowUpdate.
- (install_window_handler) [USE_CARBON_EVENTS]: Register it.
- (do_ae_open_documents) [TARGET_API_MAC_CARBON]: Get FSRef instead
- of FSSpec from apple event descriptor record.
- (do_ae_open_documents) [TARGET_API_MAC_CARBON]: Use MAXPATHLEN for
- size of filename string.
- [TARGET_API_MAC_CARBON] (mac_do_receive_drag): Likewise.
- [TARGET_API_MAC_CARBON] (mac_do_receive_drag): Return error when a
- file dialog is in action.
- [TARGET_API_MAC_CARBON] (mac_do_track_drag): Likewise.
- Reject only when there are no filename items. Set background color
- before (un)highlighting the window below the dragged items.
- (XTread_socket) [USE_CARBON_EVENTS]: Don't call do_window_update.
-
-2005-01-05 Romain Francoise <[email protected]>
-
- * term.c (encode_terminal_code): Fix buffer size computation.
-
-2005-01-04 Richard M. Stallman <[email protected]>
-
- * xdisp.c (Fformat_mode_line): Doc fix.
-
-2005-01-04 Stefan Monnier <[email protected]>
-
- * alloc.c (refill_memory_reserve): Move.
- (emacs_blocked_free, emacs_blocked_malloc, emacs_blocked_realloc)
- (reset_malloc_hooks, uninterrupt_malloc) [SYNC_INPUT]: Don't define.
-
-2005-01-03 Richard M. Stallman <[email protected]>
-
- * window.c (window_scroll_pixel_based): Don't correct preserve_y
- for CURRENT_HEADER_LINE_HEIGHT when moving backwards.
-
-2005-01-03 Jason Rumney <[email protected]>
-
- * w32bdf.c (w32_load_bdf_font): Set fontp->average_width and
- fontp->space_width to FONT_WIDTH so they are valid.
-
- * w32fns.c (w32_load_system_font): Set FONT_WIDTH to maximum, not
- average width. Set fontp->average_width and fontp->space_width to
- their appropriate values.
-
- * w32term.c (x_new_font): Set FRAME_COLUMN_WIDTH to
- fontp->average_width, not FONT_WIDTH. Set FRAME_SPACE_WIDTH to
- fontp->space_width.
-
-2005-01-03 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
- (x_font_min_bounds, XLoadQueryFont): Use the correct font width
- metrics for max and min bounds.
- (x_load_font): Correctly calculate average font width metrics.
-
-2005-01-02 Richard M. Stallman <[email protected]>
-
- * alloc.c (Fgarbage_collect): Don't truncate_undo_list on dead buffers.
-
-2004-12-31 Jan Dj,Ad(Brv <[email protected]>
-
- * xterm.c (handle_one_xevent): Clear area in expose event for GTK.
-
-2004-12-31 Richard M. Stallman <[email protected]>
-
- * xdisp.c (setup_for_ellipsis, get_next_display_element):
- Set it->ellipsis_p to 1 or 0.
- (display_line): Record whether row ends in mid-ellipsis.
- (set_cursor_from_row): If ends in ellipsis, find start of it.
- (cursor_row_p): If PT's at the end of the ellipsis the row
- ends within, don't display cursor on this row.
-
- * dispextern.h (struct it): New element ellipsis_p.
- (struct glyph_row): New element ends_in_ellipsis_p.
-
- * xdisp.c (BUFFER_POS_REACHED_P): We haven't reached the specified
- position if we're reading from something other than the buffer.
-
- * window.c (window_scroll_pixel_based): Only look at
- Vscroll_preserve_screen_position if the old PT can't be kept.
- (syms_of_window) <scroll-preserve-screen-position>: Doc fix.
-
-2004-12-30 Kim F. Storm <[email protected]>
-
- * xdisp.c (get_line_height_property): New function extracted from
- original calc_line_height_property.
- (calc_line_height_property): Rework. Handle t and (nil . ratio).
- (x_produce_glyphs): Use them to handle line-height and
- line-spacing according to new height spec.
- (Qtotal): Remove.
- (syms_of_xdisp): Remove intern and staticpro for Qtotal.
-
-2004-12-30 Kenichi Handa <[email protected]>
-
- * fileio.c (Finsert_file_contents): Don't use
- current_buffer->buffer_file_coding_system even if REPLACE is
- non-nil. Call Qafter_insert_file_set_coding with the second arg VISIT.
-
- * fontset.h (struct font_info): New members space_width and
- average_width.
-
- * frame.h (struct frame): New member space_width.
- (FRAME_SPACE_WIDTH): New macro.
-
- * xterm.h (struct x_display_info): New member Xatom_AVERAGE_WIDTH.
-
- * xterm.c (x_new_font): Set FRAME_COLUMN_WIDTH to
- fontp->average_width, not FONT_WIDTH. Set FRAME_SPACE_WIDTH to
- fontp->space_width.
- (x_load_font): Calculate fontp->space_width and fontp->average_width.
- (x_term_init): Initialize dpyinfo->Xatom_AVERAGE_WIDTH.
-
- * xdisp.c (x_produce_glyphs): Calculate tab width by
- FRAME_SPACE_WIDTH, not FRAME_COLUMN_WIDTH.
-
-2004-12-29 Sanghyuk Suh <[email protected]>
-
- * macterm.c (SelectionRange): Add Xcode position apple event struct.
- (do_ae_open_documents): Handle Xcode-style file position open events.
-
-2004-12-29 Luc Teirlinck <[email protected]>
-
- * buffer.c (syms_of_buffer) <vertical-scroll-bar>: Correct typo.
-
-2004-12-29 Richard M. Stallman <[email protected]>
-
- * buffer.c (syms_of_buffer) <vertical-scroll-bar>: Doc fix.
-
-2004-12-29 YAMAMOTO Mitsuharu <[email protected]>
-
- * macfns.c (install_window_handler): Modify extern to return OSErr
- value.
- (mac_window): Handle return value of install_window_handler.
-
- * macterm.c (reflect_byte): Remove function.
- (mac_create_bitmap_from_bitmap_data): Don't call reflect_byte.
- Lookup table instead.
- (mac_do_font_lists): Simplify calculation of the longest
- nonspecial string.
- (init_mac_drag_n_drop): Remove function and declaration.
- (mac_initialize) [TARGET_API_MAC_CARBON]: Don't call
- init_mac_drag_n_drop.
- (mac_do_track_drag): New function and declaration.
- (install_window_handler): Return OSErr value.
- (install_window_handler) [TARGET_API_MAC_CARBON]:
- Register handlers for tracking/receiving drag-and-drop items.
- (do_ae_open_documents): Generate unibyte strings for filenames.
- (mac_do_receive_drag) [TARGET_API_MAC_CARBON]: Likewise.
- Reject only non-filename items. Set event modifiers, and return value.
-
-2004-12-28 Dan Nicolaescu <[email protected]>
-
- * coding.c (decode_coding): Fix previous change.
-
-2004-12-28 Richard M. Stallman <[email protected]>
-
- * xdisp.c (back_to_previous_visible_line_start):
- Don't call handle_display_prop.
-
-2004-12-28 Dan Nicolaescu <[email protected]>
-
- * coding.c (decode_coding_XXX, decode_composition_emacs_mule)
- (decode_coding_emacs_mule, encode_coding_emacs_mule)
- (decode_coding_iso2022, encode_designation_at_bol)
- (encode_coding_iso2022, decode_coding_sjis_big5, decode_eol)
- (decode_coding): Constify arguments and local vars.
-
-2004-12-27 Jan Dj,Ad(Brv <[email protected]>
-
- * xmenu.c (popup_get_selection): Only pop down dialogs
- on C-g and Escape.
- (popup_get_selection): Remove parameter down_on_keypress.
- (create_and_show_popup_menu, create_and_show_dialog):
- Remove parameter down_on_keypress to popup_get_selection.
-
-2004-12-27 YAMAMOTO Mitsuharu <[email protected]>
-
- * dispextern.h: Change HAVE_CARBON to MAC_OS.
- (struct glyph_string): Likewise.
-
- * emacs.c (main) [MAC_OS8]: Call mac_term_init instead of
- mac_initialize.
-
- * fileio.c (Fnext_read_file_uses_dialog_p, Fread_file_name):
- Change TARGET_API_MAC_CARBON to HAVE_CARBON.
-
- * fns.c (vector): Change MAC_OSX to MAC_OS.
-
- * frame.c (x_set_frame_parameters, x_report_frame_params)
- (x_set_fullscreen): Remove #ifndef HAVE_CARBON.
- (x_set_border_width, Vdefault_frame_scroll_bars):
- Change HAVE_CARBON to MAC_OS.
-
- * image.c [MAC_OS]: Include sys/stat.h.
- [MAC_OS && !MAC_OSX]: Include sys/param.h, ImageCompression.h, and
- QuickTimeComponents.h.
-
- * mac.c [!MAC_OSX] (mac_wait_next_event): Add extern.
- [!MAC_OSX] (select): Use mac_wait_next_event.
- [!MAC_OSX] (run_mac_command): Change EXEC_SUFFIXES to Vexec_suffixes.
- [!MAC_OSX] (select, run_mac_command): Change `#ifdef
- TARGET_API_MAC_CARBON' to `#if TARGET_API_MAC_CARBON'.
- (mac_clear_font_name_table): Add extern.
- (Fmac_clear_font_name_table): New defun.
- (syms_of_mac): Defsubr it.
- [MAC_OSX] (SELECT_POLLING_PERIOD_USEC): New define.
- [MAC_OSX] (select_and_poll_event): New function.
- [MAC_OSX] (sys_select): Use it.
- [MAC_OSX && SELECT_USE_CFSOCKET] (socket_callback): New function.
- [MAC_OSX && SELECT_USE_CFSOCKET]
- (SELECT_TIMEOUT_THRESHOLD_RUNLOOP, EVENT_CLASS_SOCK): New defines.
- [MAC_OSX] (sys_select) [SELECT_USE_CFSOCKET]: Use CFSocket and
- RunLoop for simultaneously monitoring two kinds of inputs, window
- events and process outputs, without periodically polling.
-
- * macfns.c (mac_initialized): Remove extern.
- (stricmp): Put in #if 0. All callers changed to use xstricmp in
- xfaces.c.
- (strnicmp): Decrement `n' at the end of each loop, not the beginning.
- (check_mac): Use the term "Mac native windows" instead of "Mac OS".
- (check_x_display_info, x_display_info_for_name): Sync with xfns.c.
- (mac_get_rdb_resource): New function (from w32reg.c).
- (x_get_string_resource): Use it.
- (install_window_handler): Add extern.
- (mac_window): New function.
- (Fx_create_frame): Use it instead of make_mac_frame.
- Set parameter for Qfullscreen. Call x_wm_set_size_hint.
- (Fx_open_connection, Fx_close_connection): New defuns.
- (syms_of_macfns): Defsubr them.
- (x_create_tip_frame) [TARGET_API_MAC_CARBON]:
- Add kWindowNoUpdatesAttribute to the window attribute.
- (x_create_tip_frame) [!TARGET_API_MAC_CARBON]: Use NewCWindow.
- (x_create_tip_frame): Don't call ShowWindow.
- (Fx_show_tip): Call ShowWindow.
- (Fx_file_dialog): Change `#ifdef TARGET_API_MAC_CARBON' to `#if
- TARGET_API_MAC_CARBON'.
- (mac_frame_parm_handlers): Set handlers for Qfullscreen.
- (syms_of_macfns) [MAC_OSX]: Initialize mac_in_use to 0.
-
- * macgui.h [!MAC_OSX]: Don't include Controls.h. Include Windows.h.
- (Window): Typedef to WindowPtr and move outside `#if
- TARGET_API_MAC_CARBON'.
- (XSizeHints): New struct.
-
- * macterm.c (x_update_begin, x_update_end)
- [TARGET_API_MAC_CARBON]: Disable screen updates during update of a
- frame.
- (x_draw_glyph_string_background, x_draw_glyph_string_foreground)
- [MAC_OS8]: Use XDrawImageString/XDrawImageString16.
- (construct_mouse_click): Put in #if 0.
- (x_check_fullscreen, x_check_fullscreen_move): Remove decls.
- (x_scroll_bar_create, x_scroll_bar_handle_click): Change `#ifdef
- TARGET_API_MAC_CARBON' to `#if TARGET_API_MAC_CARBON'.
- (activate_scroll_bars, deactivate_scroll_bars)
- [!TARGET_API_MAC_CARBON]: Use ActivateControl/DeactivateControl.
- (x_make_frame_visible) [TARGET_API_MAC_CARBON]: Reposition window
- if the position is neither user-specified nor program-specified.
- (x_free_frame_resources): Free size_hints.
- (x_wm_set_size_hint): Allocate size_hints if needed. Set size_hints.
- (mac_clear_font_name_table): New function.
- (mac_do_list_fonts): Initialize font_name_table if needed.
- (x_list_fonts): Don't initialize font_name_table. Add BLOCK_INPUT
- around mac_do_list_fonts.
- (mac_unload_font): New function.
- (x_load_font): Add BLOCK_INPUT around XLoadQueryFont.
- (init_mac_drag_n_drop, mac_do_receive_drag): Enclose declarations
- and definitions with #if TARGET_API_MAC_CARBON.
- [USE_CARBON_EVENTS] (mac_handle_window_event): Add decl.
- (install_window_handler): Add decl.
- (do_window_update): Add BeginUpdate/EndUpdate for the tooltip
- window. Use UpdateControls. Get the rectangle that should be
- updated and restrict the target of expose_frame to it.
- (do_grow_window): Set minimum height/width according to size_hints.
- (do_grow_window) [TARGET_API_MAC_CARBON]: Use ResizeWindow.
- (do_zoom_window): Don't use x_set_window_size.
- [USE_CARBON_EVENTS] (mac_handle_window_event): New function.
- (install_window_handler): New function.
- [!USE_CARBON_EVENTS] (mouse_region): New variable.
- [!USE_CARBON_EVENTS] (mac_wait_next_event): New function.
- (XTread_socket) [USE_CARBON_EVENTS]: Move call to
- GetEventDispatcherTarget inside BLOCK_INPUT.
- (XTread_socket) [!USE_CARBON_EVENTS]: Use mac_wait_next_event.
- Update mouse_region when mouse is moved.
- (make_mac_frame): Remove.
- (make_mac_terminal_frame): Put in #ifdef MAC_OS8.
- Initialize mouse pointer shapes. Change values of f->left_pos and
- f->top_pos. Don't use make_mac_frame. Use NewCWindow.
- Don't call ShowWindow.
- (mac_initialize_display_info) [MAC_OSX]: Create mac_id_name from
- Vinvocation_name and Vsystem_name.
- (mac_make_rdb): New function (from w32term.c).
- (mac_term_init): Use it. Add BLOCK_INPUT. Error if display has
- already been opened. Don't pass argument to
- mac_initialize_display_info. Don't set dpyinfo->height/width.
- Add entries to x_display_list and x_display_name_list.
- (x_delete_display): New function.
- (mac_initialize): Don't call mac_initialize_display_info.
- (syms_of_macterm) [!MAC_OSX]: Don't call Fprovide.
-
- * macterm.h (check_mac): Add extern.
- (struct mac_output): New member size_hints.
- (FRAME_SIZE_HINTS): New macro.
- (mac_unload_font): Add extern.
-
- * xdisp.c (expose_window, expose_frame): Remove kludges for Mac.
-
- * xfaces.c (clear_font_table) [MAC_OS]: Call mac_unload_font.
-
-2004-12-27 Richard M. Stallman <[email protected]>
-
- * buffer.c (Fbuffer_disable_undo): Delete (move to simple.el).
- (syms_of_buffer): Don't defsubr it.
-
- * process.c (list_processes_1): Set undo_list instead
- of calling Fbuffer_disable_undo.
-
- * xdisp.c (single_display_spec_string_p): Rename from
- single_display_prop_string_p.
- (single_display_spec_intangible_p): Rename from
- single_display_prop_intangible_p.
- (handle_single_display_spec): Rename from handle_single_display_prop.
- Rewritten to be easier to understand.
-
- Change in load-history format. Functions now get (defun . NAME),
- and variables get just NAME.
-
- * data.c (Fdefalias): Use (defun . FN_NAME) in LOADHIST_ATTACH.
-
- * eval.c (Fdefun, Fdefmacro): Use (defun . FN_NAME) in LOADHIST_ATTACH.
- (Fdefvaralias, Fdefvar, Fdefconst): Use just SYM in LOADHIST_ATTACH.
- (Qdefvar): Var deleted.
- (syms_of_eval): Don't initialze it.
-
- * lread.c (syms_of_lread) <load-history>: Doc fix.
-
-2004-12-27 Jan Dj,Ad(Brv <[email protected]>
-
- * xmenu.c (popup_get_selection): Pop down on C-g.
- (set_frame_menubar): Install translations for Lucid/Motif/Lesstif that
- pops down menu on C-g.
- (xdialog_show): If dialog popped down and no button in the dialog was
- pushed, call Fsignal to quit.
- (xmenu_show): In no toolkit version, if menu returns NO_SELECT call
- Fsignal to quit.
-
- * xfns.c (Fx_file_dialog): Motif/Lesstif version: Pop down on C-g.
-
- * gtkutil.c (xg_initialize): Install bindings for C-g so that
- dialogs and menus pop down.
-
-2004-12-27 Kenichi Handa <[email protected]>
-
- * coding.c (code_convert_region): Fix calculation of `ratio'.
-
-2004-12-25 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (update_frame_tool_bar): Make the value of
- tool-bar-button-margin control margins of images in tool bar.
-
- * alloc.c (check_depth): New variable.
- (overrun_check_malloc, overrun_check_realloc): Only add
- overhead and write check pattern if check_depth is 1 (to handle
- recursive calls). Increase/decrease check_depth in entry/exit.
- (overrun_check_free): Only check for overhead if check_depth is 1.
- Increase/decrease check_depth in entry/exit.
-
-2004-12-23 Jan Dj,Ad(Brv <[email protected]>
-
- * keyboard.c (input_available_signal): Call SIGNAL_THREAD_CHECK
- before touching input_available_clear_time, to avoid accessing it
- from multiple threads.
-
-2004-12-23 Jason Rumney <[email protected]>
-
- * image.c (__WIN32__) [HAVE_NTGUI]: Define for correct behaviour
- of JPEG library.
-
-2004-12-22 Richard M. Stallman <[email protected]>
-
- * emacs.c (main): If batch mode, set Vundo_outer_limit to nil.
-
- * lisp.h (Vundo_outer_limit): Fix decl.
-
- * undo.c (Vundo_outer_limit): Replaces undo_outer_limit.
- Uses changed.
- (syms_of_undo): Initialize appropriately.
- (truncate_undo_list): If it's nil, there's no limit.
-
-2004-12-22 Kenichi Handa <[email protected]>
-
- * xselect.c (Fx_get_cut_buffer_internal): Return a unibyte string.
-
-2004-12-21 Richard M. Stallman <[email protected]>
-
- * eval.c (unwind_to_catch): Clear immediate_quit.
-
- * xdisp.c (get_next_display_element): Display codes 8a0 and 8ad
- specially as `\ ' and `\-'.
-
- * keyboard.c (kbd_buffer_store_event_hold):
- In the code for while-no-input, handle immediate_quit.
-
- * alloc.c (Fgarbage_collect): Update call to truncate_undo_list.
- Call that at the very start.
- (undo_limit, undo_strong_limit, undo_outer_limit): Move to undo.c.
- (syms_of_alloc): Don't define undo-limit,
- undo-strong-limit and undo-outer-limit here.
-
- * undo.c (truncate_undo_list): Return void.
- Take just one argument, the buffer.
- Make it current, and inhibit recursive GC.
- Access and update the undo list directly; return void.
- Refer to the undo...limit variables directly.
- Test undo_outer_limit only after counting the whole current command.
- When it's exceeded, call the function in undo-outer-limit-function.
- (undo_limit, undo_strong_limit, undo_outer_limit): From alloc.c.
- (Vundo_outer_limit_function): New variable.
- (syms_of_undo): Define undo-limit, undo-strong-limit
- and undo-outer-limit here, and undo-outer-limit-function.
- Doc fixes.
-
- * lisp.h (truncate_undo_list): Update decl.
-
-2004-12-21 Piet van Oostrum <[email protected]>
-
- * fileio.c (Fread_file_name): Delete duplicates in
- file-name-history when history_delete_duplicates is true.
-
-2004-12-20 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.c (mac_do_list_fonts): Fix memory leak.
-
-2004-12-20 Richard M. Stallman <[email protected]>
-
- * regex.c (re_match_2_internal) <symend, wordend>:
- Fix calls to UPDATE_SYNTAX_TABLE_FORWARD.
-
-2004-12-18 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.c (endif, x_font_name_to_mac_font_name):
- Use maccentraleurroman instead of maccentraleuropean
- (mac_c_string_match, mac_do_list_fonts): Speed up font search by
- quickly finding a specific font without needing regexps.
-
-2004-12-15 Jan Dj,Ad(Brv <[email protected]>
-
- * syssignal.h: Declare main_thread.
- (SIGNAL_THREAD_CHECK): New macro.
-
- * keyboard.c (input_available_signal): Move thread checking code
- to macro SIGNAL_THREAD_CHECK and call that macro.
- (interrupt_signal): Call SIGNAL_THREAD_CHECK.
-
- * alloc.c (uninterrupt_malloc): Move main_thread to emacs.c.
-
- * emacs.c: Define main_thread.
- (main): Initialize main_thread.
- (handle_USR1_signal, handle_USR2_signal, fatal_error_signal)
- (memory_warning_signal): Call SIGNAL_THREAD_CHECK.
-
- * floatfns.c (float_error): Call SIGNAL_THREAD_CHECK.
-
- * dispnew.c (window_change_signal): Call SIGNAL_THREAD_CHECK.
-
- * sysdep.c (select_alarm): Call SIGNAL_THREAD_CHECK.
-
- * process.c (send_process_trap, sigchld_handler):
- Call SIGNAL_THREAD_CHECK.
-
- * data.c (arith_error): Call SIGNAL_THREAD_CHECK.
-
- * atimer.c (alarm_signal_handler): Call SIGNAL_THREAD_CHECK.
-
- * xterm.c (xg_scroll_callback): Update XG_LAST_SB_DATA before
- returning when xg_ignore_gtk_scrollbar is true.
-
-2004-12-14 Kim F. Storm <[email protected]>
-
- * keyboard.c (read_char): Save and restore echo_string when
- handling input method.
-
-2004-12-13 Richard M. Stallman <[email protected]>
-
- * eval.c (syms_of_eval) <quit-flag>: Doc fix.
-
- * keyboard.c (Vthrow_on_input): New variable.
- (syms_of_keyboard): Defvar and initialize it.
- (kbd_buffer_store_event_hold): Handle Vthrow_on_input.
-
- * lisp.h (QUIT): Check for Vthrow_on_input.
- (Vthrow_on_input): Declare it.
-
-2004-12-13 Kim F. Storm <[email protected]>
-
- * xdisp.c (set_iterator_to_next): Reset stop_charpos after display
- vector.
-
-2004-12-12 Richard M. Stallman <[email protected]>
-
- * indent.c (Fvertical_motion): Call move_it_by_lines even if LINES = 0.
-
- * minibuf.c (Fall_completions): Add var `zero' and use it in loop.
- (Ftry_completion): Really use outer `zero'; eliminate inner one.
-
-2004-12-12 Kenichi Handa <[email protected]>
-
- * term.c (encode_terminal_code): Fix previous change.
-
-2004-12-11 Stefan Monnier <[email protected]>
-
- * keyboard.c (handle_async_input): Remove pthread mutex handling.
- (input_available_signal): Move pthread thingy to !SYNC_INPUT branch.
-
- * syntax.c (Fforward_word): Avoid non-idempotent side-effects
- in macro arguments.
-
- * minibuf.c (Ftry_completion, Fall_completions): Don't use
- XFASTINT blindly.
-
- * emacs.c (main, Fdump_emacs): Don't touch malloc hooks if SYNC_INPUT.
-
-2004-12-11 Jan Dj,Ad(Brv <[email protected]>
-
- * w32term.c (x_calc_absolute_position): Remove calculation of
- difference between inner and outer window. Don't subtract difference
- for left and top calculations.
-
- * xterm.c (x_calc_absolute_position): Don't subtract outer_pixel_diff
- for left and top calculations. Remove call to x_real_positions.
- [Bug report by Drew Adams in November.]
- (x_check_expected_move): Do not set change_gravity to 1 when calling
- x_set_offset.
-
-2004-12-08 Richard M. Stallman <[email protected]>
-
- * xdisp.c (get_next_display_element): Use `escape-glyph' for
- control chars and escaped octal codes.
- (Qescape_glyph): New variable.
- (syms_of_xdisp): Initialize it.
- (escape_glyph_face): New variable.
- (redisplay_window): Initialize it.
-
-2004-12-07 Paul Eggert <[email protected]>
-
- * image.c (our_fill_input_buffer, jpeg_load, CHECK_LIB_AVAILABLE)
- (init_image): Use 1 rather than TRUE. TRUE's not always defined.
-
-2004-12-07 Jan Dj,Ad(Brv <[email protected]>
-
- * emacs.c (Fdump_emacs): Add ! defined (SYSTEM_MALLOC) around
- reset_malloc_hooks.
-
- * keyboard.c (handle_async_input, input_available_signal):
- Add ! defined (SYSTEM_MALLOC) around thread code.
-
- * alloc.c: Add comment about the reason for (UN)BLOCK_INPUT_ALLOC.
-
-2004-12-07 Stefan Monnier <[email protected]>
-
- * eval.c (init_eval_once): Increase max_specpdl_size to 1000.
-
- * config.in: Regenerate.
-
-2004-12-07 Jan Dj,Ad(Brv <[email protected]>
-
- * xmenu.c (Fx_popup_menu): Correct documentation about position.
- (xmenu_show): Do not call XTranslateCoordinates. Adjust position
- if not given by a mouse click to correspond with x-popup-menu
- documentation.
-
- * config.in: Regenerate.
-
- * gtkutil.c: Include signal.h and syssignal.h.
- (xg_get_file_name): Block and unblock __SIGRTMIN if defined.
-
- * alloc.c: If HAVE_GTK_AND_PTHREAD, include pthread.h,
- new variables main_thread and alloc_mutex,
- define (UN)BLOCK_INPUT_ALLOC to use alloc_mutex to protect
- emacs_blocked_* calls and only do (UN)BLOCK_INPUT in the main thread.
- If not HAVE_GTK_AND_PTHREAD, (UN)BLOCK_INPUT_ALLOC is the same
- as (UN)BLOCK_INPUT.
- (emacs_blocked_free, emacs_blocked_malloc)
- (emacs_blocked_realloc): Use (UN)BLOCK_INPUT_ALLOC.
- (uninterrupt_malloc): Initialize main_thread and alloc_mutex.
- (reset_malloc_hooks): New function.
-
- * lisp.h: Declare reset_malloc_hooks.
-
- * emacs.c (Fdump_emacs): Call reset_malloc_hooks.
-
- * keyboard.c: Conditionally include pthread.h.
- (handle_async_input, input_available_signalt): If not in the main
- thread, block signal, send signal to main thread and return.
-
- * gtkutil.c (xg_get_file_with_chooser): Handle local files only.
- Set current folder in file chooser if default_filename is a directory.
-
-2004-12-05 Stefan Monnier <[email protected]>
-
- * regex.c (GET_UNSIGNED_NUMBER): Signal an error when reaching the end.
- Remove redundant correctness checks.
- (regex_compile): Fix up error codes for \{..\} expressions.
-
-2004-12-05 Richard M. Stallman <[email protected]>
-
- * regex.c (regex_compile): Fix end-of-pattern case for space.
-
-2004-12-03 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.h (cfstring_create_with_utf8_cstring): Add prototype.
- * mac.c (cfstring_create_with_utf8_cstring): Add to prevent
- crashes with invalid characters.
- * macmenu.c (add_menu_item): Use it.
- * image.c (image_load_quartz2d): Likewise.
- * macfns.c (x_set_name, x_set_title): Likewise.
- (Fx_file_dialog): Likewise. Use constant CFRefs instead of
- creating them each time for labels.
-
-2004-12-02 Richard M. Stallman <[email protected]>
-
- * config.in (RE_TRANSLATE_P): If make_number is not a macro,
- don't use it here.
-
- * eval.c (Fcalled_interactively_p): Don't check INTERACTIVE.
- (interactive_p): Skip Scalled_interactively_p frames
- like Sinteractive_p frames.
- (unwind_to_catch): Clear handling_signal.
-
- * data.c (Fmake_variable_buffer_local): Doc fix.
- (Fmake_local_variable): Doc fix.
-
- * insdel.c (insert_from_string_before_markers)
- (insert_from_string): Don't modify buffer on empty insertion.
-
- * window.c (Fget_lru_window, Fget_largest_window): Doc fixes.
-
-2004-12-01 YAMAMOTO Mitsuharu <[email protected]>
-
- * macmenu.c (add_menu_item): Fallback on MacRoman if encoding
- menu text as UTF8 fails.
-
-2004-12-01 Kim F. Storm <[email protected]>
-
- * alloc.c: Add commentary for last change.
- (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): New macros to handle
- sizeof(size_t) != 4.
- (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
- Use them. Also clear header and trailer of freed memory.
- (GC_STRING_OVERRUN_COOKIE_SIZE): Rename from GC_STRING_EXTRA.
- (string_overrun_cookie): Rename from string_overrun_pattern.
- (GC_STRING_EXTRA): Define from GC_STRING_OVERRUN_COOKIE_SIZE.
-
-2004-12-01 Andreas Schwab <[email protected]>
-
- * lisp.h: Declare string_to_multibyte.
-
-2004-12-01 Kenichi Handa <[email protected]>
-
- * w32console.c (w32con_write_glyphs): Decide coding here.
- Adjusted for the change of encode_terminal_code.
-
- * term.c (encode_terminal_code): Don't make it "static".
-
-2004-11-30 Kenichi Handa <[email protected]>
-
- * term.c (encode_terminal_buf, encode_terminal_bufsize): New variables.
- (encode_terminal_code): Argument changed. Encode all
- characters at once, and return a pointer to the result of encoding.
- (write_glyphs): Decide coding here. Adjusted for the above change.
- (insert_glyphs): Likewise.
- (term_init): Initialize encode_terminal_bufsize to 0.
-
- * coding.c (Vcode_conversion_workbuf_name): New variable.
- (syms_of_coding): Initialize and staticpro it.
- (set_conversion_work_buffer): New function.
- (run_pre_post_conversion_on_str): Use it.
- (run_pre_write_conversin_on_c_str): New function.
-
- * coding.h (run_pre_write_conversin_on_c_str): Extern it.
-
-2004-11-30 YAMAMOTO Mitsuharu <[email protected]>
-
- * keyboard.c: Don't undef SIGIO
- * s/darwin.h (NO_SOCK_SIGIO): Define NO_SOCK_SIGIO on carbon
- * Makefile.in (mac.o): Depend on blockinput.h and atimer.h.
- (macfns.o): Don't depend on ccl.h.
- * macfns.c (mac_frame_parm_handlers): Set handlers for
- Qleft_fringe and Qright_fringe.
- * macterm.c (mac_fill_rectangle_to_pixmap)
- (mac_draw_rectangle_to_pixmap, mac_copy_area_to_pixmap)
- (mac_copy_area_with_mask_to_pixmap, x_draw_image_foreground_1):
- Put in #if 0.
- (mac_scroll_area) [TARGET_API_MAC_CARBON]: Use ScrollWindowRect.
- (x_flush) [TARGET_API_MAC_CARBON]: Don't traverse frames.
- (XFlush) [TARGET_API_MAC_CARBON]: Define to an empty replacement.
- (x_draw_glyph_string_background, x_draw_glyph_string_foreground)
- [!MAC_OS8]: Added ifdef'd out code for os8. Don't use
- XDrawImageString. Always draw background and foreground separately.
- (x_draw_image_foreground): Use clipping instead of computing the
- intersection rectangle.
- (x_draw_image_glyph_string): Don't draw an image with mask to a
- pixmap.
- (x_redisplay_interface): Set flush_display_optional member to 0.
- (XTread_socket): Correctly reset the TEConverter
- object.
-
-2004-11-30 Kim F. Storm <[email protected]>
-
- * lisp.h: New defines to enable buffer overrun checking.
- (GC_CHECK_STRING_OVERRUN, GC_CHECK_STRING_FREE_LIST)
- (XMALLOC_OVERRUN_CHECK, GC_CHECK_CONS_LIST): Add.
-
- * alloc.c: Add more checks for buffer overruns.
- (XMALLOC_OVERRUN_CHECK_SIZE, xmalloc_overrun_check_header)
- xmalloc_overrun_check_trailer, overrun_check_malloc)
- overrun_check_realloc, overrun_check_free): Add.
- (GC_STRING_EXTRA, string_overrun_pattern): Add.
- (check_sblock, allocate_string_data, compact_small_strings):
- Set and check string_overrun_pattern if GC_CHECK_STRING_OVERRUN.
- (check_cons_list): Condition on GC_CHECK_CONS_LIST.
- (check_string_free_list): Add.
- (allocate_string, sweep_strings): Call check_string_free_list.
-
- * emacs.c (malloc_initialize_hook): Don't free malloc_state_ptr if
- XMALLOC_OVERRUN_CHECK to avoid crash during load.
-
-2004-11-29 Kim F. Storm <[email protected]>
-
- * fns.c (concat): Use SAFE_ALLOCA.
-
-2004-11-29 Stefan Monnier <[email protected]>
-
- * sysdep.c (emacs_write): Don't use QUIT.
-
-2004-11-29 Kenichi Handa <[email protected]>
-
- * buffer.c (init_buffer): Set current_buffer->directory to a
- multibyte string made by string_to_multibyte.
-
- * emacs.c (init_cmdargs): Set unibyte strings in Vcommand_line_args.
-
-2004-11-27 Andreas Schwab <[email protected]>
-
- * alloc.c (mark_stack): Call GC_MARK_SECONDARY_STACK if defined.
-
- * s/gnu-linux.h: Enable no-op gcpros on ia64.
- (GC_MARK_SECONDARY_STACK) [__ia64__]: Define.
-
- * filelock.c (lock_file_1): Call get_boot_time early.
- Increase buffer size.
-
-2004-11-27 Eli Zaretskii <[email protected]>
-
- * lisp.h (DECL_ALIGN): Define non-trivially only if NO_DECL_ALIGN
- is not defined.
-
-2004-11-27 Kim F. Storm <[email protected]>
-
- * search.c (syms_of_search) <search-spaces-regexp>: Move 'doc:'
- marker out of doc string.
-
-2004-11-26 Stefan Monnier <[email protected]>
-
- * s/darwin.h (POSIX_SIGNALS): Undo the removal of 2002-08-25,
- which was not mentioned in the log.
-
-2004-11-26 Kim F. Storm <[email protected]>
-
- * fringe.c (update_window_fringes): Prefer truncation bitmaps over
- angle bitmaps at top/bottom line.
-
- * xdisp.c: Undo recent changes for restoring saved_face_id. Instead,
- set it when it->method is set to next_element_from_display_vector.
- (setup_for_ellipsis): Add LEN argument. Callers changed.
- Set it->saved_face_id.
- (get_next_display_element): Use loop instead of recursion.
- Set it->saved_face_id. Combine duplicate code for ctr chars.
- (next_element_from_display_vector): Do not set it->saved_face_id.
- (next_element_from_ellipsis): Use setup_for_ellipsis.
-
-2004-11-26 Eli Zaretskii <[email protected]>
-
- * eval.c (Fdefvar): Declare pdl from last change as `volatile' to
- prevent compiler warnings.
-
-2004-11-25 Stefan Monnier <[email protected]>
-
- * keyboard.c (command_loop_1): Print a message describing the key
- the user just pressed when this key has no binding.
-
- * sysdep.c (sys_signal): Don't use SA_RESTART if SYNC_INPUT is set.
- (emacs_open, emacs_read, emacs_write): Check QUIT when interrupted.
-
- * lread.c (readchar): Check QUIT when `getc' is interrupted.
-
-2004-11-24 Richard M. Stallman <[email protected]>
-
- * coding.c (run_pre_post_conversion_on_str): Bind Qinhibit_read_only.
-
- * buffer.c (syms_of_buffer) <indicate-buffer-boundaries>: Doc fix.
-
-2004-11-24 Kim F. Storm <[email protected]>
-
- * xdisp.c (move_it_in_display_line_to, display_line):
- Restore saved_face_id also when truncate-lines or hscrolled.
-
-2004-11-23 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (xg_get_file_name): Rename use-old-gtk-file-dialog to
- x-use-old-gtk-file-dialog.
-
- * xfns.c: Define x_use_old_gtk_file_dialog.
- (syms_of_xfns): Rename use-old-gtk-file-dialog to x-... Move it
- outside ifdef USE_GTK.
-
-2004-11-23 Stefan Monnier <[email protected]>
-
- * coding.h (ENCODE_FILE, DECODE_FILE, ENCODE_SYSTEM, DECODE_SYSTEM):
- Don't use XFASTINT blindly.
-
- * config.in (RE_TRANSLATE_P): Don't use XFASTINT blindly.
-
- * indent.c (skip_invisible): Avoid non-idempotent side-effects
- in macro arguments.
-
- * keymap.c (Flookup_key): Check INTEGERP before XINT.
-
- * lread.c (oblookup): Don't use XFASTINT blindly.
-
- * window.c (Fset_window_scroll_bars): Don't use XINT if it isn't int.
- (decode_next_window_args, window_loop): Don't use XFASTINT blindly.
-
-2004-11-23 Kim F. Storm <[email protected]>
-
- * dispextern.h (MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P)
- (MATRIX_ROW_STARTS_IN_MIDDLE_OF_CHAR_P): Not if dpvec_index is zero.
-
- * xfaces.c (lookup_named_face): Add signal_p arg. Return -1 if
- signal_p is zero and face name is unknown.
- (Fx_list_fonts): Don't signal error in lookup_named_face.
- (Fface_font): Signal error in lookup_named_face.
- (ascii_face_of_lisp_face): Likewise.
-
- * dispextern.h (lookup_named_face): Fix prototype.
-
- * xdisp.c (handle_single_display_prop): Don't signal error in
- lookup_named_face for unknown fringe face name.
- (highlight_trailing_whitespace): Don't signal error in
- lookup_named_face if trailing-whitespace face unknown.
- (calc_line_height_property): Don't signal error in
- lookup_named_face if specified face name is unknown.
-
- * fringe.c (update_window_fringes): Show top row indicator if
- window has header-line. Don't show arrow at bob and eob
- if the boundary indicators are not used.
- (Fset_fringe_bitmap_face): Signal error in lookup_named_face.
-
- * window.c (set_window_buffer): Clear display_error_modiff.
-
-2004-11-22 Kim F. Storm <[email protected]>
-
- * fringe.c (update_window_fringes): Provide sensible fall-back
- value for non-nil indicate-buffer-boundaries setting.
-
-2004-11-22 Markus Rost <[email protected]>
-
- * minibuf.c (Fminibuffer_complete_and_exit): Fix previous change.
-
-2004-11-22 Stefan Monnier <[email protected]>
-
- * eval.c (Fdefvar): Warn when var is let-bound but globally void.
-
-2004-11-21 Kim F. Storm <[email protected]>
-
- * xdisp.c (erase_phys_cursor): Clear hollow cursor inside TEXT_AREA.
-
- * xterm.c (x_clip_to_row): Add area arg. Callers changed.
- (x_draw_hollow_cursor, x_draw_bar_cursor): Clip to TEXT_AREA.
-
- * w32term.c (w32_clip_to_row): Add area arg. Callers changed.
- (x_draw_hollow_cursor, x_draw_bar_cursor): Clip to TEXT_AREA.
-
- * macterm.c (x_clip_to_row): Add area arg. Callers changed.
- (x_draw_hollow_cursor, x_draw_bar_cursor): Clip to TEXT_AREA.
-
- * xdisp.c (move_it_in_display_line_to, display_line):
- Restore saved_face_id if overflow-newline-into-fringe is enabled and
- line is continued before or in middle of element from display vector.
-
- * indent.c (Fvertical_motion): Fix last change. Use another
- method to detect if iterator moved too far ahead after reseat.
-
- * xdisp.c (IT_EXPAND_MATRIX_WIDTH): New macro. Do not
- expand matrix width for overflow in zero-width area.
- (append_glyph, append_composite_glyph, produce_image_glyph)
- (append_stretch_glyph): Use it to avoid loop in redisplay.
- (note_mode_line_or_margin_highlight): Don't let help-echo from
- string override help-echo from image map.
-
-2004-11-20 Luc Teirlinck <[email protected]>
-
- * fns.c (Fyes_or_no_p): Call Fread_from_minibuffer with extra argument.
- * callint.c (Fcall_interactively): Ditto.
-
-2004-11-20 Stefan Monnier <[email protected]>
-
- * minibuf.c (Fminibuffer_complete_and_exit):
- Fixup the case of the completed value, for case-indep completion.
-
-2004-11-20 Richard M. Stallman <[email protected]>
-
- * lisp.h (Fread_from_minibuffer): Add arg in decl.
-
- * minibuf.c (read_minibuf): New arg KEEP_ALL. Callers changed.
- (Fread_from_minibuffer): New arg KEEP_ALL. Callers changed.
-
- * search.c (Vsearch_spaces_regexp):
- Rename from Vsearch_whitespace_regexp. All uses changed.
-
-2004-11-20 Thien-Thi Nguyen <[email protected]>
-
- * eval.c (init_eval_once): Increase `max_specpdl_size' to 650.
-
-2004-11-19 Richard M. Stallman <[email protected]>
-
- * search.c (Vsearch_whitespace_regexp): New variable.
- (syms_of_search): Defvar it.
- (compile_pattern_1): Call re_set_whitespace_regexp with it.
- (search_buffer): No regexp is trivial if Vsearch_whitespace_regexp
- is non-nil.
- (struct regexp_cache): New element whitespace_regexp.
- (syms_of_search): Initialize whitespace_regexp elements.
- (compile_pattern): Compare whitespace_regexp elements.
- (compile_pattern_1): Set whitespace_regexp elements.
-
- * regex.c (regex_compile): Substitute whitespace_regexp
- for spaces, if it is nonzero.
- (whitespace_regexp): New variable.
- (re_set_whitespace_regexp): New function.
-
-2004-11-19 Kim F. Storm <[email protected]>
-
- * indent.c (Fvertical_motion): Fix last change.
-
-2004-11-18 Kim F. Storm <[email protected]>
-
- * indent.c (Fvertical_motion): Undo 2004-11-16 change.
- Instead, move back again if reseating moves too far ahead.
-
-2004-11-17 Luc Teirlinck <[email protected]>
-
- * xdisp.c (message3): Call clear_message.
-
-2004-11-17 Kim F. Storm <[email protected]>
-
- * xdisp.c (erase_phys_cursor): Adjust cursor row visible height.
-
-2004-11-16 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (xg_get_file_name): Typo in HAVE_GTK_FILE_SELECTION_NEW.
-
- * xmenu.c (x_menu_in_use): Remove.
- (x_menu_set_in_use): Also set popup_activated_flag.
-
- * xfns.c (Fx_file_dialog): Call popup_activated instead of
- x_menu_in_use. Call x_menu_set_in_use in Motif version also.
-
- * xterm.h (x_menu_in_use): Remove.
-
-2004-11-16 Richard M. Stallman <[email protected]>
-
- * keymap.c (Fmap_keymap): New arg SORT-FIRST.
- Use map-keymap-internal to implement that.
-
- * indent.c (Fvertical_motion): In batch mode, use vmotion directly.
-
-2004-11-16 Stefan Monnier <[email protected]>
-
- * xdisp.c (get_glyph_string_clip_rect, init_glyph_string): Check it's
- a window before using XWINDOW.
-
- * window.c (make_window, Fselect_window, make_dummy_parent)
- (save_window_save):
- * frame.c (make_frame):
- * fns.c (concat): Avoid side-effects inside XSETFASTINT's arguments.
-
- * lisp.h (NILP): Use EQ rather than XFASTINT.
-
-2004-11-16 Kim F. Storm <[email protected]>
-
- * fringe.c (Fdefine_fringe_bitmap): Always set 'h'. Simplify.
-
- * indent.c (Fvertical_motion): Fix last change. Only reseat when
- moving backwards.
-
-2004-11-16 Luc Teirlinck <[email protected]>
-
- * dispextern.h: Extern reseat_at_previous_visible_line_start.
-
-2004-11-16 Kenichi Handa <[email protected]>
-
- * xdisp.c (display_mode_element): Fix previous change (calculate
- end position of substring to display correctly).
-
-2004-11-16 Kim F. Storm <[email protected]>
-
- * keyboard.c (Fposn_at_point): Remove extra */ after doc string.
- Reported by Andrew M. Scott.
-
-2004-11-15 Kim F. Storm <[email protected]>
-
- * fns.c (Fsafe_plist_get): New defun.
- (syms_of_fns): Defsubr it.
-
- * lisp.h (Fsafe_plist_get): Add EXFUN.
-
- * xdisp.c (store_mode_line_string, produce_stretch_glyph):
- Use Fsafe_plist_get.
- (note_mode_line_or_margin_highlight, note_mouse_highlight):
- Fix image map element parsing. Use Fsafe_plist_get.
-
-2004-11-15 Richard M. Stallman <[email protected]>
-
- * xdisp.c (get_next_display_element): Fix previous change.
-
-2004-11-14 Jan Dj,Ad(Brv <[email protected]>
-
- * window.c (shrink_windows): Handle special case of one window left
- when trying to shrink the final reminder. Grow windows if
- total_removed is less than total_shrink.
-
- * xmenu.c (pop_down_menu): Remove global variable current_menu,
- extract pointer from arg with XSAVE_VALUE.
- (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
- Construct arg to record_unwind_protect with make_save_value.
-
-2004-11-13 Richard M. Stallman <[email protected]>
-
- * xdisp.c (reseat_at_previous_visible_line_start): No longer static.
- (get_next_display_element): Fix previous change to apply only to \n.
-
- * indent.c (Fvertical_motion): Scan to PT from start of line to
- make iterator consistent.
-
- * minibuf.c (syms_of_minibuf) <completion-ignore-case>: Doc fix.
-
-2004-11-14 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (pop_down_file_dialog): Add BLOCK_INPUT.
-
- * xfns.c (Fx_file_dialog): Call x_menu_in_use and x_menu_set_in_use.
- Record unwind with clean_up_file_dialog.
-
- * xterm.h (x_menu_in_use, x_menu_set_in_use, x_menu_wait_for_event):
- Declare.
-
- * xmenu.c (x_menu_in_use, x_menu_set_in_use): New functions.
-
-2004-11-13 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (xg_file_sel_ok, xg_file_sel_cancel)
- (xg_file_sel_destroy): Remove.
- (xg_file_response_cb, pop_down_file_dialog)
- (xg_get_file_name_from_chooser, xg_get_file_name_from_selector):
- New functions.
- (xg_get_file_with_chooser, xg_get_file_with_selection):
- Take new arg func, set it to xg_get_file_name_from_chooser/selector.
- Move common code to xg_get_file_name. Return widget created.
- (xg_get_file_name): Set name, transient for, modal and destroy
- with parent here. Connect response signal to xg_file_response_cb,
- connect delete-event to gtk_true. Record pop_down_file_dialog
- for unwind. Do event loop and call x_menu_wait_for_event in loop.
- (xg_create_widget): Make dialogs modal.
-
- * xmenu.c (unuse_menu_items, pop_down_menu): Arg is of type
- Lisp_Object.
- (popup_get_selection): Move unwind protect ...
- (create_and_show_popup_menu, create_and_show_dialog): ... to here.
- Move destroy of widget to pop_down_menu.
- (popup_widget_loop): Move unwind protect ...
- (create_and_show_popup_menu, create_and_show_dialog): ... to here.
- Move destroy of widget to pop_down_menu.
- (pop_down_menu): BLOCK_INPUT and destroy widget/window.
- (xmenu_show): Record unwind pop_down_menu. Move XMenuDestroy,
- x_mouse_leave and grabbed = 0 to pop_down_menu.
-
-2004-11-13 Kim F. Storm <[email protected]>
-
- * xdisp.c (make_cursor_line_fully_visible_p): New variable.
- (syms_of_xdisp): DEFVAR_BOOL it.
- (make_cursor_line_fully_visible, try_cursor_movement)
- (try_window_id): Use it.
-
-2004-11-12 Kim F. Storm <[email protected]>
-
- * dispextern.h (struct glyph_row): New member extra_line_spacing.
- (struct it): New member max_extra_line_spacing.
- (MR_PARTIALLY_VISIBLE, MR_PARTIALLY_VISIBLE_AT_TOP)
- (MR_PARTIALLY_VISIBLE_AT_BOTTOM): New helper macros.
- (MATRIX_ROW_PARTIALLY_VISIBLE_P): Fix to return false if invisible
- part of last line is only extra line spacing (so the text on the
- line is fully visible). Use helper macros.
- Add W arg (to use them). All callers changed.
- (MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P)
- (MATRIX_ROW_PARTIALLY_VISIBLE_AT_BOTTOM_P): Use helper macros.
-
- * window.c (window_scroll_pixel_based, Frecenter):
- Use move_it_vertically_backward directly.
- (Frecenter): Fix calculation of new start pos for negative arg.
- Before, the new start pos was sometimes chosen too far back, so
- the last line became only partially visible, and thus would be
- either only semi-visible or automatically scrolled to the middle
- of the window by redisplay.
-
- * xdisp.c (init_iterator): Clear it.max_extra_line_spacing.
- (move_it_vertically_backward): Don't recure to move further back.
- (move_it_vertically): Remove superfluous condition.
- (move_it_by_lines): Clear last_height when moved 0 lines.
- (resize_mini_window): Use it.max_extra_line_spacing.
- (display_tool_bar_line): Clear row->extra_line_spacing.
- (try_scrolling): Use move_it_vertically_backward directly.
- (redisplay_window): Likewise.
- (compute_line_metrics): Set row->extra_line_spacing.
- (display_line, display_string): Likewise.
- (x_produce_glyphs): Update it->max_extra_line_spacing.
-
- * xmenu.c (pop_down_menu): Return nil.
-
-2004-11-12 Jan Dj,Ad(Brv <[email protected]>
-
- * xmenu.c (x_menu_wait_for_event): New function.
- (popup_get_selection, popup_widget_loop): Call x_menu_wait_for_event
- to handle timers.
- (popup_widget_loop): Add argument do_timers.
- (create_and_show_popup_menu, create_and_show_dialog): Pass 1 for
- do_timers to popup_widget_loop.
- (xmenu_show): Call XMenuActivateSetWaitFunction so that
- x_menu_wait_for_event is called by XMenuActivate.
- (create_and_show_popup_menu): Pass 1 for do_timers to
- popup_get_selection.
- (pop_down_menu): New function.
- (popup_get_selection, popup_widget_loop): Unwind protect to
- pop_down_menu.
- (popup_widget_loop): Add argument widget.
- (create_and_show_popup_menu, create_and_show_dialog): Pass new
- argument widget to popup_widget_loop.
-
-2004-11-10 Stefan Monnier <[email protected]>
-
- * keymap.c (Fkeymap_prompt): Accept symbol keymaps.
-
-2004-11-09 Kim F. Storm <[email protected]>
-
- * xselect.c: Include <sys/types.h> and <unistd.h> (for getpid).
- Fix various comments referring to XEvents instead of input events.
- (x_queue_event): Fix format strings.
- (x_stop_queuing_selection_requests): Likewise.
-
- * xdisp.c (produce_image_glyph): Remove unused variable 'face_ascent'.
- (pint2hrstr): Add extra braces to silence compiler.
-
- * print.c (print_object): Fix format string.
-
- * lread.c (read1): Fix next_char matching.
-
- * lisp.h (Fdelete): Add EXFUN.
- (replace_range_2): Add prototype.
-
- * keyboard.c (read_avail_input): Remove unused variable 'discard'.
-
- * intervals.h (NULL_INTERVAL_P): Add separate version when
- ENABLE_CHECKING is not defined to silence compiler.
- (compare_string_intervals): Add prototype.
-
- * fringe.c (destroy_fringe_bitmap): Fix return type.
- (Ffringe_bitmaps_at_pos): Remove unused var 'old_buffer'.
-
- * emacs.c (Fdump_emacs): Fix format string.
-
- * doc.c: Include <ctype.h>.
- (Fsubstitute_command_keys): Remove unused variable 'firstkey'.
-
- * data.c (store_symval_forwarding): Remove unused variables.
-
- * callint.c (Fcall_interactively): Remove unused variable 'funcar'.
-
-2004-11-09 Jan Dj,Ad(Brv <[email protected]>
-
- * Makefile.in (stamp-oldxmenu): If HAVE_GTK, don't add dependencies
- to ${OLDXMENU}.
-
-2004-11-09 Kim F. Storm <[email protected]>
-
- * process.c (Fmake_network_process): Remove kludge for interrupted
- connects on BSD. If connect is interrupted, just close socket and
- start over rather than sleeping and retry with same socket.
-
-2004-11-09 Jan Dj,Ad(Brv <[email protected]>
-
- * .cvsignore: Add buildobj.lst.
-
- * doc.c: New variable Vbuild_files.
- (Fsnarf_documentation): If Vbuild_files is nil, populate it with
- file names from buildobj.lst. Only attach docstrings from files
- that are in Vbuild_files.
- (syms_of_doc): Defvar Vbuild_files.
-
- * Makefile.in (SOME_MACHINE_OBJECTS): Add fringe.o, image.o
- and w32*.o.
- (temacs${EXEEXT}): Generate buildobj.lst when temacs is linked.
- (mostlyclean): Rm buildobj.lst.
-
- * makefile.w32-in ($(TEMACS)): Generate buildobj.lst when temacs
- is linked.
-
-2004-11-09 Kim F. Storm <[email protected]>
-
- * fringe.c (update_window_fringes): Update fringe bitmaps if
- cur and row ends_at_zv_p differs. If bitmaps of a row is updated,
- also update previous row to get rid of misc. artifacts.
-
-2004-11-08 Kim F. Storm <[email protected]>
-
- * xdisp.c (fast_find_position): Fix start pos if header line present.
- (note_mouse_highlight): Clear mouse face if we move out of text area.
-
-2004-11-08 Eli Zaretskii <[email protected]>
-
- * editfns.c: Move #include "systime.h" before <sys/resource.h>.
- Don't include <sys/time.h> explicitly.
- Include <stdio.h> unconditionally, not just on MacOS.
-
-2004-11-08 Kenichi Handa <[email protected]>
-
- * fontset.c (fontset_pattern_regexp): Cancel my previous change;
- don't pay attention to '\' before '*'.
- (fontset_pattern_regexp): Change the meaning of the second arg.
- (Fnew_fontset): Call fs_query_fontset, not Fquery_fontset.
- (check_fontset_name): Try NAME as literal at first, and if it
- failes, try NAME as pattern.
-
-2004-11-07 Jan Dj,Ad(Brv <[email protected]>
-
- * emacs.c (Fdump_emacs): Only output warning on GNU/Linux.
-
-2004-11-07 Andreas Schwab <[email protected]>
-
- * lisp.h (Fmsdos_downcase_filename): Declare.
- * dired.c (Fmsdos_downcase_filename): Don't declare here.
- * fileio.c: Likewise.
-
-2004-11-07 Jan Dj,Ad(Brv <[email protected]>
-
- * dosfns.c (Fdos_memget, Fdos_memput): Use integer variable offs in
- comparisons with integers instead of Lisp_Object address.
- (Fmsdos_set_keyboard): Declare argument allkeys.
-
- * msdos.c (IT_set_frame_parameters): Use EQ, not ==, for Lisp_Object:s.
-
- * dired.c (Fmsdos_downcase_filename): Declare extern on MSDOS to avoid
- int/Lisp_Object mixup.
-
- * fileio.c: Ditto.
-
-2004-11-06 Steven Tamm <[email protected]>
-
- * editfns.c: Need to include sys/time.h before resource.h on darwin.
-
-2004-11-06 Richard M. Stallman <[email protected]>
-
- * callint.c (Fcall_interactively): Avoid reusing EVENT for other data.
-
- * xfaces.c (merge_named_face): GCPRO the face_name in the
- named_merge_point struct that we make.
- (merge_face_heights): Eliminate GCPRO arg. All callers changed.
-
- * keyboard.c (command_loop_1): Change Vtransient_mark_mode
- before deciding whether to inactivate mark.
-
-2004-11-06 Lars Brinkhoff <[email protected]>
-
- * config.in: Regenerate (add HAVE_GETRUSAGE).
- * editfns.c (Fget_internal_run_time): New function.
- (syms_of_data): Defsubr it.
- * fns.c (sxhash): As far as possible, merge calculation of
- hash code for symbols and strings.
-
-2004-11-06 Eli Zaretskii <[email protected]>
-
- * frame.c (syms_of_frame): Fix the example in the doc string.
-
-2004-11-06 Jan Dj,Ad(Brv <[email protected]>
-
- * eval.c (Feval): Remove check for INPUT_BLOCKED_P.
-
- * xmenu.c (popup_get_selection, create_and_show_popup_menu)
- (create_and_show_dialog): Revert change from 2004-10-31.
-
-2004-11-05 Luc Teirlinck <[email protected]>
-
- * macros.c (syms_of_macros) <defining-kbd-macro>: Doc fix.
-
-2004-11-05 Kim F. Storm <[email protected]>
-
- * print.c (print_object): Print Lisp_Misc_Save_Value objects.
-
- * fileio.c (Ffile_modes): Doc fix.
- (auto_save_1): Check for Ffile_modes nil value.
-
-2004-11-05 Kim F. Storm <[email protected]>
-
- * xselect.c (struct selection_event_queue, selection_queue)
- (x_queue_selection_requests, x_queue_event)
- (x_start_queuing_selection_requests)
- (x_stop_queuing_selection_requests): Add new queue for selection
- input events to replace previous XEvent queue in xterm.c.
- (queue_selection_requests_unwind): Adapt to new queue.
- (x_reply_selection_request): Adapt to new queue.
- Unexpect wait_object in case of x errors (memory leak).
- (x_handle_selection_request, x_handle_selection_clear): Make static.
- (x_handle_selection_event): New function. May queue selection events.
- (wait_for_property_change_unwind): Use save_value instead of cons.
- Clear property_change_reply_object.
- (wait_for_property_change): Abort if already waiting.
- Use save_value instead of cons for unwind data.
- (x_handle_property_notify): Skip events already arrived, but don't
- free them, as "arrived" field is checked by wait_for_property_change,
- and it will be freed by unwind or explicit unexpect_property_change.
- (x_get_foreign_selection): Add to new queue.
- (receive_incremental_selection): Don't unexpect wait_object when done
- as it has already been freed by previous wait_for_property_change.
-
- * xterm.h (x_start_queuing_selection_requests)
- (x_stop_queuing_selection_requests, x_handle_selection_request)
- (x_handle_selection_clear): Remove prototypes.
- (x_handle_selection_event): Add prototype.
-
- * xterm.c (handle_one_xevent): Don't queue X selection events
- here, it may be too late if we start queuing after we have already
- stored some selection events into the kbd buffer.
- (struct selection_event_queue, queue, x_queue_selection_requests)
- (x_queue_event, x_unqueue_events, x_start_queuing_selection_requests)
- (x_stop_queuing_selection_requests): Remove/move to xselect.c.
- (x_catch_errors_unwind): Block input around final XSync.
-
- * keyboard.h (kbd_buffer_unget_event): Add prototype.
-
- * keyboard.c (kbd_buffer_store_event_hold): Remove obsolete code.
- (kbd_buffer_unget_event): New function.
- (kbd_buffer_get_event, swallow_events): Combine SELECTION events
- and use x_handle_selection_event.
- (mark_kboards): Don't mark x and y of SELECTION_CLEAR_EVENT.
-
-2004-11-05 Jan Dj,Ad(Brv <[email protected]>
-
- * xselect.c (TRACE3): New debug macro.
- (x_reply_selection_request): Use it.
- (receive_incremental_selection): In call to TRACE0, the name of
- a symbol is in xname.
-
-2004-11-05 Kim F. Storm <[email protected]>
-
- * fontset.c (fontset_pattern_regexp): Use unsigned char.
-
-2004-11-04 Jan Dj,Ad(Brv <[email protected]>
-
- * fileio.c (Fnext_read_file_uses_dialog_p): New function.
-
- * gtkutil.h (use_old_gtk_file_dialog): Declare.
-
- * gtkutil.c: Make use_old_gtk_file_dialog non-static.
- (xg_initialize): Move DEFVAR_BOOL for use_old_gtk_file_dialog ...
- * xfns.c (syms_of_xfns): ... to here.
-
- * gtkutil.c (xg_get_file_with_chooser): Expand DEFAULT_FILENAME if
- it doesn't start with /.
-
-2004-11-04 Kenichi Handa <[email protected]>
-
- * fontset.c (fontset_pattern_regexp): If '*' is preceded by '\',
- treat it as a literal character.
-
-2004-11-03 Kim F. Storm <[email protected]>
-
- * .gdbinit (ppt): New function.
-
-2004-11-02 Jan Dj,Ad(Brv <[email protected]>
-
- * xterm.c (x_window_to_scroll_bar): Only call
- xg_get_scroll_id_for_window if toolkit scroll bars are used.
-
- * gtkutil.c (xg_get_file_with_chooser): Use GTK_STOCK_OK instead
- of save.
-
-2004-11-02 Andreas Schwab <[email protected]>
-
- * window.c (Fscroll_right): Fix last change.
-
-2004-11-02 Kim F. Storm <[email protected]>
-
- * Makefile.in (callproc.o): Depend on blockinput.h, atimer.h, systime.h.
-
-2004-11-02 YAMAMOTO Mitsuharu <[email protected]>
-
- * callproc.c (Fcall_process): Block input around vfork.
-
-2004-11-02 Kim F. Storm <[email protected]>
-
- * eval.c (Fcalled_interactively_p): Rename from Fcall_interactive_p.
- (syms_of_eval): Defsubr it.
-
-2004-11-02 Richard M. Stallman <[email protected]>
-
- * insdel.c (replace_range_2): New function.
-
- * casefiddle.c (casify_region): Handle changes in byte-length
- using replace_range_2.
-
- * emacs.c (USAGE3): Delete --horizontal-scroll-bars, -hb.
-
- * xdisp.c (back_to_previous_visible_line_start):
- Subtract 1 from pos when checking previous newline for invisibility.
-
- * window.c (window_scroll_pixel_based): Update preserve_y
- for header line if any.
- (Fscroll_left, Fscroll_right): Don't call interactive_p;
- use a new second argument instead.
-
- * eval.c (Fcall_interactive_p): New function.
- (interactive_p): Don't test INTERACTIVE here.
- (Finteractive_p): Doc fix.
-
- * eval.c (Feval): Abort if INPUT_BLOCKED_P.
-
-2004-11-02 KOBAYASHI Yasuhiro <[email protected]>
-
- * w32fns.c (w32_font_match): Use fast_string_match_ignore_case for
- comparing font names.
-
-2004-11-02 Jan Dj,Ad(Brv <[email protected]>
-
- * fileio.c (Fread_file_name): Pass Qt as fifth parameter to
- Fx_file_dialog if only directories should be read.
-
- * lisp.h: Fx_file_dialog takes 5 parameters.
-
- * xfns.c (Fx_file_dialog): Both Motif and GTK version:
- Add parameter only_dir_p.
- In Motif version, don't put DEFAULT_FILENAME in filter part of the
- dialog, just text field part. Do not add DEFAULT_FILENAME
- to list of files if it isn't there.
- In GTK version, pass only_dir_p parameter to xg_get_file_name.
-
- * macfns.c (Fx_file_dialog): Add parameter only_dir_p.
- Check only_dir_p instead of comparing prompt to "Dired". When using
- a save dialog, add option kNavDontConfirmReplacement, change title
- to "Enter name", change text for save button to "Ok".
-
- * w32fns.c (Fx_file_dialog): Add parameter only_dir_p.
- Check only_dir_p instead of comparing prompt to "Dired".
-
- * gtkutil.c (xg_get_file_with_chooser, xg_get_file_with_selection):
- New functions, only defined ifdef HAVE_GTK_FILE_CHOOSER_DIALOG_NEW
- and HAVE_GTK_FILE_SELECTION_NEW respectively.
- (xg_get_file_name): Add parameter only_dir_p.
- Call xg_get_file_with_chooser or xg_get_file_with_selection
- depending on HAVE_GTK_FILE* and the value of use_old_gtk_file_dialog.
- (xg_initialize): New DEFVAR_BOOL use_old_gtk_file_dialog.
-
- * gtkutil.h (xg_get_file_name): Add parameter only_dir_p.
-
- * config.in: Rebuild (added HAVE_GTK_FILE_*).
-
-2004-11-01 Kim F. Storm <[email protected]>
-
- * process.c (connect_wait_mask, num_pending_connects):
- Only declare and use them if NON_BLOCKING_CONNECT is defined.
- (init_process): Initialize them if NON_BLOCKING_CONNECT defined.
- (IF_NON_BLOCKING_CONNECT): New helper macro.
- (wait_reading_process_output): Only declare and use local vars
- Connecting and check_connect when NON_BLOCKING_CONNECT is defined.
-
-2004-11-01 Andy Petrusenco <[email protected]> (tiny change)
-
- * w32term.c (x_scroll_run): Delete region objects after use.
-
-2004-10-31 Jan Dj,Ad(Brv <[email protected]>
-
- * xmenu.c: Add prototypes for forward function declarations.
- (popup_get_selection): Remove parameter do_timers, remove call to
- timer_check.
- (create_and_show_popup_menu, create_and_show_dialog):
- Remove parameter do_timers from call to popup_get_selection.
-
- * xdisp.c (update_tool_bar): Pass a copy of f->tool_bar_items to
- tool_bar_items and assign the result to f->tool_bar_items if
- not equal. Move BLOCK/UNBLOCK_INPUT from around call to
- tool_bar_items to assignment of result.
-
- * atimer.c (alarm_signal_handler): Do not call set_alarm if
- pending_atimers is non-zero.
-
-2004-10-31 Kim F. Storm <[email protected]>
-
- * dispnew.c (margin_glyphs_to_reserve): Don't use ncols_scale_factor.
-
-2004-10-28 Will <[email protected]>
-
- * macterm.c: Allow user to assign key modifiers to the Mac Option
- key via a 'mac-option-modifier' variable.
-
-2004-10-28 Stefan Monnier <[email protected]>
-
- * xselect.c (Vx_lost_selection_functions, Vx_sent_selection_functions):
- Rename from Vx_lost_selection_hooks and Vx_sent_selection_hooks.
- (x_handle_selection_request, x_handle_selection_clear)
- (x_clear_frame_selections, syms_of_xselect): Adjust accordingly.
-
-2004-10-28 Richard M. Stallman <[email protected]>
-
- * w32fns.c (Fx_server_vendor, Fx_server_version): Doc fixes.
-
- * xfns.c (Fx_server_vendor, Fx_server_version): Doc fixes.
-
-2004-10-27 Stefan Monnier <[email protected]>
-
- * syntax.c (scan_sexps_forward): Give precedence to a 2-char
- comment-starter over a 1-char one.
-
-2004-10-27 Richard M. Stallman <[email protected]>
-
- * xdisp.c (get_next_display_element): In mode lines,
- treat newline and tab like other control characters.
-
- * editfns.c (Fmessage): Doc fix.
-
- * indent.c (vmotion): When moving up, check the newline before.
- Make prevline an int, not a Lisp_Object.
-
-2004-10-27 Kim F. Storm <[email protected]>
-
- * editfns.c (Fformat): Allocate discarded table with SAFE_ALLOCA.
- Only allocate info and discarded tables once.
-
- * lisp.h (USE_SAFE_ALLOCA): Add and init sa_must_free integer.
- (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Increment it when malloc is used.
- (SAFE_FREE): Test it to determine if we need to unwind to free.
- Remove size arg. All users changed.
- (SAFE_FREE_LISP): Remove. All users changed to use SAFE_FREE.
-
-2004-10-26 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c: Put empty line between comment and function body.
- (xg_destroy_widgets): Rename from remove_from_container.
- Just destroy all widgets in list. Argument wcont removed.
- (xg_update_menubar, xg_update_submenu): Call xg_destroy_widgets
- instead of remove_from_container.
- (xg_display_close, xg_create_tool_bar, update_frame_tool_bar)
- (free_frame_tool_bar): Add comment.
-
- * xfns.c (xic_create_xfontset): Check that FRAME_XIC_BASE_FONTNAME
- is not NULL before strcmp.
-
-2004-10-26 Kim F. Storm <[email protected]>
-
- * callint.c (Fcall_interactively): Add 'U' code to get the
- up-event discarded by a previous 'k' or 'K' argument.
-
-2004-10-26 David Kastrup <[email protected]>
-
- * buffer.c (syms_of_buffer): Fix a few typos.
-
-2004-10-26 Jan Dj,Ad(Brv <[email protected]>
-
- * xsmfns.c: Put empty line between comment and function body.
- Use two spaces before comment end.
-
-2004-10-25 Kenichi Handa <[email protected]>
-
- * fontset.c (fontset_pattern_regexp): Optimize for the case that
- PATTERN is full XLFD.
-
-2004-10-24 Kenichi Handa <[email protected]>
-
- * regex.h (enum reg_errcode_t): New value REG_ERANGEX.
-
- * regex.c (re_error_msgid): Add an entry for REG_ERANGEX.
- (regex_compile): Return REG_ERANGEX if appropriate.
-
-2004-10-22 Kenichi Handa <[email protected]>
-
- * editfns.c (Ftranslate_region_internal): New function.
- (syms_of_editfns): Defsubr it.
-
-2004-10-22 Jan Dj,Ad(Brv <[email protected]>
-
- * xfns.c (xic_create_xfontset): Initialize missing_list to NULL.
-
-2004-10-21 K,Aa(Broly L$,1 q(Brentey <[email protected]>
-
- * xterm.h (x_output): New member `xic_base_fontname'.
- (FRAME_XIC_BASE_FONTNAME): New macro.
- (xic_free_xfontset): Declare.
-
- * xfns.c (xic_create_xfontset): Share fontsets between frames
- based on base_fontname.
- (xic_free_xfontset): New function.
- (free_frame_xic): Use it.
- (xic_set_xfontset): Ditto.
-
- * xterm.c (xim_destroy_callback): Ditto.
-
-2004-10-20 B. Anyos <[email protected]> (tiny change)
-
- * w32term.c (x_draw_glyph_string): Use overline_color for overlines.
-
-2004-10-20 Jan Dj,Ad(Brv <[email protected]>
-
- * xterm.h (XSync): If USE_GTK, define XSync as process_all and then
- XSync.
-
- * emacs.c (my_heap_start, heap_bss_diff, MAX_HEAP_BSS_DIFF):
- New variables and constant.
- (main): Calculate heap_bss_diff. If we are dumping and the
- heap_bss_diff is greater than MAX_HEAP_BSS_DIFF, set PER_LINUX32
- and exec ourself again.
- (Fdump_emacs): If heap_bss_diff is greater than MAX_HEAP_BSS_DIFF
- print a warning.
-
- * lastfile.c: Make my_endbss and my_endbss_static available on all
- platforms.
-
- * Makefile.in (RUN_TEMACS): Remove @SETARCH@.
- * config.in (HAVE_PERSONALITY_LINUX32): Regenerate.
-
-2004-10-19 Luc Teirlinck <[email protected]>
-
- * data.c (Flocal_variable_if_set_p): Doc fix.
-
-2004-10-19 Jason Rumney <[email protected]>
-
- * w32.c (init_environment): Set emacs_dir correctly when running
- emacs from the build directory.
-
-2004-10-19 Richard M. Stallman <[email protected]>
-
- * editfns.c (Fdelete_and_extract_region):
- If region is empty, return null string.
-
-2004-10-19 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.h (xg_update_scrollbar_pos): Remove arguments real_left
- and canon_width.
- (xg_frame_cleared): Remove.
-
- * gtkutil.c (xg_frame_cleared, xg_fixed_handle_expose)
- (xg_find_top_left_in_fixed): Remove.
- (xg_create_scroll_bar): Put an event box widget between
- the scroll bar widget and the edit widget.
- (xg_show_scroll_bar): Show the parent widget (the event box).
- (xg_remove_scroll_bar): Destroy parent (the event box) also.
- (xg_update_scrollbar_pos): Remove arguments real_left and canon_width.
- Move the parent (the event box) widget inside the fixed widget.
- Move window clear to xterm.c.
-
- * gtkutil.h (xg_frame_cleared): Remove.
-
- * xterm.c (x_clear_frame): Remove call to xg_frame_cleared
- (x_scroll_bar_create, XTset_vertical_scroll_bar):
- Remove arguments left and width to xg_update_scrollbar_pos.
- (XTset_vertical_scroll_bar): Do x_clear_area for USE_GTK also.
-
-2004-10-19 Kenichi Handa <[email protected]>
-
- * xdisp.c (display_mode_element): Fix display of wide chars.
-
-2004-10-18 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (xg_update_scrollbar_pos): Change XClearWindow to
- gdk_window_clear and move gdk_window_process_all_updates after
- clear so events are sent to the X server in correct order.
-
-2004-10-18 Kenichi Handa <[email protected]>
-
- * fontset.c (fs_load_font): Use fast_string_match_ignore_case for
- comparing font names.
- (fs_query_fontset): Use fast_string_match for comparing fontset names.
- (list_fontsets): Likewise.
-
- * search.c (fast_string_match_ignore_case): New function.
-
- * lisp.h (fast_string_match_ignore_case): Extern it.
-
-2004-10-17 Kim F. Storm <[email protected]>
-
- * xdisp.c (overlay_arrow_at_row): Return overlay string rather
- than bitmap if there is not left fringe.
- (get_overlay_arrow_glyph_row): Also used on windows system.
- (display_line): Display overlay string if no left fringe.
-
-2004-10-16 Jason Rumney <[email protected]>
-
- * w32fns.c (w32_font_match): Encode font name being matched.
-
-2004-10-16 Richard M. Stallman <[email protected]>
-
- * window.c (Fspecial_display_p): Doc fix.
-
-2004-10-15 Stefan Monnier <[email protected]>
-
- * doc.c (Fsubstitute_command_keys): Fix remap-handling.
- Don't ignore menus, because where-is-internal already does it for us.
-
-2004-10-15 Kim F. Storm <[email protected]>
-
- * xdisp.c (redisplay_window): Only update fringes and vertical
- border on window frames.
-
-2004-10-14 Andreas Schwab <[email protected]>
-
- * m/ia64.h (DATA_SEG_BITS): Don't define.
-
-2004-10-14 Kim F. Storm <[email protected]>
-
- * xterm.h: Include Xutil.h after keysym.h to work around bug
- in some X versions.
-
-2004-10-13 Stefan Monnier <[email protected]>
-
- * fns.c (map_char_table): Add missing gcpros.
-
-2004-10-13 Stefan Monnier <[email protected]>
-
- * keymap.c (get_keymap): An autoload form is not a keymap.
-
- * textprop.c (syms_of_textprop): Make `syntax-table' nonsticky.
-
-2004-10-13 Kim F. Storm <[email protected]>
-
- * callproc.c (Fcall_process): Simplify handling of display arg.
- Resume `display_on_the_fly' once a coding system is determined.
-
- * xdisp.c (redisplay_preserve_echo_area): Fix last change.
-
-2004-10-12 Kim F. Storm <[email protected]>
-
- * xdisp.c (redisplay_preserve_echo_area): Flush display in case
- caller, such as call-process, is not going to poll for input.
- (calc_line_height_property): Handle case where it->object is nil.
-
- * xterm.c (x_redisplay_interface): Fix flush_display_optional.
-
-2004-10-12 Kenichi Handa <[email protected]>
-
- * xdisp.c (get_next_display_element):
- If unibyte_display_via_language_environment is zero, display 8-bit
- chars in octal in unibyte buffer.
-
-2004-10-12 Kim F. Storm <[email protected]>
-
- * doc.c (Fsubstitute_command_keys): Ignore remappings unless there
- are no ordinary bindings.
-
-2004-10-11 Jan Dj,Ad(Brv <[email protected]>
-
- * xfns.c (syms_of_xfns): Defsubr x-file-dialog for GTK also.
-
-2004-10-10 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.c (x_raise_frame): Add BLOCK_INPUT around SelectWindow.
- (x_lower_frame): Add BLOCK_INPUT around SendBehind.
- (make_mac_frame): Add BLOCK_INPUT around the making of a
- terminal frame.
- (mac_initialize): Add BLOCK_INPUT around carbon initialization.
- * macgui.h (mktime): Use emacs_mktime.
- * macfns.c (Fx_file_dialog): Add BLOCK_INPUT around more code.
- Make a cancel file-open dialog be like C-g.
- * mac.c (mktime): Use emacs_mktime.
- (Fdo_applescript): Add BLOCK_INPUT around do_applescript.
- (Fmac_paste_function): Add better error handling for carbon cut/paste.
-
-2004-10-10 Kim F. Storm <[email protected]>
-
- * keyboard.c (timer_resume_idle): New function to resume idle
- timer without resetting timers on the idle list.
- (read_char): Use timer_resume_idle. Remove local var last_idle_start.
- (timer_start_idle, timer_stop_idle): Declare static.
- (read_key_sequence): Use timer_resume_idle instead of timer_start_idle.
-
- * keyboard.h (timer_start_idle, timer_stop_idle): Remove prototypes.
-
-2004-10-08 Steven Tamm <[email protected]>
-
- * config.in (HAVE_MALLOC_MALLOC_H): Regenerate.
- * macterm.c (mac_check_for_quit_char): Remove warning for using
- NULL where 0 should be used.
- * unexmacosx.c: Use malloc/malloc.h on Tiger instead of
- objc/malloc.h
- * mac.c: Include time.h for Tiger compatibility.
-
-2004-10-07 Kim F. Storm <[email protected]>
-
- * xdisp.c (redisplay_window): Fix flicker on vertical line between
- windows. Update vertical line after drawing window fringes, but
- only if actually drawing any bitmaps--or there is no fringe.
-
- * xterm.c (x_update_window_end): Likewise.
- * macterm.c (x_update_window_end): Likewise.
- * w32term.c (x_update_window_end): Likewise.
-
- * fringe.c (draw_window_fringes): Return value now indicates if
- any fringe bitmaps were redrawn (or there are no fringes).
-
- * dispextern.h (draw_window_fringes): Update prototype.
-
-2004-10-06 YAMAMOTO Mitsuharu <[email protected]>
-
- * macfns.c (mac_get_window_bounds): Add extern.
- (x_real_positions): Use mac_get_window_bounds.
-
- * macmenu.c (update_submenu_strings): Apply 2004-09-07 change for
- xmenu.c (YAILOM).
-
- * macterm.c [!MAC_OSX]: Include Windows.h.
- (front_emacs_window): Rename from mac_front_window. All uses
- changed. Return the frontmost non-tooltip emacs window.
- (mac_get_window_bounds): New function.
- (x_calc_absolute_position): Use the difference of width and height
- between the inner and outer window.
- (x_set_offset): Specify window position by the coordinae of the
- outer window. Adjust the position if the title bar is completely
- outside the screen.
- (app_is_suspended, app_sleep_time): Remove unused variables.
- (do_app_resume, do_app_suspend): Remove their contents because
- window-activate/deactivate events will do the job.
- (do_zoom_window): Remove unused variables. Make compliant to the
- standard way of zooming. Set f->left_pos and f->top_pos.
- (XTread_socket): Don't use argument `expected'. Don't use
- FrontWindow to determine the clicked window. Exclude unprocessed
- mouseUp cases in the early stage. Add parentheses to fix operator
- precedence.
- (XTread_socket) [TARGET_API_MAC_CARBON]: Don't specify drag area.
-
-2004-10-05 Jan Dj,Ad(Brv <[email protected]>
-
- * config.in: Regenerate.
-
- * Makefile.in (RUN_TEMACS): Check HAVE_RANDOM_HEAPSTART instead of
- HAVE_EXECSHIELD.
-
-2004-10-05 Jan Dj,Ad(Brv <[email protected]>
-
- * xterm.c (x_find_modifier_meanings): Ignore any Super or Hyper for
- a row if Alt or Meta has been found for that row. Also stop scanning
- for Keysyms for that row.
-
-2004-10-04 Kim F. Storm <[email protected]>
-
- * fringe.c (Ffringe_bitmaps_at_pos): Change return value from cons
- to list. Include overlay arrow bitmap in return value.
-
- * xterm.c (XTset_vertical_scroll_bar): Improve handling of scroll
- bars with fractional column width. If scroll bar separates two
- windows, move it towards the window it belongs to. Only update
- the padding area below the scroll bar widget when necessary,
- i.e. when scroll bar widget is created, moved, or resized.
-
- * xdisp.c (define_frame_cursor1): Do not change frame cursor
- while tracking/dragging mouse.
- (x_draw_vertical_border): Do not draw line if frame has scroll bars.
-
- * window.c (coordinates_in_window): Relax check for cursor
- on vertial border between mode lines.
- (Fset_window_fringes): Do not allow negative widths.
- (Fset_window_scroll_bars): Likewise.
-
- * .gdbinit (pp): Shorthand for p ARG + pr.
- (ff): New command: flush frame updates (X only).
-
-2004-10-03 Michael Albinus <[email protected]>
-
- * fileio.c (auto_save_1) Call Ffile_modes for remote files.
-
-2004-09-30 Kenichi Handa <[email protected]>
-
- * process.c (send_process): Free composition data.
-
- * fileio.c (Finsert_file_contents): Free composition data.
-
- * coding.c (code_convert_region): Don't skip ASCIIs if there are
- compositions to encode.
- (encode_coding_string): Likewise. Free composition data.
-
-2004-09-30 Florian Weimer <[email protected]>
-
- * coding.c (code_convert_region): Free composition data.
-
-2004-09-29 Kim F. Storm <[email protected]>
-
- * fringe.c: Remove limit on number of bitmaps.
- (fringe_bitmaps, fringe_faces): Change to pointers.
- (max_fringe_bitmaps): New var.
- (Fdefine_fringe_bitmap): Expand fringe_bitmaps and fringe_faces.
- (init_fringe): Allocate fringe_bitmaps and fringe_faces.
-
- * dispextern.h (FRINGE_ID_BITS): Increase to 16 bits (64K bitmaps).
- (struct glyph_row): Reorder fringe_bitmap related fields.
- (struct it): Likewise.
-
- * w32term.c (fringe_bmp): Change to pointer.
- (max_fringe_bmp): New var.
- (w32_define_fringe_bitmap): Expand fringe_bmp.
- (w32_draw_fringe_bitmap): Check max_fringe_bmp.
- (w32_destroy_fringe_bitmap): Likewise.
-
-2004-09-29 Kim F. Storm <[email protected]>
-
- * fringe.c: Simplify last change.
- (lookup_fringe_bitmap): New function.
- (valid_fringe_bitmap_p, resolve_fringe_bitmap): Remove.
- (Fdestroy_fringe_bitmap): Use lookup_fringe_bitmap.
- Keep standard bitmaps in Vfringe_bitmaps.
- (Fdefine_fringe_bitmap): Use lookup_fringe_bitmap.
- (Fset_fringe_bitmap_face): Likewise.
-
- * dispextern.h (lookup_fringe_bitmap): Add prototype.
- (valid_fringe_bitmap_p): Remove prototype.
-
- * xdisp.c (handle_single_display_prop): Use lookup_fringe_bitmap.
-
-2004-09-29 Kim F. Storm <[email protected]>
-
- * fringe.c (destroy_fringe_bitmap, init_fringe_bitmap)
- (w32_init_fringe, w32_reset_fringes): Fix bootstrap (NULL rif).
-
- * dispextern.h (valid_fringe_bitmap_p): Fix prototype.
-
- * fringe.c (Vfringe_bitmaps): New variable.
- (syms_of_fringe): DEFVAR_LISP it.
- (valid_fringe_bitmap_p): Rename from valid_fringe_bitmap_id_p.
- Change arg to Lisp_Object and fail if not an integer.
- (get_fringe_bitmap_name, resolve_fringe_bitmap)
- (destroy_fringe_bitmap): New functions.
- (Fdestroy_fringe_bitmap): Change arg to bitmap symbol.
- Use destroy_fringe_bitmap. Remove symbol from Vfringe_bitmaps and
- clear its fringe property.
- (init_fringe_bitmap): Use destroy_fringe_bitmap instead of
- Fdestroy_fringe_bitmap.
- (Fdefine_fringe_bitmap): Add BITMAP arg specifying new or existing
- bitmap symbol; remove WHICH arg. Add symbol to Vfringe_bitmaps
- and set fringe property. Signal error if no free slots.
- (Fset_fringe_bitmap_face): Change arg to bitmap symbol.
- (Ffringe_bitmaps_at_pos): Return bitmap symbols instead of numbers.
-
- * xdisp.c (handle_single_display_prop): Fringe bitmaps are now
- symbols with a fringe property.
-
-2004-09-27 Kim F. Storm <[email protected]>
-
- * buffer.c (syms_of_buffer) <indicate-buffer-boundaries>:
- Doc fix. Format may now be a symbol or alist, not a cons.
-
- * fringe.c (update_window_fringes): Handle new formats of
- indicate-buffer-boundaries (symbol or alist). No longer
- allow a simple cons.
- (Ffringe_bitmaps_at_pos): Use nil value for no bitmap.
-
-2004-09-25 Jan Dj,Ad(Brv <[email protected]>
-
- * config.in: Rebuild.
-
-2004-09-24 Jan Dj,Ad(Brv <[email protected]>
-
- * config.in: Rebuild.
-
- * Makefile.in: Run setarch i386 ./temacs if exec-shield is present.
-
-2004-09-18 Stefan Monnier <[email protected]>
-
- * xterm.c (x_term_init): Work around a bug in some X servers.
-
-2004-09-18 Richard M. Stallman <[email protected]>
-
- * buffer.c (syms_of_buffer) <default-major-mode>: Doc fix.
-
- * xdisp.c (try_window_reusing_current_matrix):
- Handle the case where we reach the old displayed text,
- out of sync with the old line boundary.
-
-2004-09-14 Stefan Monnier <[email protected]>
-
- * fileio.c (Finsert_file_contents): Fix case of replacement in a
- narrowed buffer.
-
-2004-09-14 Kim F. Storm <[email protected]>
-
- * puresize.h (PURESIZE_RATIO): Define based on BITS_PER_EMACS_INT.
-
- * xfaces.c (Qface_no_inherit): New var.
- (syms_of_xfaces): Intern and staticpro it.
- (Finternal_make_lisp_face, Finternal_set_lisp_face_attribute)
- (Finternal_copy_lisp_face, update_face_from_frame_parameter):
- Don't increment face_change_count when face has non-nil
- face-no-inherit property.
-
-2004-09-13 Stefan Monnier <[email protected]>
-
- * bytecode.c (BYTE_CODE_QUIT): Add missing AFTER_POTENTIAL_GC.
- (Fbyte_code): Remove dead code after `wrong_type_argument'.
-
- * alloc.c (Fgarbage_collect): Mark keyboards, gtk data, and specpdl
- before doing the mark_stack_check_gcpros since they're not on the stack.
-
-2004-09-12 Kim F. Storm <[email protected]>
-
- * editfns.c (Fformat): Handle format strings with multiple text
- properties. Reverse text property list from the format string,
- so the positions are in increasing order.
-
-2004-09-10 Jan Dj,Ad(Brv <[email protected]>
-
- * xselect.c (x_reply_selection_request): XSync and UNBLOCK before
- x_uncatch_errors so that possible protocol errors are delivered.
-
-2004-09-10 Eli Zaretskii <[email protected]>
-
- * Makefile.in (msdos.o): Depend on buffer.h, commands.h, and
- blockinput.h.
- (dosfns.o): Depend on blockinput.h, window.h, dispextern.h,
- charset.h, and coding.h
- (w16select.o): Depend on buffer.h, charset.h, coding.h, and composite.h.
- (term.o): Depend on window.h and keymap.h.
- (abbrev.o): Depend on syntax.h.
- (callint.o): Depend on keymap.h.
- (casefiddle.o): Depend on charset.h and keymap.h.
- (category.o): Depend on keymap.h.
- (coding.o): Depend on dispextern.h.
- (cmds.o): Depend on keyboard.h and keymap.h.
- (dispnew.o): Depend on indent.h and intervals.h.
- (doc.o): Depend on keymap.h.
- (editfns.o): Depend on frame.h.
- (emacs.o): Depend on dispextern.h.
- (fileio.o): Don't depend on ccl.h.
- (filelock.o): Depend on charset.h and coding.h.
- (frame.o): Depend on w32term.h and macterm.h.
- (insdel.o): Depend on region-cache.h.
- (keyboard.o): Depend on keymap.h, w32term.h, and macterm.h.
- (minibuf.o): Depend on $(INTERVALS_SRC) and keymap.h.
- (search.o): Depend on $(INTERVALS_SRC).
- (syntax.o): Depend on keymap.h, regex.h, and $(INTERVALS_SRC).
- (window.o): Depend on keymap.h, blockinput.h, $(INTERVALS_SRC),
- xterm.h, w32term.h, and macterm.h.
- (xdisp.o): Depend on keyboard.h, $(INTERVALS_SRC), xterm.h,
- w32term.h, and macterm.h.
- (xfaces.o): Depend on keyboard.h, $(INTERVALS_SRC),
- region-cache.h, xterm.h, w32term.h, and macterm.h.
- (bytecode.o): Depend on dispextern.h, frame.h, and xterm.h.
- (data.o): Depend on frame.h.
- (fns.o): Depend on keymap.h, xterm.h, and blockinput.h.
- (print.o): Depend on termchar.h and $(INTERVALS_SRC).
- (lread.o): Depend on $(INTERVALS_SRC), termhooks.h, and coding.h.
- (intervals.o): Depend on keymap.h.
-
- * msdos.c (msdos_set_cursor_shape, IT_display_cursor):
- Add debugging print-out to termscript.
-
-2004-09-09 Richard M. Stallman <[email protected]>
-
- * xdisp.c (decode_mode_spec): Use current buffer for most purposes.
-
-2004-09-08 Richard M. Stallman <[email protected]>
-
- * window.c (Fset_window_buffer): Doc fix.
-
- * xdisp.c (Fformat_mode_line): New arg BUFFER says which buffer to use.
-
-2004-09-08 Dan Nicolaescu <[email protected]>
-
- * minibuf.c (history_delete_duplicates): New variable.
- (read_minibuf): Use it.
- (syms_of_minibuf): Create the corresponding lisp variable.
-
-2004-09-08 Kim F. Storm <[email protected]>
-
- * xdisp.c (set_cursor_from_row): Also look at 'cursor' property in
- overlay just before point.
-
-2004-09-07 Luc Teirlinck <[email protected]>
-
- * buffer.h (struct buffer): Add auto_save_file_format field.
- * buffer.c (reset_buffer, init_buffer_once):
- Handle auto_save_file_format field.
- (syms_of_buffer): Add DEFVAR_PER_BUFFER for
- `buffer-auto-save-file-format'.
- * fileio.c: Delete declaration for removed Vauto_save_file_format.
- (build_annotations): Adapt to replacement of
- `auto-save-file-format' with the new buffer-local variable
- `buffer-auto-save-file-format'.
- (syms_of_fileio): Delete DEFVAR_LISP for auto-save-file-format.
-
-2004-09-07 Jason Rumney <[email protected]>
-
- * w32term.h (AppendMenuW_Proc): Move declaration from w32menu.c.
-
- * w32fns.c (w32_wnd_proc) <WM_MEASUREITEM, WM_DRAWITEM>:
- Handle Unicode menu titles.
-
-2004-09-07 Kim F. Storm <[email protected]>
-
- * xdisp.c (set_cursor_from_row): Fix last change. Only use 'cursor'
- property from text property or overlay strings at point.
-
-2004-09-07 Stefan Monnier <[email protected]>
-
- * xmenu.c (update_submenu_strings): YAILOM.
- (set_frame_menubar): Make sure last_i is initialized.
-
-2004-09-03 Jason Rumney <[email protected]>
-
- * w32menu.c (_widget_value): Add lname and lkey.
- (digest_single_submenu): Set lname and lkey in widget_value
- instead of name and key.
- (update_submenu_strings): New function.
- (set_frame_menubar): Remove call to inhibit_garbage_collection,
- call update_submenu_strings.
-
- * w32menu.c (globals_of_w32menu): Check for Unicode API.
- (digest_single_submenu, w32_menu_show): Encode menu strings as
- UTF-8 if Unicode API is available.
- (utf8to16): New function.
- (add_menu_item): Use it when calling Unicode API.
-
-2004-09-03 Kim F. Storm <[email protected]>
-
- * xdisp.c (set_cursor_from_row): Look for non-nil `cursor' property
- in overlay or text-property strings; set cursor on corresponding
- glyph rather than at end of the string.
-
-2004-09-02 YAMAMOTO Mitsuharu <[email protected]>
-
- * macfns.c (x_real_positions): Save the current window port and
- set a new one before obtaining the global coordinate.
- Use FRAME_MAC_WINDOW.
- (x_set_name, x_set_title): Encode title to UTF8.
- Use SetWindowTitleWithCFString.
- (Fx_server_version): Get correct OS version.
-
- * macmenu.c (add_menu_item): Remove unused variable `i'.
- Don't let separator items destroy refence constants of other menu items.
-
- * macterm.c (x_update_end): Move SetPortWindowPort to inside
- BLOCK_INPUT.
- (x_set_offset): Use FRAME_MAC_WINDOW.
-
- * xdisp.c (note_mouse_highlight): Set the mouse pointer shape to
- nontext_cursor if it is on a scroll bar.
-
- * s/darwin.h (LIBS_CARBON): New define to specify libraries for
- Carbon support.
- (LD_SWITCH_SYSTEM_TEMACS): Don't link with unused libstdc++.
- Use LIBS_CARBON.
-
-2004-09-02 Jan Dj,Ad(Brv <[email protected]>
-
- * xfns.c (x_set_name_internal): New function. Check if we shall call
- xfree before ENCODE_UTF_8.
- (x_set_name, x_set_title): Call x_set_name_internal.
-
-2004-08-31 NAKAMURA Toshikazu <[email protected]> (tiny change)
-
- * w32fns.c (w32_load_font): If a BDF font is already loaded, do not
- reload it.
-
-2004-08-30 Jan Dj,Ad(Brv <[email protected]>
-
- * macmenu.c (_widget_value): Add lname and lkey.
- (single_submenu): Set lname and lkey in widget_value
- instead of name and key.
- (update_submenu_strings): New function.
- (set_frame_menubar): Remove call to inhibit_garbage_collection,
- call update_submenu_strings.
-
- * xmenu.c (digest_single_submenu): Set lname and lkey in widget_value
- instead of name and key.
- (update_submenu_strings): New function.
- (set_frame_menubar): Remove call to inhibit_garbage_collection,
- call update_submenu_strings.
-
- * gtkutil.h (_widget_value): Added lname and lkey.
-
-2004-08-30 Steven Tamm <[email protected]>
-
- * macmenu.c (mac_menu_show): Remove shadowing of menu variable
- by using different names for inner loop variables.
-
-2004-08-27 Jan Dj,Ad(Brv <[email protected]>
-
- * xmenu.c (set_frame_menubar): Reintroduce inhibit_garbage_collection
- from 2002-07-15T00:01:[email protected] so that strings from ENCODE_UTF_8 isn't GC:ed before used.
-
- * gtkutil.c (xg_create_frame_widgets): Compensate for tool bar when
- tool bar items is 0.
-
-2004-08-26 YAMAMOTO Mitsuharu <[email protected]>
-
- * macmenu.c (ENCODE_MENU_STRING): Added to handle multibyte
- strings in menu items.
- (single_submenu): Use ENCODE_MENU_STRING
- (mac_menu_show): Use ENCODE_MENU_STRING. Reset grabbed because
- button release isn't passed to event loop
- (add_menu_item): Use SetMenuItemWithCFString.
-
-2004-08-26 Steven Tamm <[email protected]>
-
- * fileio.c (Fread_file_name): Call x_file_dialog on carbon on
- tool-bar/menu click.
- * macfns.c (Fx_file_dialog): Implement using NavServices.
-
-2004-08-24 Jan Dj,Ad(Brv <[email protected]>
-
- * xterm.c (x_catch_errors_unwind): Do not XSync if display has closed.
-
- * xfns.c (x_window_to_frame, x_any_window_to_frame)
- (x_non_menubar_window_to_frame, x_menubar_window_to_frame)
- (x_top_window_to_frame): Return 0 if wdesc is None.
-
-2004-08-22 Richard M. Stallman <[email protected]>
-
- * process.c (process_send_signal) [SIGNALS_VIA_CHARACTERS,
- HAVE_TERMIOS]: If there's no char for this signal, drop through
- and use system calls.
-
- * bytecode.c (Fbyte_code) <unwind-protect>: Cannot GC.
-
-2004-08-20 Kim F. Storm <[email protected]>
-
- * process.c (wait_reading_process_output): Rename from
- wait_reading_process_input. All uses changed.
- (wait_reading_process_output_1): Rename from
- wait_reading_process_input_1. All uses changed.
-
- * dispnew.c (Fsleep_for): Remove obsolete code.
-
-2004-08-20 Kenichi Handa <[email protected]>
-
- * syntax.c (skip_chars): Fix for unibyte case.
-
-2004-08-19 Stefan Monnier <[email protected]>
-
- * syntax.c (char_quoted): Mixup byte/char pos.
- (back_comment): Fixup globals in all cases.
-
-2004-08-19 Jan Dj,Ad(Brv <[email protected]>
-
- * xfns.c (x_set_name, x_set_title): Encode title to UTF8 before
- passing it to gtk_window_set_title.
-
-2004-08-19 Kim F. Storm <[email protected]>
-
- * process.c (wait_reading_process_input): Clean up.
- Add wait_for_cell, wait_proc, and just_wait_proc args
- to avoid overloading `read_kbd' and `do_display' args.
- Change read_kbd arg to int. All callers changed.
-
- * process.c (process_send_signal): Use CDISABLE.
-
- * sysdep.c (child_setup_tty, init_sys_modes): Use CDISABLE.
-
-2004-08-18 Kim F. Storm <[email protected]>
-
- * process.c (Faccept_process_output): Add arg JUST-THIS-ONE;
- forward to wait_reading_process_input via DO_DISPLAY arg.
- (wait_reading_process_input): If DO_DISPLAY < 0 for a process
- object, only process output from that process; also inhibit
- running timers if DO_DISPLAY==-2.
-
-2004-08-17 Kim F. Storm <[email protected]>
-
- * process.c (process_send_signal): Fix last change--use
- _POSIX_VDISABLE instead of CVDISABLE when available.
-
-2004-08-16 Richard M. Stallman <[email protected]>
-
- * sysdep.c (child_setup_tty) [SIGNALS_VIA_CHARACTERS]:
- Set VQUIT and VINTR chars to the standard ones if they are unset.
- [AIX]: Don't do that here. And don't force VINTR to standard
- when SIGNALS_VIA_CHARACTERS.
-
- * process.c (process_send_signal)
- [SIGNALS_VIA_CHARACTERS, HAVE_TERMIOS]: Clean up.
- Do nothing if the character is CVDISABLE.
-
- * xfaces.c (merge_face_ref): Specifying `unspecified' is a no-op.
-
- * intervals.c (move_if_not_intangible):
- Force POSITION to be between BEGV and ZV.
-
-2004-08-14 John Paul Wallington <[email protected]>
-
- * buffer.c (Frestore_buffer_modified_p): Doc fix.
-
- * fileio.c (Fread_file_name): Doc fix.
-
- * minibuf.c (syms_of_minibuf) <completion-ignore-case>: Doc fix.
-
-2004-08-09 Luc Teirlinck <[email protected]>
-
- * keymap.c (Fmake_keymap, Fmap_keymap, Fwhere_is_internal): Doc fixes.
-
-2004-08-08 Luc Teirlinck <[email protected]>
-
- * keyboard.c: Declare Qdisabled_command_function instead of
- Qdisabled_command_hook.
- (Fcommand_execute): Use Qdisabled_command_function instead of
- Qdisabled_command_hook.
- (syms_of_keyboard): Ditto.
-
-2004-08-07 Luc Teirlinck <[email protected]>
-
- * keymap.c (Flocal_key_binding, Fglobal_key_binding)
- (syms_of_keymap) <key-translation-map>: Doc fixes.
-
-2004-08-07 Stefan Monnier <[email protected]>
-
- * window.c (window_list_1): YAILOM.
-
- * fileio.c (make_temp_name): Handle multibyte prefixes.
-
-2004-08-06 Luc Teirlinck <[email protected]>
-
- * keyboard.c (syms_of_keyboard) <overriding-terminal-local-map>:
- Doc fix.
-
-2004-08-03 Kenichi Handa <[email protected]>
-
- * coding.c (decode_coding_string): Adjust coding->consumed, and
- etc. with shrinked_bytes.
-
-2004-08-03 Kim F. Storm <[email protected]>
-
- * indent.c (compute_motion): Fix check for full width window
- in non-window case. Do not count left truncation glyph on
- window systems.
-
-2004-08-02 Luc Teirlinck <[email protected]>
-
- * data.c (Finteractive_form): Doc fix.
-
-2004-08-02 Kim F. Storm <[email protected]>
-
- * indent.c (compute_motion): Use actual window width if WIDTH is -1,
- properly accounting for continuation glyph on non-window systems.
- (Fcompute_motion): Use actual window width if WIDTH is nil, and
- actual window width/height if TOPOS is nil, properly accounting for
- continuation glyphs on non-window systems, and optional header lines.
- (vmotion): Let compute_motion calculate actual window width.
-
- * window.c (window_scroll_line_based): Let compute_motion
- calculate actual window width.
-
-2004-08-02 Kim F. Storm <[email protected]>
-
- * process.c (read_process_output): Use whole read buffer.
- Don't trigger adaptive read buffering on errors.
-
-2004-07-31 Luc Teirlinck <[email protected]>
-
- * keymap.c (Fset_keymap_parent, Fdefine_prefix_command): Doc fixes.
-
- * keyboard.c (syms_of_keyboard) <disable-point-adjustment>: Doc fix.
-
- * callint.c (Fcall_interactively): Doc fix.
-
-2004-07-30 Richard M. Stallman <[email protected]>
-
- * abbrev.c (Fexpand_abbrev): Undo previous change.
-
-2004-07-30 Kim F. Storm <[email protected]>
-
- * editfns.c (Fformat): Allocate extra (dummy) element in info.
-
-2004-07-28 Luc Teirlinck <[email protected]>
-
- * eval.c (Fdefvar, Fdefconst): Doc fixes.
-
-2004-07-27 Kim F. Storm <[email protected]>
-
- * xdisp.c (move_it_in_display_line_to): Check BUFFER_POS_REACHED_P after
- we have ensured that the glyph fits on the current line (or returned
- MOVE_LINE_CONTINUED otherwise).
-
-2004-07-26 Kim F. Storm <[email protected]>
-
- * xdisp.c (move_it_in_display_line_to): If overflow-newline-into-fringe
- is enabled, return MOVE_LINE_CONTINUED rather than MOVE_POS_MATCH_OR_ZV
- if target position is at end of display line but char is not a newline.
-
-2004-07-25 Richard M. Stallman <[email protected]>
-
- * window.c (coordinates_in_window): Return ON_SCROLL_BAR
- instead of ON_VERTICAL_BORDER, when on scroll bar.
- (Fcoordinates_in_window_p): Handle ON_SCROLL_BAR--return nil.
-
- * dispextern.h (enum window_part): Add ON_SCROLL_BAR.
-
- * window.c (Fcoordinates_in_window_p):
- Take account of FRAME_INTERNAL_BORDER_WIDTH.
-
- * alloc.c (check_cons_list): New function (contents commented out).
-
-2004-07-24 Luc Teirlinck <[email protected]>
-
- * xfaces.c (Fcolor_supported_p): Doc fix.
-
- * frame.c (Fselect_frame, Fset_frame_selected_window)
- (Fframe_visible_p, Fraise_frame): Doc fixes.
-
-2004-07-24 Richard M. Stallman <[email protected]>
-
- * keyboard.h (not_single_kboard_state): Declare.
-
- * fileio.c (Fwrite_region): Doc fix.
-
- * window.c (Fwindow_at): Take account of FRAME_INTERNAL_BORDER_WIDTH.
-
- * abbrev.c (Fexpand_abbrev): Run Qpre_abbrev_expand_hook
- only when a real abbrev is present.
-
- * xfns.c (x_icon_verify): New function.
- (Fx_create_frame): Use it.
-
-2004-07-22 Barry Fishman <[email protected]> (tiny change)
-
- * s/gnu-linux.h: Use GC_MARK_STACK if __amd64__ is defined.
-
-2004-07-21 Kim F. Storm <[email protected]>
-
- * window.h (struct glyph_matrix): New members nrows_scale_factor
- and ncols_scale_factor.
-
- * window.c (make_window): Initialize nrows_scale_factor and
- ncols_scale_factor members.
-
- * dispnew.c (margin_glyphs_to_reserve): Apply ncols_scale_factor.
- (allocate_matrices_for_frame_redisplay): Fix left/right margin mix-up.
- (required_matrix_height): Apply nrows_scale_factor.
- (required_matrix_width): Apply ncols_scale_factor.
-
- * xdisp.c (display_line): Increment nrows_scale_factor and set
- fonts_changed_p if past last allocated row.
- (append_glyph, append_composite_glyph, produce_image_glyph)
- (append_stretch_glyph): Increment ncols_scale_factor and set
- fonts_changed_p if current area is full.
-
-2004-07-21 Jan Dj,Ad(Brv <[email protected]>
-
- * widget.c (EmacsFrameDestroy): Don't abort if normal_gc is 0.
-
-2004-07-19 Luc Teirlinck <[email protected]>
-
- * window.c (Fpos_visible_in_window_p, Fset_window_hscroll)
- (Fwindow_inside_pixel_edges, Fwindow_end, Fset_window_point)
- (Fset_window_start, Fscroll_up, Fscroll_down)
- (Fother_window_for_scrolling, Fscroll_other_window)
- (Fsave_window_excursion, Fset_window_vscroll)
- (syms_of_window) <window-size-fixed>: Doc fixes.
-
-2004-07-19 KOBAYASHI Yasuhiro <[email protected]>
-
- * w32fns.c (Fx_file_dialog): Use ENCODE_FILE instead of
- ENCODE_SYSTEM for filenames.
-
-2004-07-18 YAMAMOTO Mitsuharu <[email protected]>
-
- * mac.c (sys_select): Block input around call to
- ReceiveNextEvent to prevent breakage. Correctly handle
- blocking on event queue only by calling ReceiveNextEvent
- instead of select (since GUI events aren't on an fd).
- (sys_read): Remove function
- * sysdep.c: Remove redefine of read to sys_read if HAVE_CARBON.
-
-2004-07-18 YAMAMOTO Mitsuharu <[email protected]>
-
- * mac.c (sys_select): Redo sys_select to use alarm-based
- polling instead of 1 sec timeouts (like solaris).
-
- * macterm.c (x_make_frame_visible): Comment in polling on
- frame creation.
-
- * keyboard.c: Undef SIGIO on Carbon.
-
- * atimer.c (alarm_signal_handler): Call alarm handlers after
- scheduling.
-
- * eval.c (Feval): Remove quit_char test.
-
- * process.c (wait_reading_process_input): Remove clearing
- stdin for select call on process input.
-
-2004-07-18 Luc Teirlinck <[email protected]>
-
- * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Correct
- capitalization error in docstring.
-
-2004-07-17 Juanma Barranquero <[email protected]>
-
- * keyboard.c (not_single_kboard_state): Do nothing unless
- MULTI_KBOARD is defined.
-
-2004-07-17 Richard M. Stallman <[email protected]>
-
- * window.c (coordinates_in_window): Inside the window but outside
- its box to the L or R, return ON_VERTICAL_BORDER.
- (window_list_1): Rotate the list to start with WINDOW.
-
- * print.c (print_preprocess): Test for print_depth at limit
- before entering in being_printed.
-
- * keyboard.c (not_single_kboard_state): New function.
- (stuff_buffered_input): Now no-op only if no SIGTSTP.
-
- * frame.c (Fdelete_frame): If we're in single_bboard_state on
- this kboard, and we delete its last frame, go to any_kboard_state.
-
- * buffer.c (syms_of_buffer) <transient-mark-mode>: Doc fix.
-
-2004-07-15 KOBAYASHI Yasuhiro <[email protected]>
-
- * w32fns.c (Fx_file_dialog): Encode strings in system coding
- system before passing them to OS functions for display.
-
-2004-07-15 David Kastrup <[email protected]>
-
- * search.c (syms_of_search): Staticpro `saved_last_thing_searched'.
- Apparently fixes an abort condition.
-
-2004-07-14 Luc Teirlinck <[email protected]>
-
- * fileio.c (Fvisited_file_modtime): Return a list of two integers,
- instead of a cons.
-
-2004-07-14 K,Aa(Broly L$,1 q(Brentey <[email protected]>
-
- * keyboard.c (echo_dash): Do nothing if there already is a dash
- at the end of the echo string.
-
-2004-07-12 Kim F. Storm <[email protected]>
-
- * alloc.c (mark_object): Only look at Lisp_Misc_Save_Value
- if GC_MARK_STACK.
-
-2004-07-10 Luc Teirlinck <[email protected]>
-
- * buffer.c (Fswitch_to_buffer, Fpop_to_buffer): Doc fixes.
-
- * window.c (Fwindow_buffer, Fother_window, Fget_lru_window)
- (Fget_largest_window, Fget_buffer_window, Fdelete_windows_on)
- (Freplace_buffer_in_windows, Fset_window_buffer)
- (Fselect-window, Fdisplay-buffer, Fsplit_window): Doc fixes.
- (syms_of_window): Expand docstring of `display-buffer-function'.
-
-2004-07-09 Luc Teirlinck <[email protected]>
-
- * editfns.c (Ffloat_time, Fformat_time_string, Fdecode_time)
- (Fcurrent_time_string, Fcurrent_time_zone): Mention in docstrings
- that time values of the type (HIGH . LOW) are considered obsolete.
-
-2004-07-06 Luc Teirlinck <[email protected]>
-
- * keyboard.c (syms_of_keyboard): Fix `keyboard-translate-table'
- docstring.
-
- * fns.c (Fclear_string): Declare `len' before call to CHECK_STRING.
-
-2004-07-06 John Paul Wallington <[email protected]>
-
- * eval.c (Fdefmacro): Signal an error if NAME is not a symbol.
-
- * fns.c (Fclear_string): Signal an error if STRING is not a string.
-
-2004-07-05 Jan Dj,Ad(Brv <[email protected]>
-
- * macterm.c (mac_initialize_display_info): Use CGGetActiveDisplayList
- instead of CGMainDisplayID (only in OSX 10.2 and later).
-
-2004-07-04 John Paul Wallington <[email protected]>
-
- * fileio.c (read_file_name_completion_ignore_case): New variable.
- (syms_of_fileio): Declare and initialise it.
- (Fread_file_name): Bind `completion-ignore-case' to respect it.
-
-2004-07-03 Eli Zaretskii <[email protected]>
-
- * msdos.c (dos_rawgetc): Use make_number to produce Lisp objects
- for event.x and event.y.
-
-2004-07-01 Kenichi Handa <[email protected]>
-
- * w32select.c (Fw32_set_clipboard_data): Update `nbytes' correctly
- after getting a new string by pre-write-conversion.
-
-2004-06-30 Stefan Monnier <[email protected]>
-
- * xterm.c (x_detect_focus_change): Remove unused var `nr_events'.
- (x_calc_absolute_position): Remove unused var `child'.
-
- * xfaces.c (x_supports_face_attributes_p)
- (Fdisplay_supports_face_attributes_p): YAILOM.
- (tty_supports_face_attributes_p): Remove unused var `i'.
-
- * syntax.c (skip_chars): Remove unused labels fwd_unibyte_ok and
- back_unibyte_ok.
-
- * search.c (match_limit, Fmatch_data, Fset_match_data): YAILOM.
-
- * fontset.c (Fset_fontset_font): Remove unused vars `family' and
- `registry'.
-
- * Makefile.in (${etc}DOC): Fix file name of make-docfile.
-
-2004-06-30 Andreas Schwab <[email protected]>
-
- * image.c (CHECK_LIB_AVAILABLE): Add third parameter LIBRARIES.
- (Finit_image_library): Pass LIBRARIES through to
- CHECK_LIB_AVAILABLE. Declare parameters. Doc fix.
- (lookup_image_type): Pass Qnil as second argument to
- Finit_image_library.
-
- * lisp.h (Finit_image_library): Declare.
-
-2004-06-29 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.c (do_window_activate, do_window_deactivate): Remove.
- (XTread_socket): Send mouse button events to the toolbox
- dispatcher even when the mouse is grabbed. Don't process window
- activate events for non-Emacs windows. Replace function calls to
- do_window_activate and do_window_deactivate with their contents.
- Reset mouse grabbing status when a window is deactivated.
-
-2004-06-29 Steven Tamm <[email protected]>
-
- * macterm.c (mac_get_emulated_btn)
- (mac_event_to_emacs_modifiers): Fix emulated mouse button
- support to correctly mask out modifiers.
-
-2004-06-29 David Kastrup <[email protected]>
-
- * search.c (Fset_match_data): Allow buffer before end of list
- which can happen if set-match-data is using a pre-consed list.
-
-2004-06-28 Steven Tamm <[email protected]>
-
- * macterm.c (XTread_socket): Correctly set the frame position
- after the window is moved.
-
-2004-06-28 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (xg_get_image_for_pixmap): Call g_object_unref on
- gpix and gmask just before return to avoid memory leak.
- (xg_get_image_for_pixmap): Add workaround for monochrome displays
- so insensitive and activated icons look ok.
-
-2004-06-27 Jason Rumney <[email protected]>
-
- * w32fns.c (file_dialog_callback): Disable edit control if set
- to directories only on CDN_INITDONE message.
- (Fx_file_dialog): Default to directories only when prompt starts
- with "Dired".
-
-2004-06-25 Kim F. Storm <[email protected]>
-
- * alloc.c (allocate_misc): Update total_free_markers.
- (free_misc): New function.
- (safe_alloca_unwind, free_marker): Use it.
-
- * lisp.h (free_misc): Add prototype.
-
- * fns.c (Fmapconcat, Fmapcar): Remove superfluous GCPROs.
-
-2004-06-24 Richard M. Stallman <[email protected]>
-
- * emacs.c (Vsignal_USR1_hook, Vsignal_USR2_hook): Definitions deleted.
- (syms_of_emacs): Lisp variables deleted.
-
-2004-06-23 David Kastrup <[email protected]>
-
- * search.c (Freplace_match): Adjust the match-data more thoroughly
- when replacing strings in the buffer.
- (Fmatch_data): When INTEGERS is non-nil and the last match was in
- a buffer, add the buffer as last element to the match data.
- (Fset_match_data): If an additional element of the match-data is a
- buffer, restore it to last_thing_searched.
- (save_search_regs): Save last_thing_searched as part of the match data.
- (restore_match_data): Restore it again.
-
-2004-06-23 Luc Teirlinck <[email protected]>
-
- * keymap.c (Ftext_char_description): Doc fix.
- * doc.c (Fsnarf_documentation): Doc fix.
-
-2004-06-22 Kim F. Storm <[email protected]>
-
- * fns.c (Fmapcar, Fmapconcat): GCPRO the args array.
-
- * lisp.h (struct Lisp_Save_Value): New member dogc.
- (SAFE_ALLOCA_LISP): Change second arg to number of elements.
- Set dogc member in Lisp_Save_Value object so it will be GC'ed.
- (SAFE_FREE_LISP): New macro.
-
- * alloc.c (safe_alloca_unwind): Clear dogc and pointer members.
- (make_save_value): Init new dogc member.
- (mark_object): Mark Lisp_Save_Value pointer array if dogc is set.
-
- * fns.c (Fmapconcat, Fmapcar): Use new SAFE_ALLOCA_LISP and
- SAFE_FREE_LISP macros.
-
-2004-06-22 Kim F. Storm <[email protected]>
-
- * lisp.h (SAFE_ALLOCA_LISP): New macro to allocate Lisp_Objects.
- Temporarily inhibits GC if memory is xmalloc'ed, as the Lisp_Objects
- in that memory area are unknown to GC. Add comments.
-
- * fns.c (Fmapconcat, Fmapcar): Use SAFE_ALLOCA_LISP.
-
-2004-06-21 Kim F. Storm <[email protected]>
-
- * lisp.h (MAX_ALLOCA): Define here.
- (safe_alloca_unwind): Add prototype.
- (USE_SAFE_ALLOCA, SAFE_ALLOCA, SAFE_FREE): New macros.
-
- * alloc.c (safe_alloca_unwind): New function.
-
- * casefiddle.c (casify_object): Use SAFE_ALLOCA.
-
- * charset.c (Fstring): Use SAFE_ALLOCA.
-
- * coding.c (MAX_ALLOCA): Remove define.
-
- * data.c (MAX_ALLOCA): Remove define.
- (Faset): Use SAFE_ALLOCA.
-
- * editfns.c (Fformat, Ftranspose_regions): Use SAFE_ALLOCA.
-
- * fns.c (string_make_multibyte, string_to_multibyte)
- (string_make_unibyte, Fmapconcat, Fmapcar): Use SAFE_ALLOCA.
- (MAX_ALLOCA): Remove define.
- (Fbase64_encode_region, Fbase64_encode_string)
- (Fbase64_decode_region, Fbase64_decode_string): Use SAFE_ALLOCA.
- (Fbase64_encode_region, Fbase64_encode_string): Fix potential
- memory leak if encoding fails.
-
- * xdisp.c (add_to_log): Use SAFE_ALLOCA.
-
-2004-06-21 Eli Zaretskii <[email protected]>
-
- * print.c (Fwith_output_to_temp_buffer): Doc fix.
-
-2004-06-20 Richard M. Stallman <[email protected]>
-
- * xfaces.c (Finternal_copy_lisp_face): Small cleanup; doc fix.
-
- * search.c (match_limit): Cleaner err msg when no match data available.
-
- * window.c (syms_of_window): Doc fix.
-
- * keyboard.c (command_loop_1): Handle values `only' and `identity'
- for Vtransient_mark_mode.
-
- * buffer.c (syms_of_buffer): Doc fix.
-
-2004-06-21 David Kastrup <[email protected]>
-
- * minibuf.c (Ftry_completion, Fall_completions): Do lazy binding
- and unbinding of `case-fold-search' according to
- `completion-ignore-case' around calls of string-match and
- predicates, respectively. Should give satisfactory performance
- in all relevant cases.
-
-2004-06-17 Jan Dj,Ad(Brv <[email protected]>
-
- * xterm.c (x_draw_image_foreground_1): Subtract slice.x/y from
- clip_x/y_origin.
-
- * fns.c (string_to_multibyte): Use xmalloc/xfree instead of alloca.
-
- * macfns.c (Fx_display_color_cells): Do not limit return value to 256.
-
- * macterm.c (mac_initialize_display_info): Initialize n_planes correctly
- on Mac OSX.
-
-2004-06-16 Luc Teirlinck <[email protected]>
-
- * buffer.c (syms_of_buffer): Clarify `fill-column' docstring.
-
-2004-06-16 Kim F. Storm <[email protected]>
-
- * dispextern.h (Vimage_types): Remove extern.
-
-2004-06-16 Miles Bader <[email protected]>
-
- * image.c (lookup_image_type): Initialize image type if necessary.
-
-2004-06-15 Kim F. Storm <[email protected]>
-
- * xdisp.c (try_cursor_movement): Exclude header line from scroll
- margin at top of window.
- (try_window_reusing_current_matrix): Calculate proper cursor position
- after scrolling up with non-zero scroll margin, as the old cursor
- position corresponds to value of PT before executing this command.
- (try_window_id): Consider scroll margin at bottom of window too;
- otherwise we fail to scroll when hl-line-mode is enabled.
-
- * syntax.c (skip_chars): Only recognize [:class:] when it has the
- proper format and class is a lower-case word.
-
-2004-06-14 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (xg_get_image_for_pixmap): New function.
- (xg_get_gdk_pixmap_and_mask): Remove.
- (update_frame_tool_bar): Call xg_get_image_for_pixmap instead of
- xg_get_gdk_pixmap_and_mask.
-
- * xterm.h (struct x_display_info): Typo in comment fixed.
-
-2004-06-14 Juanma Barranquero <[email protected]>
-
- * dispextern.h (Vimage_types): Make it conditional on
- HAVE_WINDOW_SYSTEM.
-
- * image.c (Vimage_types): Move from xdisp.c.
- (Vimage_type_cache): New variable.
- (define_image_type): New argument indicating whether an image
- library was loaded; cache loaded status and return t on success,
- nil otherwise.
- (CACHE_IMAGE_TYPE, ADD_IMAGE_TYPE): New macros.
- (w32_delayed_load): New function to load an image library from a
- list of possible filenames.
- (init_xpm_functions, init_png_functions, init_jpeg_functions)
- (init_tiff_functions, init_gif_functions): Use `w32_delayed_load'.
- (CHECK_LIB_AVAILABLE): Call `define_image_library' with new argument.
- (Finit_image_library): New function, extracted from `init_image'.
- Try to initialize an image library on demand and cache whether we
- were successful or not.
- (syms_of_image): Initialize `Vimage_types' and
- `Vimage_type_cache'. Add recognized image types to Vimage_types.
- Export `init-image-library'.
- (init_image): Remove initialization of all image types, except xbm
- and pbm.
-
- * xdisp.c (Vimage_types): Delete (moved to image.c).
-
-2004-06-14 Andreas Schwab <[email protected]>
-
- * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
- Avoid calling specbind when completion-regexp-list is empty.
-
-2004-06-13 Richard M. Stallman <[email protected]>
-
- * regex.h (CHAR_CLASS_MAX_LENGTH, re_wctype_t, re_wchar_t)
- (re_wctype, re_iswctype, re_wctype_to_bit):
- Non-function definitions moved here from regex.c.
-
- * regex.c (re_wctype, re_iswctype): Function defs longer static.
- (CHAR_CLASS_MAX_LENGTH, re_wctype_t, re_wchar_t)
- (re_wctype, re_iswctype, re_wctype_to_bit):
- Non-function definitions moved to regex.h.
-
- * window.c (Fselect_window): Doc fix.
-
- * syntax.c: Include regex.h.
- (skip_chars): New arg HANDLE_ISO_CLASSES. Callers changed.
- If requested, make a list of classes, then check the scanned
- chars for membership in them.
- (in_classes): New function.
- Doc fix.
-
- * keyboard.c (cmd_error): Don't call any_kboard_state
- if inside a recursive edit level.
-
-2004-06-13 K,Aa(Broly L$,1 q(Brentey <[email protected]>
-
- * keyboard.c (command_loop): Call any_kboard_state before
- command_loop_2 when at top level.
-
-2004-06-13 Andreas Schwab <[email protected]>
-
- * print.c (print_object): Always use %ld for printing EMACS_INT.
-
- * keyboard.c (cancel_hourglass_unwind): Return a value.
- (modify_event_symbol): Always use %ld for printing EMACS_INT.
- (Fexecute_extended_command): Likewise.
-
- * syntax.h (SYNTAX_ENTRY_FOLLOW_PARENT): Rename local variable to
- avoid clashes.
- (SYNTAX): Likewise.
- (SYNTAX_WITH_FLAGS): Likewise.
- (SYNTAX_MATCH): Likewise.
-
- * syntax.c (char_quoted): Avoid warning about undefined operation.
- (find_defun_start): Likewise.
- (scan_lists): Likewise.
- (INC_FROM): Likewise.
- (scan_sexps_forward): Likewise.
-
- * image.c: Include <ctype.h>.
-
- * xfaces.c (face_attr_equal_p): Declare parameters.
-
-2004-06-13 Kenichi Handa <[email protected]>
-
- * ccl.c (CCL_READ_CHAR): If hit EOF, set REG to -1.
-
-2004-06-12 Matthew Mundell <[email protected]>
-
- * eval.c (Fdefun): Signal an error if NAME is not a symbol.
-
-2004-06-12 Kenichi Handa <[email protected]>
-
- * ccl.c (CCL_CALL_FOR_MAP_INSTRUCTION): Save eof_ic in
- ccl_prog_stack_struct and update it.
- (CCL_INVALID_CMD): If CCL_DEBUG is defined, call ccl_debug_hook.
- (CCL_READ_CHAR): Get instruction counter from eof_ic, not from
- ccl->eof_ic on EOF.
- (ccl_debug_hook): New function.
- (struct ccl_prog_stack): New member eof_ic.
- (ccl_driver): Handle EOF in subrountine call correctly.
-
-2004-06-11 Kenichi Handa <[email protected]>
-
- * coding.c (encode_coding_string): Check CODING_FINISH_INTERRUPT.
-
-2004-06-11 Kim F. Storm <[email protected]>
-
- * emacs.c (shut_down_emacs): Inhibit redisplay during shutdown.
-
-2004-06-11 Juanma Barranquero <[email protected]>
-
- * keyboard.c (Fposn_at_point): Doc fix.
-
-2004-06-11 David Kastrup <[email protected]>
-
- * search.c (match_limit): Don't flag an error if match-data
- exceeding the allocated search_regs.num_regs gets requested, just
- return Qnil.
-
-2004-06-08 Miles Bader <[email protected]>
-
- * xfaces.c (push_named_merge_point): Return 0 when a cycle is detected.
-
-2004-06-07 Juanma Barranquero <[email protected]>
-
- * editfns.c (Fuser_login_name, Ffloat_time, Fencode_time)
- (Fcurrent_time_string, Fcurrent_time_zone)
- (Finsert_buffer_substring, Ftranspose_regions): Doc fixes.
-
-2004-06-07 Miles Bader <[email protected]>
-
- * xfaces.c (struct named_merge_point): New type.
- (push_named_merge_point): New function.
- (merge_named_face): New function.
- (merge_face_ref, face_at_buffer_position, face_at_string_position):
- Use `merge_named_face'.
- (merge_face_inheritance): Function removed.
- (merge_face_ref): Rename from `merge_face_vector_with_property'.
- Add new `err_msgs' and `named_merge_points' args. Return error
- status. Only print error messages if ERR_MSGS is true. Don't try to
- do :inherit attribute validation.
- (merge_face_heights): Handle `unspecified' in both directions.
- (merge_face_vectors): Rename `cycle_check' arg to `named_merge_points'.
- Call `merge_face_ref' instead of `merge_face_inheritance'.
- (Fdisplay_supports_face_attributes_p, Fface_attributes_as_vector)
- (compute_char_face, face_at_buffer_position)
- (face_at_string_position): Call `merge_face_ref' instead of
- `merge_face_vector_with_property'.
-
-2004-06-07 Kenichi Handa <[email protected]>
-
- * coding.c (find_safe_codings): Check NILP (safe_codings) only at
- the necessary places.
-
-2004-06-07 Kim F. Storm <[email protected]>
-
- * process.c (Fdelete_process): Undo 2004-05-28 change.
- Instead, call status_notify also for network process.
- (status_message): Use process instead of status as arg.
- Give messages "deleted" or "connection broken by remote peer" for
- an exited network process.
- (status_notify): Change call to status_message.
- (read_process_output): Increase readmax to 4096. Do not increase
- buffer size for datagram channels (default is now large enough).
-
-2004-06-06 Steven Tamm <[email protected]>
-
- * macfns.c (x_create_tip_frame): Fix Mac OS X 10.1 compilation
- problem due to newly defined variable.
-
-2004-06-06 Miles Bader <[email protected]>
-
- * xfaces.c (Fdisplay_supports_face_attributes_p): Give up
- immediately if non-interactive or not initialized.
-
-2004-06-05 Richard M. Stallman <[email protected]>
-
- * minibuf.c (Fcompleting_read): Doc fix.
-
-2004-06-05 Andreas Schwab <[email protected]>
-
- * macfns.c (x_create_tip_frame): Fix declaration after statement.
-
-2004-06-05 Juanma Barranquero <[email protected]>
-
- * keymap.c (Fdescribe_vector): Fix docstring.
- (Fkey_description, Fglobal_key_binding): Fix typo in docstring.
-
-2004-06-05 Miles Bader <[email protected]>
-
- * xfaces.c (tty_supports_face_attributes_p): Make sure the specified
- attributes have different values than the default face.
-
-2004-06-04 Eli Zaretskii <[email protected]>
-
- * xfaces.c (x_supports_face_attributes_p): Make this function
- conditional on HAVE_WINDOW_SYSTEM.
- (Fdisplay_supports_face_attributes_p) [HAVE_WINDOW_SYSTEM]:
- Don't call x_supports_face_attributes_p if it was not compiled in.
-
-2004-06-04 Miles Bader <[email protected]>
-
- * xfaces.c (tty_supports_face_attributes_p): New function, mostly
- from Ftty_supports_face_attributes_p.
- (x_supports_face_attributes_p): New function.
- (Ftty_supports_face_attributes_p): Function deleted.
- (Fdisplay_supports_face_attributes_p): New function.
- (syms_of_xfaces): Initialize Sdisplay_supports_face_attributes_p.
- (face_attr_equal_p): New function.
- (lface_equal_p): Use it.
-
-2004-06-03 Juanma Barranquero <[email protected]>
-
- * w32fns.c (Fx_display_grayscale_p, Fw32_send_sys_command)
- (Vw32_color_map): Fix typo in docstring.
- (Fx_create_frame, Fw32_find_bdf_fonts, Fx_show_tip)
- (Fw32_unregister_hot_key, Fw32_reconstruct_hot_key):
- Make argument names match their use in docstring.
-
-2004-06-02 Juanma Barranquero <[email protected]>
-
- Work around bugs/problems with MinGW builds of graphics libraries
- called from MSVC builds of Emacs.
-
- * image.c (lookup_image): Make pointer to img static.
- (png_read_from_memory): Disable "global" optimization.
-
-2004-06-01 Stefan Monnier <[email protected]>
-
- * eval.c (Fcondition_case): Fix usage. Simplify.
-
- * mem-limits.h (EXCEEDS_LISP_PTR) [USE_LSB_TAG]: Never true.
-
-2004-05-29 YAMAMOTO Mitsuharu <[email protected]>
-
- * macfns.c: Don't include ccl.h.
- [MAC_OSX]: Don't include QuickTime/QuickTime.h.
- [!MAC_OSX]: Don't include alloca.h, Windows.h, Gestalt.h, or
- TextUtils.h.
- (Fx_create_frame): Sync with xfns.c. Initialize cursor descriptors.
- (Fx_display_mm_height, Fx_display_mm_width): Calculate length from
- display height/width.
- (compute_tip_xy, Vx_max_tooltip_size): Declare.
- (unwind_create_tip_frame, compute_tip_xy): New functions.
- (x_create_tip_frame, Fx_show_tip, Fx_hide_tip): Sync with xfns.c.
- (syms_of_macfns): Initialize Qcancel_timer, Vx_max_tooltip_size,
- and last_show_tip_args.
-
- * macgui.h [!MAC_OSX]: Include Gestalt.h.
- (Cursor, No_Cursor): New defines.
- [!TARGET_API_MAC_CARBON] (SetPortWindowPort): New compatibility macro.
- [!TARGET_API_MAC_CARBON] (arrow_cursor): Declare.
-
- * macmenu.c (mac_menu_show, mac_dialog): Use SetPortWindowPort.
-
- * macterm.c: Don't include Gestalt.h.
- (enum mouse_tracking_type, mouse_tracking_in_progress): Remove.
- (XDrawLine, XClearArea, XClearWindow, mac_draw_bitmap)
- (mac_set_clip_rectangle, mac_reset_clipping, XCreatePixmap)
- (XFillRectangle, mac_draw_rectangle, mac_draw_string_common)
- (mac_copy_area, mac_copy_area_with_mask, x_update_end)
- (construct_mouse_click, XTmouse_position)
- (x_scroll_bar_report_motion, x_calc_absolute_position)
- (do_mouse_moved, do_zoom_window, mac_do_receive_drag)
- (XTread_socket, make_mac_frame): Use SetPortWindowPort.
- (note_mouse_movement): Clear the mouse face and reset the pointer
- shape when the pointer goes outside the frame without grabbing.
- (mac_front_window): New function.
- (mac_window_to_frame): New macro.
- (XTmouse_position, x_scroll_bar_report_motion, do_window_update)
- (do_window_activate, do_window_deactivate, do_app_resume)
- (do_app_suspend, do_mouse_moved, do_menu_choice, do_grow_window)
- (do_zoom_window, mac_do_receive_drag, XTread_socket)
- (mac_check_for_quit_char): Use mac_front_window and/or
- mac_window_to_frame.
- (x_scroll_bar_handle_click): Set `(PORTION . WHOLE)' part in a
- scroll-bar click event.
- (mac_define_frame_cursor): Change the pointer shape.
- (x_free_frame_resources): Reset tip_window to NULL when it is
- disposed of.
- [!TARGET_API_MAC_CARBON] (arrow_cursor): New variable.
- [!TARGET_API_MAC_CARBON] (do_init_managers): Initialize arrow_cursor.
- (do_window_update): Don't do anything if the updated window is the
- tooltip window.
- (do_mouse_moved): Handle mouse movement events here (previously in
- XTread_socket). Clear the mouse face if
- dpyinfo->mouse_face_hidden is set.
- (do_os_event, do_events): Remove (now in XTread_socket).
- (XTread_socket): Immediately return if interrupt_input_blocked.
- Loop until all the events in the queue are processed.
- Rearrange codes for mouse grabbing. Add tooltip support. Include the
- contents of do_os_event and do_events. Remove mouse movement
- handling (now in do_mouse_moved). Add the case where
- Vmouse_highlight has an integer value.
- (NewMacWindow): Remove.
- (make_mac_frame): Do what NewMacWindow previously did. Don't do
- excess initializations.
- (make_mac_terminal_frame): Previous initializations in
- make_mac_frame are moved here.
- (mac_initialize_display_info):
- Initialize dpyinfo->mouse_face_overlay and dpyinfo->mouse_face_hidden.
-
- * xdisp.c [MAC_OS] (No_Cursor): Remove variable.
- (define_frame_cursor1): Don't treat HAVE_CARBON as a special case.
-
-2004-05-29 Richard M. Stallman <[email protected]>
-
- * lisp.h (truncate_undo_list): Update decl.
-
- * alloc.c (undo_outer_limit): New variable.
- (syms_of_alloc): Defvar it.
- (Fgarbage_collect): Pass undo_outer_limit to truncate_undo_list.
-
- * undo.c (truncate_undo_list): New arg LIMITSIZE.
-
- * alloc.c (lisp_align_malloc): Check for base == 0
- regardless of HAVE_POSIX_MEMALIGN.
- Clean up HAVE_POSIX_MEMALIGN handling of `err'.
-
-2004-05-28 Stefan Monnier <[email protected]>
-
- * alloc.c: Undo Kim's recent changes and fix the same bug differently.
- (marker_blocks_pending_free): Remove.
- (Fgarbage_collect): Sweep after cleaning up undo-lists.
- Mark the undo lists after claning them up.
- Don't free block in marker_blocks_pending_free.
- (mark_buffer): Don't mark undo_list.
- (gc_sweep): Sweep hash-tables and strings first.
- Do free marker blocks that are empty.
-
-2004-05-28 Jim Blandy <[email protected]>
-
- * regex.c (print_partial_compiled_pattern): Add missing 'break'
- after 'case wordend'. For symbeg and symend, print to stderr,
- like the other cases.
-
-2004-05-28 Noah Friedman <[email protected]>
-
- * process.c (Fdelete_process): Do not call remove_process.
-
-2004-05-28 Stefan Monnier <[email protected]>
-
- * alloc.c (struct backtrace): Remove.
- (Fgarbage_collect): Use the new mark_backtrace.
-
- * eval.c (mark_backtrace): New function.
-
- * minibuf.c (run_exit_minibuf_hook): New function.
- (read_minibuf_unwind): Don't run exit-minibuffer-hook any more.
- (read_minibuf): Use separate unwind handler to run exit-minibuf-hook.
-
-2004-05-27 Kim F. Storm <[email protected]>
-
- * xdisp.c (back_to_previous_visible_line_start): Skip backwards
- over display properties, e.g. images, that replace buffer text.
-
-2004-05-25 Kim F. Storm <[email protected]>
-
- * alloc.c (marker_blocks_pending_free): New var.
- (gc_sweep): Store free marker blocks on that list.
- (Fgarbage_collect): Free them after undo-list cleanup.
-
- * process.c (wait_reading_process_input): Check connect_wait_mask
- before actually accepting connection in case it has already been
- accepted due to recursion.
-
-2004-05-23 K,Aa(Broly L$,1 q(Brentey <[email protected]>
-
- * coding.c (Fset_safe_terminal_coding_system_internal):
- Set suppress_error in safe_terminal_coding, not terminal_coding.
-
-2004-05-22 Richard M. Stallman <[email protected]>
-
- * alloc.c (Fmake_string): Doc fix.
-
- * buffer.c (clone_per_buffer_values): Copy the alist of local vars,
- and the alist pairs too.
-
- * casefiddle.c (casify_object): Return OBJ unchanged if not real char.
-
- * emacs.c (main): Update copyright year.
-
- * fileio.c (Fread_file_name): Expand DIR if not absolute.
-
- * insdel.c (del_range_2, replace_range): Don't write an anchor
- if the gap is empty.
-
- * xdisp.c (try_scrolling): If scroll-up-aggressively or
- scroll-down-aggressively is small but positive, put point
- near the screen edge.
-
-2004-05-22 Juanma Barranquero <[email protected]>
-
- * keymap.c (Fdefine_key): Doc fix.
-
-2004-05-22 Kim F. Storm <[email protected]>
-
- * alloc.c (struct backtrace): Add debug_on_exit member.
- (Fgarbage_collect): Clear out buffer undo_list markers after gc_sweep.
- Identify those markers as Lisp_Misc_Free objects. Clear car and cdr of
- the removed cons cells.
- (mark_object): Undo previous change - disallow Lisp_Misc_Free objects.
- (gc_sweep): Clear cons_blocks before sweeping strings, so we don't have
- any cons cells pointing to unallocated stings.
- Do not lisp_free any marker blocks, as there may still be pointers
- to them from buffer undo lists at this stage of GC.
-
- * keyboard.c (struct backtrace): Add debug_on_exit member.
- (Fcommand_execute): Clear it.
-
-2004-05-20 Luc Teirlinck <[email protected]>
-
- * intervals.c (lookup_char_property): Do not prematurely return nil.
-
-2004-05-19 Jim Blandy <[email protected]>
-
- Add support for new '\_<' and '\_>' regexp operators, matching the
- beginning and end of symbols.
-
- * regex.c (enum syntaxcode): Add Ssymbol.
- (init_syntax_once): Set the syntax for '_' to Ssymbol, not Sword.
- (re_opcode_t): New opcodes `symbeg' and `symend'.
- (print_partial_compiled_pattern): Print the new opcodes properly.
- (regex_compile): Parse the new operators.
- (analyse_first): Skip sym(beg|end) (they match only the empty string).
- (mutually_exclusive_p): `symend' is mutually exclusive with \s_ and
- \sw; `symbeg' is mutually exclusive with \S_ and \Sw.
- (re_match_2_internal): Match symbeg and symend.
-
- * search.c (trivial_regexp_p): \_ is no longer a trivial regexp.
-
-2004-05-19 Kim F. Storm <[email protected]>
-
- * .gdbinit (xsymbol): Fix last change.
-
-2004-05-18 Stefan Monnier <[email protected]>
-
- * .gdbinit (xprintstr): New fun.
- (xstring, xprintsym): Use it.
-
- * w32proc.c (create_child): Use INTMASK.
-
- * alloc.c (Fgarbage_collect): Do all the marking before flushing
- unmarked elements of the undo list.
-
-2004-05-18 David Ponce <[email protected]>
-
- * print.c (print): Reset print_depth before to call print_object.
-
-2004-05-18 Jason Rumney <[email protected]>
-
- * w32console.c: Prefix RIF functions with w32con_ to avoid
- namespace clash with functions in term.c and w32term.c.
-
- * w32menu.c (add_menu_item, w32_menu_display_help)
- [USE_LISP_UNION_TYPE]: Cast from Lisp_Object using i member.
-
- * w32term.h (display_x_get_resource, vga_stdcolor_name): Add prototype.
-
-2004-05-18 Eli Zaretskii <[email protected]>
-
- * lisp.h (DECL_ALIGN): Remove restriction on MS-DOS systems.
-
- * msdos.c (syms_of_msdos): Initialize dos-unsupported-char-glyph
- with make_number.
- (IT_write_glyphs): Extract glyph from dos-unsupported-char-glyph
- with XINT.
-
-2004-05-18 Kim F. Storm <[email protected]>
-
- * blockinput.h (INPUT_BLOCKED_P): New macros.
-
- * keyboard.c (Frecursive_edit): Return immediately if input blocked.
- (Ftop_level): Unblock input if blocked.
-
- * buffer.h (GET_OVERLAYS_AT): New macro.
- * msdos.c (IT_note_mouse_highlight): Use it.
- * textprop.c (get_char_property_and_overlay): Use it.
- * xdisp.c (next_overlay_change, note_mouse_highlight): Use it.
- * xfaces.c (face_at_buffer_position): Use it.
-
- * print.c (print_object): Increase buf size.
-
-2004-05-17 Jason Rumney <[email protected]>
-
- * w32fns.c (Fw32_register_hot_key, Fw32_unregister_hot_key)
- (Fw32_toggle_lock_key) [USE_LISP_UNION_TYPE]: Cast from
- Lisp_Object using i member.
- (w32_quit_key): Rename from Vw32_quit_key, and make an int.
- (syms_of_w32fns, globals_of_w32fns): Use Lisp_Object and int
- consistently.
-
- * w32proc.c (create_child): Use make_number instead of masking pid.
-
- * w32fns.c (w32_color_map_lookup): Return a Lisp_Object.
- (x_to_w32_charset, w32_to_x_charset, w32_to_all_x_charsets):
- Use EQ to compare Lisp_Objects.
- (w32_parse_hot_key): Use int for lisp_modifiers consistently.
-
- * w32term.c (w32_num_mouse_buttons): Rename from
- Vw32_num_mouse_buttons and make it an int.
-
- * w32.c (init_environment): Use it.
-
- * w32fns.c (w32_wnd_proc): Likewise.
-
- * w32proc.c (w32_pipe_read_delay): Rename from
- Vw32_pipe_read_delay and make it an int.
-
- * w32.c (_sys_read_ahead): Use it.
-
- * lisp.h (egetenv) [USE_CRT_DLL]: Remove condition.
-
- * w32proc.c (create_child) [USE_LSB_TAG]: Don't try to mask pid.
-
- * w32inevt.c (w32_console_mouse_position, do_mouse_event)
- (key_event): Don't mix Lisp_Object and int.
-
- * w32heap.c (init_heap) [USE_LSB_TAG]: Don't check heap location.
-
- * keyboard.c (kbd_buffer_get_event): Don't use event->code and
- modifiers in language change event.
-
-2004-05-17 Kim F. Storm <[email protected]>
-
- * alloc.c (mark_object): Ignore Lisp_Misc_Free objects.
- Such objects may be freed markers which still exist on an undo list.
-
-2004-05-16 Juanma Barranquero <[email protected]>
-
- * data.c (Fset_default): Make argument names match their use in
- docstring.
-
-2004-05-15 Andreas Schwab <[email protected]>
-
- * emacs.c (gdb_array_mark_flag): Define.
- * .gdbinit: Mask off gdb_array_mark_flag from vector sizes.
-
-2004-05-15 Eli Zaretskii <[email protected]>
-
- * lisp.h (DECL_ALIGN) [MSDOS]: Don't define DECL_ALIGN to use
- __attribute__((__aligned__)), so that USE_LSB_TAG would not become
- defined for the MS-DOS build.
-
-2004-05-14 Stefan Monnier <[email protected]>
-
- * w32fns.c (Fw32_define_rgb_color): Avoid XSET.
-
-2004-05-14 Kenichi Handa <[email protected]>
-
- * ccl.c (Fccl_execute_on_string): Fix setting elements of STATUS.
-
-2004-05-14 YAMAMOTO Mitsuharu <[email protected]>
-
- * lisp.h (Vx_resource_name, Vx_resource_class): Move from xfns.c
- section to frame.c section.
- (Fxw_display_color_p, Fx_file_dialog): Declare if
- HAVE_WINDOW_SYSTEM defined.
-
- * macfns.c (Fx_create_frame): Fix int/Lisp_Object mixup.
-
- * macmenu.c (set_frame_menubar): Use NILP to test a lisp value.
-
- * macterm.c (mac_get_emulated_btn, mac_event_to_emacs_modifiers)
- (mac_get_mouse_btn): Use NILP and EQ to test/compare lisp values.
- (XTread_socket): Fix int/Lisp_Object mixup.
- (mac_check_for_quit_char): Fix pointer/Lisp_Object mixup.
-
- * macterm.h (struct frame, struct face, struct image)
- (display_x_get_resource, Fx_display_color_p)
- (Fx_display_grayscale_p, Fx_display_planes, x_free_gcs):
- Add prototypes.
-
-2004-05-14 Kim F. Storm <[email protected]>
-
- * process.c (wait_reading_process_input): Make reentrant.
- Make Available and Connecting non-static. Save and restore value
- of waiting_for_user_input_p.
-
-2004-05-13 Kim F. Storm <[email protected]>
-
- * keyboard.c (mark_kboards): Don't mark x and y members
- that are overloaded in selection request events.
-
-2004-05-13 Stefan Monnier <[email protected]>
-
- * lisp.h (USE_LSB_TAG): Make it the default when it is known to work.
-
-2004-05-13 Glenn Morris <[email protected]>
-
- * window.c (Fdisplay_buffer, Fsplit_window)
- (split-height-threshold): Doc fix.
-
-2004-05-13 Juanma Barranquero <[email protected]>
-
- * xfaces.c (Ftty_supports_face_attributes_p)
- (Finternal_copy_lisp_face): Fix typo in docstring.
- (Finternal_get_lisp_face_attribute): Fix docstring.
-
-2004-05-12 Jan Dj,Ad(Brv <[email protected]>
-
- * xfns.c (syms_of_xfns): Provide x-toolkit also for GTK.
-
-2004-05-11 Steven Tamm <[email protected]>
-
- * macfns.c (Fx_create_frame): Default to using tool-bar by
- setting tool-bar-lines to 1 in default-frame-alist.
-
-2004-05-11 YAMAMOTO Mitsuharu <[email protected]>
-
- * image.c (xpm_scan, xpm_make_color_table_v, xpm_put_color_table_v)
- (xpm_get_color_table_v, xpm_make_color_table_h)
- (xpm_put_color_table_h, xpm_get_color_table_h)
- (xpm_str_to_color_key, xpm_load_image, xpm_load)
- (syms_of_image): Support XPM on Carbon Emacs. Does not
- depend on libXpm, but only supports XPM version 3 without extensions.
-
-2004-05-11 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.c (x_flush, XTframe_up_to_date): Use FRAME_MAC_P
- instead of FRAME_X_P.
-
-2004-05-11 Kim F. Storm <[email protected]>
-
- * process.c (read_process_output): Grow decoding_buf when needed;
- this could cause a crash in allocate_string and compact_small_strings.
-
-2004-04-29 Jim Blandy <[email protected]>
-
- * regex.c (mutually_exclusive_p): In 'case wordbeg', compare op2
- against proper opcode.
-
-2004-05-10 Juanma Barranquero <[email protected]>
-
- * process.c (Fstart_process): Fix docstring.
-
- * charset.c (Fget_unused_iso_final_char): Fix typos in docstring.
- (Fchar_bytes, Fchar_width, Fstring_width, Fchar_direction)
- (Fsplit_char, Fchar_charset): Make argument names match their use
- in docstring.
-
-2004-05-10 Richard M. Stallman <[email protected]>
-
- * print.c (print_preprocess): Use being_printed, loop_count and
- halftail to detect overdeep nesting and cyclic cdr chains.
-
-2004-05-10 Andreas Schwab <[email protected]>
-
- * lisp.h (Fmake_symbolic_link): Declare.
-
- * fileio.c (Frename_file): Remove extra argument in call to
- Fmake_symbolic_link.
-
-2004-05-10 Kim F. Storm <[email protected]>
-
- * xdisp.c (calc_line_height_property): Use string position when
- object is a string.
-
-2004-05-10 Kenichi Handa <[email protected]>
-
- * print.c (temp_output_buffer_setup): Bind inhibit-read-only and
- inhibit-modification-hooks to t temporarily before calling
- Ferase_buffer.
-
- * xfns.c (x_create_tip_frame): Bind inhibit-read-only and
- inhibit-modification-hooks to t temporarily before calling
- Ferase_buffer.
-
- * w32fns.c (x_create_tip_frame): Bind inhibit-read-only and
- inhibit-modification-hooks to t temporarily before calling
- Ferase_buffer.
-
- * fns.c (count_combining): Delete it.
- (concat): Don't check combining bytes.
-
-2004-05-09 Jason Rumney <[email protected]>
-
- * w32fns.c (Vw32_ansi_code_page): New Lisp variable.
- (globals_of_w32fns): Set it.
-
-2004-05-09 Piet van Oostrum <[email protected]>
-
- * data.c (Fquo): Simplify.
-
-2004-05-08 Peter Whaite <[email protected]> (tiny change)
-
- * data.c (Fquo): If any argument is float, do the computation in
- floating point.
-
-2004-05-08 Juanma Barranquero <[email protected]>
-
- * process.c (Fwaiting_for_user_input_p, Fmake_network_process)
- (Fset_process_query_on_exit_flag, Vprocess_adaptive_read_buffering):
- Fix spelling of Emacs on docstring.
- (Fset_process_coding_system, Fprocess_coding_system)
- (Fset_process_filter_multibyte, Fprocess_filter_multibyte_p):
- Make argument names match their use in docstring.
- (Fprocess_id, Fprocess_query_on_exit_flag, Finterrupt_process):
- Fix docstring.
-
- * editfns.c (Finsert_buffer_substring): Make argument names match their
- use in docstring.
-
- * syntax.c (Fmodify_syntax_entry): Fix docstring.
-
-2004-05-07 Steven Tamm <[email protected]>
-
- * macterm.c (mac_check_for_quit_char): Adding BLOCK_INPUT
- around call to ReceiveEvent to avoid certain crashes.
-
-2004-05-07 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.c (mac_draw_line_to_pixmap, XCreatePixmapFromBitmapData)
- (mac_fill_rectangle_to_pixmap, mac_draw_rectangle_to_pixmap)
- (mac_copy_area_to_pixmap, mac_copy_area_with_mask_to_pixmap):
- Save/restore the current graphics port and device handle when
- drawing into an offscreen graphics world.
-
- * image.c [MAC_OS] (XPutPixel, XGetPixel, image_load_qt_1)
- (gif_load): Likewise.
-
-2004-05-07 Juanma Barranquero <[email protected]>
-
- * window.c (Fset_window_buffer): Fix docstring.
-
-2004-05-06 Thien-Thi Nguyen <[email protected]>
-
- * emacs.c (main) [VMS]: Fix var ref.
-
-2004-05-06 Romain Francoise <[email protected]>
-
- * data.c (Fsetq_default): Fix docstring.
-
-2004-05-06 Jason Rumney <[email protected]>
-
- * image.c (Display) [HAVE_NTGUI]: Redefine while loading xpm.h
- to avoid name clash.
-
-2004-05-04 Jan Dj,Ad(Brv <[email protected]>
-
- * fileio.c (barf_or_query_if_file_exists): Use lstat.
- (Frename_file): Handle renaming of symlinks across file systems.
- (Frename_file): Put symlink handling inside #ifdef S_IFLNK.
-
-2004-05-04 Kim F. Storm <[email protected]>
-
- * xdisp.c (Qtotal): New var.
- (syms_of_xdisp): Intern and staticpro it.
- (calc_line_height_property): New arg total. Set it if
- line-spacing property has format (total . VALUE).
- (x_produce_glyphs): Ignore line-spacing if line-height is 0.
- Handle total line-spacing property.
-
-2004-05-03 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (xg_update_scrollbar_pos): Call XClearWindow to clear
- "under" scroll bar when size/position changes.
-
-2004-05-03 Jason Rumney <[email protected]>
-
- * makefile.nt: Remove.
-
-2004-05-02 Eli Zaretskii <[email protected]>
-
- * syntax.h (SET_RAW_SYNTAX_ENTRY, SYNTAX_ENTRY_INT):
- Avoid compiler warnings.
-
- * Makefile.in (region-cache.o): Depend on config.h.
-
-2004-05-02 Romain Francoise <[email protected]>
-
- * indent.c (compute_motion): Save vpos in prev_vpos when dealing
- with continuation lines, too.
-
-2004-05-02 Thien-Thi Nguyen <[email protected]>
-
- * syssignal.h (init_signals): Move decl outside `#ifdef POSIX_SIGNALS'.
-
-2004-05-01 Stefan Monnier <[email protected]>
-
- * xdisp.c (calc_line_height_property): YAILOM (yet another
- int/Lisp_Object mixup).
-
-2004-05-01 Eli Zaretskii <[email protected]>
-
- * msdos.c (top-level): Add "#pragma pack(0)" after <dir.h>, to
- undo bad effect of pack(4) in some versions of system headers.
-
-2004-05-01 Jason Rumney <[email protected]>
-
- * w32term.c (x_draw_hollow_cursor): Sync with xterm.c.
-
-2004-04-30 Kim F. Storm <[email protected]>
-
- * buffer.c (syms_of_buffer) <line-spacing>: Allow float value.
- (syms_of_buffer) <cursor-type>: Doc fix.
-
- * dispextern.h (struct it): Remove member use_default_face.
- Add members override_ascent, override_descent, override_boff.
-
- * xdisp.c (init_iterator): Handle line-spacing float value.
- Initialize override_ascent member.
- (append_space_for_newline): Reset override_ascent.
- Remove use_default_face.
- (calc_line_height_property): New function to calculate value of
- line-height and line-spacing properties. Look at overlays, too.
- Set override_ascent, override_descent, override_boff members when
- using another face than the current face. Float values are now
- relative to the frame default font, by default; accept a cons
- of ratio and face name to specify value relative to a specific face.
- (x_produce_glyphs): Use calc_line_height_property.
- Use override_ascent etc. when set to handle different face heights.
- A negative line-spacing property value is interpreted as a total
- line height, rather than inter-line spacing.
- (note_mouse_highlight): Allocate room for 40 overlays initially.
-
-2004-04-29 Stefan Monnier <[email protected]>
-
- * data.c (Fsubr_name): New fun.
- (syms_of_data): Defsubr it.
-
-2004-04-29 Kim F. Storm <[email protected]>
-
- * xdisp.c (null_glyph_slice): New var.
- (append_glyph, append_composite_glyph, append_stretch_glyph):
- Use it to initialize glyph slice.
-
-2004-04-27 Stefan Monnier <[email protected]>
-
- * xdisp.c (x_produce_glyphs): Fix the proverbial int/Lisp_Object mixup.
- (on_hot_spot_p): Make sure we always return a value.
- (Flookup_image_map): Remove unused var ix and iy.
- (note_mode_line_or_margin_highlight): Remove unused var `image'.
-
-2004-04-27 Eli Zaretskii <[email protected]>
-
- * msdos.c (init_environment): If one of the TMP... environment
- variables is set to a drive letter without a trailing slash,
- append a slash.
-
-2004-04-27 Matthew Mundell <[email protected]>
-
- * editfns.c (lisp_time_argument): Provide externally.
-
- * fileio.c (Fset_file_times): New function.
- (syms_of_fileio): Intern and staticpro it.
-
-2004-04-27 Kim F. Storm <[email protected]>
-
- * xdisp.c (x_produce_glyphs): Fix last change; handle newline in
- header line strings.
-
- * dispextern.h (struct it): New member use_default_face.
-
- * xdisp.c (Qline_height): New variable.
- (syms_of_xdisp): Intern and staticpro it.
- (append_space_for_newline): Partially undo 2004-04-25 change;
- add default_face_p arg, and restore callers.
- Clear it->use_default_face after use.
- (x_produce_glyphs): Set default font for ascii char if
- it->use_default_font is set. Change line-spacing property to set
- just extra line spacing. Handle new line-height property.
-
-2004-04-26 Andreas Schwab <[email protected]>
-
- * print.c (print_object): Print non-ascii characters in bool
- vector representation as octal escapes.
-
- * lisp.h (BOOL_VECTOR_BITS_PER_CHAR): Define.
- * print.c (print_object): Use it instead of BITS_PER_CHAR for
- bool vectors.
- * lread.c (read1): Likewise.
- * alloc.c (Fmake_bool_vector): Likewise.
- * data.c (Faref, Faset): Likewise.
- * fns.c (Fcopy_sequence, concat, internal_equal, Ffillarray)
- (mapcar1): Likewise.
-
-2004-04-26 Steven Tamm <[email protected]>
-
- * lread.c (init_lread): Fix typo in HAVE_CARBON test logic.
-
-2004-04-26 Miles Bader <[email protected]>
-
- * lisp.h (CYCLE_CHECK): Macro moved from xfaces.c.
-
-2004-04-26 Juanma Barranquero <[email protected]>
-
- * buffer.c (Fpop_to_buffer): Fix docstring.
-
-2004-04-26 Steven Tamm <[email protected]>
-
- * lread.c (init_lread): Don't display missing lisp directory
- warnings with Carbon Emacs because self-contained bundled Emacs
- may be built without correct installation path.
-
-2004-04-25 Kim F. Storm <[email protected]>
-
- * macterm.c (x_draw_hollow_cursor): Fix height of box for narrow lines.
-
- * xterm.c (x_draw_hollow_cursor): Fix height of box for narrow lines.
-
- * xdisp.c (append_space_for_newline): Rename from append_space.
- Remove DEFAULT_FACE_P arg; always use current face. Callers changed.
- (x_produce_glyphs): Handle line-spacing property on newline char.
- If value is t, adjust ascent and descent to fit current row height.
- If value is an integer or float, set extra_line_spacing to integer
- value, or to float value x current line height.
-
-2004-04-23 Kenichi Handa <[email protected]>
-
- * fontset.c (Finternal_char_font): If POSITION is nil, return
- font for displaying CH with the default face.
-
-2004-04-23 Juanma Barranquero <[email protected]>
-
- * makefile.w32-in: Add "-*- makefile -*-" mode tag.
-
-2004-04-21 Stefan Monnier <[email protected]>
-
- * lisp.h (XINT) [EXPLICIT_SIGN_EXTEND && !NO_UNION_TYPE]:
- Don't make assumptions about the relative place of i and val.
- (EQ) [!NO_UNION_TYPE]: Don't forget to check the type match as well.
-
-2004-04-21 Kim F. Storm <[email protected]>
-
- * dispextern.h (struct glyph_slice): New struct.
- (struct glyph): New member slice.
- (GLYPH_SLICE_EQUAL_P): New macro.
- (GLYPH_EQUAL_P): Use it.
- (struct glyph_string): New member slice.
- (struct it_slice): New struct.
- (struct it): New member slice, add member to stack too.
- New member constrain_row_ascent_descent_p.
- (image_ascent): Add prototype.
-
- * dispnew.c (buffer_posn_from_coords): Return full image width
- and height even for image slices (posn is relative to full image).
- (marginal_area_string): Adjust x0,y0 for image slice.
-
- * image.c (image_ascent): Add slice arg; calculate ascent for
- image slice (or full image).
-
- * keyboard.c (Fposn_at_x_y, Fposn_at_point): New defuns.
- (syms_of_keyboard): Defsubr them.
-
- * lisp.h (pos_visible_p): Fix prototype.
-
- * macterm.c (x_draw_relief_rect): Add top_p and bot_p args.
- (x_draw_glyph_string_box): Fix call to x_draw_relief_rect.
- (x_draw_image_foreground, x_draw_image_relief)
- (x_draw_image_foreground_1, x_draw_image_glyph_string):
- Draw sliced images.
-
- * w32term.c (w32_draw_relief_rect): Add top_p and bot_p args.
- (x_draw_glyph_string_box): Fix call to x_draw_relief_rect.
- (x_draw_image_foreground, x_draw_image_relief)
- (w32_draw_image_foreground_1, x_draw_image_glyph_string):
- Draw sliced images.
-
- * w32term.h (image_ascent): Remove prototype.
-
- * window.c (Fpos_visible_in_window_p): Return pixel position if
- PARTIALLY arg is non-nil. Simplify. Doc fix.
- (Fwindow_vscroll, Fset_window_vscroll): Add optional PIXEL_P arg
- to return/set vscroll in pixels.
-
- * window.h (Fwindow_vscroll, Fset_window_vscroll): Fix EXFUN.
-
- * xdisp.c (Qslice): New variable.
- (syms_of_xdisp): Intern and staticpro it.
- (pos_visible_p): Return pixel position in new x and y args.
- (init_iterator): Reset it->slice info.
- (handle_display_prop): Parse (slice ...) property.
- (push_it, pop_it): Save/restore slice info.
- (make_cursor_line_fully_visible): Fix 2004-04-14 change. Do not
- force repositioning of tall row if window is vscrolled, as that
- would reset vscroll.
- (append_space): Set it->constrain_row_ascent_descent_p to avoid
- increasing row height if row is non-empty.
- (fill_image_glyph_string): Copy slice info.
- (take_vertical_position_into_account): Simplify.
- (produce_image_glyph): Handle iterator slice info, setup glyph
- slice info. Do not force minimum line height.
- (x_produce_glyphs): If it->constrain_row_ascent_descent_p is set,
- do not increase height (ascent/descent) of non-empty row when
- adding normal character glyph; instead reduce glyph ascent/descent
- appropriately; if row is higher than current glyph, adjust glyph
- descent/ascent to reposition glyph within the existing row.
- Likewise, when char is newline, only set ascent/descent if row is
- currently empty.
- (note_mouse_highlight): Handle hotspots with sliced image.
-
- * xterm.c (x_draw_relief_rect): Add top_p and bot_p args.
- (x_draw_glyph_string_box): Fix call to x_draw_relief_rect.
- (x_draw_image_foreground, x_draw_image_relief)
- (x_draw_image_foreground_1, x_draw_image_glyph_string):
- Draw sliced images.
-
- * xterm.h (image_ascent): Remove prototype.
-
-2004-04-20 Stefan Monnier <[email protected]>
-
- * keymap.c (Fkey_description): Fix the usual int/Lisp_Object mixup.
-
-2004-04-20 John Paul Wallington <[email protected]>
-
- * fns.c (Fassoc, Feql): Fix indentation.
-
- * fontset.c (regularize_fontname): Rename from regulalize_fontname.
-
-2004-04-19 John Paul Wallington <[email protected]>
-
- * fns.c (Feql): New function.
- (syms_of_fns): Defsubr it.
-
-2004-04-18 Jason Rumney <[email protected]>
-
- * w32select.c (Fw32_set_clipboard_data): Get sequence number
- after closing the clipboard.
-
-2004-04-16 Luc Teirlinck <[email protected]>
-
- * buffer.c (Fbuffer_base_buffer): Doc fix.
-
-2004-04-17 Kim F. Storm <[email protected]>
-
- * keymap.c (Fkey_description): Add optional PREFIX arg.
- Combine prefix with KEYS to make up the full key sequence to describe.
- Correlate meta_prefix_char and following (simple) key to describe
- as meta modifier. All callers changed.
- (describe_map): Rename arg `keys' to `prefix'. Remove local
- `elt_prefix' var. Use Fkey_description with prefix instead of
- elt_prefix combined with Fsingle_key_description.
- (describe_vector): Declare static. Replace arg `elt_prefix' with
- `prefix'. Add KEYMAP_P arg. Add local var `elt_prefix'; use it
- if !KEYMAP_P. Use Fkey_description with prefix instead of
- Fsingle_key_description.
-
- * keymap.h (Fkey_description): Fix prototype.
- (describe_vector): Remove prototype.
-
- * xdisp.c (update_overlay_arrows): Fix handling of up_to_date < 0.
-
- * image.c (PNG_BG_COLOR_SHIFT): Remove.
- (png_load): Fix calculation of transparent background color on X
- and W32 platforms.
-
-2004-04-16 Juanma Barranquero <[email protected]>
-
- * xdisp.c (try_scrolling): Make sure `scroll-conservatively' is
- not too large before computing how much to scroll.
-
-2004-04-15 Stefan Monnier <[email protected]>
-
- * dired.c (Ffile_attributes): Don't pass extra nil arg to file-handler.
-
-2004-04-14 Luc Teirlinck <[email protected]>
-
- * fileio.c (Fverify_visited_file_modtime, Fvisited_file_modtime):
- Add hyperlink to Elisp manual to the docstring.
-
-2004-04-14 Stefan Monnier <[email protected]>
-
- * callint.c (fix_command): Use XDCR.
-
-2004-04-14 Nick Roberts <[email protected]>
-
- * window.c (Fget_lru_window): Doc fix.
-
-2004-04-14 Kim F. Storm <[email protected]>
-
- * editfns.c (Fformat): Fix allocation size of precision array.
-
- * dispnew.c (update_window): Only set changed_p if
- scrolling_window actually did scroll.
- (scrolling_window): Only return 1 if we actually did scroll.
-
- * xdisp.c (get_glyph_string_clip_rect): Fix reduction of cursor
- height to glyph height when cursor row is not fully visible.
- (make_cursor_line_fully_visible): Add FORCE_P arg to return
- failure in case row is higher than window. Callers changed.
- (try_scrolling): Fix loop in scrolling if last_line_misfit (from Gerd).
- Try to scroll partially visible, higher-than-window cursor row.
- (redisplay_window): Always try to scroll partially visible,
- higher-than-window cursor row - both initially and again with
- centering_position = 0.
- Clear desired matrix before retrying with centering_position = 0.
-
-2004-04-13 Stefan Monnier <[email protected]>
-
- * syntax.c (scan_lists): Simplify backward string scan.
- Fix off-by-one boundary check for string and comment fences.
-
-2004-04-13 Joe Buehler <[email protected]>
-
- * sheap.c, unexcw.c: New files.
-
-2004-04-12 Luc Teirlinck <[email protected]>
-
- * buffer.c (Fmake_indirect_buffer): Throw an error if the intended
- base buffer has been killed. Correct the error message if the
- base buffer does not exist.
-
-2004-04-12 Joe Buehler <[email protected]>
-
- * s/cygwin.h: Changes for Cygwin unexec() support, changes in
- Cygwin itself. Add support for Xaw3d scrollbars.
-
- * puresize.h: Set up PURE_P() for Cygwin unexec() support.
-
- * lastfile.c: Define my_endbss[] for Cygwin unexec() support.
-
- * gmalloc.c (__default_morecore): Use bss_sbrk(), not __sbrk(),
- before Cygwin unexec.
-
- * Makefile.in: Link changes for Cygwin unexec() support.
-
-2004-04-12 Andreas Schwab <[email protected]>
-
- * buffer.c (Fmake_indirect_buffer): Check that NAME is a string.
-
-2004-04-11 Luc Teirlinck <[email protected]>
-
- * buffer.c (Fgenerate_new_buffer_name): Return NAME argument if
- IGNORE argument equals NAME. Doc fix.
-
-2004-04-11 Masatake YAMATO <[email protected]>
-
- * buffer.c (fix_start_end_in_overlays): Make overlays
- empty if they are backwards.
-
-2004-04-09 Stefan Monnier <[email protected]>
-
- * xfaces.c (face_color_supported_p): Fix compilation without X11.
-
-2004-04-07 Stefan Monnier <[email protected]>
-
- * doc.c (Fsnarf_documentation): Ignore new file name entries.
-
-2004-04-06 Kim F. Storm <[email protected]>
-
- * msdos.c (clear_mouse_face): Only clear mouse highlight if not hidden.
- (dos_rawgetc): Set mouse_face_hidden after clearing highlight.
-
- * w32term.c (w32_read_socket): Set mouse_face_hidden after
- clearing highlight.
-
- * xdisp.c (clear_mouse_face): Only clear mouse highlight if not hidden.
-
- * xterm.c (handle_one_xevent): Set mouse_face_hidden after
- clearing highlight.
-
- * indent.c (vmotion): Do not reserve one column for continuation
- marks on window frames.
-
-2004-04-04 Eli Zaretskii <[email protected]>
-
- * charset.h (SINGLE_BYTE_CHAR_P): Fix macro to avoid warnings
- from GCC.
-
-2004-04-03 Stefan Monnier <[email protected]>
-
- * .gdbinit-union: Remove.
-
- * .gdbinit: Make it work for USE_LSB_TAG and !NO_LISP_UNION.
- (xgetptr, xgetint, xgettype): New funs. Use them everywhere.
- ($nonvalbits): Remove.
- ($valmask): Set it by calling xreload to avoid redundancy.
-
- * emacs.c (gdb_use_union, gdb_use_lsb): New vars.
- (gdb_emacs_intbits): Remove.
-
-2004-03-31 Jan Dj,Ad(Brv <[email protected]>
-
- * data.c (Fbyteorder): Make test work even if unsigned is not 4 bytes.
-
-2004-03-30 Kenichi Handa <[email protected]>
-
- * editfns.c (Fformat): Fix initialization of the array info.
-
-2004-03-30 Kim F. Storm <[email protected]>
-
- * xterm.c (x_mouse_click_focus_ignore_position): New var.
- (syms_of_xterm): DEFVAR_BOOL it.
- (ignore_next_mouse_click_timeout): New var.
- (handle_one_xevent): Clear it on KeyPress, set it on EnterNotify.
- Use it to filter mouse clicks following focus event.
-
-2004-03-29 David Ponce <[email protected]>
-
- * callint.c (Fcall_interactively): Fix last change.
-
-2004-03-28 Stefan Monnier <[email protected]>
-
- * eval.c (Fcommandp): Simplify.
-
- * data.c (Finteractive_form): Rename from Fsubr_interactive_form.
- Extend to handle all kinds of functions.
-
- * lisp.h (Finteractive_form): Declare.
-
- * callint.c (Fcall_interactively): Use it.
-
-2004-03-26 Kim F. Storm <[email protected]>
-
- * xdisp.c (syms_of_xdisp): Include `void-variable' in list_of_error
- to catch errors in calc_pixel_width_or_height during redisplay.
-
-2004-03-26 Masatake YAMATO <[email protected]>
-
- * buffer.c (fix_start_end_in_overlays): Rename fix_overlays_in_range.
-
- * lisp.h (fix_start_end_in_overlays): Likewise.
-
- * insdel.c (adjust_markers_for_insert): Call fix_start_end_in_overlays.
-
- * editfns.c (Ftranspose_regions): Likewise.
-
-2004-03-20 Jan Dj,Ad(Brv <[email protected]>
-
- * xterm.c (handle_one_xevent): Do not pass key press events to GTK.
-
-2004-03-19 Richard M. Stallman <[email protected]>
-
- * s/sol2-6.h: Delete previous change.
-
-2004-03-19 Kim F. Storm <[email protected]>
-
- * xdisp.c (move_it_in_display_line_to): Fix MOVE_TO_POS case when
- to_charpos corresponds to newline in right fringe. Use local
- BUFFER_POS_REACHED_P macro.
-
-2004-03-19 Jan Dj,Ad(Brv <[email protected]>
-
- * xdisp.c (calc_pixel_width_or_height): Add ifdef HAVE_WINDOW_SYSTEM
- to compile on non-window system.
-
-2004-03-19 Kim F. Storm <[email protected]>
-
- * dispextern.h (calc_pixel_width_or_height): Add prototype.
-
- * image.c (Qcenter): Move to xdisp.c.
-
- * xdisp.c (Qcenter): Declare here.
- (syms_of_xdisp): Intern and staticpro it.
- (handle_single_display_prop): Allow space display property on all
- platforms.
- (display_mode_line): Set mode_line_p before displaying line.
- (calc_pixel_width_or_height): Declare extern. Add separate :align-to
- handling. Remove complex cases for fringes and scroll-bars.
- Add left, right, and center alignment positions. Add text (area)
- width/height. Return width or height for image specs.
- (produce_stretch_glyph): Improve handling of :align-to. Is now
- relative to left of text area by default, but other base offsets
- can be specified -- also for text lines.
-
- * term.c (produce_glyphs): Handle IT_STRETCH.
- (produce_stretch_glyph): New function to handle space width and
- align-to display properties on non-window systems.
-
-2004-03-17 Stefan Monnier <[email protected]>
-
- * fileio.c (Fread_file_name): Set completion-ignore-case for
- case-insensitive systems.
-
-2004-03-14 Masatake YAMATO <[email protected]>
-
- * xdisp.c (note_mode_line_or_margin_highlight): Accept HEADER_LINE
- when keymap and cursor are setup.
-
-2004-03-14 Steven Tamm <[email protected]>
-
- * Makefile.in (XMENU_OBJ) [HAVE_CARBON]: Do not include xmenu.o.
-
-2004-03-14 Kim F. Storm <[email protected]>
-
- * dispextern.h (x_find_image_file): Add prototype.
-
- * image.c (x_find_image_file): Make extern.
-
- * xfns.c (x_find_image_file): Remove prototype.
-
-2004-03-13 Eli Zaretskii <[email protected]>
-
- * Makefile.in (XMENU_OBJ): Include xmenu.o if HAVE_MENUS is defined.
-
- * emacs.c (main): Call syms_of_xmenu only if HAVE_MENUS is defined.
-
-2004-03-12 Richard M. Stallman <[email protected]>
-
- * fns.c (internal_equal): New arg PROPS controls comparing
- text properties. All callers changed.
- (Fequal_including_properties): New function.
- (syms_of_fns): defsubr it.
-
-2004-03-12 Kim F. Storm <[email protected]>
-
- Fix image support on MAC. From YAMAMOTO Mitsuharu.
-
- * dispextern.h (XImagePtr, XImagePtr_or_DC): Add typedefs.
- (image_background, image_background_transparent): Fix prototypes.
-
- * image.c (XImagePtr, XImagePtr_or_DC): Move typedefs to dispextern.h.
-
- * macfns.c (x_list_fonts, x_get_font_info, x_load_font)
- (x_query_font, x_find_ccl_program, x_set_window_size)
- (x_make_frame_visible, mac_initialize, XCreatePixmap)
- (XCreatePixmapFromBitmapData, XFreePixmap, XSetForeground)
- (mac_draw_line_to_pixmap): Move prototypes to macterm.h.
-
- * macterm.h (x_list_fonts, x_get_font_info, x_load_font)
- (x_query_font, x_find_ccl_program, x_set_window_size)
- (x_make_frame_visible, mac_initialize, XCreatePixmap)
- (XCreatePixmapFromBitmapData, XFreePixmap, XSetForeground)
- (mac_draw_line_to_pixmap): Add prototypes.
-
-2004-03-12 YAMAMOTO Mitsuharu <[email protected]>
-
- * macterm.c (XTread_socket): Fix mouse click on tool bar.
-
-2004-03-11 Kim F. Storm <[email protected]>
-
- * dispextern.h: Move image related prototypes from xfns.c section
- to image.c. Condition them by HAVE_WINDOW_SYSTEM rather than
- HAVE_X_WINDOWS.
-
- * Makefile.in (XOBJ): Consolidate into one list. Add image.o.
- Move gtkutil.o to new GTK_OBJ list.
- (XMENU_OBJ) [HAVE_MENUS]: Move declaration to proper place.
- (GTK_OBJ) [USE_GTK]: New declaration.
- (obj): Add $(GTK_OBJ) to list.
-
-2004-03-11 Steven Tamm <[email protected]>
-
- * image.c [MAC_OSX]: Include sys/stat.h.
-
- * macfns.c (syms_of_macfns): Remove definitions of things now
- defined in image.c.
-
-2004-03-11 Kim F. Storm <[email protected]>
-
- The following changes consolidates the identical/similar image
- support code previously found in xfns.c, w32fns.c, and macfns.c
- into a new file image.c.
-
- * makefile.w32-in (OBJ1): Add image.o.
- ($(BLD)/image.$(O)): Add dependencies.
-
- * Makefile.in (XOBJ, MAC_OBJ): Add image.o.
- (image.o): Add dependencies.
-
- * image.c: New file with consolidated image support code.
- (COLOR_TABLE_SUPPORT): New define to control whether
- color table support is available (X only).
- (Bitmap_Record): Common name for x_bitmap_record,
- w32_bitmap_record, and mac_bitmap_record.
- (XImagePtr): Common name for pointer to XImage or equivalent.
- (XImagePtr_or_DC): New type to simplify code sharing; equivalent
- to XImagePtr on X+MAC, and to HDC on W32.
- (GET_PIXEL): Wrapper for XGetPixel or equivalent.
- (NO_PIXMAP): Common name for "None" or equivalent.
- (PNG_BG_COLOR_SHIFT): Bits to shift PNG background colors.
- (RGB_PIXEL_COLOR): Common type for an integer "pixel color" value.
- (PIX_MASK_RETAIN, PIX_MASK_DRAW): Portability macros (from macfns.c).
- (FRAME_X_VISUAL, x_defined_color, DefaultDepthOfScreen):
- Define with suitable equivalents on W32 and MAC for code sharing.
- (XDrawLine): Define on MAC for code sharing.
- (Destroy_Image, Free_Pixmap): Wrappers for code sharing.
- (IF_LIB_AVAILABLE): Macro to simplify code sharing.
- (Vx_bitmap_file_path, Vimage_cache_eviction_delay)
- (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
- (x_reference_bitmap, x_create_bitmap_from_data)
- (x_create_bitmap_from_file, x_destroy_bitmap)
- (x_destroy_all_bitmaps, x_create_bitmap_mask)
- (XGetImage, XPutPixel, XGetPixel, XDestroyImage)
- (QCascent, QCmargin, QCrelief, QCconversion, QCcolor_symbols)
- (QCheuristic_mask, QCindex, QCmatrix, QCcolor_adjustment, QCmask)
- (Qlaplace, Qemboss, Qedge_detection, Qheuristic, Qcenter)
- (define_image_type, lookup_image_type, valid_image_p)
- (image_error, enum image_value_type, struct image_keyword)
- (parse_image_spec, image_spec_value, Fimage_size, Fimage_mask_p)
- (make_image, free_image, prepare_image_for_display, image_ascent)
- (four_corners_best, image_background, image_background_transparent)
- (x_clear_image_1, x_clear_image, x_alloc_image_color)
- (make_image_cache, free_image_cache, clear_image_cache)
- (Fclear_image_cache, postprocess_image, lookup_image, cache_image)
- (forall_images_in_image_cache, x_create_x_image_and_pixmap)
- (x_destroy_x_image, x_put_x_image, x_find_image_file, slurp_file)
- (find_image_fsspec, image_load_qt_1, image_load_quicktime)
- (init_image_func_pointer, image_load_quartz2d)
- (struct ct_color, init_color_table, free_color_table)
- (lookup_rgb_color, lookup_pixel_color, colors_in_color_table)
- (cross_disabled_images, x_to_xcolors, x_from_xcolors)
- (x_detect_edges, x_emboss, x_laplace, x_edge_detection)
- (x_disable_image, x_build_heuristic_mask)
- (XBM support, XPM support, PBM support, PNG support, JPEG support)
- (TIFF support, GIF support, Ghostscript support): Consolidate image
- code from xfns.c, w32fns.c, and macfns.c.
- (syms_of_image): Consolidate image related symbol setup here.
- (init_image): Consolidate image related initializations here.
-
- * emacs.c (main) [HAVE_WINDOW_SYSTEM]: Add calls to syms_of_image
- and init_image. Remove call to init_xfns.
-
- * macterm.h (struct mac_bitmap_record): Add file member.
- Not currently used, but simplifies code sharing.
-
- * macfns.c (Vx_bitmap_file_path, Vimage_cache_eviction_delay)
- (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
- (x_reference_bitmap, x_create_bitmap_from_data)
- (x_create_bitmap_from_file, x_destroy_bitmap)
- (x_destroy_all_bitmaps, x_create_bitmap_mask)
- (XGetImage, XPutPixel, XGetPixel, XDestroyImage)
- (QCascent, QCmargin, QCrelief, QCconversion, QCcolor_symbols)
- (QCheuristic_mask, QCindex, QCmatrix, QCcolor_adjustment, QCmask)
- (Qlaplace, Qemboss, Qedge_detection, Qheuristic, Qcenter)
- (define_image_type, lookup_image_type, valid_image_p)
- (image_error, enum image_value_type, struct image_keyword)
- (parse_image_spec, image_spec_value, Fimage_size, Fimage_mask_p)
- (make_image, free_image, prepare_image_for_display, image_ascent)
- (four_corners_best, image_background, image_background_transparent)
- (x_clear_image_1, x_clear_image, x_alloc_image_color)
- (make_image_cache, free_image_cache, clear_image_cache)
- (Fclear_image_cache, postprocess_image, lookup_image, cache_image)
- (forall_images_in_image_cache, x_create_x_image_and_pixmap)
- (x_destroy_x_image, x_put_x_image, x_find_image_file, slurp_file)
- (find_image_fsspec, image_load_qt_1, image_load_quicktime)
- (init_image_func_pointer, image_load_quartz2d)
- (struct ct_color, init_color_table, free_color_table)
- (lookup_rgb_color, lookup_pixel_color, colors_in_color_table)
- (cross_disabled_images, x_to_xcolors, x_from_xcolors)
- (x_detect_edges, x_emboss, x_laplace, x_edge_detection)
- (x_disable_image, x_build_heuristic_mask)
- (XBM support, XPM support, PBM support, PNG support, JPEG support)
- (TIFF support, GIF support, Ghostscript support): Merge with image
- code from xfns.c and macfns.c into image.c.
- (syms_of_xfns): Move image related symbols to image.c.
- (init_external_image_libraries, init_xfns): Remove; initialization
- moved to init_image in image.c.
-
- * w32fns.c (Vx_bitmap_file_path, Vimage_cache_eviction_delay)
- (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
- (x_reference_bitmap, x_create_bitmap_from_data)
- (x_create_bitmap_from_file, x_destroy_bitmap)
- (x_destroy_all_bitmaps, x_create_bitmap_mask)
- (QCascent, QCmargin, QCrelief, QCconversion, QCcolor_symbols)
- (QCheuristic_mask, QCindex, QCmatrix, QCcolor_adjustment, QCmask)
- (Qlaplace, Qemboss, Qedge_detection, Qheuristic, Qcenter)
- (define_image_type, lookup_image_type, valid_image_p)
- (image_error, enum image_value_type, struct image_keyword)
- (parse_image_spec, image_spec_value, Fimage_size, Fimage_mask_p)
- (make_image, free_image, prepare_image_for_display, image_ascent)
- (four_corners_best, image_background, image_background_transparent)
- (x_clear_image_1, x_clear_image, x_alloc_image_color)
- (make_image_cache, free_image_cache, clear_image_cache)
- (Fclear_image_cache, postprocess_image, lookup_image, cache_image)
- (forall_images_in_image_cache, x_create_x_image_and_pixmap)
- (x_destroy_x_image, x_put_x_image, x_find_image_file, slurp_file)
- (struct ct_color, init_color_table, free_color_table)
- (lookup_rgb_color, lookup_pixel_color, colors_in_color_table)
- (cross_disabled_images, x_to_xcolors, x_from_xcolors)
- (x_detect_edges, x_emboss, x_laplace, x_edge_detection)
- (x_disable_image, x_build_heuristic_mask)
- (XBM support, XPM support, PBM support, PNG support, JPEG support)
- (TIFF support, GIF support, Ghostscript support): Merge with image
- code from xfns.c and macfns.c into image.c.
- (syms_of_xfns): Move image related symbols to image.c.
- (init_external_image_libraries, init_xfns): Remove; initialization
- moved to init_image in image.c.
-
- * xfns.c (Vx_bitmap_file_path, Vimage_cache_eviction_delay)
- (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
- (x_reference_bitmap, x_create_bitmap_from_data)
- (x_create_bitmap_from_file, x_destroy_bitmap)
- (x_destroy_all_bitmaps, x_create_bitmap_mask)
- (QCascent, QCmargin, QCrelief, QCconversion, QCcolor_symbols)
- (QCheuristic_mask, QCindex, QCmatrix, QCcolor_adjustment, QCmask)
- (Qlaplace, Qemboss, Qedge_detection, Qheuristic, Qcenter)
- (define_image_type, lookup_image_type, valid_image_p)
- (image_error, enum image_value_type, struct image_keyword)
- (parse_image_spec, image_spec_value, Fimage_size, Fimage_mask_p)
- (make_image, free_image, prepare_image_for_display, image_ascent)
- (four_corners_best, image_background, image_background_transparent)
- (x_clear_image_1, x_clear_image, x_alloc_image_color)
- (make_image_cache, free_image_cache, clear_image_cache)
- (Fclear_image_cache, postprocess_image, lookup_image, cache_image)
- (forall_images_in_image_cache, x_create_x_image_and_pixmap)
- (x_destroy_x_image, x_put_x_image, x_find_image_file, slurp_file)
- (struct ct_color, init_color_table, free_color_table)
- (lookup_rgb_color, lookup_pixel_color, colors_in_color_table)
- (cross_disabled_images, x_to_xcolors, x_from_xcolors)
- (x_detect_edges, x_emboss, x_laplace, x_edge_detection)
- (x_disable_image, x_build_heuristic_mask)
- (XBM support, XPM support, PBM support, PNG support, JPEG support)
- (TIFF support, GIF support, Ghostscript support): Merge with
- w32fns.c and macfns.c image code into image.c.
- (syms_of_xfns): Move image related symbols to image.c.
- (init_xfns): Remove; initialization moved to init_image in image.c.
-
- * lisp.h (syms_of_image, init_image): Add protoypes.
- (init_xfns): Remove prototype.
-
- * dispextern.h (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
- (x_reference_bitmap, x_create_bitmap_from_data)
- (x_create_bitmap_from_file, x_destroy_bitmap)
- (x_create_bitmap_mask): Move prototypes from dispextern.h.
- (gamma_correct) [MAC_OS]: Add prototype.
-
- * xterm.h (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
- (x_reference_bitmap, x_create_bitmap_from_data)
- (x_create_bitmap_from_file, x_destroy_bitmap)
- (x_create_bitmap_mask): Move prototypes to dispextern.h.
-
-2004-03-09 Kenichi Handa <handa@etlken2>
-
- * coding.c (decode_coding_emacs_mule): Handle insufficent source
- correctly.
-
-2004-03-04 Richard M. Stallman <[email protected]>
-
- * s/sol2-6.h (LD_SWITCH_SYSTEM_TEMACS): New definition.
-
- * window.c (Fdisplay_buffer): Doc fix.
-
- * buffer.c (Fpop_to_buffer): Doc fix.
-
-2004-03-03 Kim F. Storm <[email protected]>
-
- * xdisp.c (display_line): Fix call to get_overlay_arrow_glyph_row.
-
-2004-03-02 Stefan Monnier <[email protected]>
-
- * editfns.c (Ftranslate_region): Lisp_Object/int mixup.
-
-2004-03-02 Richard M. Stallman <[email protected]>
-
- * indent.c (compute_motion): Save vpos in prev_vpos, like hpos etc.
-
-2004-03-02 Kenichi Handa <[email protected]>
-
- * doc.c (Fsubstitute_command_keys): Fix counding bytes.
-
-2004-03-02 Kim F. Storm <[email protected]>
-
- * window.h (struct window): New member overlay_arrow_bitmap.
-
- * window.c (make_window): Initialize overlay_arrow_bitmap.
-
- * xdisp.c (Voverlay_arrow_variable_list): New variable to properly
- implement and integrate multiple overlay arrows with redisplay.
- (syms_of_xdisp): DEFVAR_LISP and initialize it.
- (last_arrow_position, last_arrow_string): Replace by properties.
- (Qlast_arrow_position, Qlast_arrow_string)
- (Qoverlay_arrow_string, Qoverlay_arrow_bitmap): New variables.
- (syms_of_xdisp): Intern and staticpro them.
- (overlay_arrow_string_or_property, update_overlay_arrows)
- (overlay_arrow_in_current_buffer_p, overlay_arrows_changed_p)
- (overlay_arrow_at_row): New functions for multiple overlay arrows.
- (redisplay_internal): Use them instead of directly accessing
- Voverlay_arrow_position etc. for multiple overlay arrows.
- (mark_window_display_accurate): Use update_overlay_arrows.
- (try_cursor_movement): Use overlay_arrow_in_current_buffer_p.
- (try_window_id): Use overlay_arrows_changed_p.
- (get_overlay_arrow_glyph_row): Add overlay_arrow_string arg.
- (display_line): Use overlay_arrow_at_row to check multiple
- overlay arrows, and get relevant overlay-arrow-string and
- overlay-arrow-bitmap. Set w->overlay_arrow_bitmap accordingly.
- (produce_image_glyph): Set pixel_width = 0 for fringe bitmap.
- (syms_of_xdisp): Remove last_arrow_position and last_arrow_string.
-
- * fringe.c (draw_fringe_bitmap): Use w->overlay_arrow_bitmap if set.
- (update_window_fringes): Remove unused code.
-
-2004-03-01 Jason Rumney <[email protected]>
-
- * w32term.c (w32_read_socket): Fix last change to ButtonPress handling.
-
-2004-03-01 Juanma Barranquero <[email protected]>
-
- * fringe.c (Fdefine_fringe_bitmap): Fix typo in docstring.
-
- * makefile.w32-in ($(BLD)/fringe.$(O)): Add dependencies.
-
-2004-03-01 Jan Dj,Ad(Brv <[email protected]>
-
- * xfns.c (Fx_display_color_cells): Use number of planes to calculate
- how many colors can be displayed.
-
-2004-03-01 Kenichi Handa <[email protected]>
-
- * editfns.c (Ftranslate_region): Handle multibyte chars in TABLE
- correctly.
-
-2004-02-28 Kim F. Storm <[email protected]>
-
- * dispnew.c (update_window): Update header line also if there are
- no other changes in window (move code after set_cursor label).
-
- * lisp.h (mark_window_display_accurate): Remove prototype.
-
- * window.c (window_loop, Fforce_window_update): Force mode line
- updates by setting prevent_redisplay_optimizations_p and
- update_mode_lines.
-
-2004-02-28 Jan Dj,Ad(Brv <[email protected]>
-
- * xfns.c (x_window): Fix indentation.
-
- * xterm.c (x_calc_absolute_position): Call x_real_positions
- to get WM window sizes and use those to calculate position.
- (x_set_offset): Remove code commented out.
-
-2004-02-28 Miles Bader <[email protected]>
-
- * keyboard.c (adjust_point_for_property): #ifdef-out dodgy xassert.
-
-2004-02-28 Kim F. Storm <[email protected]>
-
- * keyboard.c (kbd_buffer_store_event_hold): New function to store
- an event into kbd fifo, but with special handling of quit event;
- a quit event is saved for later, and further events are discarded
- until the saved quit event has been processed.
- (kbd_buffer_store_event): Use kbd_buffer_store_event_hold.
- (gen_help_event): Store help event in kbd fifo.
- (NREAD_INPUT_EVENTS): Remove.
- (read_avail_input): Adapt to new read_socket_hook interface.
- Remove allocation and initialization of local input_event buffer,
- as read_socket_hook stores events directly in fifo. Allocate and
- initialize local hold_quit event to handle postponed quit event
- (and store it if set by kbd_buffer_store_event_hold).
-
- * keyboard.h (kbd_buffer_store_event_hold): Add prototype.
- (gen_help_event): Fix prototype.
-
- * macterm.c (XTread_socket): Remove bufp_r and
- numcharsp args. Add hold_quit arg.
- Rework to use just one, local, inev input_event. Store inev
- directly in fifo using kbd_buffer_store_event_hold.
-
- * sysdep.c (BUFFER_SIZE_FACTOR): Remove.
- (read_input_waiting): Adapt to new read_socket_hook interface.
- Remove allocation and initialization of local input_event buffer,
- as read_socket_hook stores events directly in fifo. Allocate and
- initialize local hold_quit event to handle postponed quit event
- (and store it if set by kbd_buffer_store_event_hold).
-
- * term.c (read_socket_hook): Fix arg list.
-
- * termhooks.h (read_socket_hook): Fix prototype.
-
- * w32inevt.c (w32_console_read_socket): Remove bufp_r and
- numcharsp args. Add hold_quit arg.
- Rework to use just one, local, inev input_event. Store inev
- directly in fifo using kbd_buffer_store_event_hold.
-
- * w32inevt.h (w32_console_mouse_position): Fix prototype.
-
- * w32term.c (w32_read_socket): Remove bufp_r and numcharsp args.
- Add hold_quit arg. Rework to use just one, local, inev
- input_event. Store inev directly in fifo using
- kbd_buffer_store_event_hold. Update count in one place.
- Postpone call to gen_help_event until inev is stored; use new
- local do_help for this.
- Remove local emacs_event in handing of ButtonPress event; just use
- inev instead (so no reason to copy it later).
-
- * xsmfns.c (x_session_check_input): Remove numchars arg.
-
- * xterm.c (x_focus_changed, x_detect_focus_change):
- Remove numchars arg. Always store event into bufp arg.
- Return nothing. Callers changed accordingly.
- (glyph_rect): Simplify.
- (STORE_KEYSYM_FOR_DEBUG): New macro.
- (SET_SAVED_MENU_EVENT): Use inev instead of bufp, etc.
- (current_bufp, current_numcharsp) [USE_GTK]: Remove.
- (current_hold_quit) [USE_GTK]: Add.
- (event_handler_gdk): Adapt to new handle_one_xevent.
- (handle_one_xevent): Remove bufp_r and numcharsp args.
- Add hold_quit arg. Rework to use just one, local, inev
- input_event. Store inev directly in fifo using
- kbd_buffer_store_event_hold. Update count in one place.
- Postpone call to gen_help_event until inev is stored; use new
- local do_help for this.
- Simplify handling of keysyms (consolidate common code). Fix bug
- where count was updated with nchars instead of nbytes.
- Remove local emacs_event in handing of ButtonPress event; just use
- inev instead (so no reason to copy it later).
- Remove `out' label. Rename label `ret' to `done'; add various
- `goto done' to clarify code flow in deeply nested blocks.
- (x_dispatch_event): Simplify as handle_one_xevent now calls
- kbd_buffer_store_event itself.
- (XTread_socket): Remove bufp_r and numcharsp args. Add hold_quit
- arg. Call handle_one_xevent with new arglist. Store event from
- x_session_check_input in fifo.
- [USE_GTK]: Setup current_hold_quit.
- Decrement handling_signal before unblocking input.
- (x_initialize) [USE_GTK]: Initialize current_count.
-
- * xterm.h (x_session_check_input): Fix prototype.
-
-2004-02-26 YAMAMOTO Mitsuharu <[email protected]>
-
- * s/darwin.h (LD_SWITCH_SYSTEM_TEMACS): Add `-framework QuickTime'.
-
- * dispextern.h [MAC_OSX]: Do not include Carbon/Carbon.h (now in
- macgui.h).
-
- * emacs.c (main) [HAVE_CARBON]: Call init_xfns.
-
- * macgui.h [MAC_OSX]: Include Carbon/Carbon.h.
- (mktime, DEBUG, Z, free, malloc, realloc, max, min)
- (init_process) [MAC_OSX]: Avoid conflicts with Carbon/Carbon.h.
- [!MAC_OSX]: Include QDOffscreen.h and Controls.h.
- (INFINITY) [MAC_OSX]: Avoid conflict with definition in math.h.
- (Bitmap): Remove typedef.
- (Pixmap): Change int to GWorldPtr.
-
- * macmenu.c [MAC_OSX]: Don't include Carbon/Carbon.h (now in macgui.h).
-
- * macterm.h [MAC_OSX]: Don't include Carbon/Carbon.h (now in macgui.h).
- (RED16_FROM_ULONG, GREEN16_FROM_ULONG, BLUE16_FROM_ULONG):
- New #define to extract 16-bit depth color components from unsigned
- long representation.
- (PIX_MASK_DRAW, PIX_MASK_RETAIN): New #define to represent pixel
- colors used for masks.
- (struct mac_display_info): Add color_p. Remove n_cbits.
-
- * macfns.c: Include sys/types.h and sys/stat.h.
- [MAC_OSX]: Do not include Carbon/Carbon.h (now in macgui.h).
- Include QuickTime/QuickTime.h.
- (XCreatePixmap, XCreatePixmapFromBitmapData, XFreePixmap)
- (XSetForeground, mac_draw_line_to_pixmap): Add externs for
- functions defined in macterm.c.
- (XImagePtr): New typedef. Corresponds to XImage * in xfns.c.
- (ZPixmap): New #define for compatibility with xfns.c.
- (XGetImage, XPutPixel, XGetPixel, XDestroyImage)
- (x_create_x_image_and_pixmap, x_destroy_x_image, x_put_x_image)
- (find_image_fsspec, image_load_qt_1, image_load_quicktime):
- New functions.
- (four_corners_best, x_create_x_image_and_pixmap)
- (x_destroy_x_image, unwind_create_frame, x_disable_image)
- (x_edge_detection, init_color_table, colors_in_color_table)
- (lookup_rgb_color, lookup_pixel_color, postprocess_image)
- (x_put_x_image, slurp_file, xbm_scan, xbm_load, xbm_load_image)
- (xbm_image_p, xbm_read_bitmap_data, xbm_file_p, x_to_xcolors)
- (x_from_xcolors, x_detect_edges): New declarations (from xfns.c).
- (mac_color_map_lookup, x_to_mac_color): Fix Lisp_Object/unsigned
- long mixup.
- (mac_defined_color, x_to_x_colors): Use RED16_FROM_ULONG etc.
- (x_decode_color): Don't use n_cbits (in struct mac_display_info).
- (x_set_foreground_color, x_set_cursor_color): Sync with w32fns.c.
- (x_set_cursor_type, Fxw_color_values, valid_image_p)
- (image_value_type, parse_image_spec, image_ascent, x_clear_image)
- (x_alloc_image_color, clear_image_cache, lookup_image)
- (x_find_image_file, xbm_read_bitmap_file_data)
- (enum xbm_keyword_index, xbm_format, xbm_image_p, xbm_scan)
- (xbm_read_bitmap_data, xbm_load, pbm_image_p, pbm_scan_number)
- (enum pbm_keyword_index, pbm_format, enum png_keyword_index)
- (png_format, png_image_p, enum jpeg_keyword_index, jpeg_format)
- (jpeg_image_p, enum tiff_keyword_index, tiff_format, tiff_image_p)
- (enum gif_keyword_index, gif_format, gif_image_p): Sync with xfns.c.
- (x_make_gc): Sync with xfns.c. Enclose unused `border_tile' with
- #if 0.
- (x_free_gcs): Sync with xfns.c. Enclose unused `border_tile' with
- #if 0. Free white_relief.gc and black_relief.gc.
- (unwind_create_frame, x_emboss, x_laplace, x_edge_detection):
- New functions (from xfns.c).
- (Fx_create_frame): Record unwind_create_frame.
- (Fxw_display_color_p): Use dpyinfo->color_p.
- (Fx_display_grayscale_p, Fx_display_planes): Don't use
- dpyinfo->n_cbits.
- (Fx_display_color_cells): Use dpyinfo->n_planes;
- (QCmatrix, QCcolor_adjustment, QCmask, Qemboss, Qedge_detection)
- (Qheuristic, cross_disabled_images, emboss_matrix)
- (laplace_matrix): New variables (from xfns.c).
- (Fimage_size, Fimage_mask_p, four_corners_best, image_background)
- (x_clear_image_1, postprocess_image, slurp_file, xbm_load_image)
- (xbm_file_p, x_to_xcolors, x_from_xcolors, x_detect_edges)
- (image_background_transparent): New function (from xfns.c).
- Use PIX_MASK_DRAW/PIX_MASK_RETAIN.
- (image_load_quicktime): Add declaration.
- [MAC_OSX] (image_load_quartz2d): Likewise.
- [MAC_OSX] (CGImageCreateWithPNGDataProviderProcType): New typedef.
- [MAC_OSX] (MyCGImageCreateWithPNGDataProvider): New variable.
- [MAC_OSX] (init_image_func_pointer, image_load_quartz2d): New funs.
- (xbm_load_image_from_file, x_laplace_read_row)
- (x_laplace_write_row, pbm_read_file): Remove functions.
- [HAVE_XPM] (enum xpm_keyword_index, xpm_format, xpm_image_p)
- (xpm_load): Sync with xfns.c (although XPM is not supported yet).
- (colors_in_color_table): Sync with xfns.c (although not used).
- (lookup_rgb_color): Don't lookup color table. Just do gamma
- correction.
- (COLOR_INTENSITY): New #define (from xfns.c).
- (x_disable_image): New function (from xfns.c).
- Use PIX_MASK_DRAW/PIX_MASK_RETAIN.
- (x_build_heuristic_mask): Sync with xfns.c.
- Use PIX_MASK_DRAW/PIX_MASK_RETAIN.
- (HAVE_PBM): Remove #ifdef.
- (pbm_load): Sync with xfns.c. Set img->width and img->height
- before IMAGE_BACKGROUND.
- (png_image_p, png_load): Don't enclose declarations with #if HAVE_PNG.
- (Qpng, enum png_keyword_index, png_format, png_type, png_image_p):
- Don't enclose with #if HAVE_PNG.
- [!HAVE_PNG] (png_load) [MAC_OSX]: Use image_load_quartz2d if a
- symbol _CGImageCreateWithPNGDataProvider is defined.
- Otherwise use image_load_quicktime.
- [!HAVE_PNG] (png_load) [!MAC_OSX]: Use image_load_quicktime.
- [HAVE_PNG] (png_load): Sync with xfns.c.
- Use PIX_MASK_DRAW/PIX_MASK_RETAIN.
- (jpeg_image_p, jpeg_load): Don't enclose declarations with #if
- HAVE_JPEG.
- (Qjpeg, enum jpeg_keyword_index, jpeg_format, jpeg_type)
- (jpeg_image_p): Don't enclose with #if HAVE_JPEG.
- [!HAVE_JPEG] (jpeg_load) [MAC_OSX]: Use image_load_quartz2d.
- [!HAVE_JPEG] (jpeg_load) [!MAC_OSX]: Use image_load_quicktime.
- [HAVE_JPEG] (jpeg_load): Sync with xfns.c.
- (tiff_image_p, tiff_load): Don't enclose declarations with #if
- HAVE_TIFF.
- (Qtiff, enum tiff_keyword_index, tiff_format, tiff_type)
- (tiff_image_p): Don't enclose with #if HAVE_TIFF.
- [!HAVE_TIFF] (tiff_load): Use image_load_quicktime.
- [HAVE_TIFF] (tiff_error_handler, tiff_warning_handler):
- New functions (from xfns.c).
- [HAVE_TIFF] (tiff_load): Sync with xfns.c.
- (gif_image_p, gif_load): Don't enclose declarations with #if HAVE_GIF.
- (Qgif, enum gif_keyword_index, gif_format, gif_type, gif_image_p):
- Don't enclose with #if HAVE_GIF.
- [!HAVE_GIF] (gif_load): Use Quicktime Movie Toolbox if it is
- animated gif. Otherwise use image_load_quicktime.
- [HAVE_GIF] (gif_lib.h): Temporarily define DrawText as
- gif_DrawText to avoid conflict with QuickdrawText.h.
- [HAVE_GIF] (gif_load): Sync with xfns.c.
- (enum gs_keyword_index, gs_format, gs_image_p, gs_load)
- [HAVE_GHOSTSCRIPT] (x_kill_gs_process): Sync with xfns.c (although
- Ghostscript is not supported yet).
- (syms_of_macfns): Initialize Qemboss, Qedge_detection, Qheuristic,
- QCmatrix, QCcolor_adjustment, and QCmask. Add DEFVAR_BOOL
- cross_disabled_images (from xfns.c). Remove #if 0 for supported
- image types. Remove #if HAVE_JPEG, HAVE_TIFF, HAVE_GIF, and
- HAVE_PNG. Add defsubr for Simage_size and Simage_mask_p.
- (init_xfns): Remove #if HAVE_JPEG, HAVE_TIFF, HAVE_GIF, and
- HAVE_PNG. Call EnterMovies to support animated gifs.
- Call init_image_func_pointer to bind a symbol
- _CGImageCreateWithPNGDataProvider if it is defined.
-
- * macterm.c [MAC_OSX]: Don't include Carbon/Carbon.h (now in macgui.h).
- (x_draw_bar_cursor): Sync declaration with xterm.c.
- (XFreePixmap, mac_draw_rectangle_to_pixmap, mac_copy_area)
- (mac_copy_area_to_pixmap): Implementation with GWorld (offscreen
- graphics).
- (mac_set_forecolor, mac_set_backcolor): Use RED16_FROM_ULONG etc.
- (mac_draw_line_to_pixmap, XCreatePixmap)
- (XCreatePixmapFromBitmapData, mac_fill_rectangle_to_pixmap)
- (mac_copy_area_with_mask, mac_copy_area_with_mask_to_pixmap):
- New functions.
- (mac_draw_bitmap) [TARGET_API_MAC_CARBON]:
- Use GetPortBitMapForCopyBits instead of the cast to Bitmap *.
- Cast bits to char *.
- (reflect_byte): New function (from w32fns.c).
- (mac_create_bitmap_from_bitmap_data): Use it and don't stuff bits
- due to byte alignment.
- (mac_scroll_area) [TARGET_API_MAC_CARBON]:
- Use GetPortBitMapForCopyBits instead of the cast to Bitmap *.
- (XSetForeground): Remove static (now used in macfns.c).
- (HIGHLIGHT_COLOR_DARK_BOOST_LIMIT): New #define (from w32term.c).
- (mac_alloc_lighter_color, x_destroy_window): Sync with w32term.c.
- (x_setup_relief_color, x_setup_relief_colors, x_draw_box_rect)
- (x_draw_glyph_string_box, x_draw_image_foreground)
- (x_draw_image_foreground_1, x_draw_image_glyph_string)
- (x_draw_stretch_glyph_string, x_draw_glyph_string)
- (x_draw_hollow_cursor, x_draw_bar_cursor, mac_draw_window_cursor):
- Sync with xterm.c.
- (x_draw_relief_rect): Sync with xterm.c. Make 1 pixel shorter
- than the xterm.c version when a strictly horizontal or vertical
- line is drawn.
- (XTset_terminal_window): Add static.
- (x_make_frame_visible): Add UNBLOCK_INPUT.
- (x_free_frame_resources): New funcion (from xterm.c).
- (XTread_socket): Call handle_tool_bar_click if mouse up/down event
- occurs in tool bar area.
- (mac_initialize_display_info): Remove dpyinfo->n_cbits.
- Set dpyinfo->color_p. Determine dpyinfo->n_planes using HasDepth.
- Initialize image cache.
- (stricmp, wildstrieq, mac_font_pattern_match, mac_font_match):
- Enclose unused functions with #if 0.
- (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): New variables.
- (decode_mac_font_name): New function to apply code conversions
- from a mac font name to an XLFD font name according to its script code.
- (x_font_name_to_mac_font_name): Apply code conversion from an XLFD
- font name to a mac font name according to REGISTRY and ENCODING fields.
- (init_font_name_table) [TARGET_API_MAC_CARBON]: Don't use a font
- whose name starts with `.'.
- (init_font_name_table): Use decode_mac_font_name. Add both
- jisx0208.1983-sjis and jisx0201.1976-0 entries if the script code
- of a font is smJapanese.
- (mac_do_list_fonts): New function to list fonts that match a given
- pattern.
- (x_list_fonts, XLoadQueryFont): Use it.
- (XLoadQueryFont): Set rbearing field for each variable width
- character to avoid needless redraw.
- (syms_of_macterm): Initialize Qbig5, Qcn_gb, Qsjis, and Qeuc_kr.
-
-2004-02-26 Kim F. Storm <[email protected]>
-
- * keyboard.c (NREAD_INPUT_EVENTS): Temporarily increase to 512
- as read_socket_hook handler on X aborts if buffer is too small
- and W32 handler doesn't always check buffer limit.
-
- * xdisp.c (handle_single_display_prop): Handle left-fringe and
- right-fringe similar to a display margin image. Specifically,
- the characters having the fringe prop are no longer shown, and
- we use IT_IMAGE/next_element_from_image with image_id = -1 to
- do this. Set fringe bitmap face_id in it->face_id.
- (produce_image_glyph): Handle image_id < 0 as "no image" case, but
- still realize it->face (i.e. the fringe bitmap face).
-
-2004-02-25 Miles Bader <[email protected]>
-
- * xdisp.c (check_it): Check string/string_pos consistency.
- (init_iterator): Initialize string-related fields properly.
-
-2004-02-11 Miles Bader <[email protected]>
-
- * xdisp.c (produce_image_glyph): Force negative descents to zero.
-
-2004-02-10 Miles Bader <[email protected]>
-
- * xfns.c (lookup_image): Remove xassert(!interrupt_input_blocked);
- BLOCK_INPUT can be nested, so it doesn't make much sense.
-
-2004-02-24 Michael Mauger <[email protected]>
-
- * w32fns.c (slurp_file, xbm_scan, xbm_load_image)
- (xbm_read_bitmap_data): Use unsigned char for image data.
-
-2004-02-23 Luc Teirlinck <[email protected]>
-
- * abbrev.c (Finsert_abbrev_table_description): Doc fix.
-
-2004-02-22 Jason Rumney <[email protected]>
-
- * w32term.c (w32_draw_fringe_bitmap): Draw overlaid bitmaps
- correctly over other bitmaps.
-
-2004-02-21 Eli Zaretskii <[email protected]>
-
- * emacs.c (USAGE1): Split into two halves.
- (USAGE2): Second half of the old USAGE1.
- (USAGE3): Rename from USAGE2.
- (USAGE4): Rename from USAGE3.
-
-2004-02-21 Juri Linkov <[email protected]>
-
- * emacs.c (USAGE1): Add --no-desktop. Move --display from USAGE2.
- Fix --multibyte. Move --help, --version to USAGE2. Add alias
- --file. Fix -f, -l. Sort options. Untabify.
- (USAGE2): Add -hb. Fix --name, --title. Sort options. Untabify.
-
-2004-02-19 Luc Teirlinck <[email protected]>
-
- * category.c (Fdefine_category, Fcategory_docstring)
- (Fget_unused_category, Fset_category_table)
- (Fcategory_set_mnemonics): Doc fixes.
-
-2004-02-20 Kim F. Storm <[email protected]>
-
- * keyboard.c: Undo 2004-02-16 and 2004-02-17 changes.
- The following changes are relative to the 2004-01-21 revision.
- (NREAD_INPUT_EVENTS): Define as max number of input events to read
- in one call to read_socket_hook. Value is 8.
- (read_avail_input): Separate and rework handling of read_socket_hook
- and non-read_socket_hook cases. Use smaller input_event buffer
- in read_socket_hook case, and repeat if full buffer is read.
- Use new local variable 'discard' to skip input after C-g.
- In non-read_socket_hook case, just use a single input_event, and
- call kbd_buffer_store_event on the fly for each character.
-
-2004-02-19 Stefan Monnier <[email protected]>
-
- * lisp.h (union Lisp_Object): Give a more precise type for `type'.
- Remove unused `gu' alternative.
-
-2004-02-19 Andreas Schwab <[email protected]>
-
- * fringe.c (Fdefine_fringe_bitmap): Use && instead of & to avoid
- warning.
-
-2004-02-18 Kim F. Storm <[email protected]>
-
- * xdisp.c (get_window_cursor_type, display_and_set_cursor):
- Fix last change.
-
-2004-02-17 Kim F. Storm <[email protected]>
-
- * xdisp.c (fast_find_position): Fix return value of new version;
- it was inverted compared to the 21.1 version.
- (get_window_cursor_type): Don't look at glyph if NULL.
- (display_and_set_cursor): Set glyph to NULL if cursor in fringe.
-
- * keyboard.c: Rework previous change; it didn't consider that the
- buf array was allocated on the stack.
- (prev_read): Remove variable.
- (read_avail_input_buf): New static event buffer array.
- (in_read_avail_input): New static variable to handle re-entrancy.
- (read_avail_input): Change buf to pinter to read_avail_input_buf.
- Use in_read_avail_input to handle re-entrance; when re-entered,
- fully initialize and use tmp_buf array instead of read_avail_input_buf.
- Do not initialize read_avail_input_buf in full here; instead assume it
- is always cleared on entry. To ensure that, we clear (just) the
- entries that were used before we return.
- (init_keyboard): Initialize read_avail_input_buf here.
-
-2004-02-16 Jesper Harder <[email protected]>
-
- * cmds.c (Fend_of_line): Doc fix.
-
-2004-02-16 Dmitry Antipov <[email protected]> (tiny change)
-
- * keyboard.c (prev_read): New static variable.
- (read_avail_input): Use it to zero out only those slots in buf[]
- that were used last time we were called.
-
-2004-02-16 Eli Zaretskii <[email protected]>
-
- * Makefile.in (obj): Move fringe.o from here...
- (XOBJ, MAC_OBJ): ...to here.
-
-2004-02-16 Stephen Eglen <[email protected]>
-
- * fringe.c (init_fringe_bitmap): Define j in MAC_OS code.
-
-2004-02-15 Stefan Monnier <[email protected]>
-
- * data.c (Fbyteorder):
- * fringe.c (Fdefine_fringe_bitmap):
- * xdisp.c (handle_single_display_prop):
- * xselect.c (x_handle_dnd_message): Lisp_Object/int mixup.
-
-2004-02-16 Jason Rumney <[email protected]>
-
- * w32term.c (w32_draw_fringe_bitmap): Handle overlay fringe bitmaps.
-
-2004-02-15 Steven Tamm <[email protected]>
-
- * macterm.c (Vmac_emulate_three_button_mouse): New variable for
- controlling emulation of a three button mouse with option and
- command keys.
- (Qreverse, mac_get_enumlated_btn): Handle the emulation.
- (mac_event_to_emacs_modifiers, XTread_socket): Ditto.
-
-2004-02-15 Kim F. Storm <[email protected]>
-
- * buffer.c (syms_of_buffer): Doc fix for indicate-buffer-boundaries.
-
- * fringe.c (init_fringe_bitmap) [MAC_OS, WORDS_BIG_ENDIAN]:
- Perform byte-swapping.
-
-2004-02-14 Kim F. Storm <[email protected]>
-
- * dispextern.h (struct draw_fringe_bitmap_params): Change member
- bits from char to short to facilitate wider bitmaps.
- (struct redisplay_interface): Fix prototype of define_fringe_bitmap
- member.
-
- * fringe.c (struct fringe_bitmap): Change member bits from char to
- short to facilitate 16 bits wide bitmaps. Modify all standard
- bitmaps accordingly.
- (BYTES_PER_BITMAP_ROW, STANDARD_BITMAP_HEIGHT): New macros.
- (FRBITS): Use STANDARD_BITMAP_HEIGHT instead of just sizeof.
- (draw_fringe_bitmap): Ditto.
- (init_fringe_bitmap) [MAC_OS]: Don't bitswap.
- (init_fringe_bitmap) [HAVE_X_WINDOWS]: Enhance bitswapping to
- handle up to 16 bits wide bitmaps.
- (Fdefine_fringe_bitmap): Doc fix. Handle wider bitmaps.
- (Ffringe_bitmaps_at_pos): Add missing arg declarations.
-
- * macterm.c (mac_draw_bitmap): Handle 16 bits wide bitmaps directly.
- (x_draw_fringe_bitmap): Use enhanced mac_draw_bitmap, so we no longer
- need to call mac_create_bitmap_from_bitmap_data and mac_free_bitmap.
-
- * w32term.c (w32_define_fringe_bitmap): Bitmaps are now 16 bits wide,
- so it is no longer necessary to expand them here.
-
- * xterm.c (x_draw_fringe_bitmap): Handle wider bitmaps (max 16 bits).
-
-2004-02-12 Kim F. Storm <[email protected]>
-
- * window.c (Fwindow_fringes): Doc fix.
-
-2004-02-10 Jan Dj,Ad(Brv <[email protected]>
-
- * xselect.c (x_get_foreign_selection): Add new optional parameter
- time_stamp.
- (Fx_get_selection_internal): Ditto, pass time_stamp to
- x_get_foreign_selection.
-
- * data.c (Fbyteorder): New function.
-
-2004-02-09 Jan Dj,Ad(Brv <[email protected]>
-
- * atimer.c: Move include stdio.h to same place as in other files.
-
- * region-cache.c: Ditto.
-
- * sysdep.c: Ditto.
-
- * xfaces.c: Ditto.
-
-2004-02-09 Sam Steingold <[email protected]>
-
- * w32term.c (w32_draw_fringe_bitmap): Fix a typo in the last patch.
-
-2004-02-09 Kim F. Storm <[email protected]>
-
- * fringe.c: New file. Move original fringe related declarations
- and code from dispextern.h and xdisp.c here.
- Rework code to support user defined fringe bitmaps, redefining
- standard bitmaps, ability to overlay user defined bitmap with
- overlay arrow bitmap, and add faces to bitmaps.
- (Voverflow_newline_into_fringe): Declare here.
- (enum fringe_bitmap_align): New enum.
- (..._bits): All bitmaps are now defined without bitswapping; that
- is now done in init_fringe_once (if necessary).
- (standard_bitmaps): New array with specifications for the
- standard fringe bitmaps.
- (fringe_faces): New array.
- (valid_fringe_bitmap_id_p): New function.
- (draw_fringe_bitmap_1): Rename from draw_fringe_bitmap.
- (draw_fringe_bitmap): New function which draws fringe bitmap,
- possibly overlaying bitmap with cursor in right fringe or the
- overlay arrow in the left fringe.
- (update_window_fringes): Do not handle overlay arrow here.
- Compare and copy fringe bitmap faces.
- (init_fringe_bitmap): New function.
- (Fdefine_fringe_bitmap, Fdestroy_fringe_bitmap): New DEFUNs to
- define and destroy user defined fringe bitmaps.
- (Fset_fringe_bitmap_face): New DEFUN to set face for a fringe bitmap.
- (Ffringe_bitmaps_at_pos): New DEFUN to read current fringe bitmaps.
- (syms_of_fringe): New function. Defsubr new DEFUNs.
- DEFVAR_LISP Voverflow_newline_into_fringe.
- (init_fringe_once, init_fringe): New functions.
- (w32_init_fringe, w32_reset_fringes) [WINDOWS_NT]: New functions.
-
- * Makefile.in (obj): Add fringe.o.
- (fringe.o): New dependencies.
-
- * dispextern.h (FRINGE_ID_BITS): New definition for number of
- bits allocated to hold a fringe number. Increase number of bits
- from 4 to 8 to allow user defined fringe bitmaps.
- (struct glyph_row, struct it): New members left_user_fringe_bitmap,
- left_user_fringe_face_id, right_user_fringe_bitmap,
- right_user_fringe_face_id.
- (enum fringe_bitmap_type, struct fringe_bitmap, fringe_bitmaps):
- Move to new file fringe.c.
- (MAX_FRINGE_BITMAPS): Define here.
- (struct draw_fringe_bitmap_params): New members bits, cursor_p,
- and overlay_p. Change member which to int.
- (struct redisplay_interface): New members define_fringe_bitmap
- and destroy_fringe_bitmap.
- (valid_fringe_bitmap_id_p): Add prototype.
- (w32_init_fringe, w32_reset_fringes) [WINDOWS_NT]: Add prototypes.
-
- * dispnew.c (row_equal_p): Compare fringe bitmap faces and overlay
- arrows.
- (update_frame): Do flush_display if force_flush_display_p to
- ensure display (specifically fringes) are updated in a timely
- manner when resizing the frame by dragging the mouse.
- (update_window_line): Update row if overlay arrow changed.
- (scrolling_window): Redraw fringe bitmaps if fringe bitmap faces
- or overlay arrow changed.
-
- * emacs.c (main) [HAVE_WINDOW_SYSTEM]: Call init_fringe_once,
- syms_of_fringe, and init_fringe.
-
- * frame.h (struct frame): New member force_flush_display_p.
-
- * lisp.h (syms_of_fringe, init_fringe, init_fringe_once):
- Add prototypes.
-
- * macterm.c (mac_draw_bitmap): Add overlay_p arg.
- (x_draw_fringe_bitmap): Handle overlayed fringe bitmaps;
- thanks to YAMAMOTO Mitsuharu for advice on how to do this.
- Use cursor color for displaying cursor in fringe.
- (x_redisplay_interface): Add null handlers for
- define_fringe_bitmap and destroy_fringe_bitmap functions.
-
- * w32term.c (w32_draw_fringe_bitmap): Copy unadapted code from
- xterm.c to handle overlayed fringe bitmaps and to use cursor color
- for displaying cursor in fringe.
- (w32_define_fringe_bitmap, w32_destroy_fringe_bitmap): New W32
- specific functions to define and destroy fringe bitmaps in fringe_bmp.
- (w32_redisplay_interface): Add them to redisplay_interface.
- (w32_term_init): Call w32_init_fringe instead of explicitly
- defining fringe bitmaps in fringe_bmp array.
- (x_delete_display): Call w32_reset_fringes instead of explicitly
- destroying fringe bitmaps in fringe_bmp array.
-
- * xdisp.c (Voverflow_newline_into_fringe, syms_of_xdisp)
- (left_bits, right_bits, up_arrow_bits, down_arrow_bits)
- (continued_bits, continuation_bits, ov_bits, first_line_bits)
- (last_line_bits, filled_box_cursor_bits, hollow_box_cursor_bits)
- (bar_cursor_bits, hbar_cursor_bits, zv_bits, hollow_square_bits)
- (fringe_bitmaps, draw_fringe_bitmap, draw_row_fringe_bitmaps)
- (draw_window_fringes, compute_fringe_widths, update_window_fringes):
- Move fringe handling vars and code to new file fringe.c.
- (handle_display_prop): Handle left-fringe and right-fringe
- display properties; store user fringe bitmaps in iterator.
- (move_it_in_display_line_to): Handle cursor in fringe at eob.
- (clear_garbaged_frames): Set force_flush_display_p if resized.
- (redisplay_window): Redraw fringe bitmaps if not just_this_one_p.
- (display_line): Handle cursor in fringe at eob.
- (display_line): Set row user fringe bitmaps from iterator.
-
- * xterm.c (x_draw_fringe_bitmap): Handle overlayed fringe bitmaps.
- Use cursor color for displaying cursor in fringe.
- (x_redisplay_interface): Add null handlers for
- define_fringe_bitmap and destroy_fringe_bitmap functions.
-
-2004-02-07 Jan Dj,Ad(Brv <[email protected]>
-
- * macfns.c (Fx_change_window_property): Make doc string and
- parameters same as for X version.
-
- * w32fns.c (Fx_change_window_property): Ditto.
-
-2004-02-07 Kim F. Storm <[email protected]>
-
- * xdisp.c (hscroll_window_tree): Position cursor near to right
- margin in hscrolled window when jumping to end of line (rather
- than centering cursor).
-
- * process.c (wait_reading_process_input): Don't do adaptive read
- buffering if waiting for a specific process.
-
-2004-02-05 Luc Teirlinck <[email protected]>
-
- * minibuf.c (Fminibufferp, Fread_from_minibuffer)
- (Fread_minibuffer, Feval_minibuffer)
- (Fread_string, Fread_no_blanks_input)
- (Fcompleting_read): Doc fixes.
- (syms_of_minibuf): Doc fixes for minibuffer-completion-table and
- completion-regexp-list. Define Qcase_fold_search and staticpro it.
- (read_minibuf): Fix initial comment.
- (Ftry_completion, Fall_completions, Ftest_completion): Bind
- case-fold-search to the value of completion-ignore-case when
- checking completion-regexp-list.
- (Fdisplay_completion_list): Make it handle arguments that are
- symbols. Doc fix.
-
-2004-02-05 Jan Dj,Ad(Brv <[email protected]>
-
- * xterm.h: Add declaration of free_frame_menubar.
-
- * xfns.c (x_create_bitmap_mask): Removed unused variable depth.
- (x_set_menu_bar_lines): Added ! defined USE_GTK for olines.
- (Fx_change_window_property): Add declaration of parameters type and
- format. Remove unused variable cons.
-
- * xselect.c: Include stdio.h.
-
-2004-02-05 Kenichi Handa <[email protected]>
-
- * fns.c (Fset_char_table_range): Fix previous change.
-
- * buffer.c (Fset_buffer_multibyte): Fix docstring.
-
-2004-02-04 Luc Teirlinck <[email protected]>
-
- * editfns.c (Fchar_after, Fchar_before): Doc fixes.
-
-2004-02-04 Stefan Monnier <[email protected]>
-
- * keymap.c (Vmouse_events): Rename from Vmenu_events.
- (syms_of_keymap): Add mouse-[45], header-line, and mode-line to it.
-
-2004-02-04 Kenichi Handa <[email protected]>
-
- * fns.c (Fset_char_table_range): Handle charsets ascii,
- eight-bit-control, and eight-bit-graphic correctly.
-
-2004-02-03 Jason Rumney <[email protected]>
-
- * w32select.c (Fw32_set_clipboard_data): Make coding iso2022 safe.
-
- * w32fns.c (x_to_w32_font): Likewise.
-
-2004-02-03 Jan Dj,Ad(Brv <[email protected]>
-
- * xterm.h: Add x_handle_dnd_message, x_check_property_data,
- x_fill_property_data, x_property_data_to_lisp and check_x_display_info.
-
- * xterm.c (handle_one_xevent): Call x_handle_dnd_message for
- ClientMessages.
-
- * xselect.c: Include termhooks.h and X11/Xproto.h.
- (x_check_property_data, x_fill_property_data)
- (x_property_data_to_lisp, mouse_position_for_drop)
- (Fx_get_atom_name, x_handle_dnd_message): New functions for DND support.
- (Fx_send_client_event): Move here from xfns.c.
- (syms_of_xselect): Add Sx_get_atom_name and Sx_send_client_message.
-
- * xfns.c (x-send-client-message): Move to xselect.c.
- (Fx_change_window_property): Add optional arguments TYPE, FORMAT and
- OUTER_P.
- (Fx_window_property): Add optional arguments TYPE, SOURCE, DELETE_P,
- VECTOR_RET_P. Handle AnyPropertyType. Call x_property_data_to_lisp
- if vector_ret_p is true.
- (syms_of_xfns): Sx_send_client_message moved to xselect.c.
-
-2004-02-02 Eli Zaretskii <[email protected]>
-
- * fileio.c (Fcopy_file): If NEWNAME is a directory, expand the
- basename of FILE relative to it, not FILE itself.
-
-2004-02-02 Kenichi Handa <[email protected]>
-
- * coding.c (coding_restore_composition): Check invalid
- composition data more rigidly.
-
-2004-01-30 Luc Teirlinck <[email protected]>
-
- * fileio.c (Fread_file_name_internal): Correctly handle the case
- where insert-default-directory is nil.
- (Fread_file_name): Always return an empty string if the user exits
- with an empty minibuffer. Adapt the docstring accordingly.
- (syms_of_fileio): Adapt the docstring of insert-default-directory
- to the change in Fread_file_name.
-
-2004-01-29 Eli Zaretskii <[email protected]>
-
- * alloca.c [!alloca]: Fix the prototype for xfree.
-
-2004-01-29 Kenichi Handa <[email protected]>
-
- * fns.c (string_char_to_byte): Optimize for ASCII only string.
- (string_byte_to_char): Likewise.
-
-2004-01-28 Peter Runestig <[email protected]>
-
- * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
-
-2004-01-27 Steven Tamm <[email protected]>
-
- * unexmacosx.c (unexec_copy): Do not copy more than was
- requested to prevent overwriting during unexec.
-
-2004-01-27 Jan Dj,Ad(Brv <[email protected]>
-
- * process.c (sigchld_handler): Add comment about not calling malloc.
-
- * process.h: Add extern to synch_process_termsig.
-
-2004-01-27 Steven Tamm <[email protected]>
-
- * macterm.c (make_mac_frame, make_mac_terminal_frame):
- Move setting of scroll bars from make_mac_frame to
- make_mac_terminal_frame to prevent clobbering of scroll-bar-mode.
-
-2004-01-26 Richard M. Stallman <[email protected]>
-
- * search.c (Freplace_match): Handle nonexistent
- back-references properly.
-
-2004-01-03 Richard M. Stallman <[email protected]>
-
- * window.c (decode_any_window): New function.
- (Fwindow_height, Fwindow_width, Fwindow_edges)
- (Fwindow_pixel_edges, Fwindow_inside_edges)
- (Fwindow_inside_pixel_edges): Use decode_any_window.
-
-2004-01-27 Jan Dj,Ad(Brv <[email protected]>
-
- * process.h: synch_process_termsig new variable.
-
- * callproc.c: Define synch_process_termsig.
- (Fcall_process): Initiate synch_process_termsig to zero and
- check if non-zero and get signal name after subprocess has ended.
-
- * process.c (sigchld_handler): Set synch_process_termsig
- if terminated by a signal. synch_process_death setting removed.
-
- * sysdep.c (mkdir, rmdir): Also check synch_process_termsig.
-
-2004-01-26 Andreas Schwab <[email protected]>
-
- * print.c (print_preprocess): Declare size as EMACS_INT to not
- lose bits.
- (print_object): Likewise.
- * alloc.c (Fpurecopy): Likewise.
-
-2004-01-25 Luc Teirlinck <[email protected]>
-
- * window.c (Fwindow_minibuffer_p): Doc fix.
-
-2004-01-24 Jonathan Yavner <[email protected]>
-
- * editfns.c (Fformat): Make both passes accept the same set of flags.
-
-2004-01-23 Kenichi Handa <[email protected]>
-
- * fns.c (Fmd5): If OBJECT is a buffer different from the current
- one, set buffer to OBJECT temporarily.
-
-2004-01-21 Stefan Monnier <[email protected]>
-
- * keyboard.c (kbd_buffer_gcpro): Remove.
- (kbd_buffer_store_event, clear_event, Fdiscard_input)
- (stuff_buffered_input, init_keyboard, syms_of_keyboard):
- Don't initialize and/or maintain the variable any more. It was made
- redundant by my commit of 2003-06-15.
-
- * lisp.h [USE_LSB_TAG && !DECL_ALIGN]: Signal an error.
-
-2004-01-21 Jan Dj,Ad(Brv <[email protected]>
-
- * lisp.h: Add undef DECL_ALIGN.
-
-2004-01-21 Stefan Monnier <[email protected]>
-
- * process.c (wait_reading_process_input) [SYNC_INPUT]:
- Check interrupt_input_pending explicitly.
-
- * lisp.h (QUIT) [SYNC_INPUT]: Check interrupt_input_pending as well.
-
- * keyboard.c (handle_async_input): New fun,
- extracted from input_available_signal.
- (input_available_signal, reinvoke_input_signal): Use it.
-
-2004-01-20 Stefan Monnier <[email protected]>
-
- * buffer.c (buffer_defaults, buffer_local_symbols): Use DECL_ALIGN.
-
- * lisp.h [USE_LSB_TAG]: Add definitions for Lisp_Object value
- manipulation macros for when tags are in the lower bits.
- (struct Lisp_Free) [USE_LSB_TAG]: Add padding.
- (DECL_ALIGN): New macro.
- (DEFUN): Use it.
-
- * lisp.h [ENABLE_CHECKING]: Don't force union type.
-
- * s/darwin.h (__attribute__): Remove outdated workaround.
-
- * macterm.c (main) [USE_LSB_TAG]: Don't range check the ram.
-
- * alloc.c (lisp_malloc, lisp_align_malloc) [USE_LSB_TAG]:
- Don't check range of malloc address.
- (pure_alloc) [USE_LSB_TAG]: Enforce alignment.
-
- * process.c (wait_reading_process_input): Lisp_Object/int mixup.
-
- * dired.c (Ffile_attributes): Lisp_Object/int mixup.
-
-2004-01-19 Kenichi Handa <[email protected]>
-
- * fontset.c (fontset_font_pattern): Fix previous change.
-
-2004-01-16 Miles Bader <[email protected]>
-
- * xdisp.c (Voverflow_newline_into_fringe)
- (move_it_in_display_line_to, redisplay_internal)
- (update_window_fringes, redisplay_window, display_line, window):
- Add `#ifdef HAVE_WINDOW_SYSTEM' around fringe-drawing stuff, so
- that it compiles without a window-system.
- * dispnew.c (direct_output_for_insert, update_window): Likewise.
-
-2004-01-16 Kim F. Storm <[email protected]>
-
- * buffer.h (struct buffer): New member indicate_buffer_boundaries.
-
- * buffer.c (init_buffer_once): Set buffer_defaults and
- buffer_local_flags for indicate_buffer_boundaries.
- (syms_of_buffer): Defvar_per_buffer it, and defvar_lisp_nopro
- default- variable for it.
-
- * dispextern.h (struct glyph_row): New members left_fringe_bitmap,
- right_fringe_bitmap, redraw_fringe_bitmaps_p for new fringe handling.
- New members exact_window_width_line_p and cursor_in_fringe_p for
- overflowing newlines into right fringe.
- New members indicate_bob_p, indicate_top_line_p, indicate_eob_p,
- and indicate_bottom_line_p for buffer boundaries and scrolling.
- (enum fringe_bitmap_type): Add UP_ARROW_BITMAP, DOWN_ARROW_BITMAP,
- FIRST_LINE_BITMAP, LAST_LINE_BITMAP, FILLED_BOX_CURSOR_BITMAP,
- HOLLOW_BOX_CURSOR_BITMAP, BAR_CURSOR_BITMAP, HBAR_CURSOR_BITMAP,
- and HOLLOW_SQUARE_BITMAP.
- (draw_fringe_bitmap, draw_window_fringes, update_window_fringes):
- Add prototypes.
-
- * dispnew.c (row_equal_p, update_window_line): Compare fringe bitmaps
- instead of related indicator fields.
- Compare exact_window_width_line_p and cursor_in_mouse_face_p indicators.
- (direct_output_for_insert): Handle exact width lines like
- contined lines. Call update_window_fringes.
- (update_window): Call update_window_fringes.
- (scrolling_window): Don't skip desired rows with changed bitmaps.
- Check if fringe bitmaps changes when assigning scrolled rows.
-
- * xdisp.c (Voverflow_newline_into_fringe): New variable.
- (IT_OVERFLOW_NEWLINE_INTO_FRINGE): New macro.
- (move_it_in_display_line_to): Overflow newline into fringe for
- rows that are exactly as wide as the window.
- (up_arrow_bits, down_arrow_bits, first_line_bits, last_line_bits)
- (filled_box_cursor_bits, hollow_box_cursor_bits, bar_cursor_bits)
- (hbar_cursor_bits, hollow_square_bits): New fringe bitmaps.
- (fringe_bitmaps): Add new bitmaps.
- (draw_fringe_bitmap): Make extern. Remove WHICH arg.
- Select proper bitmap for cursor in fringe when appropriate.
- Handle alignment of bitmap to top or bottom of row.
- (draw_row_fringe_bitmaps): Don't select bitmaps here; that is now
- done by update_window_fringes.
- (update_window_fringes, draw_window_fringes): New functions.
- (redisplay_internal): Call update_window_fringes in case only
- cursor row is updated.
- (redisplay_window): Call update_window_fringes.
- Explicitly call draw_window_fringes if redisplay was done using
- the current matrix or the overlay arrow is in the window.
- (try_window_reusing_current_matrix): Mark scrolled rows for
- fringe update (to update buffer-boundaries / scrolling icons).
- (find_last_unchanged_at_beg_row): Handle exact width lines line
- continued lines.
- (display_line): Overflow newline into fringe for rows that are
- exactly as wide as the window. Don't append space for newline
- in this case.
- (notice_overwritten_cursor): Explicitly clear cursor bitmap
- in fringe as if it had been overwritten.
- (erase_phys_cursor): Erase cursor bitmap in fringe.
- (syms_of_xdisp): Mark show-trailing-whitespace and
- void-text-area-pointer as user options.
- DEFVAR_LISP Voverflow_newline_into_fringe. Enable by default.
-
- * xterm.c (x_update_window_end): Call draw_window_fringes.
- (x_after_update_window_line): Just set redraw_fringe_bitmaps_p
- in row instead of actually drawing fringe bitmaps.
- (x_draw_fringe_bitmap): Handle bottom aligned bitmaps.
- (x_draw_window_cursor): Draw cursor in fringe.
-
- * w32term.c (x_update_window_end): Call draw_window_fringes.
- (x_after_update_window_line): Just set redraw_fringe_bitmaps_p
- in row instead of actually drawing fringe bitmaps.
- (w32_draw_fringe_bitmap): Handle bottom aligned bitmaps.
- (w32_draw_window_cursor): Draw cursor in fringe.
-
- * macterm.c (x_update_window_end): Call draw_window_fringes.
- (x_after_update_window_line): Just set redraw_fringe_bitmaps_p
- in row instead of actually drawing fringe bitmaps.
- (x_draw_fringe_bitmap): Handle bottom aligned bitmaps.
- (mac_draw_window_cursor): Draw cursor in fringe.
-
-2004-01-16 Jan Dj,Ad(Brv <[email protected]>
-
- * xterm.c (handle_one_xevent): Don't handle characters that are part
- of an old style (XLookupString) compose sequence.
-
-2004-01-15 Kenichi Handa <[email protected]>
-
- * search.c (Freplace_match): Use make_multibyte_string or
- make_unibyte_string according to the buffer multibyteness.
-
-2004-01-14 Stefan Monnier <[email protected]>
-
- * alloc.c (struct interval_block, struct string_block)
- (struct symbol_block, struct marker_block, live_string_p)
- (live_cons_p, live_symbol_p, live_float_p, live_misc_p):
- Better preserve alignment for objects in blocks.
- (FLOAT_BLOCK_SIZE): Adjust for possible alignment padding.
-
- * lread.c (defvar_per_buffer): Remove dead declaration.
-
- * macterm.c (do_check_ram_size): Don't hardcode the lisp address
- space size.
-
-2004-01-12 Jan Dj,Ad(Brv <[email protected]>
-
- * xmenu.c (popup_get_selection): Check new parameter down_on_keypress
- if a key press should pop down. Only pop down if a key is pressed
- outside the menu/dialog.
- (create_and_show_popup_menu): Pass 0 for down_on_keypress to
- popup_get_selection.
- (create_and_show_dialog): Pass 1 for down_on_keypress to
- popup_get_selection.
-
-2004-01-11 Jan Dj,Ad(Brv <[email protected]>
-
- * alloc.c (allocate_vectorlike): Surround calls to mallopt with
- BLOCK/UNBLOCK_INPUT.
-
-2004-01-08 Jan Dj,Ad(Brv <[email protected]>
-
- * xmenu.c (Fx_popup_dialog): Add an Ok button if no buttons are
- specified.
-
-2004-01-08 Kenichi Handa <[email protected]>
-
- * editfns.c (Fformat): Fix '&' to '&&'.
-
-2004-01-08 Andreas Schwab <[email protected]>
-
- * print.c (print_preprocess) <case Lisp_Vectorlike>: Only mask
- size if PSEUDOVECTOR_FLAG is set.
-
-2004-01-07 Kenichi Handa <[email protected]>
-
- * charset.c (Fdeclare_equiv_charset): Fix docstring.
-
- * fontset.c (fontset_ref_via_base): Fix previous change.
-
-2004-01-07 Kim F. Storm <[email protected]>
-
- * process.c (read_process_output): Only activate adaptive
- buffering if we read less than 256 bytes at a time.
-
-2004-01-06 Kim F. Storm <[email protected]>
-
- * dispnew.c (buffer_posn_from_coords): Return both buffer/string
- object and image object. Return glyph width and height.
- (mode_line_string, marginal_area_string): Ditto.
-
- * dispextern.h (buffer_posn_from_coords, mode_line_string)
- (marginal_area_string): Fix prototypes.
-
- * keyboard.h (POSN_POSN, POSN_SET_POSN): Rename macros from
- POSN_BUFFER_POSN and POSN_SET_BUFFER_POSN. All uses changed.
- (POSN_INBUFFER_P, POSN_BUFFER_POSN): New macros.
-
- * keyboard.c (make_lispy_position): Use modified mode_line_string,
- buffer_posn_from_coords, and marginal_area_string functions to
- include both string object and image object in the lispy position.
- Also add actual glyph width and height to position.
- (read_key_sequence): Use real buffer position from mouse
- event to find keymap property even when click is in marginal area.
-
- * xdisp.c (note_mode_line_or_margin_highlight): Use modified
- mode_line_string and marginal_area_string functions to handle
- both string object and image object properties.
-
-2004-01-06 Andreas Schwab <[email protected]>
-
- * syntax.c (skip_chars): Treat '-' at end of string as ordinary
- character.
-
-2004-01-02 Andreas Schwab <[email protected]>
-
- * macterm.c (emacs_options, x_initialized, same_x_server):
- Remove unused (and duplicated) definitions.
-
-2004-01-02 Kim F. Storm <[email protected]>
-
- * process.h (struct Lisp_Process): New members for adaptive read
- buffering: adaptive_read_buffering, read_output_delay, and
- read_output_skip.
-
- * process.c (ADAPTIVE_READ_BUFFERING): New conditional.
- (READ_OUTPUT_DELAY_INCREMENT, READ_OUTPUT_DELAY_MAX)
- (READ_OUTPUT_DELAY_MAX_MAX): New constants.
- (process_output_delay_count, process_output_skip): New vars.
- (Vprocess_adaptive_read_buffering): New variable.
- (make_process): Initialize adaptive read buffering members.
- (Fstart_process): Set adaptive_read_buffering member.
- (deactivate_process): Cleanup adaptive read buffering.
- (wait_reading_process_input): Temporarily omit delayed
- subprocesses from the set of file descriptors to read from;
- adjust the select timeout if we skipped any subprocesses.
- (read_process_output): Increase adaptive read buffering delay if
- we read less than a full buffer; reduce delay when we read a
- full buffer.
- (send_process): Simplify using local Lisp_Process var.
- Reset adaptive read buffering delay after write.
- (init_process): Initialize process_output_delay_count and
- process_output_skip.
- (syms_of_process): DEFVAR_LISP Vprocess_adaptive_read_buffering.
-
-2004-01-01 Jason Rumney <[email protected]>
-
- * w32term.c (w32_text_out): Use s->font, for consistency with callers.
-
-2003-12-30 Luc Teirlinck <[email protected]>
-
- * print.c (Ferror_message_string): Add hyperlink in the docstring
- to the definition of `signal' in the Elisp manual.
- * eval.c (Fsignal): Ditto.
-
-2003-12-29 James Clark <[email protected]>
-
- * fns.c (internal_equal): Return t for two NaN arguments.
-
-2003-12-29 Richard M. Stallman <[email protected]>
-
- * data.c (store_symval_forwarding): Handle setting
- default-fill-column, etc., by changing the value in
- buffers that use the default.
-
- * minibuf.c (Fset_minibuffer_window): Doc fix.
-
- * fileio.c (choose_write_coding_system): Ignore auto_saving
- if using the visited file for auto saves.
- (Fwrite_region): Don't update SAVE_MODIFF
- if auto-saving in visited file.
-
-2003-12-29 Kenichi Handa <[email protected]>
-
- * dispextern.h (face_font_available_p): Extern it.
-
- * fontset.c (Voverriding_fontspec_alist): New variable.
- (lookup_overriding_fontspec): New function.
- (fontset_ref_via_base): Call lookup_overriding_fontspec if necessary.
- (fontset_font_pattern): Likewise.
- (regulalize_fontname): New function.
- (Fset_fontset_font): Call regulalize_fontname.
- (Fset_overriding_fontspec_internal): New function.
- (syms_of_fontset): Initialize and staticpro Voverriding_fontspec_alist.
- Defsubr Sset_overriding_fontspec_internal.
-
- * xfaces.c (face_font_available_p): New function.
-
-2003-12-28 Richard M. Stallman <[email protected]>
-
- * buffer.c (Fother_buffer): Don't crash if BUF is nil
- or if its name is nil.
-
- * buffer.c (Fkill_buffer): Don't delete auto-save file
- if it's the same as the visited file.
-
-2003-12-28 Luc Teirlinck <[email protected]>
-
- * coding.c (Fcheck_coding_system): Doc fix.
-
-2003-12-28 Kim F. Storm <[email protected]>
-
- * Makefile.in (eval.o): Depend on dispextern.h.
-
- * dispnew.c (buffer_posn_from_coords): Fix calculation of dy for
- image glyph using image's ascent.
- (mode_line_string): Return image glyph as object clicked on.
- Adjust y0 for image glyph using image's ascent.
-
- * dispextern.h (FACE_ID_BITS, MAX_FACE_ID): New defines.
- (struct glyph): New members, ascent and descent. Used to save
- this glyph's ascent and descent, instead of having.
- (struct glyph): Declare member face_id using FACE_ID_BITS.
- (find_hot_spot): Add prototype.
-
- * keyboard.c (Qimage): Remove extern (now in lisp.h).
- (QCmap): Declare extern.
- (make_lispy_position): When position is inside image hot-spot,
- use hot-spot element's id as posn element.
-
- * lisp.h (IMAGEP): New macro to test for image object type.
- (Qimage): Declare extern.
-
- * macfns.c (Qimage): Remove extern (now in lisp.h).
- (valid_image_p, parse_image_spec): Use IMAGEP macro.
-
- * macterm.c (Qface, Qmouse_face): Remove unused externs.
-
- * w32fns.c (Qimage): Remove extern (now in lisp.h).
- (valid_image_p, parse_image_spec): Use IMAGEP macro.
-
- * w32menu.c (Qmouse_click, Qevent_kind): Remove unused externs.
-
- * w32term.c (Qface, Qmouse_face): Remove unused externs.
-
- * xdisp.c (Qarrow, Qhand, Qtext, Qpointer): New variables for
- pointer types.
- (Qrelative_width, Qalign_to): Remove unused variables.
- (Vvoid_text_area_pointer): Replace Vshow_text_cursor_in_void.
- (QCmap, QCpointer, Qrect, Qcircle, Qpoly): New variables for image
- maps.
- (x_y_to_hpos_vpos): Return glyph relative coordinates through new
- dx and dy args. Remove buffer_only_p arg (always 0). Simplify
- code accordingly.
- (get_glyph_string_clip_rect): Draw cursor using glyph's rather
- than row's ascent and height, to get sensible height on tall rows.
- (build_desired_tool_bar_string): Remove Qimage extern.
- (get_tool_bar_item): Fix call to x_y_to_hpos_vpos.
- (produce_image_glyph): Adjust it.ascent to minimum row ascent if
- image glyph is alone on the last line.
- (append_glyph, append_composite_glyph, produce_image_glyph)
- (append_stretch_glyph): Set glyph's ascent and descent.
- (on_hot_spot_p): New function to check if position is inside an
- rectangular, circular, or polygon-shaped image hot-spot,
- (find_hot_spot): New function to search for image hot-spot.
- (Flookup_image_map): New defun to search for image hot-spot.
- (define_frame_cursor1): New aux function to determine frame
- pointer.
- (note_mode_line_or_margin_highlight, note_mouse_highlight): Handle
- `pointer' text property and :pointer image property to control
- frame pointer shape. Detect image hot-spots for pointer and
- help_echo properties. Use define_frame_cursor1.
- (note_mouse_highlight): Use Vvoid_text_area_pointer.
- (syms_of_xdisp): Defsubr new defun. Intern and staticpro new
- variables. DEFVAR_LISP Vvoid_text_area_pointer instead of
- Vshow_text_cursor_in_void.
-
- * xfaces.c (cache_face): Abort if c->size exceeds MAX_FACE_ID.
-
- * xfns.c (x_set_mouse_color): Remove bogus x_check_errors call.
- (Qimage): Remove extern (now in lisp.h).
- (valid_image_p, parse_image_spec): Use IMAGEP macro.
-
- * xmenu.c (show_help_event): Remove unused code.
-
- * xterm.c (Qface, Qmouse_face): Remove unused externs.
- (x_draw_hollow_cursor): Draw cursor using glyph's rather than
- row's ascent and descent, to get a sensible height on tall rows.
-
-2003-12-25 Luc Teirlinck <[email protected]>
-
- * minibuf.c (Fcompleting_read): Undo previous change.
-
-2003-12-25 Lars Hansen <[email protected]>
-
- * dired.c (Fdirectory_files, Fdirectory_files_and_attributes):
- Arguments GCPRO'ed in call to file name handler.
-
-2003-12-25 Thien-Thi Nguyen <[email protected]>
-
- * termcap.c (tgetst1): Scan for "%pN"; if all
- N are continuous in [1,9], remove all "%pN".
-
-2003-12-24 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (xg_frame_set_char_size): Call x_wm_set_size_hint.
-
- * xfaces.c (lface_fully_specified_p): Take into account that
- MAC OS always have unspecified stipple.
-
-2003-12-24 Thien-Thi Nguyen <[email protected]>
-
- * tparam.c (tparam1): Add handling for `%pN', which
- means use param N for the next substitution.
-
-2003-12-24 Thien-Thi Nguyen <[email protected]>
-
- * xfaces.c (Fcolor_gray_p): Fix omission bug:
- In case `frame' is nil, consult the selected frame.
- (Fcolor_supported_p): Likewise.
-
-2003-12-23 Luc Teirlinck <[email protected]>
-
- * fns.c (Frandom, Fstring_make_multibyte, Fset_char_table_range):
- Doc fixes.
-
- * minibuf.c (read_minibuf): Allow INITIAL to be a cons of a string
- and an integer. Adapt the introductory comment accordingly.
- (Fread_from_minibuffer): Delete code moved into read_minibuf.
- Doc fix.
- (Fread_minibuffer, Fread_no_blanks_input): Adapt to changes in
- read_minibuf.
- (Fcompleting_read): Delete code moved into read_minibuf.
- (Ftest_completion): Make it handle obarrays and hash tables correctly.
-
-2003-12-03 Kenichi Handa <[email protected]>
-
- * coding.c (decode_coding_iso2022): Fix for preserving UTF-8
- encoding sequence.
-
-2003-12-01 Kenichi Handa <[email protected]>
-
- * composite.c (syms_of_composite): Don't make the compostion hash
- table week.
-
-2003-11-30 Luc Teirlinck <[email protected]>
-
- * intervals.h: Add EXFUN for Fget_char_property_and_overlay.
- * textprop.c (Fget_char_property_and_overlay): New function.
- (syms_of_textprop): Defsubr it.
-
-2003-11-29 Jan Dj,Ad(Brv <[email protected]>
-
- * dispnew.c (buffer_posn_from_coords): Add ifdef HAVE_WINDOW_SYSTEM
- to compile on terminal configuration.
-
- * fileio.c (Fread_file_name): Check use_file_dialog also before
- calling Fx_file_dialog.
-
- * fns.c (use_file_dialog): New variable.
- (syms_of_fns): DEFVAR_BOOL use-file-dialog.
-
-2003-11-29 Kim F. Storm <[email protected]>
-
- * msdos.c (Qcursor_type, Qbar, Qhbar): Declare extern.
- (syms_of_msdos): Don't intern and staticpro them.
-
-2003-11-27 Kim F. Storm <[email protected]>
-
- * dispnew.c (buffer_posn_from_coords): Calculate and return pixel
- coordinates relative to glyph at posn. If glyph is an image,
- return that as object at posn. Callers changed.
- (mode_line_string, marginal_area_string): Calculate and return
- pixel coordinates relative to glyph. Callers changed.
-
- * dispextern.h (buffer_posn_from_coords, mode_line_string)
- (marginal_area_string): Fix prototypes.
- (window_box_left_offset, window_box_right_offset): Add prototypes.
-
- * frame.h (get_specified_cursor_type, get_window_cursor_type):
- Remove prototypes.
-
- * keyboard.h (EVENT_CLICK_COUNT, POSN_SCROLLBAR_PART): Fix defines.
-
- * keyboard.c (make_lispy_position): Add x and y coordinates
- relative to the current glyph as 7th element of position.
- If glyph is an image, return it in the object element.
- (read_key_sequence): Skip checks for keymap property in cases
- where POSN_STRING is not a string (e.g. an image).
-
- * xdisp.c (Vdisplay_pixels_per_inch): New variable.
- (Vshow_text_cursor_in_void): New variable.
- (glyph_to_pixel_coords): Don't use negative hpos.
- (x_y_to_hpos_vpos): Fix for partially visible first glyph.
- (append_stretch_glyph): Change ascent arg to be actual value
- in pixels rather than ratio to height. Callers changed.
- (calc_pixel_width_or_height): New aux function, implementing
- pixel based artihmetic for glyph widths and heights.
- (produce_stretch_glyph): Use calc_pixel_width_or_height for
- :width, :height, :align-to, and :ascent, thus allowing these to
- be specified in pixels as well as multiples of characters.
- Don't produce stretch glyphs with zero width or height.
- (get_specified_cursor_type): Declare static.
- (get_window_cursor_type): Declare static. Add glyph arg to be
- able to know when cursor is on an image; always substitute
- hollow-box cursor for filled-box cursor on images, to avoid
- negative images and flicker when blinking the cursor.
- (display_and_set_cursor): Pass glyph to get_window_cursor_type.
- (note_mode_line_or_margin_highlight): Use non-text cursor rather
- than vertical scroll-bar cursor in display margins.
- (note_mouse_highlight): Use non-text cursor rather than text
- cursor in fringes and over images in the text area.
- Use non-text cursor when mouse pointer is outside editable text,
- i.e. in the void after end-of-line or end-of-buffer; this was
- already done for W32, but is now standard for all systems --
- user can toggle show-text-cursor-in-void to get old behaviour.
- (syms_of_xdisp): DEFVAR_LISP Vshow_text_cursor_in_void and
- Vdisplay_pixels_per_inch.
-
-2003-11-25 Andreas Schwab <[email protected]>
-
- * fns.c (internal_equal) <case Lisp_Vectorlike>: Declare size as
- EMACS_INT to not lose bits.
- (Ffillarray): Don't set bits beyond the size of a bool vector.
-
-2003-11-25 Kim F. Storm <[email protected]>
-
- * print.c (Fredirect_debugging_output) [!GNU_LINUX]: Do not
- define this defun on systems that cannot use stderr as lvalue.
-
-2003-11-24 Gerd Moellmann <[email protected]>
-
- * s/freebsd.h (LD_SWITCH_SYSTEM_TEMACS)
- [__FreeBSD_version >= 500042]: Define as -znocombreloc because
- ld's default is incompatible with unexec.
-
-2003-11-23 Kim F. Storm <[email protected]>
-
- * window.c (enum window_loop): Add REDISPLAY_BUFFER_WINDOWS.
- (window_loop): Handle REDISPLAY_BUFFER_WINDOWS.
- (Fforce_window_update): New defun.
- (syms_of_window): Defsubr it.
- (Fset_window_margins, Fset_window_fringes): Doc fix.
-
- * print.c (Fredirect_debugging_output): New defun.
- (syms_of_print): Defsubr it.
-
-2003-11-22 Luc Teirlinck <[email protected]>
-
- * fns.c (Fset_char_table_parent): Doc fix.
-
-2003-11-22 Kim F. Storm <[email protected]>
-
- * dispnew.c (buffer_posn_from_coords): Return actual row/column
- for glyph clicked on, rather than (unused) pixel positions.
- (mode_line_string, marginal_area_string): Change X and Y args to
- pointers for returning actual row/column for glyph clicked on.
- Simplify and optimize loops.
-
- * dispextern.h (mode_line_string, marginal_area_string):
- Update prototypes.
-
- * keyboard.c (make_lispy_position): New function for generating
- mouse click positions from frame and pixel coordinates.
- Enhanced to return buffer position and actual row/column for
- events outside the text area using updated mode_line_string and
- marginal_area_string functions.
- Return left-fringe and right-fringe clicks as such, rather than
- clicks in text area.
- (make_lispy_event) [USE_X_TOOLKIT, USE_GTK]: Don't call
- pixel_to_glyph_coords, as we never use the results.
- (make_lispy_event): Use make_lispy_position for MOUSE_CLICK_EVENT,
- WHEEL_EVENT, and DRAG_N_DROP_EVENT to replace redundant code.
- Eliminate unused code in WHEEL_EVENT handling.
- (make_lispy_movement): Use make_lispy_position.
-
- * window.c (coordinates_in_window): Remove redundant tests.
- Fix returned X pixel value for left-margin.
-
- * xdisp.c (note_mode_line_or_margin_highlight): Adapt to new
- mode_line_string and marginal_area_string parameters.
-
-2003-11-22 Lars Hansen <[email protected]>
-
- * w32.c (struct the_group, getgrgid): Add.
- * mac.c (struct my_group, getgrgid): Add.
-
-2003-11-21 Luc Teirlinck <[email protected]>
-
- * fns.c (Fassq, Fassoc, Frassq, Frassoc): Doc fixes.
-
-2003-11-21 Lars Hansen <[email protected]>
-
- * dired.c (Ffile_attributes): Add parameter ID-FORMAT and
- include in call to file name handler. Optionally translate numeric
- UID and GID to strings. Update docstring.
- (directory_files_internal): Add parameter ID-FORMAT.
- (Fdirectory_files_and_attributes): Add parameter ID-FORMAT and
- include in call to file name handler and call to
- directory_files_internal. Update Docstring.
- (Fdirectory_files): Add dummy parameter in call to
- directory_files_internal.
- * lisp.h (Qinteger): Add.
- (Qinteger_or_floatp, Qinteger_or_float_or_marker_p): Remove.
- (Ffile_attributes): Add parameter.
- * data.c (Qinteger): Export.
-
-2003-11-21 Luc Teirlinck <[email protected]>
-
- * fns.c (Freverse, Fnreverse): Doc fixes.
-
-2003-11-19 Kim F. Storm <[email protected]>
-
- * xdisp.c (init_iterator): Initialize it->start to position
- before reseating (in case start position is invisible).
- (init_to_row_start): Set it->start to row-start.
- (redisplay_window): Accept optional_new_start if start position
- is invisible (in which case IT_CHARPOS overshoots PT).
- (display_line): Setup row->start from it->start (rather than
- it->current which is wrong if first char on line is invisible).
- When done, reseat it->start to it->current (= start of next row).
- (expose_area): Fix exposure of text area when first char (e.g. TAB)
- is only partially visible.
-
- * dispextern.h (struct it): New member start.
-
-2003-11-17 Stefan Monnier <[email protected]>
-
- * alloc.c (make_float, Fcons): Clear the markbit at init time.
- (make_float, Fcons, Fmake_symbol, allocate_misc): Move the increment
- of block_index outside of the macro call.
- (Fgarbage_collect): Remove null code.
-
- * m/amdx86-64.h: Don't redefine XPNTR.
-
- * keyboard.c (parse_modifiers, apply_modifiers): Use INTMASK instead
- of VALMASK.
-
- * fns.c (hashfn_eq, hashfn_eql, hashfn_equal, hash_put)
- (sxhash_string, sxhash): Use INTMASK instead of VALMASK.
- (maybe_resize_hash_table): Use MOST_POSITIVE_FIXNUM.
-
- * lisp.h (VALMASK): Only define for non-union type.
- (MARKBIT): Remove.
- (ARRAY_MARK_FLAG): Use previous value of MARKBIT.
- (XTYPE): Define unconditionally.
- (XSETTYPE): Remove one more remnant.
- (EQ): Define differently for the union and non-union cases.
- (INTMASK): New bit mask.
- (struct Lisp_Marker): Move down to prepare for upcoming patch.
- (GC_EQ): Delegate to EQ.
-
- * coding.c (coding_restore_composition): Lisp_Object/int mixup.
-
-2003-11-17 Jan Dj,Ad(Brv <[email protected]>
-
- * xterm.c (x_window_to_scroll_bar): Move check of display to
- where window_id is compared.
-
-2003-11-17 Kim F. Storm <[email protected]>
-
- * dispextern.h (struct it): New member first_vpos.
-
- * xdisp.c (start_display): Set it->first_vpos.
- (try_window_id): Use first_vpos to start display in first _text_
- line if no reusable lines at start of window with header line.
-
-2003-11-16 Jan Dj,Ad(Brv <[email protected]>
-
- * w32fns.c (XPutPixel):
- * w32bdf.c (w32_init_bdf_font):
- * sunfns.c (sel_read):
- * process.c (Fmake_network_process):
- * frame.c (store_frame_param):
- * fontset.c (Fset_fontset_font):
- * emacs.c (shut_down_emacs):
- * ccl.c (ccl_driver): Remove period at end of error message.
-
- * config.in: Regenerate.
-
- * xfns.c (x_window_to_frame, x_any_window_to_frame)
- (x_non_menubar_window_to_frame, x_menubar_window_to_frame)
- (x_top_window_to_frame): Add Display* argument to xg_win_to_widget.
- (x_create_bitmap_mask, xg_set_icon, create_frame_xic)
- (xic_set_statusarea, x_window, gif_load): Formatting adjustments.
-
- * xterm.h (struct x_display_info): New field xg_cursor for GTK.
-
- * xterm.c: Add Display * to x_window_to_scroll_bar declaration.
- (XTmouse_position, handle_one_xevent): Pass Display* to
- x_window_to_scroll_bar.
- (x_window_to_scroll_bar): Take a Display* argument.
- Check that display for frame is equal to Display* argument.
- (event_handler_gdk): Remove current_dpyinfo. Get dpyinfo from
- x_display_info_for_display instead. Use Display in xev instead
- of GDK_DISPLAY.
- (x_dispatch_event): Call x_display_info_for_display.
- (XTread_socket): Move GTK part out of loop. current_dpyinfo removed.
- (x_connection_closed): Call xg_display_close for GTK.
- (x_term_init): Call xg_display_open for additional displays.
- Initiate dpyinfo->xg_cursor with call to xg_create_default_cursor
- for GTK.
-
- * xmenu.c (single_menu_item, mouse_position_for_popup)
- (x_activate_menubar): Formatting adjustments.
-
- * xdisp.c (update_tool_bar, redisplay_tool_bar): Formatting
- adjustments.
-
- * gtkutil.c (xg_get_gdk_display, xg_set_screen, xg_display_open)
- (xg_display_close, xg_create_default_cursor)
- (xg_get_gdk_pixmap_and_mask): New functions for multiple display
- handling.
- (xg_left_ptr_cursor): Remove.
- (xg_set_cursor): Change cursor to GdkCursor*. Do not create
- cursor here.
- (xg_win_to_widget): Take Display* argument, call
- gdk_xid_table_lookup_for_display.
- (xg_create_frame_widgets, xg_get_file_name, create_menus)
- (xg_create_widget, xg_modify_menubar_widgets): Call xg_set_screen.
- (xg_create_widget, xg_create_scroll_bar): Use xg_cursor
- in FRAME_X_DISPLAY_INFO.
- (xg_get_scroll_id_for_window): Take Display* argument.
- (update_frame_tool_bar): Call xg_get_gdk_pixmap_and_mask.
- (xg_initialize): Remove xg_left_ptr_cursor.
-
- * gtkutil.h (xg_get_scroll_id_for_window, xg_win_to_widget): Add
- Display* argument.
- (xg_display_open, xg_display_close, xg_create_default_cursor): Declare.
-
-2003-11-14 Jan Dj,Ad(Brv <[email protected]>
-
- * xterm.c (x_detect_focus_change): Do not change focus frame for
- Enter/LeaveNotify if the current focus frame has explicit focus.
-
-2003-11-14 Kim F. Storm <[email protected]>
-
- * dispnew.c (update_text_area): Fix redisplay error when hscroll
- is active and first glyph is only partially visible.
-
-2003-11-13 Kenichi Handa <[email protected]>
-
- * xdisp.c (select_frame_for_redisplay): New function.
- (redisplay_internal): Record also selected_frame for
- unwind_redisplay. Call select_frame_for_redisplay before
- redrawing each frame.
- (unwind_redisplay): Argument changed to a cons.
-
-2003-11-12 Luc Teirlinck <[email protected]>
-
- * fns.c (Fstring_to_multibyte): Doc fix.
-
-2003-11-11 Kenichi Handa <[email protected]>
-
- * xterm.c (x_list_fonts): Fix excluding of auto-scaled fonts.
-
-2003-11-09 Jan Dj,Ad(Brv <[email protected]>
-
- * xfns.c (x_window): Set XtNx and XtNy in shell widget for
- program specified positions.
-
-2003-11-08 Jan Dj,Ad(Brv <[email protected]>
-
- * xterm.c (XAW_ARROW_SCROLLBARS): Define it for Xaw 1.5E.
-
-2003-11-08 Kenichi Handa <[email protected]>
-
- * Makefile.in (lisp): Add kannada.el.
- (shortlisp): Likewise.
-
-2003-11-07 Kenichi Handa <[email protected]>
-
- * coding.c (coding_allocate_composition_data):
- Reset coding->composing to COMPOSITION_NO.
- (coding_restore_composition): Detect invalid composition data.
- Give Fstring and Fvector a Lispy integer, not C int.
-
-2003-11-05 Stefan Monnier <[email protected]>
-
- * floatfns.c (Flogb): Don't use VALMASK.
-
- * m/amdx86-64.h (VALBITS, XINT, XUINT): Remove.
- * m/ia64.h (VALBITS, XINT, XUINT): Remove.
-
- * lisp.h (XINT): Move the cast to clarify what is going on.
- (GCTYPEMASK, XSETTYPE): Remove.
- (XGCTYPE): Make it an alias of XTYPE.
-
-2003-11-03 Jan Dj,Ad(Brv <[email protected]>
-
- * xterm.c (x_term_init): Fix formatting.
-
-2003-11-02 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.h (xg_have_tear_offs): Declare.
- (xg_keep_popup, xg_did_tearoff): Remove.
-
- * gtkutil.c: Remove variable xg_did_tearoff.
- (xg_have_tear_offs): New function.
- (tearoff_remove): Just decrease xg_detached_menus.
- (tearoff_activate): Increase xg_detached_menus and call
- tearoff_remove when tearoff is removed.
- (xg_keep_popup): Remove function.
- (create_menus): Give add_tearoff_p as argument to recursive
- call to create_menus.
- (xg_create_widget): Use variables instead of multiple
- strcmp. Tell create_menus to create tear off only for
- menu bar menus.
- (xg_update_menubar): Change title for a detached menu also.
- (xg_modify_menubar_widgets): Always call xg_update_menubar, regardless
- of deep_p.
- (xg_initialize): Initialize xg_detached_menus, remove
- initialization of xg_did_tearoff.
-
- * xmenu.c (set_frame_menubar): For GTK, set deep_p if
- xg_have_tear_offs returns non-zero.
- (create_and_show_popup_menu): Remove setting of xg_did_tearoff and
- call to xg_keep_popup.
-
-2003-11-01 Andrew Choi <[email protected]>
-
- * macterm.c (XTread_socket): Handle menubar selection and grow
- window only for mouseDown events.
-
-2003-10-31 Jan Dj,Ad(Brv <[email protected]>
-
- * xterm.c (x_term_init): For GTK part, increase x_initialized
- to check for more than one display. Use error instead of return 0.
-
-2003-10-31 Andrew Choi <[email protected]>
-
- * unexmacosx.c (unrelocate): New function (contributed by Nozomu Ando).
- (copy_dysymtab): Call it.
-
-2003-10-31 Luc Teirlinck <[email protected]>
-
- * eval.c (Fdefvaralias): Doc fix.
-
-2003-10-26 Luc Teirlinck <[email protected]>
-
- * data.c (Fsetplist): Doc fix.
-
-2003-10-14 Lute Kamstra <[email protected]>
-
- * window.c (Fset_window_fringes): Clarify docstring.
-
-2003-10-14 Kim F. Storm <[email protected]>
-
- * window.c (Fset_window_margins): Simplify arg checking.
-
-2003-10-13 Richard M. Stallman <[email protected]>
-
- * regex.c (MAX_BUF_SIZE): Reduce to 2**15.
- (print_partial_compiled_pattern): Replace assert with a printout.
- (skip_noops, mutually_exclusive_p): Change args, values to re_char *.
-
- * alloc.c (lisp_align_malloc): If BASE is 0, call memory_full.
-
- * window.c (Fset_window_margins): Allow only integers as args.
- (syms_of_window) <special-display-buffer-names,
- special-display-regexps>: Doc fixes.
-
-2003-10-13 Lute Kamstra <[email protected]>
-
- * window.c (Fset_window_fringes): Elaborate docstring.
-
-2003-10-12 Andrew Choi <[email protected]>
-
- * macterm.c (XTread_socket): Call DragWindow only for mouseDown events.
-
- * s/darwin.h (GC_MARK_STACK): Define.
-
-2003-10-12 Jan Dj,Ad(Brv <[email protected]>
-
- * window.c (shrink_windows): New function.
- (size_window): Call shrink_windows to calculate window sizes when
- shrinking frame with more than one window.
-
-2003-10-12 Kim F. Storm <[email protected]>
-
- * xdisp.c (compute_fringe_widths): Doc fix.
-
-2003-10-08 Kenichi Handa <[email protected]>
-
- * coding.c (Fcoding_system_p): Return t for auto-loading coding system.
-
-2003-10-07 Kenichi Handa <[email protected]>
-
- * coding.c (Qcoding_system_define_form): New variable.
- (syms_of_coding): Intern and staticpro it.
- (Fcheck_coding_system): Try to autoload the definition of
- CODING-SYSTEM.
-
-2003-10-05 Luc Teirlinck <[email protected]>
-
- * fns.c (Frequire): Doc fix.
-
-2003-10-05 Jan Dj,Ad(Brv <[email protected]>
-
- * xfns.c (Fx_send_client_event): New function as a base for
- manipulating extended window manager hints.
- (Fx_send_client_event): Remove unused variable s.
-
- * w32term.c (w32_read_socket): Remove call to x_check_fullscreen_move,
- that function is removed.
-
- * xterm.c (x_set_offset): Use move_offset_left/top instead of
- x/y_pixels_outer_diff.
- (x_check_expected_move): Calculate move_offset_left/top.
-
- * xterm.h (struct x_output): New members: move_offset_top/left.
-
- * frame.c (x_set_frame_parameters): Remove x_fullscreen_move,
- call x_set_offset directly.
-
- * frame.h (enum): FULLSCREEN_MOVE_WAIT removed.
-
- * frame.c (Fdelete_frame): Free decode_mode_spec_buffer.
-
- * xterm.c (x_delete_display): Free font names and font_encoder
- in dpyinfo->font_table.
-
- * xfns.c (Fx_close_connection): Only call XFreeFont here.
- Move xfree of font names to x_delete_display.
-
- * xterm.h (struct x_display_info): New member, wm_type.
- (struct x_output): New members, expected_top/left and
- check_expected_move.
-
- * xterm.c (handle_one_xevent): Reset wm_type when ReparentNotify
- is received.
- (handle_one_xevent): Rename x_check_expected_move from
- x_check_fullscreen_move.
- (x_set_offset): Only add WM decoration sizes to modified_top/left
- for X_WMTYPE_A. Set check_expected_move when WM type is unknown.
- (x_check_expected_move): Rename from x_check_fullscreen_move.
- Removed fullscreen specific code. Use check_expected_move,
- expected_left/top instead. Also, set wm_type.
- (x_term_init): Initialize wm_type to unknown.
-
- * frame.c (x_fullscreen_move): Remove addition of WM decoration
- sizes to move_x/y.
-
-2003-10-03 Kenichi Handa <[email protected]>
-
- * macterm.c (x_load_font): Clear all members of FONTP before start
- filling them.
-
-2003-10-02 Kenichi Handa <[email protected]>
-
- * fontset.c (fs_load_font): Don't set fontp->font_encoder to NULL
- before calling find_ccl_program_func. Call find_ccl_program_func
- only when fontp->font_encoder is not NULL.
-
- * xterm.c (x_load_font): Clear all members of FONTP before start
- filling them.
-
-2003-10-03 John Paul Wallington <[email protected]>
-
- * keymap.c (map_keymap): Don't abort when binding is a vector.
-
-2003-10-02 Jason Rumney <[email protected]>
-
- * makefile.w32-in (emacs.o, coding.o, bytecode.o):
- Sync dependencies with Makefile.in.
- (alloca.o): Remove.
-
- * w32fns.c (w32_load_system_font): Clear all members of FONTP before
- filling them.
-
- * w32bdf.c (w32_load_bdf_font): Likewise.
-
-2003-09-30 Richard M. Stallman <[email protected]>
-
- * term.c (set_tty_color_mode): Calculate current_mode_spec
- regardless of value of VAL.
-
- * intervals.c (graft_intervals_into_buffer):
- Set BUF_INTERVALS (buffer)->up_obj when appropriate.
- Handle over_used when splitting UNDER.
-
-2003-09-30 YAMAMOTO Mitsuharu <[email protected]>
-
- * regex.c (regex_compile): Free the stack when returning from function.
-
-2003-09-28 Kenichi Handa <[email protected]>
-
- * fontset.c (Finternal_char_font): Change return value to
- cons (FONT-NAME . GLYPH-CODE).
-
-2003-09-28 Eli Zaretskii <[email protected]>
-
- * term.c (tty_setup_colors): Treat any negative argument as -1.
-
-2003-09-27 Gaute B Strokkenes <[email protected]> (tiny change)
-
- * process.c (send_process): Delete unused temp_buf.
-
-2003-09-26 Dave Love <[email protected]>
-
- * xterm.c (x_bitmap_mask): Declare.
-
-2003-09-25 Dave Love <[email protected]>
-
- * Makefile.in (fns.o): Depend on md5.h.
-
-2003-09-25 Kim F. Storm <[email protected]>
-
- * window.c (set_window_buffer): Fix redisplay problems when
- switching between buffers with different display margin widths.
-
-2003-09-23 Kim F. Storm <[email protected]>
-
- * process.c (set_socket_option): Fix :bindtodevice option.
- (Fset_network_process_option): Update process contact list when
- setting option succeeds.
- (Fmake_network_process): Doc fix.
-
-2003-09-23 Dave Love <[email protected]>
-
- * process.c (Fnetwork_interface_info): Use HAVE_STRUCT_IFREQ... macros.
-
-2003-09-22 Eli Zaretskii <[email protected]>
-
- * term.c (set_tty_color_mode): Use INTEGERP to test whether a
- color mode is an integer number (it could be -1).
-
-2003-09-22 Richard M. Stallman <[email protected]>
-
- * intervals.c (graft_intervals_into_buffer): Correct the main loop
- in the case where OVER is longer than UNDER.
-
-2003-09-22 Masatake YAMATO <[email protected]>
-
- * window.c (Fset_window_scroll_bars): Validate the value of
- `vertical_type'.
-
-2003-09-21 Kim F. Storm <[email protected]>
-
- * frame.c (Vdefault_frame_scroll_bars): New variable.
- (x_set_vertical_scroll_bars): Use it instead of hardcoded values.
- (syms_of_frame): DEFVAR_LISP it, and initialize according to
- window-system default scroll bar position.
-
- * window.c (Fwindow_scroll_bars): Doc fix.
-
-2003-09-19 Jan Dj,Ad(Brv <[email protected]>
-
- * xterm.c (x_set_offset): Take window manager decorations into account.
-
-2003-09-19 Richard M. Stallman <[email protected]>
-
- * atimer.h: Don't include lisp.h.
- (P_): Define it here (as well as elsewhere).
-
- * print.c (Fprin1_to_string): Move the PRINTPREPARE
- later, so that PRINTFINISH won't unbind Qinhibit_modification_hooks.
-
- * data.c (Fvariable_binding_locus): New function.
- (syms_of_data): defsubr it.
- (Flocal_variable_p): Delete duplicate call to indirect_variable.
-
-2003-09-18 Dave Love <[email protected]>
-
- * alloc.c (GC_MALLOC_CHECK): Move conditional undef after lisp.h.
-
- * process.c (Fnetwork_interface_info): Fix type error.
- (Fnetwork_interface_list): Doc fix.
- (read_process_output, read_process_output): Delete unused var.
-
-2003-09-17 Kim F. Storm <[email protected]>
-
- * process.c (Fnetwork_interface_list, Fnetwork_interface_info):
- Require HAVE_NET_IF_H and HAVE_SYS_IOCTL_H to include these fns.
- (Fnetwork_interface_info): Check that ifreq struct has required
- fields before accessing them; this requires that those fields are
- defined as macros, which may be too restrictive on some platforms,
- but it is better than failing on other platforms.
- (syms_of_process): Only defsubr above fns when included.
-
-2003-09-17 Dave Love <[email protected]>
-
- * unexalpha.c: Don't include varargs.h.
-
-2003-09-17 Kim F. Storm <[email protected]>
-
- * process.c (Fset_process_sentinel): Add sentinel to childp plist
- for network process.
- (socket_options): Add `:' prefix to option names. Add optbit field.
- (set_socket_option): Remove no_error arg and special handling of s < 0.
- Return 1<<optbit for known option, 0 for unknown.
- Do not interpret 0 as false for boolean option (only nil).
- Pass failed option and value to report_file_error.
- (Fset_network_process_options): Replace by Fset_network_process_option.
- (Fset_network_process_option): New function to set just one option.
- (Fmake_network_process): Allow :coding arg to be a cons.
- Allow :server arg to be an integer specifying backlog size.
- Remove :options arg, and allow options to be specified directly
- as :KEY, VALUE pairs. Parse these options before binding socket.
- As before, :reuseaddr t is default for a server process, but this
- can now be disabled by specifying :reuseaddr nil.
- (Fnetwork_interface_info): Rename from Fget_network_interface_info.
- (init_process): Availability of network options is now checked with
- simpler syntax (featurep 'make-network-process :OPTION); use loop to
- setup features.
- (syms_of_process): Fix defsubr's for the replaced functions.
-
-2003-09-16 Dave Love <[email protected]>
-
- * Makefile.in: Depend on coding.h.
-
-2003-09-14 Kim F. Storm <[email protected]>
-
- * process.c [HAVE_SOCKETS]: Include sys/ioctl.h and net/if.h.
- (Fnetwork_interface_list, Fget_network_interface_info): New defuns.
- (syms_of_process): Defsubr them.
-
- * config.in: Regenerate.
-
-2003-09-12 Stefan Monnier <[email protected]>
-
- * m/sr2k.h (XMARKBIT, XUNMARK): Remove.
- * m/news-r6.h (XUNMARK): Remove.
- * m/mips.h (XUNMARK): Remove.
- * m/mips-siemens.h (XUNMARK): Remove.
- * m/iris4d.h (XUNMARK): Remove.
- * m/hp800.h (XMARKBIT, XUNMARK): Remove.
-
-2003-09-11 Stefan Monnier <[email protected]>
-
- * lisp.h (VALBITS): Don't remove 1 for the markbit.
- (union Lisp_Object): Use unsigned int for types. Remove markbit.
- (MARKBIT): Remove 1 from VALBITS so we still use same old val.
- (XTYPE): Use unsigned right-shift.
- (XMARKBIT, XMARK, XUNMARK): Remove.
-
- * alloc.c (init_intervals, init_symbol, init_marker):
- Don't preallocate anything.
- (Fgarbage_collect, mark_object): Ignore the markbit.
-
- * bytecode.c (mark_byte_stack, unmark_byte_stack): Ignore the markbit.
-
-2003-09-08 Lute Kamstra <[email protected]>
-
- * xdisp.c (pint2hrstr): New function.
- (decode_mode_spec): Add `%i' and `%I' specs.
- * buffer.c (syms_of_buffer): Document `%i' and `%I' constructs
- for `mode-line-format'.
-
-2003-09-07 Andreas Schwab <[email protected]>
-
- * alloc.c: Use long instead of int when casting ABLOCKS_BUSY to
- avoid warning.
-
-2003-09-07 Eli Zaretskii <[email protected]>
-
- * editfns.c (region_limit): Support any non-zero value of BEGINNINGP.
-
-2003-09-03 Kim F. Storm <[email protected]>
-
- * xdisp.c (get_window_cursor_type): Partially undo 2002-03-01
- change (superseded by 2002-08-30 change); the default blink-off
- cursor is now again "no cursor".
-
-2003-09-01 Jason Rumney <[email protected]>
-
- * makefile.w32-in (alloca.o): Remove.
- (coding.o): Depend on intervals.h
- (emacs.o, bytecode.o): Depend on window.h.
-
-2003-09-01 Dave Love <[email protected]>
-
- * Makefile.in (alloca.o): Remove commands.
- (coding.o): Depend on intervals.h composite.h window.h.
- (emacs.o): Depend on window.h keyboard.h keymap.h.
- (gtkutil.o): Depend on keyboard.h charset.h coding.h.
- (bytecode.o): Depend on window.h.
-
-2003-08-31 Jason Rumney <[email protected]>
-
- * w32term.c (w32_per_char_metric): Allow cached metrics to be
- returned even when font_type is unknown.
-
- * xdisp.c (init_iterator): Remove old WINDOWSNT conditional.
-
-2003-08-30 Jan Dj,Ad(Brv <[email protected]>
-
- * xterm.c (x_term_init): Initialize new fields in x_display_info.
-
- * xterm.h (struct x_display_info): Add red/green/blue_bits and
- *_offset.
-
- * xfns.c (lookup_rgb_color): Use new fields in x_display_info to
- calculate pixel value.
-
-2003-08-29 Gerd Moellmann <[email protected]>
-
- * xdisp.c (redisplay_internal): Fix change of 2003-04-30.
- Don't tell redisplay display is accurate when it's actually been
- paused for pending input.
-
-2003-08-29 Richard M. Stallman <[email protected]>
-
- * dispnew.c (adjust_glyph_matrix): Call window_box
- whenever W is nonzero.
-
- * data.c (Fmake_variable_buffer_local, Fmake_local_variable)
- (Fkill_local_variable, Fmake_variable_frame_local)
- (Flocal_variable_p, Flocal_variable_if_set_p):
- Use indirect_variable to trace thru variable aliases.
-
- * config.in: Updated.
-
- * callint.c (Fcall_interactively): Save and restore
- Vthis_command, Vthis_original_command, real_this_command,
- and current_kboard->Vlast_command.
-
- * abbrev.c (Fexpand_abbrev): Insert before deleting.
-
-2003-08-29 Gerd Moellmann <[email protected]>
-
- * xfns.c (lookup_rgb_color): Handle TrueColor visuals specially.
-
-2003-08-28 David Abrahams <[email protected]> (tiny change)
-
- * coding.c (decode_coding_iso2022): Initialize local variable c2.
- (decode_coding_sjis_big5): Likewise.
-
-2003-08-27 Jason Rumney <[email protected]>
-
- * w32.c (sys_pipe): Protect against file descriptor overflow.
-
- * w32fns.c (syms_of_w32fns): Remove non-existent functions.
-
- * w32term.c (w32_read_socket): Fix WM_MOUSEWHEEL assignment.
-
-2003-08-26 Terje Rosten <[email protected]>
-
- * xfns.c (Vgtk_version_string): New variable.
- (syms_of_xfns): DEFVAR_LISP it. Provide gtk.
-
-2003-08-24 Eli Zaretskii <[email protected]>
-
- * term.c (term_init): Remove `const' from buffer_size's declaration.
-
- * Makefile.in (msdos.o): Depend on intervals.h.
-
- * msdos.c: Include intervals.h, since STRING_INTERVALS requires that.
-
-2003-08-21 Jan Dj,Ad(Brv <[email protected]>
-
- * xterm.h (struct x_display_info): New fields: client_leader_window
- and Xatom_wm_client_leader.
-
- * xterm.c (x_initialize): Move call to x_session_initialize to ...
- (x_term_init): ... here. Initialize client_leader fields in dpyinfo.
-
- * xsmfns.c (create_client_leader_window): New function.
- (x_session_initialize): Call create_client_leader_window, take
- dpyinfo as argument.
-
- * xfns.c (Fx_create_frame): Set property WM_CLIENT_LEADER.
-
- * Makefile.in (xsmfns.o): Add more depenedencies.
-
-2003-08-21 Dave Love <[email protected]>
-
- * m/iris4d.h: Use _MIPS_SZLONG, not _LP64.
-
-2003-08-21 Kenichi Handa <[email protected]>
-
- * term.c (term_init): Fix previous change; don't rely on the
- length of `buffer' if TERMINFO is defined.
-
-2003-08-20 Dave Love <[email protected]>
-
- * atimer.h: Include lisp.h.
-
- * lisp.h (EMACS_LISP_H): New.
- (popup_activated_flag): Don't declare.
-
- * alloca.c: Some merging with gnulib. Change logic and doc
- concerning (x)malloc/(x)free -- no longer Emacs-specific.
- [DO_BLOCK_INPUT]: Don't include lisp.h.
- (xmalloc, xfree): Declare.
- (malloc): Don't declare.
-
- * Makefile.in (LWLIB_OPTIONS): Remove (unused).
- (alloca.o): Remove obsolete stuff concerning alloca.s. Depend on
- atimer.h, blockinput.h.
-
- * alloc.c (lisp_align_malloc): Change type of `aligned'.
-
- * alloca.s: Remove.
-
-2003-08-19 Gerd Moellmann <[email protected]>
-
- * s/freebsd.h [__FreeBSD_version >= 400000]: Define TERMINFO,
- use -lncurses.
-
- * term.c (term_init): Use a buffer of size 4096 for tgetent since
- FreeBSD returns something longer than 2044. Abort if the end of
- the buffer is overwritten.
-
-2003-08-19 Miles Bader <[email protected]>
-
- * xterm.c (x_term_init): Correctly use result of Ffile_readable_p.
-
-2003-08-19 Gerd Moellmann <[email protected]>
-
- * alloc.c (lisp_align_malloc): Check for memory full when
- allocating ablocks, which also avoids freeing a pointer into an
- ablocks structure.
-
- * puresize.h (BASE_PURESIZE): Increase to 1100000.
-
- * buffer.c (Fmove_overlay): Set overlay's next pointer unconditionally.
-
-2003-08-16 Richard M. Stallman <[email protected]>
-
- * editfns.c (Fencode_time): Doc fix.
-
-2003-08-16 David Ponce <[email protected]>
-
- * fileio.c (Fwrite_region): Fix conditional expression to issue
- the right message.
-
-2003-08-16 Juri Linkov <[email protected]>
-
- * syntax.c (Fforward_word): Argument changed to optional.
- Set default value to 1.
-
-2003-08-15 Kenichi Handa <[email protected]>
-
- * xfaces.c (better_font_p): Prefer a real scalable font; i.e. not
- what autoscaled.
- (best_matching_font): Once we find a better scalable font, set
- non_scalable_has_exact_height_p to 1.
- (try_font_list): Call try_alternative_families to try any family
- with the given registry.
-
-2003-08-09 Andreas Schwab <[email protected]>
-
- * alloc.c (mark_object): Handle Lisp_Misc_Save_Value.
-
- * print.c (print_string): Fix printing of multibyte string with
- nontrivial printcharfun.
-
-2003-07-31 Jan Dj,Ad(Brv <[email protected]>
-
- * xfns.c (xg_set_icon): Rewrite to compile with GTK 2.0 and 2.2.
-
- * xterm.c (x_bitmap_icon): Return if xg_set_icon succeeds.
-
-2003-07-31 Kenichi Handa <[email protected]>
-
- * process.c (read_process_output): Return the actually read bytes
- instead of the result of decoding.
-
-2003-07-31 Kenichi Handa <[email protected]>
-
- * xterm.h (struct x_bitmap_record): New member have_mask.
-
- * xfns.c (x_create_bitmap_from_data): Initialize have_mask member
- to 0.
- (x_create_bitmap_from_file): Likewise.
- (x_destroy_bitmap): Check have_mask member before freeing a mask.
- (x_destroy_all_bitmaps): Likewise.
- (x_create_bitmap_mask): Set have_mask member to 1.
-
-2003-07-30 Richard M. Stallman <[email protected]>
-
- * Makefile.in (CFLAGS) [!OPTIMIZE]: Undo previous change.
-
-2003-07-29 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (xg_mark_data): Update calls to mark_object.
-
-2003-07-29 Richard M. Stallman <[email protected]>
-
- * xterm.c (xim_open_dpy, xim_initialize, xim_close_dpy):
- Conditionalize XIM code on HAVE_XIM.
-
- * fns.c (Fclear_string): New function.
- (syms_of_fns): defsubr it.
-
-2003-07-28 KOBAYASHI Yasuhiro <[email protected]>
-
- * xfns.c (xic_set_preeditarea): Add the left fringe width to spot.x.
-
-2003-07-22 Stefan Monnier <[email protected]>
-
- * xfns.c: Don't check HAVE_PNG_H: autoconf doesn't seem to find it.
-
- * buffer.c (delete_all_overlays): New function.
- * buffer.h (delete_all_overlays): Declare.
- * coding.c (run_pre_post_conversion_on_str):
- * print.c (temp_output_buffer_setup):
- * fileio.c (Finsert_file_contents):
- * minibuf.c (get_minibuffer): Use it.
-
-2003-07-22 Andrew Choi <[email protected]>
-
- * unexmacosx.c (unexec_regions_sort_compare):
- (unexec_regions_merge): New functions. Sort and merge unexec
- regions before dumping them.
-
-2003-07-22 Dave Love <[email protected]>
-
- * xfns.c [HAVE_PNG]: Consider both png.h and libpng/png.h.
-
-2003-07-21 Stefan Monnier <[email protected]>
-
- * alloc.c (MARK_STRING, UNMARK_STRING, STRING_MARKED_P)
- (GC_STRING_CHARS, string_bytes): Use ARRAY_MARK_FLAG rather than
- MARKBIT as the gcmarkbit for strings.
-
-2003-07-21 Richard M. Stallman <[email protected]>
-
- * s/openbsd.h (LD_SWITCH_SYSTEM_TEMACS): Add undef.
-
- * fns.c (Flocale_info): Rename from Flanginfo. Doc fixes.
- (syms_of_fns): Corresponding change.
-
- * alloc.c (syms_of_alloc): Doc fixes.
-
-2003-07-20 Han Boetes <[email protected]> (tiny change)
-
- * s/netbsd.h: Use -Wl syntax.
-
-2003-07-17 Richard M. Stallman <[email protected]>
-
- * xterm.c (xim_initialize): Redo 6/24 change.
-
-2003-07-15 Stefan Monnier <[email protected]>
-
- * buffer.c (copy_overlays): Use EMACS_INT for positions.
- (Fswitch_to_buffer): Don't signal an error when switching to the same
- buffer in a dedicated window.
-
- * alloc.c: Use bitmaps for cons, as was done for floats.
- (init_float, init_cons): Let the normal code allocate the first block.
- (CONS_BLOCK_SIZE): Redefine based on BLOCK_BYTES and bitmap size.
- (CONS_BLOCK, CONS_INDEX, CONS_MARKED_P, CONS_MARK, CONS_UNMARK):
- New macros.
- (struct cons_block): Move conses to the beginning. Add gcmarkbits.
- (Fcons): Use lisp_align_malloc and CONS_UNMARK.
- (live_cons_p): Check the pointer is not past the `conses' array.
- (mark_maybe_object, mark_maybe_pointer): Use CONS_MARKED_P.
- (mark_object, mark_buffer): Use CONS_MARKED_P and CONS_MARK.
- (survives_gc_p): Use CONS_MARKED_P and simplify.
- (gc_sweep): Use CONS_MARKED_P, CONS_UNMARK, and lisp_align_free.
-
-2003-07-13 Paul Eggert <[email protected]>
-
- GCC 3.3 (sparc) no longer puts "int foo = 0;" into data; it
- puts it into BSS instead, at least on Solaris 8 and 9.
- This is a valid optimization, and it may occur on other platforms,
- so Emacs should not assume that initializing a static variable to
- zero puts it into data.
- * alloc.c (pure, staticvec):
- Initialize these arrays to nonzero, so that they're not
- put into BSS by that optimization.
-
-2003-07-13 Stefan Monnier <[email protected]>
-
- * alloc.c (BLOCK_PADDING): Rename from ABLOCKS_PADDING. Update users.
- (lisp_align_malloc): Use posix_memalign is available.
- (ABLOCKS_BASE): Use HAVE_POSIX_MEMALIGN as an optimization.
- (STRING_BLOCK_SIZE): Rename from STRINGS_IN_STRING_BLOCK
- for consistency. Update users.
-
-2003-07-13 Richard M. Stallman <[email protected]>
-
- * s/netbsd.h (START_FILES_1, END_FILES_1): Always define them.
-
-2003-07-13 Terje Rosten <[email protected]>
-
- * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap): Modify to add mask,
- and use the Gtk+ function gtk_window_icon_from_file if available.
-
- * xfns.c (x_bitmap_mask, x_create_bitmap_mask): New functions to
- handle mask of bitmaps.
- (x_allocate_bitmap_record, x_destroy_bitmap): Modify to handle the
- mask property.
- (xg_set_icon): New function, wrapper for gtk_window_icon_from_file.
-
- * xterm.h (xg_set_icon): New function.
-
-2003-07-12 Paul Eggert <[email protected]>
-
- * unexelf.c (unexec): Consider a section to precede the .bss
- section if its addresses overlap that of .bss.
-
-2003-07-12 Richard M. Stallman <[email protected]>
-
- * Makefile.in (CFLAGS) [!OPTIMIZE]: Set CFLAGS to -g.
-
- * config.in (HAVE_CRTIN): Add #undef.
- (INLINE): Really inline only if OPTIMIZE is defined.
-
- * s/netbsd.h (START_FILES, LIB_STANDARD): Use START_FILES_1,
- END_FILES_1.
- (START_FILES_1, END_FILES_1): New macros (conditional).
- (LD_SWITCH_SYSTEM_TEMACS): Define.
-
- * s/openbsd.h: Don't include bsd4-3.h.
- (TERMINFO): Define.
- (LIBS_TERMCAP): Define.
- (LD_SWITCH_SYSTEM): Define (two definitions).
-
- * xfns.c: Include libpng/png.h instead of png.h.
-
-2003-07-11 Andreas Schwab <[email protected]>
-
- * buffer.c (modify_overlay): Update prototype.
- * lisp.h (adjust_overlays_for_insert, adjust_overlays_for_delete):
- Likewise.
-
-2003-07-09 Stefan Monnier <[email protected]>
-
- * lisp.h (VALBITS): Define in terms of GCTYPEBITS.
- (struct interval): Move to intervals.h.
- (struct Lisp_Marker): Use EMACS_INT for position info.
- (forward_point): Remove prototype of defunct function.
- (Qmodification_hooks, Qrear_nonsticky, Fnext_property_change)
- (Fget_text_property, Fset_text_properties, Ftext_propertes_not_all)
- (syms_of_textprop, set_text_properties): Remove prototypes that are
- already in intervals.h.
-
- * intervals.h (struct interval): Move from lisp.h.
- Use EMACS_INT for position and size info.
-
- * coding.c: Include intervals.h for Fset_text_properties.
-
- * buffer.h (struct buffer_text, struct buffer): Use EMACS_INT for
- position and length information.
-
-2003-07-09 Stefan Monnier <[email protected]>
-
- * buffer.h (struct buffer_text, struct buffer): Use EMACS_INT for
- position and length information.
-
-2003-07-09 Stefan Monnier <[email protected]>
-
- Change overlays_after and overlays_before so the overlays themselves
- are linked into lists, rather than using cons cells. After all each
- Lisp_Misc already occupies 5 words, so we can add a `next' field to
- Lisp_Overlay for free and save up one cons cell per overlay (not
- to mention one indirection when traversing the list of overlay).
-
- * lisp.h (struct Lisp_Overlay): New field `next'.
-
- * buffer.h (struct buffer): Change overlays_before and overlays_after
- from Lisp lists of overlays to pointers to overlays.
-
- * buffer.c (overlay_strings, recenter_overlay_lists):
- Fix typo in eassert in last commit.
- (unchain_overlay): New function.
- (add_overlay_mod_hooklist): Use AREF.
- (copy_overlays, reset_buffer, overlays_at, overlays_in)
- (overlay_touches_p, overlay_strings, recenter_overlay_lists)
- (fix_overlays_in_range, fix_overlays_before, Fmake_overlay)
- (Fmove_overlay, Fdelete_overlay, Foverlay_lists)
- (report_overlay_modification, evaporate_overlays, init_buffer_once):
- Adjust to new type of overlays_(before|after).
-
- * alloc.c (mark_object): Mark the new `next' field of overlays.
- (mark_buffer): Manually mark the overlays_(after|before) fields.
-
- * coding.c (run_pre_post_conversion_on_str):
- * editfns.c (overlays_around):
- * xdisp.c (load_overlay_strings):
- * fileio.c (Finsert_file_contents):
- * indent.c (current_column):
- * insdel.c (signal_before_change, signal_after_change):
- * intervals.c (set_point_both):
- * print.c (temp_output_buffer_setup): Use new type for
- overlays_(before|after).
-
-2003-07-08 Stefan Monnier <[email protected]>
-
- * buffer.c (report_overlay_modification): Don't run hooks while
- traversing the list of overlays.
-
- * buffer.h (struct buffer): Use an int for overlay_center.
- (overlays_at, evaporate_overlays, recenter_overlay_lists)
- (overlay_strings, fix_overlays_before): Use EMACS_INT for positions.
-
- * buffer.c (reset_buffer, recenter_overlay_lists)
- (adjust_overlays_for_insert, adjust_overlays_for_delete)
- (fix_overlays_in_range, Fmake_overlay, Fmove_overlay)
- (evaporate_overlays, init_buffer_once): Update use of overlay_center.
- (overlays_at, evaporate_overlays, recenter_overlay_lists)
- (overlay_strings, fix_overlays_before): Use EMACS_INT for positions.
-
- * xdisp.c (fast_find_position): Remove unused var.
-
- * cmds.c (Qexpand_abbrev): New sym.
- (syms_of_cmds): Initialize it.
- (internal_self_insert): Use it to call expand-abbrev.
-
-2003-07-09 Kim F. Storm <[email protected]>
-
- * xterm.c (use_xim) [!USE_XIM]: Default to disable XIM if Emacs
- was configured with --without-xim.
- (x_term_init) [!USE_XIM]: Use `useXIM' resource to turn on XIM.
-
-2003-07-07 Richard M. Stallman <[email protected]>
-
- * xdisp.c (reseat_1): Set it->area to TEXT_AREA.
-
- * alloc.c (Fgarbage_collect): Doc fix.
-
-2003-07-07 Nozomu Ando <[email protected]>
-
- * buffer.c (Fkill_buffer): Clear charpos cache if necessary.
-
-2003-07-06 Stefan Monnier <[email protected]>
-
- * minibuf.c (read_minibuf): UNGCPRO before returning.
- (Ftry_completion, Fall_completions): Doc fix.
-
- * alloc.c (live_float_p): Check that p is not past the `floats' array,
- now that `floats' is not the last element of the struct any more.
-
-2003-07-06 Jason Rumney <[email protected]>
-
- * w32term.h (ClipboardSequence_Proc): New type.
-
- * w32fns.c (clipboard_sequence_fn): New variable.
- (globals_of_w32fns): Initialize it.
-
- * w32select.c (last_clipboard_sequence_number): New variable.
- (Fw32_set_clipboard_data, Fw32_get_clipboard_data): Use sequence
- number if possible.
-
-2003-07-06 Stefan Monnier <[email protected]>
-
- * m/amdx86-64.h (MARKBIT):
- * m/ia64.h (MARKBIT): Remove definition since lisp.h does not compare
- MARKBIT and ARRAY_MARK_FLAG any more.
-
- * m/hp800.h (XSETMARKBIT):
- * m/sr2k.h (XSETMARKBIT):
- * lisp.h (XSETMARKBIT): Remove unused macro.
-
- * lisp.h (mark_object): Change prototype.
-
- * alloc.c (mark_object): Change arg *Lisp_Object -> Lisp_Object.
- (last_marked): Change accordingly.
- (mark_interval, mark_maybe_object, mark_maybe_pointer)
- (Fgarbage_collect, mark_glyph_matrix, mark_face_cache, mark_image)
- (mark_buffer): Update calls to mark_object.
-
- * bytecode.c (mark_byte_stack):
- * fns.c (sweep_weak_table):
- * keyboard.c (mark_kboards): Update calls to mark_object.
-
-2003-07-06 Jason Rumney <[email protected]>
-
- * alloc.c (struct ablock): Only include padding when there is some.
-
-2003-07-04 Stefan Monnier <[email protected]>
-
- * alloc.c (ALIGN): Add casts to simplify usage.
- (BLOCK_ALIGN, BLOCK_BYTES, ABLOCKS_PADDING, ABLOCKS_SIZE)
- (ABLOCKS_BYTES, ABLOCK_ABASE, ABLOCKS_BUSY, ABLOCKS_BASE): New macros.
- (struct ablock, struct ablocks): New types.
- (free_ablock): New global var.
- (lisp_align_malloc, lisp_align_free): New functions.
- (FLOAT_BLOCK_SIZE): Redefine in terms of BLOCK_BYTES.
- (struct float_block): Reorder and add gcmarkbits.
- (GETMARKBIT, SETMARKBIT, UNSETMARKBIT, FLOAT_BLOCK, FLOAT_INDEX)
- (FLOAT_MARKED_P, FLOAT_MARK, FLOAT_UNMARK): New macros.
- (init_float, make_float): Use lisp_align_malloc.
- (free_float, live_float_p): Don't use `type' any more.
- (make_float): Use FLOAT_UNMARK to access to mark bit.
- (mark_maybe_object, mark_maybe_pointer, survives_gc_p):
- Use FLOAT_MARKED_P to access the mark bit.
- (pure_alloc): Simplify use of ALIGN.
- (mark_object): Use FLOAT_MARK to access the mark bit.
- (gc_sweep): Use new macros to access the float's mark bit.
- (init_alloc_once): Init free_ablock.
-
- * lisp.h (struct Lisp_Float): Remove unused field `type'.
-
-2003-06-27 Stefan Monnier <[email protected]>
-
- * alloc.c (VECTOR_MARK, VECTOR_UNMARK, VECTOR_MARKED_P): New macros.
- (GC_STRING_BYTES): Don't mask markbit (it's only used on `size').
- (allocate_buffer): Move.
- (string_bytes): Don't mask markbit of `size_byte'.
- (mark_maybe_object, mark_maybe_pointer, Fgarbage_collect)
- (mark_object, mark_buffer, survives_gc_p, gc_sweep):
- Use the `size' field of buffers (rather than the `name' field) for
- the mark bit, as is done for all other vectorlike objects.
- Use the new macros to access the mark bit of vectorlike objects.
-
-2003-06-26 Richard M. Stallman <[email protected]>
-
- * puresize.h (BASE_PURESIZE): Increment base size.
-
- * xdisp.c (fast_find_position): Enable Gerd's new definition.
-
- * xterm.c (xim_initialize): Undo previous change.
-
-2003-06-26 Stefan Monnier <[email protected]>
-
- * alloc.c (survives_gc_p): Simplify.
-
- * buffer.c (set_buffer_internal_1): Test CONSP for lists.
-
- * window.c (Fset_window_dedicated_p): Simplify.
- (display_buffer_1): Don't raise the win from which minibuf was entered.
- (temp_output_buffer_show): Don't assume BEG == 1. Simplify.
- (Fminibuffer_selected_window): Simplify.
-
- * buffer.h (struct buffer_text): Lisp_Object `markers' => Lisp_Marker.
-
- * lisp.h (unchain_marker): Lisp_Object arg => Lisp_Marker.
- (struct Lisp_Marker): Lisp_Object `chain' => Lisp_Marker `next'.
-
- * insdel.c (check_markers, adjust_markers_for_delete)
- (adjust_markers_for_insert, adjust_markers_for_replace)
- (prepare_to_modify_buffer, RESTORE_VALUE):
- * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos)
- (Fset_marker, set_marker_restricted, set_marker_both, unchain_marker)
- (set_marker_restricted_both, Fbuffer_has_markers_at, count_markers):
- * alloc.c (Fmake_marker, free_marker, gc_sweep):
- * buffer.c (Fget_buffer_create, Fkill_buffer, Fset_buffer_multibyte):
- * editfns.c (save_excursion_restore, transpose_markers):
- * window.c (delete_window):
- * xdisp.c (message_dolog): Update for new types.
-
-2003-06-26 Jan Dj,Ad(Brv <[email protected]>
-
- * xfaces.c (set_font_frame_param): Set default_face_done_p to zero.
- (realize_default_face): Use default_face_done_p for the force_p
- argument to set_lface_from_font_name. Set default_face_done_p to one.
-
- * frame.c (make_frame): Initialize default_face_done_p.
-
- * frame.h (struct frame): Add default_face_done_p.
-
- * config.in: Add XRegisterIMInstantiateCallback_arg6 so it
- will be defined.
-
-2003-06-25 Stefan Monnier <[email protected]>
-
- * alloc.c (make_interval, Fmake_symbol, allocate_misc):
- Initialize the new field `gcmarkbit'.
- (mark_interval, MARK_INTERVAL_TREE): Use the new `gcmarkbit' field.
- (mark_interval_tree): Don't mark the tree separately from the nodes.
- (UNMARK_BALANCE_INTERVALS): Don't unmark the tree.
- (mark_maybe_object, mark_maybe_pointer, Fgarbage_collect)
- (mark_object, survives_gc_p, gc_sweep): Use new `gcmarkbit' fields.
-
- * lisp.h (struct interval, struct Lisp_Symbol, struct Lisp_Free)
- (struct Lisp_Marker, struct Lisp_Intfwd, struct Lisp_Boolfwd)
- (struct Lisp_Kboard_Objfwd, struct Lisp_Save_Value)
- (struct Lisp_Buffer_Local_Value, struct Lisp_Overlay)
- (struct Lisp_Objfwd, struct Lisp_Buffer_Objfwd): Add `gcmarkbit' field.
-
-2003-06-24 Dave Love <[email protected]>
-
- * xterm.c (xim_initialize): Use XRegisterIMInstantiateCallback_arg6.
-
- * strftime.c: Test HAVE_SYS__MBSTATE_H, not __hpux. Merge changes
- from gnulib.
-
-2003-06-21 Richard M. Stallman <[email protected]>
-
- * fileio.c (Fwrite_region): Alternate messages
- for append and partial write.
-
- * keyboard.c (read_key_sequence): When converting upcase fn key to
- downcase, update fkey and keytran so `backspace' gets translated.
-
- * keyboard.c (read_avail_input): Don't signal SIGHUP in batch mode.
-
- * process.c (wait_reading_process_input): Don't signal SIGIO
- in batch mode.
-
-2003-06-17 Kenichi Handa <[email protected]>
-
- * Makefile.in (xselect.o): Don't depend on charset.h, coding.h,
- composite.h.
-
- * xselect.c: Don't include charset.h, coding.h, composite.h.
- (Qforeign_selection): New variable.
- (syms_of_xselect): Intern and static it.
- (selection_data_to_lisp_data): Return a unibyte string made from
- data with `foreign-selection' text property.
-
-2003-06-15 Stefan Monnier <[email protected]>
-
- * termhooks.h (EVENT_INIT): New macro.
-
- * keyboard.c (mark_kboards): Move from alloc.c. Mark kbd_buffer.
-
- * alloc.c (mark_kboards): Move to keyboard.c.
-
- * keyboard.c (record_asynch_buffer_change, read_avail_input):
- * xterm.c (x_dispatch_event):
- * xmenu.c (find_and_call_menu_selection):
- * xdisp.c (handle_tool_bar_click):
- * w32menu.c (menubar_selection_callback):
- * sysdep.c (kbd_input_ast, read_input_waiting):
- * msdos.c (dos_rawgetc):
- * macterm.c (mac_check_for_quit_char):
- * macmenu.c (menubar_selection_callback):
- * gtkutil.c (xg_tool_bar_callback): Don't pass uninitialized
- data to kbd_buffer_store_event.
-
-2003-06-15 Kim F. Storm <[email protected]>
-
- * xdisp.c (x_fix_overlapping_area): Always use area relative X
- to fix redisplay problem with tall characters (such as ,AC(B).
-
-2003-06-13 Kai Gro,A_(Bjohann <[email protected]>
-
- * fileio.c (Fcopy_file): Doc fix: copies file modes, too.
-
-2003-06-12 Kenichi Handa <[email protected]>
-
- * fileio.c (Fwrite_region): Save and restore restriction.
-
-2003-06-12 Dave Love <[email protected]>
-
- * alloca.c (alloca): Declare arg as size_t.
-
- * sysdep.c: Remove redundant include of unistd.h, stdlib.h.
- Use HAVE_DECL_SYS_SIGLIST, not SYS_SIGLIST_DECLARED.
-
-2003-06-11 Dave Love <[email protected]>
-
- * search.c (shrink_regexp_cache): Use xrealloc.
- (syms_of_search): Use xmalloc.
-
-2003-06-10 Kim F. Storm <[email protected]>
-
- * xdisp.c (phys_cursor_in_rect_p): Fix 2003-05-24 change.
- Adjust phys_cursor.x to be relative to window box, rather than
- text area before checking -- to ensure cursor is redrawn when
- exposing window.
- Note: This also fixes a similar (older) bug if display margins
- are present.
-
-2003-06-06 Kenichi Handa <[email protected]>
-
- * coding.c (encoding_buffer_size): If coding->type is
- coding_type_ccl, double magnification on CRLF encoding.
-
-2003-06-06 Jason Rumney <[email protected]>
-
- * w32reg.c (SYSTEM_DEFAULT_RESOURCES): New constant.
- (w32_get_string_resource): Try SYSTEM_DEFAULT_RESOURCES last.
-
- * xfaces.c (Finternal_face_x_get_resource): Do it on Windows and
- Mac too.
-
-2003-06-05 Dave Love <[email protected]>
-
- * strftime.c: Merge changes from gnulib.
-
- * mktime.c (__mktime_internal): Merge changes from gnulib
- involving year 69 and dst2.
-
- Changes to merge with gnulib version and be consistent with the
- autoconf test:
-
- * getloadavg.c: Set NLIST_STRUCT from HAVE_NLIST_H.
- Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not NLIST_NAME_UNION.
- [HAVE_LOCALE_H]: Include locale.h.
- (getloadavg) [HAVE_SETLOCALE]: Run sscanf in C locale.
-
-2003-06-05 Kim F. Storm <[email protected]>
-
- * window.c (coordinates_in_window): Convert X and Y to window
- relative coordinates inside mode-line and header-line parts.
- Convert X and Y to margin area relative coordinates inside left
- and right display margin parts.
-
-2003-06-05 Jason Rumney <[email protected]>
-
- * w32fns.c (add_system_logical_colors_to_map): New function.
- (Fx_open_connection): Use it.
-
-2003-06-04 Stefan Monnier <[email protected]>
-
- * process.c (allocate_pty): Revert part of the previous patch.
- (Faccept_process_output): Simplify.
-
-2003-06-04 Jason Rumney <[email protected]>
-
- * termhooks.h (enum event_kind): Remove MOUSE_WHEEL_EVENT.
-
- * keyboard.c (Qmouse_wheel, mouse_wheel_syms)
- (lispy_mouse_wheel_names): Remove.
- (syms_of_keyboard): Remove Qmouse_wheel and mouse_wheel_syms.
- Always define drag_and_drop_syms.
-
- * macterm.c (XTread_socket): Map mouse wheel events to Emacs
- WHEEL_EVENT events.
-
-2003-06-03 Stefan Monnier <[email protected]>
-
- * xdisp.c (update_tool_bar): Add missing UNGCPRO.
-
- * buffer.c (init_buffer_once): Make kill-buffer-hook permanent-local.
-
-2003-06-03 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (make_menu_item): Make sure we don't crash on a NULL
- menu item label.
-
-2003-06-03 Richard M. Stallman <[email protected]>
-
- * window.c (Fwindow_edges): Doc fix.
- (Fwindow_pixel_edges, Fwindow_inside_edges)
- (Fwindow_inside_pixel_edges): New functions.
- (syms_of_window): defsubr them.
-
- * window.h (WINDOW_LEFT_FRINGE_COLS, WINDOW_RIGHT_FRINGE_COLS)
- (WINDOW_MODE_LINE_LINES, WINDOW_HEADER_LINE_LINES): New macros.
-
-2003-06-02 Stefan Monnier <[email protected]>
-
- * dispnew.c (Fsit_for): Don't lie about the number of args.
-
-2003-06-02 Dave Love <[email protected]>
-
- * callproc.c: Use HAVE_FCNTL_H, not USG5.
- (syms_of_callproc) <process-environment>: Doc fix.
-
- * doc.c: Use HAVE_FCNTL_H, not USG5.
-
- * xfaces.c (font_rescale_ratio): Fix for K&R.
-
- * termcap.c: Use HAVE_FCNTL_H, not _POSIX_VERSION.
-
- * mem-limits.h: Use HAVE_SYS_RESOURCE_H, HAVE_SYS_VLIMIT_H.
-
- * lread.c [HAVE_FCNTL_H]: Include fcntl.h.
-
- * gtkutil.c: Include keyboard.h, charset.h, coding.h.
- (xg_create_frame_widgets): Use ENCODE_UTF_8.
-
- * xterm.c (Qutf_8): Move to coding.c.
-
- * xmenu.c (ENCODE_MENU_STRING): New.
- (list_of_panes, list_of_items, digest_single_submenu, xmenu_show):
- Use it.
-
- * coding.h (ENCODE_UTF_8): New.
- (Qutf_8): Declare.
-
- * coding.c (Qutf_8): New.
- (syms_of_coding): Intern it.
-
- * fns.c: Doc fixes.
-
-2003-06-02 Kenichi Handa <[email protected]>
-
- * buffer.c (Fset_buffer_multibyte): Fix previous change.
-
-2003-06-01 Stefan Monnier <[email protected]>
-
- * lread.c (openp): Make sure STR is a string.
-
-2003-06-01 David Ponce <[email protected]>
-
- * termhooks.h (enum event_kind): Add new WHEEL_EVENT event.
- Declare MOUSE_WHEEL_EVENT only if MAC_OSX defined.
-
- * keyboard.c (Qmouse_wheel): Declare only if MAC_OSX defined.
- (mouse_wheel_syms, lispy_mouse_wheel_names): Likewise.
- (discard_mouse_events): Discard WHEEL_EVENT events too.
- (lispy_wheel_names, wheel_syms): New.
- (syms_of_keyboard): Init and staticpro `wheel_syms'. Init and
- staticpro `Qmouse_wheel' and `mouse_wheel_syms' only if MAC_OSX defined.
- (make_lispy_event): Add WHEEL_EVENT handler.
-
- * w32term.c (construct_mouse_wheel): Construct WHEEL_EVENT.
- (w32_read_socket): Map w32 WM_MOUSEWHEEL events to Emacs
- WHEEL_EVENT events.
-
-2003-05-31 John Paul Wallington <[email protected]>
-
- * Makefile.in (lisp, shortlisp): byte-run, float-sup, map-ynp, and
- timer are in lisp/emacs-lisp.
-
-2003-05-31 Kenichi Handa <[email protected]>
-
- * buffer.c (Fset_buffer_multibyte): Correctly recover a narrowed
- region when a buffer is changed to unibyte.
-
- * charset.h (VALID_LEADING_CODE_P): New macro.
- (UNIBYTE_STR_AS_MULTIBYTE_P): Check more rigidly.
-
- * coding.c (DECODE_EMACS_MULE_COMPOSITION_CHAR): If coding->flags
- is nonzero, accept multibyte form of eight-bit-control chars.
- (decode_composition_emacs_mule): Likewise.
- (decode_coding_emacs_mule): Likewise.
- (encode_coding_emacs_mule): If coding->flags is nonzero, produce
- multibyte form of eight-bit-control chars.
-
- * fileio.c (Qauto_save_coding, auto_save_coding): New variables.
- (Finsert_file_contents): If coding-system-for-read is bound to
- Qauto_save_coding, use the coding system emacs-mule with special
- setting for recovering a file.
- (choose_write_coding_system): On auto saving, use the coding
- system emacs-mule with special setting for auto saving.
- (syms_of_fileio) <Qauto_save_coding>: Intern and staticpro it.
-
-2003-05-30 Kenichi Handa <[email protected]>
-
- * coding.c (ccl_coding_driver): Set ccl->eight_bit_control
- properly before calling ccl_driver.
-
- * ccl.h (struct ccl_program) <eight_bit_control>: Comment fixed.
-
- * ccl.c (CCL_WRITE_CHAR): Increment extra_bytes only when it is nonzero.
- (ccl_driver): Initialize extra_bytes to ccl->eight_bit_control.
- (setup_ccl_program): Initialize ccl->eight_bit_control to zero.
-
-2003-05-29 Glenn Morris <[email protected]>
-
- * xfaces.c (realize_default_face): Do not abort if lface is
- non-existent - reverts change from 2003-05-19.
-
-2003-05-29 Kenichi Handa <[email protected]>
-
- * coding.c (decode_coding_iso2022): Pay attention to the byte
- sequence of CTEXT extended segment, and retain those bytes as is.
-
-2003-05-28 Kenichi Handa <[email protected]>
-
- * coding.c (ENCODE_UNSAFE_CHARACTER): Adjust for the name change
- of CODING_REPLACEMENT_CHARACTER.
- (decode_coding_iso2022): If CODING_FLAG_ISO_SAFE, set
- CODING_MODE_INHIBIT_UNENCODABLE_CHAR flag in coding->mode, and
- check this flag on encoding.
- (encode_coding_sjis_big5):
- Check CODING_MODE_INHIBIT_UNENCODABLE_CHAR flag of coding->mode.
- (Fset_terminal_coding_system_internal):
- Set CODING_MODE_INHIBIT_UNENCODABLE_CHAR flag in terminal_coding.mode
- instead of setting CODING_FLAG_ISO_SAFE flag in terminal_coding.flags.
-
- * coding.h (CODING_REPLACEMENT_CHARACTER): Rename from
- CODING_INHIBIT_CHARACTER_SUBSTITUTION.
- (CODING_MODE_INHIBIT_UNENCODABLE_CHAR): New macro.
-
-2003-05-28 Richard M. Stallman <[email protected]>
-
- * print.c (syms_of_print) <print-escape-nonascii>: Doc fix.
-
- * eval.c (unbind_to): Move init of this_binding to separate statement.
-
-2003-05-28 Kim F. Storm <[email protected]>
-
- * xdisp.c (expose_window): Fix error in calculation of
- window relative coordinates of area to redisplay.
-
-2003-05-27 Jason Rumney <[email protected]>
-
- * w32term.c (GET_WHEEL_DELTA_WPARAM): New macro.
-
-2003-05-27 David Ponce <[email protected]>
-
- Handle W32 mouse wheel events as mouse click events, like in X.
-
- * keyboard.c (make_lispy_event) [WINDOWSNT]: Don't handle
- MOUSE_WHEEL_EVENT anymore.
-
- * w32term.c (construct_mouse_wheel): Result is a MOUSE_CLICK_EVENT.
- Scrolling down/up the mouse wheel is respectively mapped to mouse
- button 4 and 5.
- (w32_read_socket): Map w32 WM_MOUSEWHEEL events to Emacs
- MOUSE_CLICK_EVENT events. Forward w32 MSH_MOUSEWHEEL events as
- WM_MOUSEWHEEL events.
-
-2003-05-27 Andreas Schwab <[email protected]>
-
- * buffer.c (syms_of_buffer) <default-direction-reversed>: Doc fix.
-
- * xdisp.c (try_window_id): Avoid aborting if PT is inside a
- partially visible line.
-
- * alloc.c (Fgarbage_collect): Fix last change.
-
-2003-05-26 John Paul Wallington <[email protected]>
-
- * xfns.c (Fx_create_frame): Don't call Qface_set_after_frame_default.
-
-2003-05-25 Stefan Monnier <[email protected]>
-
- * window.c (Fset_window_buffer): Add type of `keep_margins'.
- (Fset_window_fringes, Fset_window_scroll_bars): Declare before use.
-
- * window.h (window_box_text_cols): Declare.
-
- * xdisp.c (window_text_bottom_y, draw_row_fringe_bitmaps)
- (x_draw_vertical_border): Remove unused var `f'.
-
- * xfaces.c (build_scalable_font_name): Remove `unused var
- pixel_size' warning.
-
- * xfns.c (png_load): Remove `unused vars intent, image_gamma' warning.
-
- * unexelf.c (unexec): Remove `unused var n' warning.
-
- * strftime.c (my_strftime_localtime_r): Remove `defined but
- unused' warning.
-
- * process.c (allocate_pty): Remove `unused var stb' and
- `cp might be used uninitialized' warnings.
-
- * dispnew.c (mode_line_string): Remove unused var `f'.
-
- * coding.c (find_safe_codings): Remove unused var `i'.
-
- * bytecode.c (Fbyte_code): Remove `unused val' warning.
-
- * buffer.c (Fkill_buffer): Remove unused var `list'.
-
- * alloc.c (Fgarbage_collect): Remove `unused var tail' warning.
-
-2003-05-25 Jan Dj,Ad(Brv <[email protected]>
-
- * frame.c (make_frame): Condition want_fullscreen with
- HAVE_WINDOW_SYSTEM.
-
-2003-05-25 Juanma Barranquero <[email protected]>
-
- * window.c (Fset_window_scroll_bars): Fix typo in argument name.
- (Fwindow_scroll_bars): Fix typo in docstring.
-
-2003-05-24 Kim F. Storm <[email protected]>
-
- The following changes serve several purposes:
-
- 1) Swap the position of fringes and display margins in windows, i.e.
- the fringes are now displayed between the margins and the text area
- (by default).
-
- 2) Allow fringe and scroll bar parameters to be set per-buffer and
- per-window (like display margins). Such settings are now stored
- in window configurations, preserved when frames are resized, and
- copied when windows are split vertically or horizontally.
- Several bugs related to display margins have been fixed.
-
- 3) Consistently use FRAME_FONT and FRAME_FONTSET macros.
-
- 4) Use FRAME_COLUMN_WIDTH (f) consistently throughout the code
- rather than FRAME_WIDTH (FRAME_FONT (f)).
-
- 5) Introduce a consistent naming of variables, members and macros
- depending on whether their value is measured in pixels or in
- canonical columns/lines. Pixel dimensions are named *_width and
- *_height, while canonical columns/lines are named *_cols and
- *_lines. Pixel positions are named *_x and *_y, while column/line
- positions are named *_col and *_line.
-
- 6) Consolidate more of the X, W32, and MAC gui code by moving
- common data into struct frame, and generalize it for the non-gui
- case by using suitable defaults.
-
- 7) Cleanup and consolidate the macros controlling frame and window
- layout into frame.h and window.h, and generalize the use of the
- various window_box_* functions (enhanced to handle the new fringe
- position and the per-window fringe and scroll bar settings).
-
- * frame.h (struct frame): Rename members height to text_lines,
- width to text_cols, window_height to total_lines, window_width to
- total_cols, new_height to new_text_lines, new_width to
- new_text_cols. All uses changed.
- (struct frame): New members which consolidate common members of
- x_output, w32_output, and mac_output structures: left_pos,
- top_pos, pixel_height, pixel_width, x_pixels_diff, y_pixels_diff,
- win_gravity, size_hint_flags, border_width, internal_border_width,
- line_height, fringe_cols, left_fringe_width, right_fringe_width,
- want_fullscreen. All uses changed.
- (struct frame): New member column_width contaning the canonical
- column width, analogue to line_height. All uses changed.
- (struct frame): Rename members scroll_bar_pixel_width to
- config_scroll_bar_width, and scroll_bar_cols to
- config_scroll_bar_cols. All uses changed.
- (struct frame): New member scroll_bar_actual_width which
- consolidates and renames the vertical_scroll_bar_extra member of
- x_output, w32_output, and mac_output structures. All uses changed.
- (FRAME_PIXEL_HEIGHT): Rename from PIXEL_HEIGHT and moved
- from x/w32/macterm.h files. All uses changed. Also change code
- which referred to f->output_data...->pixel_height.
- (FRAME_PIXEL_WIDTH): Rename from PIXEL_WIDTH and moved
- from x/w32/macterm.h files. All uses changed. Also change code
- which referred to f->output_data...->pixel_width.
- (FRAME_LINES): Rename from FRAME_HEIGHT. All uses changed.
- Also change code which referred to f->height.
- (FRAME_COLS): Rename from FRAME_WIDTH. All uses changed.
- Also change code which referred to f->width.
- (FRAME_NEW_HEIGHT, FRAME_NEW_WIDTH): Remove macros; change uses
- to update new_text_lines and new_text_cols members directly.
- (FRAME_CONFIG_SCROLL_BAR_WIDTH): Rename from
- FRAME_SCROLL_BAR_PIXEL_WIDTH. All uses changed.
- (FRAME_CONFIG_SCROLL_BAR_COLS): Rename from
- FRAME_SCROLL_BAR_COLS. All uses changed.
- (FRAME_LEFT_SCROLL_BAR_COLS, FRAME_RIGHT_SCROLL_BAR_COLS):
- Rename from FRAME_LEFT_SCROLL_BAR_WIDTH and
- FRAME_RIGHT_SCROLL_BAR_WIDTH, resp. All uses changed.
- (FRAME_SCROLL_BAR_AREA_WIDTH, FRAME_LEFT_SCROLL_BAR_AREA_WIDTH)
- (FRAME_RIGHT_SCROLL_BAR_AREA_WIDTH): New macros.
- (FRAME_TOTAL_COLS): Rename from FRAME_WINDOW_WIDTH.
- (SET_FRAME_COLS): Rename from SET_FRAME_WIDTH.
- (FRAME_TOTAL_COLS_ARG): Rename from FRAME_WINDOW_WIDTH_ARG.
- (WINDOW_VERTICAL_SCROLL_BAR_COLUMN): Remove unused macro.
- (WINDOW_VERTICAL_SCROLL_BAR_HEIGHT): Remove unused macro.
- (FRAME_LINE_HEIGHT): Rename from CANON_Y_UNIT.
- Unconditionally return line_height member (it now has proper value
- also for non-window frames).
- (FRAME_COLUMN_WIDTH): Rename from CANON_X_UNIT. Unconditionally
- return new column_width member (rather than the default font width).
- (FRAME_FRINGE_COLS, FRAME_LEFT_FRINGE_WIDTH)
- (FRAME_RIGHT_FRINGE_WIDTH): Rename from FRAME_X_... and moved
- from x/w32/macterm.h files. Unconditionally return corresponding
- member of frame structure (they now have proper values also for
- non-window frames).
- (FRAME_TOTAL_FRINGE_WIDTH): Rename from FRAME_FRINGE_WIDTH.
- Calculate return value from left and right widths.
- (FRAME_INTERNAL_BORDER_WIDTH): Unconditionally return
- internal_border_width member (has proper value for non-window frame).
- (FRAME_PIXEL_X_FROM_CANON_X): Rename from PIXEL_X_FROM_CANON_X.
- (FRAME_PIXEL_Y_FROM_CANON_Y): Rename from PIXEL_Y_FROM_CANON_Y.
- (FRAME_CANON_X_FROM_PIXEL_X): Rename from CANON_X_FROM_PIXEL_X.
- (FRAME_CANON_Y_FROM_PIXEL_Y): Rename from CANON_Y_FROM_PIXEL_Y.
- (FRAME_LINE_TO_PIXEL_Y): Rename from CHAR_TO_PIXEL_ROW,
- consolidated from xterm.h, macterm.h, and w32term.h.
- (FRAME_COL_TO_PIXEL_X): Rename from CHAR_TO_PIXEL_COL,
- consolidated from xterm.h, macterm.h, and w32term.h.
- (FRAME_TEXT_COLS_TO_PIXEL_WIDTH): Rename from
- CHAR_TO_PIXEL_WIDTH consolidated from x/mac/w32term.h.
- (FRAME_TEXT_LINES_TO_PIXEL_HEIGHT): Rename from
- CHAR_TO_PIXEL_HEIGHT consolidated from x/mac/w32term.h.
- (FRAME_PIXEL_Y_TO_LINE): Rename from PIXEL_TO_CHAR_ROW
- consolidated from x/mac/w32term.h.
- (FRAME_PIXEL_X_TO_COL): Rename from PIXEL_TO_CHAR_COL
- consolidated from x/mac/w32term.h.
- (FRAME_PIXEL_WIDTH_TO_TEXT_COLS): Rename from
- PIXEL_TO_CHAR_WIDTH consolidated from x/mac/w32term.h.
- (FRAME_PIXEL_HEIGHT_TO_TEXT_LINES): Rename from
- PIXEL_TO_CHAR_HEIGHT consolidated from x/mac/w32term.h.
-
- * window.h (struct window): Rename members left to left_col,
- top to top_line, height to total_lines, width to total_cols,
- left_margin_width to left_margin_cols, right_margin_width to
- right_margin_cols, orig_height to orig_total_lines, orig_top to
- orig_top_line. All uses changed.
- (struct window): New members left_fringe_width, right_fringe_width,
- fringes_outside_margins, scroll_bar_width, vertical_scroll_bar_type.
- (WINDOW_XFRAME, WINDOW_FRAME_COLUMN_WIDTH, WINDOW_FRAME_LINE_HEIGHT):
- New macros primarily used to simplify other macros.
- (WINDOW_TOTAL_COLS): New macro. Change relevant code that
- referred to XINT (w->width).
- (WINDOW_TOTAL_LINES): New macro. Change relevant code that
- referred to XINT (w->height).
- (WINDOW_TOTAL_WIDTH): New macro. Change relevant code that
- referred to XINT (w->width) * canon_x_unit.
- (WINDOW_TOTAL_HEIGHT): New macro. Change relevant code that
- referred to XINT (w->height) * canon_y_unit.
- (WINDOW_LEFT_EDGE_COL): New macro. Change relevant code that
- referred to XINT (w->left).
- (WINDOW_RIGHT_EDGE_COL): Rename from WINDOW_RIGHT_EDGE. Change
- all uses and code that referred to XINT (w->left) + XINT (w->width).
- (WINDOW_TOP_EDGE_LINE): New macro. Change relevant code that
- referred to XINT (w->top).
- (WINDOW_BOTTOM_EDGE_LINE): New macro. Change relevant code that
- referred to XINT (w->top) + XINT (w->height).
- (WINDOW_LEFT_EDGE_X): New macro. Change relevant code that
- referred to XINT (w->left) * canon_x_unit.
- (WINDOW_RIGHT_EDGE_X): New macro. Change relevant code that
- referred to (XINT (w->left) + XINT (w->width)) * canon_x_unit.
- (WINDOW_TOP_EDGE_Y): New macro. Change relevant code that
- referred to XINT (w->top) * canon_y_unit.
- (WINDOW_BOTTOM_EDGE_Y): New macro. Change relevant code that
- referred to (XINT (w->top) + XINT (w->height)) * canon_y_unit.
- (WINDOW_LEFTMOST_P): New macro.
- (WINDOW_BOX_LEFT_EDGE_COL): Rename from WINDOW_LEFT_MARGIN.
- All uses changed.
- (WINDOW_BOX_RIGHT_EDGE_COL): Rename from WINDOW_RIGHT_MARGIN.
- All uses changed.
- (WINDOW_BOX_LEFT_EDGE_X): Rename from
- WINDOW_DISPLAY_LEFT_EDGE_PIXEL_X, moved from dispextern.h.
- Do not exclude left fringe width.
- (WINDOW_BOX_RIGHT_EDGE_X): Rename from
- WINDOW_DISPLAY_RIGHT_EDGE_PIXEL_X, moved from dispextern.h.
- Do not exclude fringe widths.
- (WINDOW_LEFT_FRINGE_WIDTH, WINDOW_RIGHT_FRINGE_WIDTH)
- (WINDOW_FRINGE_COLS, WINDOW_TOTAL_FRINGE_WIDTH): New macros.
- Change relevant code that referred to FRAME_LEFT_FRINGE_WIDTH,
- FRAME_RIGHT_FRINGE_WIDTH, FRAME_FRINGE_COLS, and
- FRAME_TOTAL_FRINGE_WIDTH to allow per-window fringe settings.
- (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS): New macro.
- (WINDOW_VERTICAL_SCROLL_BAR_TYPE, WINDOW_HAS_VERTICAL_SCROLL_BAR)
- (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT)
- (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT)
- (WINDOW_CONFIG_SCROLL_BAR_WIDTH, WINDOW_CONFIG_SCROLL_BAR_COLS):
- New macros. Change code which referenced corresponding
- FRAME_VERTICAL_SCROLL_BAR_TYPE, FRAME_HAS_VERTICAL_SCROLL_BARS,
- FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT,
- FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT,
- FRAME_SCROLL_BAR_PIXEL_WIDTH, and FRAME_SCROLL_BAR_COLS macros to
- allow per-window scroll-bar settings.
- (WINDOW_LEFT_SCROLL_BAR_COLS, WINDOW_RIGHT_SCROLL_BAR_COLS): New macros.
- (WINDOW_LEFT_SCROLL_BAR_AREA_WIDTH): New macro. Change code that
- referred to FRAME_LEFT_SCROLL_BAR_WIDTH.
- (WINDOW_RIGHT_SCROLL_BAR_AREA_WIDTH): New macro. Change code
- that referred to FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT and
- FRAME_SCROLL_BAR_WIDTH.
- (WINDOW_SCROLL_BAR_COLS, WINDOW_SCROLL_BAR_AREA_WIDTH)
- (WINDOW_SCROLL_BAR_AREA_X): New macros.
- (WINDOW_HEADER_LINE_HEIGHT): Rename from
- WINDOW_DISPLAY_HEADER_LINE_HEIGHT, moved from dispextern.h.
- (WINDOW_BOX_HEIGHT_NO_MODE_LINE): Rename from
- WINDOW_DISPLAY_HEIGHT_NO_MODE_LINE, moved from dispextern.h.
- (WINDOW_BOX_TEXT_HEIGHT): Rename from
- WINDOW_DISPLAY_PIXEL_WIDTH, moved from dispextern.h.
- (WINDOW_TO_FRAME_PIXEL_X, WINDOW_TO_FRAME_PIXEL_Y)
- (FRAME_TO_WINDOW_PIXEL_X, FRAME_TO_WINDOW_PIXEL_Y)
- (WINDOW_TEXT_TO_FRAME_PIXEL_X): Move here from dispextern.h.
- (WINDOW_LEFT_MARGIN_WIDTH): Rename from
- WINDOW_DISPLAY_LEFT_AREA_PIXEL_WIDTH, moved from dispextern.h.
- (WINDOW_RIGHT_MARGIN_WIDTH): Rename from
- WINDOW_DISPLAY_RIGHT_AREA_PIXEL_WIDTH, moved from dispextern.h.
- (window_from_coordinates): Update prototype.
- (Fset_window_buffer): Update EXFUN.
- (set_window_buffer): Update prototype.
-
- * dispextern.h (struct glyph_matrix): Rename members window_left_x
- to window_left_col, window_top_y to window_top_line. All uses
- changed.
- (FRAME_INTERNAL_BORDER_WIDTH_SAFE): Remove macro; can now safely
- use FRAME_INTERNAL_BORDER_WIDTH macro instead as
- internal_border_width is now set to 0 for non-window frames.
- (WINDOW_DISPLAY_PIXEL_WIDTH, WINDOW_DISPLAY_PIXEL_HEIGHT)
- (WINDOW_DISPLAY_MODE_LINE_HEIGHT, WINDOW_DISPLAY_HEADER_LINE_HEIGHT)
- (WINDOW_DISPLAY_HEIGHT_NO_MODE_LINE, WINDOW_DISPLAY_TEXT_HEIGHT)
- (WINDOW_DISPLAY_LEFT_EDGE_PIXEL_X, WINDOW_DISPLAY_RIGHT_EDGE_PIXEL_X)
- (WINDOW_DISPLAY_TOP_EDGE_PIXEL_Y, WINDOW_DISPLAY_BOTTOM_EDGE_PIXEL_Y)
- (WINDOW_TO_FRAME_PIXEL_X, WINDOW_TO_FRAME_PIXEL_Y)
- (FRAME_TO_WINDOW_PIXEL_X, FRAME_TO_WINDOW_PIXEL_Y)
- (WINDOW_DISPLAY_LEFT_AREA_PIXEL_WIDTH)
- (WINDOW_DISPLAY_RIGHT_AREA_PIXEL_WIDTH, WINDOW_WANTS_MODELINE_P):
- Move to window.h and renamed [see window.h changes].
- (WINDOW_AREA_TO_FRAME_PIXEL_X, WINDOW_AREA_PIXEL_WIDTH)
- (WINDOW_DISPLAY_TEXT_AREA_PIXEL_WIDTH): Remove macros.
- (WINDOW_WANTS_MODELINE_P, WINDOW_WANTS_HEADER_LINE_P):
- Use WINDOW_TOTAL_LINES.
- (frame_update_line_height): Remove prototype.
-
- * buffer.h (struct buffer): Rename members measured in columns:
- left_margin_width to left_margin_cols, right_margin_width to
- right_margin_cols. All uses changed.
- New members left_fringe_width, right_fringe_width,
- fringes_outside_margins for per-buffer fringe settings.
- New members scroll_bar_width and vertical_scroll_bar_type for
- per-buffer scroll bar settings.
-
- * buffer.c (init_buffer_once): Set buffer_defaults and
- buffer_local_flags for new buffer-local variables
- left_fringe_width, right_fringe_width, fringes_outside_margins,
- scroll_bar_width, and vertical_scroll_bar_type.
- (syms_of_buffer): Defvar_per_buffer them, and defvar_lisp_nopro
- default-* variables for them.
-
- * dispnew.c: Make (many) trivial substitutions for renamed and
- new macros in dispextern.h, frame.h and window.h.
- (mode_line_string): No need to adjust width for mode lines, as it
- is already adjusted by the caller.
- (marginal_area_string): Handle fringes inside/outside margins.
-
- * frame.c: Make (many) trivial substitutions for renamed and
- new macros in dispextern.h, frame.h and window.h.
- (make_frame): Initialize left_fringe_width, right_fringe_width,
- fringe_cols, scroll_bar_actual_width, border_width,
- internal_border_width, column_width, line_height, x_pixels_diff,
- y_pixels_diff, want_fullscreen, size_hint_flags, and win_gravity
- members with values suitable for a non-window frames.
-
- * gtkutil.c: Make (many) trivial substitutions for renamed and
- new macros in dispextern.h, frame.h and window.h.
-
- * indent.c: Make (few) trivial substitutions for renamed and
- new macros in dispextern.h, frame.h and window.h.
-
- * keyboard.c: Make (many) trivial substitutions for renamed and
- new macros in dispextern.h, frame.h and window.h.
- (make_lispy_event): Use window positions returned from
- window_from_coordinates when constructing the lisp event for
- MOUSE_CLICK_EVENT and DRAG_N_DROP_EVENT, rather than calculating
- (incorrect) values locally.
- (make_lispy_movement): Use window positions returned from
- window_from_coordinates when constructing the lisp event, rather
- than calculating (incorrect) values locally.
-
- * scroll.c: Make (some) trivial substitutions for renamed and
- new macros in dispextern.h, frame.h and window.h.
-
- * sunfns.c (Fsun_menu_internal): Adapt to per-window fringes and
- scroll-bars.
-
- * sysdep.c: Make (few) trivial substitutions for renamed and
- new macros in dispextern.h, frame.h and window.h.
-
- * term.c: Make (some) trivial substitutions for renamed and
- new macros in dispextern.h, frame.h and window.h.
-
- * widget.c: Make (few) trivial substitutions for renamed and
- new macros in dispextern.h, frame.h and window.h.
-
- * window.c: Make (many) trivial substitutions for renamed and
- new macros in dispextern.h, frame.h and window.h.
- (make_window): Initialize new members
- left_margin_cols, right_margin_cols, left_fringe_width,
- right_fringe_width, fringes_outside_margins, scroll_bar_width,
- and vertical_scroll_bar_type.
- (coordinates_in_window): Adapt to new fringe/margin positions
- and per-window fringes and scroll-bars.
- Fix bug related to incorrectly adjusting coordinates by
- frame's internal_border_width (the effect normally negible since
- the internal_border_width is typically 0 or 1 pixel, but very
- noticeable for an internal_border_width of e.g. 25 pixels).
- Upon successful return (other than ON_NOTHING), the coordinates
- are now always properly converted to window relative for the
- given display element.
- (window_from_coordinates): Add new parameters wx and wy to
- return the window relative x and y position in the returned
- window and part. A null arg means, don't return the position.
- All callers changed.
- (adjust_window_margins): New function which may reduce the width
- of the display margins if a window's text area is too small after
- resizing or splitting windows.
- (size_window): Fix bug that did not account for display margin
- widths when checking the minimum width of a window; use
- adjust_window_margins.
- (set_window_buffer): Call Fset_window_fringes and
- Fset_window_scroll_bars to setup per-window elements.
- Add new arg KEEP_MARGINS_P. Non-nil means to keep window's
- existing display margin, fringe widths, and scroll bar settings
- (e.g. after splitting a window or resizing the frame).
- All callers changed.
- (Fset_window_buffer): New arg KEEP_MARGINS. All callers changed.
- (Fsplit_window): Duplicate original window's display margin,
- fringe, and scroll-bar settings; then call Fset_window_buffer with
- KEEP_MARGINS non-nil. This fixes a bug which caused a split
- window to only preserve the display margins in one of the windows.
- When splitting horizontally, call adjust_window_margins on both
- windows to ensure that the text area of the new windows is non too
- narrow. This fixes a bug which could cause Emacs to trap if the
- width of the split window was less than the width of the display
- margins.
- (window_box_text_cols): Rename from window_internal_width.
- All uses changed. Adapt to per-window fringes and scroll bars.
- Fix bug that caused vertical separator to be subtracted also on
- window frames. Fix another bug that did not reduce the returned
- value by the columns used for display margins.
- (window_scroll_line_based): Fix bug related to scrolling too much
- when display margins are present (implicitly fixed by the fix to
- window_box_text_cols).
- (scroll_left, scroll_right): Fix bug related to scrolling too far
- by default when display margins are present (implicitly fixed by
- the fix to window_box_text_cols).
- (struct saved_window): Rename members left to left_col, top to
- top_line, width to total_cols, height to total_lines, orig_top to
- orig_top_line, orig_height to orig_total_lines. All uses changed.
- New members left_margin_cols, right_margin_cols,
- left_fringe_width, right_fringe_width, fringes_outside_margins,
- scroll_bar_width, and vertical_scroll_bar_type for saving
- per-window display elements.
- (Fset_window_configuration): Restore display margins, fringes,
- and scroll bar settings. This fixes a bug which caused display
- margins to be discarded when saving and restoring a window
- configuration.
- (save_window_save): Save display margins, fringes, and scroll bar
- settings. This fixes a bug which caused display margins to be
- discarded when saving and restoring a window configuration.
- (Fset_window_margins): Do nothing if display margins are not
- really changed. Otherwise, call adjust_window_margins to ensure
- the text area doesn't get too narrow. This fixes a bug which
- could cause Emacs to trap if setting display margins wider than
- the width of the window.
- (Fset_window_fringes): New defun to allow user to specifically set
- this window's fringe widths and position vs. display margins.
- (Fwindow_fringes): New defun to return window's actual fringe settings.
- (Fset_window_scroll_bars): New defun to allow user to specifically
- set this window's scroll bar width and position.
- (Fwindow_scroll_bars): New defun to return window's actual scroll
- bar settings.
- (compare_window_configurations): Also compare display margins,
- fringes, and scroll bar settings.
- (syms_of_window): Defsubr new defuns for fringe and scroll bars.
-
- * xdisp.c: Make (many) trivial substitutions for renamed and
- new macros in dispextern.h, frame.h and window.h.
- (window_box_width): Adapt to per-window fringes and scroll bars,
- and new fringe vs. display margin position. Note that returned
- value is no longer guaranteed to be a whole multiple of the frame
- column width, since per-window fringes may now be any width.
- (window_box_left_offset): New function like window_box_left, but
- value is relative to left border of window (rather than frame).
- (window_box_right_offset): New function like window_box_right,
- but value is relative to left border of window.
- (window_box_left): Adapt to per-window fringes and scroll bars,
- and new fringe vs. display margin position. Simplify by using
- WINDOW_LEFT_EDGE_X and window_box_left_offset.
- (window_box): Allow null args for unnecessary return values;
- change/simplify relevant callers.
- (x_y_to_hpos_vpos): Adapt to per-window fringes and scroll bars,
- and new fringe vs. display margin position.
- Use window_box_left_offset and window_box_right_offset
- (get_glyph_string_clip_rect): Adapt to per-window fringes and
- scroll bars, and new fringe vs. display margin position.
- Use WINDOW_LEFT_EDGE_X and WINDOW_TOTAL_WIDTH.
- (draw_fringe_bitmap): Rework to handle per-window fringes and new
- fringe vs. display margin position.
- (hscroll_window_tree): Use window_box_width instead of window_box.
- (redisplay_window): Adapt to per-window scroll bars.
- (draw_glyphs): Rework to handle per-window fringes and scroll
- bars, and new fringe vs. display margin position.
- Use WINDOW_LEFT_EDGE_X, WINDOW_TOTAL_WIDTH, and window_box_left.
- (x_clear_end_of_line): Adapt to per-window fringes and scroll
- bars, and new fringe vs. display margin position. Fix bug which
- increased total width of full_width rows by width of scroll bars
- although window's total width already includes that.
- (x_fix_overlapping_area): Simplify using window_box_left_offset.
- (expose_area): Simplify using window_box_left_offset.
- (x_draw_vertical_border): Handle per-window scroll bar settings,
- mixing windows with left, right and no scroll bars.
-
- * xfaces.c [WINDOWSNT]: Move redefinition of FONT_WIDTH macro to
- where it's used in x_list_fonts (for clarity).
- (frame_update_line_height): Remove unused function; functionality
- is now done directly when setting the default font in x_set_font.
-
- * xfns.c: Make (many) trivial substitutions for renamed and
- new macros in dispextern.h, frame.h and window.h.
-
- * xmenu.c: Make (some) trivial substitutions for renamed and
- new macros in dispextern.h, frame.h and window.h.
-
- * xterm.h (struct x_output): Move members left_pos, top_pos,
- border_width, pixel_height, pixel_width, line_height,
- internal_border_width, vertical_scroll_bar_extra,
- left_fringe_width, right_fringe_width, fringe_cols,
- fringes_extra, win_gravity, size_hint_flags, want_fullscreen,
- x_pixels_diff, and y_pixels_diff to struct frame (frame.h).
- (FRAME_INTERNAL_BORDER_WIDTH, FRAME_LINE_HEIGHT): Move to frame.h.
- (FRAME_DEFAULT_FONT_WIDTH): Remove macro.
- (PIXEL_WIDTH, PIXEL_HEIGHT)
- (FRAME_X_FRINGE_COLS, FRAME_X_FRINGE_WIDTH)
- (FRAME_X_LEFT_FRINGE_WIDTH, FRAME_X_RIGHT_FRINGE_WIDTH): Move to
- frame.h and renamed [see frame.h changes].
- (CHAR_TO_PIXEL_ROW, CHAR_TO_PIXEL_COL, CHAR_TO_PIXEL_WIDTH)
- (CHAR_TO_PIXEL_HEIGHT, PIXEL_TO_CHAR_ROW, PIXEL_TO_CHAR_COL)
- (PIXEL_TO_CHAR_WIDTH, PIXEL_TO_CHAR_HEIGHT): Move to frame.h
- and renamed [see frame.h changes].
-
- * xterm.c: Make (several) trivial substitutions for renamed and
- new macros in dispextern.h, frame.h and window.h.
- (x_draw_glyph_string_box): Adapt to per-window fringes and scroll-bars.
- (scroll_run): Adapt to new fringe position.
- (glyph_rect): Use window coordinates returned from
- window_from_coordinates rather than frame_to_window_pixel_xy.
- (XTset_vertical_scroll_bar): Adapt to per-window fringes and
- scroll-bars.
- (handle_one_xevent): Simplify a USE_GTK conditional.
- (x_clip_to_row): Remove superfluous whole_line_p arg and code
- (fringes are now inside margins, i.e. always in the clipping area).
- All callers changed.
- (x_new_font): Set FRAME_COLUMN_WIDTH and FRAME_LINE_HEIGHT
- directly, then call compute_fringe_widths. Don't call
- frame_update_line_height.
-
- * w32term.h (struct w32_output): Move members left_pos, top_pos,
- border_width, pixel_height, pixel_width, line_height,
- internal_border_width, vertical_scroll_bar_extra,
- left_fringe_width, right_fringe_width, fringe_cols,
- fringes_extra, win_gravity, size_hint_flags, want_fullscreen,
- x_pixels_diff, and y_pixels_diff to struct frame (frame.h).
- (FRAME_INTERNAL_BORDER_WIDTH, FRAME_LINE_HEIGHT): Move to frame.h.
- (FRAME_DEFAULT_FONT_WIDTH): Remove macro.
- (PIXEL_WIDTH, PIXEL_HEIGHT)
- (FRAME_X_FRINGE_COLS, FRAME_X_FRINGE_WIDTH)
- (FRAME_X_LEFT_FRINGE_WIDTH, FRAME_X_RIGHT_FRINGE_WIDTH): Move to
- frame.h and renamed [see frame.h changes].
- (CHAR_TO_PIXEL_ROW, CHAR_TO_PIXEL_COL, CHAR_TO_PIXEL_WIDTH)
- (CHAR_TO_PIXEL_HEIGHT, PIXEL_TO_CHAR_ROW, PIXEL_TO_CHAR_COL)
- (PIXEL_TO_CHAR_WIDTH, PIXEL_TO_CHAR_HEIGHT): Move to frame.h
- and renamed [see frame.h changes].
-
- * w32term.c: Make (several) trivial substitutions for renamed and
- new macros in dispextern.h, frame.h and window.h.
- (x_draw_glyph_string_box): Adapt to per-window fringes and scroll-bars.
- (glyph_rect): Use window coordinates returned from
- window_from_coordinates rather than frame_to_window_pixel_xy.
- (XTset_vertical_scroll_bar): Adapt to per-window fringes and
- scroll-bars.
- (w32_clip_to_row): Remove superfluous whole_line_p arg and code
- (fringes are now inside margins, i.e. always in the clipping area).
- All callers changed.
- (x_new_font): Set FRAME_COLUMN_WIDTH and FRAME_LINE_HEIGHT
- directly, then call compute_fringe_widths. Don't call
- frame_update_line_height.
-
- * w32console.c: Make (few) trivial substitutions for renamed and
- new macros in dispextern.h, frame.h and window.h.
-
- * w32fns.c: Make (many) trivial substitutions for renamed and
- new macros in dispextern.h, frame.h and window.h.
-
- * w32menu.c: Make (few) trivial substitutions for renamed and
- new macros in dispextern.h, frame.h and window.h.
-
- * macterm.h (struct mac_output): Move members left_pos, top_pos,
- border_width, pixel_height, pixel_width, line_height,
- internal_border_width, vertical_scroll_bar_extra,
- left_fringe_width, right_fringe_width, fringe_cols,
- fringes_extra, win_gravity, size_hint_flags, want_fullscreen,
- x_pixels_diff, y_pixels_diff to struct frame (frame.h).
- (FRAME_INTERNAL_BORDER_WIDTH, FRAME_LINE_HEIGHT): Move to frame.h.
- (FRAME_DEFAULT_FONT_WIDTH): Remove macro.
- (PIXEL_WIDTH, PIXEL_HEIGHT)
- (FRAME_X_FRINGE_COLS, FRAME_X_FRINGE_WIDTH)
- (FRAME_X_LEFT_FRINGE_WIDTH, FRAME_X_RIGHT_FRINGE_WIDTH): Move to
- frame.h and renamed [see frame.h changes].
- (CHAR_TO_PIXEL_ROW, CHAR_TO_PIXEL_COL, CHAR_TO_PIXEL_WIDTH)
- (CHAR_TO_PIXEL_HEIGHT, PIXEL_TO_CHAR_ROW, PIXEL_TO_CHAR_COL)
- (PIXEL_TO_CHAR_WIDTH, PIXEL_TO_CHAR_HEIGHT): Move to frame.h
- and renamed [see frame.h changes].
-
- * macterm.c: Make (several) trivial substitutions for renamed and
- new macros in dispextern.h, frame.h and window.h.
- (x_draw_glyph_string_box): Adapt to per-window fringes and scroll-bars.
- (glyph_rect): Use window coordinates returned from
- window_from_coordinates rather than frame_to_window_pixel_xy.
- (XTset_vertical_scroll_bar): Adapt to per-window fringes and
- scroll-bars.
- (x_clip_to_row): Remove superfluous whole_line_p arg and code
- (fringes are now inside margins, i.e. always in the clipping area).
- All callers changed.
- (x_new_font): Set FRAME_COLUMN_WIDTH and FRAME_LINE_HEIGHT
- directly, then call compute_fringe_widths. Don't call
- frame_update_line_height.
-
- * macfns.c: Make (several) trivial substitutions for renamed and
- new macros in dispextern.h, frame.h and window.h.
- (x_real_positions): Set f->x_pixels_diff and f->y_pixels_diff to 0.
-
- * macmenu.c: Make (few) trivial substitutions for renamed and
- new macros in dispextern.h, frame.h and window.h.
-
- * msdos.h (struct x_output): Remove members left_pos, top_pos,
- and line_height, and use corresponding new members in struct
- frame. All uses changed.
- (FRAME_LINE_HEIGHT, FRAME_INTERNAL_BORDER_WIDTH): Remove macros;
- superseeded by corresponding macros in frame.h.
-
- * msdos.c: Make (several) trivial substitutions for renamed and
- new macros in dispextern.h, frame.h and window.h.
- (IT_note_mouse_highlight): Use updated window coordinates returned
- by window_from_coordinates, rather than adjusting them locally.
- (internal_terminal_init): No need to initialize line_height here;
- it now defaults to 1.
-
-2003-05-24 Stefan Monnier <[email protected]>
-
- * keyboard.c (read_key_sequence): Adjust fkey and keytran when
- dropping `down' events.
-
-2003-05-24 Andreas Schwab <[email protected]>
-
- * coding.c (find_safe_codings): Fix last change.
-
-2003-05-24 Istvan Marko <[email protected]> (tiny change)
-
- * xfns.c (x_window): Fix typo from 2003-05-21 change.
-
-2003-05-23 Stefan Monnier <[email protected]>
-
- * xdisp.c (display_mode_element): Increase max depth.
- Simplify the error handling code. Use a different error string
- for the case where we hit the depth limit.
-
- * lisp.h (Vfundamental_mode_abbrev_table): Don't declare.
-
- * buffer.c (reset_buffer_local_variables): Remove redundant setting.
-
-2003-05-21 Stefan Monnier <[email protected]>
-
- * intervals.c (get_local_map): Don't get char-property of previous
- point any more: get_pos_property already does it and better.
-
-2003-05-21 Dave Love <[email protected]>
-
- [Merged from unicode branch.]
-
- * xfns.c (x_window, x_window): Use use_xim.
-
- * xterm.c (use_xim): Initialize.
- (xim_open_dpy, xim_initialize, xim_close_dpy): Use use_xim.
- (x_term_init): Maybe set use_xim.
-
- * xterm.h (use_xim) [HAVE_X_I18N]: Declare.
-
-2003-05-21 Jason Rumney <[email protected]>
-
- * unexw32.c (_start): Remove _fmode initialization.
-
- * emacs.c (main) [WINDOWSNT]: Move it here.
-
-2003-05-20 Dave Love <[email protected]>
-
- * s/gnu-linux.h (MAIL_USE_FLOCK): Make it conditional.
-
-2003-05-19 Richard M. Stallman <[email protected]>
-
- * xfaces.c (Finternal_set_lisp_face_attribute): Handle Qunspecified
- as value for QCfont attribute.
- (realize_default_face): lface should already exist; crash if not.
- Specify 0 for FORCE_P when calling set_lface_from_font_name.
-
- * frame.c (Fignore_event): Doc fix.
-
-2003-05-19 Kenichi Handa <[email protected]>
-
- * coding.c (decode_coding_string): Handle post-read-conversion
- even if the coding doesn't require decoding.
-
-2003-05-18 Richard M. Stallman <[email protected]>
-
- * callproc.c (Fcall_process_region): Doc fix.
-
-2003-05-17 Stefan Monnier <[email protected]>
-
- * lread.c (Fload): Print a message if package is obsolete.
-
- * window.c (Fselect_window): Add optional `norecord' arg.
- (select_window_1): Fold into Fselect_window.
- (select_window_norecord): New function.
- (temp_output_buffer_show): Use it. Preserve current buffer.
-
- * window.h (Fselect_window): Update declaration.
-
- * window.c (delete_window, Fother_window, Fset_window_configuration):
- * minibuf.c (read_minibuf):
- * macterm.c (x_new_focus_frame):
- * frame.c (do_switch_frame, Fset_frame_selected_window, Fdelete_frame):
- * callint.c (Fcall_interactively):
- * xterm.c (x_new_focus_frame): Pass nil as new arg to Fselect_window.
-
- * buffer.c (Fpop_to_buffer): Pass norecord to Fselect_window.
-
-2003-05-17 David Kastrup <[email protected]>
-
- * process.c (read_process_output): Back out change from 2003-03-09.
-
-2003-05-17 Stefan Monnier <[email protected]>
-
- * editfns.c (get_pos_property): Don't assume that `object' = nil.
-
- * textprop.c (text_property_stickiness): New arg `buffer'.
-
- * intervals.h (text_property_stickiness): New arg `buffer'.
- (get_pos_property): Declare.
-
- * intervals.c (get_local_map): Use get_pos_property, to obey
- stickiness and empty overlays.
- (create_root_interval, graft_intervals_into_buffer): Use BEG.
- (merge_properties, intervals_equal, merge_properties_sticky):
- Use XCAR, XCDR.
- (adjust_for_invis_intang): Pass new arg to text_property_stickiness.
-
-2003-05-17 Richard M. Stallman <[email protected]>
-
- * minibuf.c (read_minibuf): If buffer is empty, record the default
- in the history.
- (Fminibuffer_complete_word): When deleting the overlap, take account
- of its real position.
-
- * fns.c (map_char_table): Fix previous change.
-
- * syntax.c (find_defun_start):
- When open_paren_in_column_0_is_defun_start,
- return beginning of buffer.
-
- * lisp.h (map_char_table): Declare added arg.
-
- * fns.c (map_char_table): New arg TABLE gets the master table.
- All calls changed.
- Process default and inheritance, resorting to Faref if necessary.
-
- * keymap.c (Fset_keymap_parent, map_keymap, Fcopy_keymap)
- (Faccessible_keymaps): Pass new arg to map_char_table.
-
- * fontset.c (Ffontset_info): Pass new arg to map_char_table.
-
- * casetab.c (set_case_table): Pass new arg to map_char_table.
-
- * data.c (let_shadows_buffer_binding_p): Make target of p volatile.
-
- * lisp.h (specbinding_func): New typedef.
- (struct specbinding): Use specbinding_func, to put the `volatile'
- in the right place.
-
- * alloc.c (Fgarbage_collect): Cast pointers into specpdl
- to avoid GCC warning.
-
-2003-05-16 Ralph Schleicher <[email protected]>
-
- * fileio.c (Fdelete_file): Handle symlinks pointing to directories.
-
-2003-05-15 Stefan Monnier <[email protected]>
-
- * keyboard.c (apply_modifiers): Don't fill the other cache.
-
-2003-05-14 Stefan Monnier <[email protected]>
-
- * .gdbinit-union: New file, for USE_LISP_UNION_TYPE users.
-
- * window.h (Qwindowp, Qwindow_live_p, Vwindow_list)
- (Fwindow_end, Fselected_window, Fdelete_window, Fwindow_buffer)
- (Fget_buffer_window, Fsave_window_excursion, Fsplit_window)
- (Fset_window_configuration, Fcurrent_window_configuration)
- (compare_window_configurations, Fcoordinates_in_window_p, Fwindow_at)
- (Fpos_visible_in_window_p, mark_window_cursors_off)
- (window_internal_height, window_internal_width, Frecenter)
- (Fscroll_other_window, Fset_window_start, temp_output_buffer_show)
- (replace_buffer_in_all_windows, init_window_once, init_window)
- (syms_of_window, keys_of_window): Move from lisp.h.
- * lisp.h: Move window.c declarations to window.h.
-
- * bytecode.c: Include window.h.
- * emacs.c: Include window.h.
-
- * keyboard.c (make_lispy_event): Apply modifiers to multibyte-char key.
- (keyremap): Add `parent' field.
- (keyremap_step): Use it. Remove `parent' argument.
- (read_key_sequence): Setup and use the new `parent' field.
-
-2003-05-11 Stefan Monnier <[email protected]>
-
- * keyboard.c (adjust_point_for_property): Ensure termination.
-
-2003-05-10 Stefan Monnier <[email protected]>
-
- * keyboard.c (follow_key): Remove dead variable `did_meta'.
- (access_keymap_keyremap, keyremap_step): New funs, extracted from the
- duplicated handling of function-key-map and key-translation-map
- in read_key_sequence.
- (read_key_sequence): Use them.
-
- * keyboard.c (adjust_point_for_property): Try harder to move point
- to the non-sticky end of an invisible property.
-
- * xdisp.c (single_display_prop_intangible_p): Make `space' display
- property intangible as well.
-
-2003-05-10 Andreas Schwab <[email protected]>
-
- * xmenu.c (single_menu_item): Change last parameter to void* to
- avoid warning.
-
-2003-05-09 Richard M. Stallman <[email protected]>
-
- * print.c (Fprin1_to_string): Instead of gcpro, set abort_on_gc.
- Bind Qinhibit_modification_hooks to t so there will be no GC.
- Rename local `tem' to `save_deactivate_mark'.
-
- * eval.c (specpdl_ptr): Declare volatile.
- (unbind_to): Copy the whole binding and decrement specpdl_ptr
- before doing the work of unbinding it.
-
- * lisp.h (struct specbinding): Declare elements volatile.
- (specpdl_ptr): Declare volatile.
-
- * Makefile.in (alloca.o): Specify -DDO_BLOCK_INPUT in compiling.
-
- * alloca.c: Test DO_BLOCK_INPUT rather than `emacs'
- for use of BLOCK_INPUT and inclusion of lisp.h and blockinput.h.
-
-2003-05-08 Dave Love <[email protected]>
-
- * coding.c (Vlast_coding_system_used): Doc fix.
-
-2003-05-07 Jason Rumney <[email protected]>
-
- * fileio.c (Ffile_symlink_p): Let handlers handle symlinks even
- when system does not support them.
-
-2003-05-05 Stefan Monnier <[email protected]>
-
- * fileio.c (Qwrite_region_annotate_functions): New var.
- (build_annotations): Use it to process the global part of the hook.
- (syms_of_fileio): Init and staticpro it.
-
- * keyboard.c (safe_run_hooks_error): Display a message instead of
- silently ignoring the error.
-
-2003-05-03 Stefan Monnier <[email protected]>
-
- * keyboard.c (input_available_signal): Mark static.
- (menu_bar_items): Use map_keymap.
- (menu_bar_one_keymap): Remove.
- (menu_bar_item): Adjust arglist (for use in map_keymap).
- Properly hide a second binding when not both are keymaps.
-
- * xmenu.c (struct skp): New struct, to pass args through map_keymap.
- (single_keymap_panes): Use it and map_keymap.
- (single_menu_item): Use skp as well.
-
- * keymap.h (map_keymap_function_t): New type.
- (map_keymap): Declare.
-
- * keymap.c (map_keymap_item, map_keymap_char_table_item, map_keymap)
- (map_keymap_call, Fmap_keymap): New functions.
- (syms_of_keymap): Defsubr map-keymap.
-
-2003-05-02 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (create_dialog, make_widget_for_menu_item)
- (make_menu_item, create_menus, xg_update_menu_item): Don't call
- ..._with_mnemonic functions for menu items.
-
-2003-05-01 Kenichi Handa <[email protected]>
-
- * coding.c (coding_system_accept_latin_extra_p): Delete this
- function.
- (find_safe_codings): Pay attention to
- the property tranlsation-table-for-encode of each codings.
- (syms_of_coding): Give Qtranslation_table the extra slot number 2.
-
-2003-05-01 Stefan Monnier <[email protected]>
-
- * eval.c (Funwind_protect): Use func=Fprogn rather than symbol=Qnil.
-
-2003-04-30 Stefan Monnier <[email protected]>
-
- * eval.c (unbind_to): Don't handle symbol = Qnil any more.
-
- * lisp.h (CHECK): Wrap args in parenthesis.
- (specbind): Fix doc: symbol = Qnil is not supported any more.
-
- * bytecode.c (Fbyte_code) <unwind-protect>:
- Use Fprogn rather than 0 and Qnil.
-
- * keyboard.c (parse_modifiers_uncached): Parse `down', `drag',
- `double', and `triple' modifiers as well.
-
-2003-04-30 Richard M. Stallman <[email protected]>
-
- * keyboard.c (echo_char): Don't clear out a dash that follows a space.
-
- * alloc.c (abort_on_gc): New variable.
- (Fgarbage_collect): Abort if abort_on_gc is set.
-
- * lisp.h (abort_on_gc): Add decl.
-
- * eval.c (Fsignal): Clear abort_on_gc.
-
- * editfns.c (Fformat): Set abort_on_gc during first scan of format.
- Reinit FORMAT_START and END before second scan.
-
- * xdisp.c (move_it_vertically_backward): Do the final big else
- even if nlines is 0.
-
- * xdisp.c (redisplay_internal): Finish the per-frame loop
- even if redisplay is suspended by input.
-
-2003-04-24 Andrew Choi <[email protected]>
-
- * macterm.c (x_list_fonts): Return all fonts that match if
- maxnames = -1.
-
-2003-04-25 Kenichi Handa <[email protected]>
-
- * syntax.c (skip_chars): Fix previous change.
-
-2003-04-24 Kenichi Handa <[email protected]>
-
- * syntax.c (skip_chars): Make the code faster by using the common
- technique of *p, *stop, and *endp.
-
-2003-04-23 Jan Dj,Ad(Brv <[email protected]>
-
- * xdisp.c (update_tool_bar): BLOCK_INPUT before calling
- tool_bar_items so GTK tool bar expose callback does not access items
- being updated.
-
-2003-04-19 Stefan Monnier <[email protected]>
-
- * eval.c (Fapply): Undo last change and add a comment about why.
-
-2003-04-18 Miles Bader <[email protected]>
-
- * data.c (Faset): Calculate nbytes earlier, to satisfy the now
- pickier PARSE_MULTIBYTE_SEQ.
-
-2003-04-17 Stefan Monnier <[email protected]>
-
- * eval.c (For, Fand, Fprogn, un_autoload, do_autoload):
- Use XCDR, XCAR, CONSP.
- (Fdefmacro): Fix docstring. Use XCAR, XCDR.
- (Fapply): Remove unnecessary GCPRO.
-
- * doc.c (Fsubstitute_command_keys): Remove spurious casts.
-
- * charset.h (PARSE_MULTIBYTE_SEQ): Pretend `length' is used.
-
- * buffer.h: Don't hardcode BEG==1.
-
- * abbrev.c (Fdefine_abbrev_table): Use XCAR, XCDR.
-
-2003-04-16 Richard M. Stallman <[email protected]>
-
- * xdisp.c (try_window, try_window_reusing_current_matrix):
- When at end of window, set window_end_pos to Z-ZV.
-
- * buffer.c (Foverlay_recenter): Doc fix.
-
-2003-04-14 Stefan Monnier <[email protected]>
-
- * dispnew.c (Fsit_For): Support XEmacs-style arg list.
-
-2003-04-14 Andrew Choi <[email protected]>
-
- * macterm.c (mac_check_for_quit_char): Don't check more often than
- once a second.
-
-2003-04-11 Stefan Monnier <[email protected]>
-
- * keyboard.c (kbd_buffer_get_event): Don't handle SELECT_WINDOW_EVENT
- specially, so that they can't hide an implicit switch-frame event.
- (make_lispy_event): Handle SELECT_WINDOW_EVENT.
- (head_table): Use switch-frame as event_kind for select-window.
- (keys_of_keyboard): Don't bind [select-window] in special-event-map.
-
- * editfns.c (Fformat): Lisp_Object/int mixup.
- (format2): Remove unused var numargs.
-
-2003-04-11 Kenichi Handa <[email protected]>
-
- * fileio.c (Vafter_insert_file_adjust_coding_function): Delete.
- (Qafter_insert_file_set_coding): New variable.
- (syms_of_fileio): Initialize and staticpro it. Delete declaration
- for after-insert-file-adjust-coding-function.
- (Finsert_file_contents): Call Qafter_insert_file_set_coding
- instead of Vafter_insert_file_adjust_coding_function.
-
-2003-04-11 Kenichi Handa <[email protected]>
-
- * lisp.h (temp_echo_area_glyphs): Adjust prototype.
-
- * minibuf.c (temp_echo_area_glyphs): Change the arg to Lisp
- string. Callers changed.
-
-2003-04-10 Kenichi Handa <[email protected]>
-
- * fileio.c (Vafter_insert_file_adjust_coding_function): New variable.
- (syms_of_fileio): Declare it as a lisp variable.
- (Finsert_file_contents):
- Call Vafter_insert_file_adjust_coding_function before calling
- decode-format.
-
-2003-04-09 Jan Dj,Ad(Brv <[email protected]>
-
- * xterm.c (xg_scroll_callback): Call gtk_range_get_adjustment to
- get GtkAdjustment as widget now is a GtkRange.
-
- * gtkutil.c (xg_create_scroll_bar): Connect to value-changed on
- GtkRange to avoid memory leak.
-
-2003-04-09 Kenichi Handa <[email protected]>
-
- * xfaces.c (Vface_font_rescale_alist): New variable.
- (struct font_name): New member rescale_ratio.
- (font_rescale_ratio): New function.
- (split_font_name): If NUMERIC_P is nonzero, set font->rescale_ratio.
- (better_font_p): On comparing point sized, pay attention to
- recale_ratio member of fonts.
- (build_scalable_font_name): Reflect font->rescale_ratio in the
- font name.
- (syms_of_xfaces): Declare Vface_font_rescale_alist as a Lisp variable.
-
- * lread.c (read1): Before calling index, check if the 2nd
- arguemnt is in ASCII range.
-
-2003-04-08 Richard M. Stallman <[email protected]>
-
- * fileio.c (Ffile_symlink_p): Doc fix.
-
- * editfns.c (Fformat): Translate positions of text properties
- in the format string to apply them to the result.
-
- * fileio.c (Finsert_file_contents): Doc fix.
- (syms_of_fileio) <after-insert-file-functions>: Doc fix.
-
-2003-04-08 Ivan Zakharyaschev <[email protected]> (tiny change)
-
- * lread.c (openp): Get the Qfile_exists_p handler for STRING, not FN.
-
-2003-04-08 Steven Tamm <[email protected]>
-
- * mac.c (init_mac_osx_environment): Switch libexec and bin so
- that self-contained application finds libexec files.
-
-2003-04-08 Kenichi Handa <[email protected]>
-
- * coding.c (code_convert_region_unwind):
- Set Vlast_coding_system_used to the argument.
- (code_convert_region): If post-read-conversion function changed
- the value of last-coding-sytem, keep the new value in
- coding->symbol so that it won't be overridden.
- (run_pre_post_conversion_on_str): Likewise.
- (coding_system_accept_latin_extra_p): New function.
- (find_safe_codings): Pay attention to characters registered in
- latin-extra-code-table.
-
-2003-04-07 Thien-Thi Nguyen <[email protected]>
-
- * Makefile.in (md5.o): Add missing dependency info.
-
-2003-04-06 Richard M. Stallman <[email protected]>
-
- * xselect.c (x_handle_selection_request): Move UNGCPRO to very end.
-
- * marker.c (verify_bytepos): New function.
-
- * intervals.c (set_intervals_multibyte_1): When becoming
- multibyte, adjust right and left child sizes to a whole set of
- characters. If an interval gets zero total-length, delete it.
- If an interval consists of just its children, delete one of them.
-
- * intervals.h (CHECK_TOTAL_LENGTH): New macro.
- * intervals.c: Add many calls to CHECK_TOTAL_LENGTH.
-
- * alloc.c (VALIDATE_LISP_STORAGE): Macro deleted.
- All calls deleted.
- (lisp_malloc): Do the work here directly.
-
-2003-04-06 Gareth Jones <[email protected]> (tiny change)
-
- * fns.c (Flength): Return SUB_CHAR_TABLE_ORDINARY_SLOTS for sub
- char tables.
-
-2003-04-04 Kenichi Handa <[email protected]>
-
- * editfns.c (Fformat): Use a copy of FORMAT string so that we can
- destructively change "%S" to "%s".
-
-2003-04-03 Miles Bader <[email protected]>
-
- * xfaces.c (choose_face_font): Make sure *NEEDS_OVERSTRIKE is
- always set.
-
-2003-04-01 Dave Love <[email protected]>
-
- * xfns.c (xpm_lookup_color): Grok "opaque".
-
-2003-03-31 Andrew Choi <[email protected]>
-
- * frame.c (x_report_frame_params) [HAVE_CARBON]: Do not report
- parent window ID.
-
- * macfns.c (syms_of_macfns): Remove call to init_x_parm_symbols.
-
- * macterm.h (struct mac_output): Define x_pixels_diff and
- y_pixels_diff.
-
-2003-03-31 Juanma Barranquero <[email protected]>
-
- * makefile.w32-in ($(BLD)/frame.$(O)): Add dependency on
- blockinput.h and files included from it.
-
-2003-03-31 Kim F. Storm <[email protected]>
-
- The following changes consolidates the common code related to
- frame-parameter handling from the xfns.c, w32fns.c, and macfns.c
- files into frame.c.
-
- * frame.c: Include blockinput.h.
- (Vx_resource_name, Vx_resource_class, Qx_frame_parameter)
- (Qx_resource_name, Qface_set_after_frame_default): Define vars here.
- (Qauto_raise, Qauto_lower, ...): Define all frame parameter
- related vars here.
- (struct frame_parm_table, frame_parms): New table for describing
- frame parameters and their associated Q-variable.
- The order of the parameters corresponds to the sequence of the
- frame_parm_handlers table in redisplay_interface.
- (x_fullscreen_move, x_set_frame_parameters)
- (x_report_frame_params, x_set_fullscreen, x_set_line_spacing)
- (x_set_screen_gamma, x_set_font, x_set_fringe_width)
- (x_set_border_width, x_set_internal_border_width, x_set_visibility)
- (x_set_autoraise, x_set_autolower, x_set_unsplittable)
- (x_set_vertical_scroll_bars, x_set_scroll_bar_width, x_icon_type):
- Generic functions for processing of frame parameters.
- (validate_x_resource_name, xrdb_get_resource, Fx_get_resource)
- (display_x_get_resource, x_get_resource_string): Functions for
- generic access to X resources.
- (x_get_arg, x_frame_get_arg, x_frame_get_and_record_arg)
- (x_default_parameter, Fx_parse_geometry): Functions for generic
- access to frame parameters.
- (x_figure_window_size): Generic calculation of frame size.
- Fixed to add space needed for tool bar. Also setup size_hint_flags.
- (syms_of_frame): Intern and staticpro frame parameter variables.
- Defvar_lisp Vx_resource_class and Vx_resource_name here.
- Defsubr Sx_get_resource and Sx_parse_geometry.
-
- * frame.h (Qauto_raise, Qauto_lower, ...): Declare extern all frame
- parameter related vars defined in frame.c.
- (EMACS_CLASS): Define here.
- (enum FULLSCREEN_*): Define here.
- (x_set_scroll_bar_default_width, x_wm_set_icon_position)
- (x_set_offset, x_new_font, x_new_fontset): Add prototypes.
- (x_fullscreen_adjust, x_set_frame_parameters, x_report_frame_params)
- (x_set_fullscreen, x_set_line_spacing, x_set_screen_gamma, x_set_font)
- (x_set_fringe_width, x_set_border_width, x_set_internal_border_width)
- (x_set_visibility, x_set_autoraise, x_set_autolower)
- (x_set_unsplittable, x_set_vertical_scroll_bars)
- (x_set_scroll_bar_width, x_icon_type, validate_x_resource_name)
- (x_figure_window_size): Add prototypes.
-
- * dispextern.h (frame_parm_handler): New typedef.
- (struct redisplay_interface): New member frame_parm_handlers.
- (enum resource_types): Move declaration here.
- (x_get_arg, x_frame_get_arg, x_frame_get_and_record_arg)
- (x_default_parameter): Add prototypes.
-
- * window.c: Remove extern decl for frame parameter vars.
- (change_window_heights): New generic function;
- replaces x_change_window_heights. All users changed.
-
- * window.h (change_window_heights): Add prototype.
-
- * xfaces.c: Remove extern decl for frame parameter vars.
-
- * xterm.h (EMACS_CLASS): Remove. Use generic define.
- (struct w32_display_info): Fix type of xrdb member.
- (enum FULLSCREEN_*): Remove.
- Remove prototypes for generic functions (in frame.h).
-
- * xfns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
- parameters now defined in frame.h and frame.c.
- (Vx_resource_name): Remove. Use generic var.
- (enum x_frame_parms): Remove (bogus, unused enum).
- (check_x_display_info): Make non-static (for frame.c).
- (struct x_frame_parm_table, x_frame_parms): Remove.
- (init_x_parm_symbols, x_set_frame_parameters, x_report_frame_params)
- (x_set_line_spacing, x_set_screen_gamma, x_icon_type, x_set_font)
- (x_set_border_width, x_set_internal_border_width, x_set_visibility)
- (x_change_window_heights, x_set_autoraise, x_set_autolower)
- (x_set_vertical_scroll_bars, x_set_scroll_bar_width)
- (validate_x_resource_name, Fx_get_resource, x_get_resource_string)
- (x_default_parameter, Fx_parse_geometry, x_figure_window_size):
- Remove. Use generic functions instead.
- (enum resource_types): Remove.
- (x_set_scroll_bar_default_width): New global function (for frame.c).
- (Fx_create_frame): Depend on x_figure_window_size to add space for
- toolbar and setup size_hint_flags.
- (x_frame_parm_handlers): New table for redisplay_interface.
- (syms_of_xfns): Don't intern/staticpro removed vars.
-
- * xterm.c: Remove unnecessary extern declarations.
- (x_fullscreen_adjust): Remove. Use generic instead.
- (x_redisplay_interface): Add x_frame_parm_handlers member.
-
- * w32gui.h (XrmDatabase): New (dummy) typedef.
-
- * w32term.h (EMACS_CLASS): Remove. Use generic define.
- (struct w32_display_info): Fix type of xrdb member.
- (enum FULLSCREEN_*): Remove.
- (x_fullscreen_adjust): Remove prototype.
-
- * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
- parameters now defined in frame.h and frame.c.
- (Vx_resource_name): Remove. Use generic var.
- (enum x_frame_parms): Remove (bogus, unused enum).
- (check_x_display_info): Make non-static (for frame.c).
- (struct x_frame_parm_table, x_frame_parms): Remove.
- (init_x_parm_symbols, x_set_frame_parameters, x_report_frame_params)
- (x_set_line_spacing, x_set_screen_gamma, x_icon_type, x_set_font)
- (x_set_border_width, x_set_internal_border_width, x_set_visibility)
- (x_change_window_heights, x_set_autoraise, x_set_autolower)
- (x_set_vertical_scroll_bars, x_set_scroll_bar_width)
- (validate_x_resource_name, Fx_get_resource, x_get_resource_string)
- (x_default_parameter, Fx_parse_geometry, x_figure_window_size):
- Remove. Use generic functions instead.
- (enum resource_types): Remove.
- (x_set_scroll_bar_default_width): New global function (for frame.c).
- (Fx_create_frame): Depend on x_figure_window_size to add space for
- toolbar and setup size_hint_flags.
- (w32_frame_parm_handlers): New table for redisplay_interface.
- (syms_of_w32fns): Don't intern/staticpro removed vars.
-
- * w32term.c: Remove unnecessary extern declarations.
- (x_fullscreen_adjust): Remove. Use generic instead.
- (x_redisplay_interface): Add w32_frame_parm_handlers member.
-
- * w32reg.c (x_get_string_resource): Use XrmDatabase.
-
- * macgui.h (XrmDatabase): New (dummy) typedef.
-
- * macterm.h (EMACS_CLASS): Remove.
- (struct mac_display_info): Add xrdb member.
- (struct mac_output): Add want_fullscreen member.
-
- * macfns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
- parameters now defined in frame.h and frame.c.
- (Vx_resource_name): Remove. Use generic var.
- (check_x_display_info): Make non-static (for frame.c).
- (struct x_frame_parm_table, x_frame_parms): Remove.
- (init_x_parm_symbols, x_set_frame_parameters, x_report_frame_params)
- (x_set_line_spacing, x_set_screen_gamma, x_icon_type, x_set_font)
- (x_set_border_width, x_set_internal_border_width, x_set_visibility)
- (x_change_window_heights, x_set_autoraise, x_set_autolower)
- (x_set_vertical_scroll_bars, x_set_scroll_bar_width)
- (validate_x_resource_name, Fx_get_resource, x_get_resource_string)
- (x_default_parameter, Fx_parse_geometry, x_figure_window_size):
- Remove. Use generic functions instead.
- (enum resource_types): Remove.
- (x_set_scroll_bar_default_width): New global function (for frame.c).
- (mac_frame_parm_handlers): New table for redisplay_interface.
- (syms_of_macfns): Don't intern/staticpro removed vars.
-
- * macterm.c: Remove unnecessary extern declarations.
- (x_redisplay_interface): Add mac_frame_parm_handlers member.
-
- * Makefile.in (frame.o): Add dependency on blockinput.h and files
- included from it (atimer.h and systime.h).
-
-2003-03-30 Andreas Schwab <[email protected]>
-
- * xdisp.c (x_insert_glyphs): Fix swapped width and height
- parameters for shift_glyphs_for_insert.
-
- * macterm.c (x_redisplay_interface): Add missing entry for
- draw_vertical_window_border.
-
-2003-03-29 Kai Gro,A_(Bjohann <[email protected]>
-
- * fileio.c (Fexpand_file_name): In the no-handler case, after
- expanding, look again for a handler and invoke it. This is needed
- for filenames like "/foo/../user@host:/bar/../baz" -- the first
- expansion produces "/user@host:/bar/../baz" which needs to be
- expanded again for the finame result "/user@host:/baz".
-
-2003-03-28 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (xg_tool_bar_item_expose_callback): Reduce size
- of area to be redrawn for better performance.
-
-2003-03-28 Stefan Monnier <[email protected]>
-
- * xterm.c (take_vertical_position_into_account): Remove.
- (xt_action_hook): Call set_vertical_scroll_bar if needed.
- (XM_SB_MIN, XM_SB_RANGE): Remove (min is now set to 0).
- (xm_scroll_callback, x_create_toolkit_scroll_bar)
- (x_set_toolkit_scroll_bar_thumb): Simplify.
- (x_scroll_bar_expose): Only compile if !USE_TOOLKIT_SCROLL_BARS.
- (XTread_socket): Remove unused var.
- (x_make_frame_invisible): Replace goto with else.
-
- * xdisp.c (set_vertical_scroll_bar): New fun.
- (redisplay_window): Use it.
-
-2003-03-26 Richard M. Stallman <[email protected]>
-
- * xdisp.c (update_tool_bar): Recompute tool bar if
- update_mode_lines is set. Set w->update_mode_line
- only if the tool bar contents actually change.
- (update_menu_bar): Undo previous change.
-
-2003-03-26 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (xg_resize_widgets): Don't call xg_frame_cleared.
- (xg_frame_set_char_size): Calculate scroll bar width before frame
- width. Call SET_FRAME_GARBAGED and cancel_mouse_face.
- (xg_separator_p): Check for all documented separator types.
- (xg_update_scrollbar_pos): Variable gheight not needed, use height.
- (update_frame_tool_bar): Don't call gdk_window_process_all_updates.
-
- * xdisp.c (update_menu_bar): Set w->update_mode_line to Qt
- so tool bar gets updated.
-
-2003-03-26 Stefan Monnier <[email protected]>
-
- * data.c (store_symval_forwarding): Re-instate part of the code
- that was deleted with too much enthusiasm.
-
-2003-03-25 Stefan Monnier <[email protected]>
-
- * data.c (store_symval_forwarding): Delete special read-only
- hack for type == -1, since we now use ->constant instead.
- (Fkill_local_variable): Don't use XBUFFER if it can be nil.
-
- * buffer.c (overlays_in): Declare static.
- (syms_of_buffer) <enable-multibyte-characters>: Use the symbol's
- `constant' field rather than the variable's `type' field.
-
-2003-03-24 Andrew Choi <[email protected]>
-
- * config.in [MAC_OSX]: Do not redefine bcopy, bzero, and bcmp.
-
- * dispextern.h [HAVE_CARBON]: Include Carbon.h.
-
- * fns.c [MAC_OSX]: Do not redefine vector.
-
- * keyboard.c [MAC_OSX]: Handle SIGINT with interrupt_signal.
-
- * macgui.h: Remove definition of No_Cursor.
-
- * macterm.h: Include Carbon.h. Replace (struct Cursor *) by Cursor.
-
- * xdisp.c: Define No_Cursor.
- (x_write_glyphs, notice_overwritten_cursor)
- (draw_phys_cursor_glyph, note_mode_line_or_margin_highlight)
- (note_mouse_highlight): Remove Mac-specific code.
- (note_mouse_highlight): Use bcmp instead of == to compare Cursors.
-
-2003-03-24 John Paul Wallington <[email protected]>
-
- * xdisp.c (redisplay_window): If mini window's buffer is not
- empty, then redisplay it like other windows.
-
-2003-03-23 Kim F. Storm <[email protected]>
-
- * w32term.c (w32_draw_window_cursor): Fix last change.
-
-2003-03-23 Kenichi Handa <[email protected]>
-
- * alloc.c (make_string_from_bytes, make_specified_string):
- Add `const' for the arg CONTENTS.
-
- * lisp.h (make_string_from_bytes, make_specified_string):
- Prototypes adjusted.
-
-2003-03-23 Jan Dj,Ad(Brv <[email protected]>
-
- * xdisp.c (get_glyph_string_clip_rect): Remove ; at end of #endif.
-
- * gtkutil.h: Take two more arguments to xg_update_scrollbar_pos.
- (XG_SB_RANGE): New define.
-
- * gtkutil.c (xg_fixed_handle_expose): New function.
- (xg_create_frame_widgets): Call xg_fixed_handle_expose for
- expose events.
- (xg_update_scrollbar_pos): Take two more arguments, left and width
- of scroll bar including borders.
- Clear left and right part outside scroll bar separately as some
- themes have bars that are not an even number of pixels.
- Don't set reallocate_redraws, don't call
- gdk_window_process_all_updates.
- (xg_set_toolkit_scroll_bar_thumb): Upper value is fixed,
- so no need to change it. Calculate size and value with XG_SB_RANGE.
-
- * xterm.c (x_scroll_bar_create, XTset_vertical_scroll_bar):
- Pass left and width of scroll bar including borders to
- xg_update_scrollbar_pos.
-
-2003-03-22 Thien-Thi Nguyen <[email protected]>
-
- * Makefile.in: Make sure space precedes end-of-line backslashes.
-
-2003-03-22 Kim F. Storm <[email protected]>
-
- * xdisp.c (pixel_to_glyph_coords, glyph_to_pixel_coords):
- Add generic versions here. Remove system specific versions
- defined elsewhere.
-
- * dispextern.h (pixel_to_glyph_coords, glyph_to_pixel_coords):
- Add prototypes.
-
- * xterm.h (STORE_NATIVE_RECT): New macro.
-
-2003-03-21 Kim F. Storm <[email protected]>
-
- * xdisp.c (get_glyph_string_clip_rect):
- Use FRAME_INTERNAL_BORDER_WIDTH.
-
- * dispextern.h (struct redisplay_interface): Add active_p
- argument to draw_window_cursor member. All uses changed.
-
-2003-03-21 Kim F. Storm <[email protected]>
-
- The following changes consolidate code related to writing and
- inserting glyphs, exposing frame, the tool bar, the mouse face,
- the output cursor, and help echo from xterm.c, w32term.c and
- macterm.c into xdisp.c. It also generalizes the use of the
- window_part enum instead of using numeric values throughout.
-
- * xdisp.c: Consolidate gui-independent code here.
- Include keymap.h.
- (Qhelp_echo): Import.
- (mouse_autoselect_window, x_stretch_cursor_p): Declare here.
- (help_echo_string, help_echo_window, help_echo_object)
- (previous_help_echo_string, help_echo_pos): Declare here.
- (output_cursor, last_mouse_frame, last_tool_bar_item): Declare here.
- (estimate_mode_line_height): Define here. Handle windowing
- systems directly (without using estimate_mode_line_height_hook).
- (x_y_to_hpos_vpos, get_tool_bar_item, note_tool_bar_highlight):
- (update_window_cursor, update_cursor_in_window_tree)
- (fast_find_position, fast_find_string_pos)
- (note_mode_line_highlight, note_mode_line_or_margin_highlight)
- (expose_area, expose_line, expose_overlaps, expose_window)
- (expose_window_tree, phys_cursor_in_rect_p): New generic versions;
- declared static as they are only used locally in xdisp.c.
- (draw_glyphs): Rename from x_draw_glyphs and make static.
- (tool_bar_item_info, notice_overwritten_cursor): Make static.
- (frame_to_window_pixel_xy, get_glyph_string_clip_rect)
- (set_output_cursor, x_cursor_to, handle_tool_bar_click)
- (x_write_glyphs, x_insert_glyphs, x_clear_end_of_line):
- (x_fix_overlapping_area, draw_phys_cursor_glyph, erase_phys_cursor)
- (display_and_set_cursor, x_update_cursor, x_clear_cursor)
- (show_mouse_face, clear_mouse_face, cursor_in_mouse_face_p)
- (note_mouse_highlight, x_clear_window_mouse_face)
- (cancel_mouse_face, x_draw_vertical_border, expose_frame)
- (x_intersect_rectangles): New generic functions for use by xdisp.c
- and GUI front-ends.
- (syms_of_xdisp): Initialize and staticpro help_echo* variables.
- Defvar_bool "x-streach-cursor" and "mouse-autoselect-window" here.
-
- * dispextern.h (Display_Info): Generic typedef for *_display_info.
- (NativeRectangle): Generic typedef for rectangle type.
- (enum window_part): Move here from window.c.
- (struct redisplay_interface): New members flush_display_optional,
- define_frame_cursor, clear_frame_area, draw_window_cursor,
- draw_vertical_window_border, shift_glyphs_for_insert.
- Rename member clear_mouse_face to clear_window_mouse_face.
- (estimate_mode_line_height_hook): Remove hook.
- (auto_raise_tool_bar_buttons_p): Don't declare extern.
- (tool_bar_item_info): Remove prototype.
- (help_echo_string, help_echo_window, help_echo_object)
- (previous_help_echo_string, help_echo_pos)
- (last_mouse_frame, last_tool_bar_item, mouse_autoselect_window):
- (x_stretch_cursor_p, output_cursor): Declare extern.
- (x_draw_glyphs, notice_overwritten_cursor): Remove prototypes.
- (x_write_glyphs), x_insert_glyphs, x_clear_end_of_line)
- (x_fix_overlapping_area, draw_phys_cursor_glyph, erase_phys_cursor)
- (display_and_set_cursor, set_output_cursor, x_cursor_to)
- (x_update_cursor, x_clear_cursor, x_draw_vertical_border)
- (frame_to_window_pixel_xy, get_glyph_string_clip_rect)
- (note_mouse_highlight, x_clear_window_mouse_face, cancel_mouse_face)
- (handle_tool_bar_click, clear_mouse_face, show_mouse_face)
- (cursor_in_mouse_face_p, expose_frame, x_intersect_rectangles):
- Add prototypes.
- (mode_line_string, marginal_area_string): Fix prototypes.
-
- * window.c (enum window_part): Move to dispextern.h.
- (coordinates_in_window): Use enum window_part member names
- instead of numbers to describe return value.
- (struct check_window_data): Change part member to window_part.
- (check_window_containing): Return window_part unaltered.
- (window_from_coordinates): Change part arg from int to enum
- window_part. Allow part arg to be null. All users changed.
-
- * window.h (window_from_coordinates): Fix prototype.
-
- * term.c (estimate_mode_line_height): Move to xdisp.c.
-
- * keyboard.c (make_lispy_event): Use enum window_part.
-
- * dispnew.c (mode_line_string, marginal_area_string): Use enum
- window_part instead of int in arg list. Users changed.
-
- * xterm.h (No_Cursor): Declare as None for X.
- (struct mac_output): Replace member cross_cursor by hand_cursor.
-
- * xterm.c: Remove consolidated defines and code.
- (BETWEEN): Remove unused macro.
- (x_draw_vertical_window_border, x_shift_glyphs_for_insert)
- (x_define_frame_cursor, x_clear_frame_area)
- (x_draw_window_cursor): New X-specific functions for RIF.
- (x_redisplay_interface): Add new members.
-
- * xfns.c: Setup and use hand_cursor instead of cross_cursor.
-
- * w32term.h (struct w32_output): Remove cross_cursor member.
-
- * w32term.c: Remove consolidated defines and code.
- (BETWEEN): Remove unused macro.
- (w32_draw_vertical_window_border, w32_shift_glyphs_for_insert)
- (w32_define_frame_cursor, w32_clear_frame_area)
- (w32_draw_window_cursor): New W32-specific functions for RIF.
- (w32_redisplay_interface): Add new members.
-
- * w32gui.h (No_Cursor): Define as 0 for W32.
- (XRectangle): Add X compatible rectangle type.
- (NativeRectangle): Declare as RECT for W32.
- (CONVERT_TO_XRECT, CONVERT_FROM_XRECT, STORE_NATIVE_RECT): New macros.
-
- * w32fns.c: Remove setup of cross_cursor (already has hand_cursor).
-
- * w32console.c: Remove consolidated defines and code.
-
- * msdos.h (Display_Info): Add generic typedef.
-
- * msdos.c: Remove consolidated defines and code.
- (IT_note_mouse_highlight, dos_rawgetc): Use enum window_part.
-
- * macterm.h (struct mac_output): Replace member cross_cursor by
- hand_cursor.
- (activate_scroll_bars, deactivate_scroll_bars): Add prototypes.
-
- * macterm.c: Remove consolidated defines and code.
- (BETWEEN): Remove unused macro.
- (mac_draw_vertical_window_border, mac_shift_glyphs_for_insert)
- (mac_define_frame_cursor, mac_clear_frame_area)
- (mac_draw_window_cursor): New Mac-specific functions for RIF.
- (x_redisplay_interface): Add new members.
-
- * macgui.h (No_Cursor): Define as 0 for Mac.
- (XRectangle): Add X compatible rectangle type.
- (NativeRectangle): Declare as Rect for Mac.
- (CONVERT_TO_XRECT, CONVERT_FROM_XRECT, STORE_NATIVE_RECT): New macros.
-
- * macfns.c (x_set_mouse_color): Setup hand_cursor.
- (x_set_cursor_color): Use x_display_and_set_cursor.
-
- * Makefile.in (xdisp.o): Add dependency on blockinput.h and files
- included from it. Add dependency on keymap.h.
-
- * makefile.w32-in (xdisp.o): Add dependency on keymap.h.
-
-2003-03-21 Kenichi Handa <[email protected]>
-
- * fileio.c (Fexpand_file_name): Fix previous change.
-
-2003-03-19 Kenichi Handa <[email protected]>
-
- * fileio.c (Ffile_name_directory): Reconstruct file name by
- make_specified_string.
- (Ffile_name_nondirectory, Ffile_name_as_directory)
- (Fdirectory_file_name, Fexpand_file_name)
- (Fsubstitute_in_file_name): Likewise.
- (Fread_file_name): Compare decoded homedir with DIR and
- DEFAULT_FILENAME.
-
- * alloc.c (make_specified_string): If NCHARS is negative, count
- the number of characters.
-
-2003-03-18 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (xg_frame_cleared): Call gtk_widget_queue_draw for
- all widgets.
-
- * gtkutil.h: Removed xg_ignore_next_thumb.
-
-2003-03-18 Kenichi Handa <[email protected]>
-
- * coding.c (Vchar_coding_system_table): Remove this variable.
- (Vcoding_system_safe_chars): New variable.
- (intersection): Remove this function.
- (find_safe_codings): Don't use Vchar_coding_system_table, but try
- all codings in SAFE_CODINGS.
- (Ffind_coding_systems_region_internal): Adjust for the change of
- find_safe_codings. Get generic coding systems from
- Vcoding_system_safe_chars.
- (Fdefine_coding_system_internal): New function.
- (syms_of_coding): Defsubr Sdefine_coding_system_internal.
- Initialize and staticpro Vcoding_system_safe_chars.
-
-2003-03-18 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (xg_set_toolkit_scroll_bar_thumb): Check if new values
- equal old values before updating.
-
- * xterm.c (xg_scroll_callback): Remove xg_ignore_next_thumb.
-
- * gtkutil.c (xg_initialize): Remove xg_ignore_next_thumb.
-
-2003-03-17 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c: Removed handle_fixed_child, struct xg_last_sb_pos.
- (xg_resize_widgets): Don't call foreach(handle_fixed_child).
- (xg_gtk_scroll_destroy): Remove free of struct xg_last_sb_pos.
- (scroll_bar_button_cb): Set bar->dragging to nil on button release.
- (xg_create_scroll_bar): Pass bar to button event callback.
- (xg_find_top_left_in_fixed): New function.
- (xg_update_scrollbar_pos): Don't call gdk_window_clear on
- whole scroll bar area. Get old position with
- xg_find_top_left_in_fixed, calculate and only clear needed areas.
- (xg_set_toolkit_scroll_bar_thumb): Do not adjust scroll bar if
- dragging is in progress. Calculate whole as for Motif.
- Remove code that saved last values. Call gtk_range functions to
- set scroll bar sizes.
-
- * gtkutil.h: Removed xg_ignore_next_thumb.
-
-2003-03-17 Juanma Barranquero <[email protected]>
-
- * makefile.w32-in ($(BLD)/xdisp.$(O)): Add dependency on blockinput.h
- and files included from it.
-
-2003-03-18 Stefan Monnier <[email protected]>
-
- * keymap.c (accessible_keymaps_1): Break cycles but without preventing
- multiple occurrences of the same keymap under different prefixes.
- (Faccessible_keymaps): Remove code redundant since 1994-08-03T07:39:[email protected].
-
-2003-03-16 Jason Rumney <[email protected]>
-
- * w32gui.h: Use HDC for Display.
-
- * w32term.c (w32_encode_char): Prevent double-byte chars from
- crashing Emacs.
-
- * w32fns.c (jpeg_load, png_load, slurp_file): Read image files
- as binary.
-
-2003-03-16 Juanma Barranquero <[email protected]>
-
- * xdisp.c (x_produce_glyphs): Use FRAME_BASELINE_OFFSET.
-
-2003-03-16 Kim F. Storm <[email protected]>
-
- The following changes consolidate some of the gui-independent
- parts of the processing and drawing of "glyph strings" from
- xterm.c, w32term.c, and macterm.c into xdisp.c.
-
- * dispextern.h (struct glyph): Reduce face_id member from 22 to
- 21 bits (this reduces number of faces from 4M to 2M).
- Replace W32 specific w32_font_type member (2 bits) by generic
- font_type member (3 bits) for portability.
- (FONT_TYPE_UNKNOWN): New define, default for font_type member.
- (enum draw_glyphs_face): Define here.
- (struct glyph_string): Define here. Merge W32 and X versions.
- (struct redisplay_interface): New members per_char_metric,
- encode_char, compute_glyph_string_overhangs, draw_glyph_string.
- (VCENTER_BASELINE_OFFSET): Define here.
- (dump_glyph_string, x_get_glyph_overhangs, x_produce_glyphs)
- (x_draw_glyphs, notice_overwritten_cursor): Declare prototypes here.
-
- * xdisp.c: Consolidate gui-independent "glyph string" code here.
- (dump_glyph_string): Moved here.
- (init_glyph_string, append_glyph_string_lists, append_glyph_string)
- (prepend_glyph_string_lists, get_glyph_face_and_encoding)
- (fill_composite_glyph_string, fill_glyph_string)
- (fill_image_glyph_string, fill_stretch_glyph_string)
- (left_overwritten, left_overwriting, right_overwritten)
- (right_overwriting, get_char_face_and_encoding)
- (set_glyph_string_background_width, compute_overhangs_and_x)
- (append_glyph, append_composite_glyph, produce_image_glyph)
- (take_vertical_position_into_account, append_stretch_glyph)
- (produce_stretch_glyph): New generic functions (based on X version).
- Call platform specific functions through rif.
- (INIT_GLYPH_STRING): New macro, hides W32 details.
- (BUILD_STRETCH_GLYPH_STRING, BUILD_IMAGE_GLYPH_STRING)
- (BUILD_CHAR_GLYPH_STRINGS, BUILD_COMPOSITE_GLYPH_STRING)
- (BUILD_GLYPH_STRINGS): Generic macros (based on X version).
- (x_draw_glyphs, x_get_glyph_overhangs, x_produce_glyphs)
- (notice_overwritten_cursor):
- Generic functions exported to platform modules. Users changed.
-
- * xterm.h (FONT_DESCENT, FRAME_X_OUTPUT, FRAME_BASELINE_OFFSET)
- (FONT_TYPE_FOR_UNIBYTE, FONT_TYPE_FOR_MULTIBYTE)
- (STORE_XCHAR2B, XCHAR2B_BYTE1, XCHAR2B_BYTE2):
- New macros for consolidated code.
-
- * xterm.c: Remove consolidated defines and code.
- (x_per_char_metric, x_encode_char)
- (x_compute_glyph_string_overhangs): Adapt to RIF requirements.
- (x_redisplay_interface): Add new members.
-
- * w32gui.h (Display): Add dummy typedef for consolidation.
- (XChar2b): Define alias for wchar_t for consolidation.
- (STORE_XCHAR2B, XCHAR2B_BYTE1, XCHAR2B_BYTE2): New macros.
-
- * w32term.h (FRAME_X_OUTPUT, FRAME_X_WINDOW, FRAME_X_DISPLAY)
- (FONT_TYPE_FOR_UNIBYTE, FONT_TYPE_FOR_MULTIBYTE):
- New macros for consolidation.
-
- * w32term.c: Remove consolidated defines and code.
- (BUILD_WCHAR_T, BYTE1, BYTE2): Macros removed; callers changed
- to use STORE_XCHAR2B, XCHAR2B_BYTE1, XCHAR2B_BYTE2 instead.
- (w32_per_char_metric): Change font_type arg to int for RIF.
- (w32_encode_char): Return int according to RIF requirements.
- (w32_compute_glyph_string_overhangs): Adapt to RIF.
- (w32_get_glyph_overhangs): New function for RIF. Uses generic
- x_get_glyph_overhangs.
- (w32_redisplay_interface): Add new members.
-
- * macgui.h (XChar2b): Move typedef here for consolidation.
- (STORE_XCHAR2B, XCHAR2B_BYTE1, XCHAR2B_BYTE2): New macros.
-
- * macterm.h (FRAME_X_OUTPUT, FRAME_X_WINDOW, FRAME_X_DISPLAY):
- (FONT_TYPE_FOR_UNIBYTE, FONT_TYPE_FOR_MULTIBYTE): New macros for
- consolidation.
-
- * macterm.c: Remove consolidated defines and code.
- (mac_per_char_metric): New function for RIF.
- (mac_encode_char): Adapt to new RIF requirements.
- (mac_compute_glyph_string_overhangs): Adapt for RIF.
- (x_redisplay_interface): Add new members.
-
-2003-03-15 Stefan Monnier <[email protected]>
-
- * keymap.c (Vmenu_events): New var.
- (syms_of_keymap): Initialize it.
- (where_is_internal): Check more carefully what is a menu event.
-
-2003-03-14 Richard M. Stallman <[email protected]>
-
- * lread.c (read1): After #!, exit loop on eof.
-
-2003-03-14 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.h: Add declaration for xg_frame_cleared.
-
- * xterm.c (x_clear_frame): Call xg_frame_cleared for GTK.
-
- * gtkutil.c (struct xg_last_sb_pos): New structure.
- (handle_fixed_child): New function.
- (xg_resize_widgets): Call handle_fixed_child on all scroll bar widgets
- and force a redraw on them.
- (xg_gtk_scroll_destroy): Free struct xg_last_sb_pos also.
- (xg_create_scroll_bar): Add struct xg_last_sb_pos to scroll bar
- so we can avoid unneeded redraws.
- (xg_update_scrollbar_pos): Invalidate data in xg_last_sb_pos
- and force a redraw on the scroll bar.
- (xg_set_toolkit_scroll_bar_thumb): Do not change/redraw scroll bar
- if xg_last_sb_pos shows the positions are up to date.
- (xg_frame_cleared): New function.
-
-2003-03-13 Kenichi Handa <[email protected]>
-
- * coding.c (Fdetect_coding_region): Fix docstring.
- (Fdetect_coding_string): Fix docstring.
-
-2003-03-13 Andreas Schwab <[email protected]>
-
- * gtkutil.c: Add prototype for create_menus.
-
- * data.c (long_to_cons): Fix type of top.
-
- * xselect.c (selection_data_to_lisp_data): Use int instead of
- long for an integer of size 4.
-
- * gtkutil.c (xg_update_frame_menubar): Add missing return value.
- (xg_tool_bar_help_callback): Likewise.
-
-2003-03-12 Andreas Schwab <[email protected]>
-
- * xterm.c (x_term_init) [USE_GTK]: Fix typo.
-
-2003-03-12 Kim F. Storm <[email protected]>
-
- The following changes consolidate the fringe handling from
- xterm.c, w32term.c, and macterm.c into xdisp.c.
-
- * xdisp.c: Consolidate fringe handling code here.
- (left_bits, right_bits, continued_bits, continuation_bits)
- (ov_bits, zv_bits): Define fringe bitmaps.
- (fringe_bitmaps): New array holding fringe bitmaps.
- (draw_fringe_bitmap): Draw a specific bitmap; call display
- specific drawing routine via rif->draw_fringe_bitmap.
- (draw_row_fringe_bitmaps): Generic replacement for
- x_draw_row_fringe_bitmaps; all callers changed.
- (compute_fringe_widths): Generic replacement for
- x_compute_fringe_widths; all callers changed.
-
- * dispextern.h (enum fringe_bitmap_type): Define here.
- (struct fringe_bitmap, struct draw_fringe_bitmap_params): New.
- (fringe_bitmaps): Declare extern.
- (struct redisplay_interface): New member draw_fringe_bitmap.
- (draw_row_fringe_bitmaps, compute_fringe_widths): Declare extern.
-
- * xterm.c: Remove generic fringe code.
- (x_draw_fringe_bitmap): Only perform actual fringe drawing.
- (x_redisplay_interface): Add x_draw_fringe_bitmap member.
-
- * w32term.c: Remove generic fringe code.
- (w32_draw_fringe_bitmap): Only perform actual fringe drawing.
- (w32_redisplay_interface): Add w32_draw_fringe_bitmap member.
-
- * macterm.c: Remove generic fringe code.
- (x_draw_fringe_bitmap): Only perform actual fringe drawing.
- (x_redisplay_interface): Add x_draw_fringe_bitmap member.
-
-2003-03-11 Stefan Monnier <[email protected]>
-
- * print.c (Fprin1_to_string): Return unibyte string if possible.
-
-2003-03-09 David Kastrup <[email protected]>
-
- * process.c (read_process_output): We have allocated enough space
- for readmax and carryover, so actually use the alloted space.
-
-2003-03-09 Jan Dj,Ad(Brv <[email protected]>
-
- * keyboard.c (make_lispy_event): Extend mouse_syms if needed for
- toolkit scrollbar click.
-
- * xterm.c (x_window_to_scroll_bar): Call xg_get_scroll_id_for_window
- for USE_GTK.
- (x_scroll_bar_handle_click): Use this function for toolkit scrollbars
- also.
- (handle_one_xevent): ButtonPress/Release: If event is for a toolkit
- scrollbar and control is pressed, call x_scroll_bar_handle_click.
-
- * gtkutil.h (xg_get_scroll_id_for_window): Declare.
-
- * gtkutil.c (xg_get_scroll_id_for_window): New function.
- (xg_tool_bar_item_expose_callback): New function.
- (xg_tool_bar_expose_callback): Call update_frame_tool_bar.
- (xg_create_tool_bar): Connect xg_tool_bar_expose_callback to expose
- on the tool bar widget.
- (update_frame_tool_bar): Connect xg_tool_bar_item_expose_callback
- to expose on the tool bar item widgets.
-
-2003-03-08 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (update_frame_tool_bar): Compare pixmap ID instead of
- struct image* when deciding to update (struct image* may have been
- deleted from the image cache).
-
- * xterm.c (handle_one_xevent): Pass ReparentNotify to Xt even if
- the event isn't for a frame (i.e. for dialogs).
-
-2003-03-07 Kenichi Handa <[email protected]>
-
- * coding.c (CODING_ADD_COMPOSITION_COMPONENT): If the number of
- composition components reaches the limit, terminate composing.
- (COMPOSITION_OK): New macro.
- (detect_coding_iso2022): Use it if an escape sequence for
- composition is found.
- (coding_restore_composition): Adjust the number of composition
- components if it is not sane.
-
-2003-03-06 Juanma Barranquero <[email protected]>
-
- * w32term.h (struct w32_display_info): Add xrdb member to support
- passing resources via -xrm on Windows.
-
- * w32term.c (w32_make_rdb): New function.
- (w32_term_init): Use it to initialize xrdb member of w32_display_info
- struct. Delete leftover code.
-
- * w32fns.c (Fx_get_resource, x_get_resource_string): Pass xrdb to check
- for resources passed on the command line.
-
- * w32reg.c (w32_get_rdb_resource): New function.
- (x_get_string_resource): Use it, so resources passed with -xrm
- supercede the ones in the registry.
-
-2003-03-04 Jan Dj,Ad(Brv <[email protected]>
-
- * xterm.c (x_detect_focus_change): Call x_any_window_to_frame
- instead of x_top_window_to_frame.
-
-2003-03-03 Jan Dj,Ad(Brv <[email protected]>
-
- * xsmfns.c (smc_save_yourself_CB): Add --no-splash to options
- when restarting Emacs.
-
-2003-03-03 Richard M. Stallman <[email protected]>
-
- * buffer.c (Fkill_buffer): Use Frun_hook_with_args_until_failure
- to run kill-buffer-query-functions.
- (Qkill_buffer_query_functions): New var.
- (syms_of_buffer): Init and staticpro it.
-
-2003-03-02 Jan Dj,Ad(Brv <[email protected]>
-
- * xterm.h (XSync): Define as gdk_window_process_all_updates for GTK.
-
-2003-02-25 Kim F. Storm <[email protected]>
-
- * xdisp.c (redisplay_window): Fix infinite loop in redisplay.
- If centering point failed to make whole line visible and vscroll
- is non-zero, disable vscroll and try centering point again.
-
- * lread.c (read1): Accept `single space' syntax like (? x).
-
-2003-02-25 Jan Dj,Ad(Brv <[email protected]>
-
- * keyboard.c (cancel_hourglass_unwind): Surround with
- #ifdef HAVE_X_WINDOWS.
-
-2003-02-25 Kenichi Handa <[email protected]>
-
- * buffer.c (Fset_buffer_multibyte): Pay attention to the buffer
- process only when "subprocesses" is defined.
-
-2003-02-24 Stefan Monnier <[email protected]>
-
- * syntax.c (back_comment): Only check nestedness of 2nd char if needed.
-
-2003-02-24 Juanma Barranquero <[email protected]>
-
- * callint.c (fix_command): Declare as static void and move before
- Fcall_interactively.
-
- * xdisp.c (Qwhen): Declare external; it's now defined in callint.c.
- (syms_of_xdisp): Don't initialize Qwhen.
-
-2003-02-23 Jan Dj,Ad(Brv <[email protected]>
-
- * keyboard.c (cancel_hourglass_unwind): New function.
- (command_loop_1): Cancel hourglass with unwind-protect.
-
-2003-02-23 Richard M. Stallman <[email protected]>
-
- * callint.c (fix_command): New subroutine, from Fcall_interactively.
- Detect (when ... (region-beginning)) etc.
- (Fcall_interactively): Call fix_command.
- (Qif, Qwhen): New variables.
- (syms_of_callint): Init and staticpro them.
-
- * regex.c (print_partial_compiled_pattern): Output to stderr.
-
-2003-02-23 Kai Gro,A_(Bjohann <[email protected]>
-
- * dired.c (directory_files_internal): Don't expand directory.
- (Fdirectory_files, Fdirectory_files_and_attributes): Do it here
- instead. From Lars Hansen <[email protected]>.
-
-2003-02-22 Stefan Monnier <[email protected]>
-
- * fns.c (string_to_multibyte): Remove unused var i.
- (Flanginfo): Fix int/Lisp_Object mixup.
- (void_call2): New fun.
- (Fmap_char_table): Use it in place of call2.
-
- * xfaces.c (x_face_list_fonts): Fix int/Lisp_Object mixup.
-
- * macros.c (Fstart_kbd_macro): Remove redundant assignment.
-
- * keymap.c (copy_keymap_1): Make it static.
-
- * alloc.c (Fgarbage_collect): Don't use XSETFLOAT.
-
-2003-02-22 David Ponce <[email protected]>
-
- * lread.c (Fload): Don't check STRING_MULTIBYTE.
-
-2003-02-21 Jan Dj,Ad(Brv <[email protected]>
-
- * process.h: Removed subtty field from struct Lisp_Process.
-
- * process.c (create_process): Remove setting of subtty.
- (emacs_get_tty_pgrp): New function.
- (Fprocess_running_child_p, process_send_signal):
- Call emacs_get_tty_pgrp instead of ioctl.
- (process_send_signal): Call EMACS_KILLPG if ioctl TIOCSIGSEND fails.
-
-2003-02-21 Kai Gro,A_(Bjohann <[email protected]>
-
- * keymap.c (Fdefine_key): Doc fix.
-
-2003-02-21 Juanma Barranquero <[email protected]>
-
- Port of patch for RC by Klaus Zeitler <[email protected]>.
-
- * s/hpux10.h: Define POLL_INTERRUPTED_SYS_CALL, not
- POLLING_PROBLEM_IN_SELECT.
-
- * s/hpux11.h: Include hpux10-20.h instead of hpux10.h.
- Delete #undef of POLLING_PROBLEM_IN_SELECT.
-
- * s/hpux10-20.h: New file.
-
- * process.c (wait_reading_process_input):
- Use POLL_INTERRUPTED_SYS_CALL, not POLLING_PROBLEM_IN_SELECT.
-
-2003-02-20 Kenichi Handa <[email protected]>
-
- * fontset.c (check_fontset_name): If NAME is nil, return the
- default fontset.
- (override_font_info): New function.
- (Fset_fontset_font): Document that NAME nil means the default fontset.
- (Ffontset_info): If FONTSET is not the default fontset, merge
- FONTSET onto the copy of the default fontset, and work on that
- copy. Document that NAME nil means the default fontset.
- (Ffontset_font): Document that NAME nil means the default fontset.
-
- * process.c (setup_process_coding_systems): If the process's
- in/out descriptor is -1, do nothing.
-
-2003-02-19 Andreas Schwab <[email protected]>
-
- * lisp.h (Fcancel_kbd_macro_events, Fstring_to_multibyte):
- Add prototypes.
-
-2003-02-19 Kenichi Handa <[email protected]>
-
- * xfaces.c (try_alternative_families): Try all scalable fonts if
- Vscalable_fonts_allowed is not Qt.
-
-2003-02-19 Jan Dj,Ad(Brv <[email protected]>
-
- * xfaces.c (x_face_list_fonts): Set *pfonts to 0 if no fonts found.
-
-2003-02-18 Jan Dj,Ad(Brv <[email protected]>
-
- * xterm.c (x_list_fonts): If maxnames is less than 0, get all font
- names.
-
- * xfaces.c (x_face_list_fonts): Allocate struct font_name here.
- (sorted_font_list): Move allocation of struct font_name to
- x_face_list_fonts.
- (Fx_font_family_list): Set font-list-limit to -1 to get all font names.
- (Fx_list_fonts): Set maxnames to -1 to get all font names.
-
-2003-02-18 Kim F. Storm <[email protected]>
-
- * lread.c (read1): Fix last change.
- "`" is not always special. Allow "?" after a character constant.
-
-2003-02-18 Andrew Choi <[email protected]>
-
- * unexmacosx.c (copy_data_segment): Also copy __cfstring section.
-
-2003-02-18 Andreas Schwab <[email protected]>
-
- * window.c (window_scroll_pixel_based): Move outside a
- multi-glyph character before setting new window start.
-
- * xdisp.c (in_display_vector_p): New function.
- * dispextern.h (in_display_vector_p): Declare.
-
-2003-02-18 Kim F. Storm <[email protected]>
-
- * lread.c (read1): Fix and relax read syntax.
- Recognize "[", ";", "#", and "?" after a dotted-pair dot.
- Only recognize "," after dotted-pair dot if inside backquote.
- Never include "`" or "," (inside backquote) in a symbol.
- Allow dotted-pair dot after a character constant.
- Allow "`" and "," (inside backquote) after a character constant.
-
-2003-02-17 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (xg_tool_bar_expose_callback): New function.
- (xg_create_tool_bar): Force style of tool bar to be horizontal with
- icons. Set name of tool bar to emacs-toolbar.
- (update_frame_tool_bar): Connect expose event to
- xg_tool_bar_expose_callback.
-
-2003-02-17 Richard M. Stallman <[email protected]>
-
- * keyboard.c (this_command_key_count_reset): New variable.
- Initiatize to 0 where this_command_key_count is set.
- (read_char): Save and restore this_command_key_count_reset
- around input method code.
- (read_char): If this_command_key_count_reset, echo reread commands.
- (Freset_this_command_lengths): Set this_command_key_count_reset to 1.
-
-2003-02-17 Kenichi Handa <[email protected]>
-
- * fns.c (string_to_multibyte): Always return a multibyte string.
-
-2003-02-16 Jason Rumney <[email protected]>
-
- * w32fns.c (w32_list_bdf_fonts, w32_list_fonts):
- Negative max_fonts parameter means list all.
-
-2003-02-14 Dave Love <[email protected]>
-
- * fns.c (Flanginfo): Doc fix.
-
-2003-02-13 Kim F. Storm <[email protected]>
-
- * lread.c (read_escape): Interpret \s as a SPACE character, except
- for \s-X in a character constant which still is the super modifier.
- (read1): Signal an `invalid read syntax' error if a character
- constant is immediately followed by a digit or symbol character.
-
- * search.c (Fmatch_data): Doc fix. Explicitly state that
- match-data is undefined if last search failed.
-
- * keymap.c (Fcommand_remapping): Rename from Fremap_command.
- All uses changed.
-
-2003-02-12 Juanma Barranquero <[email protected]>
-
- * eval.c (Fdefmacro): Fix typo.
-
-2003-02-12 Kim F. Storm <[email protected]>
-
- * macros.c (Fstart_kbd_macro): If appending, and last keyboard
- macro is a string, convert meta modifiers in string when copying
- the string into a vector.
-
-2003-02-11 Kim F. Storm <[email protected]>
-
- * keymap.c (Fremap_command): Return nil if arg is not a symbol.
-
-2003-02-11 Kenichi Handa <[email protected]>
-
- * Makefile.in (lisp, shortlisp): Add malayalam.el and tamil.el.
-
-2003-02-10 Kim F. Storm <[email protected]>
-
- * process.c: Doc fixes.
- (syms_of_process): Add `:' prefix to QCfilter_multibyte.
-
-2003-02-10 Kenichi Handa <[email protected]>
-
- * fns.c (Fstring_to_multibyte): Fix typo in the docstring.
-
- * process.c (QCfilter_multibyte): New variable.
- (setup_process_coding_systems): New function.
- (Fset_process_buffer, Fset_process_filter):
- Call setup_process_coding_systems.
- (Fstart_process): Initialize the member `filter_multibyte' of
- struct Lisp_Process.
- (create_process): Call setup_process_coding_systems.
- (Fmake_network_process): New keyward `:filter-multibyte'.
- Initialize the member `filter_multibyte' of struct Lisp_Process.
- Call setup_process_coding_systems.
- (server_accept_connection): Call setup_process_coding_systems.
- (read_process_output): If the process has a filter, decide the
- multibyteness of a string to given to the filter by
- `filter_multibyte' member of the process. If the process doesn't
- have a filter and the result of conversion is unibyte, use
- Fstring_to_multibyte (not Fstring_make_multibyte) to get the
- multibyte form.
- (Fset_process_coding_system): Call setup_process_coding_systems.
- (Fset_process_filter_multibyte): New function.
- (Fprocess_filter_multibyte_p): New function.
- (syms_of_process): Intern and staticpro QCfilter_multibyte.
- Defsubr Sset_process_filter_multibyte and
- Sprocess_filter_multibyte_p.
-
- * process.h (struct Lisp_Process): New member filter_multibyte.
-
- * lisp.h (setup_process_coding_systems): Add prototype.
-
- * buffer.c (Fset_buffer_multibyte): If the current buffer has a
- process, update coding systems for the process.
-
-2003-02-09 Kenichi Handa <[email protected]>
-
- * fns.c (string_to_multibyte): New function.
- (Fstring_to_multibyte): New function.
- (syms_of_fns): Defsubr it.
-
-2003-02-08 Andreas Schwab <[email protected]>
-
- * Makefile.in (EXEEXT): Define to @EXEEXT@ and use this variable
- instead of the substitution.
-
-2003-02-08 Jan Dj,Ad(Brv <[email protected]>
-
- * xterm.c (x_make_frame_visible): Call gtk_window_deiconify.
-
- * xmenu.c (menu_position_func): Adjust menu popup position so that
- the menu is fully visible.
-
-2003-02-07 Jan Dj,Ad(Brv <[email protected]>
-
- * xterm.c (x_text_icon, x_raise_frame, x_lower_frame)
- (x_make_frame_invisible, x_wm_set_icon_position):
- Use FRAME_OUTER_WINDOW instead of ifdef X_TOOLKIT/else/endif.
-
- * xfns.c (x_set_name, x_set_title): Ditto.
-
-2003-02-04 Richard M. Stallman <[email protected]>
-
- * keyboard.c (echo_now): Update before_command_echo_length.
- (Freset_this_command_lengths): Reset this_command_key_count etc.
- immediately rather than arranging to do it later.
- (before_command_key_count_1, before_command_echo_length_1)
- (before_command_restore_flag): Vars deleted.
- (add_command_key): Don't handle before_command_restore_flag.
- (read_char, record_menu_key): Don't update before_command_key_count or
- before_command_echo_length.
- (read_char): Don't handle before_command_restore_flag.
-
- * keyboard.c (command_loop_1): Don't call adjust_point_for_property
- in direct-output clauses if it wouldn't be called in the ordinary case.
-
-2003-02-04 Kim F. Storm <[email protected]>
-
- * keyboard.c (syms_of_keyboard) <this-original-command>: Doc fix.
-
-2003-02-02 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (remove_from_container): Copying list is not needed.
- (xg_update_menubar, xg_update_menu_item, xg_update_submenu)
- (xg_modify_menubar_widgets, update_frame_tool_bar): Call g_list_free
- on list returned from gtk_container_get_children to avoid memory leak.
-
-2003-02-01 Jason Rumney <[email protected]>
-
- * w32fns.c (w32_create_pixmap_from_bitmap_data): Use alloca for
- local malloc.
- [HAVE_XPM]: Avoid clashes with XColor, XImage and Pixel
- definitions in xpm.h.
- (init_xpm_functions): New function.
- (xpm_load): Sync with xfns.c. Adapt for Windows version of libXpm.
- (init_external_image_libraries): Try to load libXpm.dll.
-
- * fileio.c (Fcopy_file) [WINDOWSNT]: Reverse logic for setting
- timestamp.
-
-2003-01-31 Dave Love <[email protected]>
-
- * syntax.c (Fskip_chars_forward)
- (open-paren-in-column-0-is-defun-start): Doc fix.
-
-2003-01-31 Joe Buehler <[email protected]>
-
- * fileio.c: Support // at start of name for Cygwin (just added proper
- preprocessor tests).
-
- * keyboard.c: Port to Cygwin (just added proper preprocessor tests).
-
- * Makefile.in: Use @EXEEXT@ for Cygwin.
-
- * mem-limits.h: Added ifdef to define BSD4_2 for Cygwin.
-
- * s/cygwin.h: Added for Cygwin port.
-
-2003-01-31 Juanma Barranquero <[email protected]>
-
- * w32fns.c (DrawText): Kludge to avoid a redefinition on Windows
- when including gif_lib.h.
- (init_gif_functions, init_tiff_functions): New functions.
- (gif_load, tiff_load): Sync with xfns.c version. Adjust colors for
- Windows. Disable color table lookups. Call library functions
- through pointers determined at runtime.
- (init_external_image_libraries): Try to load libungif.dll and
- libtiff.dll.
-
-2003-01-31 Kenichi Handa <[email protected]>
-
- * xdisp.c (SKIP_GLYPHS): New macro.
- (set_cursor_from_row): Skip all glyphs that comes from overlay string.
-
-2003-01-30 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (free_frame_tool_bar): Remove debug printf.
-
-2003-01-30 Dave Love <[email protected]>
-
- * alloc.c (Vgc_elapsed, gcs_done): New variables.
- (Fgarbage_collect): Use them.
- (init_alloc, syms_of_alloc): Set them up.
-
-2003-01-30 Juanma Barranquero <[email protected]>
-
- * w32fns.c (init_external_image_libraries): Add missing operator.
-
-2003-01-29 Jason Rumney <[email protected]>
-
- * w32fns.c (init_external_image_libraries): Allow jpeg-62.dll as
- an alternative name for jpeg.dll.
-
-2003-01-29 Kenichi Handa <[email protected]>
-
- * xdisp.c (set_cursor_from_row): Pay attention to string display
- properties.
-
-2003-01-28 Benjamin Riefenstahl <[email protected]>
-
- * macterm.c (keycode_to_xkeysym_table): Add <tab>, <backspace>,
- <escape>.
- (keycode_to_xkeysym_table): Reformat and add more comments.
- (XTread_socket): Drop special case for backspace.
-
-2003-01-28 Andrew Choi <[email protected]>
-
- * macfns.c (x_to_mac_color): Correct the order for parsing the RGB
- values in old-style RGB specs.
-
-2003-01-27 Juanma Barranquero <[email protected]>
-
- * w32fns.c (init_external_image_libraries): Try alternate names for the
- jpeg dll.
-
-2003-01-27 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (create_dialog, xg_separator_p)
- (xg_item_label_same_p, xg_update_menu_item): Check for NULL string
- before calling strcmp or strlen.
-
-2003-01-26 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (update_frame_tool_bar): Call prepare_image_for_display
- and handle image load failure.
-
-2003-01-26 Jason Rumney <[email protected]>
-
- * w32fns.c (init_jpeg_functions, jpeg_resync_to_restart_wrapper):
- New functions.
- (jpeg_load): Sync with xfns.c version. Adjust colors for Windows.
- Disable color table lookups. Call jpeg library functions
- through pointers determined at runtime.
- (init_external_image_libraries): Try to load jpeg.dll.
-
-2003-01-25 Richard M. Stallman <[email protected]>
-
- * lisp.h: Declare format2 instead of format1.
-
- * fileio.c (barf_or_query_if_file_exists):
- Call format2 instead of format1.
-
- * editfns.c (format2): New function, replaces format1
- but takes exactly two Lisp Objects as format args.
-
- * buffer.c (Fkill_buffer): Call format2 instead of format1.
-
-2003-01-25 Jan Dj,Ad(Brv <[email protected]>
-
- * xterm.h: Change to return value of x_dispatch_event to int.
-
- * xterm.c (x_filter_event): New function.
- (event_handler_gdk, XTread_socket): Call x_filter_event.
- (x_dispatch_event): Change to return value of finish.
- (event_handler_gdk): Use return value from x_dispatch_event.
-
- * xfns.c (x_window): Call create_frame_xic for GTK version to
- initialize input methods.
-
- * gtkutil.h: Add (void) prototypes.
-
- * gtkutil.c (create_menus): Remove code that puts the help menu to
- the right.
-
-2003-01-25 Jason Rumney <[email protected]>
-
- * w32fns.c (XPutPixel): Handle monochrome images; used for masks.
- [HAVE_PNG]: Sync with xfns.c version.
- (png_load): Adjust colors for Windows. Use Windows
- bitmaps. Disable color table lookups.
- (DEF_IMGLIB_FN, LOAD_IMGLIB_FN): New macros.
- (init_png_functions): New function.
- (png_read_from_memory, png_load): Call png library functions
- through pointers determined at runtime.
- (QCloader, QCbounding_box, QCpt_width, QCpt_height): Declare.
- (init_external_image_libraries): New function.
- (init_xfns): Call it.
-
-2003-01-24 Andreas Schwab <[email protected]>
-
- * minibuf.c (Fminibuffer_message): Verify type of parameter.
-
-2003-01-24 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (xg_initialize): Initialize id_to_widget here instead
- of static initializer.
-
-2003-01-24 Dave Love <[email protected]>
-
- * s/gnu-linux.h (GC_SETJMP_WORKS, GC_MARK_STACK): Define for more
- architectures.
-
- * alloc.c (mark_stack) [!GC_LISP_OBJECT_ALIGNMENT && __GNUC__]:
- Use __alignof__.
-
-2003-01-24 Kenichi Handa <[email protected]>
-
- * keyboard.c (adjust_point_for_property): New second arg MODIFIED.
- It it is nonzero, don't pretend that an invisible area doesn't exist.
- (command_loop_1): Call adjust_point_for_property with proper
- second arg.
-
-2003-01-22 Jason Rumney <[email protected]>
-
- Sync changes with xterm.c and xfns.c.
-
- * w32term.c (x_draw_glyph_string_foreground)
- (x_draw_composite_glyph_string_foreground): Implement overstriking.
-
- * w32term.c (x_write_glyphs): Clear phys_cursor_on_p if current
- phys_cursor's hpos is overwritten. This is still not completely
- correct, as it doesn't really make sense to use hpos at all to
- get the cursor glyph (as that is relative to the width of the
- characters on the line, which may have changed during the update).
-
- * w32term.c (notice_overwritten_cursor): Handle the special case
- of the cursor being in the first blank non-text line at the
- end of a window.
-
- * w32term.c (x_draw_hollow_cursor, x_draw_bar_cursor)
- (x_draw_phys_cursor_glyph): Set phys_cursor_width here.
- Compute from the x position returned by x_draw_glyphs.
-
- (x_display_and_set_cursor): Don't set phys_cursor_width here,
- except for NO_CURSOR and system caret, to make phys_cursor_width
- contain what its name suggests.
- (notice_overwritten_cursor): Consider the cursor image erased if
- the output area intersects the cursor image in y-direction.
-
- * w32term.c (note_mode_line_or_margin_highlight): Rename from
- note_mode_line_highlight and extend.
-
- * w32term.c (last_window): New variable.
- (w32_read_socket) <WM_MOUSEMOVE>: Generate SELECT_WINDOW_EVENTs.
- (note_mouse_movement): Remove reimplemented code in #if 0.
-
- * w32fns.c (x_set_cursor_type): Set cursor_type_changed,
- not update_mode_lines, and always set it to 1.
-
-2003-01-21 Jason Rumney <[email protected]>
-
- * w32fns.c (IDC_HAND): Define it if system headers don't.
-
-2003-01-21 KOBAYASHI Yasuhiro <[email protected]>
-
- * w32term.h (struct w32_output): New member hand_cursor.
- (WM_EMACS_SETCURSOR): New message definition.
-
- * w32term.c (note_mode_line_highlight): Delete #if 0 to enable
- function w32_define_cursor.
- (note_mouse_highlight): Initialize, setup cursor accoding to mouse
- position, change member name output_data.x to output_data.w32 and
- add function w32_define_cursor.
- (show_mouse_face): Delete #if 0 to enable function w32_define_cursor
- and change member name output_data.x to output_data.w32.
- (w32_initialize_display_info):
- Setup dpyinfo->vertical_scroll_bar_cursor.
-
- * w32fns.c (Vx_hand_shape): New variable.
- (w32_wnd_proc): Add message entries for WM_SETCURSOR and
- WM_EMACS_SETCURSOR.
- (x-create-frame): Setup Cursor types.
-
-2003-01-21 David Ponce <[email protected]>
-
- * w32term.c (w32_encode_char): For DIM=1 charset, set
- ccl->reg[2] to -1 before calling ccl_driver.
- (Sync. with xterm.c x_encode_char change by Kenichi Handa
- <[email protected]> on 2002-09-30.)
- (w32_draw_relief_rect): Declare all args.
- (w32_define_cursor): New.
-
- * w32fns.c (w32_load_cursor): New function.
- (w32_init_class): Use it.
- (x_put_x_image): Declare all args.
-
-2003-01-21 Richard Dawe <[email protected]>
-
- * Makefile.in (ALL_CFLAGS): Include MYCPPFLAGS, not MYCPPFLAG.
-
-2003-01-21 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c: Must include stdio.h before termhooks.h.
-
-2003-01-21 Dave Love <[email protected]>
-
- * alloc.c (Fgc_status): Print zombie list.
- (mark_maybe_object) [GC_MARK_STACK==GC_USE_GCPROS_CHECK_ZOMBIES]:
- Fix assignment of zombies.
- (Fgarbage_collect) [GC_MARK_STACK==GC_USE_GCPROS_CHECK_ZOMBIES]:
- Don't take car of non-cons.
-
- * s/sol2-5.h (GC_SETJMP_WORKS, GC_MARK_STACK): Define.
-
- * s/sunos4-0.h (GC_SETJMP_WORKS, GC_MARK_STACK): Define.
-
-2003-01-20 David Ponce <[email protected]>
-
- * w32menu.c (digest_single_submenu): Declare all args.
-
- Sync with 2002-12-23 Richard M. Stallman <[email protected]>
- changes in xmenu.c:
-
- (parse_single_submenu): Use individual keymap's prompt
- string as pane name, if there is one.
- (set_frame_menubar): Save menu_items_n_panes from each call to
- parse_single_submenu and use it when calling digest_single_submenu.
-
-2003-01-20 Steven Tamm <[email protected]>
-
- * macterm.c (XTread_socket): Check for valid, visible window
- before sending a scroll-wheel event.
-
-2003-01-20 Richard M. Stallman <[email protected]>
-
- * xdisp.c (redisplay_window): If mini window's buffer is not
- a minibuffer, then redisplay it like other windows.
-
-2003-01-20 Jan Dj,Ad(Brv <[email protected]>
-
- * gtkutil.c (xg_create_frame_widgets): Check if there is an
- external tool bar before setting tool bar height.
-
-2003-01-19 Jan Dj,Ad(Brv <[email protected]>
-
- * xterm.c (handle_one_xevent): Surround popup_activated
- with #ifdef:s for non-toolkit version.
-
- * Makefile.in (XOBJ): Add gtkutil.o if USE_GTK.
- (gtkutil.o): New file.
- (TOOLKIT_DEFINES): Set to -DUSE_GTK if HAVE_GTK.
- (LIBW): Set to @GTK_LIBS@ if USE_GTK.
-
- * gtkutil.c: New file for GTK version.
-
- * gtkutil.h: New file for GTK version.
-
- * xterm.h: Add xt_or_gtk_widget.
- Include gtk files for USE_GTK.
- (struct x_output): Add toolbar_height.
- (struct x_output): Add GTK widgets and Gdk size_hints.
- (GTK_WIDGET_TO_X_WIN, FRAME_GTK_OUTER_WIDGET, FRAME_GTK_WIDGET)
- (FRAME_OUTER_WINDOW): New macros for USE_GTK.
- (FRAME_OUTER_TO_INNER_DIFF_Y): Add FRAME_TOOLBAR_HEIGHT to calculation.
-
- * xterm.c: Include gtkutil.h for USE_GTK.
- (free_frame_menubar): Declare extern void for USE_GTK.
- (note_mouse_highlight): Check popup_activated for USE_GTK.
- (xt_action_hook): Don't compile if USE_GTK.
- (x_scroll_bar_to_input_event): Use CurrentTime for USE_GTK.
- (xg_scroll_callback): New function.
- (x_create_toolkit_scroll_bar): Call xg_create_scroll_bar for USE_GTK.
- (x_set_toolkit_scroll_bar_thumb): Call xg_set_toolkit_scroll_bar_thumb
- for USE_GTK.
- (x_scroll_bar_create): Call xg_update_scrollbar_pos and
- xg_show_scroll_bar for USE_GTK.
- (x_scroll_bar_remove): Call xg_remove_scroll_bar for USE_GTK.
- (XTset_vertical_scroll_bar): Call xg_update_scrollbar_pos for USE_GTK.
- (event_handler_gdk): New function for USE_GTK.
- (handle_one_xevent): Call xg_resize_widgets for USE_GTK.
- (handle_one_xevent): Make sure widget is mapped before
- calling x_real_positions for USE_GTK.
- (XTread_socket): Add GTK event loop for USE_GTK.
- (x_set_window_size): Call xg_frame_set_char_size for USE_GTK.
- (x_make_frame_visible): Call gtk_widget_show_all for USE_GTK.
- (x_make_frame_invisible): Call gtk_widget_hide for USE_GTK.
- (x_iconify_frame): Add code for USE_GTK.
- (x_free_frame_resources): Call gtk_widget_destroy for USE_GTK.
- (x_wm_set_size_hint): Only compile if not USE_GTK. GTK version
- is in gtkutil.c.
- (x_term_init): Add initialization for GTK.
- (syms_of_xterm): Set Vx_toolkit_scroll_bars for USE_GTK.
-
- * xmenu.c: Include gtkutil.h for USE_GTK.
- (Fx_popup_menu): Use current position if x and y are nil.
- (single_menu_item, single_menu_item, Fx_popup_dialog):
- Check for USE_GTK.
- (popup_widget_loop): New function for USE_GTK.
- (x_activate_menubar): Add code for USE_GTK.
- (popup_activate_callback, popup_deactivate_callback)
- (menu_highlight_callback, menubar_selection_callback):
- Add USE_GTK versions.
- (update_frame_menubar): Call xg_update_frame_menubar for USE_GTK.
- (set_frame_menubar): Call xg_modify_menubar_widgets for USE_GTK.
- (free_frame_menubar): Only compile if not USE_GTK. GTK version
- is in gtkutil.c.
- (popup_selection_callback): New version for USE_GTK.
- (create_and_show_popup_menu): New fuction, one USE_GTK version and
- one USE_X_TOOLKIT version.
- (xmenu_show): Call create_and_show_popup_menu.
- (dialog_selection_callback): New version for USE_GTK.
- (create_and_show_dialog): New fuction, one USE_GTK version and
- one USE_X_TOOLKIT version.
- (xdialog_show): Call create_and_show_dialog.
-
- * xfns.c: Include gtkutil for USE_GTK.
- (x_window_to_frame, x_any_window_to_frame)
- (x_non_menubar_window_to_frame, x_menubar_window_to_frame)
- (x_top_window_to_frame): Add code for USE_GTK.
- (x_set_background_color): Call xg_set_background_color for GTK.
- (x_set_menu_bar_lines): Check for USE_GTK.
- (x_set_tool_bar_lines): Call update_frame_tool_bar for USE_GTK.
- (x_set_name, x_set_title): Call gtk_window_set_title for USE_GTK.
- (x_window): Call xg_create_frame_widgets for USE_GTK.
- (Fx_create_frame): Check for USE_GTK.
- (Fx_file_dialog): New implementation for USE_GTK.
-
- * xdisp.c: Add check for USE_GTK for extern void set_frame_menubar.
- (update_menu_bar): Add check for USE_GTK.
- (update_tool_bar): Add check for USE_GTK and external tool bar.
- (redisplay_tool_bar): Add check for USE_GTK and external tool bar.
- (redisplay_internal): Add check for USE_GTK and popup_activated.
- (redisplay_window): Add check for USE_GTK and FRAME_EXTERNAL_MENU_BAR.
- (redisplay_window): Add check for USE_GTK and FRAME_EXTERNAL_TOOL_BAR.
- (display_menu_bar): Add check for USE_GTK.
-
- * lisp.h (Vx_resource_name): Declare extern.
-
- * keyboard.c (kbd_buffer_get_event): Check MENU_BAR_ACTIVATE_EVENT
- for USE_GTK.
- (make_lispy_event): Check MENU_BAR_EVENT for USE_GTK.
-
- * frame.h (struct frame): Add external_tool_bar. Check for USE_GTK.
- (FRAME_EXTERNAL_TOOL_BAR): New macro.
- (FRAME_EXTERNAL_MENU_BAR): Check for USE_GTK.
-
- * fileio.c (Fread_file_name): Add check for USE_GTK.
-
- * dispnew.c (adjust_frame_glyphs_for_window_redisplay):
- Add check for USE_GTK.
-
- * config.in: Added HAVE_GTK.
-
- * alloc.c (Fgarbage_collect): Call xg_mark_data for GTK.
-
-2003-01-18 Stefan Monnier <[email protected]>
-
- * charset.h (Funibyte_char_to_multibyte): Export.
-
-2003-01-18 Jan Dj,Ad(Brv <[email protected]>
-
- * xmenu.c (mouse_position_for_popup): New function.
- (Fx_popup_menu): Call mouse_position_for_popup for X and
- mouse_position_hook for others.
-
-2003-01-17 Kim F. Storm <[email protected]>
-
- * editfns.c (Finsert): Mention `string-make-multibyte' and
- `string-as-multibyte' in doc string.
-
-2003-01-17 Kenichi Handa <[email protected]>
-
- * fontset.c (syms_of_fontset): Setup Vfont_encoding_alist here.
-
- * editfns.c (Fformat): Convert an unibyte char argument that is
- formatted by "%c" to multibyte if the total result must be a
- multibyte string.
-
-2003-01-16 Kim F. Storm <[email protected]>
-
- * process.c (set-process-filter): Document unibyte/multibyte-ness
- of string argument.
-
-2003-01-16 Kenichi Handa <[email protected]>
-
- * charset.h (NEXT_CHAR_BOUNDARY, PREV_CHAR_BOUNDARY): New macros.
-
- * regex.c (GET_CHAR_BEFORE_2): Use PREV_CHAR_BOUNDARY.
- (re_search_2): Likewise.
-
-2003-01-15 Kenichi Handa <[email protected]>
-
- * xdisp.c (message_dolog): Fix bug of the case that *Message*
- buffer is unibyte.
-
-2003-01-15 Francesco Potort,Al(B <[email protected]>
-
- * fns.c (Fsubstring): Clarify doc string.
-
- * textprop.c (Ftext_properties_at, Fnext_char_property_change)
- (Fprevious_char_property_change)
- (Fnext_single_char_property_change)
- (Fprevious_single_char_property_change, Fnext_property_change)
- (Fnext_single_property_change, Fprevious_property_change)
- (Fprevious_single_property_change, Fadd_text_properties)
- (Fput_text_property, Fset_text_properties)
- (Fremove_text_properties, Fremove_list_of_text_properties)
- (Ftext_property_any, Ftext_property_not_all): Clarify doc strings.
-
-2003-01-14 Kim F. Storm <[email protected]>
-
- * process.h (struct Lisp_Process): New member plist replaces old
- member private_vars. All uses changed.
-
- * process.c: Reworked 2003-01-12 change -- call a plist a plist!
- (QCplist): Rename from QCvars. Change all uses.
- (Fprocess_plist): Replaces Fprocess_variable. Simplified.
- (Fset_process_plist): Replaces Fset_process_variable. Simplify.
- (syms_of_process): Intern, staticpro, defsubr these.
- (Fmake_network_process): Describe :plist arg. Remove :vars arg.
-
-2003-01-14 Francesco Potort,Al(B <[email protected]>
-
- * m/delta.h: Remove (obsolete).
-
-2003-01-13 Francesco Potort,Al(B <[email protected]>
-
- * fileio.c (Fdelete_directory, Fdelete_file): Document the
- behaviour in front of symlinks.
- (Fdelete_file): Raise an error on directories.
-
-2003-01-13 Dave Love <[email protected]>
-
- * fns.c (Freverse): Use QUIT.
-
-2003-01-13 Richard M. Stallman <[email protected]>
-
- * minibuf.c (minibuffer_completion_contents):
- Error if point is inside prompt.
-
- * keyboard.c (command_loop_1): Don't redisplay directly
- if there's a post-command-hook.
-
- * fileio.c (syms_of_fileio) <directory-sep-char>: Doc fix.
- (Fdo_auto_save): Add gcpros around Ffile_name_directory.
-
-2003-01-12 Kim F. Storm <[email protected]>
-
- * process.h (struct Lisp_Process): New member private_vars.
-
- * process.c (QCvars): New variable.
- (syms_of_process): Intern and staticpro it.
- (Fset_process_contact): Removed function.
- (Fprocess_variable, Fset_process_variable): New functions.
- (syms_of_process): Defsubr them.
- (Fstart_process): Initialize private_vars plist to nil.
- (Fmake_network_process): New arg :vars to setup the private
- variables for new network process.
- (server_accept_connection): Copy server's private variables to
- client process.
-
- * alloc.c (pure_alloc): Fixed 2003-01-10 changed (caused spurious
- crashes). Code rewritten and simplified. Now directly aligns the
- pointer and recalculates pure_bytes_used, rather than aligning the
- size and adjusting the pointer.
-
-2003-01-11 Kim F. Storm <[email protected]>
-
- * process.c (Fset_process_contact): New function.
- (syms_of_process): defsubr it.
- (make-network-process): Update doc.
-
-2003-01-10 Andreas Schwab <[email protected]>
-
- * alloc.c (pure_alloc): Correct alignment for Lisp_Floats.
- Reported by Berthold Gunreben <[email protected]>.
-
-2003-01-10 Dave Love <[email protected]>
-
- * composite.c (syms_of_composite): Make composition_hash_table weak.
-
-2003-01-09 Kim F. Storm <[email protected]>
-
- * process.c (Fmake_network_process): Convert new port number
- to host byte order for `:service t' case. From Mario Lang.
-
-2003-01-08 Jan Dj,Ad(Brv <[email protected]>
-
- * xfns.c (Fx_file_dialog): Call XtAppNextEvent and x_dispatch_event
- instead of XtAppProcessEvent.
-
- * xterm.c (handle_one_xevent): New function.
- (x_dispatch_event): New function.
- (XTread_socket): Call handle_one_xevent.
-
- * xterm.h (FRAME_OUTER_TO_INNER_DIFF_X/Y): New.
-
- * xmenu.c (Fx_popup_menu): If popping up at mouse position,
- call XQueryPointer to get coordinates.
- (popup_get_selection): Do not set popup_activated_flag to zero,
- let popup_deactivate_callback do that. Needed for Motif.
- Call x_dispatch_event instead of XtDispatchEvent.
- (xmenu_show): Calculate root coordinate from frame top/left position.
-
-2003-01-08 Kim F. Storm <[email protected]>
-
- * process.c (server_accept_connection): Fix recording of new
- connection's local address in :local property of contact info.
- (Fmake_network_process): Record local network address for new
- client processes in :local property of contact info.
- (format-network-address): Add arg OMIT-PORT. Change callers.
-
-2003-01-07 Dave Love <[email protected]>
-
- * Makefile.in (fns.o): Depend on coding.h.
-
-2003-01-06 Dave Love <[email protected]>
-
- * fns.c: Include coding.h. Use POINTER_TYPE*, not void*.
- (Vlocale_coding_system): Declare.
- (Qcodeset, Qdays, Qmonths, Qpaper): New.
- (Flanginfo): New.
- (syms_of_fns): Initialize new stuff.
-
-2003-01-07 Markus Rost <[email protected]>
-
- * minibuf.c (Fread_variable): Doc fix.
-
- * eval.c (Fuser_variable_p): Doc change. For custom variables,
- use the same test as for custom-variable-p.
-
-2003-01-05 Richard M. Stallman <[email protected]>
-
- * xdisp.c (try_scrolling): New arg LAST_LINE_MISFIT.
- Count LAST_LINE_MISFIT in scroll margin for end of window.
- Move label too_near_end before setting SCROLL_MARGIN_POS.
- Set LAST_LINE_MISFIT before jumping there.
-
- * xdisp.c (try_scrolling): Calculate amount_to_scroll better in
- scroll_conservatively case. If scrolling that much doesn't change
- STARTP, move it down one line.
-
- * xdisp.c (redisplay_window): Pass last_line_misfit arg to
- try_scrolling. Make it 1 after make_cursor_line_fully_visible fails.
-
- * xdisp.c (setup_echo_area_for_printing): Kill Emacs if no
- selected frame.
-
- * keymap.c (apropos_predicate, apropos_accumulate): Make them static.
- (syms_of_keymap): Staticpro them.
- (Fapropos_internal): Initialize them and clear them out.
- Don't GCPRO them.
-
- * buffer.c (syms_of_buffer) <scroll-up|down-aggressively>: Doc fixes.
-
- * lisp.h: New misc type Lisp_Save_Value.
- (enum Lisp_Misc_Type): Add Lisp_Misc_Save_Value.
- (XSAVE_VALUE): New macro.
- (struct Lisp_Save_Value): New data type.
- (union Lisp_Misc): Add u_save_value alternative.
- (make_save_value): Declare.
-
- * alloc.c (make_save_value): New function.
-
- * xterm.c (x_catch_errors): Save dpy using make_save_value.
- (x_catch_errors_unwind): Call XSync.
-
-2003-01-01 Richard M. Stallman <[email protected]>
-
- * window.c (window_scroll_pixel_based): Partially undo last change.
-
- * keyboard.c (command_loop_1): Call adjust_point_for_property
- in direct action cases for Qforward_char and Qbackward_char.
- Set already_adjusted so it won't be done twice.
-
-2002-12-30 Richard Dawe <[email protected]>
-
- * src/config.in (!HAVE_SIZE_T): Fix order of arguments in
- type definition of size_t.
-
-2003-01-02 Steven Tamm <[email protected]>
-
- * macterm.c (syms_of_macterm): Provide the feature "mac-carbon" to
- distinguish Carbon GUI builds from X11 builds on darwin.
-
-2002-12-30 Steven Tamm <[email protected]>
-
- * macterm.c (syms_of_macterm): Set mac-wheel-button-is-mouse-2
- to default to t.
-
-2002-12-29 Francesco Potort,Al(B <[email protected]>
-
- * data.c (Fstring_to_number, Fminus): Better English in doc strings.
-
-2002-12-28 Steven Tamm <[email protected]>
-
- * Makefile.in (macosx-bundle): Fix Mac OS X/Carbon port to
- allow building in a different directory than source. Uses some
- GNU Make extensions, but there is no other make on Mac OS X.
-
-2002-12-26 Francesco Potort,Al(B <[email protected]>
-
- * data.c (Fmakunbound, Ffmakunbound, Fmake_variable_buffer_local)
- (Fsetq_default, Fmake_local_variable, Fkill_local_variable)
- (Fmake_variable_frame_local, Faset, Fnumber_to_string, Fminus)
- (Fstring_to_number): Mention the returned value in the doc strings.
-
-2002-12-23 Richard M. Stallman <[email protected]>
-
- * buffer.c (syms_of_buffer) <scroll-up-aggressively>
- <scroll-down-aggressively>: Doc fix.
-
- * xmenu.c (parse_single_submenu): Use individual keymap's prompt
- string as pane name, if there is one.
- (set_frame_menubar): Save menu_items_n_panes from each call to
- parse_single_submenu and use it when calling digest_single_submenu.
-
- * window.c (window_scroll_pixel_based): Fix check for reaching BEGV.
- Don't try to make last line fully visible if it is past end of window.
-
-2002-12-22 Steven Tamm <[email protected]>
-
- * macmenu.c (MIN_POPUP_SUBMENU_ID): Add.
- (mac_menu_show): Add support for hierarchical popup menus.
- (add_menu_item): Remove indentation support.
- (fill_submenu, fill_menu): Create hierarchical menus
- instead of using indentation.
-
-2002-12-22 Richard M. Stallman <[email protected]>
-
- * xdisp.c (try_cursor_movement): Don't call try_window here.
- (redisplay_window): Never redisplay minibuffer when inactive.
-
- * window.c (select_window_1): Undo 9/21 change.
-
-2002-12-22 Steven Tamm <[email protected]>
-
- * macterm.c (XTread_socket): Call KeyTranslate for control and
- meta to deal correctly shifted non-alpha characters, like C-S-5
- being treated like C-%. Do not look for shift key to deal
- with masking off control-key with mac-reverse-ctrl-meta.
-
-2002-12-21 Richard M. Stallman <[email protected]>
-
- * xmenu.c (popup_get_selection): Now static. New arg DO_TIMERS.
- If it is non-nil, run timers. Use an unwind-protect to requeue
- the events that were read ahead.
- (popup_get_selection_unwind): New subroutine.
- (popup_get_selection_queue): File-scope variable now holds that queue.
- (xmenu_show): Pass 0 for DO_TIMERS to popup_get_selection.
- (xdialog_show): Pass 1 for DO_TIMERS to popup_get_selection.
- Use an unwind-protect to pop down the dialog box.
- (xdialog_show_unwind): New subroutine implements that.
-
- * xdisp.c (row_containing_pos): Change exit test using last_y.
- (try_window_id): Abort if row_containing_pos returns null.
-
- * lread.c (load_error_handler): New function.
- (Fload): Handle errors in Fsubstitute_in_file_name.
- Don't expect Fsignal to return.
-
- * eval.c: Errors and throws work right with interrupt blocking.
- (struct catchtag): New elt interrupt_input_blocked.
- (unwind_to_catch): Restore interrupt_input_blocked from saved value.
- (internal_catch, Fcondition_case, internal_condition_case)
- (internal_condition_case_1, internal_condition_case_2): Save it.
- (Fsignal): Don't do TOTALLY_UNBLOCK_INPUT.
-
- * editfns.c (Fformat): Add parens.
-
- * dired.c (file_name_completion): Fix that change.
- Delete special quit-handling code; just use QUIT.
-
-2002-12-21 Tak Ota <[email protected]>
-
- * dired.c (file_name_completion): Close directory on error
- just as in directory_files_internal.
-
-2002-12-19 David Kastrup <[email protected]>
-
- * window.c (Fset_window_configuration): Set old_point to correct
- value when new_current_buffer == current_buffer.
-
-2002-12-17 Ben Key <[email protected]>
-
- Revisited my earlier fix for the following entry in etc/PROBLEMS:
- "Emacs built on Windows 9x/ME crashes at startup on Windows XP,
- or Emacs builtpart of on XP crashes at startup on Windows 9x/ME."
-
- These changes were in part based upon suggestions made by Peter
- 'Luna' Runestig [[email protected]].
-
- * w32.c (g_b_init_is_windows_9x, g_b_init_open_process_token)
- (g_b_init_get_token_information, g_b_init_lookup_account_sid)
- (g_b_init_get_sid_identifier_authority ): Add several static
- global variables.
-
- * w32.c (globals_of_w32): New function. Used to initialize those
- global variables that must always be initialized on startup even
- when the global variable initialized is non zero. Its primary
- purpose at this time is to set the global variables
- g_b_init_is_windows_9x, g_b_init_open_process_token,
- g_b_init_get_token_information, g_b_init_lookup_account_sid, and
- g_b_init_get_sid_identifier_authority to 0 on startup.
- Called from main.
-
- * w32.c (is_windows_9x): Perform initialization only if
- g_b_init_is_windows_9x is equal to 0. On initialization set
- g_b_init_is_windows_9x equal to 1.
-
- * w32.c (open_process_token): Perform initialization only if
- g_b_init_open_process_token is equal to 0. On initialization set
- g_b_init_open_process_token equal to 1.
-
- * w32.c (get_token_information): Perform initialization only if
- g_b_init_get_token_information is equal to 0. On initialization
- set g_b_init_get_token_information equal to 1.
-
- * w32.c (lookup_account_sid): Perform initialization only if
- g_b_init_lookup_account_sid is equal to 0. On initialization
- set g_b_init_lookup_account_sid equal to 1.
-
- * w32.c (get_sid_identifier_authority): Perform initialization
- only if g_b_init_get_sid_identifier_authority is equal to 0.
- On initialization set g_b_init_get_sid_identifier_authority equal to 1.
-
- * w32fns.c (globals_of_w32fns): New function. Used to initialize
- those global variables that must always be initialized on startup
- even when the global variable initialized is non zero.
- Its primary purpose at this time is to initialize the global variable
- track_mouse_event_fn.
-
- * w32fns.c (w32_wnd_proc): Remove initialization of
- track_mouse_event_fn from the handler for the WM_SETFOCUS message.
-
- * w32fns.c (syms_of_w32fns): Call globals_of_w32fns.
-
- * w32menu.c (globals_of_w32menu): New function. Used to
- initialize those global variables that must always be initialized
- on startup even when the global variable initialized is non zero.
- Its primary purpose at this time is to initialize the global
- variables get_menu_item_info and set_menu_item_info.
-
- * w32menu.c (initialize_frame_menubar): Remove initialization of
- get_menu_item_info and set_menu_item_info.
-
- * w32menu.c (syms_of_w32menu): Call globals_of_w32menu.
-
- * w32.h (globals_of_w32, globals_of_w32fns, globals_of_w32menu):
- Declare them.
-
- * emacs.c (main): Call globals_of_w32 prior to calling
- init_environment if WINDOWSNT is defined. Call globals_of_w32fns
- and globals_of_w32menu if initialized is non zero and HAVE_NTGUI
- is defined.
-
- * w32term.c (x_update_window_begin): Fix Windows API error
- detected by BoundsChecker. Test to determine if
- w32_system_caret_hwnd is NULL prior to attempting to use
- SendMessage to send the WM_EMACS_HIDE_CARET message to it.
-
- * w32term.c (x_update_window_end): Fix Windows API error
- detected by BoundsChecker. Test to determine if
- w32_system_caret_hwnd is NULL prior to attempting to use
- SendMessage to send the WM_EMACS_SHOW_CARET message to it.
-
-2002-12-17 Kenichi Handa <[email protected]>
-
- * coding.c (coding_system_require_warning): New variable.
- (syms_of_coding): DEFVAR it.
-
- * coding.h (coding_system_require_warning): Extern it.
-
- * fileio.c (choose_write_coding_system): Even if
- Vcoding_system_for_write is non-nil, if
- coding_system_require_warning is nonzero, call
- Vselect_safe_coding_system_function.
-
-2002-12-17 Markus Rost <[email protected]>
-
- * Makefile.in (lisp, shortlisp): Add cus-face and timer.
- (lisp): Add font-core.
-
-2002-12-13 Stefan Monnier <[email protected]>
-
- * textprop.c (text_read_only): New arg `propval'.
- (get_char_property_and_overlay): Remove unused var `next_overlay'.
- (verify_interval_modification): Use text_read_only's new arg.
-
-2002-12-13 Kenichi Handa <[email protected]>
-
- * coding.c (Funencodable_char_position): Set pend correctly.
-
-2002-12-12 Jason Rumney <[email protected]>
-
- * w32term.c (last_mousemove_x, last_mousemove_y): New variables.
- (w32_read_socket) <WM_MOUSEMOVE>: Use them to detect non-movement.
- Be more careful about when help_events are generated.
-
-2002-12-12 Steven Tamm <[email protected]>
-
- * macterm.c (mac_check_for_quit_char): Correctly set the
- modifiers of the event to 0.
- * mac.c (sys_select): Duplicate rfds before calling select to
- ensure that rfds survive the while loop.
-
-2002-12-11 Kim F. Storm <[email protected]>
-
- * xdisp.c (try_window_id): Don't call set_cursor_from_row if
- row_containing_pos returned NULL.
-
-2002-12-10 Steven Tamm <[email protected]>
-
- * mac.c (sys_read): Fix sys_read to not call select if IO is
- non-blocking.
- (sys_select): Fix sys_select to not use a timeout larger than
- the one given.
-
-2002-12-10 Juanma Barranquero <[email protected]>
-
- * editfns.c (Fformat): Use alloca, not _alloca.
-
-2002-12-09 Richard M. Stallman <[email protected]>
-
- * buffer.c (Fget_buffer_create): Call Qucs_set_table_for_input
- as the last thing.
-
-2002-12-09 Dave Love <[email protected]>
-
- * s/sol2-8.h: Removed. (Not necessary.)
-
-2002-12-09 Matthew Swift <[email protected]>
-
- * editfns.c (Fformat): Handle precision in string conversion
- specifiers like libc functions do (ie, print at most that many
- characters).
-
-2002-12-08 Richard M. Stallman <[email protected]>
-
- * xdisp.c (row_containing_pos): Check more carefully
- whether charpos is really in the row before returning it.
-
-2002-12-07 Steven Tamm <[email protected]>
-
- * sysdep.c (emacs_read) [HAVE_CARBON]: Have emacs_read use sys_read.
-
- * eval.c (Feval) [HAVE_CARBON]: Calls mac_check_for_quit_char at
- each stack frame. This may change as it could be time consuming.
-
- * macterm.c (mac_check_for_quit_char, quit_char_comp)
- (init_quit_char_handler, mac_determine_quit_char_modifiers)
- (mac_initialize): Add code to check for pressing of quit_char
- in the OS event queue.
-
- * mac.c (sys_select): Call mac_check_for_quit_char every second
- while blocking on select.
-
- * mac.c (sys_read): Use sys_select to test for input first
- before calling read, to allow C-g to break.
-
-2002-12-07 Richard M. Stallman <[email protected]>
-
- * minibuf.c (Fcompleting_read): Doc fix.
-
- * lread.c (syms_of_lread) <load-history>: Doc fix.
-
- * fileio.c (Fcopy_file): Set immediate_quit around emacs_open call.
-
- * eval.c (Fdefun, Fdefmacro): Record in load-history redefining an
- autoload.
-
- * data.c (Fdefalias): Record in load-history redefining an autoload.
-
- * alloca.c: Undo ifdef change accidentally made on 12-04.
-
-2002-12-06 Francesco Potort,Al(B <[email protected]>
-
- * xfns.c (png_load): Avoid double gamma correction for PNG images.
-
-2002-12-04 Richard M. Stallman <[email protected]>
-
- * sysdep.c (fcntl.h): Test only HAVE_FCNTL_H.
-
- * fileio.c (fcntl.h): Test only HAVE_FCNTL_H.
-
- * alloca.c: Don't use #error.
-
-2002-12-03 Dave Love <[email protected]>
-
- * buffer.c (Qucs_set_table_for_input): New.
- (Fget_buffer_create): Use it.
- (Qset_buffer_major_mode_hook): Deleted.
- (Fset_buffer_major_mode): Revert previous change.
- (init_buffer_once): Intern ucs-set-table-for-input.
- (syms_of_buffer): Delete Qset_buffer_major_mode_hook.
- Add &Qucs_set_table_for_input.
-
-2002-12-03 Andreas Schwab <[email protected]>
-
- * callint.c (Fcall_interactively): Use next_event only if less
- than key_count.
-
-2002-12-02 Andrew Choi <[email protected]>
-
- * macmenu.c (add_menu_item, fill_menubar): Truncate menu item
- names to 255 characters.
-
- * macterm.c (XTread_socket): If all frames have been collapsed,
- expand the first one before handling drag-and-drop events.
-
- * s/darwin.h (GETPGRP_NO_ARG): Delete. Replaced by GETPGRP_VOID,
- which is detected by autoconf.
-
-2002-12-01 Steven Tamm <[email protected]>
-
- * unexmacosx.c (copy_twolevelhints, dump_it): Now corrects the
- offset in two hints table to allow prebinding to be redone and
- allow the executable to be stripped.
-
-2002-11-29 Dave Love <[email protected]>
-
- * fns.c (Frequire): Don't call LOADHIST_ATTACH if feature was
- already provided.
-
-2002-11-29 Richard M. Stallman <[email protected]>
-
- * xdisp.c (start_display): Check more intelligently for
- whether the line is continued.
- (move_it_vertically_backward): Clear it->continuation_lines_width.
-
-2002-11-28 Dave Love <[email protected]>
-
- * s/amdahl.h, s/unipl5-0.h, m/sgi3000.h, s/3700.h, s/alliant-2800.h:
- * s/alliant.h, s/altos.h: Deleted. (Unused/empty.)
-
-2002-11-27 Steven Tamm <[email protected]>
-
- * fns.c (Frequire): Change nesting allowance from 2 to 3 to cause
- more descriptive error output from lread.c:Fload upon most require
- cycles during boostrapping.
-
-2002-11-27 Jason Rumney <[email protected]>
-
- * fileio.c (Finsert_file_contents): Give a more appropriate error
- for files bigger than 2Gb when off_t is 32 bit.
-
- * dired.c (Ffile_attributes): Don't return negative file sizes for
- files bigger than 2Gb when off_t is 32 bit.
-
-2002-11-27 Dave Love <[email protected]>
-
- * s/irix6-0.h (GC_SETJMP_WORKS, GC_MARK_STACK): Define.
-
- * systty.h: Don't conditionally define GETPGRP_NO_ARG.
- Test GETPGRP_VOID instead.
- [BSD_TERMIOS]: Remove definitions (never used).
-
- * s/osf5-0.h (WAIT_USE_INT, SYS_SIGLIST_DECLARED, sys_siglist):
- Don't define.
- (GC_SETJMP_WORKS, GC_MARK_STACK): Define.
-
- * m/mips.h (WORDS_BIG_ENDIAN): Define conditionally.
-
-2002-11-25 Jason Rumney <[email protected]>
-
- * w32.c (sys_write): Avoid non-blocking mode, which is not fully
- supported.
-
-2002-11-25 Dave Love <[email protected]>
-
- * unexalpha.c (update_dynamic_symbols): Cast arg of fatal_unexec.
-
- * Makefile.in (TEMACS_LDFLAGS): Update last change.
-
-2002-11-25 Andreas Schwab <[email protected]>
-
- * m/ia64.h: Restore `#ifndef NOT_C_CODE' deleted by last change.
-
-2002-11-24 Steven Tamm <[email protected]>
-
- * unexmacosx.c (unexec_realloc): Use malloc_default_zone to
- determine the size of pointers alloced in unexed space instead
- of using possibly invalid emacs_zone pointers. This fixes the
- binary incompatibility problems caused by updates to libSystem.B.
-
-2002-11-24 Richard M. Stallman <[email protected]>
-
- * search.c (Fstring_match): Doc fix.
-
- * callint.c (Fcall_interactively): If a command fails because
- `*' detects a read-only buffer, but RECORD_FLAG is set,
- record it anyway if the args don't actually do tty input.
-
-2002-11-22 Dave Love <[email protected]>
-
- * sysdep.c (stuff_char) [PROTOTYPES]: Provide ISO C arglist.
-
- * keyboard.c (interrupt_signal): Provide forward declaration.
- (kbd_buffer_store_event): Don't declare interrupt_signal.
-
- * xdisp.c (store_frame_title_char) [PROTOTYPES]: Provide ISO C arglist.
-
-2002-11-21 Richard M. Stallman <[email protected]>
-
- * eval.c (interactive_p): Skip any number of bytecode
- and special form frames, in any order.
-
-2002-11-20 Jason Rumney <[email protected]>
-
- * w32fns.c (convert_mono_to_color_image): New function.
- (xbm_load, xbm_load_image): Use it when foreground or background
- is explicitly set.
-
-2002-11-19 Dave Love <[email protected]>
-
- * s/usg5-4.h, sco4.h (bcopy, bzero, bcmp): Don't define.
-
-2002-11-18 Jason Rumney <[email protected]>
-
- * w32fns.c (x_build_heuristic_mask): Filter palette info from color.
- (XPutPixel): Swap blue and red.
- (xpm_format, pbm_format, png_format, jpeg_format, tiff_format)
- (gif_format, gs_format): Use IMAGE_ASCENT_VALUE.
- (xpm_image_p, pbm_image_p, png_image_p, jpeg_image_p)
- (tiff_image_p, gif_image_p, gs_image_p): Don't check ascent.
-
-2002-11-18 Dave Love <[email protected]>
-
- * m/orion105.h (HAVE_ALLOCA): Don't define.
-
- * m/m68k.h, m/arm.h, mtekxd88.h, m/tower32v3.h: Don't define alloca.
-
- * m/intel386.h: Don't include alloca.h or define alloca.
-
- * m/ia64.h: Don't include alloca.h, stdlib.h. Don't declare
- malloc, realloc, calloc.
-
- * m/hp800.h, m/sr2k.h, m/ns16000.h, m/wicat.h (bcopy, bzero)
- (bcmp): Don't define.
-
- * m/delta.h (bcopy, bzero, bcmp, alloca): Don't define.
-
- * m/amdahl.h: Don't define LIB_STANDARD.
-
- * m/alpha.h: Move OSF1 stuff from here to s/osf1.h.
-
- * s/osf1.h: Move OSF1 stuff from m/alpha.h to here.
-
- * s/irix4-0.h, s/irix5-0.h, m/powerpcle.h, m/sparc.h:
- Don't include alloca.h.
-
- * s/aix3-2.h (HAVE_FSYNC): Don't define.
-
- * regex.c (_GNU_SOURCE): Don't define.
-
- * process.c (_GNU_SOURCE): Don't define.
-
- * fileio.c (_GNU_SOURCE, HAVE_FSYNC): Don't define.
-
-2002-11-18 Markus Rost <[email protected]>
-
- * s/sol2-8.h: Include sol2-6.h.
-
-2002-11-18 Miles Bader <[email protected]>
-
- * dispextern.h (struct face): Add `overstrike' field.
- * xterm.c (x_draw_glyph_string_foreground)
- (x_draw_composite_glyph_string_foreground): Implement overstriking.
- * xfaces.c (load_face_font): Set `face->overstrike' based on
- result from choose_face_font.
- (best_matching_font, choose_face_font): Add `needs_overstrike'
- argument, and use it to return whether overstriking is desirable
- for this face/font combo.
- (set_font_frame_param): Pass new argument to choose_face_font.
-
-2002-11-17 Ben Key <[email protected]>
-
- This change is my fix for the following entry in etc/PROBLEMS:
- "Emacs built on Windows 9x/ME crashes at startup on Windows XP,
- or Emacs builtpart of on XP crashes at startup on Windows 9x/ME."
-
- * w32.c: Added wrapper functions around the win32 API functions
- OpenProcessToken, GetTokenInformation, LookupAccountSid, and
- GetSidIdentifierAuthority. These wrapper functions serve two
- purposes:
- 1. They ensure that the wrapped function can never be called
- when Emacs is running on an operating system on which they are
- not supported (Microsoft Windows 95 / 98 / ME).
- 2. They call the wrapped functions via function pointers rather
- than calling them directly. This avoids taking advantage of the
- undocumented fact that although these functions are not supported
- in the 9x branch of Microsoft Windows, the functions do exist in
- the version of advapi32.dll that is found in the 9x branch of
- Microsoft Windows.
-
- * w32.c (init_user_info): Replace the calls to the win32 API
- functions OpenProcessToken, GetTokenInformation, LookupAccountSid,
- and GetSidIdentifierAuthority with calls to the newly added
- wrapper functions.
-
- * w32.h: Added extern declarations for the following functions:
- syms_of_w32term, syms_of_w32fns, syms_of_w32select,
- syms_of_w32menu, and void syms_of_fontset.
-
- * w32fns.c (w32_wnd_proc): Add code to reinitialize the
- function pointer track_mouse_event_fn in the handler for the
- WM_SETFOCUS message.
-
- * w32menu.c (initialize_frame_menubar): Add code to
- reinitialize the function pointers set_menu_item_info and
- get_menu_item_info.
-
-2002-11-17 Ben Key <[email protected]>
-
- * sound.c: Added a partial implementation of play-sound-internal
- for Microsoft Windows. Added various #ifdef / #else / #endif
- code blocks to separate the code that will compile under
- Microsoft Windows from the code that is specific to GNU/Linux.
- Moved several blocks of code around to make this separation of code
- into Windows compatible and GNU/Linux compatible code blocks easier.
-
- * makefile.w32-in: Include sound.c and link with WinMM.lib.
-
- * s/ms-w32.h: Defined the symbol HAVE_SOUND so that the newly
- added support for play-sound-internal under Windows would be
- included in the build of Emacs.
-
-2002-11-16 Jason Rumney <[email protected]>
-
- * w32fns.c (w32_load_system_font): Don't disable Cleartype.
-
- * w32term.c (w32_get_glyph_string_clip_rect): Clip cursor tightly.
-
-2002-11-15 Stefan Monnier <[email protected]>
-
- * keyboard.c (command_loop_1): Fix int/Lisp_Object mixup.
- (adjust_point_for_property): Move out of display and invisible even if
- we were already inside before (in case a property was added while
- we weren't looking). Be more careful when handling invisible props.
- Skip invisible text as if it really wasn't there at all.
-
-2002-11-15 Jason Rumney <[email protected]>
-
- * w32term.c (x_draw_image_foreground)
- (w32_draw_image_foreground_1): Use standard copy and invert
- operations to draw images.
-
- * w32fns.c (x_create_x_image_and_pixmap): Fill in palette for
- depth of 1.
- (xbm_read_bitmap_data): Invert bits as xbm is read in.
- (XPutPixel): Don't invert bits here.
-
-2002-11-15 Jason Rumney <[email protected]>
-
- * w32term.c (x_draw_image_foreground, x_draw_image_glyph_string)
- (w32_draw_image_foreground_1): Handle image masks.
- (x_draw_image_glyph_string): Don't BitBlt transparently.
-
- * w32fns.c (w32_defined_color): Adjust RGB values for Emacs.
- (x_from_xcolors): Adjust RGB values for W32.
- (image_background, image_background_transparent)
- (postprocess_image, x_to_xcolors, x_disable_image)
- (x_build_heuristic_mask): Adapt for W32 and enable.
- (x_create_x_image_and_pixmap): Mark images with palettes as such.
- (xbm_load): Remove unused variable.
-
-2002-11-14 Richard M. Stallman <[email protected]>
-
- * buffer.c (syms_of_buffer): Doc fix.
-
-2002-11-14 Dave Love <[email protected]>
-
- * alloc.c (SETJMP_WILL_NOT_WORK): Add note.
-
- * xterm.c (x_draw_relief_rect, x_draw_box_rect, x_update_cursor):
- * xmenu.c (unuse_menu_items, digest_single_submenu):
- * xfns.c (x_put_x_image):
- * xdisp.c (message2_nolog, set_message):
- * undo.c (record_point):
- * terminfo.c (tparam):
- * syntax.c (scan_sexps_forward):
- * scroll.c (calculate_scrolling, calculate_direct_scrolling):
- * composite.c (update_compositions):
- * cm.c (calccost, cmgoto):
- * charset.c (c_string_width): Declare all args (per C99).
-
- * frame.h (get_specified_cursor_type, get_window_cursor_type): Declare.
-
- * lisp.h (get_specified_cursor_type, get_window_cursor_type):
- Don't declare.
-
- * emacs.c (main) [!VMS]: Avoid third arg.
-
- * fns.c (Fcopy_sequence): Doc fix.
- (Fmap_char_table): Cast `call2'.
-
-2002-11-14 Francesco Potort,Al(B <[email protected]>
-
- * s/sol2-8.h: New file.
-
-2002-11-14 Kim F. Storm <[email protected]>
-
- * buffer.c (syms_of_buffer) <mode-line-format>: Document symbol
- dependency on `risky-local-variable' and the :propertize form.
-
-2002-11-12 Stefan Monnier <[email protected]>
-
- * fns.c (Fmap_char_table): Don't use map_char_table's function arg.
-
- * syntax.c (scan_sexps_forward): Undo last patch.
- Use a more obvious fix: check eob before updating the syntax table.
-
-2002-11-09 Stefan Monnier <[email protected]>
-
- * syntax.c (scan_sexps_forward): Update syntax table before reading
- a char rather than after so we don't update the table past eob.
-
-2002-11-09 Dave Love <[email protected]>
-
- * buffer.c (Fset_buffer_major_mode): Fix last change.
-
- * regex.c (regexec): Fix pmatch declaration.
-
- * cmds.c (Fself_insert_command): Apply Vtranslation_table_for_input.
-
- * keyboard.c (command_loop_1): Apply Vtranslation_table_for_input
- to self-inserting characters.
- (syms_of_keyboard) <keyboard-translate-table>: Doc fix.
-
- * coding.c (Vtranslation_table_for_input): New.
- (syms_of_coding): DEFVAR it.
-
-2002-11-08 Juanma Barranquero <[email protected]>
-
- * w32term.c (w32_draw_fringe_bitmap): Remove unused local variable
- window.
-
-2002-11-08 Pavel Jan,Am(Bk <[email protected]>
-
- * process.c (Fformat_network_address): Remove unused locals p,
- cp, and i.
-
-2002-11-06 Dave Love <[email protected]>
-
- * buffer.c (Qset_buffer_major_mode_hook): New.
- (Fset_buffer_major_mode): Use it.
-
-2002-11-06 Richard M. Stallman <[email protected]>
-
- * xterm.c (x_term_init): Use turn_on_atimers, not start_polling
- and stop_polling.
-
- * process.c (wait_reading_process_input):
- Test POLLING_PROBLEM_IN_SELECT, not hpux.
- Avoid initialization for auto Lisp_Object var.
-
- * s/hpux11.h (POLLING_PROBLEM_IN_SELECT): Add #undef.
-
- * s/hpux10.h (POLLING_PROBLEM_IN_SELECT): Defined.
-
-2002-11-05 Richard M. Stallman <[email protected]>
-
- * s/sol2-5.h (BROKEN_SIGIO): Turn off the #undef.
-
- * callint.c (Fcall_interactively): New local filter_specs.
- (Fcall_interactively): Check for progn as well as let.
- Add a gcpro.
- (Qprogn): New variable.
- (syms_of_callint): Staticpro and init Qprogn.
-
-2002-11-04 John Paul Wallington <[email protected]>
-
- * lread.c (Feval_buffer): Doc fix.
-
-2002-11-04 Dave Love <[email protected]>
-
- * keyboard.c (read_char): Always translate iff
- Vkeyboard_translate_table is a char table and c is valid.
-
- * xterm.c (XTread_socket): Check Lisp types for Vx_keysym_table
- and fix C types.
-
-2002-11-03 Stefan Monnier <[email protected]>
-
- * xdisp.c (single_display_prop_intangible_p): Strings are intangible.
-
- * editfns.c (get_pos_property): Don't hardcode Qfield.
-
- * keyboard.c (adjust_point_for_property): Handle `display' prop on
- overlays. Also handle `invisible' prop.
-
-2002-11-02 Stefan Monnier <[email protected]>
-
- * coding.c (decode_coding_emacs_mule, decode_coding_iso2022)
- (decode_coding_sjis_big5, decode_eol): Allow lone \r in DOS EOL.
-
-2002-11-01 Andreas Schwab <[email protected]>
-
- * editfns.c (Fmessage): Revert last change to properly handle %%.
-
-2002-11-01 Stefan Monnier <[email protected]>
-
- * xmenu.c (unuse_menu_items): New fun.
- (menu_items_inuse): New var.
- (syms_of_xmenu): Initialize it.
- (init_menu_items): Use it to detect re-entrance.
- (Fx_popup_menu, Fx_popup_dialog, set_frame_menubar): Reset when done.
- (Fx_popup_menu): Remove spurious XSETFRAME.
-
- * editfns.c (find_field): Make an exception for nil fields.
-
-2002-11-01 Dave Love <[email protected]>
-
- * m/gec63.h: Deleted.
-
-2002-10-31 Dave Love <[email protected]>
-
- * xterm.c (XTread_socket): Fix last change.
- (xaw_scroll_callback): Cast call_data to long to avoid warning.
-
-2002-10-31 Stefan Monnier <[email protected]>
-
- * process.c (Fformat_network_address): Fix int/Lisp_Object mixup.
-
-2002-10-30 Stefan Monnier <[email protected]>
-
- * editfns.c (overlays_around, get_pos_property): New funs.
- (find_field): Use them.
- Also be careful not to modify POS before its last use.
- (Fmessage): Don't Fformat if there's nothing to format.
-
-2002-10-30 Dave Love <[email protected]>
-
- * process.c [HAVE_SYS_WAIT]: Include sys/wait.h.
- [HAVE_PTY_H]; Include pty.h.
-
- * lread.c (Fload) <!load_dangerous_libraries>: Close fd.
-
- * xterm.c (Qeql): Declare.
- (Vx_keysym_table): New.
- (syms_of_xterm): Initialize it.
- (XTread_socket): Use it. Deal with ASCII keysyms.
- (XSetIMValues) [HAVE_X11R6]: Prototype.
-
- * keyboard.c (lispy_accent_codes, lispy_accent_keys): Extended.
- (lispy_kana_keys): Comment out.
- (make_lispy_event) [XK_kana_A]: Comment out.
- (modify_event_symbol) <sizeof (long) == sizeof (EMACS_INT)>:
- Fix sprintf call.
-
- * s/osf5-0.h (C_SWITCH_SYSTEM): Revert last change (fixed by
- regexp.h change).
- (TERMINFO, LIBS_TERMCAP): Define.
-
- * s/usg5-4.h (bcopy, bzero): Define conditional on HAVE_BCOPY.
- (bcmp): Define conditional on HAVE_BCMP.
- (NO_SIOCTL_H): Don't define.
- (TIOCSIGSEND): Don't make conditional on IRIX6.
-
- * s/sol2-5.h: Don't include strings.h.
- (bcopy, bzero, bcmp) [HAVE_BCOPY]: Don't undef.
-
- * s/irix6-0.h (IRIX6): Don't define.
- (bcopy, bcmp, bzero): Don't undef.
-
- * s/irix6-5.h: Don't include strings.h.
- (IRIX6): Don't define.
- (bcopy, bcmp, bzero): Don't undef.
-
- * syntax.c (Fforward_comment): Doc fix.
-
-2002-10-29 Kim F. Storm <[email protected]>
-
- * process.c (Fsignal_process): Allow PROCESS to be specified by
- name in addition to pid (as integer or string).
-
-2002-10-28 Harald Maier <[email protected]> (tiny change)
-
- * w32heap.c: Don't redefine _heap_init and _heap_term on MSVC 7 build
- environments.
-
-2002-10-27 Kim F. Storm <[email protected]>
-
- * xterm.c (note_mouse_highlight): Don't use mouse-face if hidden.
-
- * w32term.c (note_mouse_highlight): Don't use mouse-face if hidden.
-
- * msdos.c (IT_note_mouse_highlight): Don't use mouse-face if hidden.
-
- * macterm.c (note_mouse_highlight): Don't use mouse-face if hidden.
-
-2002-10-26 Richard M. Stallman <[email protected]>
-
- * editfns.c (Fformat): Detect invalid format letters for floats.
-
-2002-10-25 Kenichi Handa <[email protected]>
-
- * xfns.c (x_set_name): Encode by Qcompound_text unconditionally.
- (x_set_title): Likewise.
-
-2002-10-25 Juanma Barranquero <[email protected]>
-
- * macgui.h:
- * w32gui.h: Remove definition of XColor.
-
- * dispextern.h [!HAVE_X_WINDOWS]: Define XColor.
-
-2002-10-24 Kim F. Storm <[email protected]>
-
- * xdisp.c (get_window_cursor_type): New arg ACTIVE_CURSOR.
- Callers changed (supply dummy arg).
-
- * lisp.h (get_window_cursor_type): Update prototype.
-
- * w32term.c (x_display_and_set_cursor): Get active_cursor from
- get_window_cursor_type to track system caret.
-
-2002-10-24 Kim F. Storm <[email protected]>
-
- * process.c (Fformat_network_address): New function.
- (syms_of_process): Defsubr it.
- (list_processes_1): Use it to format :local/:remote address if
- service/host is not set; before Emacs would crash in that case.
- (Fmake_network_process): Don't use Ffind_operation_coding_system
- to setup coding system if host or service is not set.
-
-2002-10-23 Juanma Barranquero <[email protected]>
-
- Patch suggested by Jay Finger <[email protected]>.
-
- * w32term.c (w32_term_init): Pass XColor to w32_define_color, not
- COLORREF.
-
- * macgui.h:
- * w32gui.h: Add definition of XColor.
-
- * macfns.c:
- * w32fns.c:
- * xfaces.c: Remove definition of XColor.
-
-2002-10-22 Stefan Monnier <[email protected]>
-
- * xfns.c (x_set_name, x_set_title): `icon.value' has unsigned char.
-
- * window.c (window_loop): For GET_LRU_WINDOW and GET_LARGEST_WINDOW>,
- Only ignore truly dedicated windows. For UNSHOW_BUFFER, delete the
- window if it is dedicated.
- (Fshrink_window): Add preserve_before as was done for enlarge_window.
- (Vspecial_display_function): Update docstring.
-
- * buffer.c (assoc_ignore_text_properties, Fother_buffer, Fkill_buffer)
- (call_overlay_mod_hooks): Use CONSP and XCAR/XCDR.
- (Fget_buffer_create, advance_to_char_boundary): Use BEG and BEG_BYTE.
-
-2002-10-21 Stefan Monnier <[email protected]>
-
- * casefiddle.c (casify_region): Don't treat a prefix char as part
- of a word when at the beginning.
-
-2002-10-17 Juanma Barranquero <[email protected]>
-
- * lread.c (syms_of_lread): Fix typos.
-
-2002-10-17 Dave Love <[email protected]>
-
- * Makefile.in (TEMACS_LDFLAGS): Add trailing comment.
-
-2002-10-16 Richard M. Stallman <[email protected]>
-
- * fileio.c (Fcopy_file): Fix backward test of KEEP_TIME.
-
-2002-10-14 Juanma Barranquero <[email protected]>
-
- * w16select.c (syms_of_win16select): Fix docstring for
- `selection-coding-system'.
-
- * w32select.c (syms_of_w32select): Likewise.
-
-2002-10-14 Stefan Monnier <[email protected]>
-
- * syntax.c (scan_lists): Don't get fooled by a symbol ending with
- a backslash-quoted char.
- (scan_lists, scan_sexps_forward): Pacify the compiler.
-
-2002-10-13 Richard M. Stallman <[email protected]>
-
- * window.c (window_scroll): Set immediate_quit.
-
- * print.c (print): When backquote form is the car of a list,
- output in old style. Use old_backquote_output to output all
- comma forms inside it in old style too.
-
- * buffer.h (struct buffer): Move `undo_list' down below `name'.
-
-2002-10-11 Markus Rost <[email protected]>
-
- * emacs.c (syms_of_emacs) <kill-emacs-hook>: Doc fix (not run in
- batch mode).
-
- * lread.c (Fload): Doc fix (load-suffixes).
-
-2002-10-10 Steven Tamm <[email protected]>
-
- * macterm.c (syms_of_macterm, mac_get_mouse_btn):
- Reverse functionality of mac-wheel-button-is-mouse-2 to be correct.
- Also switch the default to Qnil from Qt.
-
-2002-10-08 Kenichi Handa <[email protected]>
-
- * coding.c (code_convert_region): When we need more GAP for
- conversion, pay attention to the case that coding->produced is not
- greater than coding->consumed.
-
-2002-10-07 Richard M. Stallman <[email protected]>
-
- * unexelf.c (unexec): Redo 9/16 change, but only if IRIX6_5.
-
-2002-10-06 Andrew Choi <[email protected]>
-
- * macmenu.c (mac_menu_show): Add j to count menu items; match
- menu_item_selection to it to find selected item.
-
-2002-10-06 Jan Dj,Ad(Brv <[email protected]>
-
- * xterm.c (XTread_socket): Fix from 2002-10-03 didn't cover all
- cases. The correct fix is to pass ReparentNotify to Xt.
- The shell widget interprets ConfigureNotify differently depending
- on if it has been reparented or not.
-
-2002-10-05 Markus Rost <[email protected]>
-
- * editfns.c (Fformat_time_string): Doc fix.
-
-2002-10-05 John Paul Wallington <[email protected]>
-
- * fns.c (Flength): Doc fix.
-
-2002-10-04 Stefan Monnier <[email protected]>
-
- * keyboard.c (keyremap): New struct.
- (read_key_sequence): Use it: globally replace keytran_foo with
- keytran.foo and fkey_foo with fkey.foo. Rename temp vars
- keytran_next and fkey_next to just `next'.
-
-2002-10-04 Steven Tamm <[email protected]>
-
- * macterm.c (keycode_to_xkeysym_table): Change return to be
- treated like an X keysym.
-
-2002-10-03 Jan Dj,Ad(Brv <[email protected]>
-
- * xterm.c (XTread_socket): For ConfigureNotify, with x and y == 0,
- and USE_MOTIF, call XTranslateCoordinates to get the real x and y.
- This is to also handle x/y changes that occur because of a resize.
-
-2002-10-02 John Paul Wallington <[email protected]>
-
- * frame.c (Vdelete_frame_functions): New variable.
- (syms_of_frame): Initialize and defvar it.
- (Fdelete_frame): Use it instead of delete-frame-hook. Don't run
- it when frame's `tooltip' parameter is non-nil.
-
- * xfns.c (x_create_tip_frame): Set `tooltip' frame parameter to t.
-
- * w32fns.c (x_create_tip_frame): Likewise.
-
- * macfns.c (x_create_tip_frame): Likewise.
-
-2002-09-30 Kenichi Handa <[email protected]>
-
- * xterm.c (x_encode_char): For DIM=1 charset, set ccl->reg[2] to
- -1 before calling ccl_driver.
-
- * coding.c (decode_coding_emacs_mule): Check coding->cmp_data.
- Only when it is non-nil, handle composition sequence.
- (setup_coding_system) <0>: Don't force composition handling.
-
- * Makefile.in (lisp, shortlisp): Add utf-16.elc.
-
-2002-09-29 Richard M. Stallman <[email protected]>
-
- * search.c (Freplace_match): Adjust match data for the substitution
- just made in the buffer.
-
- * xdisp.c (STOP_POLLING, RESUME_POLLING): New macros.
- (redisplay_internal): Use them. Do RESUME_POLLING at end of function.
-
-2002-09-27 Richard M. Stallman <[email protected]>
-
- * keyboard.c (STOP_POLLING, RESUME_POLLING): New macros.
- (read_char): Use them. Do all exits thru the end of the function.
-
-2002-09-27 Kenichi Handa <[email protected]>
-
- * xfaces.c (try_font_list): Pay attention to the case that FAMILY
- is nil.
-
-2002-09-26 Richard M. Stallman <[email protected]>
-
- * regex.h (__restrict_arr): Don't define if already defined.
-
- * coding.c (run_pre_post_conversion_on_str):
- Save and restore Vdeactivate_mark.
-
-2002-09-26 John Paul Wallington <[email protected]>
-
- * minibuf.c (Fminibufferp): Add an optional `buffer' argument.
-
-2002-09-26 Kenichi Handa <[email protected]>
-
- * xfaces.c (try_font_list): New arg PREFER_FACE_FAMILY. If it is
- nonzero, try face's family at first. Otherwise try FAMILY at first.
- (choose_face_font): If C is a single byte char or latin-1, call
- try_font_list with PREFER_FACE_FAMILY 1.
-
-2002-09-21 Richard M. Stallman <[email protected]>
-
- * window.c (select_window_1): Don't select frame.
- Set frame's selected window only when frame itself is selected.
- (Fselect_window): Doc fix.
-
-2002-09-18 Kim F. Storm <[email protected]>
-
- * process.c (make-network-process): Doc fix (there is no
- network-server-log-function hook).
-
-2002-09-18 Richard M. Stallman <[email protected]>
-
- * print.c (print): Clear out the unused parts of Vprint_number_table.
- (syms_of_print): Doc fix for `print-number-table'.
-
- * unexelf.c (unexec): Undo previous change.
-
-2002-09-17 Andreas Schwab <[email protected]>
-
- * m/alpha.h [LINUX]: Don't define DATA_START.
-
-2002-09-16 Dave Love <[email protected]>
-
- * unexelf.c (unexec): Deal with .got, reinstating change from
- 25-08-1999.
-
-2002-09-13 Richard M. Stallman <[email protected]>
-
- * s/sol2-6.h (UNEXEC): Comment out definition.
-
- * unexsol.c (unexec): Don't downcase first letter of error msg.
-
- * xfaces.c (Fcolor_supported_p): Just one arg is required.
-
-2002-09-12 Markus Rost <[email protected]>
-
- * unexsol.c: Include buffer.h, charset.h, coding.h.
-
-2002-09-11 Richard M. Stallman <[email protected]>
-
- * unexsol.c: Don't use report_file_error; do it by hand
- using dlerror.
-
- * process.c (wait_reading_process_input, both versions):
- Before calling turn_on_atimers, call stop_polling.
-
- * emacs.c (syms_of_emacs) <command-line-args>: Doc fix.
-
- * xdisp.c (try_scrolling): If after make_cursor_line_fully_visible
- we go to too_near_end, call clear_glyph_matrix.
- (redisplay_window): After make_cursor_line_fully_visible,
- call clear_glyph_matrix and bypass `goto done'.
-
- * xfns.c (x_report_frame_params): If FRAME_SCROLL_BAR_PIXEL_WIDTH is 0
- and we have non-toolkit scroll bars, return nil for scroll-bar-width.
-
-2002-09-10 Richard M. Stallman <[email protected]>
-
- * fileio.c (Fdo_auto_save): Catch error making directory.
- Only call push_message if we need to.
- At the same time, make an unwind-protect to pop it.
- Rename local message_p to old_message_p.
- (do_auto_save_make_dir, do_auto_save_eh): New functions.
- (do_auto_save_unwind): Don't call pop_message.
-
- * lisp.h (pop_message_unwind): Renamed from push_message_unwind.
-
- * keyboard.c (Fexecute_extended_command): Use pop_message_unwind.
-
- * alloc.c (Fgarbage_collect): Use pop_message_unwind.
-
- * xdisp.c (pop_message_unwind): Renamed from push_message_unwind.
-
-2002-09-10 Stefan Monnier <[email protected]>
-
- * regex.c (DISCARD_FAILURE_REG_OR_COUNT): Delete.
- (CHECK_INFINITE_LOOP): Don't pop anything: just set `cycle' to 1.
- (re_match_2_internal): Be more careful with infinite loops.
-
-2002-09-10 Kim F. Storm <[email protected]>
-
- * macros.c (end_kbd_macro): New function.
- (Fend_kbd_macro): Use it.
-
- * macros.h (end_kbd_macro): Declare extern.
-
- * keyboard.c (Fdiscard_input): If defining keyboard macro,
- end and save it instead of discarding it.
-
-2002-09-09 Markus Rost <[email protected]>
-
- * s/sol2-6.h: Fix typo. Add comment.
-
-2002-09-09 Richard M. Stallman <[email protected]>
-
- * regex.c (regnum_t): Use signed int, not unsigned int.
-
- * s/sol2-6.h: New file.
-
- * s/sol2-5.h (UNEXEC): Definition deleted.
-
-2002-09-08 Kim F. Storm <[email protected]>
-
- * macros.c (executing_macro_index): Change type to EMACS_INT.
- (syms_of_macros): DEFVAR_INT it (needed by kmacro).
-
- * macros.h (executing_macro_index): Change type to EMACS_INT.
-
-2002-09-06 Richard M. Stallman <[email protected]>
-
- * casetab.c (set_case_table): Make canon table point to eqv table.
-
-2002-09-06 Juanma Barranquero <[email protected]>
-
- * coding.c (syms_of_coding): Fix spacing.
-
- * composite.c (Fcompose_region_internal)
- (Fcompose_string_internal): Likewise.
-
- * data.c (Flsh): Likewise.
-
- * fontset.c (Fset_fontset_font): Likewise.
-
- * macfns.c (Fx_server_max_request_size): Likewise.
-
- * w16select.c (syms_of_win16select): Likewise.
-
- * w32select.c (syms_of_w32select): Likewise.
-
- * xselect.c (syms_of_xselect): Likewise.
-
-2002-09-05 Richard M. Stallman <[email protected]>
-
- * regex.c (set_image_of_range_1): In no-TRANSLATE case,
- call EXTEND_RANGE_TABLE and return a proper value.
- (set_image_of_range): Don't call set_image_of_range_1
- if no TRANSLATE or if range includes all of Latin-1.
- Only call it for the Latin-1 part of the range.
- For other cases, make two separate ranges,
- one for the original specified characters and one for
- their case-conversions.
-
-2002-09-04 Richard M. Stallman <[email protected]>
-
- * s/sol2-5.h (UNEXEC): Use unexsol.o.
-
- * window.c (displayed_window_lines): Correct for one-off bug
- in HEIGHT on non-window displays.
-
- * regex.c (set_image_of_range_1): New function.
- (set_image_of_range): Use set_image_of_range_1 for Latin-1.
- Return a value to indicate running out of memory.
- (SET_RANGE_TABLE_WORK_AREA): Check value from set_image_of_range.
- (extend_range_table_work_area): New subroutine.
- (EXTEND_RANGE_TABLE): Replaces EXTEND_RANGE_TABLE_WORK_AREA.
- Different calling conventions, and used from set_image_of_range{,_1}.
- (IMMEDIATE_QUIT_CHECK): Definitions moved.
-
-2002-09-04 Juanma Barranquero <[email protected]>
-
- * makefile.w32-in: All dependencies updated.
-
-2002-09-01 Richard M. Stallman <[email protected]>
-
- * unexsol.c: New file.
-
- * xfns.c (Qbox): Declare external, don't define.
-
- * xdisp.c (redisplay_window) <force-start case>:
- If point is on semi-visible last line, reposition
- it at previous line.
-
- * alloc.c (display_malloc_warning): Use display-warning.
- (malloc_warning_1): Function deleted.
-
- * alloc.c [ALLOC_DEBUG]: #undef INLINE.
-
- * lread.c (read1): Handle #! by skipping the line.
-
-2002-08-31 Richard M. Stallman <[email protected]>
-
- * Makefile.in (TEMACS_LDFLAGS): Renamed from ALL_LDFLAGS.
- Don't include LDFLAGS.
- (temacs): Pass LDFLAGS separately, and not via YMF_PASS_LDFLAGS.
-
-2002-08-31 Eli Zaretskii <[email protected]>
-
- * xdisp.c (get_window_cursor_type): Don't use x_highlight_frame
- member of x_display_info unless we compile for some window system.
-
-2002-08-31 Kim F. Storm <[email protected]>
-
- * xdisp.c (Valternate_cursor_type, Qalternate_cursor_type): Removed.
- (get_window_cursor_type): Don't use them.
- (syms_of_xdisp): Remove intern, staticpro, and defvar for them.
-
-2002-08-30 Kenichi Handa <[email protected]>
-
- * xdisp.c (get_next_display_element): Fix previous change.
-
-2002-08-30 Andrew Choi <[email protected]>
-
- * macterm.c (expose_overlaps): New function (merge code from xterm.c).
- (expose_window): Use it to fix the display of overlapping
- rows (merge code from xterm.c).
-
- * macfns.c (Qbox): Add extern declaration.
-
-2002-08-30 Juanma Barranquero <[email protected]>
-
- * w32fns.c (Qbox): Make extern.
- (syms_of_w32fns): Remove initialization of Qbox.
-
-2002-08-30 Rune Kleveland <[email protected]> (tiny change)
-
- * xfns.c (Fx_open_connection): Fix error message.
-
-2002-08-30 Kim F. Storm <[email protected]>
-
- The following changes consolidates the handling of the cursor
- type in xdisp.c, moving duplicate code and functionality from
- xfns.c, xterm.c, w32fns.c, w32term.c, macfns.c, and macterm.c.
-
- * frame.h (enum text_cursor_kinds): Consolidated here.
- Added DEFAULT_CURSOR value.
- (struct frame) <desired_cursor, cursor_width>
- <blink_off_cursor, blink_off_cursor_width>: New fields.
- Consolidated from output_x, output_w32 and output_mac structs.
- (FRAME_DESIRED_CURSOR, FRAME_CURSOR_WIDTH, FRAME_BLINK_OFF_CURSOR)
- (FRAME_BLINK_OFF_CURSOR_WIDTH): Macros consolidated here.
-
- * xdisp.c (Qbar, Qhbar, Qbox, Qhollow, Vblink_cursor_alist):
- Variables consolidated here.
- (Valternate_cursor_type, Qalternate_cursor_type): New variables.
- (Vcursor_in_non_selected_windows): Renamed from
- cursor_in_non_selected_windows and changed to Lisp_Object.
- (syms_of_xdisp): Define and staticpro new and moved variables.
- (get_specified_cursor_type): Renamed from x_specified_cursor_type;
- consolidated here. Recognize Qhollow setting.
- (set_frame_cursor_types): New function to set frame cursor types
- based on the frame parameters.
- (get_window_cursor_type): New function to calculate new cursor
- type and width for the specified window. Based on duplicated
- code consolidated here.
- Enhancements: cursor-in-non-selected-windows may be a cursor type,
- check buffer-local alternate-cursor-type and blink-cursor-alist
- before using built-in blink off methods.
-
- * dispextern.h (cursor_in_non_selected_windows): Extern removed.
-
- * lisp.h (Qcursor_in_non_selected_windows): Extern removed.
- (get_specified_cursor_type, get_window_cursor_type)
- (set_frame_cursor_types): Added prototypes.
-
- * macfns.c (x_specified_cursor_type): Removed.
- (x_set_cursor_type): Use set_frame_cursor_types.
- (Qbar, Qbox): Removed.
- (syms_of_macfns): Don't intern or staticpro them.
-
- * macterm.c (x_specified_cursor_type): Remove prototype.
- (x_draw_bar_cursor): Use FRAME_CURSOR_WIDTH.
- (x_display_and_set_cursor): Use get_window_cursor_type.
- Remove unused local variables cursor_non_selected, active_cursor.
- Redraw cursor if hbar cursor width changes.
- (make_mac_frame): Set FRAME_DESIRED_CURSOR.
-
- * macterm.h (enum text_cursor_kinds): Removed.
- (struct output_mac) <current_cursor, desired_cursor, cursor_width>
- <blink_off_cursor, blink_off_cursor_width>: Members removed.
- (FRAME_DESIRED_CURSOR): Macro removed.
-
- * w32fns.c (Vblink_cursor_alist): Removed.
- (Qbar, Qhbar, Qbox, Qhollow): Removed.
- (syms_of_w32fns): Don't intern, staticpro, or define them.
- (x_specified_cursor_type): Removed.
- (x_set_cursor_type): Use set_frame_cursor_types.
-
- * w32term.c (x_specified_cursor_type): Remove prototype.
- (x_draw_bar_cursor): Use FRAME_CURSOR_WIDTH.
- (x_display_and_set_cursor): Use get_window_cursor_type.
- Remove unused local variables cursor_off_state.
- Redraw cursor if hbar cursor width changes.
- Changed all occurrences of w32_highlight_frame to x_highlight_frame.
-
- * w32term.h (enum text_cursor_kinds): Removed.
- (struct output_w32) <current_cursor, desired_cursor, cursor_width>
- <blink_off_cursor, blink_off_cursor_width>: Members removed.
- (FRAME_DESIRED_CURSOR, FRAME_CURSOR_WIDTH, FRAME_BLINK_OFF_CURSOR)
- (FRAME_BLINK_OFF_CURSOR_WIDTH): Macros removed.
- (struct w32_display_info) <x_highlight_frame>: Renamed member from
- w32_highlight_frame.
-
- * xfns.c (Vblink_cursor_alist): Removed.
- (Qbar, Qhbar, Qbox, Qhollow): Removed.
- (syms_of_xfns): Don't intern, staticpro, or define them.
- (x_specified_cursor_type): Removed.
- (x_set_cursor_type): Use set_frame_cursor_types.
-
- * xterm.c (x_specified_cursor_type): Remove prototype.
- (x_draw_bar_cursor): Use FRAME_CURSOR_WIDTH.
- (x_display_and_set_cursor): Use get_window_cursor_type.
- Remove unused local variables cursor_off_state.
- Redraw cursor if hbar cursor width changes.
-
- * xterm.h (enum text_cursor_kinds): Removed.
- (struct output_x) <current_cursor, desired_cursor, cursor_width>
- <blink_off_cursor, blink_off_cursor_width>: Members removed.
- (FRAME_DESIRED_CURSOR, FRAME_CURSOR_WIDTH, FRAME_BLINK_OFF_CURSOR)
- (FRAME_BLINK_OFF_CURSOR_WIDTH): Macros removed.
- (x_specified_cursor_type): Remove prototype.
-
-2002-08-28 Richard M. Stallman <[email protected]>
-
- * w32fns.c (x_set_cursor_type): Set FRAME_BLINK_OFF_CURSOR and
- FRAME_BLINK_OFF_CURSOR_WIDTH using defaults and Vblink_cursor_alist.
- (Vblink_cursor_alist): New variable.
- (syms_of_w32fns): Initialize and defvar it.
- (x_specified_cursor_type): Recognize Qbox for filled box.
- Exceptions are hollow boxes.
- (Qbox, Qhollow): New variables.
- (syms_of_w32fns): Initialize and staticpro them.
-
- * w32term.h (FRAME_BLINK_OFF_CURSOR, FRAME_BLINK_OFF_CURSOR_WIDTH):
- New macros.
- (struct w32_output): New fields blink_off_cursor,
- blink_off_cursor_width.
- (FRAME_CURSOR_WIDTH): New macro.
-
- * w32term.c (x_display_and_set_cursor): Use FRAME_BLINK_OFF_CURSOR
- and FRAME_BLINK_OFF_CURSOR_WIDTH for blinking cursor off.
-
- * w32term.c (x_display_and_set_cursor): Check FRAME_CURSOR_WIDTH
- for bar cursor.
-
- * w32term.c (expose_overlaps): New function.
- (expose_window): Use it to fix the display of overlapping rows.
-
-2002-08-28 Simon Josefsson <[email protected]>
-
- * xfns.c (Fx_open_connection): Improve help when X connection
- fails, xhost is insecure and xauth is better.
-
-2002-08-28 Juanma Barranquero <[email protected]>
-
- * makefile.w32-in: Add missing dependencies on w32term.h and
- composite.h.
-
- * emacs.c (USAGE1): Add missing newline.
-
-2002-08-27 Andrew Choi <[email protected]>
-
- * s/darwin.h [HAVE_LIBNCURSES]: Define HAVE_TERMINFO.
-
-2002-08-27 Richard M. Stallman <[email protected]>
-
- * xfns.c (x_set_cursor_type): Set FRAME_BLINK_OFF_CURSOR and
- FRAME_BLINK_OFF_CURSOR_WIDTH using defaults and Vblink_cursor_alist.
- (Vblink_cursor_alist): New variable.
- (syms_of_xfns): Initialize and defvar it.
- (x_specified_cursor_type): Recognize Qbox for filled box.
- Exceptions are hollow boxes.
- (Qbox, Qhollow): New variables.
- (syms_of_xfns): Initialize and staticpro them.
-
- * xterm.h (FRAME_BLINK_OFF_CURSOR, FRAME_BLINK_OFF_CURSOR_WIDTH):
- New macros.
- (struct x_output): New fields blink_off_cursor, blink_off_cursor_width.
-
- * xterm.c (x_display_and_set_cursor): Use FRAME_BLINK_OFF_CURSOR
- and FRAME_BLINK_OFF_CURSOR_WIDTH for blinking cursor off.
-
- * emacs.c (main): Handle --script.
- (USAGE1): Mention --script.
- (standard_args): Define sort order for --script.
-
-2002-08-27 Gerd Moellmann <[email protected]>
-
- * xdisp.c (redisplay_updating_p): Variable removed.
- (inhibit_free_realized_faces, Qinhibit_free_realized_faces):
- New variables.
- (init_iterator): Don't free realized faces if
- inhibit_free_realized_faces is set.
- (redisplay_internal): Bind Qinhibit_free_realized_faces to nil.
- (syms_of_xdisp): DEFVAR_BOOL inhibit-free-realized-faces,
- initialize Qinhibit_free_realized_faces.
-
- * dispextern.h (PRODUCE_GLYPHS): Set inhibit_free_realized_faces
- when iterator is adding glyphs to a glyph matrix.
-
-2002-08-27 Kenichi Handa <[email protected]>
-
- * xdisp.c (get_next_display_element): In unibyte case, don't use
- octal form for such eight-bit characters that can be converted to
- multibyte char.
-
-2002-08-26 Kim F. Storm <[email protected]>
-
- * frame.c (make_terminal_frame) [CANNOT_DUMP]: Initialize
- foreground and background colors. From Joe Buehler.
-
-2002-08-26 Miles Bader <[email protected]>
-
- * bytecode.c (Fbyte_code): Fsub1 can GC, so protect it.
-
-2002-08-25 Andrew Choi <[email protected]>
-
- * emacs.c (main): Call init_mac_osx_environment if HAVE_CARBON is
- defined instead of MAC_OSX.
-
- * s/darwin.h (select): Define select to sys_select only if
- HAVE_CARBON is defined.
- (HAVE_WORKING_VFORK): #undef it. Define vfork to fork.
- (DONT_REOPEN_PTY): #def it.
-
- * macterm.c (XTread_socket): Remove code to call
- SendEventToEventTarget for keys with command modifiers when
- mac_command_key_is_meta is nil.
-
-2002-08-24 Andreas Schwab <[email protected]>
-
- * eval.c (Fdefvar): Fix last change.
-
-2002-08-23 Richard M. Stallman <[email protected]>
-
- * eval.c (Fdefvar, Fdefconst, Fdefvaralias):
- Record variables in load history as (defvar . VAR).
- (Fdefvar): Don't record in load history if no initial value.
- (Qdefvar): New variable.
- (syms_of_eval): Init and staticpro it.
-
- * lread.c (syms_of_lread): Doc fix.
- (build_load_history): Use Fmember to see if a definition
- is already in the Vload_history element.
-
- * process.c (Fstart_process): Remove /: from program name.
-
- * emacs.c (decode_env_path): Don't add /: if file name handler
- has a `safe-magic' property.
-
- * callproc.c (Fcall_process): Remove /: from program name.
-
-2002-08-23 Stefan Monnier <[email protected]>
-
- * regex.c (PATFETCH): Remove the translating fetch.
- (PATFETCH_RAW): Rename to PATFETCH.
- (set_image_of_range): New fun.
- (SET_RANGE_TABLE_WORK_AREA): Use it.
- (regex_compile): Don't translate the pattern chars so eagerly.
- Only do it when inserting an `exactn' bytecode or when handling
- a char-range.
- (mutually_exclusive_p): Avoid empty statement.
-
-2002-08-22 Kim F. Storm <[email protected]>
-
- * xdisp.c (redisplay_window): Do not `goto try_to_scroll' when we
- end up on a partially visible line; this reverts a specific part
- of the 2002-07-07 change by Richard M. Stallman to "fix" a nasty
- display error which has been reported several times now.
- However it introduces the problem that changes was supposed to fix.
- See my comments in the source if you want to debug this further.
-
-2002-08-20 Kenichi Handa <[email protected]>
-
- * abbrev.c (Fexpand_abbrev): Fix for the multibyte case.
-
-2002-08-19 Eli Zaretskii <[email protected]>
-
- * msdos.c (croak): Add `void' to definition.
-
- * sysdep.c (request_sigio, unrequest_sigio) [MSDOS]:
- Don't define them, they are defined in msdos.c.
-
- * mem-limits.h [MSDOS]: Declare etext.
-
- * fileio.c (Ffile_name_directory) [DOS_NT]: Don't declare `beg'
- `const' since CORRECT_DIR_SEPS modifies its target.
-
-2002-08-19 Kim F. Storm <[email protected]>
-
- * keyboard.c (Fclear_this_command_keys): Add optional arg
- KEEP-RECORD to avoid clearing lossage when we just want to clear
- the current key sequence (kmacro needs this).
-
-2002-08-19 Kenichi Handa <handa@localhost>
-
- * composite.c (run_composition_function): Call FUNC if it is fboundp.
-
- * composite.h (COMPOSITION_MODIFICATION_FUNC): If PROP is not a
- cons, return Qnil.
-
-2002-08-17 Richard M. Stallman <[email protected]>
-
- * s/sol2-5.h (BROKEN_SIGIO): Add #undef.
-
- * sysdep.c [!VMS]: Include sys/files.h.
-
- * editfns.c (save_restriction_restore): Defend from unchained marker.
-
- * buffer.c (overlays_at): Handle extending vec uniformly.
- (overlays_in): Handle extending vec from length 0 as in overlays_at.
-
-2002-08-15 Andrew Choi <[email protected]>
-
- * mac.c (init_mac_osx_environment): New function.
-
- * emacs.c (main) [MAC_OSX]: Call init_mac_osx_environment.
-
-2002-08-14 Kim F. Storm <[email protected]>
-
- * macros.c (Fstart_kbd_macro): Added NO-EXEC argument to inhibit
- executing macro before appending to it (when used from Lisp).
- (Fexecute_kbd_macro): Added LOOPFUNC argument to supply function
- which is called prior to each iteration of macro (for kmacro.el).
- (Fend_kbd_macro, Fcall_last_kbd_macro): Likewise.
-
- * lisp.h (Fexecute_kbd_macro): Update prototype.
-
- * keyboard.c (Fcommand_execute): Update call to Fexecute_kbd_macro.
-
-2002-08-14 Kenichi Handa <[email protected]>
-
- * xselect.c (QUTF8_STRING): New variable.
- (symbol_to_x_atom): Pay attention to QUTF8_STRING.
- (x_atom_to_symbol): Likewise.
- (x_get_local_selection): New argument local_request. If it is
- nonzero, call handler_fn with the second arg nil.
- (x_handle_selection_request): Call x_get_local_selection with
- local_request 0.
- (lisp_data_to_selection_data): Don't encode the string here.
- (Fx_get_selection_internal): Call x_get_local_selection with
- local_request 1.
- (syms_of_xselect): Intern and staticpro QUTF8_STRING.
-
- * xterm.c (x_term_init): Initialize dpyinfo->Xatom_UTF8_STRING.
-
- * xterm.h (struct x_display_info): New member Xatom_UTF8_STRING.
-
-2002-08-13 Richard M. Stallman <[email protected]>
-
- * minibuf.c (Fminibufferp): New function.
- (syms_of_minibuf): Defsubr it.
- (Fminibuffer_prompt_end): Handle non-minibuffers specially.
-
-2002-08-13 Gerd Moellmann <[email protected]>
-
- * coding.c (Funencodable_char_position): Lisp_Object/int mixup.
-
-2002-08-12 Richard M. Stallman <[email protected]>
-
- * syswait.h: Only the include of sys/wait.h tests HAVE_SYS_WAIT_H.
- [!VMS] (WCOREDUMP, WEXITSTATUS, WIFEXITED, WIFSTOPPED, WIFSIGNALED)
- (WSTOPSIG, WTERMSIG): Define each one independently if not defined
- already.
-
- * buffer.c (syms_of_buffer) <fill-column>: Doc fix.
-
-2002-08-11 Andrew Choi <[email protected]>
-
- * macterm.c (XTmouse_position): Check wp with is_emacs_window.
- (Vmac_pass_command_to_system): New variable.
- (Vmac_pass_control_to_system): New variable.
- (do_mouse_moved): Check wp with is_emacs_window.
- (XTread_socket): Check window_ptr with is_emacs_window.
- Call FrontNonFloatingWindow instead of FrontWindow. Send keydown
- events back to Mac Toolbox for processing, depending on values of
- Vmac_pass_command_to_system and Vmac_pass_control_to_system.
- (syms_of_macterm): DEFVAR_LISP Vmac_pass_command_to_system and
- Vmac_pass_control_to_system.
-
-2002-08-10 Kenichi Handa <[email protected]>
-
- * coding.c (unencodable_char_position): New function.
- (Funencodable_char_position): New function.
- (syms_of_coding): Defsubr Funencodable_char_position.
-
-2002-08-10 Andrew Choi <[email protected]>
-
- * mac.c (sys_select) [MAC_OSX]: New function.
-
- * macterm.c (MakeMeTheFrontProcess): New function.
- (mac_initialize): Call MakeMeTheFrontProcess.
-
- * s/darwin.h: Define select to sys_select.
-
-2002-08-09 Richard M. Stallman <[email protected]>
-
- * keyboard.c (make_lispy_event): Test WINDOWSNT, not WINDOWS_NT.
-
-2002-08-09 Gerd Moellmann <[email protected]>
-
- * xdisp.c (forward_to_next_line_start): Return 0 when reaching the
- end of the buffer.
-
-2002-08-08 Ken Raeburn <[email protected]>
-
- * coding.c (Ffind_operation_coding_system): Fix Lisp_Object/int mixup.
-
- * puresize.h (BASE_PURESIZE): Increase to 910000.
-
-2002-08-08 Kenichi Handa <[email protected]>
-
- * coding.c (Ffind_operation_coding_system): For write-region, if
- VISIT is a filename, make it the target.
-
-2002-08-07 Richard M. Stallman <[email protected]>
-
- * alloc.c (mark_object): Detect long lists for debugging.
- (mark_object_loop_halt): New variable.
-
- * s/hpux10.h (C_SWITCH_SYSTEM): #undef it.
-
- * data.c (Fmake_variable_frame_local): Doc fix.
-
-2002-08-01 David Ponce <[email protected]>
-
- * w32menu.c (local_heap, local_alloc, local_free): New macros.
- (malloc_widget_value, free_widget_value)
- (w32_free_submenu_strings): Use them.
-
- (push_submenu_start, push_submenu_end, push_left_right_boundary)
- (push_menu_pane, push_menu_item, single_keymap_panes)
- (single_menu_item, Fx_popup_menu, menubar_selection_callback)
- (single_submenu, set_frame_menubar)
- (w32_menu_show, w32_dialog_show): Use AREF, ASET, ASIZE.
-
- (Fx_popup_menu): Don't show pop up menu until preceding one is
- actually cleaned up. Moved UNGCPRO outside #ifdef HAVE_MENUS block.
-
- * w32menu.c: Changes adapted from xmenu.c
- (set_frame_menubar): First parse all submenus,
- then make widget_value trees from them.
- Don't allocate any widget_value objects
- until we are done with the parsing.
- (parse_single_submenu): New function.
- (digest_single_submenu): New function.
- (single_submenu): Function deleted, replaced by those two.
-
-2002-08-04 Andrew Choi <[email protected]>
-
- * macterm.c (XTread_socket): Check that FrontNonFloatingWindow
- returns a valid window pointer before proceeding for keyDown and
- autoKey events.
-
-2002-08-03 Andrew Choi <[email protected]>
-
- * macterm.c (USE_CARBON_EVENTS): New macro.
- (macCtrlKey, macShiftKey, macMetaKey, macAltKey): New macros.
- (x_iconify_frame): Call CollapseWindow.
- (Vmac_reverse_ctrl_meta): New variable.
- (Vmac_wheel_button_is_mouse_2): New variable.
- (init_mac_drag_n_drop): New function.
- (mac_do_receive_drag): New function.
- (mac_handle_service_event): New function.
- (init_service_handler): New function.
- (mac_to_emacs_modifiers): New function.
- (mac_event_to_emacs_modifiers): New function.
- (mac_get_mouse_btn): New function.
- (mac_convert_event_ref): New function.
- (XTread_socket) [USE_CARBON_EVENTS]: Call ReceiveNextEvent,
- SendEventToEventTarget, mac_event_to_emacs_modifiers, and
- mac_get_mouse_btn.
- (mac_initialize): Call init_mac_drag_n_drop and init_service_handler.
-
- * keyboard.c: Define Qmouse_wheel, mouse_wheel_syms, and
- lispy_mouse_wheel_names for MAC_OSX as well as for WINDOWS_NT.
- (kbd_buffer_get_event): Set used_mouse_menu for MENU_BAR_EVENT and
- TOOL_BAR_EVENT for MAC_OS as well.
- (make_lispy_event): Handle MOUSE_WHEEL_EVENT for MAC_OSX as well
- as for WINDOWS_NT.
- (syms_of_keyboard): Initialize Qmouse_wheel for MAC_OSX.
-
- * termhooks.h (event_kind): Define MOUSE_WHEEL_EVENT also for MAC_OSX.
-
-2002-08-03 Gerd Moellmann <[email protected]>
-
- * xdisp.c (forward_to_next_line_start): Fix a condition that
- lead to a newline being skipped.
-
-2002-08-02 Andrew Choi <[email protected]>
-
- * mac.c (syms_of_mac): Defsubr Sx_selection_exists_p.
-
-2002-08-01 Richard M. Stallman <[email protected]>
-
- * Makefile.in (SOME_MACHINE_OBJECTS): Add fontset.o.
-
-2002-07-31 Andrew Choi <[email protected]>
-
- * macfns.c: #undef init_process before #define-ing it.
-
- * s/darwin.h: Define MAC_OS, SYMS_SYSTEM, and OTHER_FILES only if
- HAVE_CARBON is defined.
-
-2002-07-31 Richard M. Stallman <[email protected]>
-
- * xmenu.c (set_frame_menubar): First parse all submenus,
- then make widget_value trees from them.
- Don't allocate any widget_value objects
- until we are done with the parsing.
- (parse_single_submenu): New function.
- (digest_single_submenu): New function.
- (single_submenu): Function deleted, replaced by those two.
-
-2002-07-30 Juanma Barranquero <[email protected]>
-
- * w32proc.c (syms_of_ntproc): Fix docstring of
- `w32-get-true-file-attributes'.
-
-2002-07-28 Richard M. Stallman <[email protected]>
-
- * s/hpux8.h (HPUX8): Define this before including hpux.h.
- (HAVE_SYS_WAIT_H): #define deleted; we let Autoconf decide.
-
- * s/hpux.h (HAVE_SYS_WAIT_H): The #undef is conditional on HPUX8.
-
- * keyboard.c (make_lispy_event):
- Use #ifdef to test USE_TOOLKIT_SCROLL_BARS.
- Explicitly clear up_modifier in event->modifiers.
-
-2002-07-27 Richard M. Stallman <[email protected]>
-
- * xterm.h (FRAME_CURSOR_WIDTH): New macro.
-
- * xterm.c (x_display_and_set_cursor): Check FRAME_CURSOR_WIDTH
- for bar cursor.
-
-2002-07-26 Kenichi Handa <[email protected]>
-
- * coding.c (detect_coding_iso2022): While checking a byte sequence
- for CODING_CATEGORY_MASK_ISO_8_2, if we read one extra byte, check
- it in the normal loop.
-
-2002-07-24 Gerd Moellmann <[email protected]>
-
- * xterm.c (expose_overlaps): New function.
- (expose_window): Use it to fix the display of overlapping rows.
-
- * xdisp.c (unwind_redisplay): Clear redisplay_updating_p.
-
-2002-07-23 Ken Raeburn <[email protected]>
-
- * lisp.h (XPNTR): Use NO_UNION_TYPE version for union as well,
- since it only depends on XUINT.
-
- * m/alpha.h (BITS_PER_LONG, BITS_PER_EMACS_INT, EMACS_INT,
- EMACS_UINT, SPECIAL_EMACS_INT, DATA_SEG_BITS,
- PNTR_COMPARISON_TYPE, VALBITS, MARKBIT, XINT, XUINT, XPNTR):
- Macros deleted.
-
- * mem-limits.h (start_of_data): If DATA_START is defined, prefer
- its value over other approaches.
- * sysdep.c (start_of_data): Don't define the function if a macro
- form has been defined.
-
-2002-07-23 Gerd Moellmann <[email protected]>
-
- * xdisp.c (redisplay_updating_p): New variable.
- (init_iterator): Don't free realized faces when
- redisplay_updating_p is set.
- (redisplay_internal): Set redisplay_updating_p while updating
- the display.
-
-2002-07-23 Richard M. Stallman <[email protected]>
-
- * editfns.c (Fmessage): Treat "" like nil.
-
-2002-07-23 Kenichi Handa <[email protected]>
-
- * xdisp.c (face_before_or_after_it_pos):
- Call FETCH_MULTIBYTE_CHAR with byte postion, not char position.
-
-2002-07-22 Juanma Barranquero <[email protected]>
-
- * callproc.c (init_callproc) [DOS_NT]:
- Initialize Vshared_game_score_directory to nil.
- (syms_of_callproc) [DOS_NT]: Likewise.
-
-2002-07-22 Gerd Moellmann <[email protected]>
-
- * xdisp.c (display_line): Replace an abort with xassert.
-
-2002-07-21 Richard M. Stallman <[email protected]>
-
- * xdisp.c (redisplay_window): Don't test BEG_UNCHANGED
- and END_UNCHANGED when setting buffer_unchanged_p.
- Use current_matrix_up_to_date_p to decide whether to use
- try_cursor_movement.
-
- * config.in (HAVE_SHARED_GAME_DIR): Undef deleted.
-
- * epaths.in (PATH_GAME): New macro, edited by ../Makefile.in.
-
- * callproc.c (init_callproc): Set up Vshared_game_score_directory.
- Set to nil if dir does not exist.
- (syms_of_callproc): Init unconditionally and simply.
-
- * buffer.c (Fbuffer_list): Doc fix.
-
-2002-07-21 Ken Raeburn <[email protected]>
-
- * sysdep.c (end_of_text, end_of_data): Unused functions deleted.
-
- * buffer.c (mmap_realloc): When shrinking, make sure number of
- pages to unmap is rounded towards zero.
-
- * m/mips-siemens.h (XSETUINT, XSETPNTR): Unused macros deleted.
- (XSETINT): Deleted.
-
- * m/att3b.h (XINT): Don't define.
- (VALBITS, VALMASK, XTYPE): Deleted.
- (DATA_SEG_BITS): Define.
- * m/gec63.h (VALBITS, VALAMASK, XTYPE, XSETTYPE, XPNTR, XSET,
- ARRAY_MARK_FLAG): Deleted.
- (DATA_SEG_BITS): Define.
- * m/pfa50.h (VALBITS, VALMASK, XTYPE): Deleted.
- (DATA_SEG_BITS): Define.
-
-2002-07-20 Richard M. Stallman <[email protected]>
-
- * print.c (print_error_message): New args CONTEXT and CALLER.
- Calls changed.
-
- * lisp.h (print_error_message): Declare new args.
-
- * keyboard.c (cmd_error_internal): Pass Vsignaling_function
- and CONTEXT to print_error_message, don't print them here.
- For a Quit, don't use Vsignaling_function.
- Call message_log_maybe_newline.
-
- * Makefile.in (xsmfns.o): Don't depend on lisp.h.
-
-2002-07-20 Kim F. Storm <[email protected]>
-
- * xdisp.c (redisplay_window): Test MODIFF to set buffer_unchanged_p.
-
-2002-07-19 Ken Raeburn <[email protected]>
-
- * bytecode.c (struct byte_stack): Pointers into byte string now
- point to const.
- * callproc.c (Fcall_process): Make NEW_ARGV array hold pointer to
- const.
- * charset.h (BCOPY_SHORT): Source pointer now points to const.
- * coding.c (encode_eol, detect_coding, detect_eol):
- (decode_coding, encode_coding, detect_coding_system):
- Source strings now treated as const.
- (decode_coding_string, encode_coding_string): Use STRING_COPYIN to
- modify Lisp string contents.
- * coding.h (decode_coding, encode_coding, detect_coding,
- detect_eol): Declarations updated.
- * composite.c (compose_chars_in_text): Treat Lisp string contents
- as const.
- * dispnew.c (safe_bcopy): Source pointer now points to const.
- * lisp.h (STRING_COPYIN): New macro.
- (detect_coding_system, safe_bcopy, temp_output_buffer_setup):
- (internal_with_output_to_temp_buffer): Declarations updated.
- * print.c (temp_output_buffer_setup):
- (internal_with_output_to_temp_buffer): Buffer name argument is now
- pointer to const.
- * sound.c (struct sound_device): Function pointer field "write"
- buffer argument now points to const.
- (vox_write): Buffer argument points to const.
- * syntax.c (Fstring_to_syntax, skip_chars): Treat Lisp string
- contents as const.
- * sysdep.c (emacs_write): Buffer pointer now const.
- * term.c (encode_terminal_code): Buffer pointer now const.
- * xfaces.c (may_use_scalable_font_p): Argument now points to const.
- (x_face_list_fonts, x_update_menu_appearance):
- (hash_string_case_insensitive): Treat Lisp string contents as const.
-
-2002-07-19 Juanma Barranquero <[email protected]>
-
- * xdisp.c (syms_of_xdisp): Remove redundant deprecation info.
-
- * fileio.c (syms_of_fileio): Likewise.
- (Ffile_name_as_directory): Fix argument name in docstring.
- (file_name_as_directory): Use literal '/' instead of DIRECTORY_SEP.
-
-2002-07-18 Richard M. Stallman <[email protected]>
-
- * data.c (Fdefalias): Doc fix.
-
-2002-07-17 Dave Love <[email protected]>
-
- * intervals.h (text_property_stickiness): Use P_.
-
- * ccl.c: Remove `emacs' conditionals.
- (ccl_backtrace_table): Fix size spec.
- (ccl_driver): Fix type errors.
-
-2002-07-16 Ken Raeburn <[email protected]>
-
- * alloc.c (xstrdup, make_string, make_unibyte_string)
- (make_multibyte_string, build_string): String pointer args now
- point to const.
- * charset.c (find_charset_in_text, c_string_width):
- (chars_in_text, multibyte_chars_in_text, parse_str_as_multibyte):
- * fileio.c (report_file_error):
- * insdel.c (copy_text, count_size_as_multibyte, insert_1):
- (count_combining_before, count_combining_after, insert_1_both):
- (insert, insert_and_inherit, insert_string):
- (insert_before_markers, insert_before_markers_and_inherit):
- * lread.c (intern, oblookup, hash_string):
- * minibuf.c (temp_echo_area_glyphs):
- * search.c (fast_c_string_match_ignore_case):
- * sysdep.c (emacs_open, set_file_times):
- * xfaces.c (xstricmp):
- * xdisp.c (store_frame_title, string_char_and_length):
- (message_dolog, message2, message2_nolog, set_message): Likewise.
- (set_message_1): Cast message string argument to const pointer.
- * editfns.c (general_insert_function): Insertion function now
- takes pointer to const for input data.
- * charset.h (find_charset_in_text, c_string_width):
- (parse_str_as_multibyte): Declarations updated.
- * dispextern.h (xstricmp): Declaration updated.
- * lisp.h (chars_in_text, multibyte_chars_in_text, copy_text):
- (count_size_as_multibyte, count_combining_before):
- (count_combining_after, insert_1, insert_1_both, message_dolog):
- (insert, insert_and_inherit, insert_before_markers)
- (insert_before_markers_and_inherit, set_message, message2):
- (message2_dolog, build_string, make_string, make_unibyte_string):
- (make_multibyte_string, intern, oblookup, report_file_error):
- (fast_c_string_match_ignore_case, temp_echo_area_glyphs):
- (emacs_open, xstrdup): Declarations updated.
- * systime.h (set_file_times): Declaration updated.
-
- * charset.c (find_charset_in_text, lisp_string_width): Use const
- for pointer to lisp string data.
- * charset.h (FETCH_STRING_CHAR_ADVANCE):
- (FETCH_STRING_CHAR_ADVANCE_NO_CHECK):
- * coding.c (Ffind_coding_systems_region_interval):
- * fileio.c (Ffile_name_directory, Ffile_name_nondirectory):
- (Fmake_directory_internal, Fdelete_directory):
- (Ffile_name_absolute_p, Fwrite_region, double_dollars):
- * fontset.c (font_family_registry, fs_query_fontset):
- (list_fontsets):
- * frame.c (Fframe_parameter):
- * keyboard.c (cmd_error_internal):
- * keymap.c (Fdescribe_buffer_bindings):
- * lread.c (complete_filename_p, openp):
- * minibuf.c (Fminibuffer_complete_word):
- * xdisp.c (string_pos_nchars_ahead, init_from_display_pos):
- (face_before_or_after_it_pos, next_element_from_string):
- (get_overlay_arrow_glyph_row, display_mode_element):
- (decode_mode_spec_coding):
- * xterm.c (same_x_server): Likewise.
-
- * buffer.c (reset_buffer_local_variables): Delete "#if 0"
- settings of non-existent fields.
-
- * editfns.c (Fstring_to_char): Don't use XSTRING/XSETSTRING to
- copy a lisp value.
-
- * lread.c (Fintern_soft): Use string macros instead of
- Lisp_String fields.
- * keyboard.c (echo_char, parse_modifiers_uncached):
- (parse_solitary_modifier, Fexecute_extended_command): Likewise.
- * textprop.c (validate_interval_range, interval_of): Likewise.
-
- * fontset.c (Fset_fontset_font): Use SDATA instead of XSTRING()->data.
-
- * charset.h (FETCH_STRING_CHAR_ADVANCE)
- (FETCH_STRING_CHAR_ADVANCE_NO_CHECK): Use SBYTES instead of
- XSTRING()->size_byte.
-
- * lisp.h (SDATA, SREF): Produce rvalue.
- (SSET): New macro.
- * alloc.c (make_event_array): Use SSET for storing into a string.
- * buffer.c (Fother_buffer): Use SREF when retrieving a byte from
- a string.
- * casefiddle.c (casify_object): Use SSET.
- * charset.h (FETCH_STRING_CHAR_ADVANCE)
- (FETCH_STRING_CHAR_ADVANCE_NO_CHECK): Use SDATA when getting
- address of string contents.
- * data.c (Faref): Use SDATA.
- (Faset): Use SDATA, SSET.
- * dired.c (directory_files_internal): Use SSET.
- * fileio.c (Fmake_symbolic_link, Fexpand_file_name): Use SSET.
- (Fread_file_name): Use SREF, SSET.
- * fns.c (concat): Use SSET.
- (concat, Fdelete): Use SDATA.
- * insdel.c (insert_from_string_1): Use SDATA.
- * keyboard.c (Fevent_convert_list): Use SREF.
- * lread.c (Fload): Use SDATA, SSET.
- * macfns.c (validate_x_resource_name): Use SSET.
- * process.c (status_message): Use SSET.
- * search.c (wordify): Use SDATA.
- (Freplace_match): Use SREF.
- * w32fns.c (validate_x_resource_name): Use SSET.
- * xfns.c (validate_x_resource_name): Use SSET.
- * xterm.c (x_catch_errors, x_clear_errors): Use SSET.
-
-2002-07-16 Richard M. Stallman <[email protected]>
-
- * s/hpux11.h (USG_SUBTTY_WORKS): Defined.
-
- * xdisp.c (reconsider_clip_changes):
- Don't test prevent_redisplay_optimizations_p.
- (redisplay_internal): Test prevent_redisplay_optimizations_p
- along with clip_changed in some cases.
- (try_window_id): Likewise.
- (redisplay_window): New local var buffer_unchanged_p.
-
- * keyboard.c (cmd_error) [HAVE_X_WINDOWS]: Maybe call cancel_houglass.
-
- * process.c (create_process): Test USG_SUBTTY_WORKS.
- (process_send_signal): Clean up handling of GID.
- Detect errors in ioctls meant to set GID.
-
- * window.c (temp_output_buffer_show):
- Don't set prevent_redisplay_optimizations_p.
-
-2002-07-15 Juanma Barranquero <[email protected]>
-
- * eval.c (Fdefvaralias): Add docstring argument.
-
-2002-07-15 Ken Raeburn <[email protected]>
-
- * lisp.h (STRING_INTERVALS): Produce rvalue.
- (STRING_SET_INTERVALS): New macro.
- * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): Use it.
- * fns.c (Fstring_as_multibyte): Likewise.
- * intervals.c (balance_possible_root_interval, delete_interval)
- (create_root_interval, copy_intervals_to_string): Likewise.
- * textprop.c (set_text_properties): Likewise. Use NULL_INTERVAL
- instead of 0.
-
-2002-07-14 Ken Raeburn <[email protected]>
-
- * lisp.h (STRING_SET_CHARS): New macro.
- (SCHARS, SBYTES): Produce rvalues.
- * dired.c (directory_files_internal): Use STRING_SET_CHARS.
- * fns.c (concat): Likewise.
- * lread.c (read_vector): Likewise.
-
- * lisp.h (SMBP): Delete. All uses changed to STRING_MULTIBYTE.
- (STRING_SET_UNIBYTE): New macro.
- (SET_STRING_BYTES): Delete. Callers (all of which supplied a
- length of -1) changed to use STRING_SET_UNIBYTE.
- * abbrev.c, alloc.c, buffer.c, bytecode.c, callint.c, callproc.c,
- casefiddle.c, category.c, ccl.c, charset.c, charset.h, coding.c,
- composite.c, data.c, dired.c, dispnew.c, disptab.h, doc.c,
- dosfns.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fn.c,
- fontset.c, frame.c, indent.c, insdel.c, intervals.c, keyboard.c,
- keymap.c, lread.c, mac.c, macfns.c, macmenu.c, macterm.c,
- minibuf.c, msdos.c, print.c, process.c, search.c, sound.c,
- sunfns.c, syntax.c, syntax.h, sysdep.c, textprop.c, undo.c,
- w16select.c, w32.c, w32fns.c, w32menu.c, w32proc.c, w32select.c,
- w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c,
- xselect.c, xsmfns.c, xterm.c: Most uses of XSTRING combined with
- STRING_BYTES or indirection changed to SCHARS, SBYTES,
- STRING_INTERVALS, SREF, SDATA; explicit size_byte references left
- unchanged for now.
-
-2002-07-13 Kim F. Storm <[email protected]>
-
- * keyboard.c (command_loop_1): Invert check on Vmemory_full.
-
-2002-07-12 Richard M. Stallman <[email protected]>
-
- * fileio.c (Fwrite_region): Doc fix.
-
- * print.c (print_error_message): Don't handle Vsignaling_function here.
-
- * keyboard.c (cmd_error_internal): Handle Vsignaling_function here.
- (command_loop_1): Avoid certain actions after memory-full error.
-
- * eval.c (Fsignal): Don't call cancel_hourglass.
- For a memory-full error, don't call Vsignal_hook_function
- and don't set Vsignaling_function.
-
- * process.c (process_send_signal): Add abort call.
-
-2002-07-11 Markus Rost <[email protected]>
-
- * keymap.c (Fkey_binding): Fix typo.
-
-2002-07-11 Richard M. Stallman <[email protected]>
-
- * alloc.c (Vmemory_full): New variable.
- (Vmemory_signal_data): Rename from memory_signal_data.
- Uses changed.
- (syms_of_alloc): Defvar them.
- (memory_full, buffer_memory_full): Set Vmemory_full.
-
- * lisp.h (Vmemory_full): Add declaration.
- (current_column, indented_beyond_p): Change declaration.
-
- * indent.c (last_known_column): Declare as double, not float.
- (current_column, current_column_1, string_display_width)
- (position_indentation): Return `double'.
- (indented_beyond_p): Arg `column' is `double'. Callers changed.
-
- * xdisp.c (message_dolog): Do nothing if Vmemory_full is non-nil.
- (back_to_previous_visible_line_start)
- (reseat_at_next_visible_line_start, next_element_from_buffer):
- Use `double', not `float', when calling indented_beyond_p.
-
- * s/hpux11.h (BROKEN_SA_RESTART): Define.
-
- * sysdep.c (sys_signal): Test BROKEN_SA_RESTART.
-
-2002-07-11 Juanma Barranquero <[email protected]>
-
- * alloc.c, buffer.c, bytecode.c, callint.c, callproc.c, coding.c,
- * composite.c, dired.c, dispnew.c, editfns.c, emacs.c, eval.c,
- * fileio.c, fns.c, insdel.c, keyboard.c, keymap.c, lread.c, macfns.c,
- * macmenu.c, macros.c, minibuf.c, print.c, process.c, sound.c,
- * textprop.c, w32fns.c, w32menu.c, window.c, xfaces.c, xfns.c,
- * xmenu.c, xselect.c, xterm.c: Use SPECPDL_INDEX wherever makes sense.
-
-2002-07-10 Juanma Barranquero <[email protected]>
-
- * lisp.h (SPECPDL_INDEX): Rename from BINDING_STACK_SIZE.
- All callers changed.
-
-2002-07-09 Stefan Monnier <[email protected]>
-
- * data.c (Fdefalias): Add an optional `docstring' argument.
- (set_internal, Fsetq_default): Use XCAR/XCDR.
-
- * composite.c (HASH_VALUE, HASH_KEY):
- * ccl.c (HASH_VALUE): Remove (it's in lisp.h now).
-
-2002-07-09 Kenichi Handa <[email protected]>
-
- * callproc.c (Fcall_process): Fix previous change.
-
-2002-07-07 Stefan Monnier <[email protected]>
-
- * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
- Add support for hash-tables.
- (Ftry_completion): Return t even if the string appears multiple times.
-
- * fns.c (Fnconc): Use XCDR.
- (Fprovide): Use CONSP and XCDR.
- (HASH_KEY, HASH_VALUE, HASH_NEXT, HASH_HASH, HASH_INDEX)
- (HASH_TABLE_SIZE): Delete: moved to lisp.h.
- (Fmake_hash_table): Accept `:size nil'.
- (Fmakehash): Delete: moved to subr.el.
- (syms_of_fns): Don't defsubr makehash.
-
- * lisp.h (HASH_KEY, HASH_VALUE, HASH_NEXT, HASH_HASH, HASH_INDEX)
- (HASH_TABLE_SIZE): Move from fns.c.
-
-2002-07-07 Richard M. Stallman <[email protected]>
-
- * xdisp.c (make_cursor_line_fully_visible): Don't try short scrolls.
- Instead just return 0 when there is something to be done.
- (try_scrolling): If make_cursor_line_fully_visible returns 0,
- retry scrolling as if cursor were off the bottom.
- (try_cursor_movement): If make_cursor_line_fully_visible returns 0,
- return CURSOR_MOVEMENT_MUST_SCROLL.
- (redisplay_window): If make_cursor_line_fully_visible returns 0,
- go to try_to_scroll.
-
- * buffer.c (Fbuffer_local_value): Store current value into its binding
- so we get the up-to-date value for the binding that is loaded.
-
- * eval.c (Fdefmacro): Doc fix.
-
-2002-07-05 Dave Love <[email protected]>
-
- * keyboard.c (read_key_sequence): Set initial_idleness_start_time
- correctly.
-
- * ccl.c (Vtranslation_hash_table_vector, GET_HASH_TABLE)
- (HASH_VALUE, CCL_LookupIntConstTbl, CCL_LookupCharConstTbl): New.
- (ccl_driver): Add cases for CCL_LookupIntConstTbl,
- CCL_LookupCharConstTbl.
- (syms_of_ccl): Defvar translation-hash-table-vector.
-
-2002-07-05 Pavel Jan,Am(Bk <[email protected]>
-
- * xdisp.c: Remove unused variable `face'.
-
-2002-07-04 Juanma Barranquero <[email protected]>
-
- * keyboard.c (post_command_idle_hook): Remove redundant (and inexact)
- obsolescence information.
-
-2002-07-03 Andrew Choi <[email protected]>
-
- * macterm.c (x_list_fonts): Fix comment. Cache fonts matching
- pattern. Search cache first.
- (init_font_name_table): Also add entry for jisx0201.1976-0 coding
- for Japanese font.
- (XLoadQueryFont): Use it.
-
-2002-07-02 Richard M. Stallman <[email protected]>
-
- * keymap.c (Fdefine_key): Doc fix.
-
- * xterm.c (x_term_init): Turn off polling around XtOpenDisplay.
-
-2002-07-02 Juanma Barranquero <[email protected]>
-
- * keymap.c (syms_of_keymap): Fix typo.
-
-2002-07-01 Andrew Choi <[email protected]>
-
- * s/darwin.h: Define POSIX_SIGNALS.
-
- * macterm.c (do_ae_open_documents) [MAC_OSX]: Call FSpMakeFSRef
- and FSRefMakePath to convert FSSpec returned with Apple Event to
- Posix pathname.
- (mac_initialize) [TARGET_API_MAC_CARBON]:
- Call init_required_apple_events and disable the `Quit' menu item
- provided automatically by the Carbon Toolbox.
-
-2002-07-01 Dave Love <[email protected]>
-
- * keyboard.c (kbd_buffer_store_event): Fix interrupt_signal decl
- for K&R.
-
- * xterm.c: Fix prototype for K&R.
-
- * term.c (costs_set): Declare static, non-initialized for pcc.
-
-2002-07-01 Richard M. Stallman <[email protected]>
-
- * keyboard.c (timer_last_idleness_start_time): New variable.
- (timer_start_idle): Set that.
- (read_key_sequence): Use that to reset timer_idleness_start_time
- to previous value.
-
- * window.c (Frecenter): With arg, set optional_new_start.
-
- * xdisp.c (redisplay_internal): Make optional_new_start really work.
-
- * minibuf.c (Fminibuffer_complete_and_exit): Move to end of
- buffer for completion.
-
-2002-06-29 Ken Raeburn <[email protected]>
-
- * xdisp.c (store_mode_line_string): Lisp_Object/int mixup.
-
-2002-06-28 Jan Dj,Ad(Brv <[email protected]>
-
- * keyboard.c (readable_filtered_events): New function that filters
- FOCUS_IN_EVENT depending on parameter.
- (readable_events): Calls readable_filtered_events, not filtering
- FOCUS_IN_EVENT.
- (get_filtered_input_pending): New function, filtering parameter passed
- to readable_filtered_events.
- (get_input_pending): Calls get_filtered_input_pending, not filtering
- FOCUS_IN_EVENT.
- (Finput_pending_p): Calls get_filtered_input_pending, DO filter
- FOCUS_IN_EVENT.
-
- * xterm.h (struct x_output): Add focus_state.
-
- * xterm.c (x_focus_changed): New function.
- (x_detect_focus_change): New function.
- (XTread_socket): Call x_detect_focus_change for FocusIn/FocusOut
- EnterNotify and LeaveNotify to track X focus changes.
-
-2002-06-28 Andreas Schwab <[email protected]>
-
- * lisp.h: Remove duplicate declaration of code_convert_string_norecord.
-
-2002-06-27 Kim F. Storm <[email protected]>
-
- * xdisp.c (mode_line_string_list, mode_line_string_face)
- (mode_line_string_face_prop): New variables.
- (store_mode_line_string): New function.
- (display_mode_element): Use store_mode_line_string to
- add mode-line string elements to mode_line_string_list
- when mode_line_string_list is non-nil.
- (Fformat_mode_line): Now returns propertized string by
- default. New arg NO-PROPS to ignore properties.
- (decode_mode_spec): Only add two dashes for %- in propertized
- mode-line string.
- (syms_of_xdisp): Init and staticpro mode_line_string_list.
-
-2002-06-27 Stefan Monnier <[email protected]>
-
- * minibuf.c (minibuffer_completion_contents): Add return type.
-
-2002-06-27 Juanma Barranquero <[email protected]>
-
- * charset.c (Fchar_bytes): Remove obsolescence info from docstring.
-
-2002-06-26 Juanma Barranquero <[email protected]>
-
- * fileio.c (read_file_name_cleanup): Add missing return.
-
-2002-06-26 Richard M. Stallman <[email protected]>
-
- * window.c (Frecenter): Don't set force_start flag.
-
- * minibuf.c (do_completion, Fminibuffer_complete_word)
- (Fminibuffer_completion_help): Complete just the text before point.
- (minibuffer_completion_contents): New function.
-
- * buffer.c (Fbury_buffer): Use frames_discard_buffer.
-
- * frame.c (frames_bury_buffer): Function deleted.
-
-2002-06-25 Miles Bader <[email protected]>
-
- * callint.c (Fcall_interactively): When checking to see if doprnt hit
- the end of callint_message, allow for a terminating '\0'.
-
-2002-06-24 Juanma Barranquero <[email protected]>
-
- * w32select.c: Include composite.h.
-
- * w16select.c: Likewise.
-
-2002-06-24 Kenichi Handa <[email protected]>
-
- * callproc.c (Fcall_process): If code detection is necessary,
- call detect_coding directly here.
-
- * coding.c (detect_eol): Preserve coding->cmp_data.
-
- * w16select.c (Fw16_get_clipboard_data):
- * w32fns.c (w32_to_x_font):
- * w32select.c (Fw32_get_clipboard_data):
- * xselect.c (selection_data_to_lisp_data):
- * xterm.c (XTread_socket): Disable composition handling.
-
-2002-06-24 Stefan Monnier <[email protected]>
-
- * print.c (temp_output_buffer_setup): Kill all local variables.
-
-2002-06-22 Stefan Monnier <[email protected]>
-
- * lread.c (Fread): Remove redundant and imprecise declaration.
-
- * xfns.c (check_x_display_info): Use check_x_frame.
-
- * .gdbinit (xprintsym): Use the new `xname' field.
- (xsymbol): Use it.
-
-2002-06-22 Jason Rumney <[email protected]>
-
- * w32fns.c (file_dialog_callback): New function.
- (Fx_file_dialog): Allow selecting directories as well as files.
-
-2002-06-21 Pavel Jan,Am(Bk <[email protected]>
-
- * m/pmax.h (START_FILES): Define START_FILES for NetBSD and
- OpenBSD. Add support for mipseb-*-netbsd* machines.
-
-2002-06-17 Andrew Choi <[email protected]>
-
- * macterm.c (mac_scroll_area): Set foreground and backcolor to
- black and white before scrolling. Restore frame background and
- foreground color after scrolling.
- (do_window_update): Call XClearWindow before calling expose_frame.
- (make_mac_frame): Don't set FRAME_BACKGROUND_PIXEL and
- FRAME_FOREGROUND_PIXEL of frame.
-
- * macterm.c (XTread_socket): If Vmac_command_key_is_meta is nil,
- test Mac command key as <ALT> key.
-
-2002-06-17 Stefan Monnier <[email protected]>
-
- * window.c (Fset_window_configuration): Lisp_Object/int mixup.
-
- * keyboard.c (read_key_sequence): Be more careful with first_unbound.
- Lookup keys in function-key-map immediately so that key-translation-map
- can be applied earlier.
- Remove function_key_possible and key_translation_possible, replaced
- by checking `keytran_start < t'.
-
- * .gdbinit (xsymbol): Use the new `xname' field.
-
-2002-06-17 Andrew Choi <[email protected]>
-
- * macterm.c (XTread_socket): If Vmac_command_key_is_meta is nil,
- test Mac command key as <ALT> key.
-
- * mac.c (do_applescript): Call initialize_applescript if necessary
- when first called. Dispose of result_desc only when there is no error.
- (Fdo_applescript): Use %d format specifier instead of %ld.
-
-2002-06-16 Andrew Choi <[email protected]>
-
- * macterm.c (XTread_socket): Call FrontNonFloatingWindow instead
- of FrontWindow for cases keyDown and autoKey.
-
- * fontset.c (syms_of_fontset) [MAC_OS]: Set ASCII font of
- Vdefault_fontset to Monaco with mac-roman coding.
-
- * mac.c, macfns.c, macmenu.c, macterm.c: Undefine and redefine
- init_process before and after inclusion of Carbon/Carbon.h, resp.
-
- * macterm.c (x_new_font): Set font for normal_gc, reverse_gc, and
- cursor_gc.
- (add_font_name_table_entry): New function.
- (init_font_name_table): Use add_font_name_table_entry; add italic,
- bold, and bold-italic entries for truetype fonts.
-
- * xfaces.c (init_frame_faces) [MAC_OS]: Call realize_basic_faces
- for Mac too.
- (try_font_list) [MAC_OS]: If no font matches given registry, try
- fonts with any registry matching face_family.
- (realize_x_face) [MAC_OS]: Remove old ad-hoc fix to load font here.
-
- * s/darwin.h: If autoconf detects the Ncurses library, define
- LIBS_TERMCAP to -lncurses to use it.
-
-2002-06-16 Eli Zaretskii <[email protected]>
-
- * strftime.c [__hpux]: Include sys/_mbstate_t.h.
-
-2002-06-15 Richard M. Stallman <[email protected]>
-
- * window.c (Fset_window_configuration): Explicitly preserve
- the point value that new_current_buffer had at the start.
-
-2002-06-14 Juanma Barranquero <[email protected]>
-
- * composite.c (Fcompose_region_internal, Fcompose_string_internal):
- Fix typos.
-
-2002-06-14 Kim F. Storm <[email protected]>
-
- * insdel.c (insert_1_both, insert_from_string_1)
- (insert_from_buffer_1): Recalculate END_UNCHANGED in case the
- insert happened in the end_unchanged region. Otherwise, the
- redisplay may be confused and duplicate the last line in the
- buffer [seen after save-buffer when require-final-newline==t].
-
-2002-06-13 Jason Rumney <[email protected]>
-
- * w32.c (init_environment): Remove EMACSLOCKDIR.
- (stat): Swap _S_IFDIR and _S_IFREG.
-
-2002-06-13 Pavel Jan,Am(Bk <[email protected]>
-
- * keyboard.c, macterm.c, macmenu.c, msdos.c, sysdep.c
- * termhooks.h, xmenu.c, xsmfns.c, xterm.h, xterm.c, w32term.c,
- * w32menu.c, w32inevt.c: Rename enum event_kind as follows:
- ascii_keystroke to ASCII_KEYSTROKE_EVENT, multibyte_char_keystroke
- to MULTIBYTE_CHAR_KEYSTROKE_EVENT, non_ascii_keystroke to
- NON_ASCII_KEYSTROKE_EVENT, timer_event to TIMER_EVENT, mouse_click
- to MOUSE_CLICK_EVENT, mouse_wheel to MOUSE_WHEEL_EVENT,
- language_change_event to LANGUAGE_CHANGE_EVENT, scroll_bar_click
- to SCROLL_BAR_CLICK_EVENT, w32_scroll_bar_click to
- W32_SCROLL_BAR_CLICK_EVENT, selection_request_event to
- SELECTION_REQUEST_EVENT, selection_clear_event to
- SELECTION_CLEAR_EVENT, buffer_switch_event to BUFFER_SWITCH_EVENT,
- delete_window_event to DELETE_WINDOW_EVENT, iconify_event to
- ICONIFY_EVENT, deiconify_event to DEICONIFY_EVENT,
- menu_bar_activate_event to MENU_BAR_ACTIVATE_EVENT, drag_n_drop to
- DRAG_N_DROP_EVENT, save_session_event to SAVE_SESSION_EVENT and
- no_event to NO_EVENT.
-
-2002-06-12 Pavel Jan,Am(Bk <[email protected]>
-
- * macmenu.c: Remove declaration of Qmouse_click and Qevent_kind.
-
-2002-06-12 Stefan Monnier <[email protected]>
-
- * intervals.c (textget): Don't forget to `return'.
- (lookup_char_property): Use XCAR/XCDR.
-
-2002-06-12 Juanma Barranquero <[email protected]>
-
- * xdisp.c (Fformat_mode_line): Fix typo.
-
-2002-06-12 Kim F. Storm <[email protected]>
-
- * xdisp.c (Fformat_mode_line): New function.
- (frame_title_buf, frame_title_buf_end, frame_title_ptr)
- (store_frame_title_char, store_frame_title): Use unconditionally.
- (init_xdisp): Defsubr Fformat_mode_line.
- Initialize frame_title_buf etc. unconditionally.
-
-2002-06-11 Stefan Monnier <[email protected]>
-
- * keyboard.c (read_key_sequence):
- Remove prev_(fkey|keytran}_(map|start|end) since we don't want to pass
- things through those maps after downcasing events.
- Enforce that keytran_end <= fkey_start, i.e. that key-translation-map
- applies after function-key-map.
- Make sure that keytran can be done in the middle in the sequence.
- Be careful not to throw away events past the one we downcase.
-
- * lread.c (read_integer): Remove unused var `tem'.
- (read1): Fix int/Lisp_Object mixup.
-
- * xfaces.c (tty_lookup_color): Type bool/Lisp_Object mismatch fixed.
-
-2002-06-11 Richard M. Stallman <[email protected]>
-
- * keyboard.c (readable_events): Ignore any number of
- FOCUS_IN_EVENT events and return 0 if nothing else in buffer.
-
-2002-06-09 Miles Bader <[email protected]>
-
- * xfaces.c (Ftty_supports_face_attributes_p): New function.
- (parse_rgb_list, tty_lookup_color): New functions.
- (tty_defined_color): Use `tty_lookup_color' to do all the work.
- (color_distance, Fcolor_distance): New functions.
- (TTY_SAME_COLOR_THRESHOLD): New macro.
- (Qtty_color_standard_values): New variable.
- (syms_of_xfaces): Initialize new vars & functions.
-
-2002-06-08 Colin Walters <[email protected]>
-
- * textprop.c (Vchar_property_alias_alist): New variable.
- (syms_of_textprop) <Vchar_property_alias_alist>: DEFVAR_LISP.
-
- * intervals.c (lookup_char_property): New function for looking up
- overlay and text properties, created from textget.
- (textget): Use it.
-
- * intervals.h (lookup_char_property): Declare.
- (Vchar_property_alias_alist): Declare.
-
- * buffer.c (Foverlay_get): Use lookup_char_property.
-
-2002-06-07 Sam Steingold <[email protected]>
-
- * xselect.c (lisp_data_to_selection_data): Fix last change:
- *data_ret is not a Lisp string, while unibyte_string is.
-
-2002-06-07 Eli Zaretskii <[email protected]>
-
- * xselect.c (lisp_data_to_selection_data): Fix last change:
- set size_ret.
-
-2002-06-07 Andreas Schwab <[email protected]>
-
- * m/amdx86-64.h: New file.
-
-2002-06-05 Eli Zaretskii <[email protected]>
-
- * fns.c (Fstring_make_unibyte): Doc fix.
-
- * xselect.c (lisp_data_to_selection_data): If the requested type
- is STRING, call string_make_unibyte to encode the selected text
- as a string.
-
- * window.c (Fset_window_hscroll): Doc fix.
-
-2002-06-05 Pavel Jan,Am(Bk <[email protected]>
-
- * fileio.c (choose_write_coding_system):
- Call select-safe-coding-system properly.
-
-2002-06-03 Richard M. Stallman <[email protected]>
-
- * xdisp.c (message_with_string): Error if STRING is not a string.
-
- * fns.c (md5): Pass FILE arg to Vselect_safe_coding_system_function.
-
- * fileio.c (choose_write_coding_system): Pass FILE arg to
- Vselect_safe_coding_system_function.
-
-2002-06-03 Ken Raeburn <[email protected]>
-
- * buffer.c (fix_overlays_before): Fix list-walking bug in 05-19 change.
-
-2002-06-02 Thien-Thi Nguyen <[email protected]>
-
- * bytecode.c (Fbyte_code): Cast `current_column' return value to int.
- * cmds.c (Fdelete_backward_char, internal_self_insert): Likewise.
- * keymap.c (describe_command): Likewise.
- * minibuf.c (read_minibuf): Likewise.
-
- * xdisp.c (redisplay_internal, redisplay_window, decode_mode_spec):
- Cast `current_column' return value to int.
- (back_to_previous_visible_line_start)
- (reseat_at_next_visible_line_start, next_element_from_buffer):
- Cast `indented_beyond_p' 3rd arg to float.
-
- * indent.c (last_known_column): Now a float.
- (current_column_1, position_indentation, current_column)
- (string_display_width): Return float.
- (Fcurrent_column): Cast `current_column' return value to int.
- (Fcurrent_indentation): Cast `position_indentation' retval to int.
- (indented_beyond_p): Third arg now a float.
- (compute_motion, vmotion): Cast `indented_beyond_p' 3rd arg to float.
-
- * lisp.h (current_column): Now returns float.
- (indented_beyond_p): 3rd arg now a float.
-
-2002-05-31 Eli Zaretskii <[email protected]>
-
- * xfns.c (x_encode_text): Return stringp non-NULL if coding_system
- is Qcompound_text_with_extensions.
-
- * xselect.c (lisp_data_to_selection_data): Always set selection
- type as string if x_encode_text returns streingp non-NULL.
-
- * s/netbsd.h: Include /usr/pkg in the run time shared library path.
-
-2002-05-30 Richard M. Stallman <[email protected]>
-
- * window.c (Fset_window_configuration): Correct the handling
- of point in current buffer, to work with multiple windows.
-
-2002-05-29 Colin Walters <[email protected]>
-
- * lread.c (Fread_from_string): Don't depend on order of evaluation
- for C function parameters.
-
-2002-05-28 Richard M. Stallman <[email protected]>
-
- * xterm.c (x_display_and_set_cursor): Change the cursor in the same
- way for blinked-off state and for a nonselected window.
-
- * window.c (window_scroll_pixel_based): Don't call Fbolp;
- instead, see if the new start pos is at beginning of line.
-
- * fileio.c (Fwrite_region): If START is a string, don't
- make any annotations.
-
- * eval.c (syms_of_eval): Doc fix.
-
-2002-05-28 Colin Walters <[email protected]>
-
- * emacs.c (USAGE1): Add --no-splash.
- (standard_args): Ditto.
-
-2002-05-28 Colin Walters <[email protected]>
-
- * lread.c (readchar_count): New variable.
- (readchar): Increment it.
- (unreadchar): Decrement it.
- (read_multibyte): Decrement it.
- (Vread_with_symbol_positions): New variable.
- (Vread_symbol_positions_list): New variable.
- (read_internal_start): New function, created from Fread and
- Fread_from_string. Handle Vread_symbol_positions_list and
- Vread_with_symbol_positions.
- (readevalloop, Fread, Fread_from_string): Use it.
- (read1): Use readchar_count to add symbol positions to
- Vread_symbol_positions_list if Vread_with_symbol_positions is non-nil.
- (syms_of_lread): DEFVAR_LISP and initialize them.
-
- * lread.c (read0, read1, read_list, read_vector, read_multibyte)
- (substitute_object_recurse, substitute_object_in_subtree)
- (substitute_in_interval): Prototype.
- (read_multibyte): Return c if it's less than zero.
-
-2002-05-28 Kim F. Storm <[email protected]>
-
- * fileio.c (Fread_file_name_internal): Added brute-force
- speed up for using predicate file-directory-p.
-
-2002-05-28 Kim F. Storm <[email protected]>
-
- * fileio.c (Vread_file_name_function, Vread_file_name_predicate):
- New variables.
- (syms_of_fileio): DEFVAR_LISP them.
- (read_file_name_cleanup): New unwind function.
- (Fread_file_name_internal): Only return completions satifying
- Vread_file_name_predicate. Temporarily unwind protect and rebind
- default-directory while checking completions against the predicate.
- (Fread_file_name): Added PREDICATE argument. Specbind it to
- Vread_file_name_predicate during completion.
- Call Vread_file_name_function to read the file name if non-nil.
-
- * lisp.h (Fread_file_name): Now has 6 args.
-
- * callint.c (Fcall_interactively) <"D">: Supply Qfile_directory_p
- predicate for Fread_file_name when reading directory name.
- Supply Qnil for predicate in other calls to Fread_file_name.
-
-2002-05-26 Miles Bader <[email protected]>
-
- * term.c (tty_capable_p): New function.
- * dispextern.h (tty_capable_p): New function declaration.
- (TTY_CAP_INVERSE, TTY_CAP_UNDERLINE, TTY_CAP_BOLD, TTY_CAP_DIM)
- (TTY_CAP_BLINK, TTY_CAP_ALT_CHARSET): New macros.
-
-2002-05-23 Stefan Monnier <[email protected]>
-
- * fileio.c (read_non_regular, Finsert_file_contents): Use BEG_BYTE.
- (Finsert_file_contents, build_annotations): Use XCAR, XCDR.
- (Vwrite_region_annotate_functions): Docstring fix.
-
-2002-05-23 Kim F. Storm <[email protected]>
-
- * xterm.c (x_write_glyphs): Clear phys_cursor_on_p if current
- phys_cursor's hpos is overwritten. This is still not completely
- correct, as it doesn't really make sense to use hpos at all to
- get the cursor glyph (as that is relative to the width of the
- characters on the line, which may have changed during the update).
-
-2002-05-22 Jason Rumney <[email protected]>
-
- * w32fns.c (enumfont_t): Remove tail, make pattern a normal
- Lisp_Object.
- (enum_font_cb2, enum_font_maybe_add_to_list, w32_list_fonts):
- Use modified enumfont_t struct.
-
- * w32term.h (text_cursor_kinds): New enumeration member HBAR_CURSOR.
-
- * w32term.c (x_draw_bar_cursor): New argument KIND; callers changed.
- Handle the `hbar' cursor type.
- (x_display_and_set_cursor): Handle the HBAR_CURSOR case.
-
- * w32fns.c (Qhbar): New variable.
- (x_specified_cursor_type): Use it.
-
-2002-05-21 Ken Raeburn <[email protected]>
-
- * w32fns.c (enum_font_maybe_add_to_list): Use XCDR_AS_LVALUE for
- now, when the address is needed.
-
-2002-05-21 Colin Walters <[email protected]>
-
- * Makefile.in (shortlisp): Add font-core.el.
-
-2002-05-20 Richard M. Stallman <[email protected]>
-
- * buffer.c (syms_of_buffer) <cursor-type>: Doc fix.
-
- * keyboard.c (read_char_minibuf_menu_prompt): Don't list
- equivalent key bindings here.
-
-2002-05-20 Ken Raeburn <[email protected]>
-
- Change symbol structure to contain a lisp object for the symbol
- name:
- * lisp.h (struct Lisp_Symbol): Replace field "name" with a lisp
- object field named "xname".
- (SYMBOL_NAME): New macro.
- * abbrev.c (write_abbrev): Use SYMBOL_NAME instead of XSYMBOL and
- name field.
- * alloc.c (Fmake_symbol): Set symbol xname field instead of name.
- (mark_object, gc_sweep): Use symbol xname field and XSTRING
- instead of name field.
- * buffer.c (buffer_slot_type_mismatch): Use XSTRING and
- SYMBOL_NAME instead of XSYMBOL and name field.
- * callint.c (Fcall_interactively): Use XSTRING and SYMBOL_NAME
- instead of XSYMBOL and name field.
- * charset.c (Fdefine_charset, Fdeclare_equiv_charset): Use XSTRING
- and SYMBOL_NAME instead of XSYMBOL and name field.
- * coding.c (Fread_coding_system, code_convert_region1)
- (code_convert_string1, code_convert_string_norecord)
- (Ffind_operation_coding_system): Use SYMBOL_NAME instead of
- XSYMBOL and name field.
- * data.c (Fkeywordp, Fsymbol_name, store_symval_forwarding)
- (Fmake_variable_buffer_local, Fmake_local_variable)
- (Fmake_variable_frame_local): Use SYMBOL_NAME and XSTRING instead
- of XSYMBOL and name field.
- * editfns.c (Fformat): Use SYMBOL_NAME and XSTRING instead of
- XSYMBOL and name field.
- * emacs.c (shut_down_emacs) [#if 0]: Use SYMBOL_NAME and XSTRING
- instead of XSYMBOL and name field.
- * eval.c (do_autoload): Use SYMBOL_NAME and XSTRING instead of
- XSYMBOL and name field.
- * fns.c (Fstring_equal, Fstring_lessp, Frequire, sxhash):
- Use SYMBOL_NAME and XSTRING instead of XSYMBOL and name field.
- * fontset.c (Fset_fontset_font): Use SYMBOL_NAME and XSTRING
- instead of XSYMBOL and name field.
- * keyboard.c (echo_char, record_char, parse_modifiers_uncached)
- (parse_modifiers, apply_modifiers, Fevent_convert_list)
- (parse_solitary_modifier, Fexecute_extended_command):
- Use SYMBOL_NAME and XSTRING instead of XSYMBOL and name field.
- * keymap.c (silly_event_symbol_error, Fsingle_key_description)
- (Fdescribe_buffer_bindings): Use SYMBOL_NAME and XSTRING instead
- of XSYMBOL and name field.
- (describe_command, describe_translation): Use SYMBOL_NAME and
- assignment instead of XSYMBOL and name field and XSETSTRING.
- * lread.c (Fintern_soft, oblookup): Use SYMBOL_NAME and XSTRING
- instead of XSYMBOL and name field.
- (Funintern): Use SYMBOL_NAME and assignment instead of XSYMBOL and
- name field and XSETSTRING.
- * macfns.c (parse_image_spec): Use SYMBOL_NAME and XSTRING instead
- of XSYMBOL and name field.
- * minibuf.c (Fread_command, Fread_variable): Use SYMBOL_NAME and
- assignment instead of XSYMBOL and name field and XSETSTRING.
- * print.c (print_error_message, print_object): Use SYMBOL_NAME and
- XSTRING instead of XSYMBOL and name field.
- * process.c (set_socket_options, Fsignal_process): Use SYMBOL_NAME
- and XSTRING instead of XSYMBOL and name field.
- * w32fns.c (parse_image_spec, w32_parse_hot_key): Use SYMBOL_NAME
- and XSTRING instead of XSYMBOL and name field.
- * xfaces.c (merge_face_vector_with_property): Use SYMBOL_NAME and
- XSTRING instead of XSYMBOL and name field.
- * xfns.c (parse_image_spec): Use SYMBOL_NAME and XSTRING instead
- of XSYMBOL and name field.
- * xselect.c (symbol_to_x_atom, x_get_foreign_selection):
- Use SYMBOL_NAME and XSTRING instead of XSYMBOL and name field.
-
-2002-05-19 Ken Raeburn <[email protected]>
-
- * lisp.h (LISP_MAKE_RVALUE): Delete disabled version, making XCAR
- and XCDR real rvalues in most configurations.
-
- * buffer.c (fix_overlays_in_range, fix_overlays_before):
- Don't take the address of the cdr part of a cons cell; instead, track
- the parent cell and call XSETCDR, or set the variable for the head
- of the list if we haven't started down the list yet.
-
-2002-05-19 Richard M. Stallman <[email protected]>
-
- * doc.c (reread_doc_file): Don't ask for confirmation.
-
-2002-05-18 Jason Rumney <[email protected]>
-
- * w32fns.c (w32_create_pixmap_from_bitmap_data): New function.
- (xbm_load_image): Use it.
- (xbm_load): Ditto.
- (xbm_read_bitmap_data): Reverted to xfns.c version.
- From David Ponce <[email protected]>.
-
-2002-05-17 Eli Zaretskii <[email protected]>
-
- * msdos.c (sig_suspender, sigprocmask): Don't define for DJGPP
- 2.02 and later.
-
-2002-05-16 Juanma Barranquero <[email protected]>
-
- * keyboard.c (Fthis_command_keys, Fthis_command_keys_vector): Fix typo.
-
-2002-05-15 Stefan Monnier <[email protected]>
-
- * keyboard.c (read_char_x_menu_prompt): Use an equivalent but more
- meaningful test.
- (read_char_minibuf_menu_prompt): Fix typo.
-
-2002-05-15 Eli Zaretskii <[email protected]>
-
- * eval.c (Fcommandp): Doc fix.
-
-2002-05-13 Stefan Monnier <[email protected]>
-
- * keymap.c (keymap_parent): New fun, extracted from Fkeymap_parent.
- (Fkeymap_parent, keymap_memberp, fix_submap_inheritance): Use it.
- (Fset_keymap_parent): Gcpro a bit more.
- (access_keymap): Gcpro around meta_map call and around the main loop.
- (get_keyelt): Gcpro when following indirect references.
- (copy_keymap_item): New fun, extracted from Fcopy_keymap.
- (copy_keymap_1, Fcopy_keymap): Use it. Don't copy the parent map.
- (Fdefine_key, Flookup_key): Gcpro before calling get_keymap.
- Remove useless ad-hoc remap code.
-
-2002-05-13 Richard M. Stallman <[email protected]>
-
- * search.c (search_buffer): Give up boyer moore search if inverse
- translation change charset_base.
-
-2002-05-12 Eli Zaretskii <[email protected]>
-
- * coding.c (decode_coding) <coding_type_ccl>: If a lone CR
- characters is carried over from the previous block of text, adjust
- coding->produced to account for the extra character.
-
-2002-05-11 Andreas Schwab <[email protected]>
-
- * coding.c (intersection): Keep the elements of the returned list
- in the same order as in the first list.
-
-2002-05-11 Kim F. Storm <[email protected]>
-
- * keymap.c (current_minor_maps): Fix resizing of cmm_maps;
- only update cmm_size if realloc actually succeeds.
- Testing with initial size of 2 elements revealed that using
- realloc on GNU/Linux would cause a random trap in xmalloc
- later on, so I rewrote the code to use malloc/bcopy/free instead
- of realloc.
-
-2002-05-10 Jason Rumney <[email protected]>
-
- * w32fns.c (enum_font_cb2): Avoid DBCS raster fonts.
-
-2002-05-10 Eli Zaretskii <[email protected]>
-
- * coding.c (encode_coding_sjis_big5): Enclose bitwise AND in
- parens, to ensure correct evaluation order.
-
-2002-05-10 Kim F. Storm <[email protected]>
-
- * keymap.c (Vemulation_mode_map_alists): New variable.
- (syms_of_keymap): DEFVAR_LISP it.
- (current_minor_maps): Process keymap alists in that list before
- minor-mode-overriding-map-alist and minor-mode-map-alist.
-
-2002-05-09 Richard M. Stallman <[email protected]>
-
- * search.c (Freplace_match): Doc fix.
-
-2002-05-09 Kim F. Storm <[email protected]>
-
- * macterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
- Enlarge cursor rectangle drawn around image with non-zero relief.
-
- * w32term.c (x_draw_image_foreground, w32_draw_image_foreground_1):
- Enlarge cursor rectangle drawn around image with non-zero relief.
-
- * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
- Enlarge cursor rectangle drawn around image with non-zero relief.
-
-2002-05-07 Eli Zaretskii <[email protected]>
-
- * xselect.c (lisp_data_to_selection_data): Don't set selection
- type if comes from the Lisp object's car. If the selection
- contains a pure ASCII text, always return QSTRING as its type.
-
-2002-05-06 Pavel Jan,Am(Bk <[email protected]>
-
- * mac.c (mac-cut-function): Doc fix.
-
-2002-05-05 Richard M. Stallman <[email protected]>
-
- * s/gnu.h [DOUG_LEA_MALLOC] (REL_ALLOC): Undefine it.
-
-2002-05-04 Jason Rumney <[email protected]>
-
- * keyboard.c (make_lispy_event) <mouse-wheel>: Set count to 1
- for event-click-count.
-
- * process.c (init_process): Only add server subfeature if we can
- use non-blocking I/O.
-
-2002-05-04 Andrew Choi <[email protected]>
-
- * macterm.c (XTread_socket): Call WaitNextEvent once instead of
- repeatedly.
-
-2002-05-03 Jason Rumney <[email protected]>
-
- * process.c (Fmake_network_process): Only support server sockets
- when we can make them non-blocking.
-
- * s/ms-w32.h (HAVE_SELECT): Define.
-
- * w32.h (FILE_NDELAY): New flag.
-
- * w32.c (sys_getpeername, fcntl): New functions.
- (_sys_read_ahead): Temporarily block on non-blocking sockets.
-
- * w32proc.c: Include sys/file.h.
-
-2002-05-03 Colin Walters <[email protected]>
-
- * callproc.c (Vgame_score_directory): Renamed to
- Vshared_game_score_directory.
-
-2002-04-30 Richard M. Stallman <[email protected]>
-
- * s/gnu.h [emacs]: Include stdio.h.
- (GNU_LIBRARY_PENDING_OUTPUT_COUNT): New definition, conditional.
-
- * eval.c (do_autoload): Error if called while preparing to dump.
-
- * fns.c (Frequire): Error if need to load while preparing to dump.
-
-2002-04-28 Colin Walters <[email protected]>
-
- * callproc.c (Vgame_score_directory) [!HAVE_SHARED_GAME_DIR]:
- Default to "~/.emacs.d/games".
-
-2002-04-29 Stefan Monnier <[email protected]>
-
- * lread.c (openp): Change arg exec_only to predicate.
- (build_load_history): Use XCAR/XCDR.
- (Flocate_file_internal): New fun.
- (syms_of_lread): Defsubr it.
- (Fload): Update call to openp.
-
- * lisp.h (openp): Update prototype.
-
- * xfns.c (x_create_bitmap_from_file, x_find_image_file):
- * w32proc.c (sys_spawnve):
- * w32fns.c (x_create_bitmap_from_file, x_find_image_file):
- * w32.c (check_windows_init_file):
- * sound.c (Fplay_sound_internal):
- * process.c (Fstart_process):
- * macfns.c (x_create_bitmap_from_file, x_find_image_file):
- * mac.c (run_mac_command):
- * emacs.c (init_cmdargs):
- * callproc.c (Fcall_process): Update call to openp.
-
- * textprop.c (remove_properties): Don't use XCAR without CONSP.
-
- * xterm.c (XTread_socket): Disable the Xutf8LookupString code.
-
-2002-04-29 Pavel Jan,Am(Bk <[email protected]>
-
- * dispextern.h (DEFAULT_TOOL_BAR_BUTTON_MARGIN)
- (DEFAULT_TOOL_BAR_BUTTON_RELIEF): Change default values.
-
-2002-04-28 Richard M. Stallman <[email protected]>
-
- * minibuf.c (Fall_completions, Ftry_completion): New arg to Fcommandp.
-
- * eval.c (Fcommandp): New arg for_call_interactively.
- * lisp.h (Fcommandp): Declare new arg.
-
-2002-04-28 Jason Rumney <[email protected]>
-
- * w32proc.c (syms_of_w32proc): Get true file attributes by default.
-
- * w32.c (stat, fstat): Use file index information to generate
- inodes for directories where available.
-
-2002-04-26 Andrew Choi <[email protected]>
-
- * Makefile.in (C_SWITCH_SYSTEM_TEMACS): Add.
- [HAVE_CARBON]: Include Mac object files.
-
- * alloc.c, callproc.c, dispextern.h, dispnew.c, emacs.c,
- fontset.c, frame.c, frame.h, keyboard.c, sysdep.c, term.c,
- termcap.c, window.c, xdisp.c, xfaces.c: Use macros MAC_OS8,
- MAC_OSX, and MAC_OS instead of macintosh.
-
- * editfns.c [MAC_OS8]: Include stdio.h.
-
- * emacs.c [MAC_OS8]: Call mac_initialize instead of x_term_init.
-
- * fontset.c [MAC_OS]: Set Vdefault_fontset to ETL Fixed instead of
- Apple Monaco.
-
- * process.c (QCfamily, QCfilte): Declare extern.
- (wait_reading_process_input) [MAC_OSX]: Clear bit for stdin before
- calling select.
-
- * termcap.c [MAC_OSX]: Don't define tgetnum, PC, tputs, and tgetent.
-
- * tparam.c [MAC_OSX]: Don't define BC and UP.
-
- * config.in [HAVE_CARBON]: Add.
-
- * mac.c, macgui.h, macfns.c, macmenu.c, macterm.c, macterm.h:
- Move here from mac/src and mac/inc.
-
- * s/darwin.h, m/powermac.h, unexmacosx.c: New files.
-
-2002-04-26 Gerd Moellmann <[email protected]>
-
- * xterm.c (x_draw_phys_cursor_glyph): Undo last change.
- Compute phys_cursor_width from the x position returned
- by x_draw_glyhs, which is cheaper.
- (x_display_and_set_cursor): Compute the buffer-local value
- of `cursor-in-non-selected-windows' only when needed.
-
-2002-04-25 Gerd Moellmann <[email protected]>
-
- * xterm.c (x_draw_phys_cursor_glyph): Take into account that a box
- cursor on a stretch glyph has a width that depends on
- x_stretch_cursor_p.
-
-2002-04-25 Pavel Jan,Am(Bk <[email protected]>
-
- * abbrev.c (abbrev-start-location): Doc fix.
-
- * indent.c (Fvertical_motion): Fix last change.
-
-2002-04-25 Gerd Moellmann <[email protected]>
-
- * indent.c (Fvertical_motion): Move to the start of the line
- containing PT before moving up or down.
-
-2002-04-24 Gerd Moellmann <[email protected]>
-
- * dispnew.c (update_text_area): Set phys_cursor_on_p to 0 in the
- case of writing a whole row, more or less analogous to the case of
- writing only parts of a row.
-
- * xterm.c (x_display_and_set_cursor): Set phys_cursor_width to
- 0 for NO_CURSOR.
-
- * xterm.c (notice_overwritten_cursor): Fix an off by 1 error.
-
-2002-04-23 Colin Walters <[email protected]>
-
- * buffer.c (syms_of_buffer): Doc fix.
-
-2002-04-23 Gerd Moellmann <[email protected]>
-
- * xterm.c (notice_overwritten_cursor): Handle the special case
- of the cursor being in the first blank non-text line at the
- end of a window.
-
- * xterm.c (x_draw_hollow_cursor, x_draw_bar_cursor)
- (x_draw_phys_cursor_glyph): Set phys_cursor_width here.
- (x_display_and_set_cursor): Don't set phys_cursor_width here, for
- bar cursors only, to make phys_cursor_width contain what its name
- suggests.
- (notice_overwritten_cursor): Consider the cursor image erased if
- the output area intersects the cursor image in y-direction.
-
-2002-04-23 Simon Marshall <[email protected]>
-
- * xfns.c (x_set_mouse_color): Change default for cross_cursor
- to XC_hand2.
-
-2002-04-23 Pavel Jan,Am(Bk <[email protected]>
-
- * xdisp.c: Remove unused global variable `minibuf_prompt_pixel_width'.
-
-2002-04-22 Kim F. Storm <[email protected]>
-
- * textprop.c (remove_properties): Fixed trap for malformed plist.
-
-2002-04-22 Richard M. Stallman <[email protected]>
-
- * cmds.c (Fend_of_line): Handle intangible text in mid line.
-
- * window.c (make_window): Initialize height_fixed_p,
- last_cursor_off_p, and p->cursor_off_p slots.
-
-2002-04-20 Pavel Jan,Am(Bk <[email protected]>
-
- * fns.c (use-dialog-box): Doc fix.
-
-2002-04-19 Pavel Jan,Am(Bk <[email protected]>
-
- * xterm.c (note_mode_line_or_margin_highlight): Remove unused
- variables `row', `i' and `area'.
- (XTread_socket) <KeyPress>: Pass KeyPress events when in menu to
- toolkit library.
-
-2002-04-19 Stefan Monnier <[email protected]>
-
- * xfaces.c (clear_font_table): Don't free the default font of
- a frame even if it's on another display.
- (Finternal_set_lisp_face_attribute): Don't use XFRAME on something
- that could be Qt.
-
-2002-04-19 Juanma Barranquero <[email protected]>
-
- * indent.c (Fmove_to_column): Remove unused local variable
- `next_boundary_byte'.
- (current_column_1): Likewise.
-
-2002-04-19 Eli Zaretskii <[email protected]>
-
- * msdos.c (Qhbar): New variable.
- (syms_of_msdos): Intern and staticpro it.
- (IT_set_cursor_type, IT_set_frame_parameters): Handle the `hbar'
- cursor type.
-
-2002-04-19 Dave Lambert <[email protected]>
-
- Theses change implement an underscore-like (`hbar') cursor.
-
- * xterm.h (text_cursor_kinds): New enumeration member HBAR_CURSOR.
-
- * xterm.c (x_draw_bar_cursor): New argument KIND; callers changed.
- Handle the `hbar' cursor type.
- (x_display_and_set_cursor): Handle the HBAR_CURSOR case.
-
- * xfns.c (Qhbar): New variable.
- (syms_of_xfns): Intern and staticpro it.
- (x_specified_cursor_type): Handle `hbar' cursor.
-
- * s/sol2-5.h (bcopy, bzero, bcmp): Define only if HAVE_BCOPY is
- not defined.
-
-2002-04-18 Richard M. Stallman <[email protected]>
-
- * textprop.c (remove_properties): New arg LIST allows scanning
- either a list or a plist.
- (interval_has_some_properties_list): New function, like
- interval_has_some_properties using list instead of plist.
- All callers changed.
- (Fremove_list_of_text_properties): New function.
- (syms_of_textprop): Defsubr it.
-
-2002-04-17 Eli Zaretskii <[email protected]>
-
- * s/sol2.h (HAVE_LIBKSTAT): Define only if not already defined.
-
-2002-04-17 Juanma Barranquero <[email protected]>
-
- * indent.c (Fmove_to_column): Remove unused local variable `end_byte'.
-
-2002-04-17 Eli Zaretskii <[email protected]>
-
- * window.c (coordinates_in_window): Don't report on margin area
- if its width is zero.
-
-2002-04-16 Jason Rumney <[email protected]>
-
- * w32fns.c (Fx_file_dialog): Decode file name before using.
-
- * w32term.c (construct_drag_n_drop): Likewise.
-
-2002-04-16 Eli Zaretskii <[email protected]>
-
- * puresize.h (BASE_PURESIZE): Increase to 830000, since we now
- store load-history in pure space.
-
- * s/msdos.h (SYSTEM_PURESIZE_EXTRA): Reduce to 50000.
-
-2002-04-16 Stefan Monnier <[email protected]>
-
- * xterm.c (Qlatin_1, Qutf_8): New vars.
- (syms_of_xterm): Initialize them.
- (XTread_socket): Eliminate incorrect optimization that tried to avoid
- decoding the output of X*LookupString.
- Always use latin-1 to decode the output of XLookupString.
- Try Xutf8LookupString if XmbLookupString failed.
-
- * region-cache.c (new_region_cache): Use BEG.
-
-2002-04-16 Gerd Moellmann <[email protected]>
-
- * buffer.c (MMAP_ALLOCATED_P): New macro to be set from system
- configuration files.
- (mmap_enlarge): Enlarge mapped regions only if MMAP_ALLOCATED_P
- returns 0.
-
-2002-04-15 Andreas Schwab <[email protected]>
-
- * config.in: Regenerated using autoheader.
-
- * m/7300.h, m/acorn.h, m/alliant-2800.h, m/alliant.h, m/alpha.h,
- m/altos.h, m/amdahl.h, m/apollo.h, m/arm.h, m/att3b.h, m/aviion.h,
- m/celerity.h, m/clipper.h, m/cnvrgnt.h, m/convex.h, m/cydra5.h,
- m/delta.h, m/delta88k.h, m/dpx2.h, m/elxsi.h, m/gec63.h,
- m/gould.h, m/hp800.h, m/hp9000s300.h, m/i860.h, m/ia64.h,
- m/ibmps2-aix.h, m/ibmrs6000.h, m/ibmrt-aix.h, m/ibmrt.h,
- m/ibms390.h, m/intel386.h, m/iris4d.h, m/irist.h, m/isi-ov.h,
- m/m68k.h, m/macppc.h, m/masscomp.h, m/mg1.h, m/mips-siemens.h,
- m/mips.h, m/news-r6.h, m/news.h, m/next.h, m/nh3000.h, m/nh4000.h
- m/ns32000.h, m/orion.h, m/pfa50.h, m/plexus.h, m/pmax.h,
- m/powerpcle.h, m/pyrmips.h, m/sequent-ptx.h, m/sequent.h,
- m/sparc.h, m/sr2k.h, m/symmetry.h, m/tad68k.h, m/tahoe.h,
- m/targon31.h, m/tek4300.h, m/tekxd88.h, m/template.h, m/tower32.h,
- m/tower32v3.h, m/ustation.h, m/vax.h, m/wicat.h, m/windowsnt.h,
- m/xps100.h, s/aix3-2.h, s/aix4-2.h, s/irix4-0.h, s/irix5-0.h,
- s/sco5.h, s/unixware.h: Don't set HAVE_ALLOCA, C_ALLOCA and
- STACK_DIRECTION, now set by autoconf.
-
-2002-04-14 Pavel Jan,Am(Bk <[email protected]>
-
- * dispnew.c (marginal_area_string): Sort arguments.
-
- * dispextern.h (marginal_area_string): Add prototype.
-
-2002-04-13 Richard M. Stallman <[email protected]>
-
- * fileio.c (Finsert_file_contents):
- Don't call temp_output_buffer_setup--do just part, by hand.
-
- * coding.c (run_pre_post_conversion_on_str):
- Don't call temp_output_buffer_setup--do just part, by hand.
-
- * keyboard.c (command_loop_1): Don't call start_hourglass
- or cancel_hourglass when executing a macro.
-
- * marker.c (count_markers): New function.
-
- * xdisp.c (display_mode_element): Don't let mode_line_proptrans_alist
- grow without limit. Move recently used elements to the front.
-
-2002-04-13 Eli Zaretskii <[email protected]>
-
- * unexelf.c (unexec) [__sgi]: Undo the change from 2002-01-20.
-
-2002-04-12 Gerd Moellmann <[email protected]>
-
- * xdisp.c (sync_frame_with_window_matrix_rows): Don't give frame
- rows marginal areas.
- (Fdump_frame_glyph_matrix) [GLYPH_DEBUG]: New function.
- (syms_of_xdisp) [GLYPH_DEBUG]: Defsubr it.
-
- * dispnew.c (marginal_area_string): Check that glyph row is enabled.
-
-2002-04-12 Dave Love <[email protected]>
-
- * dispnew.c (marginal_area_string): New.
-
- * window.c (window_part): Add ON_LEFT_MARGIN, ON_RIGHT_MARGIN.
- (Qleft_margin, Qright_margin): Declare.
- (coordinates_in_window, (Fcoordinates_in_window_p): Deal with margins.
-
- * xterm.c (note_mode_line_or_margin_highlight): Renamed from
- note_mode_line_highlight and extended.
-
- * keyboard.c (Qleft_margin, Qright_margin): Declare.
- (make_lispy_event): Deal with mouse events in margins.
-
-2002-04-12 Stefan Monnier <[email protected]>
-
- * msdos.c (dos_rawgetc): Use a single event for HELP_EVENT.
-
- * keyboard.c (command_loop_1): Turn off transient-mark-mode rather
- than deactivating the mark if tmm is set to `lambda'.
- (gen_help_event, kbd_buffer_store_help_event, kbd_buffer_get_event):
- Use a single event for HELP_EVENT.
- (Fexecute_extended_command): Save last_point_position.
-
-2002-04-12 Pavel Jan,Am(Bk <[email protected]>
-
- * lisp.h (Fpropertize): Add prototype.
-
- * fns.c (Fy_or_n_p): Use `minibuffer-prompt' face for prompt.
-
-2002-04-10 Colin Walters <[email protected]>
-
- * config.in: Add HAVE_SHARED_GAME_DIR.
-
- * callproc.c (Vgame_score_directory): New variable.
- (syms_of_callproc) <Vgame_score_directory>: DEFVAR_LISP.
-
-2002-04-10 Richard M. Stallman <[email protected]>
-
- * puresize.h (BASE_PURESIZE): Reduce again to avoid big excess.
-
-2002-04-09 Stefan Monnier <[email protected]>
-
- * minibuf.c (read_minibuf): Use empty_string.
- (Ftry_completion): Allow lambda forms and lists of strings for `alist'.
- Short-circuit the search as soon as it "failed".
- (Fall_completions): Allow lambda forms and lists of strings for alist.
- (Fcompleting_read): Set Qminibuffer_completion_confirm to nil
- when require_match is nil.
- (Ftest_completion): Rename from `test_completion' and export to elisp.
- Call the predicate also when alist is a list.
- Obey Vcompletion_regexp_list.
- (do_completion, Fminibuffer_complete_and_exit): Use it.
- (Fassoc_string): Rename from `assoc_for_completion'.
- Allow list of strings as well and export to elisp.
-
-2002-04-08 Stefan Monnier <[email protected]>
-
- * puresize.h (BASE_PURESIZE): Increase to 900KB.
-
-2002-04-08 Juanma Barranquero <[email protected]>
-
- * w32.c (sys_accept): Don't hide variable `s'.
-
-2002-04-05 Gerd Moellmann <[email protected]>
-
- * callint.c (Fcall_interactively): Use INTEGERP instead of
- NUMBERP for checking Vhistory_length.
-
-2002-04-05 Pavel Jan,Am(Bk <[email protected]>
-
- * sound.c (Fplay_sound_internal): Renamed from Fplay_sound.
- Doc fix to reflect it.
-
-2002-04-04 Richard M. Stallman <[email protected]>
-
- * xdisp.c (display_mode_element): New arg RISKY.
- Disregard text props found or specified within a variable
- that isn't marked risky-local-variable.
- (Qrisky_local_variable): New variable.
- (syms_of_xdisp): Init and staticpro it.
-
-2002-04-04 Stefan Monnier <[email protected]>
-
- * undo.c (record_point): New fun.
- (record_delete, record_insert): Use it.
-
-2002-04-03 Juanma Barranquero <[email protected]>
-
- * doc.c (Fdocumentation): Add missing parentheses.
- (Fdocumentation_property): Likewise.
-
-2002-04-03 Stefan Monnier <[email protected]>
-
- * doc.c (Fdocumentation, Fdocumentation_property): When the doc
- data is 0, just return nil.
-
-2002-04-03 Eli Zaretskii <[email protected]>
-
- * msdos.c (syms_of_msdos): Fix last change with
- mouse_autoselect_window.
-
-2002-04-03 Pavel Jan,Am(Bk <[email protected]>
-
- * w32term.c, xterm.c, msdos.c: Rename autoselect_window_p to
- mouse_autoselect_window.
-
-2002-04-02 Stefan Monnier <[email protected]>
-
- * keyboard.c (make_lispy_event): Handle unknown keysyms together
- with system-specific keysyms. Use it also for unknown function keys.
-
- * doc.c (reread_doc_file): Return whether reload was attempted.
- (Fdocumentation, Fdocumentation_property): Don't try to reload
- if the doc is 0 and only ask once.
-
- * Makefile.in (lisp, shortlisp): Add ucs-tables.elc.
-
-2002-04-02 Eli Zaretskii <[email protected]>
-
- * keyboard.c (read_char): If the event was Qselect_window,
- restore timer_idleness_start_time to its previous value.
-
- * msdos.c (dos_rawgetc): Generate SELECT_WINDOW_EVENTs when required.
-
-2002-04-01 Stefan Monnier <[email protected]>
-
- * region-cache.c (new_region_cache): Use BEG.
-
- * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
- Use BEG and BEG_BYTE.
-
- * doc.c (get_doc_string): Return nil if the location is wrong.
- (reread_doc_file): New fun.
- (Fdocumentation, Fdocumentation_property):
- Call it if get_doc_string fails.
- (Fsnarf_documentation): Make it work for a dumped Emacs.
-
- * charset.h (DEC_POS, BUF_DEC_POS): Use BEG_BYTE.
- Bound the search with MAX_MULTIBYTE_LENGTH to avoid pathological case.
-
- * charset.c (Fstring): Allow 0 arguments.
-
- * xterm.c (XTread_socket): Fix int/Lisp_Object confusion.
-
- * process.c (DATAGRAM_CONN_P, list_processes_1)
- (Fprocess_datagram_address, Fset_process_datagram_address)
- (Fset_network_process_options, server_accept_connection):
- Fix some int/Lisp_Object confusions (thank you union types).
-
-2002-04-01 Pavel Jan,Am(Bk <[email protected]>
-
- * msdos.c: Rename x_autoselect_window_p to autoselect_window_p.
-
- * w32term.c: Likewise.
- (note_mouse_movement): Put code for x_autoselect_window_p in #if 0.
-
- * keyboard.c (Qselect_window): New symbol.
- (head_table): Use it.
- (keys_of_keyboard): Bound select-window event to handle-select-window.
- (kbd_buffer_get_event): Make a Lisp event from SELECT_WINDOW_EVENT.
-
- * xterm.c: Rename x_autoselect_window_p to autoselect_window_p.
- (last_window): New variable.
- (XTread_socket): Generate SELECT_WINDOW_EVENTs.
- (note_mouse_movement): Remove reimplemented code in #if 0.
- (XTread_socket): Generate SELECT_WINDOW_EVENTs only for
- Emacs windows.
-
- * termhooks.h (enum event_kind): New event type `SELECT_WINDOW_EVENT'.
-
-2002-03-31 Gerd Moellmann <[email protected]>
-
- * xterm.c (x_get_char_face_and_encoding): Add parameter DISPLAY_P.
- Callers changed.
-
-2002-03-30 Richard M. Stallman <[email protected]>
-
- * window.c (window_scroll_pixel_based): Exit the move_it_by_lines
- loop whenever it stops making progress.
-
- * widget.c (set_frame_size): Don't call change_frame_size.
-
-2002-03-30 Gerd Moellmann <[email protected]>
-
- * dispnew.c (direct_output_for_insert):
- Call mark_window_display_accurate.
-
-2002-03-29 Jason Rumney <[email protected]>
-
- * w32term.c (w32_draw_relief_rect): Fix calculations of line lengths.
-
-2002-03-29 Eli Zaretskii <[email protected]>
-
- * Makefile.in (lread.o): Depend on coding.h.
-
- * lread.c (openp, Fload): Encode the file name before passing it
- to `stat', `access', and `emacs_open'.
- (openp): GCPRO the encoded file name. Don't recompute Lisp
- strings unnecessarily.
-
-2002-03-29 Kim F. Storm <[email protected]>
-
- * fns.c (Flax_plist_put): Doc fix.
-
-2002-03-28 Miles Bader <[email protected]>
-
- * process.c (DATAGRAM_CONN_P): Make sure PROC is really a process.
-
-2002-03-27 Pavel Jan,Am(Bk <[email protected]>
-
- * process.c (set-network-process-options): Add usage.
- (make-network-process): Doc fix.
-
-2002-03-26 Eli Zaretskii <[email protected]>
-
- * emacs.c (Fdump_emacs): Fix a typo in "command-line-processed".
-
-2002-03-26 Richard M. Stallman <[email protected]>
-
- * fns.c (Fsubstring_no_properties): New function.
- (Flax_plist_get, Flax_plist_put): New functions.
- (syms_of_fns): defsubr them.
-
- * xdisp.c (update_menu_bar): Test only update_mode_lines;
- don't test or alter w->update_mode_line.
-
- * window.c (Fdisplay_buffer): Doc fix.
-
-2002-03-24 Richard M. Stallman <[email protected]>
-
- * regex.c (GET_UNSIGNED_NUMBER): Give proper error for spaces.
-
-2002-03-24 Gerd Moellmann <[email protected]>
-
- * eval.c (Qdeclare, Vmacro_declaration_function): New variables.
- (Fdefmacro): Handle `(declare ...)'.
- (syms_of_eval) <Qdeclare>: Initialize and staticpro.
- (syms_of_eval) <Vmacro_declaration_function>: DEFVAR_LISP.
-
-2002-03-24 Jason Rumney <[email protected]>
-
- * w32fns.c (xbm_scan, xbm_load_image, xbm_read_bitmap_data)
- (xbm_file_p): Add prototypes.
- (xbm_format, xbm_image_p): Sync with xfns.c.
- (reflect_byte): New function.
- (xbm_read_bitmap_data): Sync with xfns.c, adapt for Windows.
- (xbm_load_image): Create bitmaps with a depth of 1.
- (init_xfns): Enable XBM images.
-
-2002-03-23 Jason Rumney <[email protected]>
-
- * w32term.c (w32_handle_tool_bar_click): Detect up and down events
- correctly. Do not pass up_modifier to keyboard buffer.
-
- * w32fns.c [HAVE_IMAGES, HAVE_PBM]: Remove conditionals.
-
-2002-03-22 Stefan Monnier <[email protected]>
-
- * Makefile.in (bootstrapclean): New target.
- (bootstrap-temacs, bootstrap-doc): Remove.
- (bootstrap-emacs): Use a bog-standard `temacs'.
- Don't bother to build a DOC file.
-
- * sysdep.c (wait_for_termination): Use sigsuspend rather than sigpause.
-
- * emacs.c (main): Handle --unibyte, --multibyte, and --no-loadup
- in temacs even if !CANNOT_DUMP.
- (standard_args): Keep --no-loadup even if !CANNOT_DUMP.
-
- * alloc.c (check_pure_size): Only output a warning.
-
-2002-03-22 Jason Rumney <[email protected]>
-
- * w32fns.c (Fx_create_frame): Enable tool-bar when images are
- supported.
-
- * w32term.c (zv_bits): Declare as short, for word alignment.
- (w32_read_socket) <WM_XBUTTONUP>: Fix last change.
- (syms_of_w32term): Define x-use-underline-position-properties.
-
- * w32fns.c (x_set_cursor_color): Set cursor_gc as well.
- (clear_image_cache): Block input, fix logic, clear matrices in
- all frames that share this cache.
-
-2002-03-22 Eli Zaretskii <[email protected]>
-
- * emacs.c (main): Update the Copyright year in the blurb printed
- by "emacs --version".
-
- * xdisp.c (message_with_string): Fix syntax of a call to GCPRO2.
-
- * xterm.c (XTread_socket): If XK_ISO_Lock and
- XK_ISO_Last_Group_Lock are defined, handle keysyms between
- XK_ISO_Lock and XK_ISO_Last_Group_Lock similarly to Mode_switch.
-
-2002-03-21 Kim F. Storm <[email protected]>
-
- * keyboard.c (menu_bar_items): Mostly undo 2002-02-20 patch, so
- menu-bar bindings in keymap and local-map properties _are_ used.
- But try keymap property first in accordance with 2002-01-03 patch.
- Added comment describing why this is not always reliable.
- (tool_bar_items): Ditto for tool-bar.
-
-2002-03-21 Jason Rumney <[email protected]>
-
- * w32fns.c (x_clear_image_1): Disable color table code.
-
-2002-03-21 Kim F. Storm <[email protected]>
-
- * lisp.h (DEFUN) [USE_NONANSI_DEFUN]: The 2001-10-17 patch
- removed the wrong version of the DEFUN macro; fixed it.
-
- * fns.c (Ffeaturep): Allow subfeature to be a list (test using
- Fmember rather than Fmemq).
- (Fprovide): Check that subfeatures is a list.
-
- * process.c (QCfeature, QCdatagram): Removed variables.
- (QCtype, Qdatagram): New variables.
- (network_process_featurep): Removed function.
- (Fmake_network_process): Removed :feature check.
- Use :type 'datagram instead of :datagram t to create a datagram
- socket. This allows us to add other connection types (e.g. raw
- sockets) later in a consistent manner.
- (init_process) [subprocess, HAVE_SOCKETS]: Provide list of
- supported subfeatures for feature make-network-process.
- (syms_of_process) [subprocess]: Remove QCfeature and QCdatagram.
- Intern and staticpro QCtype and Qdatagram.
- (syms_of_process) [!subprocess]: Intern and staticpro QCtype.
-
- * xfns.c (QCtype): Remove duplicate declaration and
- initialization (is now declared in process.c).
-
- * w32fns.c (QCtype): Remove duplicate declaration and
- initialization (is now declared in process.c).
-
-2002-03-21 Richard M. Stallman <[email protected]>
-
- * regex.c (DISCARD_FAILURE_REG_OR_COUNT): New macro.
- (CHECK_INFINITE_LOOP): Use DISCARD_FAILURE_REG_OR_COUNT
- when jumping to `fail' to avoid undoing reg changes in the
- last iteration of the loop.
- (GET_UNSIGNED_NUMBER): Skip spaces around the number.
-
- * Makefile.in (dispnew.o, sysdep.o, xdisp.o, xselect.o, alloc.o):
- Depend on process.h.
-
-2002-03-20 Jason Rumney <[email protected]>
-
- Most of the following changes are still conditional on HAVE_IMAGES
- which is not set by default on Windows.
-
- * emacs.c (main) [WINDOWSNT]: Call init_xfns.
-
- * w32fns.c (x_set_cursor_color): Set foreground of cursor, not frame.
- (Fimage_size, Fimage_mask_p, XPutPixel): New functions.
- (four_corners_best, x_clear_image_1, x_clear_image)
- (x_alloc_image_color, postprocess_image)
- (x_create_x_image_and_pixmap, x_destroy_x_image, xbm_load_image)
- (x_from_x_colors, x_disable_image, pbm_load): Adapt for Windows.
- (init_xfns, syms_of_w32fns): Initialize image functions and constants.
-
- * w32gui.h (struct XImage): Define.
-
- * w32term.c (w32_read_socket) <WM_XBUTTONUP>: Use XFASTINT to
- extract mouse co-ordinates.
-
-2002-03-20 Jason Rumney <[email protected]>
-
- * w32.c (init_winsock): Dynamically load new server and UDP
- socket functions.
- (socket_to_fd): New function.
- (sys_socket): Use it.
- (sys_setsockopt, sys_listen, sys_getsockname, sys_accept)
- (sys_recvfrom, sys_sendto): New wrapper functions.
-
- * process.c (QCfamily, QCfilter): Remove duplicate declaration
- and initialization.
-
- * makefile.w32-in (LIBS): Remove $(WSOCK32).
-
-2002-03-20 Eli Zaretskii <[email protected]>
-
- * process.c (conv_sockaddr_to_lisp, conv_lisp_to_sockaddr):
- Don't use "sun" as a variable, it's a predefined constant on Sun
- machines.
-
-2002-03-20 Pavel Jan,Am(Bk <[email protected]>
-
- * bytecode.c (Fbyte_code): Revert last change.
-
-2002-03-19 Kim F. Storm <[email protected]>
-
- * makefile.w32-in (LIBS): Add $(WSOCK32).
- From David Ponce <[email protected]>.
-
-2002-03-18 Pavel Jan,Am(Bk <[email protected]>
-
- * process.c (wait_reading_process_input): Move variables `pname'
- and `pnamelen' down where they are used.
-
- * bytecode.c (Fbyte_code): Discard unused computed value to
- prevent gcc warning.
-
- * lisp.h (Fplist_member): Add prototype.
-
-2002-03-18 Kim F. Storm <[email protected]>
-
- * config.in: Add HAVE_SENDTO, HAVE_RECVFROM, HAVE_SETSOCKOPT,
- HAVE_GETSOCKOPT, HAVE_GETPEERNAME, HAVE_GETSOCKNAME, and HAVE_SYS_UN_H.
-
- * process.c: Define HAVE_LOCAL_SOCKETS based on HAVE_SYS_UN_H.
- Remove explicit GNU_LINUX settings for datagram support.
-
-2002-03-18 Pavel Jan,Am(Bk <[email protected]>
-
- * process.c (Fmake_network_process): Remove unused variable `sa'.
- Doc fix. Add usage:.
- (set_socket_options): Remove unused variables `optnum' and `opttype'.
-
-2002-03-17 Richard M. Stallman <[email protected]>
-
- * xdisp.c (cursor_type_changed): New variable.
- (redisplay_internal): Redisplay all windows if cursor_type_changed.
- Clear it when clearing windows_or_buffers_changed.
- (try_cursor_movement, redisplay_window, try_window_id)
- (try_window_reusing_current_matrix): Test cursor_type_changed
- along with windows_or_buffers_changed.
-
- * window.h (cursor_type_changed): New variable.
-
- * xfns.c (x_set_cursor_type): Set cursor_type_changed,
- not update_mode_lines, and always set it to 1.
-
- * xdisp.c (clear_garbaged_frames): Don't set windows_or_buffers_changed
- if no frames needed redrawing.
-
-2002-03-17 Kim F. Storm <[email protected]>
-
- The following changes add support for network server processes,
- datagram connections, and local (unix) sockets.
-
- * process.h (struct Lisp_Process): New member log.
- Doc fix: Member command used to indicate stopped network process.
- Doc fix: Member childp contains plist for network process.
- Doc fix: Member kill_without_query is inverse of query-on-exit flag.
-
- * process.c (Qlocal, QCname, QCbuffer, QChost, QCservice, QCfamily)
- (QClocal, QCremote, QCserver, QCdatagram, QCnowait, QCnoquery, QCstop)
- (QCcoding, QCoptions, QCfilter, QCsentinel, QClog, QCfeature): New
- variables.
- (NETCONN1_P): New macro.
- (DATAGRAM_SOCKETS): New conditional symbol.
- (datagram_address): New array.
- (DATAGRAM_CONN_P, DATAGRAM_CHAN_P): New macros.
- (status_message): Use concat3.
- (Fprocess_status): Add `listen' status to doc string. Return
- `stop' for a stopped network process.
- (Fset_process_buffer): Update contact plist for network process.
- (Fset_process_filter): Ditto. Don't enable input for stopped
- network processes. Server must listen, even if filter is t.
- (Fset_process_query_on_exit_flag, Fprocess_query_on_exit_flag):
- New functions.
- (Fprocess_kill_without_query): Removed. Now defined in simple.el.
- (Fprocess_contact): Added KEY argument. Handle datagrams.
- (list_processes_1): Optionally show only processes with the query
- on exit flag set. Dynamically adjust column widths. Omit tty
- column if not needed. Report stopped network processes. Identify
- server and datagram network processes.
- (Flist_processes): New optional arg `query-only'.
- (conv_sockaddr_to_lisp, get_lisp_to_sockaddr_size)
- (conv_lisp_to_sockaddr, set_socket_options)
- (network_process_featurep, unwind_request_sigio): New helper
- functions.
- (Fprocess_datagram_address, Fset_process_datagram_address):
- (Fset_network_process_options): New lisp functions.
- (Fopen_network_stream): Removed. Now defined in simple.el.
- (Fmake_network_process): New lisp function. Code is based on
- previous Fopen_network_stream, but heavily reworked with new
- property list based argument list, support for datagrams, server
- processes, and local sockets in addition to old client-only
- functionality.
- (server_accept_connection): New function.
- (wait_reading_process_input): Use it to handle incoming connects.
- Do not enable input on a new connection if process is stopped.
- (read_process_output): Handle datagram sockets. Use 2k buffer for
- them.
- (send_process): Handle datagram sockets.
- (Fstop_process, Fcontinue_process): Apply to network processes. A
- stopped network process is indicated by setting command field to t.
- (Fprocess_send_eof): No-op if datagram connection.
- (Fstatus_notify): Don't read input for a stream server socket or a
- stopped network process.
- (init_process): Initialize datagram_address array.
- (syms_of_process): Intern and staticpro new variables, defsubr new
- functions.
-
-2002-03-16 Jason Rumney <[email protected]>
-
- * w32fns.c (w32_to_all_x_charsets): Return correct type in
- startup case.
-
-2002-03-16 Richard M. Stallman <[email protected]>
-
- * xdisp.c (redisplay_internal, redisplay_windows):
- Use list_of_error to call internal_condition_case_1.
- (safe_eval, safe_call): Pass Qt to internal_condition_case_{1,2}
- so as to catch all errors with no possibility of debugger redisplay.
- (list_of_error): New variable.
- (syms_of_xdisp): Init and staticpro it.
-
- * print.c (print_object): Delete `\ ' from printed rep of frame.
-
-2002-03-15 Eli Zaretskii <[email protected]>
-
- * msdos.c (dos_rawgetc): Disable the x-autoselect-window feature,
- until its implementation is fixed.
-
-2002-03-14 Pavel Jan,Am(Bk <[email protected]>
-
- * xfns.c (png_load): Remove unused variable `gamma_str'.
-
-2002-03-14 Richard M. Stallman <[email protected]>
-
- * xfns.c (x_real_positions): Handle failure in XQueryTree.
-
-2002-03-14 Miles Bader <[email protected]>
-
- * intervals.c (adjust_for_invis_intang): New function.
- (set_point_both): Use `adjust_for_invis_intang' to do most of the
- work for dealing with invisible+intangible regions. Do so before
- and after both forward and backward movements, to handle both
- front-sticky and rear-sticky cases.
- * textprop.c (text_property_stickiness): Function moved here from
- `editfns.c'.
- * intervals.h (text_property_stickiness): New declaration.
- * editfns.c (char_property_eq): Function removed.
- (text_property_stickiness): Function moved to `textprop.c'.
-
-2002-03-13 Jason Rumney <[email protected]>
-
- * config.in: Add STRFTIME_NO_POSIX2.
-
- * strftime.c (my_strftime) [STRFTIME_NO_POSIX2]: Handle %h, %EX
- and %OX when underlying strftime does not.
-
-2002-03-13 Stefan Monnier <[email protected]>
-
- * xterm.c (x_set_toolkit_scroll_bar_thumb) <USE_MOTIF>:
- Use a fixed-size thumb (based on an ad-hoc estimate of 30 chars per
- line) to avoid annoying flicker.
- (xm_scroll_callback): Get rid of the now unnecessary kludge.
- (XTread_socket): Mark it static.
-
- * xdisp.c (display_mode_element): Fix int/Lisp_Object mixup.
-
-2002-03-13 Kim F. Storm <[email protected]>
-
- * puresize.h (BASE_PURESIZE): Increase to 775000.
-
-2002-03-12 Juanma Barranquero <[email protected]>
-
- * editfns.c (syms_of_editfns): Fix typo.
-
-2002-03-12 Gerd Moellmann <[email protected]>
-
- * xsmfns.c: Include stdio.h because termhooks.h needs it.
- Include termopt.h for interrupt_input.
-
-2002-03-11 Andreas Schwab <[email protected]>
-
- * coding.c (syms_of_coding) <file-coding-system-alist>: Doc fix.
-
-2002-03-11 Gerd Moellmann <[email protected]>
-
- * xterm.c (note_mouse_movement): Put code for
- x_autoselect_window_p in #if 0.
-
- * lread.c (Fload): Don't assume that message_with_string uses the
- string it is given like a C string.
-
-2002-03-10 Jan Dj,Ad(Brv <[email protected]>
-
- * xterm.h (x_session_check_input, x_session_initialize): Declare.
-
- * xterm.c (XTread_socket): Add call to x_session_check_input and
- x_session_have_connection.
- (x_initialize): Add call to x_session_initialize.
-
- * termhooks.h (enum event_kind): Add save_session_event.
-
- * keyboard.c: Add Emacs event save_session_event.
-
- * emacs.c (main): Add call to syms_of_xsmfns.
-
- * lisp.h (syms_of_xsmfns): Declare extern.
-
- * config.in: Add HAVE_X_SM.
-
- * Makefile.in (LIBXT): Add -lSM -lICE
- if HAVE_X_SM and not USE_X_TOOLKIT.
- (XOBJ): New file xsmfns.c added.
-
- * xsmfns.c: New file for X session management.
-
-2002-03-09 Jason Rumney <[email protected]>
-
- * fileio.c (Fcopy_file) [WINDOWS_NT]: Ensure file is not
- read-only when setting modified time.
-
-2002-03-08 Gerd Moellmann <[email protected]>
-
- * xdisp.c (move_it_vertically_backward): At the end of the function,
- when moving forward by lines, treat terminal frames specially.
-
- * keyboard.c (echo_char): Make sure to add a separator between
- keys even if echo_dash hasn't been called.
-
- * xdisp.c: Use new string macros.
- (update_echo_area): Pass number of bytes to message3 instead of
- number of chars.
- (set_message_1): Don't access a string's size_byte directly.
- (decode_mode_spec_coding): Use number of bytes of eoltype string
- instead number of chars.
-
- * lisp.h (SREF, SDATA, SCHARS, SBYTES, SMBP): New macros.
-
-2002-03-08 Juanma Barranquero <[email protected]>
-
- * w32fns.c (Fx_display_color_cells): Force 24+ bit color depths to
- 24-bit.
-
-2002-03-06 Jason Rumney <[email protected]>
-
- * w32term.c (x_draw_hollow_cursor): Draw same size as block cursor.
-
-2002-03-06 Gerd Moellmann <[email protected]>
-
- * keyboard.c (echo_prompt, echo_char, echo_dash, echo_now)
- (cancel_echoing, echo_length, echo_truncate): Changed to
- work with new kboard definition.
- (echo_now): Use message3_nolog instead of message2_nolog.
-
- * alloc.c (mark_kboards): Mark echo_string.
-
- * keyboard.h (ECHOBUFSIZE): Removed.
- (struct kboard): Member echoptr removed, member echobuf renamed
- to echo_string.
-
- * xdisp.c (message_with_string): Use Fformat instead of doprnt and
- message3 instead of message2 to display the message using STRING's
- text properties.
-
-2002-03-05 Andreas Schwab <[email protected]>
-
- * xdisp.c (hscroll_margin): Change to EMACS_INT.
-
-2002-03-05 Per Abrahamsen <[email protected]>
-
- * frame.c (default-frame-alist): Explain that setting it doesn't
- affect existing frames.
-
-2002-03-05 Stefan Monnier <[email protected]>
-
- * indent.c (skip_invisible): Fix my brain fart.
-
- * dispnew.c (sit_for): Don't wait if executing a kbd macro.
-
-2002-03-04 Stefan Monnier <[email protected]>
-
- * dosfns.c, dosfns.h, dispnew.c, dispextern.h, commands.h, charset.c,
- * alloc.c, abbrev.c, emacs.c, eval.c, keyboard.c, keyboard.h,
- * lisp.h, lread.c, sysdep.c, termcap.c, termchar.h, w32term.c,
- * window.c, xdisp.c, xselect.c, xterm.c: Change defvar_int definition
- and variables to use EMACS_INT instead of just int.
-
- * buffer.c (syms_of_buffer): Allow non-string `mode-name'.
-
-2002-03-04 Eli Zaretskii <[email protected]>
-
- * sysdep.c (sys_subshell) [MSDOS]: If PWD is set in the
- environment, pass it down with corrected value.
-
-2002-03-04 Pavel Jan,Am(Bk <[email protected]>
-
- * lread.c (read_filtered_event): Do not call start_hourglass
- before returning.
-
-2002-03-04 Juanma Barranquero <[email protected]>
-
- * w32term.c (x_display_and_set_cursor): Fix typo.
-
-2002-03-03 Richard M. Stallman <[email protected]>
-
- * fileio.c (Fmake_temp_name): Doc fix.
-
-2002-03-03 Gary Wong <[email protected]>
-
- * termcap.c [!emacs]: Replace ospeed for building standalone
- libtermcap, for binary compatibility.
-
- * tparam.c [!emacs]: Move #define of bcopy to after string.h.
-
-2002-03-03 Richard M. Stallman <[email protected]>
-
- * xrdb.c (file_p): Rename arg `path' to `filename'.
-
- * abbrev.c (Fexpand_abbrev): Increment plist as use count
- only if it is an integer.
-
- * xfns.c (png_load): Set screen_gamma based on f->gamma.
- If png_get_sRGB gives an answer, call png_set_gamma
- using the default image gamma value.
-
- * lread.c (read1): When reading from a file, default string to
- multibyte only if it has some multibyte characters.
-
- * print.c (print_object): Output multibyte chars 128...255
- using \x even if ! print_escape_multibyte.
-
- * xdisp.c (display_mode_element): Move the places where
- bytepos, charpos, this, and lisp_string are set.
- Use lisp_string to set bytepos.
-
- * xdisp.c (redisplay_internal):
- Call clear_image_cache only if HAVE_WINDOW_SYSTEM.
-
- * xdisp.c (display_mode_element): Merge properties specified with
- :propertize onto those that come with the string.
-
-2002-03-03 Eli Zaretskii <[email protected]>
-
- * xdisp.c (syms_of_xdisp) <auto-hscroll-mode>: Renamed from
- automatic-hscrolling. Users changed.
- <hscroll-margin>: Renamed from automatic-hscroll-margin.
- Users changed.
- <hscroll-step>: Renamed from automatic-hscroll-step. Users changed.
-
-2002-03-02 Eli Zaretskii <[email protected]>
-
- * buffer.c (syms_of_buffer) <buffer-file-coding-system>: Doc fix.
-
-2002-03-02 Kim F. Storm <[email protected]>
-
- * window.c (Fminibuffer_selected_window): New function.
- (syms_of_window): Defsubr it.
-
-2002-03-01 Kim F. Storm <[email protected]>
-
- * window.h (struct window): New member phys_cursor_width.
-
- * window.c (make_window, replace_window): Init phys_cursor_width.
-
- * xterm.c (x_display_and_set_cursor): Blink box cursor using
- hollow box cursor. Blink bar cursor using 1 pixel wide bar.
-
- * w32term.c (x_display_and_set_cursor): Blink box cursor using
- hollow box cursor. Blink bar cursor using 1 pixel wide bar.
-
- * lisp.h (GCPRO6): New macro.
-
- * process.c (Fopen_network_stream): Use GCPRO6.
-
-2002-03-01 Kim F. Storm <[email protected]>
-
- * process.c (Qconnect, Qfailed): New variables.
- (syms_of_process): Intern and staticpro them.
- (Fprocess_status): Document connect and failed return values.
- [NON_BLOCKING_CONNECT]: New conditional.
- (connect_wait_mask, num_pending_connects): New variables.
- (status_message): Convert Qfailed status.
- (Fopen_network_stream): Added support for non-blocking connect.
- New optional args: filter, sentinel, non_blocking. Doc updated.
- [HAVE_GETADDRINFO, !HAVE_GETADDRINFO]: Merged common code.
- (deactivate_process): Handle pending non-blocking connect.
- (wait_reading_process_input): Poll for status of non-blocking
- connects. Exec sentinel directly when connect succeeds.
- (status_notify): Don't read process output if not yet connected.
-
-2002-02-28 Kim F. Storm <[email protected]>
-
- * window.c (minibuf_selected_window): Renamed from
- Vminibuf_selected_window. Users changed.
- (syms_of_window): Staticpro it.
-
-2002-02-26 Kim F. Storm <[email protected]>
-
- The following changes add a new Vminibuf_selected_window variable
- which is similar to Vminibuf_scroll_window, but which is only set
- on entry to the minibuffer (from a non-minibuffer window):
-
- * window.c (Vminibuf_selected_window): New variable.
- (struct save_window_data): New member minibuf_selected_window.
- (Fset_window_configuration): Restore Vminibuf_selected_window.
- (Fcurrent_window_configuration): Save Vminibuf_selected_window.
- Set minibuf_scroll_window member to nil if minibuf_level is 0.
- (compare_window_configurations): Compare minibuf_selected_window.
-
- * window.h (Vminibuf_selected_window): Declare extern.
-
- * minibuf.c (read_minibuf): Set Vminibuf_selected_window on first
- entry to minibuffer or on entry from a non-minibuffer window.
-
- * dispextern.h (CURRENT_MODE_LINE_FACE_ID_3): Compare with
- Vminibuf_selected_window instead of Vminibuf_scroll_window.
-
- * xdisp.c (init_iterator): Compare with Vminibuf_selected_window
- instead of Vminibuf_scroll_window when deciding in which window
- the region should be highlighted. Consequently, the region remains
- highlighteded even when a completion buffer is also displayed.
-
-2002-02-26 Eli Zaretskii <[email protected]>
-
- * fileio.c (Fsubstitute_in_file_name): Fix the change from 2002-02-08.
-
- * xselect.c (Qcompound_text_with_extensions): Renamed from
- Qcompound_text_no_extensions.
- (lisp_data_to_selection_data, syms_of_xselect): Use the new name.
-
-2002-02-26 Juanma Barranquero <[email protected]>
-
- * w32proc.c (syms_of_ntproc): Doc fix.
-
-2002-02-24 Pavel Jan,Am(Bk <[email protected]>
-
- * intervals.h: Include "dispextern.h" unconditionally.
-
-2002-02-24 Jason Rumney <[email protected]>
-
- * Makefile.in (WINNT_SUPPORT) [WINDOWSNT]: Add w32-vars.elc
- and disp-table.elc.
- (lisp): Add emacs-lisp/backquote.elc.
-
-2002-02-24 Kim F. Storm <[email protected]>
-
- * keymap.c (Flookup_key): Fix problem in 2001-12-28 patch:
- The validation of the event type was too strict as it didn't
- allow string events; buffer names are used in bindings for
- menu-bar-select-buffer (see `menu-bar-update-buffers').
-
-2002-02-23 Kim F. Storm <[email protected]>
-
- The following changes rework my patch of 2002-02-06 which
- added command remapping by entering the commands directly into
- the keymaps. Now, command remapping uses an explicit `remap'
- prefix in the keymaps, i.e. [remap COMMAND].
-
- * keymap.c (Qremap, remap_command_vector): New variables.
- (is_command_symbol): Remove function.
- (Fdefine_key): No longer accept a symbol for KEY.
- Added validation of [remap COMMAND] argument for KEY.
- The DEF is no longer required to be a symbol when remapping a command.
- (Fremap_command): New function to remap command through keymaps.
- (Flookup_key): Perform command remapping initiated by
- Fremap_command directly for speed.
- (Fkey_binding): Use Fremap_command for command remapping.
- (where_is_internal): Handle new command remapping representation.
- (syms_of_keymap): Intern Qremap, initialize remap_command_vector,
- staticpro them. Defsubr Fremap_command.
-
- * keymap.h (Fremap_command): Declare extern.
- (is_command_symbol): Remove extern.
-
- * keyboard.c (command_loop_1): Use Fremap_command for command
- remapping; now try command remapping for all symbols.
-
-2002-02-23 Eli Zaretskii <[email protected]>
-
- * coding.h (run_pre_post_conversion_on_str): Add prototype.
-
-2002-02-23 Jason Rumney <[email protected]>
-
- * w32select.c (Fw32_set_clipboard_data): Run pre-write-conversion
- on the string before encoding it.
- (Fw32_get_clipboard_data): Run post-read-conversion on the string
- after decoding it.
-
- * w32fns.c (w32_wnd_proc) <WM_TIMER>: Fix last change.
-
-2002-02-23 Pavel Jan,Am(Bk <[email protected]>
-
- * w32term.c (enter_timestamp): Remove unused static variable to
- prevent warning.
-
- * xterm.c (enter_timestamp): Put in #if 0 to prevent warning.
-
-2002-02-23 Eli Zaretskii <[email protected]>
-
- * w16select.c (Fw16_get_clipboard_data): Fix last change.
-
- * xselect.c (selection_data_to_lisp_data): Fix last change.
-
-2002-02-22 Jason Rumney <[email protected]>
-
- * w32term.h (struct w32_output): New member menu_command_in_progress.
-
- * w32menu.c (menubar_selection_callback): Free the menu and
- clear the menu_command_in_progress flag.
-
- * w32fns.c (mouse_move_timer, mouse_button_timer): Initialize.
- (menu_free_timer): New variable.
- (MENU_FREE_ID, MENU_FREE_DELAY): New constants.
- (w32_wnd_proc) <WM_TIMER>: Handle menu_free_timer.
- <WM_EXITMENULOOP>: Delay before freeing menu. Do nothing if a
- menu command is in progress.
- <WM_COMMAND>: Set the menu_command_in_progress flag.
- Kill any menu_free_timer that is running.
-
- * w32term.c (w32_text_out): Renamed from W32_TEXTOUT.
- Call ExtTextOutA rather than ExtTextOut.
-
-2002-02-22 Eli Zaretskii <[email protected]>
-
- * puresize.h (BASE_PURESIZE): Increase to 755000.
-
-2002-02-22 Eli Zaretskii <[email protected]>
-
- * w16select.c (Fw16_set_clipboard_data): Run pre-write-conversion
- on the string before encoding it.
- (Fw16_get_clipboard_data): Run post-read-conversion on the string
- after decoding it.
-
-2002-02-22 Eli Zaretskii <[email protected]>
-
- Support for ICCCM Extended Segments in X selections:
-
- * xselect.c <Qcompound_text_no_extensions>: New variable.
- (syms_of_xselect): Intern and staticpro it.
- (selection_data_to_lisp_data): Run post-read-conversion on decoded
- selection text.
- (lisp_data_to_selection_data): If next-selection-coding-system is
- compound-text-no-extensions, set the type of selection to be
- compound-text.
-
- * xterm.h (x_encode_text): Update prototype.
-
- * xfns.c (x_encode_text): Accept additional arg SELECTIONP; all
- callers changed. If SELECTIONP is non-zero, run the
- pre-write-conversion function before encoding the selection text.
-
-2002-02-21 Kim F. Storm <[email protected]>
-
- * frame.c (syms_of_frame): Change mouse-highlight default to t.
-
- * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
- Correct composing of language-change event.
-
-2002-02-20 Kim F. Storm <[email protected]>
-
- * keyboard.c (menu_bar_items): Don't include keymap or local-map
- bindings at PT when building menu (the menu is not updated often
- enough for this to work reliable).
- (tool_bar_items): Likewise.
- (current_active_maps): Removed unused (and buggy) function.
-
-2002-02-20 Pavel Jan,Am(Bk <[email protected]>
-
- * xfns.c (gif_load): Use correct width and height for GIF images.
-
-2002-02-19 Eli Zaretskii <[email protected]>
-
- * floatfns.c (Fatan): Accept an optional second arg and call
- atan2 if passed 2 args.
-
-2002-02-18 Jason Rumney <[email protected]>
-
- * w32term.c (glyph_rect): Determine the row and glyph more precisely.
-
-2002-02-17 Jason Rumney <[email protected]>
-
- * w32term.c (x_autoselect_window_p): New variable.
- (syms_of_w32term): DEFVAR_BOOL and initialize it.
- (note_mouse_movement): Use it.
-
- * w32fns.c (w32_load_system_font): Never set fonts_changed_p to zero.
-
- * w32bdf.c (w32_load_bdf_font): Maybe set fonts_changed_p.
-
- * w32fns.c (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth):
- New variables.
- (syms_of_w32fns): Intern and staticpro them.
- (x_frame_parms) <"fullscreen">: New parameter.
- (x_fullscreen_move, x_set_fullscreen): New functions.
- (x_set_frame_parameters): Support Qfullscreen.
- (x_real_positions): Save x/y_pixels_diff frame params.
- (x_figure_window_size): Support full-screen frames.
- (Fx_create_frame): Default the fullscreen parameter.
-
- * w32term.c (x_check_fullscreen, x_check_fullscreen_move)
- (x_fullscreen_adjust): New functions.
- (w32_read_socket) <WM_WINDOWPOSCHANGED>: Don't resize to
- fullscreen. Call x_check_fullscreen_move, and set the
- want_fullscreen member of output_data.w32
- <WM_ACTIVATE, WM_ACTIVATEAPP>: Call x_check_fullscreen.
-
- * w32term.h: New enum for FULLSCREEN_* constants.
- (struct w32_output): New members want_fullscreen, x_pixels_diff,
- y_pixels_diff, x_pixels_outer_diff, and y_pixels_outer_diff.
- (x-fullscreen-adjust): New prototype.
-
-2002-02-17 Kim F. Storm <[email protected]>
-
- * frame.c (Vmouse_highlight): New variable.
- (syms_of_frame): DEFVAR_LISP it.
-
- * frame.h (Vmouse_highlight): Declare extern.
-
- * xterm.h (struct x_display_info): Add mouse_face_hidden.
-
- * xterm.c (disable_mouse_highlight): Removed variable.
- (note_mouse_highlight): Don't highlight if Vmouse_highlight is nil.
- (show_mouse_face): Don't show highlight if mouse_face_hidden is set.
- (XTread_socket): Turn mouse_face_hidden off after mouse movement,
- and on after keyboard input.
- (x_term_init): Initialize mouse_face_hidden.
-
- * msdos.h (struct display_info): Add mouse_face_hidden.
-
- * msdos.c (disable_mouse_highlight): Removed variable.
- (show_mouse_face): Don't show highlight if mouse_face_hidden is set.
- (IT_note_mouse_highlight): Don't highlight if Vmouse_highlight is nil.
- (internal_terminal_init): Initialize mouse_face_hidden.
- (dos_rawgetc): Turn mouse_face_hidden off after mouse movement,
- and on after keyboard input.
-
- * w32term.h (struct w32_display_info): Add mouse_face_hidden.
-
- * w32term.c (disable_mouse_highlight): Removed variable.
- (note_mouse_highlight): Disable highlight if Vmouse_highlight is nil.
- (show_mouse_face): Don't show highlight if mouse_face_hidden is set.
- (w32_read_socket): Turn mouse_face_hidden off after mouse movement,
- and on after keyboard input.
- (w32_initialize_display_info): Initialize mouse_face_hidden.
-
-2002-02-16 Eli Zaretskii <[email protected]>
-
- * msdos.c (last_mouse_window): New variable.
- (dos_rawgetc): Fix last change--if the mouse is in the same window
- as recorded in last_mouse_window, don't select this window.
-
- * Makefile.in (lisp, shortlisp): Use cus-start.elc, not cus-start.el.
-
- * msdos.c (x_autoselect_window_p): New variable.
- (syms_of_msdos): Defvar it.
- (dos_rawgetc): If x_autoselect_window_p is set, select the window in
- which the last mouse movement occured, unless it is already selected.
-
- * xdisp.c (automatic_hscroll_margin, Vautomatic_hscroll_step):
- New variables.
- (syms_of_xdisp): DEVFAR them.
- (hscroll_window_tree): Use automatic_hscroll_margin and
- Vautomatic_hscroll_step to compute the amount of window scrolling.
-
-2002-02-16 Pavel Jan,Am(Bk <[email protected]>
-
- * xterm.c (x-autoselect-window): New variable.
- (note_mouse_movement): Use it.
-
- * keyboard.c: Do not include "systime.h" twice.
-
-2002-02-15 Andreas Schwab <[email protected]>
-
- * puresize.h (PURESIZE_RATIO): Increase to 9/5.
-
- * alloc.c (NSTATICS): Increase to 1280.
-
-2002-02-15 Kai Gro,A_(Bjohann <[email protected]>
-
- * alloc.c (NSTATICS): Bump to 1026.
-
- * xterm.c (Vx_alt_keysym, Vx_hyper_keysym, Vx_meta_keysym)
- (Vx_super_keysym): New variables.
- (syms_of_xterm): DEFVAR_LISP them.
- (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Use the
- variables to determine which keys to use for the various modifiers.
-
-2002-02-13 Kim F. Storm <[email protected]>
-
- * window.c (Vmode_line_in_non_selected_windows): Removed.
- (mode_line_in_non_selected_windows): New variable.
- (syms_of_window): DEFVAR_BOOL it.
-
- * dispextern.h (CURRENT_MODE_LINE_FACE_ID_3):
- Use mode_line_in_non_selected_windows.
- (mode_line_in_non_selected_windows): Declare extern.
- (Vmode_line_in_non_selected_windows): Removed extern.
-
-2002-02-13 Richard M. Stallman <[email protected]>
-
- * keyboard.c (Fthis_command_keys, Fthis_command_keys_vector)
- (Fthis_single_command_keys, Fthis_single_command_raw_keys)
- (Fclear_this_command_keys): Doc fixes.
-
- * xfaces.c (Finternal_make_lisp_face, Finternal_copy_lisp_face)
- (update_face_from_frame_parameter): Increment face_change_count
- and windows_or_buffers_changed to force redisplay using changed faces.
-
- * xdisp.c (QCpropertize): New variable.
- (mode_line_proptrans_alist): New variable.
- (display_mode_element): New arg PROPS; all calls changed.
- Implement this, for strings.
- Handle literal output of strings by sharing the
- main-line code for strings, using local var `literal'.
- Handle :propertize feature.
- (syms_of_xdisp): Initialze and staticpro QCpropertize and
- mode_line_proptrans_alist.
-
-2002-02-11 Kim F. Storm <[email protected]>
-
- * window.c (Vmode_line_in_non_selected_windows): New variable.
- (syms_of_window): DEFVAR_LISP it.
-
- * dispextern.h (CURRENT_MODE_LINE_FACE_ID_3): New macro.
- (CURRENT_MODE_LINE_FACE_ID): Use it.
- (Vmode_line_in_non_selected_windows): Declare extern.
-
- * xdisp.c (display_mode_lines): Use CURRENT_MODE_LINE_FACE_ID_3
- to get mode line face.
-
-2002-02-11 Eli Zaretskii <[email protected]>
-
- * msdos.c (Vx_bitmap_file_path, x_stretch_cursor_p): Remove these
- variables; cus-start.el doesn't need them anymore.
-
-2002-02-09 Kim F. Storm <[email protected]>
-
- * insdel.c (make_gap_smaller): Preserve BEG_UNCHANGED during gap
- reduction. This fixes a display problem where stray newlines were
- inserted in the window (corrected by C-l). Clarified code (IMHO).
-
-2002-02-09 Eli Zaretskii <[email protected]>
-
- * dispextern.h (CURRENT_MODE_LINE_FACE_ID): Fix last change.
-
- * xdisp.c (display_mode_lines): Fix last change.
-
-2002-02-09 Jason Rumney <[email protected]>
-
- * w32fns.c (enum_font_cb2): Don't let charsets unknown to Windows
- match each other.
- (w32_load_system_font): Prevent Cleartype fonts from loading.
- (Fx_show_tip): Ensure tip frames are above other topmost windows.
-
-2002-02-09 Kim F. Storm <[email protected]>
-
- * dispextern.h (CURRENT_MODE_LINE_FACE_ID): New macro.
- (CURRENT_MODE_LINE_HEIGHT): Use it.
- (enum face_id): Add MODE_LINE_INACTIVE_FACE_ID.
-
- * xdisp.c (window_box_height): Use CURRENT_MODE_LINE_FACE_ID.
- (pos_visible_p, handle_face_prop): Likewise.
- (display_mode_lines): Likewise, but for the real selected window.
- (init_iterator) [row == NULL]: Handle MODE_LINE_INACTIVE_FACE_ID.
-
- * xfaces.c (Qmode_line_inactive): New face variable for mode-line
- in non-selected windows.
- (realize_basic_faces): Realize it.
- (syms_of_term): Intern and staticpro it.
-
-2002-02-08 Kim F. Storm <[email protected]>
-
- * alloc.c (SETJMP_WILL_LIKELY_WORK, SETJMP_WILL_NOT_WORK):
- Changed mail addresses to [email protected].
-
-2002-02-08 Eli Zaretskii <[email protected]>
-
- * fileio.c (Fsubstitute_in_file_name): If the file name includes
- ~user, and there's no such user, don't discard everything before ~user.
-
- * floatfns.c (Fround): Doc fix.
-
-2002-02-08 Pavel Jan,Am(Bk <[email protected]>
-
- * sysdep.c (init_system_name): Put unused variable `p' in #if 0.
-
-2002-02-07 Stefan Monnier <[email protected]>
-
- * lisp.h (Fx_file_dialog): Add extern decl (used in fileio.c).
-
-2002-02-07 Kim F. Storm <[email protected]>
-
- * keymap.c (where_is_internal): Only check whether definition is
- remapped if it fulfills is_command_symbol.
-
-2002-02-07 Andreas Schwab <[email protected]>
-
- * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT): Define to 2 for m68k.
-
- * alloc.c (mark_stack): Don't assume sizeof (Lisp_Object) is 4.
-
-2002-02-06 Kim F. Storm <[email protected]>
-
- * keymap.c (Fdefine_key): Allow symbol as KEY argument for
- defining command remapping. Doc updated.
- (Flookup_key): Remap command through keymap if KEY is a symbol.
- (is_command_symbol): New function.
- (Fkey_binding): Use it. New optional argument NO-REMAP.
- Doc updated. Callers changed. Perform command remapping via
- recursive call unless that arg is non-nil.
- (where_is_internal): New argument no_remap. Callers changed.
- Call recursively to find original key bindings for a remapped
- comand unless that arg is non-nil.
- (Fwhere_is_internal): New optional argument NO-REMAP.
- Doc updated. Callers changed. Pass arg to where_is_internal.
-
- * keymap.h (Fkey_binding, Fwhere_is_internal): Update prototype.
- (is_command_symbol): Add prototype.
-
- * keyboard.c (Vthis_original_command): New variable.
- (syms_of_keyboard): DEFVAR_LISP it.
- (command_loop_1): Set it, and perform command remapping.
-
-2002-02-06 Pavel Jan,Am(Bk <[email protected]>
-
- * keyboard.c (recursive_edit_1): Call cancel_hourglass unconditionally.
-
-2002-02-06 Jason Rumney <[email protected]>
-
- * w32term.c (w32_native_per_char_metric): Disable 2002-01-20 change.
-
-2002-02-06 Eli Zaretskii <[email protected]>
-
- * charset.c (get_charset_id): Use if-else instead of ?:.
-
-2002-02-06 Richard M. Stallman <[email protected]>
-
- * filelock.c (S_ISLNK): Define if not defined.
-
-2002-02-03 Richard M. Stallman <[email protected]>
-
- * fileio.c (Fdo_auto_save): Improve "auto save disabled" msg.
-
- * lread.c (read1): Redesign strategy for force_multibyte and
- force_singlebyte. Now is_multibyte records whether read_buffer
- is multibyte. Encountering any multibyte character makes it so.
-
-2002-02-02 Stefan Monnier <[email protected]>
-
- * term.c (term_get_fkeys_1): If `k0' and `k;' are both specified and
- with the same sequence, map that sequence to f10 rather than f0.
-
-2002-02-03 Andreas Schwab <[email protected]>
-
- * s/gnu-linux.h: Check for __mc68000__ instead of __m68k__, the
- latter never being defined on GNU/Linux.
-
-2002-02-02 Eli Zaretskii <[email protected]>
-
- * xfaces.c (realize_default_face): Don't set the weight and slant of
- the default face to Qnormal, unless these attributes are unspecified.
-
-2002-02-02 Pavel Jan,Am(Bk <[email protected]>
-
- * keyboard.c (command_loop_1) [HAVE_X_WINDOWS]:
- Call cancel_hourglass unconditionally.
-
- * eval.c (Fsignal): Remove duplicated declaration of
- the variable `display_hourglass_p'.
-
-2002-01-31 Richard M. Stallman <[email protected]>
-
- * editfns.c (region_limit): Nicer error message.
-
- * coding.c (decode_composition_emacs_mule):
- Give up if NCOMPONENT gets too large to index `component'.
-
- * callint.c (check_mark): New arg to specify clearer error message.
- Callers changed.
-
-2002-01-27 Richard M. Stallman <[email protected]>
-
- * minibuf.c (Fcompleting_read): Doc fix.
-
-2002-01-27 Pavel Jan,Am(Bk <[email protected]>
-
- * minibuf.c (Fread_from_minibuffer, Fread_command, Fread_function)
- (Fread_variable, Fread_buffer, minibuffer-completion-confirm):
- Fix doc-strings.
-
-2002-01-26 Richard M. Stallman <[email protected]>
-
- * buffer.c (syms_of_buffer): Doc fixes for scroll-...-aggressively.
-
- * xdisp.c (try_scrolling): Exchange uses of scroll_down_aggressively
- and scroll_up_aggressively.
-
-2002-01-26 Pavel Jan,Am(Bk <[email protected]>
-
- * keyboard.c (parse_tool_bar_item): Remove duplicated prototypes.
-
-2002-01-25 Stefan Monnier <[email protected]>
-
- * textprop.c (Fnext_property_change, Fnext_single_property_change)
- (Fprevious_property_change, Fprevious_single_property_change):
- Stay within the narrowed-buffer boundaries.
-
-2002-01-25 Eli Zaretskii <[email protected]>
-
- * term.c (Ftty_display_color_cells): New function.
- (syms_of_term): Defsubr it.
- (Ftty_display_color_cells, Ftty_display_color_p): Change the
- argument name to DISPLAY. Doc fix.
-
- * dispextern.h: Add prototype for set_tty_color_mode and
- tty_setup_colors.
-
-2002-01-24 Jason Rumney <[email protected]>
-
- * w32term.c (x_scroll_run): Use ScrollWindowEx in place of BitBlt.
- If region left to draw is not what was expected, mark the frame as
- garbaged.
-
- * w32fns.c (w32_wnd_proc) <WM_PAINT>: Initialize update_rect.
- Combine the regions returned by BeginPaint and GetUpdateRect.
-
-2002-01-23 Jason Rumney <[email protected]>
-
- * w32term.c (x_update_window_begin): Only hide caret if
- w32_use_visible_system_caret is set.
- (x_update_window_end): Only show caret if
- w32_use_visible_system_caret is set.
- (syms_of_w32term): Handle SystemParametersInfo call failing.
-
- * w32fns.c (syms_of_w32fns): Initialize w32_visible_system_caret_hwnd.
-
-2002-01-22 Richard M. Stallman <[email protected]>
-
- * unexelf.c (unexec): Define n so as to cause compilation error
- for the code where people have often written n instead of nn.
-
- * .gdbinit (hookpost-run): Defined.
-
-2002-01-22 Jan Dj,Ad(Brv <[email protected]>
-
- * xfns.c (x_set_frame_parameters): Typo in previous fix corrected.
-
-2002-01-21 Jan Dj,Ad(Brv <[email protected]>
-
- * xfns.c (x_set_frame_parameters): Just call x_fullscreen_adjust
- if fullscreen is being set.
-
-2002-01-21 Pavel Jan,Am(Bk <[email protected]>
-
- * minibuf.c (Fminibuffer_contents)
- (Fminibuffer_contents_no_properties, Fread_from_minibuffer)
- (Fread_string, Fread_no_blanks_input, Fcompleting_read): Doc fixes.
-
-2002-01-21 Richard M. Stallman <[email protected]>
-
- * window.c (check_frame_size): Fix minimum height calculation.
-
-2002-01-20 Ken Raeburn <[email protected]>
-
- * dispextern.h (WINDOW_WANTS_MODELINE_P): Use XFASTINT on window
- height before comparison.
- (WINDOW_WANTS_HEADER_LINE_P): Likewise.
-
-2002-01-20 Jason Rumney <[email protected]>
-
- * w32term.c (w32_system_caret_width): Remove.
- (w32_use_visible_system_caret): New user flag.
- (syms_of_w32term): DEFVAR_BOOL it. Initialize based on whether
- Windows reports a screen reader running.
- (x_update_window_begin): Hide the system caret.
- (x_update_window_end): Show the system caret.
- (x_display_and_set_cursor): Don't draw a cursor when
- w32_use_visible_system_caret is set. Do not adjust width.
-
- * w32fns.c (w32_visible_system_caret_hwnd): New static variable.
- (w32_wnd_proc) <WM_KILL_FOCUS, WM_EMACS_DESTROY_CARET>: Set it.
- <WM_EMACS_TRACK_CARET>: Arrange for system caret to be visible if
- the user requests it. Use system default width when creating.
- <WM_EMACS_HIDE_CARET, WM_EMACS_SHOW_CARET>: Handle new messages.
-
- * w32term.h (WM_EMACS_SHOW_CARET, WM_EMACS_HIDE_CARET):
- New window messages.
-
-2002-01-20 Richard M. Stallman <[email protected]>
-
- * window.c (MIN_SAFE_WINDOW_HEIGHT): Value now 1.
-
-2002-01-20 Pavel Jan,Am(Bk <[email protected]>
-
- * doprnt.c (doprnt1): Fix typos in error call.
-
-2002-01-20 Eli Zaretskii <[email protected]>
-
- * unexelf.c (unexec) [__sgi]: Support the .got sections.
-
-2002-01-20 Jason Rumney <[email protected]>
-
- * w32term.c (w32_native_per_char_metric): Don't trust the metrics
- that Windows returns. If a double check fails, try to guess how
- ExtTextOut is going to act.
-
- * w32fns.c (w32_load_system_font, w32_to_x_charset): Use strnicmp
- in place of stricmp.
- (w32_list_synthesized_fonts): Removed.
- (w32_to_all_x_charsets, enum_font_maybe_add_to_list): New functions.
- (struct enumfont_t): New element; list.
- (enum_font_cb2): List all style and charset variations of a font.
- (Fw32_select_font): New optional argument; include_proportional.
- Exclude vertical fonts. Exclude proportional fonts unless
- include_proportional is non-nil.
- (w32_enable_synthesized_fonts): Change to a boolean.
- (Fw32_send_sys_command): Doc fix.
-
-2002-01-19 Pavel Jan,Am(Bk <[email protected]>
-
- * dispnew.c (update_frame): Move the variable `tem' to the block
- where it is used.
-
-2002-01-19 Jason Rumney <[email protected]>
-
- * w32fns.c (Fx_create_frame): Bind redisplay-dont-pause around
- call to face-set-after-frame-default.
-
-2002-01-18 Richard M. Stallman <[email protected]>
-
- * dispextern.h (WINDOW_WANTS_MODELINE_P): Check window height > 1.
- (WINDOW_WANTS_HEADER_LINE_P): Check window height provides room.
-
-2002-01-17 Richard M. Stallman <[email protected]>
-
- * window.c (enlarge_window): When exceeding size of parent,
- directly delete all the siblings instead of trying to resize it.
-
-2002-01-17 Pavel Jan,Am(Bk <[email protected]>
-
- * term.c (set_tty_color_mode): Remove unused variable `tem'.
-
-2002-01-16 Henrik Enberg <[email protected]>
-
- * lread.c (init_lread): Move the installed-lisp dirs later in the path.
-
-2002-01-16 Kim F. Storm <[email protected]>
-
- * xterm.c (x_erase_phys_cursor): Don't erase cursor if cursor row
- is invisible. This can happen if cursor is on top line of a
- window, and we switch to a buffer with a header line.
-
- * w32term.c (x_erase_phys_cursor): Ditto.
-
-2002-01-16 Pavel Jan,Am(Bk <[email protected]>
-
- * xterm.c (XTread_socket) [!USE_X_TOOLKIT]: Compute the value of
- `dont_resize' only when used.
-
- * xdisp.c: Remove forgotten extern declaration of `Qimage'.
-
-2002-01-15 Eli Zaretskii <[email protected]>
-
- * xdisp.c (display_mode_element): When computing charpos, depend
- on multibyteness of elt, not the text in field.
-
-2002-01-15 Pavel Jan,Am(Bk <[email protected]>
-
- * buffer.c (Fkill_all_local_variables):
- Increment `update_mode_lines' only once.
-
-2002-01-14 Pavel Jan,Am(Bk <[email protected]>
-
- * lisp.h (adjust_after_replace_noundo)
- (Fupdate_coding_systems_internal): Add prototypes.
-
- * sound.c (Fplay_sound): Initialize header_size also for :data case.
-
-2002-01-14 Eli Zaretskii <[email protected]>
-
- Support for the --color command-line argument and tty-color-mode
- frame parameter:
-
- * term.c (tty_default_color_capabilities, tty_setup_colors)
- (set_tty_color_mode): New functions.
- (term_init): Call tty_default_color_capabilities.
- (Qtty_color_mode_alist): New variable.
- (syms_of_term): Intern and staticpro it.
-
- * frame.c (store_frame_param): Call set_tty_color_mode for termcap
- frames.
- (do_switch_frame): For termcap frames, switch the tty
- color mode as specified by the frame's parameters.
- (Qtty_color_mode): New variable.
- (syms_of_frame): Intern and staticpro it.
-
- * emacs.c (USAGE2): Add the --color option.
- (standard_args): Ditto.
-
-2002-01-13 Jan Dj,Ad(Brv <[email protected]>
-
- * xterm.h (struct x_output): New members want_fullscreen,
- x_pixels_diff, y_pixels_diff, x_pixels_outer_diff, and
- y_pixels_outer_diff.
- New enum for FULLSCREEN_* constants.
- (FRAME_OUTER_WINDOW): Handle the case where output_data.x->widget
- is NULL.
- (x_fullscreen_adjust): Add prototype.
-
- * emacs.c (USAGE2): Add the new full-screen arguments.
- (standard_args): Ditto.
-
- * xfns.c (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth):
- New variables.
- (syms_of_xfns): Intern and staticpro them.
- (x_frame_parms) <"fullscreen">: New parameter.
- (x_fullscreen_move, x_set_fullscreen): New functions.
- (x_set_frame_parameters): Support for Qfullscreen.
- (x_real_positions): More accurate computation of the frame position.
- (x_figure_window_size): Support full-screen frames.
- (Fx_create_frame): Default the fullscreen parameter.
-
- * xterm.c (x_check_fullscreen, x_fullscreen_adjust): New functions.
- (XTread_socket) <Expose>: Call x_check_fullscreen.
- <ConfigureNotify>: Don't resize to fullscreen.
- Call x_check_fullscreen_move, and set the want_fullscreen member of
- output_data.x.
-
-2002-01-13 Jason Rumney <[email protected]>
-
- * w32term.h (WM_XBUTTONDOWN, WM_XBUTTONUP): New window messages
- for mice with more than 3 buttons.
-
- * w32term.c (parse_button): New parameter xbutton. Callers changed.
- (w32_read_socket): Handle new "XBUTTON" messages.
-
- * w32fns.c (w32_pass_extra_mouse_buttons_to_system): New user option.
- (syms_of_w32fns): DEFVAR_BOOL it.
- (w32_wnd_proc): Handle new "XBUTTON" messages.
-
-2002-01-13 Pavel Jan,Am(Bk <[email protected]>
-
- * keyboard.c (read_key_sequence): Remove unused variable `extra_maps'.
-
-2002-01-13 Andreas Schwab <[email protected]>
-
- * xterm.c (x_load_font): Never set fonts_changed_p to zero.
-
-2002-01-12 Andreas Schwab <[email protected]>
-
- * .gdbinit (xbuffer): Remove address operator since data is now a
- pointer.
-
-2002-01-11 Richard M. Stallman <[email protected]>
-
- * insdel.c (adjust_after_replace_noundo): New function.
-
- * coding.c (code_convert_region): Don't copy old text if undo disabled.
-
-2002-01-09 Jason Rumney <[email protected]>
-
- * xdisp.c (x_consider_frame_title): Don't count the tooltip frame
- when checking for multiple frames.
-
-2002-01-08 Richard M. Stallman <[email protected]>
-
- * window.c (delete_window): Rewrite the code for changing the
- selected window to handle the case where WINDOW is not a leaf.
-
-2002-01-07 Eli Zaretskii <[email protected]>
-
- * process.c (send_process): Set src_multibyte to 1 after the call
- top setup_coding_system, not before the call.
-
-2002-01-07 Jason Rumney <[email protected]>
-
- * xmenu.c (set_frame_menubar, xmenu_show):
- (xdialog_show): Initialize wv->help to Qnil.
-
- * w32menu.c (single_submenu, set_frame_menubar, w32_menu_show):
- (w32_dialog_show): Initialize wv->help to Qnil.
-
-2002-01-06 Jason Rumney <[email protected]>
-
- * xmenu.c (single_submenu): Initialize wv->help to Qnil.
-
- * w32menu.c (w32_menu_display_help): Revert last change.
-
- * xmenu.c (menu_highlight_callback): Revert last change.
-
-2002-01-06 Andreas Schwab <[email protected]>
-
- * insdel.c (make_gap_larger): Make sure buffer size does not
- overflow range of int.
-
-2002-01-05 Jason Rumney <[email protected]>
-
- * w32term.c (x_draw_glyphs): Don't call notice_overwritten_cursor if
- OVERLAPS_P.
-
- * w32menu.c (w32_menu_display_help): Hide any tooltip window.
-
- * w32fns.c (compute_tip_xy): If tooltip won't fit on the screen
- to the left or to the right of the pointer, put it against
- the left screen edge.
- (x_frame_parms): Add missing braces around initializer.
-
- * w32term.c (x_setup_relief_colors): Don't compute an image's
- background color if it doesn't have a Pixmap.
- (notice_overwritten_cursor): Don't depend on
- output_cursor and updated_area. Compare pixel coordinates with
- window's cursor pixel coordinates.
- (x_draw_glyphs, x_clear_end_of_line, show_mouse_face):
- Call notice_overwritten_cursor with new arg list.
- (show_mouse_face): Fix bug setting a row's mouse_face_p flag
- unconditionally.
- (x_draw_image_relief): Use predefined macro instead of
- constant when the value of `tool_bar_button_relief' is negative.
-
- * w32term.c (x_display_and_set_cursor): Fix PostMessage arg types.
-
-2002-01-04 Richard M. Stallman <[email protected]>
-
- * xmenu.c (menu_highlight_callback): Hide any tooltip window.
-
-2002-01-03 Richard M. Stallman <[email protected]>
-
- * keymap.c (Fcurrent_active_maps): Put the `keymap' property map first.
- (Fkey_binding): Try the `keymap' property map first.
- (Fdescribe_buffer_bindings): Show `keymap' property bindings before
- minor mode bindings.
-
-2002-01-03 Kim F. Storm <[email protected]>
-
- * keyboard.c (read_key_sequence): Fix cast of submaps arg to bcopy.
-
-2002-01-02 Richard M. Stallman <[email protected]>
-
- * keyboard.c (read_key_sequence): Handle the keymap property
- before minor mode maps.
-
- * editfns.c (Fformat): Update thissize from field_width
- based on the actual width, in the string case.
-
-2002-01-01 Pavel Jan,Am(Bk <[email protected]>
-
- * charset.h (UNIBYTE_STR_AS_MULTIBYTE_P): Parenthesize assignment
- when used as truth value to prevent gcc warnings.
-
- * sysdep.c, unexapollo.c, w32.c, w32bdf.c, w32heap.c, w32inevt.c,
- * w32proc.c: Include <config.h>.
-
-2002-01-01 Andreas Schwab <[email protected]>
-
- * eval.c (max_specpdl_size, max_lisp_eval_depth): Define as int,
- not EMACS_INT, to make them compatible with DEFVAR_INT.
- * lisp.h (max_specpdl_size): Adjust declaration.
-
-2002-01-01 Richard M. Stallman <[email protected]>
-
- * print.c (print_object): Test print_escape_nonascii only for
- unibyte strings.
- (PRINTPREPARE): Once again bind Qprint_escape_nonascii
- when outputting to a multibyte buffer.
-
-2001-12-29 Richard M. Stallman <[email protected]>
-
- * print.c (print_object): In multibyte string, use hex escapes.
- Use octal only for unibyte strings.
- (PRINTPREPARE): Don't ever set Qprint_escape_nonascii.
-
- * lread.c (read_escape): New arg BYTEREP for reporting whether
- escape forces unibyte or multibyte.
- (read1): When reading a string, take note of that info.
-
-2001-12-29 Ken Raeburn <[email protected]>
-
- * abbrev.c (Fexpand_abbrev): Use NILP instead of implicit zero
- comparison to test lisp value returned by Fget.
-
-2001-12-29 Richard M. Stallman <[email protected]>
-
- * lisp.h (max_specpdl_size): Add declaration.
-
- * fileio.c (Fdo_auto_save): If NO_MESSAGE, don't call push_message.
-
- * keymap.c (silly_event_symbol_error): New subrtn, from Fdefine_key.
- Handle modifier bits. Correct typo in error message.
-
-2001-12-28 Richard M. Stallman <[email protected]>
-
- * abbrev.c: Use the plist of an abbrev for multiple params if nec.
- (Fdefine_abbrev): New arg SYSTEM-FLAG for a system abbrev.
- (Fdefine_global_abbrev, Fdefine_mode_abbrev):
- Update calls to Fdefine_abbrev.
- (write_abbrev): Update for changed data format.
- Don't list "system" abbrevs.
- (Fexpand_abbrev): Update use count with new data format.
- (describe_abbrev): Update for changed data format.
- (Fdefine_abbrev_table): Handle the new SYSTEM-FLAG.
-
- * config.in (HAVE_MBSINIT): Add #undef.
-
- * strftime.c (mbsinit): Define as no-op if not available.
-
- * s/sco5.h (LIBX11_SYSTEM) [MOTIF]: Add -lgen.
- (sigprocmask_set): Conditionalize decl on ! NOT_C_CODE.
-
- * keymap.c (Flookup_key): Error message if key has wrong data type.
- (Fdefine_key): Add error message for trying to bind [DEL], [RET], etc.
- (exclude_key): New variable.
-
-2001-12-28 Gerd Moellmann <[email protected]>
-
- * xterm.c (x_setup_relief_colors): Don't compute an image's
- background color if it doesn't have a Pixmap.
-
- * xterm.c (notice_overwritten_cursor): Don't depend on
- output_cursor and updated_area. Compare pixel coordinates with
- window's cursor pixel coordinates.
- (x_draw_glyphs, x_clear_end_of_line, show_mouse_face):
- Call notice_overwritten_cursor with new arg list.
- (show_mouse_face): Fix bug setting a row's mouse_face_p flag
- unconditionally.
-
- * xdisp.c (try_scrolling) <PT below scroll margin>: Add the
- height of the cursor line to the amount to scroll.
-
-2001-12-27 Richard M. Stallman <[email protected]>
-
- * intervals.c (set_point_both): The position after an invisible,
- intangible character is not an acceptable stopping point.
-
-2001-12-27 Ken Raeburn <[email protected]>
-
- * window.c (enlarge_window): In new preserve_before code, convert
- CURBEG from lisp object to integer before doing arithmetic.
-
-2001-12-27 Richard M. Stallman <[email protected]>
-
- * bytecode.c (Fbyte_code): Undo previous change.
-
-2001-12-26 Kim F. Storm <[email protected]>
-
- * keyboard.c (record_char): Ignore duplicate help-echo events only
- separated by mouse-movement. When tracking mouse, only record
- first and last mouse-movement event in same window.
- Don't record mouse-movement events in keyboard macros.
-
-2001-12-25 Richard M. Stallman <[email protected]>
-
- * window.c (enlarge_window): New arg PRESERVE_BEFORE. Callers changed.
- (Fenlarge_window): New arg PRESERVE_BEFORE.
-
- * bytecode.c (Fbyte_code): Use Fstring_make_unibyte
- instead of Fstring_as_unibyte.
-
-2001-12-22 Pavel Jan,Am(Bk <[email protected]>
-
- The following changes remove mocklisp support:
-
- * mocklisp.h, mocklisp.c: Files removed.
-
- * lisp.h: Remove declarations of variables `Vmocklisp_arguments',
- `Qmocklisp' and `Qmocklisp_arguments'.
- Remove prototype of syms_of_mocklisp.
-
- * makefile.nt, makefile.w32-in, Makefile.in: Remove mocklisp files.
-
- * callint.c: Do not include mocklisp.h.
- (Fcall_interactively): Do not test for mocklisp case.
-
- * eval.c: Remove variables `Qmocklisp_arguments',
- `Vmocklisp_arguments' and `Qmocklisp'. Remove prototype of ml_apply.
- (Fprogn, Fwhile, Fcommandp, Feval, Ffuncall, funcall_lambda):
- Do not test for mocklisp case.
- (Fwhile): Remove unused variable `tem'.
- (syms_of_eval): Remove variable `moclisp-arguments'.
-
- * data.c (wrong_type_argument): Remove mocklisp case.
-
- * doc.c (Fdocumentation): Remove mocklisp case.
-
- * emacs.c (main): Do not call syms_of_mocklisp.
-
-2001-12-21 Richard M. Stallman <[email protected]>
-
- * xfns.c (compute_tip_xy): If tooltip won't fit on the screen
- to the left or to the right of the pointer, put it against
- the left screen edge.
-
-2001-12-21 Eli Zaretskii <[email protected]>
-
- * Makefile.in (distclean): Remove .gdbinit if we are building
- outside the source tree.
-
-2001-12-19 Eli Zaretskii <[email protected]>
-
- * w32.c (emacs_root_dir): New function.
-
- * msdos.c (emacs_root_dir): New function.
-
- * fileio.c (Fexpand_file_name) [DOS_NT]: Use the root directory
- of the current drive as the fallback for default_directory.
-
- * dired.c (file_name_completion): Run the elements of
- completion-ignored-extensions through ENCODE_FILE.
-
- * lisp.h (scmp): Remove prototype, since it's now a static
- function private to dired.c.
-
-2001-12-18 Richard M. Stallman <[email protected]>
-
- * dired.c (scmp): Function moved from minibuf.c.
- Delete multibyte handling--used only on encoded strings.
-
- * minibuf.c (scmp): Function moved to dired.c.
-
- * fns.c (merge): Add QUIT call.
-
-2001-12-18 Dave Love <[email protected]>
-
- * Makefile.in (lisp, shortlisp): Add language/utf-8-lang.el,
- language/georgian.el.
-
-2001-12-18 Eli Zaretskii <[email protected]>
-
- * Makefile.in (lisp, shortlisp): Synchronize with changes to
- lisp/Makefile.in:DONTCOMPILE.
-
-2001-12-18 Pavel Jan,Am(Bk <[email protected]>
-
- * xdisp.c (window_box_height): Do not return negative values.
- From Gerd Moellmann <[email protected]>.
-
- * keyboard.c (head_table): Add missing braces around initializer.
-
- * term.c (keys): Likewise.
-
- * xfns.c (x_frame_parms, visual_classes): Likewise.
-
-2001-12-17 Sam Steingold <[email protected]>
-
- * coding.c (DECODE_COMPOSITION_END): Fixed a typo in the last
- patch (COMPOSING_P, not COMPOSING).
-
-2001-12-17 Richard M. Stallman <[email protected]>
-
- * editfns.c (Fcompare_buffer_substrings): Add QUIT to main loop.
-
- * coding.c (code_convert_region): Update coding->cmp_data->char_offset
- before calling decode_coding.
-
- * charset.c (Fdefine_charset): Call Fupdate_coding_systems_internal.
-
- * coding.c (DECODE_COMPOSITION_END): Check for ! COMPOSING_P (coding)
- instead of only for COMPOSITION_DISABLED.
-
-2001-12-16 Richard M. Stallman <[email protected]>
-
- * alloc.c (pure_alloc): After overflow, allocate just a small block.
-
- * Makefile.in (xmenu.o, xterm.o, fontset.o): Depend on buffer.h.
-
- * buffer.h (struct buffer): New field `display_error_modiff'.
- * buffer.c (reset_buffer): Initialize `display_error_modiff'.
-
- * window.c (Frecenter): Clear display_error_modiff field.
-
- * xdisp.c (redisplay_window_0, redisplay_window_1): New functions.
- Call redisplay_window, but not if display_error_modiff field says no.
- (redisplay_window_error): New function.
- (displayed_buffer): New variable.
- (redisplay_internal, redisplay_windows): Call the new functions
- instead of redisplay_window directly.
-
-2001-12-15 Richard M. Stallman <[email protected]>
-
- * keyboard.c (syms_of_keyboard) <double-click-fuzz>: Doc fix.
-
-2001-12-14 Andrew Innes <[email protected]>
-
- * makefile.w32-in (EMACSLOADPATH): Define.
- ($(EMACS)): Run `list-load-path-shadows' after dumping Emacs.
- (bootstrap-temacs): Remove dependency on bootstrap-clean.
-
-2001-12-13 Eli Zaretskii <[email protected]>
-
- * xfns.c (x_report_frame_params): Make the scroll-bar-width frame
- parameter have a numeric value all the time.
-
- * w32fns.c (x_report_frame_params): Likewise.
-
-2001-12-12 Richard M. Stallman <[email protected]>
-
- * fileio.c (Fwrite_region): Doc fix.
-
- * xdisp.c (CLEAR_FACE_CACHE_COUNT): Redefine as 500.
- (redisplay_internal): Call clear_image_cache only for window terminals.
-
-2001-12-12 Gerd Moellmann <[email protected]>
-
- * xdisp.c (move_it_vertically_backward): Change heuristic
- for the case that we didn't move far enough initially.
-
- * window.c (Frecenter): Simplify computation in the case of window
- system frames and ARG < 0; use window_box_height.
-
-2001-12-11 Richard M. Stallman <[email protected]>
-
- * Makefile.in, mem-limits.h, dispnew.c, emacs.c, fileio.c:
- * process.c, sysdep.c, unexec.c: Test GNU_LINUX, not LINUX.
-
-2001-12-11 Andrew Innes <[email protected]>
-
- * insdel.c (make_gap) [DOUG_LEA_MALLOC]: Call make_gap_smaller if
- arg is negative.
-
-2001-12-11 Richard M. Stallman <[email protected]>
-
- * m/hp800.h: Split the __hpux conditional into the parts
- that are right for GNU/Linux too and the parts that are not.
- Use the former if GNU_LINUX.
- (HAVE_ALLOCA, LOAD_AVE_TYPE, LOAD_AVE_CVT): New defs for GNU/Linux.
-
- * s/gnu-linux.h (GNU_LINUX): Defined.
-
-2001-12-11 Pavel Jan,Am(Bk <[email protected]>
-
- * macros.c, msdos.c, w16select.c: Change doc-string comments to
- `new style' [w/`doc:' keyword].
-
-2001-12-10 Jason Rumney <[email protected]>
-
- * w32menu.c (w32_free_submenu_strings): Clear menu item struct
- before using.
-
-2001-12-09 Pavel Jan,Am(Bk <[email protected]>
-
- * dosfns.c: Change doc-string comments to `new style' [w/`doc:'
- keyword].
-
-2001-12-09 Eli Zaretskii <[email protected]>
-
- * dosfns.c (dos-display-scancodes, dos-decimal): Doc fix.
-
- * s/hpux10.h (srand48): Don't undefine.
-
-2001-12-09 Jason Rumney <[email protected]>
-
- * w32menu.c (_widget_value): Make `help' field a Lisp_Object.
- Add comment to explain where the struct came from.
- (single_submenu, w32_menu_show): Set `help' field as Lisp_Object.
- (add_menu_item): Process pop-up menus first to avoid memory leak.
- (add_menu_item, w32_menu_display_help): Use `help' field as
- Lisp_Object.
- (w32_free_submenu_strings): Only free owner-drawn strings.
-
-2001-12-09 Pavel Jan,Am(Bk <[email protected]>
-
- * COPYING: Moved back.
-
- * charset.c (char_to_string_1, translate_char, Fdefine_charset):
- Add parentheses around && within ||.
-
- * indent.c (compute_motion): Likewise.
-
- * intervals.c (merge_properties_sticky): Likewise.
-
- * coding.c (setup_coding_system, shrink_encoding_region)
- (Fdecode_sjis_char): Likewise.
-
-2001-12-07 Andreas Schwab <[email protected]>
-
- * xdisp.c (display_mode_element): Don't read past end of string if
- it ends with '%'.
-
- * alloc.c (inhibit_garbage_collection): Don't exceed value an int
- can hold.
-
- * data.c (Vmost_positive_fixnum, Vmost_negative_fixnum):
- Rename from most_positive_fixnum and most_negative_fixnum, resp., and
- type changed to Lisp_Object.
- (syms_of_data): DEFVAR_LISP them.
-
-2001-12-07 Richard M. Stallman <[email protected]>
-
- * callproc.c (init_callproc): Set Vdata_directory based on the source
- location whenever Emacs was run uninstalled.
-
-2001-12-06 Paul Eggert <[email protected]>
-
- * config.in (HAVE_WORKING_VFORK): New #undefs.
- * process.c (create_process):
- Use HAVE_WORKING_VFORK, not HAVE_VFORK.
- * m/cnvrgnt.h (HAVE_VFORK): Remove #define.
- * m/ibm370aix.h (HAVE_VFORK): Remove #undef.
- * m/ibmps2-aix.h (HAVE_VFORK): Remove #define.
- * m/intel386.h (HAVE_VFORK): Likewise.
- * m/mips-siemens.h (HAVE_VFORK): Likewise.
- * m/mips.h (HAVE_VFORK): Likewise.
- * s/freebsd.h (vfork): Remove #define.
- * s/lynxos.h (HAVE_VFORK): Remove #undef.
- * s/usg5-4-2.h: Fix comment about vfork.
-
-2001-12-06 Richard M. Stallman <[email protected]>
-
- * s/hpux10.h (random): Add undef.
- (HAVE_RANDOM): Define it just once.
-
-2001-12-06 Stefan Monnier <[email protected]>
-
- * eval.c: Undo last change: the standard syntax is not wanted.
-
-2001-12-06 Eli Zaretskii <[email protected]>
-
- * xterm.c (x_free_frame_resources) [USE_X_TOOLKIT]: Remove all the
- scroll bars of the frame before deleting the frame itself. If the
- frame has a widget, delete the frame with XtDestroyWidget, and do
- not call XDestroyWindow before that.
-
-2001-12-06 Kim F. Storm <[email protected]>
-
- * xfns.c (x_report_frame_params): Return actual fringe widths.
-
- * w32fns.c (x_report_frame_params): Return actual fringe widths.
-
-2001-12-05 Andrew Innes <[email protected]>
-
- * alloc.c (Fgarbage_collect): Shrink buffer gaps that are
- excessively large.
-
- * insdel.c (make_gap_larger): New function.
- (make_gap_smaller): New function.
- (make_gap) [USE_MMAP_FOR_BUFFERS || REL_ALLOC]:
- Call make_gap_smaller if arg is negative.
-
-2001-12-04 Stefan Monnier <[email protected]>
-
- * keyboard.c (kbd_buffer_store_event): Fix interrupt_signal prototype.
- Pass a dummy argument when calling interrupt_signal.
- (parse_menu_item): Mark disabled items before checking for empty def.
- (read_char_minibuf_menu_prompt): Make safety more visible.
- (read_key_sequence): Add a `first_unbound' variable.
- Use it to detect C-c ESC ESC ESC ESC ... cases and drop the
- unbound prefix as soon as we can detect it.
-
- * doc.c (Fsnarf_documentation): Add prototype.
- (get_doc_string): Handle negative arguments.
- (Fdocumentation): Use AREF and ASIZE.
- Move the calls to get_doc_string to a single place.
- Don't confuse an interactive-spec for a docstring reference.
- (Fdocumentation_property): Take advantage of the fact that
- get_doc_string now ignores the sign of the docstring position.
-
- * eval.c: Use standard syntax for usage in docstrings.
-
-2001-12-03 Pavel Jan,Am(Bk <[email protected]>
-
- * xdisp.c (syms_of_xdisp): Make `tool-bar-button-relief' an option.
-
-2001-12-02 Pavel Jan,Am(Bk <[email protected]>
-
- * xterm.c (x_draw_image_relief): Use predefined macro instead of
- constant when the value of `tool_bar_button_relief' is negative.
-
-2001-12-02 Richard M. Stallman <[email protected]>
-
- * xmenu.c (menu_highlight_callback): Use `help' field as Lisp_Object.
- (single_submenu, xmenu_show): Set `help' field as Lisp_Object.
-
- * fileio.c (read_non_regular): Delete Fsignal call.
-
-2001-12-01 Stefan Monnier <[email protected]>
-
- * lisp.h (run_hook_list_with_args): Undo last change.
-
-2001-12-01 Gerd Moellmann <[email protected]>
-
- * xterm.c (x_draw_fringe_bitmap): Always undo clipping.
-
-2001-12-01 Jason Rumney <[email protected]>
-
- * window.c (Qleft_fringe, Qright_fringe): Remove. Now in frame.c.
-
- * w32term.h (WM_MOUSELEAVE, TME_LEAVE, TRACKMOUSEEVENT)
- [!WM_MOUSELEAVE]: Define.
-
- * w32menu.c (current_popup_menu, get_menu_item_info):
- (set_menu_item_info): New vars.
- (set_frame_menubar): Doc fix clarifying GC interaction with menus.
- (w32_menu_show): Set current_popup_menu.
- (add_menu_item): Allocate new strings for owner-drawn menu items
- and help strings.
- Use owner-draw for disabled menu items again.
- (w32_menu_display_help): Ignore owner-drawn items and popup menus.
- (w32_free_submenu_strings, w32_free_menu_strings): New functions.
-
- * w32fns.c (trackmouse_window, track_mouse_event_fn): New vars.
- (w32_wnd_proc) <WM_MOUSEMOVE>: Notice when mouse enters frame.
- <WM_EXITMENULOOP>: Free menu strings.
- <WM_MOUSELEAVE>: Stop tracking mouse.
- (x_create_tip_frame): Specify no minibuffer, modeline or fringes.
-
- * w32term.c (w32_read_socket) <WM_MOUSELEAVE>: Cancel help echo
- and mouse face.
-
-2001-12-01 Kim F. Storm <[email protected]>
-
- The following changes add left-fringe and right-fringe
- frame parameters to adjust fringe widths, or remove one or
- both fringes.
-
- * frame.h (struct frame): Remove trunc_area_pixel_width and
- trunc_area_cols fields.
- (Qleft_fringe, Qright_fringe): Declare.
- (FRAME_RIGHT_FRINGE_WIDTH): New macro.
-
- * frame.c (Qleft_fringe, Qright_fringe): New vars.
- (syms_of_frame): Initialize them.
-
- * window.c (coordinates_in_window): Handle separate left and right
- fringe widths.
-
- * xterm.h (struct x_output): Add left_fringe_width, right_fringe_width,
- and fringe_cols fields.
- (FRAME_FRINGE_BITMAP_WIDTH, FRAME_FRINGE_BITMAP_HEIGHT): Remove macros.
- (FRAME_X_FRINGE_COLS): Use fringe_cols field.
- (FRAME_X_FRINGE_WIDTH): Use fringes_extra field.
- (FRAME_X_LEFT_FRINGE_WIDTH): Use left_fringe_width field.
- (FRAME_X_RIGHT_FRINGE_WIDTH): Use right_fringe_width field.
- (x_compute_fringe_widths): Add prototype.
-
- * xterm.c (zv_height, zv_bits, zv_period): Changed zv bitmap to
- fill fringe evenly with small dashes.
- (x_draw_fringe_bitmap): Clear background if necessary. Align and
- clip the new ZV bitmap to avoid jitter between rows.
- (x_draw_row_fringe_bitmaps): Rely on x_draw_fringe_bitmap to clear
- background. Don't draw fringe bitmaps if fringe width is zero.
- (x_compute_fringe_widths): New function.
- (x_new_font, x_set_window_size_1): Use it.
-
- * xfns.c (x_frame_parms): Add `left-fringe' and `right-fringe' parms.
- (x_set_frame_parameters): Process `font' parameter before other
- parameters as fringe widths depend on it.
- (x_set_fringe_width): New function.
- (x_figure_window_size): Use x_compute_fringe_widths.
- (Fx_create_frame): Process `left-fringe' and `right-fringe' frame
- parameters.
-
- * widget.c (set_frame_size): Use x_compute_fringe_widths.
- (EmacsFrameSetCharSize): Ditto.
-
- * w32term.h: Merged changes from xterm.h.
- * w32term.c: Merged changes from xterm.c.
- * w32fns.c: Merged changes from xfns.c.
-
-2001-11-29 Pavel Jan,Am(Bk <[email protected]>
-
- * COPYING: Removed.
-
-2001-11-29 Dave Love <[email protected]>
-
- * coding.c (syms_of_coding) <Qchar_coding_system>: Give it an
- extra extra slot.
- (detect_coding_mask): Fix call of detect_coding_iso2022.
-
-2001-11-29 Pavel Jan,Am(Bk <[email protected]>
-
- * fileio.c (file-name-coding-system)
- (default-file-name-coding-system): Doc fix (links to referenced
- variables added).
-
-2001-11-28 Stefan Monnier <[email protected]>
-
- * lisp.h (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5):
- Add dummy uses of gcproN variables.
-
- * category.c (describe_category, describe_category_1)
- (Fdescribe_categories): Remove. (Moved to lisp/help-fns.el.)
- (syms_of_category): Don't defsubr Sdescribe_categories.
-
-2001-11-28 Richard M. Stallman <[email protected]>
-
- * fileio.c (Ffind_file_name_handler): Avoid initializer for `result'.
-
- * Makefile.in (lispdir): New variable, referring to build dir.
- (TAGS-LISP): Find Makefile in $(lispdir), not $(lispsource).
-
-2001-11-28 Andrew Innes <[email protected]>
-
- * w32menu.c (w32_menu_display_help): Actually add the new argument
- OWNER.
-
-2001-11-28 Jason Rumney <[email protected]>
-
- * w32menu.c (add_menu_item): Do not use owner-draw for disabled
- menu items. From David Ponce <[email protected]>.
- (w32_dialog_show) [HAVE_DIALOGS]: Compile whole function
- conditionally.
- (w32_menu_display_help): New argument OWNER. Rewritten to store a
- help event in the owner frame's keyboard buffer.
-
- * w32fns.c (w32_wnd_proc) <WM_MENUSELECT>: Display help directly.
- (Fx_show_tip): Don't subtract last width from row width.
-
- * w32term.c (w32_read_socket) <WM_MENUSELECT>: Remove.
- (w32_read_socket): Use EQ to compare frames.
-
-2001-11-28 Gerd Moellmann <[email protected]>
-
- * xterm.c (x_draw_glyphs): Don't call notice_overwritten_cursor if
- OVERLAPS_P.
-
-2001-11-28 Pavel Jan,Am(Bk <[email protected]>
-
- * xdisp.c (message_dolog): Remove unused variables `gcpro2',
- `gcpro3' and `gcpro4'.
-
- * coding.c (decode_coding_string): Remove unused variable `gcpro1'.
-
-2001-11-28 Stefan Monnier <[email protected]>
-
- * ccl.c: Use AREF and ASIZE.
-
-2001-11-27 Stefan Monnier <[email protected]>
-
- * lisp.h (run_hook_list_with_args): Remove.
- (LIST_END_P): Fix call to wrong_type_argument.
- (make_fixnum_or_float): Use EMACS_INT rather than int.
-
-2001-11-26 Stefan Monnier <[email protected]>
-
- * syntax.c (syms_of_syntax): Remove defsubr of Sdescribe_syntax.
- (describe_syntax, describe_syntax_1, Fdescribe_syntax): Remove.
-
- * eval.c: Use AREF and ASIZE.
- (Ffetch_bytecode): Add the file name to the error message.
-
- * fileio.c (Ffind_file_name_handler): Give precedence to handlers
- which match the end of the file-name.
- (Fsubstitute_in_file_name): Don't signal an error if $ENVVAR
- is not a valid env var, but leave it as is instead.
-
- * keymap.c (access_keymap): Handle t bindings like nil bindings.
- Make nil bindings in char-tables transparent.
- (store_in_keymap): Turn a nil binding into a t binding for char-tables.
-
-2001-11-26 Richard M. Stallman <[email protected]>
-
- * textprop.c (set_text_properties_1): Allow START, END in either order.
- Do nothing if range is empty.
-
- * Makefile.in (mallocobj): Simplify logic using auxiliary vars.
-
- * Makefile.in (mostlyclean): Delete bootstrap-emacs here.
- (clean): Not here.
-
-2001-11-25 Stefan Monnier <[email protected]>
-
- * textprop.c (set_text_properties_1): Clearly mark that the
- interval should not be empty.
-
- * intervals.c (graft_intervals_into_buffer):
- Don't call set_text_properties_1 on an empty interval.
-
-2001-11-25 Richard M. Stallman <[email protected]>
-
- * unexelf.c (unexec): Index by n, not nn, when checking for ".sbss".
-
- * callproc.c (Fcall_process): When we make a bigger buffer for bufptr,
- don't lose the data in it.
-
-2001-11-25 Juanma Barranquero <[email protected]>
-
- * abbrev.c (Fexpand_abbrev): Use Frun_hooks instead of Vrun_hooks.
-
- * buffer.c (Fkill_buffer): Likewise.
-
- * print.c (temp_output_buffer_setup): Likewise.
-
-2001-11-25 Stefan Monnier <[email protected]>
-
- * xfaces.c (merge_face_heights): Coerce back to int explicitly.
-
-2001-11-25 Eli Zaretskii <[email protected]>
-
- * window.c (Fset_window_vscroll): Doc fix. From Kalle Olavi
- Niemitalo <[email protected]>.
-
-2001-11-25 Jason Rumney <[email protected]>
-
- * w32term.h (FRAME_X_FRINGE_COLS): No fringe on tip frames.
-
- * w32fns.c (x_create_tip_frame): Set frame's fringes_extra to 0.
- (Fx_show_tip): Block input during frame creation.
- (Fx_show_tip, Fx_hide_tip): Enable.
-
-2001-11-24 Richard M. Stallman <[email protected]>
-
- * lread.c (Fload): Detect recursive load error for more than 3
- nestings of the same file.
- (Vrecursive_load_depth_limit): Variable deleted.
- (syms_of_lread) <recursive-load-depth-limit>: Variable deleted.
-
-2001-11-24 Jason Rumney <[email protected]>
-
- * xfns.c (compute_tip_xy): Initialize root_x and root_y from
- mouse position if either left or top is not specified.
-
- * w32fns.c (w32_wnd_proc) <WM_MENUSELECT>: Revert last change.
- <WM_WINDOWPOSCHANGING>: Let tip frames resize without restriction.
- (my_create_tip_window, Fx_show_tip): Adjust size for external border.
- (my_create_tip_window): Assign tip_window.
- (x_create_tip_frame): Use same defaults as X.
- (compute_tip_xy): Remove unused variable. Use full screen width.
- (Fx_show_tip): Do not double height. Call ShowWindow directly.
-
- * w32term.c (x_after_update_window_line): Doc fix.
- (w32_read_socket): Doc fix. Avoid SET_FRAME_GARBAGED for tip
- frames.
- <WM_SHOWWINDOW>: Redo mouse highlight when hiding tip frame.
-
- * xdisp.c (prepare_menu_bars) [HAVE_WINDOW_SYSTEM]: Use tip_frame
- for all Windowed systems.
-
-2001-11-23 Eli Zaretskii <[email protected]>
-
- * msdos.c (IT_clear_screen): If the frame's faces are not yet
- realized, use the initial screen colors to clear the screen.
-
-2001-11-23 Pavel Jan,Am(Bk <[email protected]>
-
- * textprop.c (Fset_text_properties): Remove unused variables
- `unchanged', `prev_changed', `s' and `len'.
-
- * search.c (Freplace_match): Remove unused variable `inslen'.
-
- * keymap.c (access_keymap): Remove unused variables `c1' and `c2'.
-
-2001-11-22 Jason Rumney <[email protected]>
-
- * w32fns.c (x_window_to_frame): Remove irrelevant TODO comment.
- (w32_wnd_proc) <WM_MENUSELECT>: Show help echo directly.
- (my_create_tip_window): New function.
- (x_create_tip_frame, compute_tip_xy): Adapt for Windows.
- (Fx_show_tip, Fx_hide_tip) [TEST_TOOLTIPS]: Adapt for Windows.
-
-2001-11-20 Jason Rumney <[email protected]>
-
- * coding.h (Vw32_system_coding_system) [WINDOWSNT]: Remove.
- (ENCODE_SYSTEM, DECODE_SYSTEM) [WINDOWSNT]: Use Vlocale_coding_system.
-
- * w32fns.c (Vw32_system_coding_system): Remove.
- (w32_to_x_font, x_to_w32_font): Use Vlocale_coding_system.
-
-2001-11-19 Stefan Monnier <[email protected]>
-
- * fileio.c (Fwrite_region): Move choose_write_coding_system to
- after build_annotations.
-
- * syntax.c (describe_syntax): Add dummy arg.
- (describe_syntax_1): Update call to describe_vector.
-
- * category.c (describe_category): Add dummy arg.
- (describe_category_1): Update call to describe_vector.
-
- * keymap.c (Fdescribe_vector): Add `describer' parameter.
- (describe_command, describe_translation): Add dummy second param.
- (describe_map): Call elt_describer with two arguments.
- (describe_vector_princ): Add `fun' parameter.
- Call it instead of the hardcoded `princ'.
- (describe_vector): Add arg `args'.
- Pass it as a new second argument to elt_describer.
-
- * keymap.h (describe_vector): Update prototype.
-
- * frame.c: Don't include keymap.h any more.
- (keys_of_frame): Remove.
-
- * lisp.h (keys_of_frame): Remove declaration.
-
- * emacs.c (main): Don't call `keys_of_frame' any more.
-
-2001-11-14 Andreas Schwab <[email protected]>
-
- * unexelf.c [!defined MAP_ANON]: Define MAP_ANON to MAP_ANONYMOUS
- if defined, 0 otherwise.
- (MAP_FAILED): Define if not defined and use it to test mmap failure.
- (unexec) [!MAP_ANON]: Use /dev/zero as file to map.
-
-2001-11-19 Richard M. Stallman <[email protected]>
-
- * indent.c (current_column_1): Fix handling of scan_bytes for mb chars.
-
-2001-11-18 Jason Rumney <[email protected]>
-
- * w32term.c (note_mouse_highlight): Fix type of variable `ignore'.
- (x_draw_bar_cursor): If the background color of the glyph under
- the cursor equals the frame's cursor color, use the glyph's
- foreground color for drawing the bar cursor.
- (x_after_update_window_line): Clear internal border in different
- circumstances.
- (w32_set_vertical_scroll_bar): Check for width and height > 0.
- (w32_draw_relief_rect): Correct relief by 1 pixel.
- (x_set_glyph_string_background_width):
- Set extends_to_end_of_line_p if the row's fill_line_p is set and
- drawing the last glyph with DRAW_IMAGE_{RAISED,SUNKEN}.
- (x_display_and_set_cursor): If cursor_in_echo_area, use NO_CURSOR
- if cursor_in_non_selected_windows is false.
- (show_mouse_face): Clean up. Recognize overwritten cursor differently.
- (x_draw_glyphs): Remove parameters REAL_START and REAL_END.
- Notice if cursor gets overwritten.
- (notice_overwritten_cursor): Renamed from
- note_overwritten_text_cursor. Rewritten to take glyph widths
- into account, and to take X positions as parameters.
- (x_draw_phys_cursor_glyph): Save state of w->phys_cursor_on_p
- around call to x_draw_glyphs.
- (x_setup_relief_colors): Use `IMAGE_BACKGROUND' and
- `IMAGE_BACKGROUND_TRANSPARENT' to calculate the correct background
- color to use for image glyph reliefs.
- (x_draw_image_relief): Accept zero tool_bar_button_relief.
- (glyph_rect): Remove unused variable `area'.
-
- * w32fns.c (x_set_frame_parameters): Avoid infinite recursion for
- some items.
- (x_set_internal_border_width): Set frame garbaged when window
- doesn't exist yet.
- (Fx_create_frame): Accept zero tool_bar_button_relief.
- (x_clear_image_1, four_corners_best, image_background)
- (image_background_transparent): New functions.
- (xpm_format, png_format, jpeg_format, tiff_format, gif_format)
- (gs_format): Add `:background' entry.
- (lookup_image): Set IMG's background color if specified.
- (pbm_load, xbm_load_image, png_load): Set IMG's background field
- when appropriate.
- (x_clear_image_1): Reset `background_valid' and
- `background_transparent_valid' fields.
- (x_build_heuristic_mask): Use IMAGE_BACKGROUND instead of
- calculating it here. Set IMG's background_transparent field.
- (enum xpm_keyword_index): Add XPM_BACKGROUND.
- (enum png_keyword_index): Add PNG_BACKGROUND.
- (enum jpeg_keyword_index): Add JPEG_BACKGROUND.
- (enum tiff_keyword_index): Add TIFF_BACKGROUND.
- (enum gif_keyword_index): Add GIF_BACKGROUND.
- (enum gs_keyword_index): Add GS_BACKGROUND.
- (pbm_load, png_load, jpeg_load, tiff_load, gif_load):
- Pre-calculate image background color where necessary.
- (x_create_x_image_and_pixmap, xbm_load, gs_load):
- Use display info's n_cbits entry for screen depth.
- (Fx_show_tip): Remove unused variables `buffer', `top',
- `left', `max_width' and `max_height'.
-
- * w32menu.c (w32_menu_show, push_menu_pane): Doc fixes.
-
-2001-11-18 Gerd Moellmann <[email protected]>
-
- * puresize.h (BASE_PURESIZE): Increase to 750000.
-
-2001-11-18 Pavel Jan,Am(Bk <[email protected]>
-
- * frame.c (Fframe_live_p): Doc fix.
-
-2001-11-18 Richard M. Stallman <[email protected]>
-
- * xdisp.c (message_dolog_marker1, message_dolog_marker2)
- (message_dolog_marker3): New static variables hold three markers.
- (syms_of_xdisp): Initialize and staticpro them.
- (message_dolog): Use message_dolog_marker1..3 instead of
- allocating markers each time. Unchain them when done.
-
-2001-11-17 Richard M. Stallman <[email protected]>
-
- * doc.c (Fsnarf_documentation): Doc fix.
-
-2001-11-17 Andreas Schwab <[email protected]>
-
- * xterm.c (note_mouse_highlight): Fix type of variable `ignore'.
-
-2001-11-17 Richard M. Stallman <[email protected]>
-
- * fileio.c (Fwrite_region): Avoid initializer for Lisp_Object.
-
-2001-11-17 Jason Rumney <[email protected]>
-
- * xterm.c (notice_overwritten_cursor): Take care of end < 0 case.
-
-2001-11-17 Gerd Moellmann <[email protected]>
-
- * xdisp.c (tool_bar_item_info): Avoid calling Fget_text_property
- with invalid position.
-
-2001-11-16 Richard M. Stallman <[email protected]>
-
- * syswait.h: Delete conditionals for HPUX7, ISC 4.1, and convex.
-
- * s/isc4-1.h (HAVE_SYS_WAIT_H): Add #undef.
- * s/hpux.h (HAVE_SYS_WAIT_H): Add #undef.
- * s/hpux8.h (HAVE_SYS_WAIT_H): Define it.
-
- * m/convex.h (HAVE_SYS_WAIT_H): Add #undef.
-
-2001-11-16 Stefan Monnier <[email protected]>
-
- * fileio.c (build_annotations): Split off the tail.
- (build_annotations_2): New fun. Extracted from build_annotations.
- (Fwrite_region): Split the call to build_annotations into two
- calls to build_annotations and build_annotations_2.
-
-2001-11-16 Pavel Jan,Am(Bk <[email protected]>
-
- * sysdep.c (wait_for_kbd_input) [VMS]: Do not call
- clear_waiting_for_input with argument.
-
- * xterm.h (x_update_cursor): Remove duplicated prototype.
-
- * keyboard.h (clear_waiting_for_input): Remove duplicated prototype.
-
- * xterm.c (waiting_for_input): Remove unnecessary declaration.
-
- * data.c (Ftimes, Fquo, Frem, Fmod): Doc fix.
-
-2001-11-16 Stefan Monnier <[email protected]>
-
- * fileio.c (choose_write_coding_system): New fun, extracted
- from Fwrite_region.
- (Fwrite_region): Use it.
-
- * eval.c (max_specpdl_size, max_lisp_eval_depth): Use EMACS_INT.
- (funcall_lambda, run_hook_with_args): Make static and add prototype.
- (ml_apply, find_handler_clause): Add prototype.
-
-2001-11-16 Eli Zaretskii <[email protected]>
-
- * config.in: Add #undef HAVE_COFF_H.
-
- * unexec.c (coff.h): Don't include unless HAVE_COFF_H is defined.
- Required for ISC 4.1.
-
-2001-11-16 Eli Zaretskii <[email protected]>
-
- * syswait.h (HAVE_SYS_WAIT_H): Undef for ISC 4.1. Reported by
- Andrew Wiseman <[email protected]>.
-
-2001-11-16 Kim F. Storm <[email protected]>
-
- The following changes are made to clean up the various internal
- references to the fringes to actually use the term `fringe' for
- them. Previously, they were called `flags areas', `bitmap areas',
- `left/right side of windows', or implicitly as `flags' or
- `bitmaps':
-
- * dispextern.h (FRINGE_FACE_ID): Renamed from BITMAP_AREA_FACE_ID.
- Comments fixed. Use renamed symbols.
-
- * dispnew.c: Comment fix. Use renamed symbols.
-
- * frame.h (FRAME_FRINGE_COLS): Renamed from FRAME_FLAGS_AREA_COLS.
- (FRAME_FRINGE_WIDTH): Renamed from FRAME_FLAGS_AREA_WIDTH.
- (FRAME_LEFT_FRINGE_WIDTH): Renamed from FRAME_LEFT_FLAGS_AREA_WIDTH.
-
- * msdos.c: Comment fix.
-
- * w32fns.c: Use renamed symbols.
-
- * w32term.c: Comment fixes. Use renamed symbols.
- (fringe_bitmap_type): Renamed from bitmap_type.
- (NO_FRINGE_BITMAP): Renamed from NO_BITMAP.
- (w32_draw_fringe_bitmap): Renamed from w32_draw_bitmap.
- (x_draw_row_fringe_bitmaps): Renamed from x_draw_row_bitmaps.
-
- * w32term.h: Comment fixes. Use renamed symbols.
- (fringes_extra): Renamed from flags_areas_extra.
- (FRAME_FRINGE_BITMAP_WIDTH): Renamed from FRAME_FLAGS_BITMAP_WIDTH.
- (FRAME_FRINGE_BITMAP_HEIGHT): Renamed from FRAME_FLAGS_BITMAP_HEIGHT.
- (FRAME_X_FRINGE_COLS): Renamed from FRAME_X_FLAGS_AREA_COLS.
- (FRAME_X_FRINGE_WIDTH): Renamed from FRAME_X_FLAGS_AREA_WIDTH.
- (FRAME_X_LEFT_FRINGE_WIDTH):
- Renamed from FRAME_X_LEFT_FLAGS_AREA_WIDTH.
- (FRAME_X_RIGHT_FRINGE_WIDTH):
- Renamed from FRAME_X_RIGHT_FLAGS_AREA_WIDTH.
-
- * widget.c: Use renamed symbols.
-
- * window.c: Comment fixes. Use renamed symbols.
- (coordinates-in-window-p): Doc fix.
-
- * xdisp.c: Comment fixes. Use renamed symbols.
-
- * xfaces.c (realize_basic_faces): Use FRINGE_FACE_ID.
-
- * xfns.c: Use renamed symbols.
-
- * xterm.c: Comment fixes. Use renamed symbols.
- (fringe_bitmap_type): Renamed from bitmap_type.
- (NO_FRINGE_BITMAP): Renamed from NO_BITMAP.
- (x_draw_fringe_bitmap): Renamed from x_draw_bitmap.
- (x_draw_row_fringe_bitmaps): Renamed from x_draw_row_bitmaps.
-
- * xterm.h: Comment fixes. Use renamed symbols.
- (fringes_extra): Renamed from flags_areas_extra.
- (FRAME_FRINGE_BITMAP_WIDTH): Renamed from FRAME_FLAGS_BITMAP_WIDTH.
- (FRAME_FRINGE_BITMAP_HEIGHT): Renamed from FRAME_FLAGS_BITMAP_HEIGHT.
- (FRAME_X_FRINGE_COLS): Renamed from FRAME_X_FLAGS_AREA_COLS.
- (FRAME_X_FRINGE_WIDTH): Renamed from FRAME_X_FLAGS_AREA_WIDTH.
- (FRAME_X_LEFT_FRINGE_WIDTH):
- Renamed from FRAME_X_LEFT_FLAGS_AREA_WIDTH.
- (FRAME_X_RIGHT_FRINGE_WIDTH):
- Renamed from FRAME_X_RIGHT_FLAGS_AREA_WIDTH.
-
-2001-11-15 Jason Rumney <[email protected]>
-
- * w32menu.c (add-menu-item): Make help_echo and radio buttons
- work for most menu items. From David Ponce
-
-2001-11-15 Gerd Moellmann <[email protected]>
-
- * xfns.c (x_set_frame_parameters): Revert change of 2001-11-07.
- Some x_set_* function expect to be called even if old and new
- value are equal.
-
- * xdisp.c (build_desired_tool_bar_string): Accept zero
- tool_bar_button_relief.
-
- * xfns.c (Fx_create_frame): Accept zero tool_bar_button_relief.
-
- * xterm.c (x_draw_image_relief): Accept zero tool_bar_button_relief.
-
- * xterm.c (x_draw_bar_cursor): If the background color of the
- glyph under the cursor equals the frame's cursor color, use
- the glyph's foreground color for drawing the bar cursor.
-
- * dispnew.c (direct_output_forward_char): Fix character/byte
- position comparison.
-
-2001-11-15 Miles Bader <[email protected]>
-
- * editfns.c (find_field): Add BEG_LIMIT and END_LIMIT parameters.
- (Fdelete_field, Ffield_string, Ffield_string_no_properties):
- Update arguments to find_field.
- (Ffield_beginning, Ffield_end): Add LIMIT param, pass to find_field.
- (Fconstrain_to_field): Use LIMIT arg to shorten search time.
- * lisp.h (Ffield_beginning, Ffield_end): Update EXFUN decl.
- * minibuf.c (Fminibuffer_prompt_end): Update args to Ffield_end.
-
-2001-11-14 Richard M. Stallman <[email protected]>
-
- * editfns.c (Fpropertize): Allow call with 1 arg.
-
- * dispextern.h (image_background, image_background_transparent):
- Conditionalize on HAVE_X_WINDOWS.
-
-2001-11-13 Richard M. Stallman <[email protected]>
-
- * print.c (Fprin1_to_string): Doc fix.
-
- * sunfns.c (Fsun_change_cursor_icon): Doc fix.
-
- * floatfns.c (Fceiling, Ffloor): Doc fixes.
-
- * filelock.c (Funlock_buffer, Ffile_locked_p): Doc fixes.
-
- * fileio.c (Ffile_accessible_directory_p): Doc fix.
-
- * eval.c (syms_of_eval): Doc fix.
-
- * coding.c (syms_of_coding): Doc fix.
-
- * doc.c (Fsnarf_documentation): Doc fix.
-
- * dispnew.c (syms_of_display): Doc fix.
-
- * category.c (Fget_unused_category): Doc fix.
-
- * buffer.c (syms_of_buffer): Doc fixes.
-
-2001-11-14 Eli Zaretskii <[email protected]>
-
- * print.c (prin1, print): Doc fix.
-
-2001-11-14 Pavel Jan,Am(Bk <[email protected]>
-
- * fontset.h: Remove declarations of variables
- `Vhighlight_wrong_size_font' and `Vclip_large_size_font'.
-
- * fontset.c: Remove variables `Vhighlight_wrong_size_font' and
- `Vclip_large_size_font'.
-
-2001-11-13 Jason Rumney <[email protected]>
-
- * w32fns.c: Doc fix.
-
-2001-11-13 Pavel Jan,Am(Bk <[email protected]>
-
- * xfaces.c (Fface_attributes_as_vector): Doc fix.
-
- * fns.c: Doc fix.
-
- * emacs.c: Doc fix.
-
- * coding.c: Doc fix.
-
- * cmds.c, composite.c, dired.c, doc.c, filelock.c, floatfns.c,
- * fontset.c, insdel.c, keymap.c: Change doc-string comments to
- `new style' [w/`doc:' keyword].
-
-2001-11-12 Richard M. Stallman <[email protected]>
-
- * xterm.c (XTread_socket): Don't update focus for EnterNotify or
- LeaveNotify events. Only FocusIn and FocusOut do that now.
- (x_display_and_set_cursor): Do display hollow cursors in active
- minibuffer windows when they are not selected.
-
-2001-11-12 Jason Rumney <[email protected]>
-
- * w32console.c, w32fns.c, w32menu.c, w32proc.c, w32select.c,
- * w32term.c: Change doc-string comments to `new style'
- [w/`doc:' keyword]. Doc fixes.
-
- * w32fns.c: Don't define max.
- (Fx_open_connection): Only execute once.
-
-2001-11-12 Pavel Jan,Am(Bk <[email protected]>
-
- * ccl.c: Change macros to use do-while block instead of if-else.
- Use braces to follow GNU Coding Standards.
-
-2001-11-11 Richard M. Stallman <[email protected]>
-
- * sysdep.c (child_setup_tty): Don't clear ICRNL or INLCR.
-
- * lread.c (read_escape): Use end_of_file_error for reporting eof.
-
- * insdel.c (replace_range): Use adjust_markers_for_replace
- instead of adjust_markers_for_delete and adjust_markers_for_insert.
-
- * intervals.h (set_text_properties, set_text_properties_1): Declare.
-
- * textprop.c (set_text_properties_1): New subroutine
- broken out of set_text_properties.
- (set_text_properties): Use set_text_properties_1.
-
- * intervals.c (graft_intervals_into_buffer):
- Use set_text_properties_1 to clear out properties.
-
- * search.c (Freplace_match): Use replace_range to insert
- and delete. Don't request property inheritance from
- surrounding text.
-
-2001-11-10 Jason Rumney <[email protected]>
-
- * w32fns.c (enum_font_cb2): Use leading @ on face name to detect
- vertical fonts. Allow them if face name is explicitly specified.
- Do not give up if we find a font that cannot be converted to an xlfd.
-
-2001-11-10 Gerd Moellmann <[email protected]>
-
- * unexelf.c (unexec): Use mmap/munmap to allocate buffers
- instead of malloc/free.
-
-2001-11-09 Pavel Jan,Am(Bk <[email protected]>
-
- * xfaces.c (merge_face_vectors): Use braces to follow GNU
- Coding Standards.
- (Finternal_set_lisp_face_attribute): Likewise.
-
- * buffer.c (Fbury_buffer): Likewise.
-
- * indent.c (current_column_1): Remove unused variable `prev_col'.
-
- * coding.c (encode_coding): Use precomputed value of `src'.
- (encode_coding): Remove unused variable `src_end'.
- (code_convert_region): Remove unused variables `count'.
-
-2001-11-07 Jason Rumney <[email protected]>
-
- * w32term.c (x_display_and_set_cursor): Do not move system caret
- if cursor_glyph is NULL.
-
-2001-11-07 Pavel Jan,Am(Bk <[email protected]>
-
- * keymap.c (access_keymap): Fix compilation error.
-
-2001-11-07 Miles Bader <[email protected]>
-
- * xfns.c (x_set_frame_parameters): Avoid infinite recursion.
-
-2001-11-07 Pavel Jan,Am(Bk <[email protected]>
-
- * intervals.c (graft_intervals_into_buffer):
- Remove #ifdef'd-out code.
- (graft_intervals_into_buffer): Remove unused variable `middle'.
-
- * lread.c (Feval_region): Remove obsolete #ifdef'd-out
- code (eval-current-buffer).
- Change doc-string comments to `new style' [w/`doc:' keyword].
-
-2001-11-06 Richard M. Stallman <[email protected]>
-
- * keymap.c (access_keymap): Don't use initializers on Lisp_Object.
-
-2001-11-06 Stefan Monnier <[email protected]>
-
- * lread.c (read1): Fix behavior with nested backquoting.
-
- * keyboard.c (make_lispy_event): Check integerness and fix
- Lisp_Object/int mixup.
-
-2001-11-06 Pavel Jan,Am(Bk <[email protected]>
-
- * fns.c (copy_hash_table): Remove unused variable `v'.
-
- * fontset.c (fontset_font_pattern): Remove unused variable
- `family_registry'.
-
- * indent.c (current_column_1): Remove unused variable `prev_col'.
-
-2001-11-05 Richard M. Stallman <[email protected]>
-
- * m/news-risc.h (BROKEN_PROTOTYPES): Defined.
-
- * buffer.c (Fkill_buffer): Don't delete auto save file
- if buffer is modified.
-
-2001-11-05 Andrew Innes <[email protected]>
-
- * w32proc.c (Fw32_set_keyboard_layout): Use CHECK_NUMBER_CAR and
- CHECK_NUMBER_CDR.
-
-2001-11-05 Richard M. Stallman <[email protected]>
-
- * unexelf.c (unexec): Minor changes; clean up comments.
-
-2001-11-05 Sam Steingold <[email protected]>
-
- * w32term.c (x_display_and_set_cursor): Fix w32 compilation error.
-
-2001-11-05 Andreas Schwab <[email protected]>
-
- * sound.c (sound_perror): Save errno from being clobbered.
-
-2001-11-05 Dale Hagglund <[email protected]>
-
- * unexelf.c (unexec): Don't use `mmap'. Instead, read and write
- the program image directly.
-
-2001-11-05 Pavel Jan,Am(Bk <[email protected]>
-
- * buffer.h (Fbuffer_local_value): Add prototype.
-
-2001-11-04 Richard M. Stallman <[email protected]>
-
- * buffer.c (Fbuffer_local_value): Remove extra args from CHECK_SYMBOL
- and CHECK_BUFFER.
-
- * keyboard.c (read_char): Use Fcar and Fcdr, not Fnth.
- (record_char): Likewise.
-
- * keyboard.c (make_lispy_event): Don't insist a drag event must
- move to a different buffer position. Instead, check for moving at
- least double_click_fuzz.
-
- * fns.c (Fmake_hash_table): Use XCAR and XCDR, not Fnth and Flength.
-
- * keyboard.c (echo-area-clear-hook): Undo Oct 29 change.
-
- * indent.c (current_column_1, Fmove_to_column): Separate the code
- for display-table glyphs from the code for buffer text, to fix
- bugs in the former.
-
-2001-11-04 Michael Welsh Duggan <[email protected]>
-
- * buffer.c (Fbuffer_local_value): New function.
- (syms_of_buffer): Defsubr it.
-
- * xterm.c, w32term.c (x_display_and_set_cursor): Use buffer-local
- value of `cursor-in-non-selected-windows'.
-
- * lisp.h (Qcursor_in_non_selected_windows): New declaration.
- * xdisp.c (Qcursor_in_non_selected_windows): New variable.
- (syms_of_xdisp): Initialize it.
-
-2001-11-04 Pavel Jan,Am(Bk <[email protected]>
-
- * xfns.c (Fx_create_frame): Doc fix.
-
- * coding.c: Change doc-string comments to `new style' [w/`doc:'
- keyword].
-
- * eval.c (top_level_value, top_level_set): Remove commented and
- #ifdef'd-out code.
- (Fdefvar): Fix usage in doc-string.
-
-2001-11-03 Richard M. Stallman <[email protected]>
-
- * xfns.c: Include unistd.h, if it exists.
-
- * editfns.c: Move the include of ctype.h after unistd.h.
-
- * gmalloc.c: Test BROKEN_PROTOTYPES.
-
-2001-11-03 Ken Raeburn <[email protected]>
-
- * lisp.h (CHECK_STRING_CAR): New macro.
- * lread.c (Fload): Use XSETCARFASTINT, XSETCDRFASTINT instead of
- treating XCAR and XCDR as lvalues.
- (openp): Use CHECK_STRING_CAR.
- (read_list): Use XSETCDR instead of treating XCDR as lvalue.
-
-2001-11-03 Eli Zaretskii <[email protected]>
-
- * s/sco5.h (sigprocmask_set): Declare as extern SIGMASKTYPE.
- (SIGMASKTYPE): Define.
-
- * syssignal.h (sigunblock): Don't define if already defined.
-
-2001-11-02 Pavel Jan,Am(Bk <[email protected]>
-
- * eval.c (debugger_may_continue, Vdebug_ignored_errors)
- (call_debugger, Fcondition_case, skip_debugger, unbind_to):
- Fix typos in comments.
-
- * mocklisp.c (Fml_defun, Fml_while, Fml_substr): Remove commented
- and #ifdef'd-out code.
- Fix and reindent comments.
-
- * mocklisp.h: Remove comment which is a copy of comment in mocklisp.c.
-
- * category.h (CHECK_CATEGORY, CHECK_CATEGORY_SET): Remove unused
- argument `i' in macros.
-
- * frame.h (CHECK_FRAME, CHECK_LIVE_FRAME): Remove unused argument
- `i' in macros.
-
- * lisp.h (CHECK_STRING_OR_BUFFER, CHECK_HASH_TABLE, CHECK_LIST)
- (CHECK_STRING, CHECK_CONS, CHECK_SYMBOL, CHECK_CHAR_TABLE)
- (CHECK_VECTOR, CHECK_VECTOR_OR_CHAR_TABLE, CHECK_BUFFER)
- (CHECK_WINDOW, CHECK_LIVE_WINDOW, CHECK_PROCESS, CHECK_NUMBER)
- (CHECK_NATNUM, CHECK_MARKER, CHECK_NUMBER_COERCE_MARKER)
- (CHECK_FLOAT, CHECK_NUMBER_OR_FLOAT)
- (CHECK_NUMBER_OR_FLOAT_COERCE_MARKER, CHECK_OVERLAY)
- (CHECK_NUMBER_CAR, CHECK_NUMBER_CDR): Remove unused argument `i'
- in macros.
-
- * abbrev.c, alloc.c, buffer.c, bytecode.c, callint.c, callproc.c,
- * casefiddle.c, category.c, ccl.c, charset.c, cmds.c, coding.c,
- * composite.c, data.c, dired.c, dispnew.c, doc.c, dosfns.c, emacs.c,
- * eval.c, fileio.c, filelock.c, fns.c, fontset.c, frame.c, frame.h,
- * indent.c, keyboard.c, keymap.c, lread.c, macros.c, marker.c,
- * minibuf.c, mocklisp.c, msdos.c, print.c, process.c, search.c,
- * sunfns.c, syntax.c, textprop.c, undo.c, w16select.c, w32console.c,
- * w32fns.c, w32menu.c, w32proc.c, w32select.c, window.c, xdisp.c,
- * xfaces.c, xmenu.c, xselect.c: Update usage of CHECK_ macros
- (remove unused second argument).
-
-2001-11-02 Stefan Monnier <[email protected]>
-
- * syntax.c (describe_syntax): New wrapper.
- (Finternal_describe_syntax_value): Rename from describe_syntax.
- Don't insert space at front and \n at the end.
- (syms_of_syntax): Defsubr Sinternal_describe_syntax_value.
-
- * regex.c (re_wctype): Try to fix some warnings.
- (regcomp, regexec): Don't forget the __restrict.
-
-2001-11-02 Richard M. Stallman <[email protected]>
-
- * textprop.c (Fget_char_property): Doc fix.
-
-2001-11-02 Pavel Jan,Am(Bk <[email protected]>
-
- * process.c (Fstart_process): Add usage to doc-string.
-
- * data.c (Fsetq_default): Ditto.
-
- * callint.c (Finteractive): Ditto.
-
-2001-11-01 Stefan Monnier <[email protected]>
-
- * macros.c: Don't include keymap.h any more.
-
-2001-11-01 Richard M. Stallman <[email protected]>
-
- * data.c (Fmake_local_variable): Doc fix.
-
- * eval.c (Frun_hooks, Frun_hook_with_args_until_failure): Doc fix.
- (Frun_hook_with_args_until_success, Frun_hook_with_args): Doc fix.
-
- * keymap.c (Fdescribe_buffer_bindings): Print character property
- bindings along with or instead of the buffer local map.
- Make the overriding maps override what they should.
-
-2001-11-01 Pavel Jan,Am(Bk <[email protected]>
-
- * window.c (grow_mini_window): Fix typo in comment.
-
-2001-11-01 Gerd Moellmann <[email protected]>
-
- * xterm.c (x_scroll_bar_create): Check for width and height > 0.
- (XTset_vertical_scroll_bar): Likewise.
-
- * xfns.c (x_build_heuristic_mask): Use four_corners_best
- instead of IMAGE_BACKGROUND.
-
- * xfns.c (four_corners_best): Reindent.
-
- * xfaces.c (Finternal_set_lisp_face_attribute_from_resource):
- Handle :box so that it is possible to specify sexprs.
-
-2001-10-31 Eli Zaretskii <[email protected]>
-
- * s/hpux11.h: New file.
-
-2001-10-31 Pavel Jan,Am(Bk <[email protected]>
-
- * emacs.c (USAGE1): Show command line option --no-window-system
- instead of --no-windows in usage.
- (standard_args): Rename --no-windows to --no-window-system.
- (bug_reporting_address): Follow Emacs coding conventions.
-
- * eval.c (Fcommandp): Doc fix.
- Change doc-string comments to `new style' [w/`doc:' keyword].
-
- * frame.c (Fframe_live_p): Doc fix.
-
- * buffer.c (selective-display-ellipses): Doc fix.
-
-2001-10-31 Gerd Moellmann <[email protected]>
-
- * lread.c (to_multibyte): Fix computation of new read_buffer_size.
-
- * xfaces.c (realize_x_face): If C is not a single-byte character,
- set the face's colors_copied_bitwise_p instead of the defaulted_p
- members which have a different meaning.
- (free_face_colors): Do nothing for a face whose colors have been
- copied bitwise.
-
- * dispextern.h (struct face) <colors_copied_bitwise_p>: New member.
-
-2001-10-31 Pavel Jan,Am(Bk <[email protected]>
-
- * marker.c, mocklisp.c: Change doc-string comments to `new style'
- [w/`doc:' keyword].
-
-2001-10-31 Gerd Moellmann <[email protected]>
-
- * fns.c (require_unwind): Return Lisp_Object.
-
-2001-10-31 Pavel Jan,Am(Bk <[email protected]>
-
- * keyboard.c (lucid-menu-bar-dirty-flag): Doc fix.
- (last-input-char): Revert doc-string to be the same as the
- doc-string of `last-input-event'.
-
- * xdisp.c: Fix typos in comments.
-
-2001-10-31 Gerd Moellmann <[email protected]>
-
- * window.c (grow_mini_window): Handle case that the root
- window is already smaller than the nominal mininum height.
-
-2001-10-30 Stefan Monnier <[email protected]>
-
- * emacs.c (main): Don't call keys_of_macros any more.
-
- * lisp.h (keys_of_macros): Remove.
-
- * macros.c (keys_of_macros): Remove.
-
- * xfaces.c (Fface_attribute_relative_p): Declare args.
-
-2001-10-30 Jason Rumney <[email protected]>
-
- * w32fns.c (w32_to_x_charset): Increase size of XLFD charset buffer.
- (enum_font_cb2): Ignore fonts with vertical orientation.
-
-2001-10-30 Richard M. Stallman <[email protected]>
-
- * keyboard.c (Finput_pending_p): Doc fix.
-
-2001-10-30 Gerd Moellmann <[email protected]>
-
- * xterm.c (x_after_update_window_line): Don't run the code
- clearing in borders for rows whose visible height is 0.
-
- * xdisp.c (clear_garbaged_frames): Redraw the frame only if its
- resized_p flag is set. If not set, use the much less flickering
- method previously used.
-
- * dispnew.c (change_frame_size_1): Set frame's resized_p.
-
- * frame.h (struct frame) <resized_p>: New member.
-
- * lread.c (to_multibyte): Ensure read_buffer is at least twice
- as large as the number of bytes to convert.
-
- * lread.c (to_multibyte): New function.
- (read1): Use it.
-
-2001-10-30 Eli Zaretskii <[email protected]>
-
- * msdos.h (FRAME_LINE_HEIGHT): Define (it's used by xmenu.c).
-
-2001-10-30 Gerd Moellmann <[email protected]>
-
- * xterm.c (x_draw_relief_rect): Correct bottom relief by 1 pixel.
- (x_set_glyph_string_background_width): Set extends_to_end_of_line_p
- if the row's fill_line_p is set and drawing the last glyph with
- DRAW_IMAGE_{RAISED,SUNKEN}.
-
- * xdisp.c (clear_garbaged_frames): Call Fredraw_frame.
-
-2001-10-29 Stefan Monnier <[email protected]>
-
- * xmenu.c: Include coding.h and charset.h.
- (Fx_popup_menu): Use FRAME_PTR and FRAME_FONT and FRAME_LINE_HEIGHT.
- (Fx_popup_dialog): Use FRAME_PTR and enum scroll_bar_part.
- (single_submenu, xmenu_show): Use ENCODE_SYSTEM.
- Explicitly set wv->help. Use `TRUE' rather than `True'.
- (menu_help_callback): Use empty_string.
-
- * w32menu.c (Fx_popup_menu): Explicitly init f, xpos, and ypos.
- (Fx_popup_dialog): Explicitly init f.
- (w32_menu_display_help): Use empty_string.
-
-2001-10-29 Richard M. Stallman <[email protected]>
-
- * fns.c (Frequire): Detect recursive try to require the same
- feature 3 or more levels deep, and get error.
- (require_unwind): New subroutine.
- (require_nesting_list): New variable.
- (syms_of_fns): Init and staticpro it.
-
- * print.c (print_object): Clarify indication of insertion type.
-
-2001-10-29 Eli Zaretskii <[email protected]>
-
- * coding.c (syms_of_coding): Document that locale-coding-system is
- used for decoding input on X.
-
- * window.c (Fscroll_left, Fscroll_right): Doc fix.
-
-2001-10-29 Pavel Jan,Am(Bk <[email protected]>
-
- * keyboard.c (Finput_pending_p): Fix typo in doc-string.
- (echo-area-clear-hook): Properly DEFVAR_LISP and staticpro it.
-
-2001-10-29 Gerd Moellmann <[email protected]>
-
- * xterm.c (x_display_and_set_cursor): If cursor_in_echo_area,
- use NO_CURSOR if cursor_in_non_selected_windows is false.
-
- * xfaces.c (Fface_font): Use UNSPECIFIEDP instead of NILP for
- the slant attribute if FRAME is t.
-
- * xfns.c (x_set_internal_border_width): Set frame garbaged
- when X window doesn't exist yet.
-
- * xterm.c (x_after_update_window_line): Clear internal border
- in different circumstances.
-
- * xterm.c (XTread_socket) <KeyPress>: Don't use
- STRING_CHAR_AND_LENGTH if nchars == nbytes. From Kenichi Handa
-
-2001-10-28 Eli Zaretskii <[email protected]>
-
- * m/ibms390.h: New file. From Adam Thornton
-
-2001-10-28 Gerd Moellmann <[email protected]>
-
- * xfns.c (x_build_heuristic_mask): Use x_alloc_image_color.
-
- * xfns.c (x_build_heuristic_mask): Fix a bug not incrementing
- a loop counter.
-
-2001-10-28 Pavel Jan,Am(Bk <[email protected]>
-
- * emacs.c: Use argv[0] instead of "emacs" when -t was specified.
-
- * keyboard.c: Change doc-string comments to `new style' [w/`doc:'
- keyword].
- Fix typos in comments.
-
- * emacs.c (bug_reporting_address): New function.
- Use it when displaying usage message.
-
- * minibuf.c (read_minibuf): Remove unused external declaration of
- variable `Qread_only'.
-
- * keymap.c (access_keymap): Remove unused variable `charset'.
-
-2001-10-28 Miles Bader <[email protected]>
-
- * xfaces.c (merge_face_heights): Handle TO being relative as well.
- Remove #ifdef'd-out code.
- (Fface_attribute_relative_p, Fmerge_face_attribute): New functions.
- (syms_of_xfaces): Initialize them.
-
-2001-10-27 Jason Rumney <[email protected]>
-
- * w32fns.c (w32_wnd_proc) <WM_KILLFOCUS>: Destroy the system caret.
- <WM_EMACS_DESTROY_CARET, WM_EMACS_TRACK_CARET>: Track cursor
- position using the system caret.
-
- * w32term.c (w32_system_caret_hwnd, w32_system_caret_width)
- (w32_system_caret_height, w32_system_caret_x)
- (w32_system_caret_y): New variables for tracking system caret.
- (w32_initialize): Initialize them.
- (x_display_and_set_cursor): Make system caret follow the active cursor.
-
- * w32term.h (WM_EMACS_TRACK_CARET, WM_EMACS_DESTROY_CARET):
- New messages types.
-
- * w32term.c (note_mouse_highlight): Clear old help_echo.
-
-2001-10-27 Pavel Jan,Am(Bk <[email protected]>
-
- * xterm.c: Fix typo in a comment.
-
- * emacs.c: Fix typos in comments.
- Remove unnecessary spaces.
- Change doc-string comments to `new style' [w/`doc:' keyword].
- (USAGE2): Fix typos in usage string.
-
- * xterm.c: Fix typo in a comment.
-
- * lisp.h (gdb_lisp_params): Remove code in #if 0 which is now in
- emacs.c.
-
-2001-10-27 Gerd Moellmann <[email protected]>
-
- * xdisp.c (move_it_vertically_backward): Use 2/3 line_height
- instead of 1/2 line_height in the heuristic for skipping
- farther backward when target_y was not reached.
-
- * sound.c (sound_perror): Unblock SIGIO, turn on atimers.
- Display errno only if non-zero.
- (sound_warning): New function.
- (vox_configure): Don't treat failing to set sample rate as error.
- (various places): Improve error messages.
-
-2001-10-26 Eli Zaretskii <[email protected]>
-
- * fileio.c (Faccess_file): Run the argument filename through
- Fexpand_file_name, before using it.
-
- * dispnew.c (syms_of_display) <visible-bell>: Add a reference to
- ring-bell-function. Suggested by Alf-Ivar Holm <[email protected]>
-
-2001-10-26 Gerd Moellmann <[email protected]>
-
- * insdel.c (insert_1_both): Do nothing if NCHARS == 0.
-
- * xterm.c (XTset_vertical_scroll_bar) [!USE_TOOLKIT_SCROLL_BARS]:
- Fix clearing in the case of scroll bars on the right.
-
-2001-10-26 Juanma Barranquero <[email protected]>
-
- * w32gui.h (XImage): Add a dummy typedef.
-
-2001-10-26 Gerd Moellmann <[email protected]>
-
- * xfns.c (XScreenNumberOfScreen): Fix struct to pointer comparison.
-
-2001-10-25 Eli Zaretskii <[email protected]>
-
- * frame.c (Fframe_parameter): Fix last change.
-
- * fileio.c: Revert last change (which removed old commented-out
- version of expand-file-name). Add a comment that explains why
- this old version should not be removed.
-
-2001-10-25 Gerd Moellmann <[email protected]>
-
- * frame.c (Fframe_parameter): Fix a bug whereby some
- ``artificial'' frame parameters, like `minibuffer' were not
- obtained by calling Fframe_parameters.
-
- * xterm.c (show_mouse_face): Clean up. Recognize overwritten
- cursor differently.
-
- * xdisp.c (move_it_vertically_backward): Compute line height
- differently. Add heuristic to try to be more compatible to 20.x.
-
-2001-10-25 Stefan Monnier <[email protected]>
-
- * lisp.h (make_fixnum_or_float): Coerce double to int explicitly.
-
- * editfns.c (text_property_stickiness): Fix Lisp_Object used as
- boolean.
-
-2001-10-25 Miles Bader <[email protected]>
-
- * xfns.c (png_load): Make sure SPECIFIED_BG is a string.
- BG is a pointer to a structure, not a structure.
- (gif_format, png_format): Add missing commas.
-
-2001-10-24 Richard M. Stallman <[email protected]>
-
- * xfaces.c (Fface_attributes_as_vector): New function.
- (syms_of_xfaces): Defsubr it.
-
-2001-10-24 Pavel Jan,Am(Bk <[email protected]>
-
- * dispnew.c (sync_window_with_frame_matrix_rows): Remove unused
- variable `area'.
-
-2001-10-25 Pavel Jan,Am(Bk <[email protected]>
-
- * search.c (scan_newline): Remove unused variable `selective_display'.
-
-2001-10-25 Miles Bader <[email protected]>
-
- * dispextern.h (struct image): Add `background',
- `background_valid', and `background_transparent' fields.
- (image_background, image_background_transparent): New declarations.
- (IMAGE_BACKGROUND, IMAGE_BACKGROUND_TRANSPARENT): New macros.
- * xfns.c (image_background, image_background_transparent)
- (four_corners_best): New functions.
- (xpm_format, png_format, jpeg_format, tiff_format, gif_format)
- (gs_format): Add `:background' entry.
- (lookup_image): Set IMG's background color if specified.
- (pbm_load, xbm_load_image, png_load): Set IMG's background field
- when appropriate.
- (x_clear_image_1): Reset `background_valid' and
- `background_transparent_valid' fields.
- (x_build_heuristic_mask): Use IMAGE_BACKGROUND instead of
- calculating it here. Set IMG's background_transparent field.
- (enum xpm_keyword_index): Add XPM_BACKGROUND.
- (enum png_keyword_index): Add PNG_BACKGROUND.
- (enum jpeg_keyword_index): Add JPEG_BACKGROUND.
- (enum tiff_keyword_index): Add TIFF_BACKGROUND.
- (enum gif_keyword_index): Add GIF_BACKGROUND.
- (enum gs_keyword_index): Add GS_BACKGROUND.
- (pbm_load, png_load, jpeg_load, tiff_load, gif_load):
- Pre-calculate image background color where necessary.
- * xterm.c (x_setup_relief_colors): Use `IMAGE_BACKGROUND' and
- `IMAGE_BACKGROUND_TRANSPARENT' to calculate the correct background
- color to use for image glyph reliefs.
-
-2001-10-24 Gerd Moellmann <[email protected]>
-
- * xterm.c (x_draw_glyphs): Don't check for cursor overwriting
- in full-width rows.
-
- * xterm.c (XTset_vertical_scroll_bar) [!USE_TOOLKIT_SCROLL_BARS]:
- Fix clearing of area not covered by scroll bar.
-
-2001-10-24 Pavel Jan,Am(Bk <[email protected]>
-
- * xterm.c (x_insert_glyphs): Remove unused variables `real_end'
- and `real_start'.
- (x_draw_image_foreground): Remove unused variables `mask' and `xgcv'.
- (glyph_rect): Remove unused variable `area'.
-
-2001-10-24 Gerd Moellmann <[email protected]>
-
- * xdisp.c: Change #ifdef GLYPH_DEBUG to #if.
-
- * xdisp.c (try_window_reusing_current_matrix): Use row_containing_pos.
- (row_containing_pos): Take additional argument DY.
- Treat rows ending in middle of char differently.
- (display_line): Handle tabs on window systems differently.
-
- * xterm.c, w32term.c (fast_find_position): Call row_containing_pos
- with additional argument.
-
- * dispextern.h (row_containing_pos): Adjust prototype.
-
- * xdisp.c (inhibit_try_window_id, inhibit_try_window_reusing)
- (inhibit_try_cursor_movement) [GLYPH_DEBUG]: New variables.
- (try_window_id, try_window_reusing_current_matrix)
- (try_cursor_movement) [GLYPH_DEBUG]: Don't run if inhibited.
- (syms_of_xdisp) [GLYPH_DEBUG]: DEFVAR_BOOL the variables.
-
-2001-10-24 Pavel Jan,Am(Bk <[email protected]>
-
- * xmenu.c: Spell the name of Emacs properly (GNU Emacs instead of
- gnuemacs).
- (HAVE_BOXES): Fix typo in comment.
- (push_menu_pane): Fix typo in comment.
-
- * xdisp.c (display_prop_string_p): Remove unused local declaration
- of `Qwhen'.
- (single_display_prop_string_p): Remove unused local declarations
- of `Qwhen' and `Qmargin'.
- (string_buffer_position): Remove unused variable `around'.
- (store_frame_title): Remove unused variable `width'.
-
- * window.c: Don't define max.
- (coordinates_in_window): Remove unused variable `uy'.
-
- * widget.c: Don't define max.
-
- * process.c: Don't define max.
- (create_process): Remove unused variable `buffer'.
-
-2001-10-23 Gerd Moellmann <[email protected]>
-
- * xfaces.c (Finternal_set_lisp_face_attribute): Fix compilation error.
-
-2001-10-23 Eli Zaretskii <[email protected]>
-
- * xfaces.c (Finternal_set_lisp_face_attribute)
- [HAVE_WINDOW_SYSTEM]: Don't do anything for QCfont unless the
- frame is on a windowed display.
-
-2001-10-23 Gerd Moellmann <[email protected]>
-
- * dispnew.c (sync_window_with_frame_matrix_rows):
- Fix handling of windows which aren't full-width, fix handling
- of marginal areas.
-
- * lread.c (syms_of_lread) <recursive-load-depth-limit>: Raise to 50.
-
-2001-10-23 Andreas Schwab <[email protected]>
-
- * m/macppc.h [LINUX]: Undef LD_SWITCH_SYSTEM_TEMACS and override
- LD_SWITCH_MACHINE_TEMACS with "-Xlinker -znocombreloc".
-
-2001-10-23 Gerd Moellmann <[email protected]>
-
- * xterm.c (x_draw_glyphs): Remove parameters READ_START and
- REAL_END. Notice if cursor gets overwritten.
- (notice_overwritten_cursor): Take X positions as parameters.
- (x_draw_phys_cursor_glyph): Save state of w->phys_cursor_on_p
- around call to x_draw_glyphs.
-
-2001-10-23 Pavel Jan,Am(Bk <[email protected]>
-
- * syntax.c (modify-syntax-entry): Fix argument names (use CHAR
- instead of C) and usage.
-
- * editfns.c (char-to-string): Fix argument names (use CHAR instead
- of C) and usage.
-
- * xfns.c (Fx_show_tip): Remove unused variables `buffer', `top',
- `left', `max_width' and `max_height'.
-
-2001-10-23 Gerd Moellmann <[email protected]>
-
- * xdisp.c (display_line): For a tab continued to the next line,
- set row's ends_in_middle_of_char_p.
-
-2001-10-22 Gerd Moellmann <[email protected]>
-
- * xdisp.c (display_line): Fix computation of continuation lines
- width for TABs.
-
-2001-10-22 Pavel Jan,Am(Bk <[email protected]>
-
- * xdisp.c (build_desired_tool_bar_string): Remove unused variable
- `Qlaplace'.
-
- * fileio.c: Remove unused code.
-
-2001-10-22 Miles Bader <[email protected]>
-
- * lisp.h (DEFVAR_LISP, DEFVAR_LISP_NOPRO, DEFVAR_BOOL)
- (DEFVAR_INT, DEFVAR_PER_BUFFER, DEFVAR_KBOARD):
- Remove `DOC_STRINGS_IN_COMMENTS' cases.
-
-2001-10-21 Jason Rumney <[email protected]>
-
- * w32term.c (x_erase_phys_cursor): Remove inverse_p again.
-
-2001-10-21 Eli Zaretskii <[email protected]>
-
- * mocklisp.c (Fml_if, Fml_provide_prefix_argument)
- (Finsert_string): Avoid the multi-line string literals warning.
-
-2001-10-22 Miles Bader <[email protected]>
-
- * doc.c (Vhelp_manyarg_func_alist): Variable removed.
- (Fdocumentation): Don't use it.
- (syms_of_doc): Don't initialize it.
-
- * keyboard.c (Ftrack_mouse): Add usage: string to doc string.
- * print.c (Fwith_output_to_temp_buffer): Likewise.
- * window.c (Fsave_window_excursion): Likewise.
- * editfns.c (Fsave_excursion, Fsave_current_buffer)
- (Fsave_restriction): Likewise.
- * eval.c (Frun_hooks, Frun_hook_with_args)
- (Frun_hook_with_args_until_failure)
- (Frun_hook_with_args_until_success, Ffuncall, For, Fand, Fif)
- (Fcond, Fprogn, Fprog1, Fprog2, Fsetq, Fquote, Ffunction, Fdefun)
- (Fdefmacro, Fdefvar, Fdefconst, FletX, Flet, Fwhile, Fcatch)
- (Funwind_protect, Fcondition_case): Likewise.
- * coding.c (Ffind_operation_coding_system): Likewise.
- * keyboard.c (Ftrack_mouse): Likewise.
-
-2001-10-21 Miles Bader <[email protected]>
-
- * fns.c (Fappend, Fconcat, Fvconcat, Fnconc, Fwidget_apply)
- (Fmake_hash_table): Add usage: string to doc string.
- * editfns.c (Finsert, Finsert_and_inherit, Finsert_before_markers)
- (Fmessage, Fmessage_box, Fmessage_or_box, Fpropertize, Fformat)
- (Fencode_time, Finsert_and_inherit_before_markers): Likewise.
- * mocklisp.c (Finsert_string, Fml_if, Fml_provide_prefix_argument)
- (Fml_prefix_argument_loop): Likewise.
-
-2001-10-21 Pavel Jan,Am(Bk <[email protected]>
-
- * fileio.c (Finsert_file_contents): Remove unused variable `gap_size'.
-
- * sysdep.c (init_sys_modes): Change doc-string comments to `new
- style' [w/`doc:' keyword].
-
- * data.c, fileio.c, indent.c, print.c, search.c, sound.c,
- * sunfns.c, textprop.c, undo.c, xselect.c: Change doc-string
- comments to `new style' [w/`doc:' keyword].
-
-2001-10-21 Jason Rumney <[email protected]>
-
- * w32fns.c (Fx_file_dialog): Pass a filter to GetOpenFileName.
-
- * w32term.c (remember_mouse_glyph): New function.
- (w32_mouse_position): Use it.
- (note_mouse_movement): If the mouse moved off the glyph, remember
- its new position.
-
- * w32term.h (struct w32_output): Correct spelling of x_compatible.
- (w32_display_info): Add mouse_face_overlay.
-
- * w32term.c (notice_overwritten_cursor): Renamed from
- note_overwritten_text_cursor. Rewritten to take glyph widths into
- account.
- (x_y_to_hpos_vpos): Add parameter BUFFER_ONLY_P.
- (fast_find_string_pos): New function.
- (fast_find_position): Return the correct vpos. Add parameter
- STOP. In the final row, stop before glyphs having STOP as object.
- Don't consider glyphs that are not from a buffer.
- (fast_find_position) [0]: Add a presumably more correct version
- for after 21.1.
- (expose_window_tree, expose_frame): Don't compute intersections here.
- (expose_window): Do it here instead.
- (expose_window_tree, expose_window, expose_line): Return 1 when
- overwriting mouse-face.
- (expose_window): If W is the window currently being updated, mark
- the frame garbaged.
- (expose_frame): If mouse-face was overwritten, redo it.
- (x_use_underline_position_properties): New variable.
- (syms_of_xterm): DEFVAR_BOOL it.
- (x_draw_glyph_string): Add comment to use it in future.
- (x_draw_glyph_string): Restore clipping after drawing box.
- Fix a computation of the underline position.
- (w32_get_glyph_string_clip_rect): Minor cleanup.
- (x_fill_stretch_glyph_string): Remove an assertion.
- (x_produce_glyphs): Don't convert multibyte characters
- to unibyte characters in unibyte buffers.
- (cursor_in_mouse_face_p): New function.
- (x_draw_stretch_glyph_string): Use it to choose a different GC
- when drawing a cursor within highlighted text. Don't draw
- background again if it has already been drawn.
- (x_draw_glyph_string_box): Don't draw a full-width
- box just because the glyph row's full_width_p flag is set.
- (x_draw_glyphs): Fix computation of rightmost x for
- full-width rows.
- (x_dump_glyph_string): Put in #if GLYPH_DEBUG.
- (w32_draw_relief_rect): Extend left shadow to the bottom and left;
- change bottom shadow accordingly. Some cleanup.
- (x_update_window_end): Handle overwritten mouse face
- also for tool bar windows.
- (show_mouse_face): Set the glyph row's mouse_face_p flag also when
- DRAW is DRAW_IMAGE_RAISED.
- (clear_mouse_face): Return 1 if text with mouse face was
- actually redrawn. Make the function static.
- Reset dpyinfo->mouse_face_overlay otherwise note_mouse_highlight might
- optimize away highlighting if we pass over that same overlay again.
- (note_mouse_highlight): Call mouse_face_overlay_overlaps
- to detect a case where we have to highlight a different region
- despite not having left the currently highlighted region.
- Set mouse_face_overlay in the x_display_info. Avoid changing the
- mouse pointer shape when show_mouse_face has already done it, or
- there is no need. Handle mouse-face and help-echo in strings.
- (glyph_rect): New function.
- (w32_mouse_position): Use it to raise the threshold for mouse
- movement event generation.
- (w32_initialize_display_info): Initialize the x_display_info's
- mouse_face_overlay.
- (w32_set_vertical_scroll_bar): Don't clear a zero height
- or width area.
- (w32_set_vertical_scroll_bar, x_scroll_bar_create): Don't configure
- a widget to zero height.
-
- * w32menu.c (single_submenu, w32_menu_show) [!HAVE_MULTILINGUAL_MENU]:
- Protect unibyte strings created by replacing their multibyte
- equivalents in menu_items.
- (w32_menu_show): Don't overwrite an item's name with its key
- description in case the description is a multibyte string.
- (single_submenu): Some cleanup.
-
- * w32fns.c (x_laplace_read_row, x_laplace_write_row): Removed.
- (postprocess_image): New function.
- (lookup_image): Call it for all image types except PostScript.
- (x_kill_gs_process): Call postprocess_image.
- (tiff_error_handler, tiff_warning_handler): New functions.
- (tiff_load): Install them as handlers.
- (x_kill_gs_process): Recognize if someone has cleared the image
- cache under us.
- (valid_image_p): Protect better against invalid image
- specifications. Previous code could signal an error.
- (Fx_hide_tip, Fshow_tip): Doc fix.
- (Fv_max_tooltip_size): New variable.
- (syns_of_xfns): DEFVAR_LISP it.
- (Fx_show_tip): Add parameter TEXT. Set the tip frame's root
- window buffer to *tip* right after creating the frame. Set frame's
- window_width. Use a maximum tooltip size specified by
- Vx_max_tooltip_size, if that has valid contents.
- (compute_tip_xy): Add parameters WIDTH and HEIGHT.
- Make sure the tooltip is completely visible.
- (x_create_tip_frame): Set tooltip buffer's truncate-lines to nil.
- (Fx_create_frame): Adjust the frame's height for presence
- of the tool bar before calling x_figure_window_size.
- (x_set_tool_bar_lines): Clear the tool bar window's current matrix
- when the window gets smaller.
- (x_set_foreground_color): Set frame's cursor_pixel.
- (x_set_foreground_color, x_set_background_color): Cleaned up.
- (x_set_font): Handle case of x_new_fontset returning the same name
- as before, although there was a change in fontsets.
-
-2001-10-21 Miles Bader <[email protected]>
-
- * data.c (Fplus, Fminus, Fmax, Ftimes, Fquo, Flogand, Flogior)
- (Flogxor): Add usage: string to doc string.
- * charset.c (Fstring): Likewise.
- * callproc.c (Fcall_process_region, Fcall_process): Likewise.
- * alloc.c (Fmake_byte_code, Fvector, Flist): Likewise.
-
-2001-10-21 Pavel Jan,Am(Bk <[email protected]>
-
- * buffer.c: Reindent DEFUNs and DEFVARs with doc: keywords.
-
- * alloc.c: Reindent DEFUNs with doc: keywords.
-
- * abbrev.c (Finsert_abbrev_table_description): Reindent.
-
- * frame.c: Change doc-string comments to `new style' [w/`doc:'
- keyword].
-
-See ChangeLog.9 for earlier changes.
-
-;; Local Variables:
-;; coding: iso-2022-7bit
-;; add-log-time-zone-rule: t
-;; End:
-
- Copyright (C) 2001, 2002, 2003, 2004, 2005,
- 2006, 2007 Free Software Foundation, Inc.
-
- This file is part of GNU Emacs.
-
- GNU Emacs is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3, or (at your option)
- any later version.
-
- GNU Emacs is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GNU Emacs; see the file COPYING. If not, write to the
- Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-
-;;; arch-tag: 5dcc435f-4038-4141-b3bf-5be51cd76bd4
diff --git a/src/ChangeLog.unicode b/src/ChangeLog.unicode
new file mode 100644
index 0000000000..6331cc2dd8
--- /dev/null
+++ b/src/ChangeLog.unicode
@@ -0,0 +1,4732 @@
+2007-09-20 Kenichi Handa <[email protected]>
+
+ * keymap.c (where_is_internal_1): If key is a cons, store the copy
+ in sequence.
+
+ * chartab.c (map_sub_char_table): If the range contains just one
+ character, call the function with that character even if the depth
+ is not 3.
+ (map_char_table): Likewise.
+
+2007-09-19 Jason Rumney <[email protected]>
+
+ * w32font.c (w32font_text_extents): Calculate metrics for the
+ whole string.
+
+2007-09-15 Jason Rumney <[email protected]>
+
+ * w32xfns.c (get_next_msg): Consolidate WM_PAINT messages.
+
+2007-09-13 Jason Rumney <[email protected]>
+
+ * w32term.c (x_set_glyph_string_clipping): Use
+ get_glyph_string_clip_rects.
+ (x_set_glyph_string_clipping_exactly): Adjusted for the change of
+ struct glyph_string.
+ (x_draw_glyph_string): Likewise.
+
+ * w32font.c (w32font_draw): Do clipping here.
+
+2007-09-13 Kenichi Handa <[email protected]>
+
+ * xftfont.c (xftfont_draw): Adjusted for the change of struct
+ glyph_string.
+
+ * xterm.c (x_set_glyph_string_clipping): Use
+ get_glyph_string_clip_rects.
+ (x_set_glyph_string_clipping_exactly): Adjusted for the change of
+ struct glyph_string.
+ (x_draw_glyph_string): Likewise.
+
+ * xdisp.c (get_glyph_string_clip_rects): Reflect s->row->clip to
+ the resulting clip(s}.
+ (expose_overlaps): Add arg r. Callers changed. Set it ot
+ row->clip temporarily.
+ (expose_window): Redraw rows overlapping the exposed area.
+
+ * dispextern.h (struct glyph_row): New member clip.
+ (struct glyph_string): Delete members clip_x, clip_y, clip_width,
+ clip_height, new member clip, and num_clips.
+
+2007-09-07 Kenichi Handa <[email protected]>
+
+ * data.c (Fchar_or_string_p): Fix docstring.
+
+2007-08-22 Kenichi Handa <[email protected]>
+
+ * xftfont.c (xftfont_draw): If s->font_info != s->face->font_info,
+ create a temporal XftDraw object.
+
+2007-07-26 Kenichi Handa <[email protected]>
+
+ * font.c (Ffontp): Fix docstring.
+
+ * coding.c (detect_coding_iso_2022): Don't treat SI/SO codes as a
+ strong evidence of ISO-2022.
+
+2007-07-23 Kenichi Handa <[email protected]>
+
+ * abbrev.c (abbrev_check_chars): Use CHAR_TABLE_REF, not
+ SYNTAX_ENTRY_FOLLOW_PARENT.
+
+2007-06-29 Stefan Monnier <[email protected]>
+
+ * fns.c (weak_hash_tables): Rename from Vweak_hash_tables and change
+ its type.
+ (make_hash_table, copy_hash_table, sweep_weak_hash_tables, init_fns):
+ Update to the new type of weak_hash_tables and next_weak.
+
+ * lisp.h (struct Lisp_Hash_Table): Change next_weak from Lisp_Object to
+ a plain C pointer to Lisp_Hash_Table.
+
+ * lisp.h (XGCTYPE, GC_HASH_TABLE_P, GC_NILP, GC_NUMBERP, GC_NATNUMP)
+ (GC_INTEGERP, GC_SYMBOLP, GC_MISCP, GC_VECTORLIKEP, GC_STRINGP)
+ (GC_CONSP, GC_FLOATP, GC_VECTORP, GC_OVERLAYP, GC_MARKERP)
+ (GC_INTFWDP, GC_BOOLFWDP, GC_OBJFWDP, GC_BUFFER_OBJFWDP)
+ (GC_BUFFER_LOCAL_VALUEP, GC_SOME_BUFFER_LOCAL_VALUEP)
+ (GC_KBOARD_OBJFWDP, GC_PSEUDOVECTORP, GC_WINDOW_CONFIGURATIONP)
+ (GC_PROCESSP, GC_WINDOWP, GC_SUBRP, GC_COMPILEDP, GC_BUFFERP)
+ (GC_SUB_CHAR_TABLE_P, GC_CHAR_TABLE_P, GC_BOOL_VECTOR_P, GC_FRAMEP)
+ (GC_EQ): Remove since they've been identical to their non-GC_
+ alter-egos ever since the markbit was eradicated.
+
+ * src/alloc.c:
+ * src/buffer.c:
+ * src/buffer.h:
+ * src/data.c:
+ * src/fileio.c:
+ * src/filelock.c:
+ * src/fns.c:
+ * src/frame.h:
+ * src/lisp.h:
+ * src/macterm.c:
+ * src/print.c:
+ * src/process.c:
+ * src/w32fns.c:
+ * src/w32menu.c:
+ * src/w32term.c:
+ * src/xfns.c:
+ * src/xmenu.c:
+ * src/xterm.c: Replace uses of GC_* macros with the non-GC_ versions.
+
+2007-06-25 Kenichi Handa <[email protected]>
+
+ * chartab.c (map_sub_char_table): Make it work for the top-level
+ char-table. Fix handling of parent char-table.
+ (map_char_table): Adjust for the above change.
+
+2007-06-24 Jason Rumney <[email protected]>
+
+ * w32font.c (Qgdi): Rename from Qw32.
+
+2007-06-22 Jason Rumney <[email protected]>
+
+ * w32bdf.c (get_quoted_string): Make function static.
+
+2007-06-20 Kenichi Handa <[email protected]>
+
+ * xftfont.c (xftfont_open): If one of font's ASCII glyph has
+ bigger ascent and descent than those of the font, use them as
+ font's ascent and descent.
+
+2007-06-18 Kenichi Handa <[email protected]>
+
+ * Makefile.in (${lispsource}international/charprop.el): Move this
+ target within "#ifdef HAVE_UNIDATA" and "#endif".
+
+2007-06-16 Kenichi Handa <[email protected]>
+
+ * Makefile.in (lisp): Add ${lispsource}language/tai-viet.el.
+ (shortlisp): Add ../lisp/language/tai-viet.el.
+
+2007-06-15 Ulrich Mueller <[email protected]> (tiny change)
+
+ * Makefile.in (${lispsource}international/charprop.el): Depend on
+ temacs${EXEEXT}.
+
+2007-06-13 Jason Rumney <[email protected]>
+
+ * w32font.c (w32font_close): Delete the GDI font object.
+
+ * w32menu.c: Include character.h
+
+ * w32proc.c: Likewise.
+
+ * w32select.c: Likewise.
+
+ * makefile.w32-in (w32proc.o): Depend on character.h
+
+2007-06-11 Jason Rumney <[email protected]>
+
+ * w32fns.c (syms_of_w32fns): Use DEFSYM macro.
+
+ * w32menu.c (syms_of_w32menu): Likewise.
+
+ * w32proc.c (syms_of_ntproc): Likewise.
+
+ * w32select.c (syms_of_w32select): Likewise.
+
+ * w32term.c (syms_of_w32term): Likewise.
+
+2007-06-06 Jason Rumney <[email protected]>
+
+ * w32font.c (w32font_draw): Delete brush after using it.
+
+2007-06-04 Jason Rumney <[email protected]>
+
+ * w32font.c (w32font_open): Don't set font_idx.
+ (w32font_text_extents): Try GetTextExtentPoint32W before defaulting
+ to font settings.
+ (w32font_draw): Fill background explicitly.
+
+2007-06-03 Jason Rumney <[email protected]>
+
+ * w32term.c (w32_initialize): Don't call w32font_initialize.
+
+ * w32font.c (w32font_info): Remove subranges.
+ (QCsubranges, Qmodern, Qswiss, Qroman): Remove.
+ (QCfamily, Qmonospace, Qsans_serif, Qmono, Qsans, Qsans__serif)
+ (Qraster, Qoutline, Qlatin, Qgreek, Qcoptic, Qcyrillic, Qarmenian)
+ (Qhebrew, Qarabic, Qsyriac, Qnko, Qthaana, Qdevanagari, Qbengali)
+ (Qgurmukhi, Qgujarati, Qoriya, Qtamil, Qtelugu, Qkannada)
+ (Qmalayalam, Qsinhala, Qthai, Qlao, Qtibetan, Qmyanmar, Qgeorgian)
+ (Qhangul, Qethiopic, Qcherokee, Qcanadian_aboriginal, Qogham)
+ (Qrunic, Qkhmer, Qmongolian, Qsymbol, Qbraille, Qhan)
+ (Qideographic_description, Qcjk_misc, Qkana, Qbopomofo, Qkanbun)
+ (Qyi, Qbyzantine_musical_symbol, Qmusical_symbol, Qmathematical):
+ New symbols.
+ (font_callback_data): New struct.
+ (w32font_list, w32font_match): Use it.
+ (w32font_open): Don't populate subranges.
+ (w32font_has_char): Use script Lisp symbols, not subrange bitmask.
+ (w32font_encode_char): Always return unicode code-point as-is.
+ (w32font_text_extents): Supply a tranformation matrix to
+ GetGlyphOutline. Never look up by glyph index. Avoid looping
+ twice. Use unicode version of GetTexExtentPoint32 instead of
+ glyph index version.
+ (set_fonts_frame): Remove
+ (w32_enumfont_pattern_entity): Add frame parameter, use it to
+ set frame parameter. Use backward compatible fake foundries.
+ Save generic family in extra slot under QCfamily. Make width slot
+ constant. Save QCspacing value. Save list of scripts instead of
+ binary subranges.
+ (w32_generic_family, logfonts_match, font_matches_spec): New functions.
+ (add_font_entity_to_list): Use font_callback_data struct. Filter
+ unwanted fonts.
+ (add_one_font_entity_to_list): Use font_callback_data struct.
+ (w32_registry): Default to iso10646_1;
+ (fill_in_logfont): Use dpi from extra slot. Don't bother with
+ string font registries. Don't fill in font name if it is a generic
+ family name, fill family instead. Use spacing, family and script
+ extra info to fill pitch, family and charset fields.
+ (list_all_matching_fonts): Use font_callback_data struct.
+ (unicode_range_for_char): Remove.
+ (font_supported_scripts): New function.
+ (w32font_initialize): Remove.
+ (syms_of_w32font): Update which symbols are defined.
+
+2007-06-02 Jason Rumney <[email protected]>
+
+ * font.c (font_pixel_size): Reverse assq_no_quit args.
+
+ * w32term.h (FONT_WIDTH): Report max width, not average.
+ (FONT_MAX_WIDTH): Remove.
+ (FONT_AVG_WIDTH): New macro.
+
+ * xfaces.c (Fx_list_fonts) [WINDOWSNT]: Remove Windows only
+ redefinition of FONT_WIDTH.
+
+ * w32term.c (x_font_min_bounds): Use FONT_AVG_WIDTH.
+ (w32_cache_char_metrics): Use FONT_WIDTH.
+
+ * w32fns.c (w32_load_system_font, w32_list_fonts): Use FONT_AVG_WIDTH.
+
+2007-06-01 Jason Rumney <[email protected]>
+
+ * w32font.c (w32font_open): Make lfHeight negative.
+
+ * w32fns.c (x_default_font_parameter): Use new style font name.
+ (Fx_create_frame, x_create_tip_frame): Initialize resx and resy.
+
+2007-05-31 Jason Rumney <[email protected]>
+
+ * w32font.c (QCsubranges): New symbol.
+ (w32font_open, w32font_has_char): Get subranges from subproperty
+ of extra.
+ (w32_enumfont_pattern_entity): Set subranges as subproperty of extra.
+ (syms_of_w32font): Define :subranges symbol.
+
+ * font.c (font_put_extra): Expose externally.
+
+ * font.h (font_put_extra): Moved declaration from font.c.
+
+ * font.c (Ffont_get): Use font driver to determine otf capability.
+ (adjust_anchor): Check if driver defines anchor_point before using.
+
+ * w32font.c (w32font_open): Handle size, height and pixel_size better.
+ (w32font_draw): Use options.
+ (w32_enumfont_pattern_entity): Set size to 0 for scalable fonts.
+ Fix detection of truetype fonts.
+ (registry_to_w32_charset): Handle charsets other than iso8859-1
+ expressed as lisp symbols.
+ (w32_registry): Express charset as lisp symbol.
+ (fill_in_logfont): Reverse pixel and point height logic.
+ Don't set width here. Set quality to default.
+
+ * w32fns.c (w32_load_system_font): Fix detecting FIXED_PITCH fonts.
+ (x_to_w32_font): Fill in lfPitchAndFamily correctly.
+
+ * xterm.c (x_draw_glyph_string_foreground) [USE_FONT_BACKEND]:
+ Remove redundant loop and allocation.
+
+ * makefile.w32-in (font.o, w32font.o): New objects.
+ (fontset.o, xdisp.o, xfaces.o, w32fns.o, w32term.o): Depend on font.h
+ (FONTOBJ): New group of objects conditioned on USE_FONT_BACKEND.
+
+ * xdisp.c (fill_composite_glyph_string): Make the first arg to
+ STORE_XCHARB a valid l-value.
+
+ * w32term.c (w32_native_per_char_metric): Swap width and rbearing
+ calculations for non-Truetype fonts.
+ (x_draw_glyph_string): Sync with xterm.c.
+ (x_draw_glyph_string_foreground) [USE_FONT_BACKEND]: Remove
+ redundant code.
+ (w32_initialize) [USE_FONT_BACKEND]: Call w32font_initialize.
+
+ * w32term.h (w32_output_data) [USE_FONT_BACKEND]: Add fontp member.
+ (FRAME_FONT_OBJECT) [USE_FONT_BACKEND]: New macro from xterm.h.
+
+ * w32fns.c [USE_FONT_BACKEND]: Port font backend changes from xfns.c.
+ (x_to_w32_charset, w32_to_x_charset): Expose externally.
+
+ * w32font.c: New file for w32 font backend.
+
+2007-05-28 Kenichi Handa <[email protected]>
+
+ * term.c: Don't include "buffer.h" twice.
+
+2007-05-21 Kenichi Handa <[email protected]>
+
+ * syntax.c (skip_syntaxes): Synch with the trunk.
+
+2007-05-14 Kenichi Handa <[email protected]>
+
+ * character.c (Funibyte_string): New function.
+ (syms_of_character): Defsubr it.
+
+2007-05-01 Jason Rumney <[email protected]>
+
+ * w32term.c [USE_FONT_BACKEND]:
+ (x_get_font_repertory, note_mouse_movement, x_set_mouse_face_gc):
+ (x_set_glyph_string_clipping, x_set_glyph_string_clipping_exactly):
+ (x_draw_glyph_string, x_draw_glyph_string_foreground):
+ (x_draw_composite_glyph_string_foreground, x_new_fontset2):
+ (x_free_frame_resources): Sync with xterm.c.
+
+2007-04-29 Andreas Schwab <[email protected]>
+
+ * lread.c (read1): Use CHAR_TABLE_STANDARD_SLOTS to validate
+ char-table size.
+
+2007-04-26 Kenichi Handa <[email protected]>
+
+ * font.c (check_otf_features): Define it regardless of
+ HAVE_LIBOTF.
+
+2007-04-25 Kenichi Handa <[email protected]>
+
+ * ftfont.c (ftfont_driver): Delete font_otf_gsub and
+ font_otf_gpos, add font_drive_otf.
+
+ * fontset.c (fontset_find_font): Pay attention to font size
+ specified for a font.
+ (reorder_font_vector): Check contents of font_def.
+
+ * font.c (struct otf_list): Delete it.
+ (otf_list): Make it a lisp variable..
+ (otf_open): Use lispy otf_list.
+ (generate_otf_features): Renamed from parse_gsub_gpos_spec.
+ (check_otf_features): New function.
+ (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor): New
+ functinos.
+ (font_drive_otf): New function merging font_otf_gsub and
+ font_otf_gpos.
+ (font_open_for_lface): New arg spec. Change argument order.
+ (font_load_for_face): Adjusted for the change of
+ font_open_for_lface.
+ (Ffont_drive_otf): New function merging Ffont_otf_gsub and
+ Ffont_otf_gpos.
+ (syms_of_font): Staticpro otf_list. Delete defsubr of
+ Sfont_otf_gsub and Sfont_otf_gpos. Defsubr Sfont_drive_otf.
+
+ * xfaces.c (set_font_frame_param): Adjusted for the change of
+ font_open_for_lface.
+
+ * font.h (font_open_for_lface): Adjust prototype.
+ (struct font_driver): Delete members otf_gsub and otf_gpos, add
+ member otf_drive.
+ (font_otf_gsub, font_otf_gpos): Delete externs.
+ (font_drive_otf): Extern it.
+
+2007-04-24 Kenichi Handa <[email protected]>
+
+ * font.c (font_at): If the window W is not on a window system,
+ return Qnil.
+
+ * coding.c (produce_chars): Don't call insert_from_gap if no
+ characters to produce.
+ (encode_coding): Likewise.
+
+2007-04-17 Kenichi Handa <[email protected]>
+
+ * fontset.c (free_realized_fontsets): Avoid unnecessary call of
+ Fclear_face_cache.
+
+ * xfaces.c (face_for_font): Check also face->font==font->font.font.
+
+2007-04-16 Miles Bader <[email protected]>
+
+ * emacs.c (main): Change default value of `enable_font_backend' to 1.
+ Parse "--disable-font-backend" option.
+ (standard_args): Add "--disable-font-backend" option.
+
+2007-04-13 Kenichi Handa <[email protected]>
+
+ * fontset.c (fontset_find_font): New function.
+ (fontset_font): Use fontset_find_font.
+ (make_fontset_for_ascii_face): Don't set face ID in rfont_def.
+ Register the specified font for all Latin characters.
+ (new_fontset_from_font): Register the specified font for all Latin
+ characters.
+ (dump_fontset): For a realized fontset, include the base fontset
+ name in the returned vector.
+
+2007-04-11 Kenichi Handa <[email protected]>
+
+ * character.h (CHAR_STRING): Cast C to unsigned on calling
+ char_string.
+
+ * character.c (char_string): Type of arg C changed to unsigned.
+ Signal an error if C is an invalid character code.
+
+ * editfns.c (general_insert_function): Use CHARACTERP, not INTEGERP.
+ (Fchar_to_string): Likewise.
+
+2007-03-23 Kenichi Handa <[email protected]>
+
+ * character.h (MIN_MULTIBYTE_LEADING_CODE)
+ (MAX_MULTIBYTE_LEADING_CODE): New macros.
+
+ * regex.c (analyse_first): Fix for multibyte characters in "case
+ charset:" and "case categoryspec:".
+
+2007-03-04 Andreas Schwab <[email protected]>
+
+ * Makefile.in (LIBES): Move standard libraries to the end.
+
+2007-02-27 Kenichi Handa <[email protected]>
+
+ * process.c: Cancel the change done by sync with HEAD.
+
+2007-02-23 Kenichi Handa <[email protected]>
+
+ * alloc.c (Fgarbage_collect): If nextb->text->inhibit_shrinking is
+ nonzero, don't shrink the buffer nextb.
+
+ * buffer.h (struct buffer_text): New member inhibit_shrinking.
+
+ * coding.c (coding_alloc_by_making_gap): New arg offset.
+ (alloc_destination): Call coding_alloc_by_making_gap with the arg
+ offset.
+ (decode_coding_iso_2022): Update coding->safe_charsets.
+ (decode_coding_gap): Temporarily set
+ current_buffer->text->inhibit_shrinking to 1.
+
+2007-02-20 Kenichi Handa <[email protected]>
+
+ * xterm.c (x_draw_composite_glyph_string_foreground): Fix
+ indexing into elements of s->cmp and s->char2b.
+
+2007-02-16 Juanma Barranquero <[email protected]>
+
+ * regex.c (RE_STRING_CHAR_AND_LENGTH) [! emacs]: Add missing arg `len'.
+
+2007-02-16 Kenichi Handa <[email protected]>
+
+ * regex.c (GET_CHAR_BEFORE_2, GET_CHAR_AFTER): Check the variable
+ target_multibyte instead of multibyte.
+ (re_match_2_internal): Call bcmp_translate with target_multibyte.
+ (bcmp_translate): Change the argument name from multibyte to
+ target_multibyte.
+
+2007-02-15 Kenichi Handa <[email protected]>
+
+ These changes are to compile a regexp into a pattern that can be
+ used both for multibyte and unibyte targets.
+
+ * Makefile.in (search.o): Depend on charset.h.
+
+ * character.c (multibyte_char_to_unibyte_safe): New function.
+
+ * search.c: Include "charset.h".
+ (compile_pattern_1): Delete argument multibyte. Don't set
+ cp->buf.target_multibyte here. Set cp->buf.charset_unibyte.
+ (compile_pattern): Don't compare cp->buf.target_multibyte.
+ Compare cp->buf.charset_unibyte.
+ (compile_pattern): Set cp->buf.target_multibyte.
+
+ * lisp.h (multibyte_char_to_unibyte_safe): Extern it.
+
+ * regex.h (struct re_pattern_buffer): New member charset_unibyte.
+
+ * regex.c (RE_STRING_CHAR, RE_STRING_CHAR_AND_LENGTH): New arg
+ multibyte. Callers changed.
+ (RE_CHAR_TO_MULTIBYTE, RE_CHAR_TO_UNIBYTE): New macros.
+ (MAKE_CHAR_MULTIBYTE, MAKE_CHAR_UNIBYTE): Deleted. Callers
+ changed to use RE_CHAR_TO_MULTIBYTE and RE_CHAR_TO_UNIBYTE
+ respectively.
+ (SETUP_ASCII_RANGE, SETUP_UNIBYTE_RANGE): New macros.
+ (SETUP_MULTIBYTE_RANGE): Generate a more compact range_table.
+ (regex_compile): Make the compiled pattern usable both for
+ multibyte and unibyte targets.
+ (analyse_first): Make the fastmap usable both for multibyte and
+ unibyte targets.
+ (TRANSLATE_VIA_MULTIBYTE): Deleted.
+ (re_match_2_internal): Pay attention to the case that the
+ multibyteness of bufp and target may be different.
+
+2007-02-14 Kenichi Handa <[email protected]>
+
+ * xdisp.c (x_produce_glyphs): When a font is not found, make the
+ empty box occupy at least one column width.
+
+2007-01-30 Miles Bader <[email protected]>
+
+ * Makefile.in: Remove redundant HAVE_XFT clause.
+
+2006-12-20 Kenichi Handa <[email protected]>
+
+ * xrdb.c (x_load_resources): Setup the default fontSet X reource.
+
+2006-12-15 Kenichi Handa <[email protected]>
+
+ * regex.c (regex_compile): Synch with HEAD.
+
+2006-12-12 Kenichi Handa <[email protected]>
+
+ * fontset.c (Finternal_char_font): Fix previous change.
+
+2006-12-07 Kenichi Handa <[email protected]>
+
+ * fontset.c (Finternal_char_font): Fix for the case of POSITION
+ being nil.
+
+2006-12-06 Kenichi Handa <[email protected]>
+
+ * xftfont.c (xftfont_open): Call FcConfigSubstitute.
+
+2006-12-05 Kenichi Handa <[email protected]>
+
+ * xftfont.c (xftfont_open): Don't enable antialias explicitly.
+
+2006-11-30 Kenichi Handa <[email protected]>
+
+ * search.c (simple_search): Fix previous change.
+
+2006-11-29 Kenichi Handa <[email protected]>
+
+ * xftfont.c (ftfont_font_format): Extern declaration.
+
+ * frame.c (x_set_font): Fix the second arg to fs_query_fontset.
+
+ * xfont.c (xfont_driver): Initialize ftfont_driver.type by 0.
+ (xfont_list): Don't directly use Lisp_Object as an operand of &&.
+
+ * ftfont.c (ftfont_driver): Initialize ftfont_driver.type by 0.
+ (ftfont_font_format): Fix previous change.
+
+ * font.h (Ffont_xlfd_name): EXFUN it.
+
+ * font.c (font_parse_xlfd): Fix the array size of `f'.
+ (register_font_driver): Use EQ to compare driver->type.
+
+ * xfns.c (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
+ (create_frame_xic) [USE_FONT_BACKEND]: Call xic_create_xfontset2.
+ (xic_set_xfontset) [USE_FONT_BACKEND]: Likewise.
+
+2006-11-27 Kenichi Handa <[email protected]>
+
+ * ftfont.c (ftfont_pattern_entity): Check if FC_FONTFORMAT is
+ defined.
+ (ftfont_list_generic_family, ftfont_list, ftfont_font_format):
+ Likewise.
+
+2006-11-24 Kenichi Handa <[email protected]>
+
+ * xfont.c (xfont_open): Set font->format.
+
+ * xftfont.c (xftfont_open): Set font->format.
+
+ * ftfont.c (ftfont_pattern_entity): Add fontformat in a pattern.
+ (ftfont_list): Include FC_FONTFORMAT in FcObject.
+ (ftfont_open): Set font->format.
+ (ftfont_font_format): New function.
+
+ * font.h (struct font): New memeber format.
+
+ * font.c (Qopentype): New variable.
+ (syms_of_font): Defsym it.
+ (Fquery_font): Change the format of the last element of the return
+ value.
+
+2006-11-22 Kenichi Handa <[email protected]>
+
+ * search.c (simple_search): Fix sync with HEAD.
+
+2006-11-17 Kenichi Handa <[email protected]>
+
+ * xfns.c (xic_create_xfontset): Try the default fontset name as a
+ last resort.
+
+2006-11-08 Kenichi Handa <[email protected]>
+
+ * coding.c (detect_coding_charset): Fix detection of multi-byte
+ charset.
+
+2006-11-07 Bob Halley <[email protected]> (tiny change)
+
+ * ccl.c (ccl_driver): If DST is NULL, set ccl->produced to 0.
+
+2006-10-31 Kenichi Handa <[email protected]>
+
+ * xdisp.c (get_next_display_element): Set it->face_id for the
+ first component of a composition.
+ (x_produce_glyphs): Check if the font is changed or not for
+ composition.
+
+2006-10-31 Kenichi Handa <[email protected]>
+
+ (get_next_display_element): Set it->face_id for the
+ first component of a composition.
+ (x_produce_glyphs): Check if the font is changed or not for
+ composition.
+
+2006-10-30 Kenichi Handa <[email protected]>
+
+ * fontset.c (Qlatin): New variable.
+ (syms_of_fontset): Define it as a lisp symbol.
+ (Fset_fontset_font): If TARGET is `latin', use FONT_SPEC for
+ ASCII.
+
+2006-10-27 Kenichi Handa <[email protected]>
+
+ * font.c (font_unparse_fcname): Pay attention to the case that
+ some of font property is a null string.
+
+2006-10-26 Kenichi Handa <[email protected]>
+
+ * term.c: Include "composite.h".
+ (encode_terminal_code): Output all components of composition.
+ Check the size of encode_terminal_src.
+ (produce_glyphs): For compostion, call produce_composite_glyph.
+ (append_composite_glyph, produce_composite_glyph): New functions.
+
+ * xdisp.c (x_produce_glyphs): In handling composition, if a font
+ is not found, get font_info from the current ascii face.
+
+2006-10-23 Kenichi Handa <[email protected]>
+
+ * fileio.c (Finsert_file_contents): On replacing, temporarily bind
+ buffer-file-name to Qnil before calling insert_from_buffer.
+
+ * font.c (font_unparse_fcname): Pay attention to the case that
+ foundry is a null string.
+
+2006-10-17 Kenichi Handa <[email protected]>
+
+ * ftfont.c (ftfont_list): Allow registry "unicode-sip".
+
+ * font.c (Qunicode_sip): New variable.
+ (syms_of_font): Declare it as a Lisp symbol.
+
+ * font.h (Qunicode_sip): Extern it.
+
+2006-10-16 Kenichi Handa <[email protected]>
+
+ * composite.c (get_composition_id): Pay attention to TAB
+ component.
+
+ * xterm.c (x_draw_composite_glyph_string_foreground): Don't draw
+ TAB. Adjusted for the change of s->char2b which always points to
+ the first elememnt of allocated memory.
+
+ * xftfont.c (xftfont_text_extents): Fix calculation of descent
+ value.
+
+ * xdisp.c (handle_composition_prop): Set it->c to the first
+ non-TAB component.
+ (fill_composite_glyph_string): Argument changed.
+ (BUILD_COMPOSITE_GLYPH_STRING): Adjusted for the above change.
+ (x_produce_glyphs): Fix handling of left/right padding.
+
+2006-10-04 Kenichi Handa <[email protected]>
+
+ * regex.c (analyse_first): Cancel the change for synching with
+ HEAD.
+
+2006-08-28 Kenichi Handa <[email protected]>
+
+ * coding.c (detect_coding_system): Fix for handling off
+ inhibit_iso_escape_detection. Fix for the case that no coding
+ system is defined for a specific coding category.
+
+2006-08-21 Kenichi Handa <[email protected]>
+
+ * font.c (font_matching_entity): Dolete unused local var.
+
+ * xftfont.c (xftfont_open): Call XftDefaultSubstitute before
+ opening a font.
+
+ * fileio.c (Finsert_file_contents): On recovering a file, assume
+ Unix-like eol.
+ (choose_write_coding_system): On auto-saving a file, force
+ Unix-like eol.
+
+ * coding.c (setup_coding_system): Fix setting of
+ coding->common_flags based on eol_type.
+ (coding_inherit_eol_type): If PARENT is not nil, be sure to
+ inherit from it.
+
+2006-08-04 Kenichi Handa <[email protected]>
+
+ * alloc.c (NSTATICS): Increased to 0x600.
+
+2006-08-01 Kenichi Handa <[email protected]>
+
+ * ftfont.c (ftfont_driver): Set ftfont_driver.match to
+ ftfont_match.
+ (ftfont_list): Don't check :name property.
+ (ftfont_match): New function.
+ (ftfont_pattern_entity): If the pattern doesn't contain
+ FC_SPACING, don't assuce FC_MONO.
+
+ * font.h (struct font_driver): New member `match'.
+ (font_update_drivers): Prototype adjusted.
+
+ * font.c (font_parse_fcname): Don't change :name property of FONT.
+ (font_parse_name): Likewise.
+ (LGSTRING_HEADER_SIZE, LGSTRING_GLYPH_SIZE, check_gstring): Define
+ them unconditionally.
+ (font_matching_entity): New function.
+ (font_open_by_name): Try font_matching_entity if exact match is
+ not found.
+ (font_update_drivers): Delete the arg FONT. Return a list of
+ actually used backends. Don't free faces, font caches here.
+ Don't store data in frame parameters. Don't call x_set_font.
+ (Ffont_spec): Store :name property as is.
+ (Ffont_get): Check HAVE_LIBOTF before calling font_otf_capability.
+ (Ffont_otf_gsub): Call font->driver->otf_gsub instead of
+ font_otf_gsub.
+ (Ffont_otf_gpos): Call font->driver->otf_gpos instead of
+ font_otf_gpos.
+ (Ffont_otf_alternates): Check if the driver has otf_gsub function.
+ Call font->driver->otf_gsub instead of font_otf_gsub.
+
+ * frame.c (x_set_font_backend): Do more works that were done in
+ font_update_drivers before.
+
+ * xfont.c (xfont_match): New function.
+ (xfont_driver): Set xfont_driver.match to xfont_match.
+ (xfont_draw): Set font in GC if necessary.
+
+ * ftxfont.c (ftxfont_match): New function.
+ (syms_of_ftxfont): Set ftxfont_driver.match to ftxfont_match.
+
+ * xftfont.c (xftfont_match): New function.
+ (syms_of_xftfont): Set xftfont_driver.match to xftfont_match.
+
+2006-07-28 Kenichi Handa <[email protected]>
+
+ * font.h (struct font): New member scalable.
+ (struct font_driver): New arg ALTERANTE_SUBST to otf_gsub.
+ (font_otf_gsub): Prototype adjusted.
+
+ * font.c (font_otf_capability): Fix handling of the default
+ langsys.
+ (parse_gsub_gpos_spec): Type changed to void. New arg nbytes.
+ Check the contents of SPEC.
+ (LGSTRING_HEADER_SIZE, LGSTRING_GLYPH_SIZE): New macros.
+ (check_gstring): New function.
+ (REPLACEMENT_CHARACTER): New macro.
+ (font_otf_gsub): New arg alternate_subst. Be sure to set all
+ glyph codes of GSTRING.
+ (font_otf_gpos): Be sure to set all glyph codes of GSTRING.
+ (font_prepare_composition): Set cmp->glyph_len.
+ (font_open_entity): Set font->scalable.
+ (Ffont_get): Handle :otf property.
+ (Ffont_otf_gsub, Ffont_otf_gpos, Ffont_otf_alternates): New
+ functions.
+ (Fquery_font): Use font->font.full_name.
+ (syms_of_font): Defsubr Sfont_otf_gsub, Sfont_otf_gpos, and
+ Sfont_otf_alternates.
+
+ * ftfont.c (ftfont_open): Set font->font.full_name and
+ font->font.name properly. Fix calculation of font->font.height
+ and font->min_width.
+
+ * ftxfont.c (ftxfont_create_gcs): New function.
+ (ftxfont_draw_bitmap): Fix arg to ftfont_driver.get_bitmap.
+ (ftxfont_draw_backgrond): Fix filling region.
+ (ftxfont_default_fid): New function.
+ (ftxfont_open): Set xfotn->fid to the return value of
+ ftxfont_default_fid.
+ (ftxfont_prepare_face): Use ftxfont_create_gcs to create GCs.
+ (ftxfont_done_face): Free only GCs that are created by
+ ftxfont_create_gcs.
+ (ftxfont_draw): If face->gc != s->gc, create proper GCs.
+
+ * xterm.c (x_set_glyph_string_clipping_exactly) [USE_FONT_BACKEND]:
+ Clip to src->width, etc (not src->clip_XXX).
+
+ * xfns.c (x_create_tip_frame) [USE_FONT_BACKEND]: Handle
+ FontBackend frame parameter.
+
+2006-07-26 Kenichi Handa <[email protected]>
+
+ * font.h (struct font_driver_list): New member `on'.
+ (Fclear_font_cache): EXFUN it.
+ (font_update_drivers): Extern it.
+
+ * font.c (font_unparse_fcname): Fix typo (swidth->width).
+ (font_list_entities): Check driver_list->on.
+ (register_font_driver): Initalize `on' member to 0.
+ (font_update_drivers): New function.
+ (Fclear_font_cache): Check driver_list->on.
+
+ * frame.h (Qfont_backend): Extern it.
+ (x_set_font_backend): Extern it.
+
+ * frame.c (Qfont_backend): New variable.
+ (frame_parms): New element for font-backend.
+ (x_set_font_backend): New function.
+
+ * xfns.c (Fx_create_frame) [USE_FONT_BACKEND]: Handle
+ FontBackend frame parameter.
+ (x_frame_parm_handlers) [USE_FONT_BACKEND]: New element
+ x_set_font_backend.
+
+ * xfont.c (xfont_list): Don't try listing by :name property if the
+ name is not for XLFD.
+
+2006-07-24 Kenichi Handa <[email protected]>
+
+ * font.h (LGLYPH_FROM, LGLYPH_TO, LGLYPH_SET_FROM)
+ (LGLYPH_SET_TO): New macros.
+ (LGLYPH_XOFF, LGLYPH_YOFF, LGLYPH_WADJUST): Check if adjustment
+ element of G is vector or not.
+ (font_at): Extern it.
+
+ * font.c: Include window.h.
+ (font_lispy_object): New function.
+ (font_prepare_composition): Check LGLYPH_FORM (g) to detect the
+ end of valid glyph.
+ (font_close_object): Fix getting (struct font *).
+ (font_at): New function.
+ (Ffont_get): If FONT is a font-object, get entity from it.
+ (Ffont_make_gstring): Initialize elements of glyphs with nil.
+ (Ffont_fill_gstring): Use macro LGSTRING_XXX and LGLYPH_XXX. Fix
+ range check.
+ (Ffont_at): New function.
+ (syms_of_font): Defsubr Sfont_at.
+
+ * xdisp.c (it_props): Move the entry for Qauto_composed to just
+ before the entry for Qcompostion.
+ (handle_auto_composed_prop): Call auto-composition-function with 4
+ args.
+ (handle_composition_prop) [USE_FONT_BACKEND]: Set it->face_id from
+ the font in gstring.
+ (fill_composite_glyph_string) [USE_FONT_BACKEND]: Check
+ LGLYPH_FORM (g) to detect the end of valid glyph.
+ (x_produce_glyphs) [USE_FONT_BACKEND]: Don't update it->face_id if
+ we are composing with gstring.
+
+ * xterm.c (x_draw_composite_glyph_string_foreground) [USE_FONT_BACKEND]:
+ Check if adjustment is vector or not.
+
+ * Makefile.in (font.o): Make it depends on window.h.
+
+2006-07-24 Kenichi Handa <[email protected]>
+
+ * xterm.c (x_draw_composite_glyph_string_foreground): Check if
+ adjustment is vector or not.
+
+2006-07-20 Kenichi Handa <[email protected]>
+
+ * casefiddle.c (casify_object): Sync with HEAD.
+
+2006-07-18 Miles Bader <[email protected]>
+
+ * character.h (CHECK_CHARACTER): Redefine in terms of CHECK_TYPE.
+
+2006-07-14 Kenichi Handa <[email protected]>
+
+ * font.h (LGLYPH_XOFF, LGLYPH_YOFF, LGLYPH_WIDTH, LGLYPH_WADJUST)
+ (LGLYPH_SET_WIDTH): Adjusted for the change of LGLYPH format.
+ (LGLYPH_ADJUSTMENT, LGLYPH_SET_ADJUSTMENT): New macros.
+
+ * font.c (font_merge_old_spec): Treat '*' in foundry as a wild
+ card.
+ (DEVICE_DELTA): Fix typo.
+ (font_otf_gpos): Adjusted for the change of LGLYPH format.
+ (font_prepare_composition): Likewise.
+
+ * xterm.c (x_draw_composite_glyph_string_foreground): Adjusted for
+ the change of LGLYPH format.
+
+2006-07-07 Kenichi Handa <[email protected]>
+
+ * ftfont.c (ftfont_list): Fix typo.
+ (ftfont_build_basic_charsets): Don't include letters with
+ diactrics.
+
+2006-07-09 Jan Dj,Ad(Brv <[email protected]>
+
+ * xfaces.c (realize_non_ascii_face): Set face->extra to NULL.
+
+ * xftfont.c (xftfont_done_face): Call XftDrawDestroy only if
+ xftface_info is non-NULL.
+
+2006-07-07 Kenichi Handa <[email protected]>
+
+ * ftfont.c (ftfont_list): Fix typo.
+ (ftfont_build_basic_charsets): Don't include letters with
+ diactrics.
+
+2006-07-05 Jan Dj,Ad(Brv <[email protected]>
+
+ * ftfont.c (ftfont_list): Move misplaced #endif
+
+2006-07-05 Kenichi Handa <[email protected]>
+
+ * ftfont.c (ftfont_list): Pay attention to the case that
+ FC_CAPABILITY is not defined.
+
+2006-07-03 Kenichi Handa <[email protected]>
+
+ * xftfont.c (xftfont_open): Set charset related members to -1.
+
+ * ftfont.c (ftfont_list): Handle QCotf property. Handling of
+ QCname fixed.
+ (ftfont_open): Set charset related members to -1.
+
+ * fontset.c (Votf_script_alist): New variable.
+ (syms_of_fontset): Initialize it.
+ (fontset_font): Delete unused variable.
+
+ * fontset.h (Votf_script_alist): Extern it.
+
+ * font.c (font_find_for_lface): Code optimized.
+
+ * font.h (font_close_object, font_merge_old_spec): Extern them.
+
+2006-06-28 Kenichi Handa <[email protected]>
+
+ * font.c (QCscalable, Qc, Qm, Qp, Qd): New variables.
+ (syms_of_font): Initialize them.
+ (font_pixel_size): Allow float value in dpi.
+ (font_prop_validate_type): Deleted.
+ (font_prop_validate_symbol, font_prop_validate_style): Argument
+ changed. Caller changed.
+ (font_prop_validate_non_neg): Renamed from
+ font_prop_validate_size.
+ (font_prop_validate_extra): Deleted.
+ (font_prop_validate_spacing): New function.
+ (font_property_table): Add elements for all known properties.
+ (get_font_prop_index): Renamed from check_font_prop_name. New
+ argument FROM. Caller changed.
+ (font_prop_validate): Validate all known properties.
+ (font_put_extra): Argument force deleted. Caller changed.
+ (font_expand_wildcards): Make it static. Fix the way of shrinking
+ the possible range.
+ (font_parse_xlfd): Arguemnt merge deleted. Fix handling of RESX,
+ RESY, SPACING, and AVGWIDTH. Don't validate property values here.
+ Caller changed.
+ (font_unparse_xlfd): Handle dpi, spacing, and scalable properties.
+ (font_parse_fcname): Arguemnt merge deleted. Fix parsing of point
+ size. Don't validate properties values here. Caller changed.
+ (font_unparse_fcname): Handle dpi, spacing, and scalable
+ properties.
+ (font_open_by_name): Delete unused variable.
+ (Ffont_spec): Likewise. Validate property values.
+ (Ffont_match_p): New function.
+
+ * font.h (QCscalable): Extern it.
+ (font_parse_xlfd, font_parse_fcname): Prototype adjusted.
+
+ * ftfont.c (ftfont_list): Handle properties dpi, spacing, and
+ scalable.
+
+ * xfont.c (xfont_query_font): Adjusted for the change of
+ font_parse_xlfd.
+ (xfont_list_pattern): New function.
+ (xfont_list): Use xfont_list_pattern.
+
+ * xftfont.c (xftfont_prepare_face): Cancel previous change.
+ (xftfont_done_face): Likewise.
+
+2006-06-26 Kenichi Handa <[email protected]>
+
+ * font.h (Flist_fonts): EXFUN it.
+
+2006-06-25 Jason Rumney <[email protected]>
+
+ * w32term.c (w32_initialize): Add back smoothing_type and
+ smoothing_enabled definitions.
+
+2006-06-23 Kenichi Handa <[email protected]>
+
+ * xterm.c (x_draw_glyph_string) [USE_FONT_BACKEND]: Check
+ s->face->font on determining underline position.
+
+2006-06-21 Kenichi Handa <[email protected]>
+
+ * font.c (font_parse_xlfd): Fix generating of CHARSET_REGISTRY field.
+ (font_has_char): Accept font-object too.
+ (font_find_for_lface): Try at first with a size specified in face.
+
+ * xftfont.c (xftfont_prepare_face): Make non-ascii face share
+ face->extra with ascii face.
+ (xftfont_done_face): Don't free face->extra of non-ascii face.
+
+2006-06-20 Kenichi Handa <[email protected]>
+
+ * frame.c (x_set_font) [USE_FONT_BACKEND]: Fix argument to
+ font_open_by_name.
+
+2006-06-19 Kenichi Handa <[email protected]>
+
+ * font.h (QCspacing, QCdpi): Extern them.
+ (enum font_spacing): New enum.
+ (FONT_PIXEL_SIZE_QUANTUM): New macro.
+
+ * font.c (POINT_TO_PIXEL): Don't divice POINT by 10.
+ (QCspacing, QCdpi): New variables.
+ (syms_of_font): Initialize them.
+ (font_pixel_size): New function.
+ (font_put_extra): New function.
+ (font_parse_xlfd): Fix handling of font size. Add QCdpi property
+ in FONT_EXTRA.
+ (font_parse_fcname): Handle enumenrated values (e.g. bold). Fix
+ handling font size. Add QCname property that contains only
+ unknown properties.
+ (font_score): Change argument. Caller changed. Pay attention to
+ FONT_PIXEL_SIZE_QUANTUM.
+ (font_sort_entites): Fix handling of font size.
+ (font_list_entities): Likewise.
+ (font_find_for_lface): Likewise.
+ (font_open_for_lface): Likewise.
+ (font_open_by_name): Likewise.
+ (Ffont_spec): Add QCname property that contains only unknown
+ properties.
+
+ * ftfont.c (ftfont_list): Use assq_no_quit, not Fassq. Don't
+ include weight in listing pattern, instead check weight of each
+ listed font. Don't include scalable in pattern. Pay attention to
+ FONT_PIXEL_SIZE_QUANTUM.
+
+2006-06-19 Kenichi Handa <[email protected]>
+
+ * lread.c (read_escape): Fix the code synched with HEAD.
+
+ * font.c (font_parse_fcname): Fix parsing of point-size.
+ (font_unparse_fcname): Produce symbolic names for style
+ properties.
+ (font_list_entities): Handle float size correctly.
+ (font_open_by_name): Prefer `normal' property values if the name
+ doesn't specify them.
+
+ * fontset.c (Finternal_char_font): Use font_get_name, not
+ Ffont_xlfd_name.
+
+ * ftfont.c (ftfont_pattern_entity): Use the numeric value 100 for
+ FC_WEIGHT_REGULAR. Exclude FC_SIZE and FC_PIXEL_SIZE from listing
+ pattern. Don't force scalable.
+
+ * xftfont.c (xftfont_open): For generating a name, start from
+ 96-byte buffer.
+
+2006-06-16 Jan Dj,Ad(Brv <[email protected]>
+
+ * frame.h (x_new_fontset2): Fix prototype.
+
+2006-06-16 Kenichi Handa <[email protected]>
+
+ * font.h (struct font_driver): Member parse_name deleted.
+ (font_match_p, font_get_spec, font_parse_fcname)
+ (font_unparse_fcname): Extern them.
+ (font_get_name): Prototype adjusted.
+
+ * font.c (XLFD_SMALLNUM_MASK): Delete this macro.
+ (XLFD_LARGENUM_MASK): Delete XLFD_ENCODING_MASK from it.
+ (font_expand_wildcards): Fix handling ENCODING field. Avoid
+ unnecessary checks for weight, slant, and swidth.
+ (font_parse_fcname): New function.
+ (font_unparse_fcname): New function.
+ (font_parse_name): New function.
+ (font_match_p): New function.
+ (font_get_name): Return value changed to Lisp string.
+ (font_get_spec): New function.
+ (Qunspecified, Qignore_defface): Don't extern them.
+ (font_find_for_lface): Assume that LFACE is fully specified.
+ (font_load_for_face): If lface[LFACE_FONT_INDEX] is an font
+ object, use it for FACE.
+ (font_open_by_name): Call Ffont_spec with QCname prop. Don't call
+ driver->parse_name.
+ (Ffont_spec): Call font_parse_name, not font_parse_xlfd.
+
+ * fontset.h (new_fontset_from_font) [USE_FONT_BACKEND]: Prototype
+ adjusted.
+
+ * fontset.c (new_fontset_from_font) [USE_FONT_BACKEND]: Argument F
+ deleted. Don't call Fnew_fontset. Instead, directly call
+ make_fontset.
+
+ * frame.h (x_new_fontset2) [USE_FONT_BACKEND]: Prototype adjusted.
+
+ * frame.c (x_set_font) [USE_FONT_BACKEND]: Adjusted for the change
+ of x_new_fontset2.
+
+ * ftfont.c (Qmonospace, Qsans_serif, Qserif, Qmono, Qsans)
+ (Qsans__serif): New variables.
+ (ftfont_generic_family_list): New variable.
+ (syms_of_ftfont): Initialize the above variables.
+ (ftfont_pattern_entity): Argument NAME deleted.
+ (ftfont_list_generic_family): New function.
+ (ftfont_parse_name): Delete this function.
+ (ftfont_list): Try generic family only when FcFontList found no
+ font.
+ (ftfont_list_family): Fix args to FcObjectSetBuild.
+
+ * xfaces.c (check_lface_attrs) [USE_FONT_BACKEND]: Accept font
+ object in attrs[LFACE_FONT_INDEX].
+ (set_lface_from_font_name): Cancel all changes for font-backend.
+ (set_lface_from_font_and_fontset) [USE_FONT_BACKEND]: New
+ function.
+ (Finternal_set_lisp_face_attribute) [USE_FONT_BACKEND]: Accept a
+ font object in QCfont attribute.
+ (set_font_frame_param) [USE_FONT_BACKEND]: Likewise.
+ (realize_default_face) [USE_FONT_BACKEND]: Call
+ set_lface_from_font_and_fontset.
+
+ * xfns.c (x_default_font_parameter) [USE_FONT_BACKEND]: Try also
+ "fixed", and signal error here if no suitable font was found.
+
+ * xfont.c (xfont_parse_name): Delete this function.
+
+ * xftfont.c (xftfont_open): Change coding style of error
+ handling. Generate fontconfig's fontname pattern.
+
+ * xterm.h (struct x_output) [USE_FONT_BACKEND]: New member fontp.
+ (FRAME_FONT_OBJECT) [USE_FONT_BACKEND]: New macro.
+
+ * xterm.c (x_new_fontset2) [USE_FONT_BACKEND]: Change arguments.
+ Both args FONTSET and FONT_OBJECT must be existing ones.
+
+2006-06-16 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.c (mac_set_unicode_keystroke_event): Don't use MAKE_CHAR.
+
+2006-06-14 Kenichi Handa <[email protected]>
+
+ * xfont.c (xfont_open, xfont_encode_char): Fix typo.
+
+ * font.h (struct font): Fix typo.
+
+ * font.c (enum xlfd_field_index): Rename XLFD_XXX_SIZE_INDEX to
+ XLFD_XXX_INDEX.
+ (enum xlfd_field_mask): New enum.
+ (intern_font_field): Argument changed. Caller changed. If digits
+ are followed by non-digits, return a symbol.
+ (font_expand_wildcards): New function.
+ (font_parse_xlfd): Fix wildcard handling.
+ (Ffont_spec): If :name is specified, reflect the info in the other
+ properties.
+
+ * ftfont.c (ftfont_pattern_entity): Fix typo.
+ (ftfont_list): Enforce FC_LANG in PATTERN to cancel the effect of
+ locale.
+
+2006-06-09 Kenichi Handa <[email protected]>
+
+ * font.h (Qiso8859_1, Qiso10646_1, Qunicode_bmp): Extern them.
+
+ * font.c (Qiso8859_1, Qiso10646_1, Qunicode_bmp): Moved from
+ ftfont.c.
+ (font_unparse_xlfd): Fix argument type declaration. Append "*" if
+ registry doesn't specify encoding part.
+ (font_find_for_lface): Pay attention to LFACE_FONT_INDEX.
+ (font_open_by_name): At first try parsing the name.
+ (syms_of_font): Declare Qiso8859_1, Qiso10646_1, and Qunicode_bmp
+ as Lisp symbols.
+
+ * fontset.c (reorder_font_vector): Pay attention to the case that
+ the 3rd element of font_def is nil.
+ (fontset_font): For the default fontset, append one more fontset
+ elements for a script-based font specification. Don't add script
+ attribute on finding a font.
+ (new_fontset_from_font): Unconditionally set FONTSET_ASCII to the
+ font name.
+ (fontset_ascii_font): If a font can't be opened, return nil.
+
+ * ftfont.c (Qiso8859_1, Qiso10646_1, Qunicode_bmp): Moved to
+ font.c.
+ (ftfont_pattern_entity): New function.
+ (ftfont_get_cache): Assume that freetype_font_cache is already
+ initialized.
+ (ftfont_list): Handle the case that a file is specified in font
+ name. Use ftfont_pattern_entity to generate entities.
+ (ftfont_has_char): Check if the pattern contains FC_CHARSET.
+ (syms_of_ftfont): Initialize freetype_font_cache.
+
+ * xftfont.c (xftfont_open): Make the font name fontconfig's
+ style. Add BLOCK_INPUT and UNBLOCK_INPUT.
+ (xftfont_close): Free font->font.name if not NULL.
+
+ * xfont.c (xfont_list): If script is specified for a font, return
+ null_vector.
+ (xfont_list_family): Declare argument type.
+
+ * xfaces.c (set_lface_from_font_name): If a font doesn't have a
+ name, set LFACE_FONT (lface) to nil.
+
+ * xterm.c (x_new_fontset2): If an ASCII font couldn't be loaded,
+ return Qnil.
+
+2006-06-08 Jason Rumney <[email protected]>
+
+ * w32term.c (w32_initialize): Manually sync 2006-06-05 change from
+ HEAD.
+
+2006-06-08 Kenichi Handa <[email protected]>
+
+ * emacs.c (main): Check -enable-font-backend arg after the check
+ of -nl.
+ (standard_args): Add "-enable-font-backend".
+
+ * coding.c (Ffind_operation_coding_system): Sync with HEAD.
+
+ * callproc.c (Fcall_process): Sync with HEAD.
+
+ * coding.h (CODING_REQUIRE_ENCODING): Comment sync with HEAD.
+
+2006-06-07 Kenichi Handa <[email protected]>
+
+ * xftfont.c (xftfont_default_fid): Set fid_known to 1.
+ (struct xftdraw_list, xftdraw_list): Delete them.
+ (register_xftdraw, check_xftdraw): Delete them.
+ (xftfont_prepare_face): Don't call register_xftdraw.
+ (xftfont_done_face): Don't call check_xftdraw.
+ (xftfont_draw): Get backroudn color only when with_background is
+ nonzero.
+
+ * xfont.c (xfont_encode_char): Fix calculation of char2b.
+
+2006-06-06 Kenichi Handa <[email protected]>
+
+ These changes are for the new font handling codes.
+
+ * Makefile.in (ALL_CFLAGS): Add @FREETYPE_CFLAGS@,
+ @FONTCONFIG_CFLAGS@, and @LIBOTF_CFLAGS@.
+ (LIB_X11_LIB): If HAVE_XFT is defined, set to @XFT_LIBS@.
+ (FONTSRC, FONTOBJ): New variables.
+ (obj): Add $(FONTOBJ).
+ (SOME_MACHINE_OBJECTS): Lib_X11_Lib.
+ (LIBES): Add @FREETYPE_LIBS@, @FONTCONFIG_LIBS@, and
+ @LIBOTF_LIBS@.
+ (font.o, ftfont.o, xfont.o, xftfont.o, ftxfont.o): New targets.
+ (fontset.o, xdisp.o, xfaces.o, xfns.o, xterm.o): Depends on
+ $(FONTSRC).
+
+ * font.h, font.c, xfont.c, ftfont.c, xftfont.c, ftxfont.c: New
+ files.
+
+ * character.h (Vscript_representative_chars): Extern it.
+
+ * character.c (Vscript_representative_chars): New variable.
+ (syms_of_character): Declare it as a Lisp variable.
+
+ * composite.c (get_composition_id) [USE_FONT_BACKEND]: If
+ enable_font_backend is nonzero, accept the composition method
+ COMPOSITION_WITH_GLYPH_STRING.
+
+ * composite.h (enum composition_method) [USE_FONT_BACKEND]: New
+ enumeration COMPOSITION_WITH_GLYPH_STRING.
+
+ * config.in: Re-generated.
+
+ * dispextern.h (struct glyph_string) [USE_FONT_BACKEND]: New
+ members clip_x, clip_y, clip_width, and clip_height.
+ (struct face) [USE_FONT_BACKEND]: New members font_info and extra.
+
+ * emacs.c (main) [USE_FONT_BACKEND]: Handle arg
+ --enable-font-backend. Call syms_of_font.
+
+ * fns.c (assoc_no_quit): New function.
+
+ * fontset.h (FONT_INFO_FROM_FACE): New macro.
+ (face_for_font, new_fontset_from_font)
+ (fontset_ascii_font) [USE_FONT_BACKEND]: Extern them.
+
+ * fontset.c [USE_FONT_BACKEND]: Include "font.h".
+ (fontset_font, fontset_ascii, face_for_char)
+ (make_fontset_for_ascii_face, Ffont_info)
+ (Finternal_char_font) [USE_FONT_BACKEND]: If enable_font_backend
+ is nonzero, use font-backend mechanism.
+ (find_font_encoding): Make it non-static.
+ (new_fontset_from_font, fontset_ascii_font) [USE_FONT_BACKEND]:
+ New functions.
+
+ * frame.h (struct frame): New members resx and resy.
+ (struct frame) [USE_FONT_BACKEND]: New member font_driver_list.
+ (x_new_fontset2) [USE_FONT_BACKEND]: Extern it.
+
+ * frame.c [USE_FONT_BACKEND]: Include "font.h".
+ (make_frame, x_set_font) [USE_FONT_BACKEND]: Use font-backend
+ mechanism.
+
+ * lisp.h (assoc_no_quit): Extern it.
+
+ * xdisp.c: If USE_FONT_BACKEND is defined, include "font.h".
+ Through out the file, use FONT_INFO_FROM_FACE instead of
+ FONT_INFO_FROM_ID, use get_per_char_metric instead of
+ rif->per_char_metric.
+ (handle_composition_prop) [USE_FONT_BACKEND]: If the composition
+ method is COMPOSITION_WITH_GLYPH_STRING, just set it->c to ' '.
+ (get_glyph_face_and_encoding, fill_composite_glyph_string)
+ (get_char_face_and_encoding, BUILD_COMPOSITE_GLYPH_STRING)
+ (x_produce_glyphs) [USE_FONT_BACKEND]: If enable_font_backend is
+ nonzero, use font-backend mechanism.
+ (get_per_char_metric): New function.
+
+ * xfaces.c [USE_FONT_BACKEND]: Include "font.h".
+ (set_lface_from_font_name)
+ (set_font_frame_param, free_realized_face)
+ (prepare_face_for_display, clear_face_gcs)
+ (Finternal_set_font_selection_order, realize_x_face)
+ [USE_FONT_BACKEND]: If enable_font_backend is nonzero, use
+ font-backend mechanism.
+ (clear_face_cache) [USE_FONT_BACKEND]: Don't call
+ clear_font_table.
+ (load_face_font) [USE_FONT_BACKEND]: Abort.
+ (face_symbolic_value, face_symbolic_weight, face_symbolic_slant)
+ (face_symbolic_swidth, face_for_font) [USE_FONT_BACKEND]: New
+ functions.
+
+ * xfns.c [USE_FONT_BACKEND]: Include "font.h".
+ (x_default_font_parameter) [USE_FONT_BACKEND]: New function.
+ (Fx_create_frame) [USE_FONT_BACKEND]: If enable_font_backend is
+ nonzero, register all available font drivers. Call
+ x_default_font_parameter for deciding a font.
+ (x_create_tip_frame) [USE_FONT_BACKEND]: Likewise.
+
+ * xterm.c [USE_FONT_BACKEND]: Include "font.h".
+ (x_set_mouse_face_gc, x_set_glyph_string_clipping)
+ (x_set_glyph_string_clipping_exactly)
+ (x_compute_glyph_string_overhangs)
+ (x_draw_glyph_string_foreground)
+ (x_draw_composite_glyph_string_foreground, x_draw_glyph_string)
+ (x_free_frame_resources) [USE_FONT_BACKEND]: If
+ enable_font_backend is nonzero, use font-backend mechanism.
+ (x_new_fontset2) [USE_FONT_BACKEND]: New function.
+
+2006-05-15 Kenichi Handa <[email protected]>
+
+ * coding.h (system_eol_type): Fix synching with HEAD.
+
+ * coding.c (system_eol_type): Sync with HEAD.
+ (coding_inherit_eol_type): If PARENT is nil, inherit from
+ system_eol_type.
+ (syms_of_coding): Initialize system_eol_type.
+
+ * callproc.c (Fcall_process): Sync with HEAD.
+
+ * process.c (setup_process_coding_systems): Fix synching with
+ HEAD.
+ (read_process_output): Likewise.
+ (Fset_process_coding_system): Inherit system's eol format if
+ necessary.
+
+ * fileio.c (choose_write_coding_system): Fix synching with HEAD.
+
+ * keymap.c (push_key_description): Fix synching with HEAD.
+
+2006-05-02 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macgui.h (USE_ATSUI): Don't enable on emacs-unicode-2 branch.
+
+2006-04-07 Kenichi Handa <[email protected]>
+
+ * coding.c (decode_eol): Pay attention to buffer relocation in
+ del_range_2.
+ (decode_coding): Call decode_eol before restoring undo_list.
+
+2006-03-20 Kenichi Handa <[email protected]>
+
+ * charset.c (Fdefine_charset_internal): Fix setting of
+ emacs_mule_bytes.
+
+2006-03-14 Kenichi Handa <[email protected]>
+
+ * keyboard.c (read_char): Check if C is a character or not before
+ looking up Vkeyboard_translate_table.
+
+2006-03-10 Kenichi Handa <[email protected]>
+
+ * coding.c (DECODE_EMACS_MULE_20_RELATIVE_COMPOSITION): Fix
+ condition to terminate the loop.
+
+2006-03-09 Kenichi Handa <[email protected]>
+
+ * coding.c (produce_composition): Compare charbuf[i] instead of
+ args[i] against 0.
+ (Fterminal_coding_system): Use EQ to compare Lisp objects.
+
+2006-03-07 Kenichi Handa <[email protected]>
+
+ * coding.c (DECODE_COMPOSITION_START): If the source is short, set
+ coding->result to CODING_RESULT_INSUFFICIENT_SRC.
+ (decode_coding_gap): Set CODING_MODE_LAST_BLOCK after the call of
+ detect_coding.
+ (emacs_mule_char): Handle old style (Emacs 20) component character
+ of a composition.
+ (DECODE_EMACS_MULE_COMPOSITION_RULE_20): Fix parsing a composition
+ rule.
+ (DECODE_EMACS_MULE_20_RULEBASE_COMPOSITION): Likewise.
+ (decode_coding_emacs_mule): Handle invalid bytes correctly.
+
+2006-03-04 Kenichi Handa <[email protected]>
+
+ * coding.c (encode_coding_ccl): Allocate destination dynamically
+ when necessary.
+
+2006-03-03 Kenichi Handa <[email protected]>
+
+ * ccl.c (Fccl_execute_on_string): Fix the condition of terminating
+ the loop. When quitted, show a proper error message.
+
+2006-03-02 Kenichi Handa <[email protected]>
+
+ * coding.c (decode_coding): Fix previous change.
+
+ * xterm.c (x_set_glyph_string_clipping_exactly): Set
+ src->clip_head and src->clip_tail temporarily instead of src->hl.
+
+ * ccl.c (CCL_WRITE_STRING): Handle a flag bit for multibyte
+ character sequence.
+ (Fccl_execute_on_string): Use ASET, not XSET.
+
+2006-03-01 Kenichi Handa <[email protected]>
+
+ * search.c (search_buffer): Fix handling of "\\" in a trivial
+ regexp.
+
+2006-02-28 Kenichi Handa <[email protected]>
+
+ * coding.c (decode_coding): Fix the condition of terminating the
+ decoding loop.
+
+2006-02-27 Kenichi Handa <[email protected]>
+
+ * data.c (Faset): On setting a character bigger than 255 in a
+ unibyte string, signal an error instead of make the string
+ multibyte.
+
+2006-02-22 Kenichi Handa <[email protected]>
+
+ * charset.c (map_charset_chars): Fix for ascii-compatible charset
+ made by a mapping table.
+
+2006-02-21 Kenichi Handa <[email protected]>
+
+ * xdisp.c (fill_composite_glyph_string): Check s->face is NULL or
+ not.
+ (BUILD_COMPOSITE_GLYPH_STRING): If C is TAB, set s->face to NULL.
+ (x_produce_glyphs): If CH is TAB, set cmp->offsets properly.
+
+ * xterm.c (x_draw_composite_glyph_string_foreground): Check
+ s->face is NULL or not.
+
+2006-02-20 Kenichi Handa <[email protected]>
+
+ * xterm.c (x_set_glyph_string_clipping_exactly): New function.
+ (x_draw_glyph_string): Fix drawing of right_overhang and
+ left_overhang around/on cursor.
+
+ * xdisp.c (draw_glyphs): Fix inclusion of right_overwriting
+ glyphs.
+
+ * term.c (produce_glyphs): Sync to HEAD.
+
+2006-02-15 Kenichi Handa <[email protected]>
+
+ * xdisp.c (x_produce_glyphs): Handle composition with TAB.
+
+2006-02-05 Kenichi Handa <[email protected]>
+
+ * coding.c: Cancel incorrect synching with HEAD.
+
+2006-02-03 Kenichi Handa <[email protected]>
+
+ * coding.c (Fdefine_coding_system_internal): Avoid a duplicated
+ element in Vcoding_system_alist.
+ (Fdefine_coding_system_alias): Likewise.
+
+2006-01-19 Kenichi Handa <[email protected]>
+
+ * xterm.c (handle_one_xevent): Handle keysyms 0x1000000..0x10000FF.
+
+ * coding.c: Sync to HEAD for handling autoload-coding-system.
+ (Qcoding_system_define_form): New variable.
+ (syms_of_coding): Intern and staticpro it.
+ (Fcoding_system_p): Check Qcoding_system_define_form.
+ (Fcheck_coding_system): Try to autoload the definition of
+ CODING-SYSTEM.
+
+ * coding.h (CODING_SYSTEM_P): If ID is not available, call
+ Fcoding_system_p.
+ (CHECK_CODING_SYSTEM): If ID is not available, call
+ Fcheck_coding_system.
+ (CHECK_CODING_SYSTEM_GET_SPEC): Try also Fcheck_coding_system.
+ (CHECK_CODING_SYSTEM_GET_ID): Likewise.
+
+2006-01-17 Kenichi Handa <[email protected]>
+
+ * xterm.c (handle_one_xevent): Delete unnecessary code inserted by
+ sync with HEAD.
+
+ * coding.c (code_conversion_restore): GCPRO arg.
+
+2005-12-28 Kenichi Handa <[email protected]>
+
+ * character.c (lisp_string_width): Check multibyteness of STRING.
+
+2005-10-18 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.c (mac_encode_char): Call ccl_driver with the last arg
+ Qnil. Use JIS_TO_SJIS instead of ENCODE_SJIS.
+ (decode_mac_font_name): Use decode_coding_c_string instead of
+ decode_coding.
+ (x_load_font): Initialize fontp->fontset to -1. Set
+ fontp->encoding_type.
+
+2005-10-17 Kenichi Handa <[email protected]>
+
+ * search.c (search_buffer): Give up BM search on case-fold-search
+ if one of a target character has a case-equivalence of different
+ byte length even if that target charcter is an ASCII.
+ (simple_search): Fix culculation of byte length of matched text.
+ (boyer_moore): Fix handling of case-equivalent multibyte
+ characters.
+
+2005-10-15 Kenichi Handa <[email protected]>
+
+ * coding.c (decode_coding): Fix handling of invalid bytes.
+
+2005-10-06 Kenichi Handa <[email protected]>
+
+ * xterm.c (handle_one_xevent): Handle keysyms directly mapped to
+ Unicode characters.
+
+2005-09-23 Kenichi Handa <[email protected]>
+
+ * coding.c (encode_coding_object): If a pre-write-conversion
+ function makes a new buffer, kill it.
+
+2005-07-29 Kenichi Handa <[email protected]>
+
+ * coding.c (QCascii_compatible_p): New variable.
+ (syms_of_coding): Initialize it.
+ (ONE_MORE_BYTE): Decrement `src' before calling string_char.
+ (ONE_MORE_BYTE_NO_CHECK): Likewise.
+ (record_conversion_result): Add `default:' case.
+ (coding_charset_list): Delete unused variable `coding_type'.
+ (Fdefine_coding_system_internal): Add `ascii-compatible-p'
+ property in the plist of the coding system.
+ (Fcoding_system_put): Check QCascii_compatible_p.
+
+2005-06-09 Kenichi Handa <[email protected]>
+
+ * xdisp.c (get_next_display_element): Sync with the change in
+ HEAD (2005-06-08).
+
+2005-06-06 Kenichi Handa <[email protected]>
+
+ * callproc.c (Fcall_process): Sync with the change in
+ HEAD (2005-06-04).
+
+2005-06-05 Miles Bader <[email protected]>
+
+ * xfaces.c (Finternal_lisp_face_equal_p): Restore previously
+ removed calculation of frame `f', as it's now used.
+
+2005-05-22 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.c (x_font_name_to_mac_font_name): Sync with trunk
+ for the case that does not require code conversion.
+
+2005-05-11 Kenichi Handa <[email protected]>
+
+ * Makefile.in (shortlisp): Cancel previous change.
+ (RUN_TEMACS): Include "-nl" if HAVE_SHM is defined.
+ (emacs${EXEEXT}): Run $(RUN_TEMACS) unconditionally.
+ (UNIDATA): New variable.
+ (${lispsource}international/charprop.el): Depends on ${UNIDATA}.
+ (bootstrap-emacs${EXEEXT}): Depends on charprop.el. Run
+ $(RUN_TEMACS) unconditionally.
+
+2005-05-10 Kenichi Handa <[email protected]>
+
+ * Makefile.in (shortlisp): Add ../lisp/international/charprop.el.
+ (temacs${EXEEXT}): Build charprop.el if necessary.
+ (admindir): New variable.
+ ($(lispsource)international/charprop.el): New target.
+
+2005-05-04 Miles Bader <[email protected]>
+
+ * character.c (chars-in-region): Obsolete function removed.
+ (syms_of_character): Remove its initialization.
+
+2005-04-28 Benjamin Riefenstahl <[email protected]>
+
+ * w32select.c (validate_coding_system)
+ (setup_windows_coding_system): New functions.
+ (convert_to_handle_as_coded, Fw32_get_clipboard_data): Use
+ setup_windows_coding_system.
+ (setup_config, Fw32_get_clipboard_data): Use
+ validate_coding_system.
+ (Fx_selection_exists): Move call to setup_config to a place
+ were signals are allowed.
+
+ * lisp.h (Fcoding_system_base, Fcoding_system_eol_type)
+ (Fcheck_coding_system): Add declarations.
+
+2005-04-28 Kenichi Handa <[email protected]>
+
+ * s/ms-w32.h (STDC_HEADERS): Sync with the change in
+ HEAD (2005-04-23).
+
+2005-04-25 Kenichi Handa <[email protected]>
+
+ * charset.c (load_charset_map_from_vector): Fix for the first
+ iteration.
+
+2005-04-22 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macfns.c (Fx_create_frame, x_create_tip_frame): Pass Lisp
+ string as the second argument for x_new_fontset.
+
+2005-04-18 Kenichi Handa <[email protected]>
+
+ * fns.c (Fstring_as_multibyte): Fix the change for syncing with
+ CVS head.
+
+2005-04-09 Kenichi Handa <[email protected]>
+
+ * search.c (search_buffer): Fix the change for syncing with CVS
+ head.
+ (search_buffer): Likewise.
+
+2005-03-31 Kenichi Handa <[email protected]>
+
+ * xdisp.c (get_next_display_element): Sync with CVS head.
+
+2005-03-29 Kenichi Handa <[email protected]>
+
+ * coding.c (decode_coding_object): Use safe_call1 instead of call1.
+ (encode_coding_object): Use safe_call instead of call2.
+
+2005-03-14 Kenichi Handa <[email protected]>
+
+ * fontset.c (set_default_ascii_font): Fix the change for
+ syncing with CVS head.
+
+2005-01-30 Kenichi Handa <[email protected]>
+
+ * fontset.c (Fset_fontset_font): Check family element of a given
+ vector.
+
+ * Makefile.in (lisp): Include charprop.el.
+
+2005-01-17 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macfns.c (Fx_create_frame, x_create_tip_frame): Fix crash.
+ Not sure if it's unnecessary.
+
+2005-01-16 Steven Tamm <[email protected]>
+
+ * macfns.c (Fx_create_frame, x_create_tip_frame): ifdef'd out
+ some possibly unnecessary fontset checking code that crashed
+ when creating a new frame
+
+2005-01-17 Kenichi Handa <[email protected]>
+
+ * xfaces.c (merge_faces): Fix argument to lookup_derived_face and
+ lookup_face.
+
+ * xdisp.c (Fformat_mode_line): Fix argument to lookup_named_face.
+
+ * fringe.c (draw_fringe_bitmap_1): Fix argument to
+ lookup_named_face.
+
+2004-12-25 Kenichi Handa <[email protected]>
+
+ * xdisp.c (get_next_display_element): Sync to the change in HEAD
+ on 2004-12-21.
+
+2004-12-11 Kenichi Handa <[email protected]>
+
+ * search.c: Sync to the change in HEAD on 2004-11-19, 20.
+
+ * w32console.c: Sync to the change in HEAD on 2004-12-01.
+
+ * coding.c: Cancel the change done in HEAD on 2004-11-30.
+ (coding_charset_list): New function.
+
+ * coding.h (coding_charset_list): Extern it.
+
+ * term.c: Sync to the change in HEAD on 2004-11-30.
+
+2004-12-09 Kenichi Handa <[email protected]>
+
+ * fontset.c (Fset_fontset_font): Call find_font_encoding with
+ concatenation of family and registry.
+
+2004-12-06 Kenichi Handa <[email protected]>
+
+ * character.h (BYTE8_STRING): Fix typo.
+
+ * editfns.c (Ftranslate_region_internal): Don't convert unibyte
+ string to multibyte (sync to HEAD).
+
+ * casefiddle.c (casify_region): Handle changes in byte-length
+ using replace_range_2 (sync to HEAD).
+
+2004-11-24 Andreas Schwab <[email protected]>
+
+ * chartab.c (map_char_table): GCPRO table and arg.
+
+2004-10-29 Kenichi Handa <[email protected]>
+
+ * syntax.c (skip_syntaxes): Return lispy 0 (not nil) if point is
+ already at limit.
+
+2004-10-23 Kenichi Handa <[email protected]>
+
+ * fontset.c (fs_load_font): Use fast_string_match_ignore_case
+ instead of fast_c_string_match_ignore_case.
+ (find_font_encoding): Argument changed to Lisp_Object. Use
+ fast_string_match_ignore_case instead of
+ fast_c_string_match_ignore_case. Caller changed.
+
+2004-10-15 Kenichi Handa <[email protected]>
+
+ * xdisp.c (get_next_display_element): In unibyte case, decide to
+ display in octal form by checking a chacter by
+ UNIBYTE_CHAR_HAS_MULTIBYTE_P.
+
+ * charset.c (Fset_unibyte_charset): Setup
+ unibyte_has_multibyte_table.
+
+ * character.c (unibyte_has_multibyte_table): New variable.
+
+ * character.h (unibyte_has_multibyte_table): Extern it.
+ (UNIBYTE_CHAR_HAS_MULTIBYTE_P): New macro.
+
+2004-10-14 Kenichi Handa <[email protected]>
+
+ * callproc.c (Fcall_process): Fix merging of 2004-10-13 change.
+
+2004-10-13 Kenichi Handa <[email protected]>
+
+ * coding.c (encode_coding_iso_2022): Fix handling of charset
+ annotation.
+
+2004-10-12 Kenichi Handa <[email protected]>
+
+ * coding.c (setup_coding_system): If coding_system is nil, use
+ Qundecided.
+ (Fterminal_coding_system): Return nil if terminal coding system is
+ `undecided'.
+ (syms_of_coding): Define coding-system `undecided' here. Setup
+ terminal_coding as `undecided'.
+
+2004-10-04 Kenichi Handa <[email protected]>
+
+ * xdisp.c (message_dolog, set_message_1): Call
+ unibyte_char_to_multibyte with arg type int.
+
+ * fileio.c (Fsubstitute_in_file_name): Fix previous change.
+
+ * lread.c (read1): Fix reading of a char-table.
+
+ * print.c (print_object): Include sub char-table in cicularities
+ detection.
+
+2004-10-01 Kenichi Handa <[email protected]>
+
+ * keymap.c (where_is_internal_2): Fix for the case that KEY is a
+ cons. Append the found sequences in car of ARGS instead of
+ prepending.
+
+2004-09-28 Kenichi Handa <[email protected]>
+
+ * fileio.c (report_file_error): Make a unibyte string from
+ strerror (errorno).
+ (Fsubstitute_in_file_name): Fix the arg to
+ unibyte_char_to_multibyte. It is evaluated twice.
+
+2004-09-19 Kenichi Handa <[email protected]>
+
+ * charset.h (CHAR_CHARSET): Shortcut for ASCII case.
+
+2004-09-14 Kenichi Handa <[email protected]>
+
+ * coding.c (detect_coding): Fix previous change.
+
+2004-09-13 Kenichi Handa <[email protected]>
+
+ * coding.c (detect_coding_utf_16): Don't set detect_info->found if
+ BOM is not found.
+ (detect_coding): Optimization for ISO-2022 when no 8-bit data is
+ found.
+ (detect_coding_system): Likewise.
+
+2004-09-01 Jason Rumney <[email protected]>
+
+ * w32fns.c (x_to_w32_font): Update to use new coding struct.
+
+2004-08-17 Kenichi Handa <[email protected]>
+
+ * charset.c (Fdeclare_equiv_charset): Fix handing of CHARS.
+ (Fiso_charset): Likewise.
+
+2004-08-03 Steven Tamm <[email protected]>
+
+ * macterm.c (mac_encode_char): Add charset argument and update
+ to use encoding_type
+ (x_new_font,x_new_fontset): Merge in changes from xterm.c;
+ switch to pure fontset
+ (decode_mac_font_name): Temporarily remove decoding
+ (x_font_name_to_mac_font_name): Temporarily remove encoding
+ (x_load_font): Temporarily remove encoding
+
+2004-06-30 Kenichi Handa <[email protected]>
+
+ * xfaces.c (Fface_font): If frame is not on a window system,
+ ignore CHARACTER arg. If HAVE_WINDOW_SYSTEM is not defined, don't
+ refer to face->font.
+ (split_font_name_into_vector, build_font_name_from_vector)
+ (lookup_non_ascii_face, realize_non_ascii_face): Define them only
+ whne HAVE_WINDOW_SYSTEM is defined.
+
+2004-05-29 Kenichi Handa <[email protected]>
+
+ * xdisp.c (BUILD_GLYPH_STRINGS): Check if s is NULL.
+ (x_produce_glyphs): Fix setting of members of cmp in case
+ cmp->glyph_len is zero,
+
+ * fontset.c (Fset_fontset_font): Docstring fixed.
+ (Ffontset_info): Make it backward compatible. New arg ALL.
+
+2004-05-11 Kim F. Storm <[email protected]>
+
+ * process.c (read_process_output): Grow decoding_buf when needed;
+ this could cause a crash in allocate_string and compact_small_strings.
+
+2004-04-29 Kenichi Handa <[email protected]>
+
+ * fileio.c (WRITE_BUF_SIZE): This macro deleted.
+ (e_write): Fix previous change.
+
+2004-04-28 Kenichi Handa <[email protected]>
+
+ * coding.c (setup_coding_system): Set coding->common_flags
+ correctly for raw-text.
+ (consume_chars): On encoding unibyte text by raw-text, don't check
+ multibyte form.
+ (encode_coding): On encoding by raw-text, never use translation
+ tables.
+
+ * fileio.c (e_write): Short cut for the case of no encoding.
+
+2004-04-20 Kenichi Handa <[email protected]>
+
+ * coding.c (detect_coding): Delete unused variables.
+ (detect_coding_system): Likewise.
+
+2004-04-18 Kenichi Handa <[email protected]>
+
+ * coding.c (encode_coding_utf_8): Fix handling of raw-byte char.
+ (consume_chars): Fix handling of 8-bit bytes in unibyte source.
+
+2004-04-14 Kenichi Handa <[email protected]>
+
+ Sync all files to HEAD.
+
+2004-04-14 Kenichi Handa <[email protected]>
+
+ * coding.c (Ffind_coding_systems_region_internal): Include
+ raw-text and no-conversion in the result.
+
+ * fontset.h: Sync to HEAD.
+
+ * fontset.c: Sync to HEAD.
+
+2004-04-14 Kenichi Handa <[email protected]>
+
+ * fontset.c (find_font_encoding): Return `ascii' for unknown
+ encoding.
+ (load_font_get_repertory): Delete unnecessary check of ENCODING of
+ FONT_DEF.
+ (font_def_arg, add_arg, from_arg, to_arg): New args.
+ (set_fontset_font): Argument changed.
+ (Fset_fontset_font): Fix for the case that TARGET is a script
+ name and charset name.
+ (new_fontset_from_font_name): Fix argument to Fnew_fontset.
+
+2004-04-13 Kenichi Handa <[email protected]>
+
+ * fontset.c (fontset_font): Renamed from fontset_face. Return
+ value changed.
+ (face_suitable_for_char_p): Adjusted for the change of
+ fontset_font.
+ (face_for_char): Likewise.
+ (make_fontset_for_ascii_face): Fix setting of the fontset element
+ for ASCII.
+ (Finternal_char_font): Use fontset_font instead of FACE_FOR_CHAR
+ to get a font name.
+ (Ffontset_info): Adjusted for the change of fontset_font.
+
+ * composite.c: Sync to HEAD.
+
+ * search.c: Sync to HEAD.
+
+ * coding.c: Sync to HEAD.
+ (emacs_mule_char): Check invalid code more regidly.
+
+ * coding.h: Sync to HEAD.
+
+ * charset.c: Sync to HEAD.
+
+ * charset.h: Sync to HEAD.
+
+ * character.h (LEADING_CODE_LATIN_1_MIN)
+ (LEADING_CODE_LATIN_1_MAX): Delete these macros.
+
+2004-04-08 Kenichi Handa <[email protected]>
+
+ * category.h: Sync to HEAD.
+
+ * category.c: Sync to HEAD.
+
+ * syntax.h: Sync to HEAD.
+
+ * syntax.c: Sync to HEAD.
+
+ * regex.h: Sync to HEAD.
+
+ * regex.c: Sync to HEAD.
+
+2004-04-07 Kenichi Handa <[email protected]>
+
+ * editfns.c: Sync to HEAD.
+ (check_translation): New function.
+ (Ftranslate_region_internal): Handle M:N mapping.
+
+2004-04-06 Kenichi Handa <[email protected]>
+
+ * xfaces.c (xlfd_point_size): Set font->numeric[XLFD_PIXEL_SIZE].
+
+2004-03-30 Kenichi Handa <[email protected]>
+
+ * coding.c (DECODE_DESIGNATION): Set chars_96 to -1 instead of
+ goto invalid_code.
+ (decode_coding_iso_2022): Fix handling of invalid designation.
+
+ * fileio.c (Finsert_file_contents): Be sure to call unbind_to
+ after calling code_conversion_save.
+
+2004-03-11 Kenichi Handa <[email protected]>
+
+ * xdisp.c (handle_auto_composed_prop): Fix Lisp_Object/int mixup.
+
+ * print.c (print_prune_string_charset): Fix Lisp_Object/int mixup.
+
+ * fontset.c: Include "intervals.h".
+ (fontset_face): Fix comparing of Lisp_Objects.
+ (free_face_fontset): Fix Lisp_Object/int mixup.
+ (new_fontset_from_font_name): Likewise.
+
+ * editfns.c (Ftranslate_region_internal): Fix Lisp_Object/int mixup.
+
+ * coding.c: Add many prototypes for static functions.
+ (get_translation_table): Allow max_lookup to be NULL.
+ (decode_coding): Call get_translation_table with max_lookup NULL.
+ (Ffind_coding_systems_region_internal): Likewise.
+ (Funencodable_char_position, Fcheck_coding_systems_region):
+ Likewise.
+
+2004-03-11 Kenichi Handa <[email protected]>
+
+ * coding.c (get_translation_table): Declare it as Lisp_Object.
+ (LOOKUP_TRANSLATION_TABLE): New macro.
+ (produce_chars): Use LOOKUP_TRANSLATION_TABLE instead of
+ CHAR_TABLE_REF.
+ (consume_chars): Likewise.
+
+2004-03-11 Kenichi Handa <[email protected]>
+
+ * coding.c (MAX_ANNOTATION_LENGTH): Adjusted for the change of
+ annotation data format.
+ (ADD_ANNOTATION_DATA, ADD_COMPOSITION_DATA, ADD_CHARSET_DATA):
+ Change arguments FROM and TO to single argument NCHARS. Caller
+ changed.
+ (decode_coding_utf_8): Pay attention to coding->charbuf_used.
+ (decode_coding_utf_16, decode_coding_emacs_mule)
+ (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
+ (decode_coding_ccl, decode_coding_charset): Likewise.
+ (get_translation): New function.
+ (produce_chars): New arguments translation_table and last_block.
+ Translate characters here. Return number of carryover chars.
+ Caller changed.
+ (produce_composition): New argument pos. Caller changed.
+ Adjusted for the change of annotation data format.
+ (produce_charset, produce_annotation): Likewise.
+ (decode_coding, encode_coding): Don't call translate_chars.
+ (consume_chars): New arg translation_table. Caller changed.
+ (translate_chars): Deleted.
+ (syms_of_coding): Make translation-table's number of extra slots
+ 2.
+
+2004-03-09 Kenichi Handa <[email protected]>
+
+ * search.c (simple_search): Fix setting this_pos_byte in backward
+ search.
+
+ * coding.c (detect_coding_emacs_mule): Fix counting of encoded
+ byte sequence.
+ (detect_coding_ccl): Fix setting of the variable valids.
+
+2004-03-04 Kenichi Handa <[email protected]>
+
+ * xterm.c (x_list_fonts): Fix the detection of an auto-scaled font.
+
+ * coding.c (decode_coding_utf_16): Fix handling of surrogate pair.
+
+ * editfns.c (Ftranslate_region_internal): Renamed from
+ Ftranslate_region. Accept a char-table in TABLE.
+ (syms_of_editfns): Defsubr Stranslate_region_internal.
+
+ * xfaces.c (set_lface_from_font_name): If a font is specified for
+ a frame, generate a fontset from the font.
+ (build_scalable_font_name): If the scalable font is requested for
+ a specific size, don't change that size.
+ (try_font_list): Try a scalable font also in the case that a
+ pattern string is specified,
+
+
+2004-03-03 Kenichi Handa <[email protected]>
+
+ * xfaces.c (Fface_font): New optional arg CHARACTER.
+
+2004-02-17 Kenichi Handa <[email protected]>
+
+ * charset.h (CHARSET_OFFSET): New macro.
+
+2004-02-13 Kenichi Handa <[email protected]>
+
+ * xterm.c (x_get_font_repertory): Fix for non-Unicode-bmp charset.
+
+ * fontset.c (fontset_face): Handle the case that repertory is a
+ char-table.
+ (find_font_encoding): Return nil for unknown encoding.
+ (Fset_fontset_font): Ignore a font of unknown encoding.
+
+2004-02-09 Kenichi Handa <[email protected]>
+
+ * keymap.c (describe_vector): Handle default value of a char
+ table.
+
+ * fontset.c (fontset_face): Handle fallback fonts correctly.
+ (Ffontset_info): Return infomation about fallback fonts.
+
+2004-02-06 Kenichi Handa <[email protected]>
+
+ * fontset.c (FONTSET_DEFAULT): New macro.
+ (FONTSET_ADD): Handle the case that range is nil.
+ (fontset_add): Likewise.
+ (Fset_fontset_font): Change the 2nd arg name to TARGET, and handle
+ the case that it is nil.
+ (dump_fontset): Call FONTSET_DEFAULT, not FONTSET_FALLBACK.
+ (syms_of_fontset): Set char-table-extra-slots property of fontset
+ to 9.
+
+ * charset.h (CHAR_CHARSET_P): Fix for the case that the method is
+ subset or superset.
+
+2004-01-30 Kenichi Handa <[email protected]>
+
+ * emacs.c (main): Call init_charset after syms_of_XXX.
+
+ * charset.c (Vcharset_map_directory): Deleted.
+ (Vcharset_map_path): New variable
+ (load_charset_map_from_file): Use Vcharset_map_path instead.
+ (init_charset): Initialize Vcharset_map_path.
+ (syms_of_charset): Delete declaration of "charset-map-directory",
+ add declaration of "charset-map-path".
+
+2004-01-29 Kenichi Handa <[email protected]>
+
+ * fns.c (string_char_to_byte): Optimize for ASCII only string.
+ (string_byte_to_char): Likewise.
+
+ * fileio.c (Finsert_file_contents): Avoid detecting a code twice.
+
+ * coding.c (detect_coding_iso_2022): Fix handling of SS2 and SS3.
+ (detect_coding): Treat '\0' as normal ASCII byte..
+ (detect_coding_system): Likewise.
+
+2004-01-27 Kenichi Handa <[email protected]>
+
+ * coding.h (SJIS_TO_JIS2, JIS_TO_SJIS2): New macros.
+
+ * coding.c (QCmnemonic, QCdefalut_char)
+ (QCdecode_translation_table, QCencode_translation_table)
+ (QCpost_read_conversion, QCpre_write_conversion): New variables.
+ (get_translation_table): Return a list of translation tables if
+ necessary.
+ (decode_coding): Call get_translation_table with ENCODEP 0.
+ (char_encodable_p): If translation_table is non-nil, always call
+ translate_char.
+ (Fdefine_coding_system_internal): Accept list of translation
+ tables as :encode-translation-table and :decode-translation-table.
+ (Fcoding_system_put): New function.
+ (syms_of_coding): Declare new symbols. Defsubr
+ Scoding_system_put.
+ (decode_coding_sjis): Handle 4th charset (typically JISX0212).
+ (encode_coding_sjis): Likewise.
+
+ * charset.c (map_charset_chars): Fix arg to map_charset_chars in
+ when the charset is superset type.
+
+ * character.c (translate_char): Accept list of translation tables.
+
+2004-01-25 Kenichi Handa <[email protected]>
+
+ * coding.h (enum coding_attr_index): New member
+ coding_attr_trans_tbl.
+ (CODING_ATTR_TRANS_TBL): New macro.
+
+ * coding.c (get_translation_table): New function.
+ (translate_chars): Fix the bug of skipping annotation data.
+ (decode_coding): Utilze get_translation_table.
+ (encode_coding): Likewise.
+ (char_encodable_p): Translate char if necessary.
+ (Funencodable_char_position): Likewise.
+ (Ffind_coding_systems_region_internal): Setup translation table
+ for encode in a coding system attribute vector in advance.
+ (Fcheck_coding_systems_region): Likewise.
+ (Fdefine_coding_system_internal): Allow a symbol as translation
+ table. For shift-jis type coding system, allow 4th charset.
+
+2004-01-24 Kenichi Handa <[email protected]>
+
+ * coding.c (decode_coding_sjis): Check the first byte rigidly.
+
+ * xdisp.c (get_next_display_element): Pass -1 as POS to
+ FACE_FOR_CHAR if displaying a C-string.
+
+2004-01-23 Kenichi Handa <[email protected]>
+
+ * composite.c (get_composition_id): Handle xoff and yoff in a
+ composition rule.
+
+ * composite.h (COMPOSITION_DECODE_RULE): New arg xoff and yoff.
+ (struct composition): New member lbearing and rbearing.
+
+ * xdisp.c (move_it_to): Optimize for the case (op & MOVE_TO_Y).
+ (x_get_glyph_overhangs): Handle a composition glyph.
+ (x_produce_glyphs): Setup lbearing and rbreaing for a composition
+ glyph.
+
+ * xterm.c (x_compute_glyph_string_overhangs): Handle also a
+ composition glyph.
+
+2004-01-18 Kenichi Handa <[email protected]>
+
+ * print.c: Include charset.h.
+ (Vprint_charset_text_property): New variable.
+ (Qdefault): Extern it.
+ (PRINT_STRING_NON_CHARSET_FOUND)
+ (PRINT_STRING_UNSAFE_CHARSET_FOUND): New macros.
+ (print_check_string_result): New variable.
+ (print_check_string_charset_prop): New function.
+ (print_prune_charset_plist): New variable.
+ (print_prune_string_charset): New function.
+ (print_object): Call print_prune_string_charset if
+ Vprint_charset_text_property is not t.
+ (print_interval): Print nothing if itnerval->plist is nil.
+ (syms_of_print): Declare Vprint_charset_text_property as a lisp
+ variable. Init and staticpro print_prune_charset_plist.
+
+2004-01-15 Kenichi Handa <[email protected]>
+
+ * fontset.c (new_fontset_from_font_name): Use the specified font
+ for all characters in the new fontset.
+
+ * macterm.c (x_set_mouse_face_gc): Call FACE_FOR_CHAR with POS and
+ OBJECT args.
+
+ * xdisp.c (x_produce_glyphs): Call FACE_FOR_CHAR with POS and
+ OBJECT args for composition too.
+
+ * w32term.c (x_set_mouse_face_gc): Call FACE_FOR_CHAR with POS and
+ OBJECT args.
+
+2004-01-13 Kenichi Handa <[email protected]>
+
+ * dispextern.h (FACE_FOR_CHAR): New args POS and OBJECT.
+
+ * fontset.c (reorder_font_vector): Adjusted for the change of
+ FONT_DEF format.
+ (fontset_face): New arg id. Caller changed.
+ (face_for_char): New args pos and object.
+ (make_fontset_for_ascii_face): Adjusted for the change of FONT_DEF
+ format.n
+ (fs_query_fontset): Check NAME by Fassoc too.
+ (Fset_fontset_font): Allow non-XLFD font name.
+ (Ffontset_info): Adjusted for the change of FONT_DEF format.
+
+ * fontset.h (face_for_char): Prototype adjusted.
+
+ * xdisp.c (face_before_or_after_it_pos): Call FACE_FOR_CHAR with
+ POS and OBJECT args.
+ (get_next_display_element): Likewise.
+ (append_space): Likewise.
+ (extend_face_to_end_of_line): Likewise.
+ (get_char_face_and_encoding): Likewise.
+ (BUILD_COMPOSITE_GLYPH_STRING): Likewise.
+ (x_produce_glyphs): Likewise.
+
+ * xfaces.c (compute_char_face): Call FACE_FOR_CHAR with
+ POS and OBJECT args.
+
+ * xterm.c (x_set_mouse_face_gc): Call FACE_FOR_CHAR with
+ POS and OBJECT args.
+
+2004-01-03 Jason Rumney <[email protected]>
+
+ * w32select.c (Fw32_set_clipboard_data): Avoid potential realloc
+ of GlobalAlloc'ed memory.
+
+2003-12-29 Kenichi Handa <[email protected]>
+
+ * ccl.c (Fccl_execute_on_string): Fix the condition of loop.
+
+ * charset.h (charset_table_used): Delete extern.
+
+ * charset.c (charset_table_used): Make it static.
+ (map_charset_chars): Fix args to c_function with.
+
+ * chartab.c (map_sub_char_table_for_charset): Fix args to
+ c_function with.
+
+ * coding.h (enum coding_result_code): Delete
+ CODING_RESULT_INSUFFICIENT_CMP, add CODING_RESULT_INVALID_SRC.
+
+ * coding.c (Qinsufficient_source, Qinconsistent_eol)
+ (Qinvalid_source, Qinterrupted, Qinsufficient_memory): New
+ variables.
+ (Vlast_code_conversion_error): New variables.
+ (syms_of_coding): DEFSYM or DEFVAR_LISP them.
+ (ONE_MORE_BYTE): Record error if any instead of signaling an
+ error. If non-ASCII multibyte char is found, return the negative
+ value of the code. All callers changed to check it.
+ (ONE_MORE_BYTE_NO_CHECK): Likewise.
+ (record_conversion_result): New function. All codes setting
+ coding->result are changed to call this function.
+ (detect_coding_utf_8): Don't use the local variable incomplete.
+ (decode_coding_utf_8): Likewise.
+ (emacs_mule_char): Change the second arg to `const'.
+ (detect_coding_emacs_mule): Don't use the local variable
+ incomplete.
+ (detect_coding_sjis): Likewise.
+ (detect_coding_big5): Likewise.
+ (decode_coding): Fix of flushing out unprocessed data.
+ (make_conversion_work_buffer): Fix making of a work buffer.
+ (decode_coding_object): Return coding->dst_object;
+
+ * fontset.c (set_fontset_font): Fix args.
+
+ * lisp.h (CHARACTERBITS): Define as 22.
+
+ * process.c (send_process): Be sure to set coding->src_multibyte.
+
+ * xdisp.c (handle_auto_composed_prop): Fix setting of limit.
+
+2003-12-02 Kenichi Handa <[email protected]>
+
+ * xdisp.c (handle_auto_composed_prop): Give limit to
+ Fnext_single_char_property_change.
+
+2003-12-02 Kenichi Handa <[email protected]>
+
+ * coding.c (detect_coding): Fix previous change.
+ (detect_coding_system): Likewise.
+
+2003-12-02 Kenichi Handa <[email protected]>
+
+ * composite.c (syms_of_composite): Don't make the compostion hash
+ table week.
+
+ * fontset.c (Fset_fontset_font): Fix docstring.
+
+ * lisp.h (detect_coding_system): Adjust prototype.
+
+ * fileio.c (kill_workbuf_unwind): Delete this function.
+ (Finsert_file_contents): Adjust the call of detect_coding_system.
+ Get conversion_buffer by code_conversion_save. Use the macor
+ CODING_MAY_REQUIRE_DECODING. After decoding, update
+ coding_system.
+
+ * coding.h (make_conversion_work_buffer): Delete extern.
+ (code_conversion_save): Extern it.
+
+ * coding.c (enum iso_code_class_type): Delete ISO_carriage_return.
+ (CODING_GET_INFO): Delete argument eol_type. Callers changed.
+ (decode_coding_utf_8): Don't do eol converion.
+ (detect_coding_utf_16): Check coding->src_chars, not
+ coding->src_bytes. Add heuristics for those that have no
+ signature.
+ (decode_coding_emacs_mule): Don't do eol converion.
+ (decode_coding_iso_2022): Likewise.
+ (decode_coding_sjis): Likewise.
+ (decode_coding_big5): Likewise.
+ (decode_coding_charset): Likewise.
+ (adjust_coding_eol_type): Return a new coding system.
+ (detect_coding): Don't detect eol. Fix for utf-16 detection.
+ (decode_eol): In case of CRLF->LF conversion, use del_range_2 on
+ each change.
+ (decode_coding): Pay attention to undo_list. Do eol convesion for
+ all types of coding-systems (if necessary).
+ (Vcode_conversion_work_buf_list): Delete it.
+ (Vcode_conversion_reused_workbuf): Renamed from
+ Vcode_conversion_reused_work_buf.
+ (Vcode_conversion_workbuf_name): New variable.
+ (reused_workbuf_in_use): New variable.
+ (make_conversion_work_buffer): Delete the arg DEPTH.
+ (code_conversion_restore): Argument changed to cons.
+ (code_conversion_save): Delete the argument BUFFER. Callers
+ changed.
+ (detect_coding_system): New argument src_chars. Callers changed.
+ Fix for utf-16 detection.
+ (init_coding_once): Don't use ISO_carriage_return.
+ (syms_of_coding): Initialized Vcode_conversion_workbuf_name and
+ reused_workbuf_in_use.
+
+2003-11-24 Kenichi Handa <[email protected]>
+
+ * keymap.c (store_in_keymap): Pay attention to the case that idx
+ is a cons specifying a character range.
+
+ * coding.c (Fdefine_coding_system_internal): Fix previous change.
+
+2003-11-23 Kenichi Handa <[email protected]>
+
+ * xdisp.c (handle_auto_composed_prop): Fix the case of returning
+ HANDLED_RECOMPUTE_PROPS.
+
+ * coding.c (Fdefine_coding_system_internal): Fix checking of
+ ascii compatibility.
+
+2003-11-22 Kenichi Handa <[email protected]>
+
+ * charset.c (find_charsets_in_text): Delete unused locale
+ variable.
+ (Fset_charset_priority): Update Vemacs_mule_charset_list too.
+
+ * coding.c (encode_coding_emacs_mule): Emit bytes with MSB.
+ Resync charset_list to Vemacs_mule_charset_list.
+
+ * keymap.c (store_in_keymap): Pay attention to the case that idx
+ is a cons specifying a character range.
+
+2003-11-18 Kenichi Handa <[email protected]>
+
+ * composite.c (update_compositions): Bind inhibit-read-only, etc
+ to t before calling remove-list-of-text-properties.
+
+ * print.c (print_object): Always print ASCII chars as is.
+
+2003-11-17 Kenichi Handa <[email protected]>
+
+ * keymap.c (Fdefine_key): Fix handling of Lucid style event type
+ list.
+
+ * fns.c (Fmapconcat): Signal an error if SEQUENCE is a char table.
+ (Fmapcar): Likewise.
+ (Fmapc): Likewise.
+
+2003-11-15 Kenichi Handa <[email protected]>
+
+ * syntax.c (skip_chars): Be sure to alloca char_ranges when
+ necessary.
+
+2003-11-14 Kenichi Handa <[email protected]>
+
+ * xfaces.c (set_lface_from_font_name): Fix for the case that
+ FONTNAME is not fontset name.
+
+2003-11-13 Kenichi Handa <[email protected]>
+
+ * fns.c (base64_encode_1): Fix previous change.
+
+2003-11-08 Kenichi Handa <[email protected]>
+
+ * fontset.c (set_fontset_font): New function.
+ (Fset_fontset_font): If a font is specified for a charset, use
+ map_charset_chars to store the font spec in a fontset.
+
+2003-10-29 Kenichi Handa <[email protected]>
+
+ * fontset.c (fontset_face): Create a fallback fontset on demand
+ (make_fontset): Don't create a fallback fontset here.
+ (free_face_fontset): Free a fallback fontset (if any) too.
+ (n_auto_fontsets): Delete this variable.
+ (auto_fontset_alist): New variable.
+ (new_fontset_from_font_name): Check auto_fontset_alist.
+ (dump_fontset) [FONTSET_DEBUG]: Fully re-written.
+ (Ffontset_list_all) [FONTSET_DEBUG]: New function.
+ (syms_of_fontset): Initialize and staticpro auto_fontset_alist.
+ Defsubr Sfontset_list_all.
+
+2003-10-24 Kenichi Handa <[email protected]>
+
+ * xterm.c (x_list_fonts): Fix excluding of auto-scaled fonts.
+
+2003-10-23 Kenichi Handa <[email protected]>
+
+ * fontset.c (Fnew_fontset): Check NAME more rigidly.
+
+2003-10-17 Kenichi Handa <[email protected]>
+
+ * editfns.c (Fgoto_char): Fix docstring.
+
+2003-10-16 Kenichi Handa <[email protected]>
+
+ * insdel.c (insert_from_gap): Adjust intervals correctly.
+
+2003-10-12 Jason Rumney <[email protected]>
+
+ * w32term.c (GLYPHSET, WCRANGE): Define if system headers don't.
+ (pfnGetFontUnicodeRanges): New dynamically loaded function.
+ (w32_initialize): Try to load it.
+ (x_get_font_repertory): Use it if available.
+ (w32_encode_char): Add shortcut for unicode output.
+
+ * w32fns.c (w32_load_system_font): Default charset to -1.
+ (x_to_w32_charset): Match all fonts for unicode.
+ (w32_to_x_charset): New parameter matching. Don't return partial
+ or wildcard charsets.
+ (w32_to_all_x_charsets): Don't return partial or wildcard charsets.
+ (w32_codepage_for_font): Return CP_UNICODE for unicode.
+ (w32_to_x_font): Match charset to real charset.
+ (enum_font_cb2): Always list unicode versions.
+
+ * makefile.w32-in (temacs): Increase EMHEAP.
+
+2003-10-11 Jason Rumney <[email protected]>
+
+ * w32term.c (w32_encode_char): New charset parameter.
+ font_info.encoding becomes encoding_type.
+ (x_get_font_repertory): New function. Warning: stub only!
+ (x_new_font): Return quickly if font already set.
+ (x_new_fontset): fontsetname parameter is Lisp_Object.
+ Use new fs_query_fontset. Try new_fontset_from_font_name. Use
+ fontset_name for return value.
+
+ * w32term.h: Declare x_get_font_repertory.
+
+ * w32select.c (Fw32_set_clipboard_data): Use string_x_string_p in
+ place of find_charset_in_text. Use encode_coding_object in place
+ of encode_coding.
+ (Fw32_get_clipboard_data): Use decode_coding_c_string in place of
+ decode_coding.
+
+ * w32fns.c (Fx_create_frame, x_create_tip_frame): Use new version
+ of x_new_fontset.
+ (w32_load_system_font): Initialize charset as unicode.
+ font_info.encoding becomes encoding_type.
+ (w32_to_x_font): Use decode_coding_c_string in place of
+ decode_coding.
+ (x_to_w32_font): Use encode_coding_object in place of
+ encode_coding.
+ (syms_of_w32fns): Set get_font_repertory_func.
+
+ * w32console.c: Include character.h. Use terminal_encode_buffer
+ from term.c.
+ (write_glyphs): Use new version of encode_terminal_code. Use
+ encode_coding_object in place of encode_coding.
+
+ * w32bdf.c (w32_load_bdf_font): Clear font_info before filling.
+ encoding becomes encoding_type.
+
+ * term.c (terminal_encode_buffer): Make externally visible.
+
+ * makefile.w32-in: Add character.h dependancies.
+ (character.o, chartab.o): New targets.
+
+2003-10-10 Kenichi Handa <[email protected]>
+
+ * fileio.c (Finsert_file_contents) [DOS_NT]: Use the macro
+ CODING_ID_EOL_TYPE..
+
+2003-10-07 Andreas Schwab <[email protected]>
+
+ * coding.c (produce_chars): Revert last change.
+
+2003-10-06 Kenichi Handa <[email protected]>
+
+ * charset.h (charset_unicode): Extern it.
+
+ * charset.c (string_xstring_p): Check by (C >= 0x100).
+ (find_charsets_in_text): Format of the arc CHARSETS changed. New
+ arg MULTIBYTE.
+ (Ffind_charset_region, Ffind_charset_string): Adjusted for the
+ change of find_charsets_in_text.
+ (Fsplit_char): Fix doc. Never return unknown.
+
+ * chartab.c (char_table_translate): Use CHARACTERP, not INETEGERP.
+
+ * coding.c (Fdefine_coding_system_alias): Update
+ Vcoding_system_list.
+
+ * fontset.c (load_font_get_repertory): Pay attention to the case
+ that ENCODING of a font is specified by a char-table.
+
+ * xterm.c (x_get_font_repertory): Handle the case that the
+ encoding of font is other than Unicode.
+
+2003-10-02 Kenichi Handa <[email protected]>
+
+ * term.c (encode_terminal_code): Don't handle glyph-table. Check
+ if a character is encodable by the terminal coding system. If
+ not, produces proper number of `?'s. Update
+ terminal_encode_buffer and terminal_encode_buf_size if necessary.
+ (produce_glyphs): Check by CHAR_BYTE8_P, not SINGLE_BYTE_CHAR_P.
+
+2003-10-01 Kenichi Handa <[email protected]>
+
+ * term.c (terminal_encode_buffer, terminal_encode_buf_size): New
+ variables.
+ (encode_terminal_code): Argument changed. Encode multiple
+ characters at once. Store the result of encoding in
+ terminal_encode_buffer.
+ (write_glyphs): Adjusted for the change of encode_terminal_code.
+ (insert_glyphs): Likewise.
+ (term_init): Initialize terminal_encode_buffer and
+ terminal_encode_buf_size.
+
+ * coding.c (consume_chars): If coding->src_object is nil, don't
+ check annotation.
+
+2003-09-30 Kenichi Handa <[email protected]>
+
+ * character.c (char_string): Use ASCII_CHAR_P instead of
+ SINGLE_BYTE_CHAR_P.
+
+2003-09-30 Kenichi Handa <[email protected]>
+
+ * xdisp.c (handle_auto_composed_prop): Check if the last
+ characters of auto-composed region is newly composed with the
+ following characters.
+ (handle_composition_prop): Fix checking of point being inside
+ composition.
+
+2003-09-26 Kenichi Handa <[email protected]>
+
+ * fns.c (concat): Don't change multibyteness of the result by
+ concatenating an 8-bit character.
+
+ * data.c (Faset): Check newelt by CHECK_CHARACTER. Don't change
+ multibyteness of the result when newelt is an 8-bit character.
+
+2003-09-29 Dave Love <[email protected]>
+
+ * xmenu.c (find_and_call_menu_selection): Make menu_bar_items_used
+ EMACS_INT.
+
+ * xfns.c (DefaultDepthOfScreen, x_encode_text): Remove unused vars.
+
+ * xfaces.c (face_numeric_value): Declare dim size_t.
+ (Finternal_lisp_face_equal_p): Remove unused f.
+
+ * xdisp.c (BUILD_CHAR_GLYPH_STRINGS, display_and_set_cursor)
+ (MATRIX_ROW): Remove unused vars.
+ (draw_glyphs, x_insert_glyphs, fast_find_position)
+ (fast_find_position, fast_find_string_pos): Use EMACS_INT for
+ byte/char counts.
+
+ * regex.c (regex_compile): Remove unused var.
+
+ * minibuf.c (Fminibuffer_complete_word): Remove unused var.
+
+ * keymap.c (Fset_keymap_parent, map_keymap, Fcopy_keymap)
+ (Faccessible_keymaps, where_is_internal): Remove unused vars.
+
+ * keyboard.c (cancel_hourglass_unwind): Return Qnil.
+
+ * frame.c (frame_name_fnn_p): Make len EMACS_INT.
+
+ * fileio.c (Fwrite_region): Remove unused var.
+
+ * dispnew.c (adjust_frame_glyphs_for_frame_redisplay)
+ (adjust_frame_glyphs_for_window_redisplay): Remove unused ch_dim.
+
+ * composite.c (Fremove_list_of_text_properties): Declare.
+
+ * coding.c (inhibit_pre_post_conversion): Removed (unused).
+ (alloc_destination, produce_chars): Use EMACS_INT for byte/char
+ counts.
+ (coding_inherit_eol_type): Remove unused attrs.
+ (detect_coding): Cast arg of detect_eol.
+
+ * charset.c (syms_of_charset): Remove unused var p.
+ (find_charsets_in_text, Ffind_charset_region): Use EMACS_INT for
+ byte/char counts.
+
+ * casetab.c (set_case_table): Remove unused var.
+
+ * window.c (Fdisplay_buffer, Fframe_selected_window): Remove
+ unsued vars.
+
+2003-09-26 Dave Love <[email protected]>
+
+ * xterm.c (x_bitmap_mask): Declare.
+
+2003-09-17 Dave Love <[email protected]>
+
+ * xterm.c (x_term_init): Fix type error.
+
+ * lisp.h: Add Funibyte_char_to_multibyte.
+
+ * coding.c (Fread_coding_system): Fix arg of XSETSTRING.
+ (Fset_coding_system_priority): Doc fix.
+
+ * alloc.c: Sync with HEAD version.
+
+ * ccl.c (ccl_driver): Fix arg of CHARACTERP.
+
+ * indent.c (check_composition): Make start and end EMACS_INT.
+
+ * character.c (lisp_string_width): Make ignore and end EMACS_INT.
+
+ * xdisp.c (handle_composition_prop, check_point_in_composition):
+ Make buffer positions EMACS_INT.
+
+ * composite.c (find_composition, run_composition_function)
+ (update_compositions, Ffind_composition_internal): Make buffer
+ positions EMACS_INT.
+
+ * composite.h (find_composition, update_compositions): Make
+ position args EMACS_INT.
+
+ * keyboard.c (adjust_point_for_property): Make beg and end
+ EMACS_INT.
+
+ * intervals.c (get_property_and_range)
+ * intervals.h (get_property_and_range): Make start and end EMACS_INT.
+
+ * unexalpha.c: Don't include varargs.h.
+
+2003-09-16 Dave Love <[email protected]>
+
+ * coding.h (ENCODE_UTF_8): New.
+
+ * Makefile.in (gtkutil.o): Depend on coding.h.
+
+ * coding.c (Fset_coding_system_priority): Doc fix.
+
+2003-09-16 Kenichi Handa <[email protected]>
+
+ * fileio.c (Finsert_file_contents): Call setup_coding_system in
+ the case of auto saving.
+
+2003-09-10 Andreas Schwab <[email protected]>
+
+ * chartab.c (map_char_table): Protect `range' from GC.
+ (map_char_table_for_charset): Likewise.
+
+2003-07-09 Kenichi Handa <[email protected]>
+
+ * coding.c (decode_coding_sjis): Check bytes more rigidly.
+
+2003-06-26 Kenichi Handa <[email protected]>
+
+ * fileio.c (choose_write_coding_system): Return a decided coding
+ system.
+ (Fwrite_region): Set Vlast_coding_system_used to the return value
+ of choose_write_coding_system.
+
+2003-06-06 Kenichi Handa <[email protected]>
+
+ * charset.c (Fset_charset_priority): Pay attention to duplicated
+ arguments.
+
+ * coding.c (QCcategory): New variable.
+ (syms_of_coding): Defsym it. Set all elements of
+ Vcoding_category_table and their symbol values.
+ (Fset_coding_system_priority): Doc fix. Update symbol qvalues of
+ coding-category-XXX, and coding-category-list.
+ (Fdefine_coding_system_internal): Add category in the plist.
+
+2003-06-05 Kenichi Handa <[email protected]>
+
+ * callproc.c (Fcall_process): Handle carryover correctly.
+
+ * coding.c (decode_coding_iso_2022): Fix handling of invalid
+ bytes.
+ (raw_text_coding_system): Check NILP (coding_system).
+ (coding_inherit_eol_type): Check NILP (coding_system) and
+ NILP (parent).
+ (consume_chars): Fix for the case of raw-text.
+
+ * process.c (read_process_output): Handle carryover correctly.
+
+2003-06-02 Dave Love <[email protected]>
+
+ * regex.c (re_search_2): Fix last change.
+
+2003-05-30 Kenichi Handa <[email protected]>
+
+ * regex.c (GET_CHAR_BEFORE_2): Check multibyte, not
+ target_multibyte. Even in a unibyte case, return a converted
+ multibyte char.
+ (GET_CHAR_AFTER): New macro.
+ (PATFETCH): Translate via multibyte char.
+ (HANDLE_UNIBYTE_RANGE): Delete this macro.
+ (SETUP_MULTIBYTE_RANGE): New macro.
+ (regex_compile): Setup compiled code so that its multibyteness
+ matches that of a target. Fix the handling of "[X-YZ]" using
+ SETUP_MULTIBYTE_RANGE.
+ (analyse_first) <charset>: For filling fastmap for all multibyte
+ characters, don't check by BASE_LEADING_CODE_P.
+ (re_search_2): Don't check RE_TARGET_MULTIBYTE_P (bufp). It is
+ the same as RE_MULTIBYTE_P (bufp) now.
+ (mutually_exclusive_p): Check by (! multibyte ||
+ IS_REAL_ASCII (c)).
+ (TARGET_CHAR_AND_LENGTH): Delete this macro.
+ (TRANSLATE_VIA_MULTIBYTE): New macro.
+ (re_match_2_internal): Don't check RE_TARGET_MULTIBYTE_P (bufp).
+ It is the same as RE_MULTIBYTE_P (bufp) now.
+ <exactn>: Translate via multibyte.
+ <anychar>: Fetch a character by RE_STRING_CHAR_AND_LENGTH. Don't
+ translate it.
+ <charset, charset_not>: Fetch a character by
+ RE_STRING_CHAR_AND_LENGTH. Translate via multibyte.
+ <duplicate>: Call bcmp_translate with the last arg `multibyte'.
+ <wordbound, notwordbound, wordbeg, wordend, syntaxspec,
+ notsyntaxspec, categoryspec, notcategoryspec> Fetch a character
+ by GET_CHAR_AFTER.
+ (bcmp_translate): Likewise.
+
+ * search.c (compile_pattern): Check the member target_multibyte,
+ not the member multibyte of buf.
+
+ * lread.c (read1): While reading a string, set force_singlebyte
+ and force_multibyte correctly.
+
+ * charset.c (Fset_unibyte_charset): Fix setting up of
+ unibyte_to_multibyte_table.
+ (init_charset_once): Likewise.
+
+2003-05-29 Kenichi Handa <[email protected]>
+
+ * coding.c (setup_coding_system): If coding has
+ post-read-conversion or pre-write-conversion, set
+ CODING_REQUIRE_DECODING_MASK and CODING_REQUIRE_ENCODING_MASK
+ respectively.
+ (decode_coding_gap): Run post-read-conversion if any.
+
+ * fileio.c (Finsert_file_contents): Even if we read into a
+ unibyte buffer, check if we must decode the result or not.
+
+2003-05-29 Kenichi Handa <[email protected]>
+
+ * coding.c (make_conversion_work_buffer): Change the work buffer
+ name to the same one as that of Emacs 21.
+
+2003-05-28 Kenichi Handa <[email protected]>
+
+ * coding.h (make_conversion_work_buffer): Prototype adjusted.
+ (code_conversion_restore): Don't extern it.
+
+ * coding.c (detected_mask): Delete unused variable.
+ (decode_coding_iso_2022): Pay attention to the byte sequence of
+ CTEXT extended segment, and retain those bytes as is.
+ (decode_coding_ccl): Delete unused variable `valids'.
+ (setup_coding_system): Delete unused variable `category'.
+ (consume_chars): Delete unused variable `category'. Make it work
+ for non-multibyte case.
+ (make_conversion_work_buffer): Argument changed.
+ (saved_coding): Delete unused variable.
+ (code_conversion_restore): Don't check saved_coding->destination.
+ (code_conversion_save): New function.
+ (decode_coding_gap, encode_coding_gap): Call code_conversion_save
+ instead of record_unwind_protect.
+ (decode_coding_object, encode_coding_object): Likewise. Recover
+ PT.
+ (detect_coding_system): Delete unused variable `mask'.
+ (Fdefine_coding_system_internal): Delete unsed vaiable id;
+
+ * fileio.c (kill_workbuf_unwind): New function.
+ (Finsert_file_contents): On replacing, call
+ make_conversion_work_buffer with correct args, and call
+ record_unwind_protect with the first arg kill_workbuf_unwind.
+
+ * lisp.h (Fgenerate_new_buffer_name): EXFUN it.
+
+2003-05-20 Kenichi Handa <[email protected]>
+
+ * fontset.c (BASE_FONTSET_P): Check FONTSET_BASE, not
+ FONTSET_NAME.
+ (fontset_add): Fix for the case that TO is less than TO1.
+ (Ffontset_info): Don't use fallback fontset on checking the
+ default fontset.
+ (dump_fontset): New function for debugging.
+
+ * coding.c (Fdefine_coding_system_internal): Fix for the case that
+ coding_type is Qcharset.
+
+2003-05-07 Kenichi Handa <[email protected]>
+
+ * chartab.c (map_sub_char_table): New argument DEFAULT_VAL.
+ (map_char_table): Don't inherit the value from the parent on
+ initializing VAL. Adjusted for the above change.
+
+2003-05-06 Kenichi Handa <[email protected]>
+
+ * coding.c (Qsignature, Qendian): Delete these variables.
+ (syms_of_coding): Don't initialize them.
+ (CATEGORY_MASK_UTF_16_AUTO): New macro.
+ (detect_coding_utf_16): Add CATEGORY_MASK_UTF_16_AUTO in
+ detect_info->found.
+ (decode_coding_utf_16): Don't detect BOM here.
+ (encode_coding_utf_16): Produce BOM if CODING_UTF_16_BOM (coding)
+ is NOT utf_16_without_bom.
+ (setup_coding_system): For a coding system of type utf-16, check
+ if the attribute :endian is Qbig or not (not nil or not), and set
+ CODING_REQUIRE_DETECTION_MASK if BOM detection is required.
+ (detect_coding): If coding type is utf-16 and BOM detection is
+ required, detect it.
+ (Fdefine_coding_system_internal): For a coding system of type
+ utf-16, check if the attribute :endian is Qbig or not (not nil or
+ not).
+
+2003-05-06 Kenichi Handa <[email protected]>
+
+ * coding.c (coding_set_source): Fix for the case that the current
+ buffer is different from coding->src_object.
+ (decode_coding_object): Don't use the conversion work buffer if
+ DST_OBJECT is a buffer.
+
+2003-05-04 Dave Love <[email protected]>
+
+ * lread.c (read_emacs_mule_char) [len==2]: Index
+ emacs_mule_charset correctly.
+
+2003-02-16 Dave Love <[email protected]>
+
+ * coding.c (Qbig5, Vbig5_coding_system, CATEGORY_MASK_BIG5)
+ (detect_coding_big5, decode_coding_big5, encode_coding_big5)
+ (Fdecode_big5_char, Fencode_big5_char): Deleted. (Big5 no longer
+ treated specially.)
+ (setup_coding_system, coding_category, CATEGORY_MASK_ANY)
+ (detected_mask): Remove Big5 bits.
+
+2003-04-09 Kenichi Handa <[email protected]>
+
+ The following changes are to make the font rescaling facility
+ compatible with Emacs 21.
+
+ * xfaces.c (Vface_font_rescale_alist): Renamed from
+ Vface_resizing_fonts.
+ (struct font_name): Rename member resizing_ratio to rescale_ratio.
+ (font_rescale_ratio): Renamed from font_resizing_ratio.
+ (split_font_name): Set font->rescale_ratio.
+ (better_font_p): Pay attention to font->rescale_ratio.
+ (build_scalable_font_name): Likewise. Change RESX, and RESY
+ fields.
+ (syms_of_xfaces): Declare Vface_font_rescale_alist as a Lisp
+ variable.
+
+2003-03-28 Kenichi Handa <[email protected]>
+
+ * coding.c (Qutf_16_be_nosig, Qutf_16_be, Qutf_16_le_nosig)
+ (Qutf_16_le): Remove these variables.
+ (syms_of_coding): Don't DEFSYM them.
+ (decode_coding_utf_16): Fix handling of BOM.
+ (encode_coding_utf_16): Fix handling of BOM.
+
+2003-03-14 Kenichi Handa <[email protected]>
+
+ * fileio.c (Finsert_file_contents): On replacing, before decoding
+ the file into the work buffer, set point of the work buffer to the
+ end.
+
+2003-02-13 Dave Love <[email protected]>
+
+ * coding.c (Fcheck_coding_systems_region): Fix type errors.
+
+2003-02-04 Dave Love <[email protected]>
+
+ * xterm.c (XTread_socket): Check Lisp types for Vx_keysym_table
+ and fix C types.
+
+2003-01-31 Kenichi Handa <[email protected]>
+
+ * xdisp.c (SKIP_GLYPHS): New macro.
+ (set_cursor_from_row): Pay attention to string display properties.
+
+ * category.c (copy_category_entry): Fix for the case that RANGE
+ is an integer.
+
+ * xterm.c (x_encode_char): Call ccl_driver with the last arg Qnil.
+
+ * w32term.c (w32_encode_char): Call ccl_driver with the last arg
+ Qnil.
+
+2003-01-30 Kenichi Handa <[email protected]>
+
+ * charset.c (Fcharset_id_internal): New function.
+ (syms_of_charset): Defsubr it.
+
+ * coding.c (decode_coding_ccl, encode_coding_ccl): Call ccl_driver
+ with the last arg charset_list acquired from coding.
+ (Fdefine_coding_system_internal): For ccl-based coding system, fix
+ the attribute coding_attr_ccl_valids.
+
+ * coding.h (enum define_coding_ccl_arg_index): Set the first
+ member coding_arg_ccl_decoder to coding_arg_max.
+
+ * ccl.h (ccl_driver): Prototype adjusted.
+
+ * ccl.c (CCL_DECODE_CHAR, CCL_ENCODE_CHAR): New macros.
+ (ccl_driver): New arg CHARSET_LIST. Use the above macros instead
+ of DECODE_CAHR, ENCODE_CHAR, CHAR_CHARSET.
+ (Fccl_execute): Call ccl_driver with the last arg Qnil.
+ (Fccl_execute_on_string): Likewise.
+
+2003-01-11 Kenichi Handa <[email protected]>
+
+ * charset.h (ENCODE_CHAR): If the method is SUBSET or SUPERSET,
+ call encode_char.
+
+ * charset.c (encode_char): Fix handling of methods SUBSET and
+ SUPERSET.
+
+ * xterm.c (x_new_fontset): Fix previous change.
+
+2003-01-10 Dave Love <[email protected]>
+
+ * composite.c (syms_of_composite): Make composition_hash_table
+ weak.
+
+2003-01-10 Kenichi Handa <[email protected]>
+
+ * dispextern.h (check_face_attributes, generate_ascii_font_name)
+ (font_name_registry): Don't extern them.
+ (split_font_name_into_vector, build_font_name_from_vector): Extern
+ them.
+
+ * fontset.h (Qfontset): Don't extern it.
+ (new_fontset_from_font_name): Extern it.
+
+ * fontset.c: Give 8 extra slots to fontset objects.
+ (Qfontset_info): New variable.
+ (syms_of_fontset): Defsym it.
+ (FONTSET_FALLBACK): New macro.
+ (fontset_face): Try also the default fontset.
+ (make_fontset): Realize a fallback fontset from the default
+ fontset.
+ (generate_ascii_font_name): Moved from xfaces.c. Rewritten by
+ using split_font_name_into_vector and build_font_name_from_vector.
+ (Fset_fontset_font): Access the elements of font_spec by enum
+ FONT_SPEC_INDEX. If font_spec is a string, extract the registry
+ name by using split_font_name_into_vector.
+ (Fnew_fontset): If no ASCII font is specified in FONTLIST,
+ generate a proper font name from the fontset name. Update
+ Vfontset_alias_alist.
+ (n_auto_fontsets): New variable.
+ (new_fontset_from_font_name): New function.
+ (Ffont_info): Store the information about fonts generated from the
+ default fontset in the first extra slot of the returned
+ char-table.
+
+ * xfaces.c (generate_ascii_font_name): Moved to fontset.c.
+ (font_name_registry): Function deleted.
+ (split_font_name_into_vector): New function.
+ (build_font_name_from_vector): New function.
+ (font_list): The argument REGISTRY is now a list of registry
+ names.
+ (choose_face_font): If we are choosing an ASCII font, and ATTRS
+ specifies an explicit font name, return the name as is. Make a
+ list of registy names.
+
+ * xfns.c (x_set_font, x_create_tip_frame): Adjusted to the change
+ of x_new_fontset.
+ (Fx_create_frame): Don't call x_new_fontset here. Just use
+ x_list_fonts to check the existence of fonts.
+
+ * xterm.h (x_new_fontset): Prototype adjusted.
+
+ * xterm.c (x_new_fontset): Change the arg FONTSETNAME to Lisp
+ string. Use new_fontset_from_font_name to create a fontset from a
+ font name.
+
+2003-01-07 Dave Love <[email protected]>
+
+ * Makefile.in: Fix some dependencies.
+
+ * keymap.c (Fapropos_internal): Don't gcpro apropos_predicate but
+ set it to nil before returning.
+
+ * composite.c (update_compositions): Fix type error.
+
+ * syntax.c (skip_chars, skip_syntaxes): Fix type errors.
+
+2003-01-07 Kenichi Handa <[email protected]>
+
+ * xterm.c (x_new_font): Optimize for the case that the font is
+ already set for the frame.
+
+2003-01-06 Kenichi Handa <[email protected]>
+
+ * chartab.c (char_table_ascii): Check if the char table contents
+ is sub-char-table or not.
+ (char_table_set): Fix argument to char_table_ascii.
+ (char_table_set_range): Likewise.
+
+ * coding.c (CATEGORY_MASK_RAW_TEXT): New macro.
+ (detect_coding_utf_8, detect_coding_utf_16)
+ (detect_coding_emacs_mule, detect_coding_iso_2022)
+ (detect_coding_sjis, detect_coding_big5)
+ (detect_coding_ccl, detect_coding_charset): Change argument MASK
+ to DETECT_INFO. Update DETECT_INFO and return 1 if the byte
+ sequence is valid in this coding system. Callers changed.
+ (MAX_ANNOTATION_LENGTH): New macro.
+ (ADD_ANNOTATION_DATA): New macro.
+ (ADD_COMPOSITION_DATA): Argument changed. Callers changed. Call
+ ADD_ANNOTATION_DATA. The format of annotation data changed.
+ (ADD_CHARSET_DATA): New macro.
+ (emacs_mule_char): New argument ID. Callers changed.
+ (decode_coding_emacs_mule, decode_coding_iso_2022)
+ (decode_coding_sjis, decode_coding_big5, decode_coding_charset):
+ Produce charset annotation data in coding->charbuf.
+ (encode_coding_emacs_mule, encode_coding_iso_2022): Pay attention
+ to charset annotation data in coding->charbuf.
+ (setup_coding_system): Add CODING_ANNOTATE_CHARSET_MASK
+ coding->common_flags if the coding system is iso-2022 based and
+ uses designation.
+ (produce_composition): Adjusted for the new annotation data
+ format.
+ (produce_charset): New function.
+ (produce_annotation): Handle charset annotation.
+ (handle_composition_annotation, handle_charset_annotation): New
+ functions.
+ (consume_chars): Handle charset annotation. Utilize the above two
+ functions.
+ (encode_coding_object): If SRC_OBJECT and DST_OBJECT are the same
+ buffer, get the deleted text as a string and set
+ coding->src_object to that string.
+ (detect_coding, detect_coding_system): Use the new struct
+ coding_detection_info.
+
+ * coding.h (struct coding_detection_info): New structure.
+ (struct coding_system): Prototype of the member `detector'
+ adjusted.
+ (CODING_ANNOTATE_CHARSET_MASK): New macro.
+
+2003-01-06 Kenichi Handa <[email protected]>
+
+ * insdel.c (insert_from_gap): Fix argument to offset_intervals.
+
+2003-01-03 Dave Love <[email protected]>
+
+ * keymap.c (apropos_predicate, apropos_accumulate): Declare
+ static.
+ (Fapropos_internal): Don't gcpro apropos_accumulate. Set result
+ to new local and nullify apropos_accumulate before returning.
+ (syms_of_keymap): Staticpro and initialize apropos_accumulate.
+
+2002-12-05 Kenichi Handa <[email protected]>
+
+ * charset.c (Fdefine_charset_internal): Setup charset.fast_map
+ correctly.
+
+2002-11-26 Dave Love <[email protected]>
+
+ * fns.c (Flanginfo): Call synchronize_system_time_locale.
+
+2002-11-07 Kenichi Handa <[email protected]>
+
+ The following changes are to make character composition happen
+ automatically on displaying.
+
+ * Makefile.in (lisp, shortlisp): Add composite.elc
+
+ * composite.h (Qauto_composed, Vauto_composition_function,
+ Qauto_composition_function): Extern them.
+
+ * composite.c (Vcomposition_function_table,
+ Qcomposition_function_table): Delete variables.
+ (Qauto_composed, Vauto_composition_function,
+ Qauto_composition_function): New variables.
+ (run_composition_function): Don't call
+ compose-chars-after-function.
+ (update_compositions): Clear `auto-composed' text property.
+ (compose_chars_in_text): Delete this function.
+ (syms_of_composite): Staticpro Qauto_composed and
+ Qauto_composition_function. Declare Vauto_composition_function as
+ a Lisp variable.
+
+ * dispextern.h (enum prop_idx): Add member AUTO_COMPOSED_PROP_IDX.
+
+ * xdisp.c (it_props): Add an entry for Qauto_composed.
+ (handle_auto_composed_prop): New function.
+
+ * xselect.c (selection_data_to_lisp_data): Don't call
+ compose_chars_in_text.
+
+2002-11-06 Dave Love <[email protected]>
+
+ * keyboard.c (read_char): Modify checking around use of
+ Vkeyboard_translate_table.
+
+ * xterm.c (XTread_socket): Check Lisp types for Vx_keysym_table
+ and fix C types.
+
+2002-11-06 Kenichi Handa <[email protected]>
+
+ * coding.c (decode_coding_utf_8): When eol_type is Qdos, handle
+ the case that the last byte is '\r' correctly.
+ (decode_coding_emacs_mule): Likewise.
+ (decode_coding_iso_2022): Likewise.
+ (decode_coding_sjis): Likewise.
+ (decode_coding_big5): Likewise.
+ (decode_coding_charset): Likewise.
+ (produce_chars): Likewise.
+ (decode_coding): Flushing out the unprocessed data correctly.
+ (decode_coding_gap): Set CODING_MODE_LAST_BLOCK bit of
+ coding->mode.
+
+2002-10-31 Dave Love <[email protected]>
+
+ * xterm.c (XTread_socket): Fix changes for defined keysyms. Add
+ XK_ISO... case.
+ (xaw_scroll_callback): Revert last change.
+
+2002-10-30 Kenichi Handa <[email protected]>
+
+ * charset.c (Fset_charset_priority): Update
+ Viso_2022_charset_list.
+
+2002-10-29 Kenichi Handa <[email protected]>
+
+ * xfaces.c (Vface_resizing_fonts): New variable.
+ (struct font_name): New member `resizing_ratio'.
+ (font_resizing_ratio): New function.
+ (split_font_name): Set font->resizing_ratio.
+ (better_font_p): Pay attention to font->resizing_ratio.
+ (build_scalable_font_name): Likewise. Don't change POINT_SIZE,
+ RESX, and RESY fields.
+ (try_alternative_families): Try scalable fonts if
+ Vscalable_fonts_allowed is not Qt.
+ (syms_of_xfaces): Declare Vface_resizing_fonts as a Lisp variable.
+
+2002-10-29 Dave Love <[email protected]>
+
+ * xterm.c (xaw_scroll_callback): Cast correctly.
+
+2002-10-28 Dave Love <[email protected]>
+
+ * keyboard.c (lispy_accent_codes, lispy_accent_keys): Extend.
+ (lispy_kana_keys): Comment out.
+ (make_lispy_event) [XK_kana_A]: Comment out.
+
+ * xterm.c (xaw_scroll_callback): Cast call_data.
+ (XTread_socket): Deal with ASCII keysyms.
+ (syms_of_xterm) <Vx_keysym_table>: Fix args of make_hash_table.
+
+2002-10-27 Dave Love <[email protected]>
+
+ * xterm.c (Vx_keysym_table): New.
+ (syms_of_xterm): Initialize it.
+ (XTread_socket): Use it.
+ From head: Eliminate incorrect optimization that tried to avoid
+ decoding the output of X*LookupString.
+ (x_get_font_repertory): Delete charset declaration.
+
+2002-10-16 Kenichi Handa <[email protected]>
+
+ * coding.c (detect_coding): Fix previous change.
+ (detect_coding_charset): If only ASCII bytes are found, return 0.
+ (detect_coding_system): Fix previous change.
+ (Fdefine_coding_system_internal): Setup CODING_ATTR_ASCII_COMPAT
+ (attrs) correctly.
+
+2002-10-15 Dave Love <[email protected]>
+
+ * coding.c (Fcheck_coding_system): Doc fix.
+
+ * editfns.c (Finsert_byte): Return a proper value.
+
+2002-10-14 Kenichi Handa <[email protected]>
+
+ * coding.c (decode_coding): Fix args to translate_chars. Pay
+ attention to Vstandard_translation_table_for_decode.
+ (encode_coding): Fix args to translate_chars. Pay attention to
+ Vstandard_translation_table_for_encode.
+
+ * data.c (Faset): Check NEWELT by ASCII_CHAR_P, not by
+ SINGLE_BYTE_CHAR_P.
+
+ * editfns.c (general_insert_function): Check VAL by ASCII_CHAR_P,
+ not by SINGLE_BYTE_CHAR_P.
+
+ * fns.c (concat): Check CH by ASCII_CHAR_P, not by
+ SINGLE_BYTE_CHAR_P.
+
+ * insdel.c (copy_text): Check C by ASCII_CHAR_P, not by
+ SINGLE_BYTE_CHAR_P.
+
+ * keymap.c (Ftext_char_description): Check C by ASCII_CHAR_P, not
+ by SINGLE_BYTE_CHAR_P.
+
+ * search.c (Freplace_match): Check C by ASCII_CHAR_P, not by
+ SINGLE_BYTE_CHAR_P.
+
+2002-10-14 Dave Love <[email protected]>
+
+ * fns.c (Fstring_as_multibyte, Fstring_to_multibyte): Doc fix.
+
+2002-10-10 Dave Love <[email protected]>
+
+ * fns.c (Flanginfo): Fix typo.
+
+ * unexelf.c (unexec): Make last change conditional on Irix 6.5.
+
+2002-10-10 Kenichi Handa <[email protected]>
+
+ * coding.c (detect_coding_utf_8): Check incomplete byte sequence.
+ Don't update *mask when correctly detected.
+ (detect_coding_utf_16): Likewise.
+ (detect_coding_emacs_mule): Likewise.
+ (detect_coding_iso_2022): Likewise.
+ (detect_coding_sjis): Likewise.
+ (detect_coding_big5): Likewise.
+ (detect_coding_ccl): Likewise.
+ (decode_coding_sjis): Fix decoding of katakana-jisx0201.
+ (detect_eol): Delete the argument CODING, and add the argument
+ CATEGORY.
+ (detect_coding): Adjusted for the changes above.
+ (detect_coding_system): Likewise.
+
+2002-10-09 Kenichi Handa <[email protected]>
+
+ * character.c (char_string): Renamed from
+ char_string_with_unification. Pay attention to
+ CHAR_MODIFIER_MASK.
+ (string_char): Renamed from string_char.
+
+ * character.h (CHAR_STRING): Call char_string if C is greater than
+ MAX_3_BYTE_CHAR.
+ (CHAR_STRING_ADVANCE): Likewise.
+ (STRING_CHAR): Call string_char instead of
+ string_char_with_unification.
+ (STRING_CHAR_AND_LENGTH): Likewise.
+ (STRING_CHAR_ADVANCE): Likewise.
+
+2002-10-09 Dave Love <[email protected]>
+
+ * coding.c (decode_coding_utf_8): Treat surrogates as invalid.
+
+2002-10-07 Kenichi Handa <[email protected]>
+
+ * keymap.c (push_key_description): Pay attention to
+ force_multibyte.
+
+ * regex.c (re_search_2): Fix for the case of unibyte buffer.
+
+2002-10-06 Dave Love <[email protected]>
+
+ * charset.c (define_charset_internal): Rename `supprementary'.
+
+ * Makefile.in (lisp, shortlisp): Remove latin-N.
+
+2002-10-05 Dave Love <[email protected]>
+
+ * xfns.c (x_window, x_window): Use use_xim.
+
+ * xterm.c (use_xim): Initialize.
+ (xim_open_dpy, xim_initialize, xim_close_dpy): Use use_xim.
+ (x_term_init): Maybe set use_xim.
+
+ * xterm.h (use_xim) [HAVE_X_I18N]: Declare.
+
+2002-10-01 Kenichi Handa <[email protected]>
+
+ * search.c (search_buffer): Fix case-fold-search of multibyte
+ characters.
+ (boyer_moore): Rename the last argument to char_high_bits.
+
+2002-09-27 Kenichi Handa <[email protected]>
+
+ * xdisp.c (display_string): Fix for the case of zero width glyph.
+
+ * xfns.c (x_set_font): Change the error message of the case that
+ x_new_fontset returns Qt.
+
+ * xfaces.c (set_lface_from_font_name): Reject the default fontset.
+ (Finternal_set_lisp_face_attribute): Use signal_error for the
+ error of invalid fontset.
+
+ * xterm.c (x_new_fontset): If FONTSETNAME specifies the default
+ fontset, return Qt.
+
+2002-09-19 Kenichi Handa <[email protected]>
+
+ * regex.c (re_search_2): Fix previous change.
+
+2002-09-18 Kenichi Handa <[email protected]>
+
+ * syntax.c (skip_syntaxes): Fix previous change.
+
+2002-09-13 Kenichi Handa <[email protected]>
+
+ * syntax.c (skip_chars): Fix previous change.
+ (skip_syntaxes): Fix previous change.
+
+2002-09-06 Dave Love <[email protected]>
+
+ * config.in: Restore it.
+
+2002-09-05 Dave Love <[email protected]>
+
+ * config.in: Removed (now auto-generated).
+
+ * s/usg5-4.h: Fix last change.
+
+ * unexelf.c (unexec): Make .got handling not SGI-specific.
+
+ * syntax.c (syms_of_syntax) <multibyte-syntax-as-symbol>: Doc fix.
+
+ * regex.c: Use `ifdef HAVE_ALLOCA_H', not `if HAVE_ALLOCA_H'.
+
+ * keyboard.c (read_key_sequence): Fix type error.
+
+ * buffer.c (Fset_buffer_multibyte, Fset_buffer_multibyte): Fix
+ type error.
+
+ * fontset.c (fontset_add): Return Lisp_Object.
+
+2002-09-03 Dave Love <[email protected]>
+
+ * charset.h (charset_ordered_list_tick): Declare extern.
+
+2002-09-03 Kenichi Handa <[email protected]>
+
+ The following changes (and some of 2002-08-20 changes of mine) are
+ for handling syntax, category, and case conversion for unibyte
+ characters by converting them to multibyte on the fly. With these
+ changes, we don't have to setup syntax and case tables for unibyte
+ characters in each language environment.
+
+ * abbrev.c (Fexpand_abbrev): Convert a unibyte character to
+ multibyte if necessary.
+
+ * bytecode.c (Fbyte_code): Likewise.
+
+ * character.h (LEADING_CODE_LATIN_1_MIN)
+ (LEADING_CODE_LATIN_1_MAX): New macros.
+ (unibyte_to_multibyte_table): Extern it.
+ (unibyte_char_to_multibyte): New macro.
+ (MAKE_CHAR_MULTIBYTE): Use unibyte_to_multibyte_table.
+ (CHAR_LEADING_CODE): New macro.
+ (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE): New macro.
+
+ * character.c (unibyte_to_multibyte_table): New variable.
+ (unibyte_char_to_multibyte): Move to character.h and defined as
+ macro.
+ (multibyte_char_to_unibyte): If C is an eight-bit character,
+ convert it to the corresponding byte value.
+
+ * charset.c (Fset_unibyte_charset): If the dimension of CHARSET is
+ not 1, singals an error. Update the elements of
+ unibyte_to_multibyte_table.
+ (init_charset_once): Initialize unibyte_to_multibyte_table.
+ (syms_of_charset): Define the charset `iso-8859-1'.
+
+ * casefiddle.c (casify_object): Fix previous change.
+
+ * cmds.c (internal_self_insert): In a multibyte buffer, insert C
+ as is without converting it to unibyte. In a unibyte buffer,
+ convert C to multibyte before checking the syntax.
+
+ * lisp.h (unibyte_char_to_multibyte): Extern deleted.
+
+ * minibuf.c (Fminibuffer_complete_word): Use the macro
+ FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE.
+
+ * regex.h (struct re_pattern_buffer): New member target_multibyte.
+
+ * regex.c (RE_TARGET_MULTIBYTE_P): New macro.
+ (GET_CHAR_BEFORE_2): Check target_multibyte, not multibyte. If
+ that is zero, convert an eight-bit char to multibyte.
+ (MAKE_CHAR_MULTIBYTE, CHAR_LEADING_CODE): New dummy new macros for
+ non-emacs case.
+ (PATFETCH): Convert an eight-bit char to multibyte.
+ (HANDLE_UNIBYTE_RANGE): New macro.
+ (regex_compile): Setup the compiled pattern for multibyte chars
+ even if the given regex string is unibyte. Use PATFETCH_RAW
+ instead of PATFETCH in many places. To handle `charset'
+ specification of unibyte, call HANDLE_UNIBYTE_RANGE. Use bitmap
+ only for ASCII chars.
+ (analyse_first) <exactn>: Simplified because the compiled pattern
+ is multibyte.
+ <charset_not>: Setup fastmap from bitmap only for ASCII chars.
+ <charset>: Use CHAR_LEADING_CODE to get leading codes.
+ <categoryspec>: If multibyte, setup fastmap only for ASCII chars
+ here.
+ (re_compile_fastmap) [emacs]: Call analyse_first with the arg
+ multibyte always 1.
+ (re_search_2) In emacs, set the locale variable multibyte to 1,
+ otherwise to 0. New local variable target_multibyte. Check it
+ to decide the multibyteness of STR1 and STR2. If
+ target_multibyte is zero, convert unibyte chars to multibyte
+ before translating and checking fastmap.
+ (TARGET_CHAR_AND_LENGTH): New macro.
+ (re_match_2_internal): In emacs, set the locale variable multibyte
+ to 1, otherwise to 0. New local variable target_multibyte. Check
+ it to decide the multibyteness of STR1 and STR2. Use
+ TARGET_CHAR_AND_LENGTH to fetch a character from D.
+ <charset, charset_not>: If multibyte is nonzero, check fastmap
+ only for ASCII chars. Call bcmp_translate with
+ target_multibyte, not with multibyte.
+ <begline>: Declare the local variable C as `unsigned'.
+ (bcmp_translate): Change the last arg name to target_multibyte.
+
+ * search.c (compile_pattern_1): Don't adjust the multibyteness of
+ the regexp pattern and the matching target. Set cp->buf.multibyte
+ to the multibyteness of the regexp pattern. Set
+ cp->but.target_multibyte to the multibyteness of the matching
+ target.
+ (wordify): Use FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE instead of
+ FETCH_STRING_CHAR_ADVANCE.
+ (Freplace_match): Convert unibyte chars to multibyte.
+
+ * syntax.c (char_quoted): Use FETCH_CHAR_AS_MULTIBYTE to convert
+ unibyte chars to multibyte.
+ (back_comment): Likewise.
+ (scan_words): Likewise.
+ (skip_chars): The arg syntaxp is deleted, and the code for
+ handling syntaxes is moved to skip_syntaxes. Callers changed.
+ Fix the case that the multibyteness of STRING and the current
+ buffer doesn't match.
+ (skip_syntaxes): New function.
+ (SYNTAX_WITH_MULTIBYTE_CHECK): Check C by ASCII_CHAR_P, not by
+ SINGLE_BYTE_CHAR_P.
+ (Fforward_comment): Use FETCH_CHAR_AS_MULTIBYTE to convert unibyte
+ chars to multibyte.
+ (scan_lists): Likewise.
+ (Fbackward_prefix_chars): Likewise.
+ (scan_sexps_forward): Likewise.
+
+2002-08-23 Kenichi Handa <[email protected]>
+
+ * xfaces.c (QCfontset): New variable.
+ (LFACE_FONTSET): New macro.
+ (check_lface_attrs): Check also LFACE_FONTSET_INDEX.
+ (set_lface_from_font_name): Setup LFACE_FONTSET (lface).
+ (Finternal_set_lisp_face_attribute): Handle QCfontset.
+ (Finternal_get_lisp_face_attribute): Likewise.
+ (lface_same_font_attributes_p): Fix checking of LFACE_FONT_INDEX,
+ check also LFACE_FONTSET_INDEX.
+ (face_fontset): Check attrs[LFACE_FONTSET_INDEX], not
+ attrs[LFACE_FONT_INDEX].
+ (syms_of_xfaces): Intern and staticpro QCfontset.
+
+ * dispextern.h (enum lface_attribute_index): New member
+ LFACE_FONTSET_INDEX.
+
+ * fns.c (base64_encode_1): Handle eight-bit chars correctly.
+
+2002-08-21 Kenichi Handa <[email protected]>
+
+ * coding.c (coding_set_destination): Fix coding->destination for
+ the case converting a region.
+ (encode_coding_utf_8): Encode eight-bit chars as single byte.
+ (encode_coding_object): Fix coding->dst_pos and
+ coding->dst_pos_byte for the case converting a region.
+
+ * insdel.c (insert_from_gap): Make it work even if PT != GTP.
+
+ * character.h (BYTE8_STRING): New macro.
+
+ * fns.c (base64_decode_1): Insert eight-bit chars correctly.
+
+2002-08-20 Kenichi Handa <[email protected]>
+
+ * xdisp.c (get_next_display_element): Don't display unibyte 8-bit
+ characters by octal form.
+
+ * abbrev.c (Fexpand_abbrev): Fix for the multibyte case.
+
+ * buffer.h (_fetch_multibyte_char_len): Extern deleted.
+ (FETCH_MULTIBYTE_CHAR): Don't use _fetch_multibyte_char_len.
+ (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
+ (FETCH_CHAR_AS_MULTIBYTE): New macro.
+
+ * casetab.c (set_canon, set_identity, shuffle): Simplified.
+
+ * casefiddle.c (casify_object): Simplified. Handle the case that
+ the case conversion change the byte length.
+ (casify_region): Likewise
+
+ * character.h (MAKE_CHAR_UNIBYTE, MAKE_CHAR_MULTIBYTE): New
+ macros.
+
+ * character.c (_fetch_multibyte_char_len): This variable deleted.
+ (syms_of_character): Setup Vprintable_chars.
+
+ * editfns.c (Fchar_equal): Fix for the unibyte case.
+ (Finsert_byte): New function.
+ (syms_of_editfns): Defsubr it.
+
+ * keyboard.c (read_key_sequence): Use ~CHAR_MODIFIER_MASK instead
+ of direct code 0x3ffff.
+
+ * search.c (Freplace_match): Fix for the unibyte case.
+
+2002-08-19 Kenichi Handa <[email protected]>
+
+ * lread.c (safe_to_load_p): Fix the logic.
+
+ * syntax.c (scan_words): Don't treat characters belonging to
+ different scripts as constituting a word.
+
+ * editfns.c (Fformat): Use ASCII_CHAR_P, not SINGLE_BYTE_CHAR_P.
+
+ * fontset.c (Fset_fontset_font): Treat `ascii' as charset, not
+ script.
+
+ * emacs.c (main): In the case of --unibyte, instead of aborting on
+ finding non-empty buffer, make it unibyte.
+
+2002-08-18 Kenichi Handa <[email protected]>
+
+ * xterm.c (x_new_fontset): Call `create-fontset-from-ascii-font'
+ to create a fontset.
+
+2002-08-18 Dave Love <[email protected]>
+
+ * character.c (Funibyte_char_to_multibyte): Doc fix.
+
+ * xfns.c [HAVE_STDLIB_H]: Fix last change.
+
+2002-08-15 Kenichi Handa <[email protected]>
+
+ * fontset.c (fontset_add): Make the type `int'.
+ (fontset_id_valid_p): Define it if FONTSET_DEBUG is defined.
+
+ * character.c (unibyte_char_to_multibyte): Refer to
+ charset_unibyte, not charset_primary.
+ (multibyte_char_to_unibyte): Likewise.
+ (Funibyte_char_to_multibyte): Likewise.
+
+ * charset.h: (charset_unibyte): Extern it instead of
+ charset_primary.
+
+ * charset.c (charset_unibyte): Renamed from charset_primary.
+ (Funibyte_charset): Renamed from Fprimary_charset.
+ (Fset_unibyte_charset): Renamed from Fset_primary_charset.
+ (syms_of_charset): Adjusted for the above changes.
+
+ * w32term.c (x_produce_glyphs): Use ASCII_CHAR_P, not
+ SINGLE_BYTE_CHAR_P. Fix the logic of handling non-ASCII char when
+ it->multibyte_p is zero.
+
+ * lisp.h (nonascii_insert_offset, Vnonascii_translation_table):
+ Extern deleted.
+
+2002-08-08 Kenichi Handa <[email protected]>
+
+ * coding.c (Fdefine_coding_system_internal): Fix category setting
+ for a coding system of type iso-2022.
+
+2002-08-02 Kenichi Handa <[email protected]>
+
+ * fontset.h (FS_LOAD_FONT): Call fs_load_font with the arg CHARSET
+ -1.
+
+2002-08-01 Kenichi Handa <[email protected]>
+
+ * syntax.c (Vnext_word_boundary_function_table): New variable.
+ (syms_of_syntax): Declare it as a Lisp variable.
+ (scan_words): Call functions in Vnext_word_boundary_function_table
+ if any.
+
+ * xterm.c (x_load_font): Initialize fontp->fontset to -1.
+
+ * fontset.c (fs_load_font): If fontp->charset is not negative,
+ return fontp without setting its members.
+
+2002-07-31 Dave Love <[email protected]>
+
+ * config.in: Generated with autoheader.
+
+ * xfns.c [HAVE_STDLIB_H]: Change logic (instead of fixing typo).
+
+ * m/sparc.h (HAVE_ALLOCA): Delete.
+
+ * s/irix6-5.h: Don't include strings.h.
+ (bcopy, bzero, bcmp): Don't undef.
+
+ * s/irix6-0.h (bcopy, bzero, bcmp): Don't undef.
+
+ * s/usg5-4.h (NO_SIOCTL_H): Don't define.
+ (TIOCSIGSEND): Don't test IRIX6.
+ (bcopy, bzero, bcmp): Define conditionally.
+
+2002-07-31 Kenichi Handa <[email protected]>
+
+ * buffer.c (Qas, Qmake, Qto): New variables.
+ (Fset_buffer_multibyte): New optional arg METHOD. Caller changed.
+ (syms_of_buffer): Intern and staticpro Qas, Qmake, and Qto.
+
+ * callproc.c (Fcall_process): Don't call insert_1_both directly if
+ we are inserting a process output into a multibyte buffer.
+
+ * character.h (CHAR_TO_BYTE8): If C is not eight-bit char, call
+ multibyte_char_to_unibyte.
+
+ * character.c (Funibyte_char_to_multibyte): If C can't be decoded
+ by the primary charset, make it eight-bit char.
+ (Fmultibyte_char_to_unibyte): Call CHAR_TO_BYTE8.
+
+ * charset.c: (charset_eight_bit, Qeight_bit_control): New
+ variables.
+ (charset_8_bit__control, charset_8_bit_graphic,
+ Qeight_bit_control, Qeight_bit_graphic): These variables deleted.
+ (define_charset_internal): New function.
+ (syms_of_charset): Call define_charset_internal for pre-defined
+ charsets.
+
+ * charset.h (charset_8_bit): Extern it.
+
+ * coding.c (make_conversion_work_buffer): Adjusted for the change
+ of Fset_buffer_multibyte.
+ (encode_coding_raw_text): Increment p0 in the loop.
+
+ * lisp.h (Fset_buffer_multibyte): Prototype adjusted.
+
+ * xdisp.c (setup_echo_area_for_printing, set_message_1): Adjusted
+ for the change of Fset_buffer_multibyte.
+
+ * fns.c (Fstring_to_multibyte): New function.
+ (syms_of_fns): Declare Fstring_to_multibyte as Lisp subroutine.
+
+2002-07-30 Dave Love <[email protected]>
+
+ * xfns.c (x_put_x_image): Declare args.
+
+ * xfaces.c (font_name_registry, choose_face_font): Delete unused
+ vars.
+ (try_font_list): Declare an arg.
+
+ * xdisp.c (message2_nolog, set_message): Declare an arg.
+
+ * terminfo.c (tparam): Declare an arg. Use P_ to declare tparm.
+
+ * syntax.c (scan_sexps_forward): Declare an arg.
+
+ * scroll.c (calculate_scrolling, calculate_direct_scrolling):
+ Declare an arg.
+
+ * lisp.h (Fnew_fontset): Declare.
+
+ * keymap.c (push_key_description): Call CHARACTERP correctly.
+
+ * fontset.c (fontset_add): Declare args. Call make_number
+ correctly.
+ (face_for_char): Delete unused vars.
+ (Fset_fontset_font): Doc fix. Delete unused vars.
+
+ * doc.c (Fsubstitute_command_keys): Delete unused vars.
+
+ * composite.c (update_compositions): Declare arg.
+
+ * cm.c (calccost, cmgoto): Declare args.
+
+ * charset.c: Remove `emacs' conditional. Doc fixes.
+ (map_char_table_for_charset): Declare.
+
+ * character.c (syms_of_character) <translation-table-vector>: Doc
+ fix.
+
+ * ccl.c: Remove `emacs' conditional. Include hash table stuff
+ from trunk.
+
+2002-07-26 Kenichi Handa <[email protected]>
+
+ The following changes are to allow specifying multiple font
+ patterns for a character range (specified by script or charset).
+
+ * Makefile.in (abbrev.o): Depend on syntax.h.
+ (xfaces.o): Depend on charset.h.
+
+ * alloc.c (Fmake_string): Use ASCII_CHAR_P, not
+ SINGLE_BYTE_CHAR_P.
+
+ * ccl.c (Fccl_execute_on_string): Add `const' to local variables.
+
+ * character.h (Vchar_script_table): Extern it.
+
+ * character.c (Vscript_alist): This variable deleted.
+ (Vchar_script_table, Qchar_script_table): New variable.
+ (syms_of_character): Declare Vchar_script_table as a lisp variable
+ and initialize it.
+
+ * chartab.c (Fmake_char_table): Doc fixed. If PURPOSE doesn't
+ have property char-table-extra-slots, make no extra slot.
+
+ * dispextern.h (struct face): Member `charset' deleted.
+ (FACE_SUITABLE_FOR_CHAR_P): Use ASCII_CHAR_P, not
+ SINGLE_BYTE_CHAR_P.
+ (FACE_FOR_CHAR): Likewise.
+ (choose_face_font, lookup_non_ascii_face, font_name_registry): Add
+ prototypes
+ (lookup_face, lookup_named_face, lookup_derived_face): Prototype
+ fixed.
+ (generate_ascii_font_name): Renamed from generate_ascii_font.
+
+ * fontset.h (get_font_repertory_func): New prototype.
+ (make_fontset_for_ascii_face, fs_load_font): Prototypes fixed.
+ (FS_LOAD_FONT): Call fs_load_font with the 3rd arg charset_ascii.
+
+ * fontset.c (Qprepend, Qappend): New variables.
+ (FONTSET_CHARSET_ALIST, FONTSET_FACE_ALIST): These macros deleted.
+ (FONTSET_NOFONT_FACE, FONTSET_REPERTORY): New macros.
+ (FONTSET_REF): Optimize if FONTSET is Vdefault_fontset.
+ (FONTSET_REF_AND_RANGE, FONTSET_ADD): New macros.
+ (fontset_ref_and_range, fontset_add, reorder_font_vector)
+ (load_font_get_repertory): New functions.
+ (fontset_set): This function deleted.
+ (fontset_face): New arg FACE. Return face ID, not face.
+ Completely re-written to handle new fontset structure. Caller
+ changed.
+ (free_face_fontset): Use ASET istead of AREF (X) = Y.
+ (face_for_char): Don't call lookup_face.
+ (make_fontset_for_ascii_face): New arg FACE.
+ (fs_load_font): New arg CHARSET_ID. Don't check
+ Vfont_encoding_alist here.
+ (find_font_encoding): New function.
+ (list_fontsets): Use STRINGP, not ! NILP.
+ (accumulate_script_ranges): New function.
+ (Fset_fontset_font, Fnew_fontset, Ffontset_info): Completely
+ re-written to handle new fontset structure.
+ (Ffontset_font): Return a copy of element.
+ (syms_of_fontset): Define symbols Qprepend and Qappend. Fix
+ docstring of font-encoding-alist.
+
+ * lisp.h (CHAR_TABLE_REF): Remove unnecessary check (IDX >= 0).
+ (Fset_fotset_font): Fix arguments to 5.
+
+ * msdos.c (XMenuActivate): Adjuted for the change of
+ lookup_derived_face.
+
+ * xdisp.c (message_dolog, set_message_1, extend_face_to_end_of_line):
+ Use ASCII_CHAR_P, not SINGLE_BYTE_CHAR_P.
+ (highlight_trailing_whitespace): Adjusted for the change of
+ lookup_named_face.
+
+ * xfaces.c: Include charset.h.
+ (load_face_font): Argument C deleted. Caller changed.
+ (generate_ascii_font_name): Renamed from generate_ascii_font.
+ (font_name_registry): New function.
+ (cache_face): Store ascii faces before non-ascii faces in buckets.
+ (lookup_face): Arguments C and BASE_FACE deleted. Caller changed.
+ Lookup only ascii faces.
+ (lookup_non_ascii_face): New function.
+ (lookup_named_face): Argument C deleted. Caller changed.
+ (lookup_derived_face): Argument C deleted. Caller changed.
+ (try_font_list): New arg PATTERN. Caller changed. If PATTERN is
+ a string, just call font_list with it.
+ (choose_face_font): Arguments FACE and C deleted. New arg
+ FONT_SPEC. Caller changed.
+ (realize_face): Arguments C and BASE_FACE deleted. Caller
+ (realize_x_face): Likewise.
+ (realize_non_ascii_face): New function.
+ (realize_x_face): Call load_face_font here.
+ (realize_tty_face): Argument C deleted. Caller changed.
+ (compute_char_face): If CH is not ascii, call FACE_FOR_CHAR to
+ get a face ID.
+ (dump_realized_face): Don't print charset of FACE.
+
+ * xfns.c (x_set_font): Always call x_new_fontset and
+ store_frame_parameter.
+ (Fx_create_frame): Call x_new_fontset, not x_new_font.
+ (syms_of_xfns): Set get_font_repertory_func to
+ x_get_font_repertory.
+
+ * xterm.h (x_get_font_repertory): Extern it.
+
+ * xterm.c (x_produce_glyphs): Use ASCII_CHAR_P, not
+ SINGLE_BYTE_CHAR_P. Fix the logic of handling non-ASCII char when
+ it->multibyte_p is zero.
+ (XTread_socket): Use ASCII_CHAR_P, not SINGLE_BYTE_CHAR_P.
+ (x_new_fontset): If FONTSETNAME doesn't match any existing
+ fontsets, create a new one.
+ (x_get_font_repertory): New function.
+
+2002-07-25 Kenichi Handa <[email protected]>
+
+ * coding.c (Ffind_coding_systems_region_internal): Detect an
+ ASCII only string correctly.
+
+ * lread.c (Fload): Don't load with Qload_force_doc_strings t if
+ version is 0.
+
+2002-07-24 Kenichi Handa <[email protected]>
+
+ * lread.c: Include "coding.h".
+ (Qget_emacs_mule_file_char, Qload_force_doc_strings,
+ load_each_byte, unread_char): New variables.
+ (readchar_backlog): This variable deleted.
+ (readchar): Return a character unless load_each_byte is nonzero.
+ Handle the case that readcharfun is Qget_emacs_mule_file_char or a
+ cons. If unread_char is not -1, simply return it.
+ (unreadchar): Handle the case that readcharfun is
+ Qget_emacs_mule_file_char or a cons. Set unread_char if
+ necessary.
+ (read_multibyte): This function deleted.
+ (readbyte_for_lambda, readbyte_from_file, readbyte_from_string)
+ (read_emacs_mule_char): New functions.
+ (Fload): Even if the file doesn't have the extention ".elc", if
+ safe_to_load_p returns a positive version number, assume that the
+ file contains bytecompiled code. If the version is less than 22,
+ load the file while decoding multibyte sequences by emacs-mule.
+ (readevalloop): Don't use readchar_backlog.
+ (Fread): Likewise. Pay attention to the case that STREAM is a
+ cons.
+ (Fread_from_string): Pay attention to the case that STREAM is a
+ cons.
+ (read_escape): The arg BYTEREP deleted.
+ (read1): Set load_each_byte to 1 temporarily while handling
+ #@NUMBER. Don't call read_multibyte.
+ (read_vector): Call Fread with a cons. If readcharfun is
+ Qget_emacs_mule_file_char, decode the read string by emacs-mule.
+ (read_list): If doc_reference is 2, make the cdr part string as
+ unibyte.
+ (syms_of_lread): Intern and staticpro Qget_emacs_mule_file_char
+ and Qload_force_doc_strings.
+
+2002-07-23 Kenichi Handa <[email protected]>
+
+ * xdisp.c (face_before_or_after_it_pos): Call
+ FETCH_MULTIBYTE_CHAR with byte postion, not char position.
+
+2002-07-22 Kenichi Handa <[email protected]>
+
+ * character.h (TRAILING_CODE_P): New macro.
+ (MAYBE_UNIFY_CHAR): Adjusted for the change of Funify_charset.
+ (string_char_with_unification): Fix prototype.
+ (Vscript_alist): Extern it.
+
+ * character.c (Vscript_alist): New variable.
+ (string_char_with_unification): Add `const' to local variables.
+ (str_as_unibyte): Likewise.
+ (string_escape_byte8): Likewise.
+ (syms_of_character): Declare script-alist as a Lisp variable.
+
+ * charset.h (Vcharset_ordered_list): Extern it.
+ (charset_ordered_list_tick): Extern it.
+ (EMACS_MULE_LEADING_CODE_PRIVATE_11)
+ (EMACS_MULE_LEADING_CODE_PRIVATE_12)
+ (EMACS_MULE_LEADING_CODE_PRIVATE_21)
+ (EMACS_MULE_LEADING_CODE_PRIVATE_22): New macros
+ (Funify_charset): Adjusted for the change of Funify_charset.
+
+ * charset.c (charset_ordered_list_tick): New variable.
+ (Fdefine_charset_internal): Increment charset_ordered_list_tick.
+ (Funify_charset): New optional arg DEUNIFY. If it is non-nil,
+ deunify intead of unify a charset.
+ (string_xstring_p): Add `const' to local variables.
+ (find_charsets_in_text): Add `const' to arguemnts and local
+ variables.
+ (encode_char): Adjusted for the change of Funify_charset. Fix
+ detecting of invalid code.
+ (Fset_charset_priority): Increment charset_ordered_list_tick.
+ (Fmap_charset_chars): Fix handling of default value for FROM_CODE
+ and TO_CODE.
+
+ * coding.c (LEADING_CODE_PRIVATE_11, LEADING_CODE_PRIVATE_12)
+ (LEADING_CODE_PRIVATE_21, LEADING_CODE_PRIVATE_22): Macros
+ deleted. Callers changed to use
+ EMACS_MULE_LEADING_CODE_PRIVATE_11, etc.
+ (decode_coding_ccl): Add `const' to local variables.
+ (consume_chars): Likewise.
+ (Ffind_coding_systems_region_internal): Likewise.
+ (Fcheck_coding_systems_region): Likewise.
+
+ * print.c (print_object): Use octal form for printing the
+ contents of a bool vector.
+
+2002-07-18 Dave Love <[email protected]>
+
+ * lread.c (Fload) <!load_dangerous_libraries>: Don't leak fd.
+ <version == 20>: Refuse to load.
+
+2002-07-17 Dave Love <[email protected]>
+
+ * fns.c: Move coding.h.
+ (Qcodeset, Qdays, Qmonths): New.
+ (concat): Use CHARACTERP instead of INTERGERP.
+ (Flocale_codeset): Deleted.
+ (Flanginfo): New function.
+ (syms_of_fns): Changed accordingly.
+
+ * coding.c (adjust_coding_eol_type): Fix eol_type/eol_seen mixup.
+
+2002-07-16 Dave Love <[email protected]>
+
+ * casetab.c (init_casetab_once, init_casetab_once): Fix
+ CHAR_TABLE_SET call.
+
+ * category.c (Fmodify_category_entry): Fix CATEGORY_MEMBER call.
+
+ * character.c (syms_of_character): Fix CHAR_TABLE_SET call.
+
+ * charset.c (Fmap_charset_chars): Check args. Convert Lisp types.
+ (load_charset_map, Fdeclare_equiv_charset, Fencode_char)
+ (Fset_charset_priority, syms_of_charset): Convert Lisp types.
+
+ * charset.h (CHECK_CHARSET_GET_ID): Use XINT on AREF result.
+
+ * coding.c (ENCODE_DESIGNATION, decode_eol)
+ (make_conversion_work_buffer, code_conversion_restore)
+ (Fdefine_coding_system_internal): Convert Lisp types.
+ (code_conversion_restore): Use EQ, not ==.
+ (Fencode_coding_string): Fix code_convert_string call.
+
+ * coding.h (code_convert_region): Fix prototype.
+
+ * dispextern.h (redraw_frame, redraw_garbaged_frames): Removed.
+
+ * fontset.c (fontset_ref, fontset_set, fs_load_font)
+ (Ffontset_info): Convert Lisp types.
+
+ * syntax.h (SYNTAX_ENTRY_INT): Don't use make_number.
+
+ * xterm.c (note_mouse_movement): Fix call of window_from_coordinates.
+
+ * xdisp.c (display_mode_element): Fix call of Fset_text_properties.
+
+ * chartab.c: Include "...h", not <...h> in some cases.
+
+ * callproc.c (Fcall_process): Remove unused variables.
+
+2002-07-12 Dave Love <[email protected]>
+
+ * coding.c (Fset_coding_system_priority): Allow null arg list.
+
+2002-07-03 Dave Love <[email protected]>
+
+ * minibuf.c (Fminibuffer_complete_word): Remove unused var.
+ (Fself_insert_and_exit): Use CHARACTERP.
+
+ * callproc.c (Fcall_process): Remove unused vars.
+
+ * xterm.c (XTread_socket): Add extra dead keysyms.
+
+ * xdisp.c (decode_mode_spec_coding): Use CHARACTERP.
+
+ * dispextern.h: Remove prototypes for redraw_frame,
+ redraw_garbaged_frames.
+
+ * cmds.c (Fself_insert_command): Use CHARACTERP.
+
+ * chartab.c (make_sub_char_table): Remove unused var.
+ (Fset_char_table_default, Fmap_char_table): Doc fix.
+
+ * keymap.c (access_keymap): Remove generic char code.
+ (push_key_description): Use CHARACTERP.
+
+2002-07-01 Dave Love <[email protected]>
+
+ * charset.c: Doc fixes.
+ (Funify_charset): Extra checking.
+
+2002-06-24 Dave Love <[email protected]>
+
+ * lread.c: Remove some unused variables.
+ (safe_to_load_p): If safe, return the magic number version byte.
+ (Fload): Maybe use load-with-code-conversion.
+
+2002-06-12 Kenichi Handa <[email protected]>
+
+ * category.c (Fmodify_category_entry): Don't modify the contents
+ of category_set for characters out of the range. Avoid
+ unnecessary modification.
+
+ * character.h (MAYBE_UNIFY_CHAR): Adjusted for the change of
+ Vchar_unify_table. The default value of the table is now nil.
+
+ * character.c (syms_of_character): Setup Vchar_width_table for
+ eight-bit-control and raw-byte chars.
+
+ * charset.h (enum define_charset_arg_index): Delete
+ charset_arg_parents and add charset_arg_subset and
+ charset_arg_superset.
+ (enum charset_attr_index): Delete charset_parents and add
+ charset_subset and charset_superset.
+ (enum charset_method): Delete CHARSET_METHOD_INHERIT and add
+ CHARSET_METHOD_SUBSET and CHARSET_METHOD_SUPERSET.
+ (CHARSET_ATTR_PARENTS, CHARSET_PARENTS): Macros deleted.
+ (CHARSET_ATTR_SUBSET, CHARSET_ATTR_SUPERSET, CHARSET_SUBSET)
+ (CHARSET_SUPERSET): New macros.
+ (charset_work): Extern it.
+ (ENCODE_CHAR): Use charset_work.
+ (CHAR_CHARSET_P): Adjusted for the change of encoder format.
+ (map_charset_chars): Extern it.
+
+ * charset.c (load_charset_map): Set the default value of encoder
+ and deunifier char-tables to nil.
+ (map_charset_chars): Argument changed. Callers changed. Use
+ map_char_table_for_charset instead of map_char_table.
+ (Fmap_charset_chars): New optional args from_code and to_code.
+ (Fdefine_charset_internal): Adjusted for the change of
+ `define-charset' (:parents -> :subset or :superset).
+ (charset_work): New variable.
+ (encode_char): Adjusted for the change of
+ Fdefine_charset_internal.
+ (syms_of_charset): Likewise.
+ (Ffind_charset_string): Setup the vector `charsets' correctly.
+
+ * chartab.c (sub_char_table_ref_and_range): New arg defalt. Fix
+ the previous change.
+ (char_table_ref_and_range): Adjusted for the above change.
+ (map_sub_char_table_for_charset): New function.
+ (map_char_table_for_charset): New function.
+
+ * keymap.c (describe_vector): Handle a char-table directly here.
+ (describe_char_table): Deleted.
+
+ * lisp.h (map_charset_chars): Deleted.
+
+2002-06-11 Dave Love <[email protected]>
+
+ * fns.c (count_combining): Comment out (unused).
+ (Flocale_codeset): New.
+ (syms_of_fns): Defsubr it.
+
+ * config.in (HAVE_PTY_H, HAVE_SIZE_T, HAVE_LANGINFO_CODESET): New.
+ (size_t): Removed.
+
+2002-06-06 Dave Love <[email protected]>
+
+ * Makefile.in (chartab.o): Depend on charset.h
+
+2002-06-03 Kenichi Handa <[email protected]>
+
+ * character.c (syms_of_character): Set the default value of
+ Vprintable_chars to Qnil.
+
+2002-05-31 Dave Love <[email protected]>
+
+ * Makefile.in (lisp, shortlisp): Change indian.elc to indian.el.
+
+2002-05-31 Kenichi Handa <[email protected]>
+
+ * charset.c (load_charset_map): Handle the case that from < to
+ correctly.
+
+ * coding.c (encode_coding_emacs_mule): Pay attention to raw-8-bit
+ chars.
+ (encode_coding_iso_2022): Likewise.
+ (encode_coding_sjis): Likewise.
+ (encode_coding_big5): Likewise.
+ (encode_coding_charset): Likewise.
+
+2002-05-30 Kenichi Handa <[email protected]>
+
+ * Makefile.in (lisp): Change chinese.elc to chinese.el. They are
+ not bytecompiled now.
+ (shortlisp): Likewise.
+
+ * charset.c (charset_jisx0201_roman, charset_jisx0208_1978)
+ (charset_jisx0208): New variables.
+ (Fdefine_charset_internal): Setup them if appropriate.
+ (init_charset_once): Initialize them to -1.
+
+ * charset.h (charset_jisx0201_roman, charset_jisx0208_1978,
+ charset_jisx0208): Extern them.
+
+ * coding.c (CODING_ISO_FLAG_USE_ROMAN): New macro
+ (CODING_ISO_FLAG_USE_OLDJIS): New macro.
+ (CODING_ISO_FLAG_FULL_SUPPORT): Macro definition changed.
+ (setup_iso_safe_charsets): Fix arguemtns to Fassq.
+ (DECODE_DESIGNATION): Pay attention to CODING_ISO_FLAG_USE_ROMAN
+ and CODING_ISO_FLAG_USE_OLDJIS.
+ (ENCODE_ISO_CHARACTER_DIMENSION1): Likewise.
+ (ENCODE_ISO_CHARACTER_DIMENSION2): Likewise.
+ (encode_coding_iso_2022): Change the 1st arg to
+ ENCODE_ISO_CHARACTER to a variable.
+
+2002-05-29 Kenichi Handa <[email protected]>
+
+ * charset.h (enum define_charset_arg_index): New enums
+ charset_arg_min_code and charset_arg_max_code.
+ (struct charset): New member char_index_offset.
+
+ * charset.c (CODE_POINT_TO_INDEX): Take charset->char_index_offset
+ into account.
+ (INDEX_TO_CODE_POINT): Likewise.
+ (Fdefine_charset_internal): Handle args[charset_arg_min_code] and
+ args[charset_arg_max_code]. Setup charset.char_index_offset.
+ (syms_of_charset): Fix args to Fdefine_charset_internal.
+
+2002-05-27 Dave Love <[email protected]>
+
+ * coding.c (decode_coding_utf_8): Reject overlong sequences.
+
+2002-05-26 Dave Love <[email protected]>
+
+ * coding.c: Doc fixes.
+ (Fcoding_system_aliases): Fix return value.
+ (Qmac): Remove (duplicated) definition.
+
+2002-05-25 Dave Love <[email protected]>
+
+ * charset.c (Fcharset_priority_list, Fset_charset_priority): New
+ functions.
+
+ * character.c (Fstring): Doc fix.
+
+ * charset.c (Fdefine_charset_alias): Update Vcharset_list.
+
+ * fontset.c (Ffontset_info): Doc fix. Return charset names, not
+ ids.
+ (font-encoding-alist): Doc fix.
+
+2002-05-24 Dave Love <[email protected]>
+
+ * term.c (costs_set): Declare static, non-initialized for pcc.
+ (encode_terminal_code): Remove ensued var.
+
+ * keyboard.c (kbd_buffer_store_event): Fix interrupt_signal decl
+ for K&R.
+
+ * xterm.c (xlwmenu_window_p): Fix prototype for K&R.
+
+ * coding.c (setup_iso_safe_charsets): Fix arg decl for K&R.
+ (suffixes): Moved out of make_subsidiaries for K&R.
+
+ * charset.c (map_charset_chars): Fix c_function declaration for
+ K&R.
+
+ * lisp.h (DEFUN) [!PROTOTYPES]: Remove spurious `args'.
+
+2002-05-23 Dave Love <[email protected]>
+
+ * data.c (Fchar_or_string_p): Doc fix. Use CHARACTERP.
+
+ * category.c (Fmodify_category_entry): Doc fix. Remove unused
+ vars.
+
+2002-05-23 Yong Lu <[email protected]>
+
+ * charset.c (Fdefine_charset_internal): Fix argument to bzero.
+
+ * coding.c (Fdefine_coding_system_internal): Fix previous change.
+ (decode_coding_charset): Workaround for the bug of GCC 2.96.
+
+2002-05-23 Kenichi Handa <[email protected]>
+
+ * Makefile.in (lisp): Change cyrillic.elc to cyrillic.el,
+ vietnamese.elc to vietnamese.el. They are not bytecompiled now.
+ (shortlisp): Likewise.
+
+2002-05-22 Kenichi Handa <[email protected]>
+
+ * coding.c (decode_coding_charset): Adjusted for the change of
+ Fdefine_coding_system_internal.
+ (Fdefine_coding_system_internal): For a coding system of
+ `charset' type, store a list of charset IDs in
+ `charset_attr_charset_valids' element of coding attributes.
+
+ * charset.c (Fmake_char): Fix previous change.
+
+2002-05-21 Kenichi Handa <[email protected]>
+
+ * coding.c (ONE_MORE_BYTE_NO_CHECK): Increment consumed_chars.
+ (emacs_mule_char): New arg src. Delete arg `composition'. Caller
+ changed. Handle 2-byte and 3-byte charsets correctly.
+ (DECODE_EMACS_MULE_COMPOSITION_RULE_20): Renamed from
+ DECODE_EMACS_MULE_COMPOSITION_RULE. Caller changed.
+ (DECODE_EMACS_MULE_COMPOSITION_RULE_21): New macro.
+ (DECODE_EMACS_MULE_21_COMPOSITION): Call
+ DECODE_EMACS_MULE_COMPOSITION_RULE_21. Produce correct annotation
+ sequence.
+ (decode_coding_emacs_mule): Handle composition correctly. Rewind
+ `src' and `consumed_chars' correctly before calling
+ emacs_mule_char.
+ (DECODE_COMPOSITION_START): Correctly handle the case of altchar
+ and alt&rule composition.
+ (decode_coding_iso_2022): Handle composition correctly.
+ (init_coding_once): Setup emacs_mule_bytes for private charsets.
+
+ * charset.c (Fdefine_charset_internal): Fix bug for the case of
+ re-defining a charset. If the charset has :emacs-mule-id, setup
+ emacs_mule_bytes.
+ (Fmake_char): If CODE1 is nil, use the minimum code of the
+ charset.
+
+2002-05-20 Kenichi Handa <[email protected]>
+
+ * coding.c (encode_coding_iso_2022): If coding requires safe
+ encoding, produce a character specified by
+ CODING_INHIBIT_CHARACTER_SUBSTITUTION.
+ (encode_coding_sjis): Likewise.
+ (encode_coding_big5): Likewise.
+ (encode_coding_charset): Likewise.
+
+2002-05-17 Dave Love <[email protected]>
+
+ * xterm.c (XSetIMValues): Declare.
+
+ * process.c: Conditionally include sys/wait.h, pty.h.
+
+ * print.c (print_object): Fix print format for 64-bit
+ systems.
+
+ * keyboard.c (modify_event_symbol): Fix print format for 64-bit
+ systems.
+
+ * buffer.c (emacs_strerror): Declare.
+ (MMAP_ALLOCATED_P, mmap_enlarge, syms_of_buffer): Import changes
+ from trunk.
+
+ * fontset.c (Fclear_face_cache): Declare.
+ (accumulate_font_info): Commented-out (unused).
+ (face_for_char, Fset_fontset_font, Ffontset_info): Remove unused
+ variables.
+
+ * character.h (string_escape_byte8): Declare.
+
+ * charset.c (load_charset_map, load_charset_map_from_file): Remove
+ unused vars.
+ (Fdefine_charset_internal, Fsplit_char, syms_of_charset)
+ (Fmap_charset_chars): Doc fix.
+
+ * coding.c (Vchar_coding_system_table, Qchar_coding_system):
+ Removed.
+ (Fset_coding_system_priority, Fset_coding_system_priority)
+ (Fdefine_coding_system_internal): Doc fix.
+
+2002-05-16 Dave Love <[email protected]>
+
+ * s/osf5-0.h (C_SWITCH_SYSTEM) [!__GNUC__]: Remove -nointrinsics.
+
+2002-05-16 Kenichi Handa <[email protected]>
+
+ * character.c (string_escape_byte8): Make multibyte string with
+ correct size.
+
+ * charset.c (Fmake_char): Delete unnecessary code.
+
+2002-05-14 Kenichi Handa <[email protected]>
+
+ * xfns.c (x_encode_text): Allocate coding.destination here, and
+ call encode_coding_object with dst_object Qnil.
+
+ * buffer.c (Fset_buffer_multibyte): Convert 8-bit bytes to
+ multibyte form correctly.
+
+ * fontset.c (fs_load_font): Check fontp->full_name (not fontname)
+ against Vfont_encoding_alist.
+
+ * coding.c (Fdecode_sjis_char): Fix typo (0x7F->0xFF). Fix the
+ handling of charset list.
+ (encode_coding_iso_2022): Setup coding->safe_charsets in advance.
+ (decode_coding_object): Move point to coding->dst_pos before
+ calling post-read-conversion function.
+ (encode_coding_object): Give correct arguments to
+ pre-write-conversion. Ignore the return value of
+ pre-write-conversion function. Pay attention to the case that
+ pre-write-conversion changes the current buffer. If dst_object is
+ Qt, even if coding->src_bytes is zero, allocate at least one byte
+ to coding->destination.
+
+ * coding.h (JIS_TO_SJIS): Fix typo (j1->s1, j2->s2).
+
+ * charset.c (Fmake_char): Make it more backward compatible.
+ (Fmap_charset_chars): Fix docstring.
+
+2002-05-13 Dave Love <[email protected]>
+
+ * coding.c: Doc fixes.
+ (Fdefine_coding_system_alias): Use names, not symbols, in
+ coding-system-alist.
+
+2002-05-13 Kenichi Handa <[email protected]>
+
+ * fontset.c (free_realized_fontsets): Call Fclear_face_cache instead
+ of calling free_realized_face.
+
+2002-05-10 Yong Lu <[email protected]>
+
+ * charset.c (load_charset_map): Fix previous change.
+ (read_hex): Don't treat SPC as a comment starter.
+ (decode_char): If CODE_POINT_TO_INDEX retruns -1, always return
+ -1.
+ (Fdecode_char): Fix typo.
+
+2002-05-10 Kenichi Handa <[email protected]>
+
+ * charset.h (struct charset): New member `code_space_mask'.
+
+ * coding.c (coding_set_source): Delete the local variable
+ beg_byte.
+ (encode_coding_charset): Delete the local variable charset.
+ (Fdefine_coding_system_internal): Likewise.
+ (Fdefine_coding_system_internal): Setup
+ attrs[coding_attr_charset_valids] correctly.
+
+ * charset.c (CODE_POINT_TO_INDEX): Utilize `code_space_mask'
+ member to check if CODE is valid or not.
+ (Fdefine_charset_internal): Initialize `code_space_mask' member.
+ (encode_char): Before calling CODE_POINT_TO_INDEX, check if CODE
+ is within the range of charset->min_code and carset->max_code.
+
+2002-05-09 Dave Love <[email protected]>
+
+ * syntax.h (syntax_temp) [!__GNUC__]: Declare.
+
+ * dispextern.h (generate_ascii_font): Fix return type.
+
+ * xfaces.c (generate_ascii_font): Fix arg declaration.
+
+ * coding.c (coding_inherit_eol_type)
+ (Fset_terminal_coding_system_internal)
+ (Fset_safe_terminal_coding_system_internal): Fix arg declarations.
+
+2002-05-08 Kenichi Handa <[email protected]>
+
+ * coding.c (decode_coding_charset, encode_coding_charset): Handle
+ multiple charsets correctly.
+
+2002-05-07 Kenichi Handa <[email protected]>
+
+ * search.c (boyer_moore): Fix handling of mulitbyte character
+ translation.
+
+ * xdisp.c (display_mode_element): When the variable `elt' is
+ changed, update `this' and `lisp_string'.
+
+2002-05-07 Kenichi Handa <[email protected]>
+
+ * buffer.c (Fset_buffer_multibyte): Fix 8-bit char handling.
+
+ * callproc.c (Fcall_process): Be sure to give the current buffer
+ to decode_coding_c_string. Update PT and PT_BYTE after the
+ insertion.
+
+ * charset.c (struct charset_map_entries): New struct.
+ (load_charset_map): Renamed from parse_charset_map. New args
+ entries and n_entries. Caller changed.
+ (load_charset_map_from_file): Renamed from load_charset_map.
+ Caller changed. New arg control_flag. Call load_charset_map at
+ the tail.
+ (load_charset_map_from_vector): New function.
+ (Fdefine_charset_internal): Setup charset.compact_codes_p.
+ (encode_char): If the charset is compact, change a character index
+ to a code point.
+
+ * coding.c (coding_alloc_by_making_gap): Check the case that the
+ source and destination are the same correctly.
+ (decode_coding_raw_text): Set coding->consumed_char and
+ coding->consumed to 0.
+ (produce_chars): If coding->chars_at_source is nonzero, update
+ coding->consumed_char and coding->consumed before calling
+ alloc_destination.
+ (Fdefine_coding_system_alias): Register ALIAS in
+ Vcoding_system_alist.
+ (syms_of_coding): Define `no-convesion' coding system at the tail.
+
+ * fileio.c (Finsert_file_contents): Set coding_system instead of
+ val. If the current buffer is multibyte, always call
+ decode_coding_gap.
+
+ * xfaces.c (try_font_list): Give higher priority to fontset's
+ family than face's family.
+
+2002-04-18 Kenichi Handa <[email protected]>
+
+ * callproc.c (Fcall_process): Be sure to give the current buffer
+ to decode_coding_c_string.
+
+ * xfaces.c (try_font_list): Give a family specified in a fontset
+ higher priority than a family specified in a face.
+
+2002-04-09 Kenichi Handa <[email protected]>
+
+ * fileio.c (Finsert_file_contents): Fix calculation of `inserted'.
+ Fix arguments to insert_from_buffer.
+
+ * xdisp.c (display_mode_element): Fix calculation of `bytepos'.
+
+2002-03-11 Kenichi Handa <[email protected]>
+
+ * coding.c (produce_chars): Set the variable `multibytep' correctly.
+ (decode_coding_gap): Set coding->dst_multibyte correctly.
+
+2002-03-07 Kenichi Handa <[email protected]>
+
+ * coding.c (encode_coding_utf_8): Initialize produced_chars to 0.
+ (decode_coding_utf_16): Fix converting high and low bytes to
+ code-point.
+ (encode_coding_utf_16): Substitute coding->default_char for
+ non-Unicode characters.
+ (decode_coding): Don't call record_insert here.
+ (setup_coding_system): Initialize `surrogate' of
+ coding->spec.utf_16 to 0.
+ (EMIT_ONE_BYTE): Fix for multibyte case.
+
+ * insdel.c (insert_from_gap): Call record_insert.
+
+2002-03-04 Kenichi Handa <[email protected]>
+
+ * casefiddle.c (casify_region): Fix multibyte case.
+
+ * character.c (c_string_width): Add return type `int'.
+ (char_string_with_unification): Arg ADVANCED deleted.
+
+ * character.h (CHAR_VALID_P): Don't call CHARACTERP.
+ (CHAR_STRING): Adjusted for the change of
+ char_string_with_unification.
+ (CHAR_STRING_ADVANCE): Make it do-while statement.
+
+ * chartab.c (sub_char_table_set_range): Optimized for the case
+ DEPTH == 3. Add workaround code for a GCC optimization bug.
+
+ * charset.c (parse_charset_map): Remove an unused variable.
+
+ * coding.c: Delete unused variables.
+
+ * fileio.c (Finsert_file_contents): Set coding_system to Qnil
+ earlier. If inserted is zero and the coding system doesn't
+ require flushing, don't call decode_coding_gap.
+
+ * syntax.h (SET_RAW_SYNTAX_ENTRY): Don't call make_number.
+
+2002-03-01 Kenichi Handa <[email protected]>
+
+ The following changes are for using Unicode as an internal
+ character model, and use UTF-8 format for buffer/string
+ representation.
+
+ * .gdbinit (xchartable): Adjusted for the change of char table
+ structure.
+ (xsubchartable, xcoding, xcharset, xcurbuf): New commands.
+
+ * Makefile.in (obj): Add character.o and chartab.o.
+ (lisp, shortlisp): Remove utf-8.elc:
+ (*.o): For many files, change dependency on charset.h to
+ character.h, and add dependency on character.h.
+ (character.o, chartab.o): New targets.
+
+ * abbrev.c, bytecode.c, casefiddle.c, cmds.c, dispnew.c, doc.c,
+ doprnt.c, dosfns.c, frame.c, marker.c, minibuf.c, msdos.c,
+ w16select.c, w32bdf.c, w32console.c: Include "character.h" instead
+ of "charset.h".
+
+ * dired.c, filelock.c: Include "character.h".
+
+ * alloc.c: Include "character.h" instead of "charset.h".
+ (Fmake_char_table): Moved to chartab.c.
+ (make_sub_char_table): Likewise.
+ (syms_of_alloc): Remove defsubr for Smake_char_table.
+
+ * buffer.c: Include "character.h" instead of "charset.h", don't
+ include "coding.h".
+ (Fset_buffer_multibyte): Adjuted for UTF-8.
+
+ * buffer.h: EXFUN Fbuffer_live_p.
+
+ * callproc.c: Include "character.h" instead of "charset.h".
+ (Fcall_process): Big change for the new code-conversion APIs.
+
+ * casetab.c: Include "character.h" instead of "charset.h".
+ (set_canon, set_identity, shuffle): Adjusted for the new
+ map_char_table spec.
+ (init_casetab_once): Call CHAR_TABLE_SET instead of directly
+ accessing the char table structure.
+
+ * chartab.c: New file that implements char table.
+
+ * category.c: Include "character.h".
+ (copy_category_entry): New function.
+ (copy_category_table): Call map_char_table and copy_category_entry.
+ (Fmake_category_table): Initialize all top-vel slots.
+ (char_category_set): New function.
+ (modify_lower_category_set): Deleted.
+ (Fmodify_category_entry): Call char_table_ref_and_range.
+
+ * category.h (CATEGORY_SET): Just call char_category_set.
+
+ * ccl.c: Include "character.h".
+ (Qccl, Qcclp): New variables.
+ (CCL_WRITE_CHAR): Alway treat the arg CH as a character even if
+ it's less than 256.
+ (CCL_WRITE_MULTIBYTE_CHAR): Deleted.
+ (CCL_WRITE_STRING, CCL_READ_CHAR): Adjusted for the change of SRC
+ and DST type.
+ (ccl_driver): Types of arguments changed. Code adjusted for that.
+ (Fccl_execute, Fccl_execute_on_string): Adjusted for the change of
+ ccl_driver.
+ (syms_of_ccl): Intern and staticpro Qccl and Qcclp.
+
+ * ccl.h (struct ccl_program): Members eol_type and multibyte
+ deleted. New members src_multibyte, dst_multibyte, consumed, and
+ produced.
+ (struct ccl_spec): Members decoder and encoder deleted. New
+ memeber ccl.
+ (CODING_SPEC_CCL_PROGRAM): New macro.
+ (ccl_driver): Prototype updated.
+ (Qccl, Qcclp, Fccl_program_p): Extern them.
+ (CHECK_CCL_PROGRAM): New macro.
+
+ * character.c, character.h, chartab.c: New files.
+
+ * charset.c: Mostly re-written. Character and multibyte sequence
+ handling codes are moved to character.c.
+
+ * charset.h: Mostly re-written. Character and multibyte sequence
+ handling codes are moved to character.h.
+
+ * coding.c, coding.h: Mostly re-written.
+
+ * composite.c: Include "character.h" instead of "charset.h".
+ (CHAR_WIDTH): Moved to character.h.
+ (HASH_KEY, HASH_VALUE): Deleted.
+
+ * composite.h (enum composition_method): Order of enumeration
+ symbols changed.
+
+ * data.c: Include "character.h" instead of "charset.h".
+ (Faref): Call CHAR_TABLE_REF for a char table.
+ (Faset): Call CHAR_TABLE_SET for a char table.
+
+ * dispextern.h (free_realized_face, check_face_attribytes,
+ generate_ascii_font): Extern them.
+ (free_realized_multibyte_face): Extern deleted.
+
+ * disptab.h (DISP_CHAR_VECTOR): Adjusted for the change of char
+ table structure.
+
+ * editfns.c: Include "character.h" instead of "charset.h".
+ (Fchar_to_string): Always call CHAR_STRING.
+
+ * emacs.c (main): Call init_charset_once, init_charset,
+ syms_of_chartab, and syms_of_character.
+
+ * fileio.c: Include "character.h" instead of "charset.h".
+ (Finsert_file_contents): Big change for the new code-conversion
+ API.
+ (choose_write_coding_system): Likewise.
+ (Fwrite_region): Likewise.
+ (build_annotations_2): Deleted.
+ (e_write): Big change for the new code-conversion API.
+
+ * fns.c: Include "character.h" instead of "charset.h".
+ (copy_sub_char_table): Moved to chartab.c.
+ (Fcopy_sequence): Call copy_char_table for a char table.
+ (concat): Delete codes calling count_multibyte.
+ (string_char_to_byte): Adjusted for the new multibyte form.
+ (string_byte_to_char): Likewise.
+ (internal_equal): Adjusted for the change of char table structure.
+ (Fchar_table_subtype, Fchar_table_parent, Fset_char_table_parent,
+ Fchar_table_extra_slot, Fset_char_table_extra_slot,
+ Fchar_table_range, Fset_char_table_range, Fset_char_table_default,
+ char_table_translate, optimize_sub_char_table,
+ Foptimize_char_table, map_char_table, Fmap_char_table): Moved to
+ chartab.c.
+ (char_table_ref_and_index): Deleted.
+ (HASH_KEY, HASH_VALUE): Moved to lisp.h.
+ (Fmd5): Call preferred_coding_system instead of accessing
+ Vcoding_category_list. Adjusted for the new code-conversion API.
+ (syms_of_fns): Defsubr for char table related functions moved to
+ chartab.c.
+
+ * fontset.c: Mostly re-written.
+
+ * fontset.h (struct font_info): Type of the member encoding_type
+ changed.
+ (enum FONT_SPEC_INDEX): New enum.
+ (fontset_font_pattern, fs_load_font): Prototype updated.
+ (FS_LOAD_FONT): Adjusted for the change of fs_load_font.
+
+ * indent.c: Include "character.h" instead of "charset.h".
+ (MULTIBYTE_BYTES_WIDTH): Call CHAR_WIDTH instead of
+ WIDTH_BY_CHAR_HEAD.
+
+ * insdel.c: Include "character.h" instead of "charset.h".
+ (copy_text): Don't refer to Vnonascii_translation_table.
+ (insert_from_gap): New function.
+
+ * keyboard.c: Include "character.h" instead of "charset.h".
+ (command_loop_1): Never call direct_output_forward_char before
+ a non-ASCII character.
+ (read_char): If Vkeyboard_translate_table is a char table, always
+ translated a character.
+
+ * keymap.c: Include "character.h".
+ (store_in_keymap): Handle the case that IDX is a cons.
+ (Fdefine_key): Handle the case that KEY is a cons and the car part
+ is also a cons (range).
+ (push_key_description): Adjusted for the new character code.
+ (describe_vector): Call describe_char_table for a char table.
+ (describe_char_table): New function.
+
+ * keymap.h (describe_char_table): Extern it.
+
+ * lisp.h (enum pvec_type): New member PVEC_SUB_CHAR_TABLE.
+ (XSUB_CHAR_TABLE, XSETSUB_CHAR_TABLE): New macros.
+ (CHAR_TABLE_ORDINARY_SLOTS, CHAR_TABLE_SINGLE_BYTE_SLOTS,
+ SUB_CHAR_TABLE_ORDINARY_SLOTS, SUB_CHAR_TABLE_STANDARD_SLOTS):
+ Deleted.
+ (CHAR_TABLE_REF, CHAR_TABLE_SET): Adjusted for the new char table
+ structure.
+ (CHAR_TABLE_TRANSLATE): Just call char_table_translate.
+ (CHARTAB_SIZE_BITS_0, CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2,
+ CHARTAB_SIZE_BITS_3): New macros.
+ (chartab_size): Extern it.
+ (struct Lisp_Char_Table): Re-designed.
+ (struct Lisp_Sub_Char_Table): New structure.
+ (HASH_KEY, HASH_VALUE): Moved from fns.c.
+ (CHARACTERBITS): Defined as 22.
+ (GLYPH_MASK_FACE, GLYPH_MASK_CHAR): Adjusted for the above change.
+ (SUB_CHAR_TABLE_P): Check PVEC_CHAR_TABLE.
+ (GC_SUB_CHAR_TABLE_P): New macro.
+ (Fencode_coding_string, Fdecode_coding_string): EXFUN Updated.
+ (code_convert_string_norecord): Extern deleted.
+ (init_character_once, syms_of_character, init_charset,
+ syms_of_composite, Qeq, Fmakehash, insert_from_gap): Extern them.
+
+ * lread.c: Include "character.h".
+ (read_multibyte): New arg NBYTES.
+ (read_escape): The meaning of returned *BYTEREP changed.
+ (to_multibyte): Deleted.
+ (read1): Adjuted the handling of char table and string.
+
+ * print.c: Include "character.h" instead of "charset.h".
+ (print_string): Convert 8-bit raw bytes to octal form by
+ string_escape_byte8.
+ (print_object): Adjusted for the new multibyte form. Print 8-bit
+ raw bytes always in octal form. Handle sub char table correctly.
+
+ * process.c: Include "character.h" instead of "charset.h".
+ (read_process_output): Adjusted for the new code-conversion API.
+ (send_process): Likewise.
+
+ * puresize.h (BASE_PURESIZE): Increased.
+
+ * regex.c: Include "character.h" instead of "charset.h".
+ (BYTE8_TO_CHAR, CHAR_BYTE8_P) [not emacs]: New dummy macros.
+ (regex_compile): Accept a range whose starting and ending
+ character have different leading bytes.
+ (analyse_first): Adjusted for the above change.
+
+ * search.c: Include "character.h" instead of "charset.h".
+ (search_buffer, boyer_moore): Adjusted for the new multibyte form.
+ (Freplace_match): Adjusted for the change of
+ multibyte_char_to_unibyte.
+
+ * syntax.c: Include "character.h" instead of "charset.h".
+ (syntax_parent_lookup): Deleted.
+ (Fmodify_syntax_entry): Accept a cons as CHAR.
+ (skip_chars): Adjusted for the new multibyte form.
+ (init_syntax_once): Call char_table_set_range instead of directly
+ accessing the structure of a char table.
+
+ * syntax.h (SET_RAW_SYNTAX_ENTRY): Call CHAR_TABLE_SET.
+ (SYNTAX_ENTRY_FOLLOW_PARENT): Macro deleted.
+ (SET_RAW_SYNTAX_ENTRY_RANGE): New macro.
+ (SYNTAX_ENTRY_INT): Call CHAR_TABLE_REF.
+
+ * term.c: Include "buffer.h" and "character.h".
+ (encode_terminal_code): Adjusted for the new code-conversion API.
+ (write_glyphs): Likewise.
+ (produce_glyphs): Call CHAR_WIDTH instead of CHARSET_WIDTH.
+
+ * w32term.c (x_new_font): Adjusted for the change of FS_LOAD_FONT.
+
+ * xdisp.c: Include "character.h".
+ (get_next_display_element): Adjusted for the new multibyte form.
+ (disp_char_vector): Adjusted for the new char table structure.
+ (decode_mode_spec_coding): Adjusted for the new structure of
+ coding system.
+ (decode_mode_spec): Adjusted for the new code-conversion API.
+
+ * xfaces.c: Include "character.h" instead of "charset.h".
+ (load_face_font): Adjusted for the change of choose_face_font and
+ FS_LOAD_FONT.
+ (generate_ascii_font): New function.
+ (set_lface_from_font_name): Adjusted for the change of
+ FS_LOAD_FONT.
+ (set_font_frame_param): Adjusted for the change of
+ choose_face_font.
+ (free_realized_face): Make it public.
+ (free_realized_faces_for_fontset): Renamed from
+ free_realized_multibyte_face. Free also faces realized for ASCII.
+ (choose_face_font): Argments changed. Adjusted for the change of
+ fontset_font_pattern and FS_LOAD_FONT.
+
+ * xfns.c: Include "character.h".
+ (x_encode_text): Adjusted for the new code-conversion API.
+
+ * xselect.c: Don't include "charset.h".
+ (selection_data_to_lisp_data): Adjusted for the new code
+ covnersion API.
+
+ * xterm.c: Include "character.h".
+ (x_encode_char): New argument CHARSET. Caller changed.
+ (x_get_char_face_and_encoding): Call ENCODE_CHAR instead of
+ SPLIT_CHAR.
+ (x_get_glyph_face_and_encoding): Likewise.
+ (x_produce_glyphs): Don't check Vnonascii_translation_table Call
+ CHAR_WIDTH instead of CHARSET_WIDTH.
+ (XTread_socket): Adjusted for the new code-conversion API.
+ (x_new_font): Adjusted for the change of FS_LOAD_FONT.
+ (x_load_font): Adjusted for the change of struct font.
+
+;; Local Variables:
+;; coding: iso-2022-7bit
+;; End:
+
+ Copyright (C) 2002 Free Software Foundation, Inc.
+ Copying and distribution of this file, with or without modification,
+ are permitted provided the copyright notice and this notice are preserved.
+
+;;; arch-tag: 1bff38bd-2030-46ae-9d18-f15e6006b665
diff --git a/src/Makefile.in b/src/Makefile.in
index f5fc9e4ec3..217e9846e2 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -51,6 +51,7 @@ LIBOBJS = @LIBOBJS@
dot = .
dotdot = ${dot}${dot}
lispsource = ${srcdir}/$(dot)$(dot)/lisp/
+admindir = $(srcdir)/$(dot)$(dot)/admin/
libsrc = $(dot)$(dot)/lib-src/
etc = $(dot)$(dot)/etc/
oldXMenudir = $(dot)$(dot)/oldXMenu/
@@ -75,6 +76,12 @@ SHELL=/bin/sh
#define NOT_C_CODE
#include "config.h"
+/* We will not really call alloca;
+ do not let the file name alloca.c get messed up. */
+#ifdef alloca
+#undef alloca
+#endif
+
/* Do not let the file name mktime.c get messed up. */
#ifdef mktime
#undef mktime
@@ -275,7 +282,7 @@ TOOLKIT_DEFINES =
/* C_SWITCH_X_SITE must come before C_SWITCH_X_MACHINE and C_SWITCH_X_SYSTEM
since it may have -I options that should override those two. */
-ALL_CFLAGS=-Demacs -DHAVE_CONFIG_H $(TOOLKIT_DEFINES) $(MYCPPFLAGS) -I. -I${srcdir} C_SWITCH_MACHINE C_SWITCH_SYSTEM C_SWITCH_SITE C_SWITCH_X_SITE C_SWITCH_X_MACHINE C_SWITCH_X_SYSTEM C_SWITCH_SYSTEM_TEMACS ${CFLAGS_SOUND} ${RSVG_CFLAGS} ${CFLAGS}
+ALL_CFLAGS=-Demacs -DHAVE_CONFIG_H $(TOOLKIT_DEFINES) $(MYCPPFLAGS) -I. -I${srcdir} C_SWITCH_MACHINE C_SWITCH_SYSTEM C_SWITCH_SITE C_SWITCH_X_SITE C_SWITCH_X_MACHINE C_SWITCH_X_SYSTEM C_SWITCH_SYSTEM_TEMACS ${CFLAGS_SOUND} ${RSVG_CFLAGS} ${CFLAGS} @FREETYPE_CFLAGS@ @FONTCONFIG_CFLAGS@ @LIBOTF_CFLAGS@
.c.o:
$(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $<
@@ -585,11 +592,28 @@ emacsapp = $(PWD)/$(mac)Emacs.app/
emacsappsrc = ${srcdir}/../mac/Emacs.app/
#endif
+#ifdef HAVE_WINDOW_SYSTEM
+#ifdef USE_FONT_BACKEND
+FONTSRC = font.h
+#ifdef HAVE_X_WINDOWS
+#if defined (HAVE_XFT)
+FONTOBJ = font.o xfont.o ftfont.o xftfont.o ftxfont.o
+#elif defined (HAVE_FREETYPE)
+FONTOBJ = font.o xfont.o ftfont.o ftxfont.o
+#else /* ! defined (HAVE_XFT) && ! defined (HAVE_FREETYPE) */
+FONTOBJ = font.o xfont.o
+#endif /* ! defined (HAVE_XFT) && ! defined (HAVE_FREETYPE) */
+#else /* ! HAVE_X_WINDOWS */
+FONTOBJ = font.o
+#endif /* ! HAVE_X_WINDOWS */
+#endif /* USE_FONT_BACKEND */
+#endif /* HAVE_WINDOW_SYSTEM */
+
/* lastfile must follow all files
whose initialized data areas should be dumped as pure by dump-emacs. */
obj= dispnew.o frame.o scroll.o xdisp.o $(XMENU_OBJ) window.o \
- charset.o coding.o category.o ccl.o \
- cm.o term.o terminal.o xfaces.o $(XOBJ) $(GTK_OBJ)\
+ charset.o coding.o category.o ccl.o character.o chartab.o \
+ cm.o term.o xfaces.o $(XOBJ) $(GTK_OBJ)\
emacs.o keyboard.o macros.o keymap.o sysdep.o \
buffer.o filelock.o insdel.o marker.o \
minibuf.o fileio.o dired.o filemode.o \
@@ -600,7 +624,7 @@ obj= dispnew.o frame.o scroll.o xdisp.o $(XMENU_OBJ) window.o \
process.o callproc.o \
region-cache.o sound.o atimer.o \
doprnt.o strftime.o intervals.o textprop.o composite.o md5.o \
- $(MSDOS_OBJ) $(MAC_OBJ) $(CYGWIN_OBJ)
+ $(MSDOS_OBJ) $(MAC_OBJ) $(CYGWIN_OBJ) $(FONTOBJ)
/* Object files used on some machine or other.
These go in the DOC file on all machines
@@ -609,7 +633,7 @@ SOME_MACHINE_OBJECTS = sunfns.o dosfns.o msdos.o \
xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o fringe.o image.o \
mac.o macterm.o macfns.o macmenu.o macselect.o fontset.o \
w32.o w32bdf.o w32console.o w32fns.o w32heap.o w32inevt.o \
- w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o
+ w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o $(FONTOBJ)
#ifdef TERMINFO
@@ -644,6 +668,12 @@ mallocobj = $(gmallocobj) $(rallocobj) vm-limit.o
#endif /* SYSTEM_MALLOC */
+#ifndef HAVE_ALLOCA
+allocaobj = alloca.o
+#else
+allocaobj =
+#endif
+
#ifdef USE_X_TOOLKIT
widgetobj= widget.o
#else /* not USE_X_TOOLKIT */
@@ -655,9 +685,9 @@ widgetobj=
should not be told about. */
#ifdef CYGWIN
/* Cygwin differs because of its unexec(). */
-otherobj= $(termcapobj) $(gmallocobj) $(rallocobj) lastfile.o vm-limit.o $(widgetobj) $(LIBOBJS)
+otherobj= $(termcapobj) $(gmallocobj) $(rallocobj) lastfile.o vm-limit.o $(allocaobj) $(widgetobj) $(LIBOBJS)
#else
-otherobj= $(termcapobj) lastfile.o $(mallocobj) $(widgetobj) $(LIBOBJS)
+otherobj= $(termcapobj) lastfile.o $(mallocobj) $(allocaobj) $(widgetobj) $(LIBOBJS)
#endif
#ifdef HAVE_MOUSE
@@ -731,6 +761,7 @@ lisp= \
${lispsource}buff-menu.elc \
${lispsource}button.elc \
${lispsource}emacs-lisp/byte-run.elc \
+ ${lispsource}composite.elc \
${lispsource}cus-face.elc \
${lispsource}cus-start.elc \
${lispsource}custom.elc \
@@ -758,20 +789,11 @@ lisp= \
${lispsource}international/mule-conf.el \
${lispsource}international/mule-cmds.elc \
${lispsource}international/characters.elc \
- ${lispsource}international/ucs-tables.elc \
- ${lispsource}international/utf-8.elc \
- ${lispsource}international/utf-16.elc \
- ${lispsource}international/latin-1.el \
- ${lispsource}international/latin-2.el \
- ${lispsource}international/latin-3.el \
- ${lispsource}international/latin-4.el \
- ${lispsource}international/latin-5.el \
- ${lispsource}international/latin-8.el \
- ${lispsource}international/latin-9.el \
+ ${lispsource}international/charprop.el \
${lispsource}case-table.elc \
- ${lispsource}language/chinese.elc \
- ${lispsource}language/cyrillic.elc \
- ${lispsource}language/indian.elc \
+ ${lispsource}language/chinese.el \
+ ${lispsource}language/cyrillic.el \
+ ${lispsource}language/indian.el \
${lispsource}language/devanagari.el \
${lispsource}language/kannada.el \
${lispsource}language/malayalam.el \
@@ -787,9 +809,10 @@ lisp= \
${lispsource}language/japanese.el \
${lispsource}language/korean.el \
${lispsource}language/lao.el \
+ ${lispsource}language/tai-viet.el \
${lispsource}language/thai.el \
${lispsource}language/tibetan.elc \
- ${lispsource}language/vietnamese.elc \
+ ${lispsource}language/vietnamese.el \
${lispsource}language/misc-lang.el \
${lispsource}language/utf-8-lang.el \
${lispsource}language/georgian.el \
@@ -830,6 +853,7 @@ shortlisp= \
../lisp/buff-menu.elc \
../lisp/button.elc \
../lisp/emacs-lisp/byte-run.elc \
+ ../lisp/composite.elc \
../lisp/cus-face.elc \
../lisp/cus-start.elc \
../lisp/custom.elc \
@@ -855,20 +879,10 @@ shortlisp= \
../lisp/international/mule-conf.el \
../lisp/international/mule-cmds.elc \
../lisp/international/characters.elc \
- ../lisp/international/ucs-tables.elc \
- ../lisp/international/utf-8.elc \
- ../lisp/international/utf-16.elc \
- ../lisp/international/latin-1.el \
- ../lisp/international/latin-2.el \
- ../lisp/international/latin-3.el \
- ../lisp/international/latin-4.el \
- ../lisp/international/latin-5.el \
- ../lisp/international/latin-8.el \
- ../lisp/international/latin-9.el \
../lisp/case-table.elc \
- ../lisp/language/chinese.elc \
- ../lisp/language/cyrillic.elc \
- ../lisp/language/indian.elc \
+ ../lisp/language/chinese.el \
+ ../lisp/language/cyrillic.el \
+ ../lisp/language/indian.el \
../lisp/language/devanagari.el \
../lisp/language/kannada.el \
../lisp/language/malayalam.el \
@@ -884,9 +898,10 @@ shortlisp= \
../lisp/language/japanese.el \
../lisp/language/korean.el \
../lisp/language/lao.el \
+ ../lisp/language/tai-viet.el \
../lisp/language/thai.el \
../lisp/language/tibetan.elc \
- ../lisp/language/vietnamese.elc \
+ ../lisp/language/vietnamese.el \
../lisp/language/misc-lang.el \
../lisp/language/utf-8-lang.el \
../lisp/language/georgian.el \
@@ -931,9 +946,7 @@ SOME_MACHINE_LISP = ${dotdot}/lisp/mouse.elc \
${dotdot}/lisp/x-dnd.elc \
${dotdot}/lisp/international/ccl.elc \
${dotdot}/lisp/international/codepage.elc \
- ${dotdot}/lisp/international/fontset.elc \
- ${dotdot}/lisp/mouse.elc \
- ${dotdot}/lisp/term/x-win.elc
+ ${dotdot}/lisp/international/fontset.elc
/* Construct full set of libraries to be linked.
Note that SunOS needs -lm to come before -lc; otherwise, you get
@@ -941,8 +954,9 @@ SOME_MACHINE_LISP = ${dotdot}/lisp/mouse.elc \
with GCC, we might need gnulib again after them. */
LIBES = $(LOADLIBES) $(LIBS) $(LIBX) $(LIBSOUND) $(RSVG_LIBS) LIBGPM \
LIBS_SYSTEM LIBS_MACHINE LIBS_TERMCAP \
- LIBS_DEBUG $(GETLOADAVG_LIBS) $(GNULIB_VAR) LIB_MATH LIB_STANDARD \
- $(GNULIB_VAR)
+ LIBS_DEBUG $(GETLOADAVG_LIBS) \
+ @FREETYPE_LIBS@ @FONTCONFIG_LIBS@ @LIBOTF_LIBS@ \
+ $(GNULIB_VAR) LIB_MATH LIB_STANDARD $(GNULIB_VAR)
/* Enable recompilation of certain other files depending on system type. */
@@ -954,7 +968,11 @@ LIBES = $(LOADLIBES) $(LIBS) $(LIBX) $(LIBSOUND) $(RSVG_LIBS) LIBGPM \
#define OBJECTS_MACHINE
#endif
-RUN_TEMACS = ./temacs
+#ifdef HAVE_SHM
+RUN_TEMACS = `/bin/pwd`/temacs -nl
+#else
+RUN_TEMACS = `/bin/pwd`/temacs
+#endif
all: emacs${EXEEXT} OTHER_FILES
@@ -963,11 +981,7 @@ emacs${EXEEXT}: temacs${EXEEXT} ${etc}DOC ${lisp}
rm -f emacs${EXEEXT}
ln temacs${EXEEXT} emacs${EXEEXT}
#else
-#ifdef HAVE_SHM
- LC_ALL=C $(RUN_TEMACS) -nl -batch -l loadup dump
-#else /* ! defined (HAVE_SHM) */
LC_ALL=C $(RUN_TEMACS) -batch -l loadup dump
-#endif /* ! defined (HAVE_SHM) */
#endif /* ! defined (CANNOT_DUMP) */
-./emacs -q -batch -f list-load-path-shadows
@@ -987,6 +1001,16 @@ ${etc}DOC: ${libsrc}make-docfile${EXEEXT} ${obj} ${shortlisp} ${SOME_MACHINE_LIS
${libsrc}make-docfile${EXEEXT}:
cd ${libsrc}; ${MAKE} ${MFLAGS} make-docfile${EXEEXT}
+#ifdef HAVE_UNIDATA
+UNIDATA=${admindir}unidata/UnicodeData.txt
+
+${lispsource}international/charprop.el: temacs${EXEEXT} ${UNIDATA}
+ RUNEMACS="$(RUN_TEMACS)"; \
+ cd ${admindir}unidata; \
+ $(MAKE) $(MFLAGS) \
+ RUNEMACS="$${RUNEMACS}" DSTDIR=${lispsource}international
+#endif
+
/* Some systems define this to cause parallel Make-ing. */
#ifndef MAKE_PARALLEL
#define MAKE_PARALLEL
@@ -1082,77 +1106,92 @@ stamp-oldxmenu:
@echo "Please run the `configure' script again."
exit 1
+/* Some machines have alloca built-in.
+ They should define HAVE_ALLOCA.
+ Some use the C version in alloca.c (these define C_ALLOCA in config.h).
+ */
+alloca.o: alloca.c blockinput.h atimer.h systime.h
+
/* Nearly all the following files depend on lisp.h,
but it is not included as a dependency because
it is so often changed in ways that do not require any recompilation
and so rarely changed in ways that do require any. */
-abbrev.o: abbrev.c buffer.h window.h dispextern.h commands.h charset.h \
+abbrev.o: abbrev.c buffer.h window.h dispextern.h commands.h character.h \
syntax.h $(config_h)
buffer.o: buffer.c buffer.h region-cache.h commands.h window.h \
- dispextern.h $(INTERVAL_SRC) blockinput.h atimer.h systime.h charset.h \
+ dispextern.h $(INTERVAL_SRC) blockinput.h atimer.h systime.h character.h \
$(config_h)
callint.o: callint.c window.h commands.h buffer.h keymap.h \
keyboard.h dispextern.h $(config_h)
callproc.o: callproc.c epaths.h buffer.h commands.h $(config_h) \
- process.h systty.h syssignal.h charset.h coding.h ccl.h msdos.h \
- composite.h w32.h blockinput.h atimer.h systime.h frame.h termhooks.h
-casefiddle.o: casefiddle.c syntax.h commands.h buffer.h composite.h \
+ process.h systty.h syssignal.h character.h coding.h ccl.h msdos.h \
+ composite.h w32.h blockinput.h atimer.h systime.h
+casefiddle.o: casefiddle.c syntax.h commands.h buffer.h character.h \
+ composite.h \
charset.h keymap.h $(config_h)
casetab.o: casetab.c buffer.h $(config_h)
-category.o: category.c category.h buffer.h charset.h keymap.h $(config_h)
-ccl.o: ccl.c ccl.h charset.h coding.h $(config_h)
-charset.o: charset.c charset.h buffer.h coding.h composite.h disptab.h \
- $(config_h)
-coding.o: coding.c coding.h ccl.h buffer.h charset.h intervals.h composite.h \
- window.h dispextern.h frame.h termhooks.h $(config_h)
-cm.o: cm.c frame.h cm.h termhooks.h termchar.h $(config_h)
-cmds.o: cmds.c syntax.h buffer.h charset.h commands.h window.h $(config_h) \
+category.o: category.c category.h buffer.h charset.h keymap.h \
+ character.h $(config_h)
+ccl.o: ccl.c ccl.h charset.h character.h coding.h $(config_h)
+character.o: character.c character.h buffer.h charset.h composite.h disptab.h \
+ $(config.h)
+charset.o: charset.c charset.h character.h buffer.h coding.h composite.h \
+ disptab.h $(config_h)
+chartab.o: charset.h character.h $(config.h)
+coding.o: coding.c coding.h ccl.h buffer.h character.h charset.h intervals.h composite.h \
+ window.h dispextern.h $(config_h)
+cm.o: cm.c cm.h termhooks.h $(config_h)
+cmds.o: cmds.c syntax.h buffer.h character.h commands.h window.h $(config_h) \
msdos.h dispextern.h keyboard.h keymap.h
pre-crt0.o: pre-crt0.c
ecrt0.o: ecrt0.c $(config_h)
CRT0_COMPILE ${srcdir}/ecrt0.c
-dired.o: dired.c commands.h buffer.h $(config_h) charset.h coding.h regex.h \
- systime.h blockinput.h atimer.h
-dispnew.o: dispnew.c systime.h commands.h process.h frame.h \
+dired.o: dired.c commands.h buffer.h $(config_h) character.h charset.h \
+ coding.h regex.h systime.h blockinput.h atimer.h
+dispnew.o: dispnew.c systty.h systime.h commands.h process.h frame.h \
window.h buffer.h dispextern.h termchar.h termopts.h termhooks.h cm.h \
disptab.h indent.h intervals.h \
- xterm.h blockinput.h atimer.h charset.h msdos.h composite.h keyboard.h \
+ xterm.h blockinput.h atimer.h character.h msdos.h composite.h keyboard.h \
$(config_h)
-doc.o: doc.c $(config_h) epaths.h buffer.h keyboard.h keymap.h charset.h
-doprnt.o: doprnt.c charset.h $(config_h)
+doc.o: doc.c $(config_h) epaths.h buffer.h keyboard.h keymap.h character.h
+doprnt.o: doprnt.c character.h $(config_h)
dosfns.o: buffer.h termchar.h termhooks.h frame.h blockinput.h window.h \
msdos.h dosfns.h dispextern.h charset.h coding.h atimer.h systime.h \
$(config_h)
-editfns.o: editfns.c window.h buffer.h systime.h $(INTERVAL_SRC) charset.h \
+editfns.o: editfns.c window.h buffer.h systime.h $(INTERVAL_SRC) character.h \
coding.h dispextern.h frame.h blockinput.h atimer.h $(config_h)
emacs.o: emacs.c commands.h systty.h syssignal.h blockinput.h process.h \
termhooks.h buffer.h atimer.h systime.h $(INTERVAL_SRC) $(config_h) \
window.h dispextern.h keyboard.h keymap.h
-fileio.o: fileio.c window.h buffer.h systime.h $(INTERVAL_SRC) charset.h \
+fileio.o: fileio.c window.h buffer.h systime.h $(INTERVAL_SRC) character.h \
coding.h msdos.h dispextern.h blockinput.h atimer.h $(config_h)
-filelock.o: filelock.c buffer.h charset.h coding.h systime.h epaths.h $(config_h)
+filelock.o: filelock.c buffer.h character.h charset.h coding.h systime.h \
+ epaths.h $(config_h)
filemode.o: filemode.c $(config_h)
frame.o: frame.c xterm.h window.h frame.h termhooks.h commands.h keyboard.h \
- blockinput.h atimer.h systime.h buffer.h charset.h fontset.h \
- msdos.h dosfns.h dispextern.h w32term.h macterm.h termchar.h $(config_h)
-fringe.o: fringe.c dispextern.h frame.h window.h buffer.h termhooks.h $(config_h)
-fontset.o: dispextern.h fontset.h fontset.c ccl.h buffer.h charset.h frame.h \
- keyboard.h termhooks.h $(config_h)
+ blockinput.h atimer.h systime.h buffer.h character.h fontset.h \
+ msdos.h dosfns.h dispextern.h w32term.h macterm.h $(config_h)
+fringe.o: fringe.c dispextern.h frame.h window.h buffer.h $(config_h)
+font.o: font.c dispextern.h frame.h window.h ccl.h character.h charset.h \
+ font.h $(config_h)
+ftfont.o: dispextern.h frame.h character.h charset.h font.h $(config_h)
+fontset.o: dispextern.h fontset.h fontset.c ccl.h buffer.h character.h \
+ charset.h frame.h keyboard.h $(FONTSRC) $(config_h)
getloadavg.o: getloadavg.c $(config_h)
image.o: image.c frame.h window.h dispextern.h blockinput.h atimer.h \
systime.h xterm.h w32term.h w32gui.h macterm.h macgui.h $(config_h)
indent.o: indent.c frame.h window.h indent.h buffer.h $(config_h) termchar.h \
- termopts.h disptab.h region-cache.h charset.h composite.h dispextern.h \
- keyboard.h
-insdel.o: insdel.c window.h buffer.h $(INTERVAL_SRC) blockinput.h charset.h \
+ termopts.h disptab.h region-cache.h character.h category.h composite.h \
+ dispextern.h keyboard.h
+insdel.o: insdel.c window.h buffer.h $(INTERVAL_SRC) blockinput.h character.h \
dispextern.h atimer.h systime.h region-cache.h $(config_h)
-keyboard.o: keyboard.c termchar.h termhooks.h termopts.h buffer.h charset.h \
+keyboard.o: keyboard.c termchar.h termhooks.h termopts.h buffer.h character.h \
commands.h frame.h window.h macros.h disptab.h keyboard.h syssignal.h \
- systime.h dispextern.h syntax.h $(INTERVAL_SRC) blockinput.h \
+ systty.h systime.h dispextern.h syntax.h $(INTERVAL_SRC) blockinput.h \
atimer.h xterm.h puresize.h msdos.h keymap.h w32term.h macterm.h $(config_h)
keymap.o: keymap.c buffer.h commands.h keyboard.h termhooks.h blockinput.h \
- atimer.h systime.h puresize.h charset.h intervals.h keymap.h window.h \
+ atimer.h systime.h puresize.h character.h intervals.h keymap.h window.h \
$(config_h)
lastfile.o: lastfile.c $(config_h)
macros.o: macros.c window.h buffer.h commands.h macros.h keyboard.h \
@@ -1161,38 +1200,37 @@ malloc.o: malloc.c $(config_h)
gmalloc.o: gmalloc.c $(config_h)
ralloc.o: ralloc.c $(config_h)
vm-limit.o: vm-limit.c mem-limits.h $(config_h)
-marker.o: marker.c buffer.h charset.h $(config_h)
+marker.o: marker.c buffer.h character.h $(config_h)
md5.o: md5.c md5.h $(config_h)
minibuf.o: minibuf.c syntax.h dispextern.h frame.h window.h keyboard.h \
- buffer.h commands.h charset.h msdos.h $(INTERVAL_SRC) keymap.h \
- termhooks.h $(config_h)
+ buffer.h commands.h character.h msdos.h $(INTERVAL_SRC) keymap.h $(config_h)
mktime.o: mktime.c $(config_h)
msdos.o: msdos.c msdos.h dosfns.h systime.h termhooks.h dispextern.h frame.h \
- termopts.h termchar.h charset.h coding.h ccl.h disptab.h window.h \
+ termopts.h termchar.h character.h coding.h ccl.h disptab.h window.h \
keyboard.h intervals.h buffer.h commands.h blockinput.h atimer.h $(config_h)
process.o: process.c process.h buffer.h window.h termhooks.h termopts.h \
commands.h syssignal.h systime.h systty.h syswait.h frame.h dispextern.h \
blockinput.h atimer.h charset.h coding.h ccl.h msdos.h composite.h \
keyboard.h $(config_h)
-regex.o: regex.c syntax.h buffer.h $(config_h) regex.h category.h charset.h
+regex.o: regex.c syntax.h buffer.h $(config_h) regex.h category.h character.h \
+ charset.h
region-cache.o: region-cache.c buffer.h region-cache.h $(config_h)
scroll.o: scroll.c termchar.h dispextern.h frame.h msdos.h keyboard.h \
- termhooks.h $(config_h)
+ $(config_h)
search.o: search.c regex.h commands.h buffer.h region-cache.h syntax.h \
- blockinput.h atimer.h systime.h category.h charset.h composite.h \
- $(INTERVAL_SRC) $(config_h)
+ blockinput.h atimer.h systime.h category.h character.h charset.h \
+ composite.h $(INTERVAL_SRC) \
+ $(config_h)
strftime.o: strftime.c $(config_h)
-syntax.o: syntax.c syntax.h buffer.h commands.h category.h charset.h \
+syntax.o: syntax.c syntax.h buffer.h commands.h category.h character.h \
composite.h keymap.h regex.h $(INTERVAL_SRC) $(config_h)
sysdep.o: sysdep.c syssignal.h systty.h systime.h syswait.h blockinput.h \
process.h dispextern.h termhooks.h termchar.h termopts.h \
- frame.h atimer.h window.h msdos.h dosfns.h keyboard.h cm.h $(config_h)
+ frame.h atimer.h window.h msdos.h dosfns.h keyboard.h $(config_h)
term.o: term.c termchar.h termhooks.h termopts.h $(config_h) cm.h frame.h \
- disptab.h dispextern.h keyboard.h charset.h coding.h ccl.h msdos.h \
- window.h keymap.h blockinput.h atimer.h systime.h
+ disptab.h dispextern.h keyboard.h character.h charset.h coding.h ccl.h \
+ msdos.h window.h keymap.h blockinput.h atimer.h systime.h
termcap.o: termcap.c $(config_h)
-terminal.o: terminal.c frame.h termchar.h termhooks.h charset.h coding.h \
- keyboard.h $(config_h)
terminfo.o: terminfo.c $(config_h)
tparam.o: tparam.c $(config_h)
undo.o: undo.c buffer.h commands.h window.h $(config_h)
@@ -1205,29 +1243,37 @@ w16select.o: w16select.c dispextern.h frame.h blockinput.h atimer.h systime.h \
widget.o: widget.c xterm.h frame.h dispextern.h widgetprv.h \
$(srcdir)/../lwlib/lwlib.h $(config_h)
window.o: window.c indent.h commands.h frame.h window.h buffer.h termchar.h \
- disptab.h keyboard.h dispextern.h msdos.h composite.h \
+ termhooks.h disptab.h keyboard.h dispextern.h msdos.h composite.h \
keymap.h blockinput.h atimer.h systime.h $(INTERVAL_SRC) \
xterm.h w32term.h macterm.h $(config_h)
-xdisp.o: xdisp.c macros.h commands.h process.h indent.h buffer.h dispextern.h coding.h \
- termchar.h frame.h window.h disptab.h termhooks.h charset.h $(config_h) \
- keyboard.h $(INTERVAL_SRC) region-cache.h xterm.h w32term.h macterm.h \
- msdos.h composite.h fontset.h blockinput.h atimer.h systime.h keymap.h
-xfaces.o: xfaces.c dispextern.h frame.h xterm.h buffer.h blockinput.h \
- window.h charset.h msdos.h dosfns.h composite.h atimer.h systime.h \
- keyboard.h fontset.h w32term.h macterm.h $(INTERVAL_SRC) termchar.h \
- termhooks.h $(config_h)
+xdisp.o: xdisp.c macros.h commands.h process.h indent.h buffer.h dispextern.h \
+ coding.h termchar.h frame.h window.h disptab.h termhooks.h character.h \
+ charset.h $(config_h) keyboard.h $(INTERVAL_SRC) region-cache.h xterm.h \
+ w32term.h macterm.h msdos.h composite.h fontset.h blockinput.h atimer.h \
+ systime.h keymap.h $(FONTSRC)
+xfaces.o: xfaces.c dispextern.h frame.h xterm.h buffer.h blockinput.h \
+ window.h character.h charset.h msdos.h dosfns.h composite.h atimer.h \
+ systime.h keyboard.h fontset.h w32term.h macterm.h $(INTERVAL_SRC) \
+ $(FONTSRC) $(config_h)
xfns.o: xfns.c buffer.h frame.h window.h keyboard.h xterm.h dispextern.h \
$(srcdir)/../lwlib/lwlib.h blockinput.h atimer.h systime.h epaths.h \
- charset.h gtkutil.h termchar.h termhooks.h $(config_h)
+ character.h charset.h coding.h gtkutil.h $(config_h) termhooks.h \
+ fontset.h $(FONTSRC)
+xfont.o: dispextern.h xterm.h frame.h blockinput.h character.h charset.h \
+ font.h $(config_h)
+xftfont.o: dispextern.h xterm.h frame.h blockinput.h character.h charset.h \
+ font.h $(config_h)
+ftxfont.o: dispextern.h xterm.h frame.h blockinput.h character.h charset.h \
+ font.h $(config_h)
xmenu.o: xmenu.c xterm.h termhooks.h window.h dispextern.h frame.h buffer.h \
- keyboard.h $(srcdir)/../lwlib/lwlib.h blockinput.h atimer.h systime.h \
- gtkutil.h msdos.h coding.h $(config_h)
+ charset.h keyboard.h $(srcdir)/../lwlib/lwlib.h blockinput.h atimer.h \
+ systime.h gtkutil.h msdos.h coding.h $(config_h)
xterm.o: xterm.c xterm.h termhooks.h termopts.h termchar.h window.h buffer.h \
- dispextern.h frame.h disptab.h blockinput.h atimer.h systime.h syssignal.h \
- keyboard.h gnu.h charset.h ccl.h fontset.h composite.h \
- coding.h process.h gtkutil.h $(config_h)
+ dispextern.h frame.h disptab.h blockinput.h atimer.h systime.h syssignal.h \
+ keyboard.h gnu.h character.h charset.h ccl.h fontset.h composite.h \
+ coding.h process.h gtkutil.h $(FONTSRC) $(config_h)
xselect.o: xselect.c process.h dispextern.h frame.h xterm.h blockinput.h \
- buffer.h atimer.h systime.h termhooks.h $(config_h)
+ buffer.h atimer.h systime.h $(config_h)
xrdb.o: xrdb.c $(config_h) epaths.h
xsmfns.o: xsmfns.c $(config_h) systime.h sysselect.h termhooks.h xterm.h \
lisp.h termopts.h
@@ -1242,39 +1288,42 @@ atimer.o: atimer.c atimer.h systime.h $(config_h)
/* The files of Lisp proper */
alloc.o: alloc.c process.h frame.h window.h buffer.h puresize.h syssignal.h keyboard.h \
- blockinput.h atimer.h systime.h charset.h dispextern.h $(config_h) $(INTERVAL_SRC)
-bytecode.o: bytecode.c buffer.h syntax.h charset.h window.h dispextern.h \
+ blockinput.h atimer.h systime.h character.h dispextern.h $(config_h) \
+ $(INTERVAL_SRC)
+bytecode.o: bytecode.c buffer.h syntax.h character.h window.h dispextern.h \
frame.h xterm.h $(config_h)
-data.o: data.c buffer.h puresize.h charset.h syssignal.h keyboard.h frame.h termhooks.h $(config_h)
+data.o: data.c buffer.h puresize.h character.h syssignal.h keyboard.h frame.h \
+ $(config_h)
eval.o: eval.c commands.h keyboard.h blockinput.h atimer.h systime.h \
dispextern.h $(config_h)
floatfns.o: floatfns.c $(config_h)
-fns.o: fns.c commands.h $(config_h) frame.h buffer.h charset.h keyboard.h \
+fns.o: fns.c commands.h $(config_h) frame.h buffer.h character.h keyboard.h \
keymap.h frame.h window.h dispextern.h $(INTERVAL_SRC) coding.h md5.h \
- blockinput.h atimer.h systime.h xterm.h termhooks.h
-print.o: print.c process.h frame.h window.h buffer.h keyboard.h charset.h \
- $(config_h) dispextern.h termchar.h $(INTERVAL_SRC) msdos.h composite.h \
+ blockinput.h atimer.h systime.h xterm.h
+print.o: print.c process.h frame.h window.h buffer.h keyboard.h character.h \
+ $(config_h) dispextern.h termchar.h $(INTERVAL_SRC) msdos.h composite.h \
blockinput.h atimer.h systime.h
-lread.o: lread.c commands.h keyboard.h buffer.h epaths.h charset.h \
- $(config_h) $(INTERVAL_SRC) termhooks.h coding.h msdos.h
+lread.o: lread.c commands.h keyboard.h buffer.h epaths.h character.h \
+ charset.h $(config_h) $(INTERVAL_SRC) termhooks.h coding.h msdos.h \
+ blockinput.h atimer.h systime.h
/* Text properties support */
textprop.o: textprop.c buffer.h window.h dispextern.h $(INTERVAL_SRC) \
$(config_h)
intervals.o: intervals.c buffer.h $(INTERVAL_SRC) keyboard.h puresize.h \
keymap.h $(config_h)
-composite.o: composite.c buffer.h charset.h $(INTERVAL_SRC) $(config_h)
+composite.o: composite.c buffer.h character.h $(INTERVAL_SRC) $(config_h)
/* System-specific programs to be made.
OTHER_FILES and OBJECTS_MACHINE
select which of these should be compiled. */
-sunfns.o: sunfns.c buffer.h window.h dispextern.h termhooks.h $(config_h)
+sunfns.o: sunfns.c buffer.h window.h dispextern.h $(config_h)
#ifdef HAVE_CARBON
abbrev.o buffer.o callint.o cmds.o dispnew.o editfns.o fileio.o frame.o \
fontset.o indent.o insdel.o keyboard.o macros.o minibuf.o msdos.o process.o \
- scroll.o sysdep.o term.o terminal.o widget.o window.o xdisp.o xfaces.o xfns.o xmenu.o \
+ scroll.o sysdep.o term.o widget.o window.o xdisp.o xfaces.o xfns.o xmenu.o \
xterm.o xselect.o sound.o: macgui.h
mac.o: mac.c process.h sysselect.h blockinput.h atimer.h systime.h charset.h \
coding.h ccl.h $(config_h)
@@ -1315,6 +1364,8 @@ ${emacsapp}Contents/MacOS/Emacs: emacs${EXEEXT}
cd ${emacsapp}Contents/MacOS/; cp ../../../../src/emacs${EXEEXT} Emacs${EXEEXT}
#endif
+${libsrc}emacstool${EXEEXT}: ${libsrc}emacstool.c
+ cd ${libsrc}; ${MAKE} ${MFLAGS} emacstool${EXEEXT}
bootstrapclean:
rm -f bootstrap-emacs${EXEEXT} emacs-${version}${EXEEXT}
mostlyclean:
@@ -1340,6 +1391,17 @@ versionclean:
extraclean: distclean
-rm -f *~ \#* m/?*~ s/?*~
+/* The rule for the [sm] files has to be written a little funny to
+ avoid looking like a C comment to CPP. */
+SOURCES = *.[ch] [sm]/?* COPYING Makefile.in \
+ config.in epaths.in README COPYING ChangeLog vms.pp-trans
+unlock:
+ chmod u+w $(SOURCES)
+
+relock:
+ chmod -w $(SOURCES)
+ chmod +w epaths.h
+
/* Arrange to make a tags table TAGS-LISP for ../lisp,
plus TAGS for the C files, which includes ../lisp/TAGS by reference. */
@@ -1368,14 +1430,10 @@ bootstrap: bootstrap-emacs${EXEEXT}
/* Dump an Emacs executable named bootstrap-emacs containing the
files from loadup.el in source form. */
-bootstrap-emacs${EXEEXT}: temacs${EXEEXT}
+bootstrap-emacs${EXEEXT}: temacs${EXEEXT} ${lispsource}international/charprop.el
#ifdef CANNOT_DUMP
ln temacs${EXEEXT} bootstrap-emacs${EXEEXT}
#else
-#ifdef HAVE_SHM
- $(RUN_TEMACS) -nl -batch -l loadup bootstrap
-#else /* ! defined (HAVE_SHM) */
$(RUN_TEMACS) --batch --load loadup bootstrap
-#endif /* ! defined (HAVE_SHM) */
mv -f emacs${EXEEXT} bootstrap-emacs${EXEEXT}
#endif /* ! defined (CANNOT_DUMP) */
diff --git a/src/abbrev.c b/src/abbrev.c
index 403afdb99a..a58c4ecbfb 100644
--- a/src/abbrev.c
+++ b/src/abbrev.c
@@ -27,7 +27,7 @@ Boston, MA 02110-1301, USA. */
#include "commands.h"
#include "buffer.h"
#include "window.h"
-#include "charset.h"
+#include "character.h"
#include "syntax.h"
/* An abbrev table is an obarray.
@@ -198,7 +198,7 @@ abbrev_check_chars (abbrev, global)
{
/* Copied from SYNTAX in syntax.h, except using FOLLOW_PARENT. */
Lisp_Object syntax_temp
- = SYNTAX_ENTRY_FOLLOW_PARENT (Vstandard_syntax_table, c);
+ = CHAR_TABLE_REF (Vstandard_syntax_table, c);
if ( (CONSP (syntax_temp)
? (enum syntaxcode) (XINT (XCAR (syntax_temp)) & 0xff)
: Swhitespace) != Sword ) badchars[nbad++] = c;
@@ -470,9 +470,15 @@ Returns the abbrev symbol, if expansion took place. */)
int pos = wordstart_byte;
/* Find the initial. */
- while (pos < PT_BYTE
- && SYNTAX (*BUF_BYTE_ADDRESS (current_buffer, pos)) != Sword)
- pos++;
+ if (multibyte)
+ while (pos < PT_BYTE
+ && SYNTAX (FETCH_MULTIBYTE_CHAR (pos)) != Sword)
+ INC_POS (pos);
+ else
+ while (pos < PT_BYTE
+ && (SYNTAX (*BUF_BYTE_ADDRESS (current_buffer, pos))
+ != Sword))
+ pos++;
/* Change just that. */
pos = BYTE_TO_CHAR (pos);
@@ -769,6 +775,9 @@ Calling `expand-abbrev' sets this to nil. */);
Trying to expand an abbrev in any other buffer clears `abbrev-start-location'. */);
Vabbrev_start_location_buffer = Qnil;
+ DEFVAR_PER_BUFFER ("local-abbrev-table", &current_buffer->abbrev_table, Qnil,
+ doc: /* Local (mode-specific) abbrev table of current buffer. */);
+
DEFVAR_BOOL ("abbrevs-changed", &abbrevs_changed,
doc: /* Set non-nil by defining or altering any word abbrevs.
This causes `save-some-buffers' to offer to save the abbrevs. */);
diff --git a/src/alloc.c b/src/alloc.c
index 8e00733a60..2e88afc00a 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -53,9 +53,8 @@ Boston, MA 02110-1301, USA. */
#include "keyboard.h"
#include "frame.h"
#include "blockinput.h"
-#include "charset.h"
+#include "character.h"
#include "syssignal.h"
-#include "termhooks.h" /* For struct terminal. */
#include <setjmp.h>
/* GC_MALLOC_CHECK defined means perform validity checks of malloc'd
@@ -342,9 +341,7 @@ Lisp_Object Vgc_elapsed; /* accumulated elapsed time in GC */
EMACS_INT gcs_done; /* accumulated GCs */
static void mark_buffer P_ ((Lisp_Object));
-static void mark_terminals P_ ((void));
extern void mark_kboards P_ ((void));
-extern void mark_ttys P_ ((void));
extern void mark_backtrace P_ ((void));
static void gc_sweep P_ ((void));
static void mark_glyph_matrix P_ ((struct glyph_matrix *));
@@ -376,11 +373,14 @@ enum mem_type
MEM_TYPE_MISC,
MEM_TYPE_SYMBOL,
MEM_TYPE_FLOAT,
- /* We used to keep separate mem_types for subtypes of vectors such as
- process, hash_table, frame, terminal, and window, but we never made
- use of the distinction, so it only caused source-code complexity
- and runtime slowdown. Minor but pointless. */
- MEM_TYPE_VECTORLIKE
+ /* Keep the following vector-like types together, with
+ MEM_TYPE_WINDOW being the last, and MEM_TYPE_VECTOR the
+ first. Or change the code of live_vector_p, for instance. */
+ MEM_TYPE_VECTOR,
+ MEM_TYPE_PROCESS,
+ MEM_TYPE_HASH_TABLE,
+ MEM_TYPE_FRAME,
+ MEM_TYPE_WINDOW
};
static POINTER_TYPE *lisp_align_malloc P_ ((size_t, enum mem_type));
@@ -467,7 +467,7 @@ static struct mem_node mem_z;
#define MEM_NIL &mem_z
static POINTER_TYPE *lisp_malloc P_ ((size_t, enum mem_type));
-static struct Lisp_Vector *allocate_vectorlike P_ ((EMACS_INT));
+static struct Lisp_Vector *allocate_vectorlike P_ ((EMACS_INT, enum mem_type));
static void lisp_free P_ ((POINTER_TYPE *));
static void mark_stack P_ ((void));
static int live_vector_p P_ ((struct mem_node *, void *));
@@ -502,7 +502,7 @@ struct gcpro *gcprolist;
/* Addresses of staticpro'd variables. Initialize it to a nonzero
value; otherwise some compilers put it into BSS. */
-#define NSTATICS 1280
+#define NSTATICS 0x600
Lisp_Object *staticvec[NSTATICS] = {&Vpurify_flag};
/* Index of next unused slot in staticvec. */
@@ -743,15 +743,6 @@ overrun_check_free (block)
#define free overrun_check_free
#endif
-#ifdef SYNC_INPUT
-/* When using SYNC_INPUT, we don't call malloc from a signal handler, so
- there's no need to block input around malloc. */
-#define MALLOC_BLOCK_INPUT ((void)0)
-#define MALLOC_UNBLOCK_INPUT ((void)0)
-#else
-#define MALLOC_BLOCK_INPUT BLOCK_INPUT
-#define MALLOC_UNBLOCK_INPUT UNBLOCK_INPUT
-#endif
/* Like malloc but check for no memory and block interrupt input.. */
@@ -761,9 +752,9 @@ xmalloc (size)
{
register POINTER_TYPE *val;
- MALLOC_BLOCK_INPUT;
+ BLOCK_INPUT;
val = (POINTER_TYPE *) malloc (size);
- MALLOC_UNBLOCK_INPUT;
+ UNBLOCK_INPUT;
if (!val && size)
memory_full ();
@@ -780,14 +771,14 @@ xrealloc (block, size)
{
register POINTER_TYPE *val;
- MALLOC_BLOCK_INPUT;
+ BLOCK_INPUT;
/* We must call malloc explicitly when BLOCK is 0, since some
reallocs don't do this. */
if (! block)
val = (POINTER_TYPE *) malloc (size);
else
val = (POINTER_TYPE *) realloc (block, size);
- MALLOC_UNBLOCK_INPUT;
+ UNBLOCK_INPUT;
if (!val && size) memory_full ();
return val;
@@ -800,9 +791,9 @@ void
xfree (block)
POINTER_TYPE *block;
{
- MALLOC_BLOCK_INPUT;
+ BLOCK_INPUT;
free (block);
- MALLOC_UNBLOCK_INPUT;
+ UNBLOCK_INPUT;
/* We don't call refill_memory_reserve here
because that duplicates doing so in emacs_blocked_free
and the criterion should go there. */
@@ -853,7 +844,7 @@ lisp_malloc (nbytes, type)
{
register void *val;
- MALLOC_BLOCK_INPUT;
+ BLOCK_INPUT;
#ifdef GC_MALLOC_CHECK
allocated_mem_type = type;
@@ -883,7 +874,7 @@ lisp_malloc (nbytes, type)
mem_insert (val, (char *) val + nbytes, type);
#endif
- MALLOC_UNBLOCK_INPUT;
+ UNBLOCK_INPUT;
if (!val && nbytes)
memory_full ();
return val;
@@ -896,12 +887,12 @@ static void
lisp_free (block)
POINTER_TYPE *block;
{
- MALLOC_BLOCK_INPUT;
+ BLOCK_INPUT;
free (block);
#if GC_MARK_STACK && !defined GC_MALLOC_CHECK
mem_delete (mem_find (block));
#endif
- MALLOC_UNBLOCK_INPUT;
+ UNBLOCK_INPUT;
}
/* Allocation of aligned blocks of memory to store Lisp data. */
@@ -1002,7 +993,7 @@ lisp_align_malloc (nbytes, type)
eassert (nbytes <= BLOCK_BYTES);
- MALLOC_BLOCK_INPUT;
+ BLOCK_INPUT;
#ifdef GC_MALLOC_CHECK
allocated_mem_type = type;
@@ -1034,7 +1025,7 @@ lisp_align_malloc (nbytes, type)
if (base == 0)
{
- MALLOC_UNBLOCK_INPUT;
+ UNBLOCK_INPUT;
memory_full ();
}
@@ -1060,7 +1051,7 @@ lisp_align_malloc (nbytes, type)
{
lisp_malloc_loser = base;
free (base);
- MALLOC_UNBLOCK_INPUT;
+ UNBLOCK_INPUT;
memory_full ();
}
}
@@ -1093,7 +1084,7 @@ lisp_align_malloc (nbytes, type)
mem_insert (val, (char *) val + nbytes, type);
#endif
- MALLOC_UNBLOCK_INPUT;
+ UNBLOCK_INPUT;
if (!val && nbytes)
memory_full ();
@@ -1108,7 +1099,7 @@ lisp_align_free (block)
struct ablock *ablock = block;
struct ablocks *abase = ABLOCK_ABASE (ablock);
- MALLOC_BLOCK_INPUT;
+ BLOCK_INPUT;
#if GC_MARK_STACK && !defined GC_MALLOC_CHECK
mem_delete (mem_find (block));
#endif
@@ -1141,7 +1132,7 @@ lisp_align_free (block)
#endif
free (ABLOCKS_BASE (abase));
}
- MALLOC_UNBLOCK_INPUT;
+ UNBLOCK_INPUT;
}
/* Return a new buffer structure allocated from the heap with
@@ -1170,8 +1161,6 @@ allocate_buffer ()
can use GNU malloc. */
#ifndef SYNC_INPUT
-/* When using SYNC_INPUT, we don't call malloc from a signal handler, so
- there's no need to block input around malloc. */
#ifndef DOUG_LEA_MALLOC
extern void * (*__malloc_hook) P_ ((size_t, const void *));
@@ -1245,8 +1234,7 @@ emacs_blocked_malloc (size, ptr)
BLOCK_INPUT_ALLOC;
__malloc_hook = old_malloc_hook;
#ifdef DOUG_LEA_MALLOC
- /* Segfaults on my system. --lorentey */
- /* mallopt (M_TOP_PAD, malloc_hysteresis * 4096); */
+ mallopt (M_TOP_PAD, malloc_hysteresis * 4096);
#else
__malloc_extra_blocks = malloc_hysteresis;
#endif
@@ -1352,9 +1340,9 @@ emacs_blocked_realloc (ptr, size, ptr2)
void
reset_malloc_hooks ()
{
- __free_hook = old_free_hook;
- __malloc_hook = old_malloc_hook;
- __realloc_hook = old_realloc_hook;
+ __free_hook = 0;
+ __malloc_hook = 0;
+ __realloc_hook = 0;
}
#endif /* HAVE_GTK_AND_PTHREAD */
@@ -1456,7 +1444,9 @@ make_interval ()
/* eassert (!handling_signal); */
- MALLOC_BLOCK_INPUT;
+#ifndef SYNC_INPUT
+ BLOCK_INPUT;
+#endif
if (interval_free_list)
{
@@ -1480,7 +1470,9 @@ make_interval ()
val = &interval_block->intervals[interval_block_index++];
}
- MALLOC_UNBLOCK_INPUT;
+#ifndef SYNC_INPUT
+ UNBLOCK_INPUT;
+#endif
consing_since_gc += sizeof (struct interval);
intervals_consed++;
@@ -1883,7 +1875,9 @@ allocate_string ()
/* eassert (!handling_signal); */
- MALLOC_BLOCK_INPUT;
+#ifndef SYNC_INPUT
+ BLOCK_INPUT;
+#endif
/* If the free-list is empty, allocate a new string_block, and
add all the Lisp_Strings in it to the free-list. */
@@ -1914,7 +1908,9 @@ allocate_string ()
s = string_free_list;
string_free_list = NEXT_FREE_LISP_STRING (s);
- MALLOC_UNBLOCK_INPUT;
+#ifndef SYNC_INPUT
+ UNBLOCK_INPUT;
+#endif
/* Probably not strictly necessary, but play it safe. */
bzero (s, sizeof *s);
@@ -1966,7 +1962,9 @@ allocate_string_data (s, nchars, nbytes)
old_data = s->data ? SDATA_OF_STRING (s) : NULL;
old_nbytes = GC_STRING_BYTES (s);
- MALLOC_BLOCK_INPUT;
+#ifndef SYNC_INPUT
+ BLOCK_INPUT;
+#endif
if (nbytes > LARGE_STRING_BYTES)
{
@@ -1982,14 +1980,18 @@ allocate_string_data (s, nchars, nbytes)
mmap'ed data typically have an address towards the top of the
address space, which won't fit into an EMACS_INT (at least on
32-bit systems with the current tagging scheme). --fx */
+ BLOCK_INPUT;
mallopt (M_MMAP_MAX, 0);
+ UNBLOCK_INPUT;
#endif
b = (struct sblock *) lisp_malloc (size + GC_STRING_EXTRA, MEM_TYPE_NON_LISP);
#ifdef DOUG_LEA_MALLOC
/* Back to a reasonable maximum of mmap'ed areas. */
+ BLOCK_INPUT;
mallopt (M_MMAP_MAX, MMAP_MAX_AREAS);
+ UNBLOCK_INPUT;
#endif
b->next_free = &b->first_data;
@@ -2020,7 +2022,9 @@ allocate_string_data (s, nchars, nbytes)
data = b->next_free;
b->next_free = (struct sdata *) ((char *) data + needed + GC_STRING_EXTRA);
- MALLOC_UNBLOCK_INPUT;
+#ifndef SYNC_INPUT
+ UNBLOCK_INPUT;
+#endif
data->string = s;
s->data = SDATA_DATA (data);
@@ -2286,7 +2290,7 @@ INIT must be an integer that represents a character. */)
CHECK_NUMBER (init);
c = XINT (init);
- if (SINGLE_BYTE_CHAR_P (c))
+ if (ASCII_CHAR_P (c))
{
nbytes = XINT (length);
val = make_uninit_string (nbytes);
@@ -2338,13 +2342,11 @@ LENGTH must be a number. INIT matters only in whether it is t or nil. */)
/* We must allocate one more elements than LENGTH_IN_ELTS for the
slot `size' of the struct Lisp_Bool_Vector. */
val = Fmake_vector (make_number (length_in_elts + 1), Qnil);
+ p = XBOOL_VECTOR (val);
/* Get rid of any bits that would cause confusion. */
- XVECTOR (val)->size = 0; /* No Lisp_Object to trace in there. */
- /* Use XVECTOR (val) rather than `p' because p->size is not TRT. */
- XSETPVECTYPE (XVECTOR (val), PVEC_BOOL_VECTOR);
-
- p = XBOOL_VECTOR (val);
+ p->vector_size = 0;
+ XSETBOOL_VECTOR (val, p);
p->size = XFASTINT (length);
real_init = (NILP (init) ? 0 : -1);
@@ -2353,7 +2355,7 @@ LENGTH must be a number. INIT matters only in whether it is t or nil. */)
/* Clear the extraneous bits in the last byte. */
if (XINT (length) != length_in_chars * BOOL_VECTOR_BITS_PER_CHAR)
- p->data[length_in_chars - 1]
+ XBOOL_VECTOR (val)->data[length_in_chars - 1]
&= (1 << (XINT (length) % BOOL_VECTOR_BITS_PER_CHAR)) - 1;
return val;
@@ -2611,7 +2613,9 @@ make_float (float_value)
/* eassert (!handling_signal); */
- MALLOC_BLOCK_INPUT;
+#ifndef SYNC_INPUT
+ BLOCK_INPUT;
+#endif
if (float_free_list)
{
@@ -2638,7 +2642,9 @@ make_float (float_value)
float_block_index++;
}
- MALLOC_UNBLOCK_INPUT;
+#ifndef SYNC_INPUT
+ UNBLOCK_INPUT;
+#endif
XFLOAT_DATA (val) = float_value;
eassert (!FLOAT_MARKED_P (XFLOAT (val)));
@@ -2736,7 +2742,9 @@ DEFUN ("cons", Fcons, Scons, 2, 2, 0,
/* eassert (!handling_signal); */
- MALLOC_BLOCK_INPUT;
+#ifndef SYNC_INPUT
+ BLOCK_INPUT;
+#endif
if (cons_free_list)
{
@@ -2762,7 +2770,9 @@ DEFUN ("cons", Fcons, Scons, 2, 2, 0,
cons_block_index++;
}
- MALLOC_UNBLOCK_INPUT;
+#ifndef SYNC_INPUT
+ UNBLOCK_INPUT;
+#endif
XSETCAR (val, car);
XSETCDR (val, cdr);
@@ -2912,39 +2922,48 @@ int n_vectors;
with room for LEN Lisp_Objects. */
static struct Lisp_Vector *
-allocate_vectorlike (len)
+allocate_vectorlike (len, type)
EMACS_INT len;
+ enum mem_type type;
{
struct Lisp_Vector *p;
size_t nbytes;
- MALLOC_BLOCK_INPUT;
-
#ifdef DOUG_LEA_MALLOC
/* Prevent mmap'ing the chunk. Lisp data may not be mmap'ed
because mapped region contents are not preserved in
a dumped Emacs. */
+ BLOCK_INPUT;
mallopt (M_MMAP_MAX, 0);
+ UNBLOCK_INPUT;
#endif
/* This gets triggered by code which I haven't bothered to fix. --Stef */
/* eassert (!handling_signal); */
nbytes = sizeof *p + (len - 1) * sizeof p->contents[0];
- p = (struct Lisp_Vector *) lisp_malloc (nbytes, MEM_TYPE_VECTORLIKE);
+ p = (struct Lisp_Vector *) lisp_malloc (nbytes, type);
#ifdef DOUG_LEA_MALLOC
/* Back to a reasonable maximum of mmap'ed areas. */
+ BLOCK_INPUT;
mallopt (M_MMAP_MAX, MMAP_MAX_AREAS);
+ UNBLOCK_INPUT;
#endif
consing_since_gc += nbytes;
vector_cells_consed += len;
+#ifndef SYNC_INPUT
+ BLOCK_INPUT;
+#endif
+
p->next = all_vectors;
all_vectors = p;
- MALLOC_UNBLOCK_INPUT;
+#ifndef SYNC_INPUT
+ UNBLOCK_INPUT;
+#endif
++n_vectors;
return p;
@@ -2957,7 +2976,7 @@ struct Lisp_Vector *
allocate_vector (nslots)
EMACS_INT nslots;
{
- struct Lisp_Vector *v = allocate_vectorlike (nslots);
+ struct Lisp_Vector *v = allocate_vectorlike (nslots, MEM_TYPE_VECTOR);
v->size = nslots;
return v;
}
@@ -2965,78 +2984,74 @@ allocate_vector (nslots)
/* Allocate other vector-like structures. */
-static struct Lisp_Vector *
-allocate_pseudovector (memlen, lisplen, tag)
- int memlen, lisplen;
- EMACS_INT tag;
+struct Lisp_Hash_Table *
+allocate_hash_table ()
{
- struct Lisp_Vector *v = allocate_vectorlike (memlen);
+ EMACS_INT len = VECSIZE (struct Lisp_Hash_Table);
+ struct Lisp_Vector *v = allocate_vectorlike (len, MEM_TYPE_HASH_TABLE);
EMACS_INT i;
- /* Only the first lisplen slots will be traced normally by the GC. */
- v->size = lisplen;
- for (i = 0; i < lisplen; ++i)
+ v->size = len;
+ for (i = 0; i < len; ++i)
v->contents[i] = Qnil;
- XSETPVECTYPE (v, tag); /* Add the appropriate tag. */
- return v;
-}
-#define ALLOCATE_PSEUDOVECTOR(typ,field,tag) \
- ((typ*) \
- allocate_pseudovector \
- (VECSIZE (typ), PSEUDOVECSIZE (typ, field), tag))
-
-struct Lisp_Hash_Table *
-allocate_hash_table (void)
-{
- return ALLOCATE_PSEUDOVECTOR (struct Lisp_Hash_Table, count, PVEC_HASH_TABLE);
+ return (struct Lisp_Hash_Table *) v;
}
struct window *
allocate_window ()
{
- return ALLOCATE_PSEUDOVECTOR(struct window, current_matrix, PVEC_WINDOW);
-}
-
+ EMACS_INT len = VECSIZE (struct window);
+ struct Lisp_Vector *v = allocate_vectorlike (len, MEM_TYPE_WINDOW);
+ EMACS_INT i;
-struct terminal *
-allocate_terminal ()
-{
- struct terminal *t = ALLOCATE_PSEUDOVECTOR (struct terminal,
- next_terminal, PVEC_TERMINAL);
- /* Zero out the non-GC'd fields. FIXME: This should be made unnecessary. */
- bzero (&(t->next_terminal),
- ((char*)(t+1)) - ((char*)&(t->next_terminal)));
+ for (i = 0; i < len; ++i)
+ v->contents[i] = Qnil;
+ v->size = len;
- return t;
+ return (struct window *) v;
}
+
struct frame *
allocate_frame ()
{
- struct frame *f = ALLOCATE_PSEUDOVECTOR (struct frame,
- face_cache, PVEC_FRAME);
- /* Zero out the non-GC'd fields. FIXME: This should be made unnecessary. */
- bzero (&(f->face_cache),
- ((char*)(f+1)) - ((char*)&(f->face_cache)));
- return f;
+ EMACS_INT len = VECSIZE (struct frame);
+ struct Lisp_Vector *v = allocate_vectorlike (len, MEM_TYPE_FRAME);
+ EMACS_INT i;
+
+ for (i = 0; i < len; ++i)
+ v->contents[i] = make_number (0);
+ v->size = len;
+ return (struct frame *) v;
}
struct Lisp_Process *
allocate_process ()
{
- return ALLOCATE_PSEUDOVECTOR (struct Lisp_Process, pid, PVEC_PROCESS);
+ /* Memory-footprint of the object in nb of Lisp_Object fields. */
+ EMACS_INT memlen = VECSIZE (struct Lisp_Process);
+ /* Size if we only count the actual Lisp_Object fields (which need to be
+ traced by the GC). */
+ EMACS_INT lisplen = PSEUDOVECSIZE (struct Lisp_Process, pid);
+ struct Lisp_Vector *v = allocate_vectorlike (memlen, MEM_TYPE_PROCESS);
+ EMACS_INT i;
+
+ for (i = 0; i < lisplen; ++i)
+ v->contents[i] = Qnil;
+ v->size = lisplen;
+
+ return (struct Lisp_Process *) v;
}
-/* Only used for PVEC_WINDOW_CONFIGURATION. */
struct Lisp_Vector *
allocate_other_vector (len)
EMACS_INT len;
{
- struct Lisp_Vector *v = allocate_vectorlike (len);
+ struct Lisp_Vector *v = allocate_vectorlike (len, MEM_TYPE_VECTOR);
EMACS_INT i;
for (i = 0; i < len; ++i)
@@ -3070,51 +3085,6 @@ See also the function `vector'. */)
}
-DEFUN ("make-char-table", Fmake_char_table, Smake_char_table, 1, 2, 0,
- doc: /* Return a newly created char-table, with purpose PURPOSE.
-Each element is initialized to INIT, which defaults to nil.
-PURPOSE should be a symbol which has a `char-table-extra-slots' property.
-The property's value should be an integer between 0 and 10. */)
- (purpose, init)
- register Lisp_Object purpose, init;
-{
- Lisp_Object vector;
- Lisp_Object n;
- CHECK_SYMBOL (purpose);
- n = Fget (purpose, Qchar_table_extra_slots);
- CHECK_NUMBER (n);
- if (XINT (n) < 0 || XINT (n) > 10)
- args_out_of_range (n, Qnil);
- /* Add 2 to the size for the defalt and parent slots. */
- vector = Fmake_vector (make_number (CHAR_TABLE_STANDARD_SLOTS + XINT (n)),
- init);
- XSETPVECTYPE (XVECTOR (vector), PVEC_CHAR_TABLE);
- XCHAR_TABLE (vector)->top = Qt;
- XCHAR_TABLE (vector)->parent = Qnil;
- XCHAR_TABLE (vector)->purpose = purpose;
- XSETCHAR_TABLE (vector, XCHAR_TABLE (vector));
- return vector;
-}
-
-
-/* Return a newly created sub char table with slots initialized by INIT.
- Since a sub char table does not appear as a top level Emacs Lisp
- object, we don't need a Lisp interface to make it. */
-
-Lisp_Object
-make_sub_char_table (init)
- Lisp_Object init;
-{
- Lisp_Object vector
- = Fmake_vector (make_number (SUB_CHAR_TABLE_STANDARD_SLOTS), init);
- XSETPVECTYPE (XVECTOR (vector), PVEC_CHAR_TABLE);
- XCHAR_TABLE (vector)->top = Qnil;
- XCHAR_TABLE (vector)->defalt = Qnil;
- XSETCHAR_TABLE (vector, XCHAR_TABLE (vector));
- return vector;
-}
-
-
DEFUN ("vector", Fvector, Svector, 0, MANY, 0,
doc: /* Return a newly created vector with specified arguments as elements.
Any number of arguments, even zero arguments, are allowed.
@@ -3172,7 +3142,6 @@ usage: (make-byte-code ARGLIST BYTE-CODE CONSTANTS DEPTH &optional DOCSTRING INT
args[index] = Fpurecopy (args[index]);
p->contents[index] = args[index];
}
- XSETPVECTYPE (p, PVEC_COMPILED);
XSETCOMPILED (val, p);
return val;
}
@@ -3237,7 +3206,9 @@ Its value and function definition are void, and its property list is nil. */)
/* eassert (!handling_signal); */
- MALLOC_BLOCK_INPUT;
+#ifndef SYNC_INPUT
+ BLOCK_INPUT;
+#endif
if (symbol_free_list)
{
@@ -3260,7 +3231,9 @@ Its value and function definition are void, and its property list is nil. */)
symbol_block_index++;
}
- MALLOC_UNBLOCK_INPUT;
+#ifndef SYNC_INPUT
+ UNBLOCK_INPUT;
+#endif
p = XSYMBOL (val);
p->xname = name;
@@ -3323,7 +3296,9 @@ allocate_misc ()
/* eassert (!handling_signal); */
- MALLOC_BLOCK_INPUT;
+#ifndef SYNC_INPUT
+ BLOCK_INPUT;
+#endif
if (marker_free_list)
{
@@ -3347,7 +3322,9 @@ allocate_misc ()
marker_block_index++;
}
- MALLOC_UNBLOCK_INPUT;
+#ifndef SYNC_INPUT
+ UNBLOCK_INPUT;
+#endif
--total_free_markers;
consing_since_gc += sizeof (union Lisp_Misc);
@@ -4093,7 +4070,9 @@ live_vector_p (m, p)
struct mem_node *m;
void *p;
{
- return (p == m->start && m->type == MEM_TYPE_VECTORLIKE);
+ return (p == m->start
+ && m->type >= MEM_TYPE_VECTOR
+ && m->type <= MEM_TYPE_WINDOW);
}
@@ -4179,7 +4158,7 @@ mark_maybe_object (obj)
{
int mark_p = 0;
- switch (XGCTYPE (obj))
+ switch (XTYPE (obj))
{
case Lisp_String:
mark_p = (live_string_p (m, po)
@@ -4199,13 +4178,13 @@ mark_maybe_object (obj)
break;
case Lisp_Vectorlike:
- /* Note: can't check GC_BUFFERP before we know it's a
+ /* Note: can't check BUFFERP before we know it's a
buffer because checking that dereferences the pointer
PO which might point anywhere. */
if (live_vector_p (m, po))
- mark_p = !GC_SUBRP (obj) && !VECTOR_MARKED_P (XVECTOR (obj));
+ mark_p = !SUBRP (obj) && !VECTOR_MARKED_P (XVECTOR (obj));
else if (live_buffer_p (m, po))
- mark_p = GC_BUFFERP (obj) && !VECTOR_MARKED_P (XBUFFER (obj));
+ mark_p = BUFFERP (obj) && !VECTOR_MARKED_P (XBUFFER (obj));
break;
case Lisp_Misc:
@@ -4291,12 +4270,16 @@ mark_maybe_pointer (p)
XSETFLOAT (obj, p);
break;
- case MEM_TYPE_VECTORLIKE:
+ case MEM_TYPE_VECTOR:
+ case MEM_TYPE_PROCESS:
+ case MEM_TYPE_HASH_TABLE:
+ case MEM_TYPE_FRAME:
+ case MEM_TYPE_WINDOW:
if (live_vector_p (m, p))
{
Lisp_Object tem;
XSETVECTOR (tem, p);
- if (!GC_SUBRP (tem) && !VECTOR_MARKED_P (XVECTOR (tem)))
+ if (!SUBRP (tem) && !VECTOR_MARKED_P (XVECTOR (tem)))
obj = tem;
}
break;
@@ -4305,7 +4288,7 @@ mark_maybe_pointer (p)
abort ();
}
- if (!GC_NILP (obj))
+ if (!NILP (obj))
mark_object (obj);
}
}
@@ -4691,7 +4674,11 @@ valid_lisp_object_p (obj)
case MEM_TYPE_FLOAT:
return live_float_p (m, p);
- case MEM_TYPE_VECTORLIKE:
+ case MEM_TYPE_VECTOR:
+ case MEM_TYPE_PROCESS:
+ case MEM_TYPE_HASH_TABLE:
+ case MEM_TYPE_FRAME:
+ case MEM_TYPE_WINDOW:
return live_vector_p (m, p);
default:
@@ -5066,7 +5053,8 @@ returns nil, because real GC can't be done. */)
truncate_undo_list (nextb);
/* Shrink buffer gaps, but skip indirect and dead buffers. */
- if (nextb->base_buffer == 0 && !NILP (nextb->name))
+ if (nextb->base_buffer == 0 && !NILP (nextb->name)
+ && ! nextb->text->inhibit_shrinking)
{
/* If a buffer's gap size is more than 10% of the buffer
size, or larger than 2000 bytes, then shrink it
@@ -5140,9 +5128,7 @@ returns nil, because real GC can't be done. */)
mark_object (bind->symbol);
mark_object (bind->old_value);
}
- mark_terminals ();
mark_kboards ();
- mark_ttys ();
#ifdef USE_GTK
{
@@ -5205,8 +5191,8 @@ returns nil, because real GC can't be done. */)
prev = Qnil;
while (CONSP (tail))
{
- if (GC_CONSP (XCAR (tail))
- && GC_MARKERP (XCAR (XCAR (tail)))
+ if (CONSP (XCAR (tail))
+ && MARKERP (XCAR (XCAR (tail)))
&& !XMARKER (XCAR (XCAR (tail)))->gcmarkbit)
{
if (NILP (prev))
@@ -5355,7 +5341,7 @@ mark_glyph_matrix (matrix)
struct glyph *end_glyph = glyph + row->used[area];
for (; glyph < end_glyph; ++glyph)
- if (GC_STRINGP (glyph->object)
+ if (STRINGP (glyph->object)
&& !STRING_MARKED_P (XSTRING (glyph->object)))
mark_object (glyph->object);
}
@@ -5429,29 +5415,6 @@ int last_marked_index;
Normally this is zero and the check never goes off. */
int mark_object_loop_halt;
-/* Return non-zero if the object was not yet marked. */
-static int
-mark_vectorlike (ptr)
- struct Lisp_Vector *ptr;
-{
- register EMACS_INT size = ptr->size;
- register int i;
-
- if (VECTOR_MARKED_P (ptr))
- return 0; /* Already marked */
- VECTOR_MARK (ptr); /* Else mark it */
- if (size & PSEUDOVECTOR_FLAG)
- size &= PSEUDOVECTOR_SIZE_MASK;
-
- /* Note that this size is not the memory-footprint size, but only
- the number of Lisp_Object fields that we should trace.
- The distinction is used e.g. by Lisp_Process which places extra
- non-Lisp_Object fields at the end of the structure. */
- for (i = 0; i < size; i++) /* and then mark its elements */
- mark_object (ptr->contents[i]);
- return 1;
-}
-
void
mark_object (arg)
Lisp_Object arg;
@@ -5511,7 +5474,7 @@ mark_object (arg)
#endif /* not GC_CHECK_MARKED_OBJECTS */
- switch (SWITCH_ENUM_CAST (XGCTYPE (obj)))
+ switch (SWITCH_ENUM_CAST (XTYPE (obj)))
{
case Lisp_String:
{
@@ -5530,13 +5493,13 @@ mark_object (arg)
case Lisp_Vectorlike:
#ifdef GC_CHECK_MARKED_OBJECTS
m = mem_find (po);
- if (m == MEM_NIL && !GC_SUBRP (obj)
+ if (m == MEM_NIL && !SUBRP (obj)
&& po != &buffer_defaults
&& po != &buffer_local_symbols)
abort ();
#endif /* GC_CHECK_MARKED_OBJECTS */
- if (GC_BUFFERP (obj))
+ if (BUFFERP (obj))
{
if (!VECTOR_MARKED_P (XBUFFER (obj)))
{
@@ -5553,9 +5516,9 @@ mark_object (arg)
mark_buffer (obj);
}
}
- else if (GC_SUBRP (obj))
+ else if (SUBRP (obj))
break;
- else if (GC_COMPILEDP (obj))
+ else if (COMPILEDP (obj))
/* We could treat this just like a vector, but it is better to
save the COMPILED_CONSTANTS element for last and avoid
recursion there. */
@@ -5578,49 +5541,132 @@ mark_object (arg)
obj = ptr->contents[COMPILED_CONSTANTS];
goto loop;
}
- else if (GC_FRAMEP (obj))
+ else if (FRAMEP (obj))
{
register struct frame *ptr = XFRAME (obj);
- if (mark_vectorlike (XVECTOR (obj)))
- {
- mark_face_cache (ptr->face_cache);
+
+ if (VECTOR_MARKED_P (ptr)) break; /* Already marked */
+ VECTOR_MARK (ptr); /* Else mark it */
+
+ CHECK_LIVE (live_vector_p);
+ mark_object (ptr->name);
+ mark_object (ptr->icon_name);
+ mark_object (ptr->title);
+ mark_object (ptr->focus_frame);
+ mark_object (ptr->selected_window);
+ mark_object (ptr->minibuffer_window);
+ mark_object (ptr->param_alist);
+ mark_object (ptr->scroll_bars);
+ mark_object (ptr->condemned_scroll_bars);
+ mark_object (ptr->menu_bar_items);
+ mark_object (ptr->face_alist);
+ mark_object (ptr->menu_bar_vector);
+ mark_object (ptr->buffer_predicate);
+ mark_object (ptr->buffer_list);
+ mark_object (ptr->menu_bar_window);
+ mark_object (ptr->tool_bar_window);
+ mark_face_cache (ptr->face_cache);
#ifdef HAVE_WINDOW_SYSTEM
- mark_image_cache (ptr);
+ mark_image_cache (ptr);
+ mark_object (ptr->tool_bar_items);
+ mark_object (ptr->desired_tool_bar_string);
+ mark_object (ptr->current_tool_bar_string);
#endif /* HAVE_WINDOW_SYSTEM */
- }
}
- else if (GC_WINDOWP (obj))
+ else if (BOOL_VECTOR_P (obj))
+ {
+ register struct Lisp_Vector *ptr = XVECTOR (obj);
+
+ if (VECTOR_MARKED_P (ptr))
+ break; /* Already marked */
+ CHECK_LIVE (live_vector_p);
+ VECTOR_MARK (ptr); /* Else mark it */
+ }
+ else if (WINDOWP (obj))
{
register struct Lisp_Vector *ptr = XVECTOR (obj);
struct window *w = XWINDOW (obj);
- if (mark_vectorlike (ptr))
+ register int i;
+
+ /* Stop if already marked. */
+ if (VECTOR_MARKED_P (ptr))
+ break;
+
+ /* Mark it. */
+ CHECK_LIVE (live_vector_p);
+ VECTOR_MARK (ptr);
+
+ /* There is no Lisp data above The member CURRENT_MATRIX in
+ struct WINDOW. Stop marking when that slot is reached. */
+ for (i = 0;
+ (char *) &ptr->contents[i] < (char *) &w->current_matrix;
+ i++)
+ mark_object (ptr->contents[i]);
+
+ /* Mark glyphs for leaf windows. Marking window matrices is
+ sufficient because frame matrices use the same glyph
+ memory. */
+ if (NILP (w->hchild)
+ && NILP (w->vchild)
+ && w->current_matrix)
{
- /* Mark glyphs for leaf windows. Marking window matrices is
- sufficient because frame matrices use the same glyph
- memory. */
- if (NILP (w->hchild)
- && NILP (w->vchild)
- && w->current_matrix)
- {
- mark_glyph_matrix (w->current_matrix);
- mark_glyph_matrix (w->desired_matrix);
- }
+ mark_glyph_matrix (w->current_matrix);
+ mark_glyph_matrix (w->desired_matrix);
}
}
- else if (GC_HASH_TABLE_P (obj))
+ else if (HASH_TABLE_P (obj))
{
struct Lisp_Hash_Table *h = XHASH_TABLE (obj);
- if (mark_vectorlike ((struct Lisp_Vector *)h))
- { /* If hash table is not weak, mark all keys and values.
- For weak tables, mark only the vector. */
- if (GC_NILP (h->weak))
- mark_object (h->key_and_value);
- else
- VECTOR_MARK (XVECTOR (h->key_and_value));
- }
+
+ /* Stop if already marked. */
+ if (VECTOR_MARKED_P (h))
+ break;
+
+ /* Mark it. */
+ CHECK_LIVE (live_vector_p);
+ VECTOR_MARK (h);
+
+ /* Mark contents. */
+ /* Do not mark next_free or next_weak.
+ Being in the next_weak chain
+ should not keep the hash table alive.
+ No need to mark `count' since it is an integer. */
+ mark_object (h->test);
+ mark_object (h->weak);
+ mark_object (h->rehash_size);
+ mark_object (h->rehash_threshold);
+ mark_object (h->hash);
+ mark_object (h->next);
+ mark_object (h->index);
+ mark_object (h->user_hash_function);
+ mark_object (h->user_cmp_function);
+
+ /* If hash table is not weak, mark all keys and values.
+ For weak tables, mark only the vector. */
+ if (NILP (h->weak))
+ mark_object (h->key_and_value);
+ else
+ VECTOR_MARK (XVECTOR (h->key_and_value));
}
else
- mark_vectorlike (XVECTOR (obj));
+ {
+ register struct Lisp_Vector *ptr = XVECTOR (obj);
+ register EMACS_INT size = ptr->size;
+ register int i;
+
+ if (VECTOR_MARKED_P (ptr)) break; /* Already marked */
+ CHECK_LIVE (live_vector_p);
+ VECTOR_MARK (ptr); /* Else mark it */
+ if (size & PSEUDOVECTOR_FLAG)
+ size &= PSEUDOVECTOR_SIZE_MASK;
+
+ /* Note that this size is not the memory-footprint size, but only
+ the number of Lisp_Object fields that we should trace.
+ The distinction is used e.g. by Lisp_Process which places extra
+ non-Lisp_Object fields at the end of the structure. */
+ for (i = 0; i < size; i++) /* and then mark its elements */
+ mark_object (ptr->contents[i]);
+ }
break;
case Lisp_Symbol:
@@ -5811,21 +5857,6 @@ mark_buffer (buf)
}
}
-/* Mark the Lisp pointers in the terminal objects.
- Called by the Fgarbage_collector. */
-
-static void
-mark_terminals (void)
-{
- struct terminal *t;
- for (t = terminal_list; t; t = t->next_terminal)
- {
- eassert (t->name != NULL);
- mark_vectorlike ((struct Lisp_Vector *)t);
- }
-}
-
-
/* Value is non-zero if OBJ will survive the current GC because it's
either marked or does not need to be marked to survive. */
@@ -5836,7 +5867,7 @@ survives_gc_p (obj)
{
int survives_p;
- switch (XGCTYPE (obj))
+ switch (XTYPE (obj))
{
case Lisp_Int:
survives_p = 1;
@@ -5855,7 +5886,7 @@ survives_gc_p (obj)
break;
case Lisp_Vectorlike:
- survives_p = GC_SUBRP (obj) || VECTOR_MARKED_P (XVECTOR (obj));
+ survives_p = SUBRP (obj) || VECTOR_MARKED_P (XVECTOR (obj));
break;
case Lisp_Cons:
@@ -5901,51 +5932,23 @@ gc_sweep ()
for (cblk = cons_block; cblk; cblk = *cprev)
{
- register int i = 0;
+ register int i;
int this_free = 0;
- int ilim = (lim + BITS_PER_INT - 1) / BITS_PER_INT;
-
- /* Scan the mark bits an int at a time. */
- for (i = 0; i <= ilim; i++)
- {
- if (cblk->gcmarkbits[i] == -1)
- {
- /* Fast path - all cons cells for this int are marked. */
- cblk->gcmarkbits[i] = 0;
- num_used += BITS_PER_INT;
- }
- else
- {
- /* Some cons cells for this int are not marked.
- Find which ones, and free them. */
- int start, pos, stop;
-
- start = i * BITS_PER_INT;
- stop = lim - start;
- if (stop > BITS_PER_INT)
- stop = BITS_PER_INT;
- stop += start;
-
- for (pos = start; pos < stop; pos++)
- {
- if (!CONS_MARKED_P (&cblk->conses[pos]))
- {
- this_free++;
- cblk->conses[pos].u.chain = cons_free_list;
- cons_free_list = &cblk->conses[pos];
+ for (i = 0; i < lim; i++)
+ if (!CONS_MARKED_P (&cblk->conses[i]))
+ {
+ this_free++;
+ cblk->conses[i].u.chain = cons_free_list;
+ cons_free_list = &cblk->conses[i];
#if GC_MARK_STACK
- cons_free_list->car = Vdead;
+ cons_free_list->car = Vdead;
#endif
- }
- else
- {
- num_used++;
- CONS_UNMARK (&cblk->conses[pos]);
- }
- }
- }
- }
-
+ }
+ else
+ {
+ num_used++;
+ CONS_UNMARK (&cblk->conses[i]);
+ }
lim = CONS_BLOCK_SIZE;
/* If this block contains only free conses and we have already
seen more than two blocks worth of free conses then deallocate
@@ -6464,7 +6467,6 @@ The time is in seconds as a floating point value. */);
defsubr (&Smake_byte_code);
defsubr (&Smake_list);
defsubr (&Smake_vector);
- defsubr (&Smake_char_table);
defsubr (&Smake_string);
defsubr (&Smake_bool_vector);
defsubr (&Smake_symbol);
diff --git a/src/alloca.c b/src/alloca.c
new file mode 100644
index 0000000000..e8c8319adc
--- /dev/null
+++ b/src/alloca.c
@@ -0,0 +1,517 @@
+/* alloca.c -- allocate automatically reclaimed memory
+ (Mostly) portable public-domain implementation -- D A Gwyn
+
+ NOTE: The canonical source of this file is maintained with gnulib.
+ Bugs can be reported to [email protected].
+
+ This implementation of the PWB library alloca function,
+ which is used to allocate space off the run-time stack so
+ that it is automatically reclaimed upon procedure exit,
+ was inspired by discussions with J. Q. Johnson of Cornell.
+ J.Otto Tennant <[email protected]> contributed the Cray support.
+
+ There are some preprocessor constants that can
+ be defined when compiling for your specific system, for
+ improved efficiency; however, the defaults should be okay.
+
+ The general concept of this implementation is to keep
+ track of all alloca-allocated blocks, and reclaim any
+ that are found to be deeper in the stack than the current
+ invocation. This heuristic does not reclaim storage as
+ soon as it becomes invalid, but it will do so eventually.
+
+ As a special case, alloca(0) reclaims storage without
+ allocating any. It is a good idea to use alloca(0) in
+ your main control loop, etc. to force garbage collection. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#ifdef HAVE_STRING_H
+# include <string.h>
+#endif
+#ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+#endif
+
+#ifdef DO_BLOCK_INPUT
+# include "blockinput.h"
+#endif
+
+/* If compiling with GCC 2, this file's not needed. */
+#if !defined (__GNUC__) || __GNUC__ < 2
+
+/* If someone has defined alloca as a macro,
+ there must be some other way alloca is supposed to work. */
+# ifndef alloca
+
+# ifdef emacs
+# ifdef static
+/* actually, only want this if static is defined as ""
+ -- this is for usg, in which emacs must undefine static
+ in order to make unexec workable
+ */
+# ifndef STACK_DIRECTION
+you
+lose
+-- must know STACK_DIRECTION at compile-time
+/* Using #error here is not wise since this file should work for
+ old and obscure compilers.
+
+ As far as I know, using it is OK if it's indented -- at least for
+ pcc-based processors. -- fx */
+# endif /* STACK_DIRECTION undefined */
+# endif /* static */
+# endif /* emacs */
+
+/* If your stack is a linked list of frames, you have to
+ provide an "address metric" ADDRESS_FUNCTION macro. */
+
+# if defined (CRAY) && defined (CRAY_STACKSEG_END)
+long i00afunc ();
+# define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg))
+# else
+# define ADDRESS_FUNCTION(arg) &(arg)
+# endif
+
+# ifndef POINTER_TYPE
+# ifdef __STDC__
+# define POINTER_TYPE void
+# else
+# define POINTER_TYPE char
+# endif
+# endif
+typedef POINTER_TYPE *pointer;
+
+# ifndef NULL
+# define NULL 0
+# endif
+
+/* The Emacs executable needs alloca to call xmalloc, because ordinary
+ malloc isn't protected from input signals. xmalloc also checks for
+ out-of-memory errors, so we should use it generally.
+
+ Callers below should use malloc. */
+
+# undef malloc
+# define malloc xmalloc
+# undef free
+# define free xfree
+
+void *xmalloc _P ((size_t));
+void xfree _P ((void *));
+
+/* Define STACK_DIRECTION if you know the direction of stack
+ growth for your system; otherwise it will be automatically
+ deduced at run-time.
+
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown */
+
+# ifndef STACK_DIRECTION
+# define STACK_DIRECTION 0 /* Direction unknown. */
+# endif
+
+# if STACK_DIRECTION != 0
+
+# define STACK_DIR STACK_DIRECTION /* Known at compile-time. */
+
+# else /* STACK_DIRECTION == 0; need run-time code. */
+
+static int stack_dir; /* 1 or -1 once known. */
+# define STACK_DIR stack_dir
+
+static void
+find_stack_direction ()
+{
+ static char *addr = NULL; /* Address of first `dummy', once known. */
+ auto char dummy; /* To get stack address. */
+
+ if (addr == NULL)
+ { /* Initial entry. */
+ addr = ADDRESS_FUNCTION (dummy);
+
+ find_stack_direction (); /* Recurse once. */
+ }
+ else
+ {
+ /* Second entry. */
+ if (ADDRESS_FUNCTION (dummy) > addr)
+ stack_dir = 1; /* Stack grew upward. */
+ else
+ stack_dir = -1; /* Stack grew downward. */
+ }
+}
+
+# endif /* STACK_DIRECTION == 0 */
+
+/* An "alloca header" is used to:
+ (a) chain together all alloca'ed blocks;
+ (b) keep track of stack depth.
+
+ It is very important that sizeof(header) agree with malloc
+ alignment chunk size. The following default should work okay. */
+
+# ifndef ALIGN_SIZE
+# define ALIGN_SIZE sizeof(double)
+# endif
+
+typedef union hdr
+{
+ char align[ALIGN_SIZE]; /* To force sizeof(header). */
+ struct
+ {
+ union hdr *next; /* For chaining headers. */
+ char *deep; /* For stack depth measure. */
+ } h;
+} header;
+
+static header *last_alloca_header = NULL; /* -> last alloca header. */
+
+/* Return a pointer to at least SIZE bytes of storage,
+ which will be automatically reclaimed upon exit from
+ the procedure that called alloca. Originally, this space
+ was supposed to be taken from the current stack frame of the
+ caller, but that method cannot be made to work for some
+ implementations of C, for example under Gould's UTX/32. */
+
+pointer
+alloca (size)
+ size_t size;
+{
+ auto char probe; /* Probes stack depth: */
+ register char *depth = ADDRESS_FUNCTION (probe);
+
+# if STACK_DIRECTION == 0
+ if (STACK_DIR == 0) /* Unknown growth direction. */
+ find_stack_direction ();
+# endif
+
+ /* Reclaim garbage, defined as all alloca'd storage that
+ was allocated from deeper in the stack than currently. */
+
+ {
+ register header *hp; /* Traverses linked list. */
+
+# ifdef DO_BLOCK_INPUT
+ BLOCK_INPUT;
+# endif
+
+ for (hp = last_alloca_header; hp != NULL;)
+ if ((STACK_DIR > 0 && hp->h.deep > depth)
+ || (STACK_DIR < 0 && hp->h.deep < depth))
+ {
+ register header *np = hp->h.next;
+
+ free ((pointer) hp); /* Collect garbage. */
+
+ hp = np; /* -> next header. */
+ }
+ else
+ break; /* Rest are not deeper. */
+
+ last_alloca_header = hp; /* -> last valid storage. */
+
+# ifdef DO_BLOCK_INPUT
+ UNBLOCK_INPUT;
+# endif
+ }
+
+ if (size == 0)
+ return NULL; /* No allocation required. */
+
+ /* Allocate combined header + user data storage. */
+
+ {
+ /* Address of header. */
+ register pointer new = malloc (sizeof (header) + size);
+
+ if (new == 0)
+ abort();
+
+ ((header *) new)->h.next = last_alloca_header;
+ ((header *) new)->h.deep = depth;
+
+ last_alloca_header = (header *) new;
+
+ /* User storage begins just after header. */
+
+ return (pointer) ((char *) new + sizeof (header));
+ }
+}
+
+# if defined (CRAY) && defined (CRAY_STACKSEG_END)
+
+# ifdef DEBUG_I00AFUNC
+# include <stdio.h>
+# endif
+
+# ifndef CRAY_STACK
+# define CRAY_STACK
+# ifndef CRAY2
+/* Stack structures for CRAY-1, CRAY X-MP, and CRAY Y-MP */
+struct stack_control_header
+ {
+ long shgrow:32; /* Number of times stack has grown. */
+ long shaseg:32; /* Size of increments to stack. */
+ long shhwm:32; /* High water mark of stack. */
+ long shsize:32; /* Current size of stack (all segments). */
+ };
+
+/* The stack segment linkage control information occurs at
+ the high-address end of a stack segment. (The stack
+ grows from low addresses to high addresses.) The initial
+ part of the stack segment linkage control information is
+ 0200 (octal) words. This provides for register storage
+ for the routine which overflows the stack. */
+
+struct stack_segment_linkage
+ {
+ long ss[0200]; /* 0200 overflow words. */
+ long sssize:32; /* Number of words in this segment. */
+ long ssbase:32; /* Offset to stack base. */
+ long:32;
+ long sspseg:32; /* Offset to linkage control of previous
+ segment of stack. */
+ long:32;
+ long sstcpt:32; /* Pointer to task common address block. */
+ long sscsnm; /* Private control structure number for
+ microtasking. */
+ long ssusr1; /* Reserved for user. */
+ long ssusr2; /* Reserved for user. */
+ long sstpid; /* Process ID for pid based multi-tasking. */
+ long ssgvup; /* Pointer to multitasking thread giveup. */
+ long sscray[7]; /* Reserved for Cray Research. */
+ long ssa0;
+ long ssa1;
+ long ssa2;
+ long ssa3;
+ long ssa4;
+ long ssa5;
+ long ssa6;
+ long ssa7;
+ long sss0;
+ long sss1;
+ long sss2;
+ long sss3;
+ long sss4;
+ long sss5;
+ long sss6;
+ long sss7;
+ };
+
+# else /* CRAY2 */
+/* The following structure defines the vector of words
+ returned by the STKSTAT library routine. */
+struct stk_stat
+ {
+ long now; /* Current total stack size. */
+ long maxc; /* Amount of contiguous space which would
+ be required to satisfy the maximum
+ stack demand to date. */
+ long high_water; /* Stack high-water mark. */
+ long overflows; /* Number of stack overflow ($STKOFEN) calls. */
+ long hits; /* Number of internal buffer hits. */
+ long extends; /* Number of block extensions. */
+ long stko_mallocs; /* Block allocations by $STKOFEN. */
+ long underflows; /* Number of stack underflow calls ($STKRETN). */
+ long stko_free; /* Number of deallocations by $STKRETN. */
+ long stkm_free; /* Number of deallocations by $STKMRET. */
+ long segments; /* Current number of stack segments. */
+ long maxs; /* Maximum number of stack segments so far. */
+ long pad_size; /* Stack pad size. */
+ long current_address; /* Current stack segment address. */
+ long current_size; /* Current stack segment size. This
+ number is actually corrupted by STKSTAT to
+ include the fifteen word trailer area. */
+ long initial_address; /* Address of initial segment. */
+ long initial_size; /* Size of initial segment. */
+ };
+
+/* The following structure describes the data structure which trails
+ any stack segment. I think that the description in 'asdef' is
+ out of date. I only describe the parts that I am sure about. */
+
+struct stk_trailer
+ {
+ long this_address; /* Address of this block. */
+ long this_size; /* Size of this block (does not include
+ this trailer). */
+ long unknown2;
+ long unknown3;
+ long link; /* Address of trailer block of previous
+ segment. */
+ long unknown5;
+ long unknown6;
+ long unknown7;
+ long unknown8;
+ long unknown9;
+ long unknown10;
+ long unknown11;
+ long unknown12;
+ long unknown13;
+ long unknown14;
+ };
+
+# endif /* CRAY2 */
+# endif /* not CRAY_STACK */
+
+# ifdef CRAY2
+/* Determine a "stack measure" for an arbitrary ADDRESS.
+ I doubt that "lint" will like this much. */
+
+static long
+i00afunc (long *address)
+{
+ struct stk_stat status;
+ struct stk_trailer *trailer;
+ long *block, size;
+ long result = 0;
+
+ /* We want to iterate through all of the segments. The first
+ step is to get the stack status structure. We could do this
+ more quickly and more directly, perhaps, by referencing the
+ $LM00 common block, but I know that this works. */
+
+ STKSTAT (&status);
+
+ /* Set up the iteration. */
+
+ trailer = (struct stk_trailer *) (status.current_address
+ + status.current_size
+ - 15);
+
+ /* There must be at least one stack segment. Therefore it is
+ a fatal error if "trailer" is null. */
+
+ if (trailer == 0)
+ abort ();
+
+ /* Discard segments that do not contain our argument address. */
+
+ while (trailer != 0)
+ {
+ block = (long *) trailer->this_address;
+ size = trailer->this_size;
+ if (block == 0 || size == 0)
+ abort ();
+ trailer = (struct stk_trailer *) trailer->link;
+ if ((block <= address) && (address < (block + size)))
+ break;
+ }
+
+ /* Set the result to the offset in this segment and add the sizes
+ of all predecessor segments. */
+
+ result = address - block;
+
+ if (trailer == 0)
+ {
+ return result;
+ }
+
+ do
+ {
+ if (trailer->this_size <= 0)
+ abort ();
+ result += trailer->this_size;
+ trailer = (struct stk_trailer *) trailer->link;
+ }
+ while (trailer != 0);
+
+ /* We are done. Note that if you present a bogus address (one
+ not in any segment), you will get a different number back, formed
+ from subtracting the address of the first block. This is probably
+ not what you want. */
+
+ return (result);
+}
+
+# else /* not CRAY2 */
+/* Stack address function for a CRAY-1, CRAY X-MP, or CRAY Y-MP.
+ Determine the number of the cell within the stack,
+ given the address of the cell. The purpose of this
+ routine is to linearize, in some sense, stack addresses
+ for alloca. */
+
+static long
+i00afunc (long address)
+{
+ long stkl = 0;
+
+ long size, pseg, this_segment, stack;
+ long result = 0;
+
+ struct stack_segment_linkage *ssptr;
+
+ /* Register B67 contains the address of the end of the
+ current stack segment. If you (as a subprogram) store
+ your registers on the stack and find that you are past
+ the contents of B67, you have overflowed the segment.
+
+ B67 also points to the stack segment linkage control
+ area, which is what we are really interested in. */
+
+ stkl = CRAY_STACKSEG_END ();
+ ssptr = (struct stack_segment_linkage *) stkl;
+
+ /* If one subtracts 'size' from the end of the segment,
+ one has the address of the first word of the segment.
+
+ If this is not the first segment, 'pseg' will be
+ nonzero. */
+
+ pseg = ssptr->sspseg;
+ size = ssptr->sssize;
+
+ this_segment = stkl - size;
+
+ /* It is possible that calling this routine itself caused
+ a stack overflow. Discard stack segments which do not
+ contain the target address. */
+
+ while (!(this_segment <= address && address <= stkl))
+ {
+# ifdef DEBUG_I00AFUNC
+ fprintf (stderr, "%011o %011o %011o\n", this_segment, address, stkl);
+# endif
+ if (pseg == 0)
+ break;
+ stkl = stkl - pseg;
+ ssptr = (struct stack_segment_linkage *) stkl;
+ size = ssptr->sssize;
+ pseg = ssptr->sspseg;
+ this_segment = stkl - size;
+ }
+
+ result = address - this_segment;
+
+ /* If you subtract pseg from the current end of the stack,
+ you get the address of the previous stack segment's end.
+ This seems a little convoluted to me, but I'll bet you save
+ a cycle somewhere. */
+
+ while (pseg != 0)
+ {
+# ifdef DEBUG_I00AFUNC
+ fprintf (stderr, "%011o %011o\n", pseg, size);
+# endif
+ stkl = stkl - pseg;
+ ssptr = (struct stack_segment_linkage *) stkl;
+ size = ssptr->sssize;
+ pseg = ssptr->sspseg;
+ result += size;
+ }
+ return (result);
+}
+
+# endif /* not CRAY2 */
+# endif /* CRAY */
+
+# endif /* no alloca */
+#endif /* not GCC version 2 */
+
+/* arch-tag: 5c9901c8-3cd4-453e-bd66-d9035a175ee3
+ (do not change this comment) */
diff --git a/src/buffer.c b/src/buffer.c
index ede5d9e1ce..3a2b9460c1 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -42,7 +42,7 @@ extern int errno;
#include "window.h"
#include "commands.h"
#include "buffer.h"
-#include "charset.h"
+#include "character.h"
#include "region-cache.h"
#include "indent.h"
#include "blockinput.h"
@@ -184,6 +184,7 @@ static struct Lisp_Overlay * copy_overlays P_ ((struct buffer *, struct Lisp_Ove
static void modify_overlay P_ ((struct buffer *, EMACS_INT, EMACS_INT));
static Lisp_Object buffer_lisp_local_variables P_ ((struct buffer *));
+extern char * emacs_strerror P_ ((int));
/* For debugging; temporary. See set_buffer_internal. */
/* Lisp_Object Qlisp_mode, Vcheck_symbol; */
@@ -215,38 +216,25 @@ frame parameter come first, followed by the rest of the buffers. */)
(frame)
Lisp_Object frame;
{
- Lisp_Object general;
+ Lisp_Object framelist, general;
general = Fmapcar (Qcdr, Vbuffer_alist);
if (FRAMEP (frame))
{
- Lisp_Object framelist, prevlist, tail;
- Lisp_Object args[3];
+ Lisp_Object tail;
CHECK_FRAME (frame);
framelist = Fcopy_sequence (XFRAME (frame)->buffer_list);
- prevlist = Fnreverse (Fcopy_sequence (XFRAME (frame)->buried_buffer_list));
- /* Remove from GENERAL any buffer that duplicates one in
- FRAMELIST or PREVLIST. */
+ /* Remove from GENERAL any buffer that duplicates one in FRAMELIST. */
tail = framelist;
- while (CONSP (tail))
+ while (! NILP (tail))
{
general = Fdelq (XCAR (tail), general);
tail = XCDR (tail);
}
- tail = prevlist;
- while (CONSP (tail))
- {
- general = Fdelq (XCAR (tail), general);
- tail = XCDR (tail);
- }
-
- args[0] = framelist;
- args[1] = general;
- args[2] = prevlist;
- return Fnconc (3, args);
+ return nconc2 (framelist, general);
}
return general;
@@ -429,7 +417,6 @@ The value is never nil. */)
b->name = name;
/* Put this in the alist of all live buffers. */
- XSETPVECTYPE (b, PVEC_BUFFER);
XSETBUFFER (buf, b);
Vbuffer_alist = nconc2 (Vbuffer_alist, Fcons (Fcons (name, buf), Qnil));
@@ -1597,23 +1584,6 @@ record_buffer (buf)
XSETCDR (link, Vbuffer_alist);
Vbuffer_alist = link;
- /* Effectively do a delq on buried_buffer_list. */
-
- prev = Qnil;
- for (link = XFRAME (frame)->buried_buffer_list; CONSP (link);
- link = XCDR (link))
- {
- if (EQ (XCAR (link), buf))
- {
- if (NILP (prev))
- XFRAME (frame)->buried_buffer_list = XCDR (link);
- else
- XSETCDR (prev, XCDR (XCDR (prev)));
- break;
- }
- prev = link;
- }
-
/* Now move this buffer to the front of frame_buffer_list also. */
prev = Qnil;
@@ -2096,10 +2066,10 @@ selected window if it is displayed there. */)
XSETCDR (link, Qnil);
Vbuffer_alist = nconc2 (Vbuffer_alist, link);
- XFRAME (selected_frame)->buffer_list
- = Fdelq (buffer, XFRAME (selected_frame)->buffer_list);
- XFRAME (selected_frame)->buried_buffer_list
- = Fcons (buffer, Fdelq (buffer, XFRAME (selected_frame)->buried_buffer_list));
+ /* Removing BUFFER from frame-specific lists
+ has the effect of putting BUFFER at the end
+ of the combined list in each frame. */
+ frames_discard_buffer (buffer);
}
return Qnil;
@@ -2183,8 +2153,10 @@ DEFUN ("set-buffer-multibyte", Fset_buffer_multibyte, Sset_buffer_multibyte,
doc: /* Set the multibyte flag of the current buffer to FLAG.
If FLAG is t, this makes the buffer a multibyte buffer.
If FLAG is nil, this makes the buffer a single-byte buffer.
-The buffer contents remain unchanged as a sequence of bytes
-but the contents viewed as characters do change.
+In these cases, the buffer contents remain unchanged as a sequence of
+bytes but the contents viewed as characters do change.
+If FLAG is `to', this makes the buffer a multibyte buffer by changing
+all eight-bit bytes to eight-bit characters.
If the multibyte flag was really changed, undo information of the
current buffer is cleared. */)
(flag)
@@ -2258,11 +2230,11 @@ current buffer is cleared. */)
p = GAP_END_ADDR;
stop = Z;
}
- if (MULTIBYTE_STR_AS_UNIBYTE_P (p, bytes))
- p += bytes, pos += bytes;
- else
+ if (ASCII_BYTE_P (*p))
+ p++, pos++;
+ else if (CHAR_BYTE8_HEAD_P (*p))
{
- c = STRING_CHAR (p, stop - pos);
+ c = STRING_CHAR_AND_LENGTH (p, stop - pos, bytes);
/* Delete all bytes for this 8-bit character but the
last one, and change the last one to the charcter
code. */
@@ -2277,6 +2249,11 @@ current buffer is cleared. */)
zv -= bytes;
stop = Z;
}
+ else
+ {
+ bytes = BYTES_BY_CHAR_HEAD (*p);
+ p += bytes, pos += bytes;
+ }
}
if (narrowed)
Fnarrow_to_region (make_number (begv), make_number (zv));
@@ -2285,13 +2262,14 @@ current buffer is cleared. */)
{
int pt = PT;
int pos, stop;
- unsigned char *p;
+ unsigned char *p, *pend;
/* Be sure not to have a multibyte sequence striding over the GAP.
- Ex: We change this: "...abc\201 _GAP_ \241def..."
- to: "...abc _GAP_ \201\241def..." */
+ Ex: We change this: "...abc\302 _GAP_ \241def..."
+ to: "...abc _GAP_ \302\241def..." */
- if (GPT_BYTE > 1 && GPT_BYTE < Z_BYTE
+ if (EQ (flag, Qt)
+ && GPT_BYTE > 1 && GPT_BYTE < Z_BYTE
&& ! CHAR_HEAD_P (*(GAP_END_ADDR)))
{
unsigned char *p = GPT_ADDR - 1;
@@ -2310,6 +2288,7 @@ current buffer is cleared. */)
pos = BEG;
stop = GPT;
p = BEG_ADDR;
+ pend = GPT_ADDR;
while (1)
{
int bytes;
@@ -2319,16 +2298,21 @@ current buffer is cleared. */)
if (pos == Z)
break;
p = GAP_END_ADDR;
+ pend = Z_ADDR;
stop = Z;
}
- if (UNIBYTE_STR_AS_MULTIBYTE_P (p, stop - pos, bytes))
+ if (ASCII_BYTE_P (*p))
+ p++, pos++;
+ else if (EQ (flag, Qt) && (bytes = MULTIBYTE_LENGTH (p, pend)) > 0)
p += bytes, pos += bytes;
else
{
unsigned char tmp[MAX_MULTIBYTE_LENGTH];
+ int c;
- bytes = CHAR_STRING (*p, tmp);
+ c = BYTE8_TO_CHAR (*p);
+ bytes = CHAR_STRING (c, tmp);
*p = tmp[0];
TEMP_SET_PT_BOTH (pos + 1, pos + 1);
bytes--;
@@ -2342,6 +2326,7 @@ current buffer is cleared. */)
zv += bytes;
if (pos <= pt)
pt += bytes;
+ pend = Z_ADDR;
stop = Z;
}
}
@@ -2882,7 +2867,7 @@ overlay_touches_p (pos)
int endpos;
XSETMISC (overlay ,tail);
- if (!GC_OVERLAYP (overlay))
+ if (!OVERLAYP (overlay))
abort ();
endpos = OVERLAY_POSITION (OVERLAY_END (overlay));
@@ -2897,7 +2882,7 @@ overlay_touches_p (pos)
int startpos;
XSETMISC (overlay, tail);
- if (!GC_OVERLAYP (overlay))
+ if (!OVERLAYP (overlay))
abort ();
startpos = OVERLAY_POSITION (OVERLAY_START (overlay));
@@ -3968,7 +3953,7 @@ OVERLAY. */)
DEFUN ("overlays-at", Foverlays_at, Soverlays_at, 1, 1, 0,
- doc: /* Return a list of the overlays that contain the character at POS. */)
+ doc: /* Return a list of the overlays that contain position POS. */)
(pos)
Lisp_Object pos;
{
@@ -5037,9 +5022,7 @@ init_buffer_once ()
buffer_local_symbols.text = &buffer_local_symbols.own_text;
BUF_INTERVALS (&buffer_defaults) = 0;
BUF_INTERVALS (&buffer_local_symbols) = 0;
- XSETPVECTYPE (&buffer_defaults, PVEC_BUFFER);
XSETBUFFER (Vbuffer_defaults, &buffer_defaults);
- XSETPVECTYPE (&buffer_local_symbols, PVEC_BUFFER);
XSETBUFFER (Vbuffer_local_symbols, &buffer_local_symbols);
/* Set up the default values of various buffer slots. */
@@ -5278,46 +5261,6 @@ init_buffer ()
free (pwd);
}
-/* Similar to defvar_lisp but define a variable whose value is the Lisp
- Object stored in the current buffer. address is the address of the slot
- in the buffer that is current now. */
-
-/* TYPE is nil for a general Lisp variable.
- An integer specifies a type; then only LIsp values
- with that type code are allowed (except that nil is allowed too).
- LNAME is the LIsp-level variable name.
- VNAME is the name of the buffer slot.
- DOC is a dummy where you write the doc string as a comment. */
-#define DEFVAR_PER_BUFFER(lname, vname, type, doc) \
- defvar_per_buffer (lname, vname, type, 0)
-
-static void
-defvar_per_buffer (namestring, address, type, doc)
- char *namestring;
- Lisp_Object *address;
- Lisp_Object type;
- char *doc;
-{
- Lisp_Object sym, val;
- int offset;
-
- sym = intern (namestring);
- val = allocate_misc ();
- offset = (char *)address - (char *)current_buffer;
-
- XMISCTYPE (val) = Lisp_Misc_Buffer_Objfwd;
- XBUFFER_OBJFWD (val)->offset = offset;
- SET_SYMBOL_VALUE (sym, val);
- PER_BUFFER_SYMBOL (offset) = sym;
- PER_BUFFER_TYPE (offset) = type;
-
- if (PER_BUFFER_IDX (offset) == 0)
- /* Did a DEFVAR_PER_BUFFER without initializing the corresponding
- slot of buffer_local_flags */
- abort ();
-}
-
-
/* initialize the buffer routines */
void
syms_of_buffer ()
@@ -5603,9 +5546,6 @@ its hooks should not expect certain variables such as
Qnil,
doc: /* Pretty name of current buffer's major mode (a string). */);
- DEFVAR_PER_BUFFER ("local-abbrev-table", &current_buffer->abbrev_table, Qnil,
- doc: /* Local (mode-specific) abbrev table of current buffer. */);
-
DEFVAR_PER_BUFFER ("abbrev-mode", &current_buffer->abbrev_mode, Qnil,
doc: /* Non-nil turns on automatic expansion of abbrevs as they are inserted. */);
diff --git a/src/buffer.h b/src/buffer.h
index 3d34e7c321..3935a675c4 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -325,7 +325,6 @@ else
/* Variables used locally in FETCH_MULTIBYTE_CHAR. */
extern unsigned char *_fetch_multibyte_char_p;
-extern int _fetch_multibyte_char_len;
/* Return character code of multi-byte form at position POS. If POS
doesn't point the head of valid multi-byte form, only the byte at
@@ -333,10 +332,18 @@ extern int _fetch_multibyte_char_len;
#define FETCH_MULTIBYTE_CHAR(pos) \
(_fetch_multibyte_char_p = (((pos) >= GPT_BYTE ? GAP_SIZE : 0) \
- + (pos) + BEG_ADDR - BEG_BYTE), \
- _fetch_multibyte_char_len \
- = ((pos) >= GPT_BYTE ? ZV_BYTE : GPT_BYTE) - (pos), \
- STRING_CHAR (_fetch_multibyte_char_p, _fetch_multibyte_char_len))
+ + (pos) + BEG_ADDR - BEG_BYTE), \
+ STRING_CHAR (_fetch_multibyte_char_p, 0))
+
+/* Return character at position POS. If the current buffer is unibyte
+ and the character is not ASCII, make the returning character
+ multibyte. */
+
+#define FETCH_CHAR_AS_MULTIBYTE(pos) \
+ (!NILP (current_buffer->enable_multibyte_characters) \
+ ? FETCH_MULTIBYTE_CHAR ((pos)) \
+ : unibyte_char_to_multibyte (FETCH_BYTE ((pos))))
+
/* Macros for accessing a character or byte,
or converting between byte positions and addresses,
@@ -385,10 +392,7 @@ extern int _fetch_multibyte_char_len;
(_fetch_multibyte_char_p \
= (((pos) >= BUF_GPT_BYTE (buf) ? BUF_GAP_SIZE (buf) : 0) \
+ (pos) + BUF_BEG_ADDR (buf) - BEG_BYTE), \
- _fetch_multibyte_char_len \
- = (((pos) >= BUF_GPT_BYTE (buf) ? BUF_ZV_BYTE (buf) : BUF_GPT_BYTE (buf)) \
- - (pos)), \
- STRING_CHAR (_fetch_multibyte_char_p, _fetch_multibyte_char_len))
+ STRING_CHAR (_fetch_multibyte_char_p, 0))
/* Define the actual buffer data structures. */
@@ -444,6 +448,11 @@ struct buffer_text
successive elements in its marker `chain'
are the other markers referring to this buffer. */
struct Lisp_Marker *markers;
+
+ /* Usually 0. Temporarily set to 1 in decode_coding_gap to
+ prevent Fgarbage_collect from shrinking the gap and loosing
+ not-yet-decoded bytes. */
+ int inhibit_shrinking;
};
/* This is the structure that the buffer Lisp object points to. */
@@ -455,7 +464,7 @@ struct buffer
Check out mark_buffer (alloc.c) to see why. */
- EMACS_UINT size;
+ EMACS_INT size;
/* Next buffer, in chain of all buffers including killed buffers.
This chain is used only for garbage collection, in order to
@@ -866,6 +875,7 @@ extern void mmap_set_vars P_ ((int));
} \
} while (0)
+EXFUN (Fbuffer_live_p, 1);
EXFUN (Fbuffer_name, 1);
EXFUN (Fget_file_buffer, 1);
EXFUN (Fnext_overlay_change, 1);
@@ -909,7 +919,7 @@ extern Lisp_Object Vtransient_mark_mode;
We assume you know which buffer it's pointing into. */
#define OVERLAY_POSITION(P) \
- (GC_MARKERP (P) ? marker_position (P) : (abort (), 0))
+ (MARKERP (P) ? marker_position (P) : (abort (), 0))
/***********************************************************************
diff --git a/src/bytecode.c b/src/bytecode.c
index 3582e69dfb..1dd1f3671e 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -37,7 +37,7 @@ by Hallvard:
#include <config.h>
#include "lisp.h"
#include "buffer.h"
-#include "charset.h"
+#include "character.h"
#include "syntax.h"
#include "window.h"
@@ -1394,10 +1394,17 @@ If the third argument is incorrect, Emacs may crash. */)
break;
case Bchar_syntax:
- BEFORE_POTENTIAL_GC ();
- CHECK_NUMBER (TOP);
- AFTER_POTENTIAL_GC ();
- XSETFASTINT (TOP, syntax_code_spec[(int) SYNTAX (XINT (TOP))]);
+ {
+ int c;
+
+ BEFORE_POTENTIAL_GC ();
+ CHECK_CHARACTER (TOP);
+ AFTER_POTENTIAL_GC ();
+ c = XFASTINT (TOP);
+ if (NILP (current_buffer->enable_multibyte_characters))
+ MAKE_CHAR_MULTIBYTE (c);
+ XSETFASTINT (TOP, syntax_code_spec[(int) SYNTAX (c)]);
+ }
break;
case Bbuffer_substring:
diff --git a/src/callint.c b/src/callint.c
index a19c424c89..9b3535474c 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -263,6 +263,7 @@ invoke it. If KEYS is omitted or nil, the return value of
Lisp_Object function, record_flag, keys;
{
Lisp_Object *args, *visargs;
+ Lisp_Object fun;
Lisp_Object specs;
Lisp_Object filter_specs;
Lisp_Object teml;
@@ -316,6 +317,8 @@ invoke it. If KEYS is omitted or nil, the return value of
else
enable = Qnil;
+ fun = indirect_function (function);
+
specs = Qnil;
string = 0;
/* The idea of FILTER_SPECS is to provide away to
@@ -326,19 +329,37 @@ invoke it. If KEYS is omitted or nil, the return value of
/* If k or K discard an up-event, save it here so it can be retrieved with U */
up_event = Qnil;
- /* Set SPECS to the interactive form, or barf if not interactive. */
- {
- Lisp_Object form;
- GCPRO2 (function, prefix_arg);
- form = Finteractive_form (function);
- UNGCPRO;
- if (CONSP (form))
- specs = filter_specs = Fcar (XCDR (form));
- else
- wrong_type_argument (Qcommandp, function);
- }
+ /* Decode the kind of function. Either handle it and return,
+ or go to `lose' if not interactive, or set either STRING or SPECS. */
+
+ if (SUBRP (fun))
+ {
+ string = (unsigned char *) XSUBR (fun)->prompt;
+ if (!string)
+ {
+ lose:
+ wrong_type_argument (Qcommandp, function);
+ }
+ }
+ else if (COMPILEDP (fun))
+ {
+ if ((XVECTOR (fun)->size & PSEUDOVECTOR_SIZE_MASK) <= COMPILED_INTERACTIVE)
+ goto lose;
+ specs = XVECTOR (fun)->contents[COMPILED_INTERACTIVE];
+ }
+ else
+ {
+ Lisp_Object form;
+ GCPRO2 (function, prefix_arg);
+ form = Finteractive_form (function);
+ UNGCPRO;
+ if (CONSP (form))
+ specs = filter_specs = Fcar (XCDR (form));
+ else
+ goto lose;
+ }
- /* If SPECS is set to a string, use it as an interactive prompt. */
+ /* If either SPECS or STRING is set to a string, use it. */
if (STRINGP (specs))
{
/* Make a copy of string so that if a GC relocates specs,
@@ -347,7 +368,7 @@ invoke it. If KEYS is omitted or nil, the return value of
bcopy (SDATA (specs), string,
SBYTES (specs) + 1);
}
- else
+ else if (string == 0)
{
Lisp_Object input;
i = num_input_events;
@@ -381,8 +402,8 @@ invoke it. If KEYS is omitted or nil, the return value of
real_this_command= save_real_this_command;
current_kboard->Vlast_command = save_last_command;
- temporarily_switch_to_single_kboard (NULL);
- return unbind_to (speccount, apply1 (function, specs));
+ single_kboard_state ();
+ return apply1 (function, specs);
}
/* Here if function specifies a string to control parsing the defaults */
@@ -833,11 +854,12 @@ invoke it. If KEYS is omitted or nil, the return value of
real_this_command= save_real_this_command;
current_kboard->Vlast_command = save_last_command;
+ single_kboard_state ();
+
{
Lisp_Object val;
specbind (Qcommand_debug_status, Qnil);
- temporarily_switch_to_single_kboard (NULL);
val = Ffuncall (count + 1, args);
UNGCPRO;
return unbind_to (speccount, val);
diff --git a/src/callproc.c b/src/callproc.c
index 0fa0c3a866..d86113cfdb 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -75,7 +75,7 @@ extern int errno;
#include "lisp.h"
#include "commands.h"
#include "buffer.h"
-#include "charset.h"
+#include "character.h"
#include "ccl.h"
#include "coding.h"
#include "composite.h"
@@ -84,8 +84,6 @@ extern int errno;
#include "syssignal.h"
#include "systty.h"
#include "blockinput.h"
-#include "frame.h"
-#include "termhooks.h"
#ifdef MSDOS
#include "msdos.h"
@@ -113,7 +111,7 @@ Lisp_Object Vtemp_file_name_pattern;
Lisp_Object Vshell_file_name;
-Lisp_Object Vprocess_environment, Vinitial_environment;
+Lisp_Object Vprocess_environment;
#ifdef DOS_NT
Lisp_Object Qbuffer_file_type;
@@ -132,7 +130,6 @@ int synch_process_termsig;
/* If synch_process_death is zero,
this is exit code of synchronous subprocess. */
int synch_process_retcode;
-
/* Clean up when exiting Fcall_process.
On MSDOS, delete the temporary file on any kind of termination.
@@ -141,8 +138,6 @@ int synch_process_retcode;
/* Nonzero if this is termination due to exit. */
static int call_process_exited;
-EXFUN (Fgetenv_internal, 2);
-
#ifndef VMS /* VMS version is in vmsproc.c. */
static Lisp_Object
@@ -278,6 +273,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
if (nargs >= 5)
{
int must_encode = 0;
+ Lisp_Object coding_attrs;
for (i = 4; i < nargs; i++)
CHECK_STRING (args[i]);
@@ -303,11 +299,15 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
else
val = Qnil;
}
+ val = coding_inherit_eol_type (val, Qnil);
setup_coding_system (Fcheck_coding_system (val), &argument_coding);
- if (argument_coding.common_flags & CODING_ASCII_INCOMPATIBLE_MASK)
- setup_coding_system (Qraw_text, &argument_coding);
- if (argument_coding.eol_type == CODING_EOL_UNDECIDED)
- argument_coding.eol_type = system_eol_type;
+ coding_attrs = CODING_ID_ATTRS (argument_coding.id);
+ if (NILP (CODING_ATTR_ASCII_COMPAT (coding_attrs)))
+ {
+ /* We should not use an ASCII incompatible coding system. */
+ val = raw_text_coding_system (val);
+ setup_coding_system (val, &argument_coding);
+ }
}
}
@@ -430,12 +430,8 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
{
argument_coding.src_multibyte = STRING_MULTIBYTE (args[i]);
if (CODING_REQUIRE_ENCODING (&argument_coding))
- {
- /* We must encode this argument. */
- args[i] = encode_coding_string (args[i], &argument_coding, 1);
- if (argument_coding.type == coding_type_ccl)
- setup_ccl_program (&(argument_coding.spec.ccl.encoder), Qnil);
- }
+ /* We must encode this argument. */
+ args[i] = encode_coding_string (&argument_coding, args[i], 1);
new_argv[i - 3] = SDATA (args[i]);
}
UNGCPRO;
@@ -747,19 +743,15 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
else
val = Qnil;
}
- setup_coding_system (Fcheck_coding_system (val), &process_coding);
+ Fcheck_coding_system (val);
/* In unibyte mode, character code conversion should not take
place but EOL conversion should. So, setup raw-text or one
of the subsidiary according to the information just setup. */
if (NILP (current_buffer->enable_multibyte_characters)
&& !NILP (val))
- setup_raw_text_coding_system (&process_coding);
+ val = raw_text_coding_system (val);
+ setup_coding_system (val, &process_coding);
}
- process_coding.src_multibyte = 0;
- process_coding.dst_multibyte
- = (BUFFERP (buffer)
- ? ! NILP (XBUFFER (buffer)->enable_multibyte_characters)
- : ! NILP (current_buffer->enable_multibyte_characters));
immediate_quit = 1;
QUIT;
@@ -771,12 +763,8 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
int carryover = 0;
int display_on_the_fly = display_p;
struct coding_system saved_coding;
- int pt_orig = PT, pt_byte_orig = PT_BYTE;
- int inserted;
saved_coding = process_coding;
- if (process_coding.composing != COMPOSITION_DISABLED)
- coding_allocate_composition_data (&process_coding, PT);
while (1)
{
/* Repeatedly read until we've filled as much as possible
@@ -809,133 +797,49 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
if (!NILP (buffer))
{
- if (! CODING_MAY_REQUIRE_DECODING (&process_coding))
+ if (NILP (current_buffer->enable_multibyte_characters)
+ && ! CODING_MAY_REQUIRE_DECODING (&process_coding))
insert_1_both (buf, nread, nread, 0, 1, 0);
else
{ /* We have to decode the input. */
- int size;
- char *decoding_buf;
-
- repeat_decoding:
- size = decoding_buffer_size (&process_coding, nread);
- decoding_buf = (char *) xmalloc (size);
-
- /* We can't use the macro CODING_REQUIRE_DETECTION
- because it always returns nonzero if the coding
- system requires EOL detection. Here, we have to
- check only whether or not the coding system
- requires text-encoding detection. */
- if (process_coding.type == coding_type_undecided)
- {
- detect_coding (&process_coding, buf, nread);
- if (process_coding.composing != COMPOSITION_DISABLED)
- /* We have not yet allocated the composition
- data because the coding type was undecided. */
- coding_allocate_composition_data (&process_coding, PT);
- }
- if (process_coding.cmp_data)
- process_coding.cmp_data->char_offset = PT;
-
- decode_coding (&process_coding, buf, decoding_buf,
- nread, size);
+ Lisp_Object curbuf;
+ XSETBUFFER (curbuf, current_buffer);
+ decode_coding_c_string (&process_coding, buf, nread,
+ curbuf);
if (display_on_the_fly
- && saved_coding.type == coding_type_undecided
- && process_coding.type != coding_type_undecided)
+ && CODING_REQUIRE_DETECTION (&saved_coding)
+ && ! CODING_REQUIRE_DETECTION (&process_coding))
{
/* We have detected some coding system. But,
there's a possibility that the detection was
- done by insufficient data. So, we try the code
- detection again with more data. */
- xfree (decoding_buf);
+ done by insufficient data. So, we give up
+ displaying on the fly. */
+ if (process_coding.produced > 0)
+ del_range_2 (process_coding.dst_pos,
+ process_coding.dst_pos_byte,
+ process_coding.dst_pos
+ + process_coding.produced_char,
+ process_coding.dst_pos_byte
+ + process_coding.produced, 0);
display_on_the_fly = 0;
process_coding = saved_coding;
carryover = nread;
/* This is to make the above condition always
fails in the future. */
- saved_coding.type = coding_type_no_conversion;
+ saved_coding.common_flags
+ &= ~CODING_REQUIRE_DETECTION_MASK;
continue;
}
- if (process_coding.produced > 0)
- insert_1_both (decoding_buf, process_coding.produced_char,
- process_coding.produced, 0, 1, 0);
- xfree (decoding_buf);
-
- if (process_coding.result == CODING_FINISH_INCONSISTENT_EOL)
- {
- Lisp_Object eol_type, coding;
-
- if (process_coding.eol_type == CODING_EOL_CR)
- {
- /* CRs have been replaced with LFs. Undo
- that in the text inserted above. */
- unsigned char *p;
-
- move_gap_both (PT, PT_BYTE);
-
- p = BYTE_POS_ADDR (pt_byte_orig);
- for (; p < GPT_ADDR; ++p)
- if (*p == '\n')
- *p = '\r';
- }
- else if (process_coding.eol_type == CODING_EOL_CRLF)
- {
- /* CR LFs have been replaced with LFs. Undo
- that by inserting CRs in front of LFs in
- the text inserted above. */
- EMACS_INT bytepos, old_pt, old_pt_byte, nCR;
-
- old_pt = PT;
- old_pt_byte = PT_BYTE;
- nCR = 0;
-
- for (bytepos = PT_BYTE - 1;
- bytepos >= pt_byte_orig;
- --bytepos)
- if (FETCH_BYTE (bytepos) == '\n')
- {
- EMACS_INT charpos = BYTE_TO_CHAR (bytepos);
- TEMP_SET_PT_BOTH (charpos, bytepos);
- insert_1_both ("\r", 1, 1, 0, 1, 0);
- ++nCR;
- }
-
- TEMP_SET_PT_BOTH (old_pt + nCR, old_pt_byte + nCR);
- }
-
- /* Set the coding system symbol to that for
- Unix-like EOL. */
- eol_type = Fget (saved_coding.symbol, Qeol_type);
- if (VECTORP (eol_type)
- && ASIZE (eol_type) == 3
- && SYMBOLP (AREF (eol_type, CODING_EOL_LF)))
- coding = AREF (eol_type, CODING_EOL_LF);
- else
- coding = saved_coding.symbol;
-
- process_coding.symbol = coding;
- process_coding.eol_type = CODING_EOL_LF;
- process_coding.mode
- &= ~CODING_MODE_INHIBIT_INCONSISTENT_EOL;
- }
-
- nread -= process_coding.consumed;
- carryover = nread;
+ TEMP_SET_PT_BOTH (PT + process_coding.produced_char,
+ PT_BYTE + process_coding.produced);
+ carryover = process_coding.carryover_bytes;
if (carryover > 0)
/* As CARRYOVER should not be that large, we had
better avoid overhead of bcopy. */
- BCOPY_SHORT (buf + process_coding.consumed, buf,
- carryover);
- if (process_coding.result == CODING_FINISH_INSUFFICIENT_CMP)
- {
- /* The decoding ended because of insufficient data
- area to record information about composition.
- We must try decoding with additional data area
- before reading more output for the process. */
- coding_allocate_composition_data (&process_coding, PT);
- goto repeat_decoding;
- }
+ BCOPY_SHORT (process_coding.carryover, buf,
+ process_coding.carryover_bytes);
}
}
@@ -966,33 +870,12 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
}
give_up: ;
- if (!NILP (buffer)
- && process_coding.cmp_data)
- {
- coding_restore_composition (&process_coding, Fcurrent_buffer ());
- coding_free_composition_data (&process_coding);
- }
-
- {
- int post_read_count = SPECPDL_INDEX ();
-
- record_unwind_protect (save_excursion_restore, save_excursion_save ());
- inserted = PT - pt_orig;
- TEMP_SET_PT_BOTH (pt_orig, pt_byte_orig);
- if (SYMBOLP (process_coding.post_read_conversion)
- && !NILP (Ffboundp (process_coding.post_read_conversion)))
- call1 (process_coding.post_read_conversion, make_number (inserted));
-
- Vlast_coding_system_used = process_coding.symbol;
-
- /* If the caller required, let the buffer inherit the
- coding-system used to decode the process output. */
- if (inherit_process_coding_system)
- call1 (intern ("after-insert-file-set-buffer-file-coding-system"),
- make_number (total_read));
-
- unbind_to (post_read_count, Qnil);
- }
+ Vlast_coding_system_used = CODING_ID_NAME (process_coding.id);
+ /* If the caller required, let the buffer inherit the
+ coding-system used to decode the process output. */
+ if (inherit_process_coding_system)
+ call1 (intern ("after-insert-file-set-buffer-file-coding-system"),
+ make_number (total_read));
}
/* Wait for it to terminate, unless it already has. */
@@ -1186,40 +1069,6 @@ usage: (call-process-region START END PROGRAM &optional DELETE BUFFER DISPLAY &r
static int relocate_fd ();
-static char **
-add_env (char **env, char **new_env, char *string)
-{
- char **ep;
- int ok = 1;
- if (string == NULL)
- return new_env;
-
- /* See if this string duplicates any string already in the env.
- If so, don't put it in.
- When an env var has multiple definitions,
- we keep the definition that comes first in process-environment. */
- for (ep = env; ok && ep != new_env; ep++)
- {
- char *p = *ep, *q = string;
- while (ok)
- {
- if (*q != *p)
- break;
- if (*q == 0)
- /* The string is a lone variable name; keep it for now, we
- will remove it later. It is a placeholder for a
- variable that is not to be included in the environment. */
- break;
- if (*q == '=')
- ok = 0;
- p++, q++;
- }
- }
- if (ok)
- *new_env++ = string;
- return new_env;
-}
-
/* This is the last thing run in a newly forked inferior
either synchronous or asynchronous.
Copy descriptors IN, OUT and ERR as descriptors 0, 1 and 2.
@@ -1275,10 +1124,9 @@ child_setup (in, out, err, new_argv, set_pgrp, current_dir)
/* Note that use of alloca is always safe here. It's obvious for systems
that do not have true vfork or that have true (stack) alloca.
- If using vfork and C_ALLOCA (when Emacs used to include
- src/alloca.c) it is safe because that changes the superior's
- static variables as if the superior had done alloca and will be
- cleaned up in the usual way. */
+ If using vfork and C_ALLOCA it is safe because that changes
+ the superior's static variables as if the superior had done alloca
+ and will be cleaned up in the usual way. */
{
register char *temp;
register int i;
@@ -1322,80 +1170,57 @@ child_setup (in, out, err, new_argv, set_pgrp, current_dir)
temp[--i] = 0;
}
- /* Set `env' to a vector of the strings in the environment. */
+ /* Set `env' to a vector of the strings in Vprocess_environment. */
{
register Lisp_Object tem;
register char **new_env;
- char **p, **q;
register int new_length;
- Lisp_Object display = Qnil;
-
- new_length = 0;
+ new_length = 0;
for (tem = Vprocess_environment;
- CONSP (tem) && STRINGP (XCAR (tem));
- tem = XCDR (tem))
- {
- if (strncmp (SDATA (XCAR (tem)), "DISPLAY", 7) == 0
- && (SDATA (XCAR (tem)) [7] == '\0'
- || SDATA (XCAR (tem)) [7] == '='))
- /* DISPLAY is specified in process-environment. */
- display = Qt;
- new_length++;
- }
-
- /* If not provided yet, use the frame's DISPLAY. */
- if (NILP (display))
- {
- Lisp_Object tmp = Fframe_parameter (selected_frame, Qdisplay);
- if (!STRINGP (tmp) && CONSP (Vinitial_environment))
- /* If still not found, Look for DISPLAY in Vinitial_environment. */
- tmp = Fgetenv_internal (build_string ("DISPLAY"),
- Vinitial_environment);
- if (STRINGP (tmp))
- {
- display = tmp;
- new_length++;
- }
- }
+ CONSP (tem) && STRINGP (XCAR (tem));
+ tem = XCDR (tem))
+ new_length++;
/* new_length + 2 to include PWD and terminating 0. */
env = new_env = (char **) alloca ((new_length + 2) * sizeof (char *));
+
/* If we have a PWD envvar, pass one down,
but with corrected value. */
- if (egetenv ("PWD"))
+ if (getenv ("PWD"))
*new_env++ = pwd_var;
-
- if (STRINGP (display))
- {
- int vlen = strlen ("DISPLAY=") + strlen (SDATA (display)) + 1;
- char *vdata = (char *) alloca (vlen);
- strcpy (vdata, "DISPLAY=");
- strcat (vdata, SDATA (display));
- new_env = add_env (env, new_env, vdata);
- }
- /* Overrides. */
+ /* Copy the Vprocess_environment strings into new_env. */
for (tem = Vprocess_environment;
CONSP (tem) && STRINGP (XCAR (tem));
tem = XCDR (tem))
- new_env = add_env (env, new_env, SDATA (XCAR (tem)));
-
- *new_env = 0;
-
- /* Remove variable names without values. */
- p = q = env;
- while (*p != 0)
{
- while (*q != 0 && strchr (*q, '=') == NULL)
- *q++;
- *p = *q++;
- if (*p != 0)
- p++;
+ char **ep = env;
+ char *string = (char *) SDATA (XCAR (tem));
+ /* See if this string duplicates any string already in the env.
+ If so, don't put it in.
+ When an env var has multiple definitions,
+ we keep the definition that comes first in process-environment. */
+ for (; ep != new_env; ep++)
+ {
+ char *p = *ep, *q = string;
+ while (1)
+ {
+ if (*q == 0)
+ /* The string is malformed; might as well drop it. */
+ goto duplicate;
+ if (*q != *p)
+ break;
+ if (*q == '=')
+ goto duplicate;
+ p++, q++;
+ }
+ }
+ *new_env++ = string;
+ duplicate: ;
}
+ *new_env = 0;
}
-
-
#ifdef WINDOWSNT
prepare_standard_handles (in, out, err, handles);
set_process_dir (SDATA (current_dir));
@@ -1509,18 +1334,22 @@ relocate_fd (fd, minfd)
}
static int
-getenv_internal_1 (var, varlen, value, valuelen, env)
+getenv_internal (var, varlen, value, valuelen)
char *var;
int varlen;
char **value;
int *valuelen;
- Lisp_Object env;
{
- for (; CONSP (env); env = XCDR (env))
+ Lisp_Object scan;
+
+ for (scan = Vprocess_environment; CONSP (scan); scan = XCDR (scan))
{
- Lisp_Object entry = XCAR (env);
+ Lisp_Object entry;
+
+ entry = XCAR (scan);
if (STRINGP (entry)
- && SBYTES (entry) >= varlen
+ && SBYTES (entry) > varlen
+ && SREF (entry, varlen) == '='
#ifdef WINDOWSNT
/* NT environment variables are case insensitive. */
&& ! strnicmp (SDATA (entry), var, varlen)
@@ -1529,95 +1358,35 @@ getenv_internal_1 (var, varlen, value, valuelen, env)
#endif /* not WINDOWSNT */
)
{
- if (SBYTES (entry) > varlen && SREF (entry, varlen) == '=')
- {
- *value = (char *) SDATA (entry) + (varlen + 1);
- *valuelen = SBYTES (entry) - (varlen + 1);
- return 1;
- }
- else if (SBYTES (entry) == varlen)
- {
- /* Lone variable names in Vprocess_environment mean that
- variable should be removed from the environment. */
- *value = NULL;
- return 1;
- }
- }
- }
- return 0;
-}
-
-static int
-getenv_internal (var, varlen, value, valuelen, frame)
- char *var;
- int varlen;
- char **value;
- int *valuelen;
- Lisp_Object frame;
-{
- /* Try to find VAR in Vprocess_environment first. */
- if (getenv_internal_1 (var, varlen, value, valuelen,
- Vprocess_environment))
- return *value ? 1 : 0;
-
- /* For DISPLAY try to get the values from the frame or the initial env. */
- if (strcmp (var, "DISPLAY") == 0)
- {
- Lisp_Object display
- = Fframe_parameter (NILP (frame) ? selected_frame : frame, Qdisplay);
- if (STRINGP (display))
- {
- *value = (char *) SDATA (display);
- *valuelen = SBYTES (display);
+ *value = (char *) SDATA (entry) + (varlen + 1);
+ *valuelen = SBYTES (entry) - (varlen + 1);
return 1;
}
- /* If still not found, Look for DISPLAY in Vinitial_environment. */
- if (getenv_internal_1 (var, varlen, value, valuelen,
- Vinitial_environment))
- return *value ? 1 : 0;
}
return 0;
}
-DEFUN ("getenv-internal", Fgetenv_internal, Sgetenv_internal, 1, 2, 0,
- doc: /* Get the value of environment variable VARIABLE.
-VARIABLE should be a string. Value is nil if VARIABLE is undefined in
-the environment. Otherwise, value is a string.
-
-This function searches `process-environment' for VARIABLE. If it is
-not found there, then it continues the search in the environment list
-of the selected frame.
-
-If optional parameter ENV is a list, then search this list instead of
-`process-environment', and return t when encountering a negative entry.
-
-If it is a frame, then this function will ignore `process-environment' and
-will simply look up the variable in that frame's environment. */)
- (variable, env)
- Lisp_Object variable, env;
+DEFUN ("getenv-internal", Fgetenv_internal, Sgetenv_internal, 1, 1, 0,
+ doc: /* Return the value of environment variable VAR, as a string.
+VAR should be a string. Value is nil if VAR is undefined in the environment.
+This function consults the variable `process-environment' for its value. */)
+ (var)
+ Lisp_Object var;
{
char *value;
int valuelen;
- CHECK_STRING (variable);
- if (CONSP (env))
- {
- if (getenv_internal_1 (SDATA (variable), SBYTES (variable),
- &value, &valuelen, env))
- return value ? make_string (value, valuelen) : Qt;
- else
- return Qnil;
- }
- else if (getenv_internal (SDATA (variable), SBYTES (variable),
- &value, &valuelen, env))
+ CHECK_STRING (var);
+ if (getenv_internal (SDATA (var), SBYTES (var),
+ &value, &valuelen))
return make_string (value, valuelen);
else
return Qnil;
}
-/* A version of getenv that consults the Lisp environment lists,
- easily callable from C. */
+/* A version of getenv that consults process_environment, easily
+ callable from C. */
char *
egetenv (var)
char *var;
@@ -1625,7 +1394,7 @@ egetenv (var)
char *value;
int valuelen;
- if (getenv_internal (var, strlen (var), &value, &valuelen, Qnil))
+ if (getenv_internal (var, strlen (var), &value, &valuelen))
return value;
else
return 0;
@@ -1748,8 +1517,8 @@ init_callproc ()
{
char *dir = getenv ("TMPDIR");
Vtemp_file_name_pattern
- = Fexpand_file_name (build_string ("emacsXXXXXX"),
- build_string (dir));
+ = Fexpand_file_name (build_string ("emacsXXXXXX"),
+ build_string (dir));
}
else
Vtemp_file_name_pattern = build_string ("/tmp/emacsXXXXXX");
@@ -1765,21 +1534,17 @@ init_callproc ()
}
void
-set_initial_environment ()
+set_process_environment ()
{
register char **envp;
+
+ Vprocess_environment = Qnil;
#ifndef CANNOT_DUMP
if (initialized)
#endif
- {
- for (envp = environ; *envp; envp++)
- Vprocess_environment = Fcons (build_string (*envp),
- Vprocess_environment);
- store_frame_param (SELECTED_FRAME(), Qenvironment, Vprocess_environment);
- /* Ideally, the `copy' shouldn't be necessary, but it seems it's frequent
- to use `delete' and friends on process-environment. */
- Vinitial_environment = Fcopy_sequence (Vprocess_environment);
- }
+ for (envp = environ; *envp; envp++)
+ Vprocess_environment = Fcons (build_string (*envp),
+ Vprocess_environment);
}
void
@@ -1838,34 +1603,16 @@ If this variable is nil, then Emacs is unable to use a shared directory. */);
This is used by `call-process-region'. */);
/* This variable is initialized in init_callproc. */
- DEFVAR_LISP ("initial-environment", &Vinitial_environment,
- doc: /* List of environment variables inherited from the parent process.
-Each element should be a string of the form ENVVARNAME=VALUE.
-The elements must normally be decoded (using `locale-coding-system') for use. */);
- Vinitial_environment = Qnil;
-
DEFVAR_LISP ("process-environment", &Vprocess_environment,
- doc: /* List of overridden environment variables for subprocesses to inherit.
+ doc: /* List of environment variables for subprocesses to inherit.
Each element should be a string of the form ENVVARNAME=VALUE.
-
-Entries in this list take precedence to those in the frame-local
-environments. Therefore, let-binding `process-environment' is an easy
-way to temporarily change the value of an environment variable,
-irrespective of where it comes from. To use `process-environment' to
-remove an environment variable, include only its name in the list,
-without "=VALUE".
-
-This variable is set to nil when Emacs starts.
-
If multiple entries define the same variable, the first one always
takes precedence.
-
+The environment which Emacs inherits is placed in this variable
+when Emacs starts.
Non-ASCII characters are encoded according to the initial value of
-`locale-coding-system', i.e. the elements must normally be decoded for
-use.
-
+`locale-coding-system', i.e. the elements must normally be decoded for use.
See `setenv' and `getenv'. */);
- Vprocess_environment = Qnil;
#ifndef VMS
defsubr (&Scall_process);
diff --git a/src/casefiddle.c b/src/casefiddle.c
index 0e9e1ba2c3..2984201a03 100644
--- a/src/casefiddle.c
+++ b/src/casefiddle.c
@@ -23,7 +23,7 @@ Boston, MA 02110-1301, USA. */
#include <config.h>
#include "lisp.h"
#include "buffer.h"
-#include "charset.h"
+#include "character.h"
#include "commands.h"
#include "syntax.h"
#include "composite.h"
@@ -38,7 +38,7 @@ casify_object (flag, obj)
enum case_action flag;
Lisp_Object obj;
{
- register int i, c, len;
+ register int c, c1;
register int inword = flag == CASE_DOWN;
/* If the case table is flagged as modified, rescan it. */
@@ -50,6 +50,7 @@ casify_object (flag, obj)
int flagbits = (CHAR_ALT | CHAR_SUPER | CHAR_HYPER
| CHAR_SHIFT | CHAR_CTL | CHAR_META);
int flags = XINT (obj) & flagbits;
+ int multibyte = ! NILP (current_buffer->enable_multibyte_characters);
/* If the character has higher bits set
above the flags, return it unchanged.
@@ -57,12 +58,18 @@ casify_object (flag, obj)
if ((unsigned) XFASTINT (obj) > (unsigned) flagbits)
return obj;
- c = DOWNCASE (XFASTINT (obj) & ~flagbits);
+ c1 = XFASTINT (obj) & ~flagbits;
+ if (! multibyte)
+ MAKE_CHAR_MULTIBYTE (c1);
+ c = DOWNCASE (c1);
if (inword)
XSETFASTINT (obj, c | flags);
else if (c == (XFASTINT (obj) & ~flagbits))
{
- c = UPCASE1 ((XFASTINT (obj) & ~flagbits));
+ if (! inword)
+ c = UPCASE1 (c1);
+ if (! multibyte)
+ MAKE_CHAR_UNIBYTE (c);
XSETFASTINT (obj, c | flags);
}
return obj;
@@ -71,42 +78,43 @@ casify_object (flag, obj)
if (STRINGP (obj))
{
int multibyte = STRING_MULTIBYTE (obj);
- int n;
+ int i, i_byte, len;
+ int size = SCHARS (obj);
obj = Fcopy_sequence (obj);
- len = SBYTES (obj);
-
- /* I counts bytes, and N counts chars. */
- for (i = n = 0; i < len; n++)
+ for (i = i_byte = 0; i < size; i++, i_byte += len)
{
- int from_len = 1, to_len = 1;
-
- c = SREF (obj, i);
-
- if (multibyte && c >= 0x80)
- c = STRING_CHAR_AND_LENGTH (SDATA (obj) + i, len -i, from_len);
+ if (multibyte)
+ c = STRING_CHAR_AND_LENGTH (SDATA (obj) + i_byte, 0, len);
+ else
+ {
+ c = SREF (obj, i_byte);
+ len = 1;
+ MAKE_CHAR_MULTIBYTE (c);
+ }
+ c1 = c;
if (inword && flag != CASE_CAPITALIZE_UP)
c = DOWNCASE (c);
else if (!UPPERCASEP (c)
&& (!inword || flag != CASE_CAPITALIZE_UP))
- c = UPCASE1 (c);
- if ((ASCII_BYTE_P (c) && from_len == 1)
- || (! multibyte && SINGLE_BYTE_CHAR_P (c)))
- SSET (obj, i, c);
- else
+ c = UPCASE1 (c1);
+ if ((int) flag >= (int) CASE_CAPITALIZE)
+ inword = (SYNTAX (c) == Sword);
+ if (c != c1)
{
- to_len = CHAR_BYTES (c);
- if (from_len == to_len)
- CHAR_STRING (c, SDATA (obj) + i);
+ if (! multibyte)
+ {
+ MAKE_CHAR_UNIBYTE (c);
+ SSET (obj, i_byte, c);
+ }
+ else if (ASCII_CHAR_P (c1) && ASCII_CHAR_P (c))
+ SSET (obj, i_byte, c);
else
{
- Faset (obj, make_number (n), make_number (c));
- len += to_len - from_len;
+ Faset (obj, make_number (i), make_number (c));
+ i_byte += CHAR_BYTES (c) - len;
}
}
- if ((int) flag >= (int) CASE_CAPITALIZE)
- inword = SYNTAX (c) == Sword;
- i += to_len;
}
return obj;
}
@@ -168,13 +176,14 @@ casify_region (flag, b, e)
enum case_action flag;
Lisp_Object b, e;
{
- register int i;
register int c;
register int inword = flag == CASE_DOWN;
register int multibyte = !NILP (current_buffer->enable_multibyte_characters);
int start, end;
int start_byte, end_byte;
int changed = 0;
+ int opoint = PT;
+ int opoint_byte = PT_BYTE;
if (EQ (b, e))
/* Not modifying because nothing marked */
@@ -192,85 +201,74 @@ casify_region (flag, b, e)
start_byte = CHAR_TO_BYTE (start);
end_byte = CHAR_TO_BYTE (end);
- for (i = start_byte; i < end_byte; i++, start++)
+ while (start < end)
{
- int c2;
- c = c2 = FETCH_BYTE (i);
- if (multibyte && c >= 0x80)
- /* A multibyte character can't be handled in this simple loop. */
- break;
+ int c2, len;
+
+ if (multibyte)
+ {
+ c = FETCH_MULTIBYTE_CHAR (start_byte);
+ len = CHAR_BYTES (c);
+ }
+ else
+ {
+ c = FETCH_BYTE (start_byte);
+ MAKE_CHAR_MULTIBYTE (c);
+ len = 1;
+ }
+ c2 = c;
if (inword && flag != CASE_CAPITALIZE_UP)
c = DOWNCASE (c);
else if (!UPPERCASEP (c)
&& (!inword || flag != CASE_CAPITALIZE_UP))
c = UPCASE1 (c);
- if (multibyte && c >= 0x80)
- /* A multibyte result character can't be handled in this
- simple loop. */
- break;
- FETCH_BYTE (i) = c;
- if (c != c2)
- changed = 1;
if ((int) flag >= (int) CASE_CAPITALIZE)
- inword = SYNTAX (c) == Sword && (inword || !SYNTAX_PREFIX (c));
- }
- if (i < end_byte)
- {
- /* The work is not yet finished because of a multibyte character
- just encountered. */
- int opoint = PT;
- int opoint_byte = PT_BYTE;
- int c2;
-
- while (start < end)
+ inword = ((SYNTAX (c) == Sword) && (inword || !SYNTAX_PREFIX (c)));
+ if (c != c2)
{
- if ((c = FETCH_BYTE (i)) >= 0x80)
- c = FETCH_MULTIBYTE_CHAR (i);
- c2 = c;
- if (inword && flag != CASE_CAPITALIZE_UP)
- c2 = DOWNCASE (c);
- else if (!UPPERCASEP (c)
- && (!inword || flag != CASE_CAPITALIZE_UP))
- c2 = UPCASE1 (c);
- if (c != c2)
+ changed = 1;
+ if (! multibyte)
+ {
+ MAKE_CHAR_UNIBYTE (c);
+ FETCH_BYTE (start_byte) = c;
+ }
+ else if (ASCII_CHAR_P (c2) && ASCII_CHAR_P (c))
+ FETCH_BYTE (start_byte) = c;
+ else
{
- int fromlen, tolen, j;
+ int tolen = CHAR_BYTES (c);
+ int j;
unsigned char str[MAX_MULTIBYTE_LENGTH];
- changed = 1;
- /* Handle the most likely case */
- if (c < 0400 && c2 < 0400)
- FETCH_BYTE (i) = c2;
- else if (fromlen = CHAR_STRING (c, str),
- tolen = CHAR_STRING (c2, str),
- fromlen == tolen)
+ CHAR_STRING (c, str);
+ if (len == tolen)
{
/* Length is unchanged. */
- for (j = 0; j < tolen; ++j)
- FETCH_BYTE (i + j) = str[j];
+ for (j = 0; j < len; ++j)
+ FETCH_BYTE (start_byte + j) = str[j];
}
else
{
/* Replace one character with the other,
keeping text properties the same. */
- replace_range_2 (start, i,
- start + 1, i + fromlen,
+ replace_range_2 (start, start_byte,
+ start + 1, start_byte + len,
str, 1, tolen,
- 1);
- if (opoint > start)
- opoint_byte += tolen - fromlen;
+ 0);
+ len = tolen;
}
}
- if ((int) flag >= (int) CASE_CAPITALIZE)
- inword = SYNTAX (c2) == Sword;
- INC_BOTH (start, i);
}
- TEMP_SET_PT_BOTH (opoint, opoint_byte);
+ start++;
+ start_byte += len;
}
- start = XFASTINT (b);
+ if (PT != opoint)
+ TEMP_SET_PT_BOTH (opoint, opoint_byte);
+
if (changed)
{
+ start = XFASTINT (b);
signal_after_change (start, end - start, end - start);
update_compositions (start, end, CHECK_ALL);
}
diff --git a/src/casetab.c b/src/casetab.c
index 952a320dda..bcd8e63cc7 100644
--- a/src/casetab.c
+++ b/src/casetab.c
@@ -24,7 +24,7 @@ Boston, MA 02110-1301, USA. */
#include <config.h>
#include "lisp.h"
#include "buffer.h"
-#include "charset.h"
+#include "character.h"
Lisp_Object Qcase_table_p, Qcase_table;
Lisp_Object Vascii_downcase_table, Vascii_upcase_table;
@@ -126,7 +126,6 @@ set_case_table (table, standard)
int standard;
{
Lisp_Object up, canon, eqv;
- int indices[3];
check_case_table (table);
@@ -137,8 +136,8 @@ set_case_table (table, standard)
if (NILP (up))
{
up = Fmake_char_table (Qcase_table, Qnil);
- map_char_table (set_identity, Qnil, table, table, up, 0, indices);
- map_char_table (shuffle, Qnil, table, table, up, 0, indices);
+ map_char_table (set_identity, Qnil, table, up);
+ map_char_table (shuffle, Qnil, table, up);
XCHAR_TABLE (table)->extras[0] = up;
}
@@ -146,14 +145,14 @@ set_case_table (table, standard)
{
canon = Fmake_char_table (Qcase_table, Qnil);
XCHAR_TABLE (table)->extras[1] = canon;
- map_char_table (set_canon, Qnil, table, table, table, 0, indices);
+ map_char_table (set_canon, Qnil, table, table);
}
if (NILP (eqv))
{
eqv = Fmake_char_table (Qcase_table, Qnil);
- map_char_table (set_identity, Qnil, canon, canon, eqv, 0, indices);
- map_char_table (shuffle, Qnil, canon, canon, eqv, 0, indices);
+ map_char_table (set_identity, Qnil, canon, eqv);
+ map_char_table (shuffle, Qnil, canon, eqv);
XCHAR_TABLE (table)->extras[2] = eqv;
}
@@ -180,30 +179,45 @@ set_case_table (table, standard)
/* The following functions are called in map_char_table. */
-/* Set CANON char-table element for C to a translated ELT by UP and
- DOWN char-tables. This is done only when ELT is a character. The
- char-tables CANON, UP, and DOWN are in CASE_TABLE. */
+/* Set CANON char-table element for characters in RANGE to a
+ translated ELT by UP and DOWN char-tables. This is done only when
+ ELT is a character. The char-tables CANON, UP, and DOWN are in
+ CASE_TABLE. */
static void
-set_canon (case_table, c, elt)
- Lisp_Object case_table, c, elt;
+set_canon (case_table, range, elt)
+ Lisp_Object case_table, range, elt;
{
Lisp_Object up = XCHAR_TABLE (case_table)->extras[0];
Lisp_Object canon = XCHAR_TABLE (case_table)->extras[1];
if (NATNUMP (elt))
- Faset (canon, c, Faref (case_table, Faref (up, elt)));
+ Fset_char_table_range (canon, range, Faref (case_table, Faref (up, elt)));
}
-/* Set elements of char-table TABLE for C to C itself. This is done
- only when ELT is a character. This is called in map_char_table. */
+/* Set elements of char-table TABLE for C to C itself. C may be a
+ cons specifying a character range. In that case, set characters in
+ that range to themselves. This is done only when ELT is a
+ character. This is called in map_char_table. */
static void
set_identity (table, c, elt)
Lisp_Object table, c, elt;
{
if (NATNUMP (elt))
- Faset (table, c, c);
+ {
+ int from, to;
+
+ if (CONSP (c))
+ {
+ from = XINT (XCAR (c));
+ to = XINT (XCDR (c));
+ }
+ else
+ from = to = XINT (c);
+ for (; from <= to; from++)
+ CHAR_TABLE_SET (table, from, make_number (from));
+ }
}
/* Permute the elements of TABLE (which is initially an identity
@@ -215,11 +229,25 @@ static void
shuffle (table, c, elt)
Lisp_Object table, c, elt;
{
- if (NATNUMP (elt) && !EQ (c, elt))
+ if (NATNUMP (elt))
{
Lisp_Object tem = Faref (table, elt);
- Faset (table, elt, c);
- Faset (table, c, tem);
+ int from, to;
+
+ if (CONSP (c))
+ {
+ from = XINT (XCAR (c));
+ to = XINT (XCDR (c));
+ }
+ else
+ from = to = XINT (c);
+
+ for (; from <= to; from++)
+ if (from != XINT (elt))
+ {
+ Faset (table, elt, make_number (from));
+ Faset (table, make_number (from), tem);
+ }
}
}
@@ -244,22 +272,24 @@ init_casetab_once ()
Vascii_downcase_table = down;
XCHAR_TABLE (down)->purpose = Qcase_table;
- for (i = 0; i < CHAR_TABLE_SINGLE_BYTE_SLOTS; i++)
- XSETFASTINT (XCHAR_TABLE (down)->contents[i],
- (i >= 'A' && i <= 'Z') ? i + ('a' - 'A') : i);
+ for (i = 0; i < 128; i++)
+ {
+ int c = (i >= 'A' && i <= 'Z') ? i + ('a' - 'A') : i;
+ CHAR_TABLE_SET (down, i, make_number (c));
+ }
XCHAR_TABLE (down)->extras[1] = Fcopy_sequence (down);
up = Fmake_char_table (Qcase_table, Qnil);
XCHAR_TABLE (down)->extras[0] = up;
- for (i = 0; i < CHAR_TABLE_SINGLE_BYTE_SLOTS; i++)
- XSETFASTINT (XCHAR_TABLE (up)->contents[i],
- ((i >= 'A' && i <= 'Z')
- ? i + ('a' - 'A')
- : ((i >= 'a' && i <= 'z')
- ? i + ('A' - 'a')
- : i)));
+ for (i = 0; i < 128; i++)
+ {
+ int c = ((i >= 'A' && i <= 'Z') ? i + ('a' - 'A')
+ : ((i >= 'a' && i <= 'z') ? i + ('A' - 'a')
+ : i));;
+ CHAR_TABLE_SET (up, i, make_number (c));
+ }
XCHAR_TABLE (down)->extras[2] = Fcopy_sequence (up);
diff --git a/src/category.c b/src/category.c
index 7ea9b7810f..708131d8e4 100644
--- a/src/category.c
+++ b/src/category.c
@@ -5,6 +5,9 @@
2005, 2006, 2007
National Institute of Advanced Industrial Science and Technology (AIST)
Registration Number H14PRO021
+ Copyright (C) 2003
+ National Institute of Advanced Industrial Science and Technology (AIST)
+ Registration Number H13PRO009
This file is part of GNU Emacs.
@@ -31,6 +34,7 @@ Boston, MA 02110-1301, USA. */
#include <ctype.h>
#include "lisp.h"
#include "buffer.h"
+#include "character.h"
#include "charset.h"
#include "category.h"
#include "keymap.h"
@@ -189,6 +193,18 @@ This is the one used for new buffers. */)
return Vstandard_category_table;
}
+
+static void
+copy_category_entry (table, c, val)
+ Lisp_Object table, c, val;
+{
+ val = Fcopy_sequence (val);
+ if (CONSP (c))
+ char_table_set_range (table, XINT (XCAR (c)), XINT (XCDR (c)), val);
+ else
+ char_table_set (table, XINT (c), val);
+}
+
/* Return a copy of category table TABLE. We can't simply use the
function copy-sequence because no contents should be shared between
the original and the copy. This function is called recursively by
@@ -198,44 +214,14 @@ Lisp_Object
copy_category_table (table)
Lisp_Object table;
{
- Lisp_Object tmp;
- int i, to;
+ table = copy_char_table (table);
- if (!NILP (XCHAR_TABLE (table)->top))
- {
- /* TABLE is a top level char table.
- At first, make a copy of tree structure of the table. */
- table = Fcopy_sequence (table);
-
- /* Then, copy elements for single byte characters one by one. */
- for (i = 0; i < CHAR_TABLE_SINGLE_BYTE_SLOTS; i++)
- if (!NILP (tmp = XCHAR_TABLE (table)->contents[i]))
- XCHAR_TABLE (table)->contents[i] = Fcopy_sequence (tmp);
- to = CHAR_TABLE_ORDINARY_SLOTS;
-
- /* Also copy the first (and sole) extra slot. It is a vector
- containing docstring of each category. */
- Fset_char_table_extra_slot
- (table, make_number (0),
- Fcopy_sequence (Fchar_table_extra_slot (table, make_number (0))));
- }
- else
- {
- i = 32;
- to = SUB_CHAR_TABLE_ORDINARY_SLOTS;
- }
-
- /* If the table has non-nil default value, copy it. */
- if (!NILP (tmp = XCHAR_TABLE (table)->defalt))
- XCHAR_TABLE (table)->defalt = Fcopy_sequence (tmp);
-
- /* At last, copy the remaining elements while paying attention to a
- sub char table. */
- for (; i < to; i++)
- if (!NILP (tmp = XCHAR_TABLE (table)->contents[i]))
- XCHAR_TABLE (table)->contents[i]
- = (SUB_CHAR_TABLE_P (tmp)
- ? copy_category_table (tmp) : Fcopy_sequence (tmp));
+ if (! NILP (XCHAR_TABLE (table)->defalt))
+ XCHAR_TABLE (table)->defalt
+ = Fcopy_sequence (XCHAR_TABLE (table)->defalt);
+ XCHAR_TABLE (table)->extras[0]
+ = Fcopy_sequence (XCHAR_TABLE (table)->extras[0]);
+ map_char_table (copy_category_entry, Qnil, table, table);
return table;
}
@@ -261,9 +247,12 @@ DEFUN ("make-category-table", Fmake_category_table, Smake_category_table,
()
{
Lisp_Object val;
+ int i;
val = Fmake_char_table (Qcategory_table, Qnil);
XCHAR_TABLE (val)->defalt = MAKE_CATEGORY_SET;
+ for (i = 0; i < (1 << CHARTAB_SIZE_BITS_0); i++)
+ XCHAR_TABLE (val)->contents[i] = MAKE_CATEGORY_SET;
Fset_char_table_extra_slot (val, make_number (0),
Fmake_vector (make_number (95), Qnil));
return val;
@@ -285,6 +274,13 @@ Return TABLE. */)
}
+Lisp_Object
+char_category_set (c)
+ int c;
+{
+ return CHAR_TABLE_REF (current_buffer->category_table, c);
+}
+
DEFUN ("char-category-set", Fchar_category_set, Schar_category_set, 1, 1, 0,
doc: /* Return the category set of CHAR.
usage: (char-category-set CHAR) */)
@@ -318,34 +314,6 @@ The return value is a string containing those same categories. */)
return build_string (str);
}
-/* Modify all category sets stored under sub char-table TABLE so that
- they contain (SET_VALUE is t) or don't contain (SET_VALUE is nil)
- CATEGORY. */
-
-void
-modify_lower_category_set (table, category, set_value)
- Lisp_Object table, category, set_value;
-{
- Lisp_Object val;
- int i;
-
- val = XCHAR_TABLE (table)->defalt;
- if (!CATEGORY_SET_P (val))
- val = MAKE_CATEGORY_SET;
- SET_CATEGORY_SET (val, category, set_value);
- XCHAR_TABLE (table)->defalt = val;
-
- for (i = 32; i < SUB_CHAR_TABLE_ORDINARY_SLOTS; i++)
- {
- val = XCHAR_TABLE (table)->contents[i];
-
- if (CATEGORY_SET_P (val))
- SET_CATEGORY_SET (val, category, set_value);
- else if (SUB_CHAR_TABLE_P (val))
- modify_lower_category_set (val, category, set_value);
- }
-}
-
void
set_category_set (category_set, category, val)
Lisp_Object category_set, category, val;
@@ -365,113 +333,55 @@ DEFUN ("modify-category-entry", Fmodify_category_entry,
Smodify_category_entry, 2, 4, 0,
doc: /* Modify the category set of CHARACTER by adding CATEGORY to it.
The category is changed only for table TABLE, which defaults to
- the current buffer's category table.
+the current buffer's category table.
+CHARACTER can be either a single character or a cons representing the
+lower and upper ends of an inclusive character range to modify.
If optional fourth argument RESET is non-nil,
then delete CATEGORY from the category set instead of adding it. */)
(character, category, table, reset)
Lisp_Object character, category, table, reset;
{
- int c, charset, c1, c2;
Lisp_Object set_value; /* Actual value to be set in category sets. */
- Lisp_Object val, category_set;
+ Lisp_Object category_set;
+ int start, end;
+ int from, to;
- CHECK_NUMBER (character);
- c = XINT (character);
- CHECK_CATEGORY (category);
- table = check_category_table (table);
-
- if (NILP (CATEGORY_DOCSTRING (table, XFASTINT (category))))
- error ("Undefined category: %c", XFASTINT (category));
-
- set_value = NILP (reset) ? Qt : Qnil;
-
- if (c < CHAR_TABLE_SINGLE_BYTE_SLOTS)
- {
- val = XCHAR_TABLE (table)->contents[c];
- if (!CATEGORY_SET_P (val))
- XCHAR_TABLE (table)->contents[c] = (val = MAKE_CATEGORY_SET);
- SET_CATEGORY_SET (val, category, set_value);
- return Qnil;
- }
-
- SPLIT_CHAR (c, charset, c1, c2);
-
- /* The top level table. */
- val = XCHAR_TABLE (table)->contents[charset + 128];
- if (CATEGORY_SET_P (val))
- category_set = val;
- else if (!SUB_CHAR_TABLE_P (val))
- {
- category_set = val = MAKE_CATEGORY_SET;
- XCHAR_TABLE (table)->contents[charset + 128] = category_set;
- }
-
- if (c1 <= 0)
+ if (INTEGERP (character))
{
- /* Only a charset is specified. */
- if (SUB_CHAR_TABLE_P (val))
- /* All characters in CHARSET should be the same as for having
- CATEGORY or not. */
- modify_lower_category_set (val, category, set_value);
- else
- SET_CATEGORY_SET (category_set, category, set_value);
- return Qnil;
+ CHECK_CHARACTER (character);
+ start = end = XFASTINT (character);
}
-
- /* The second level table. */
- if (!SUB_CHAR_TABLE_P (val))
+ else
{
- val = make_sub_char_table (Qnil);
- XCHAR_TABLE (table)->contents[charset + 128] = val;
- /* We must set default category set of CHARSET in `defalt' slot. */
- XCHAR_TABLE (val)->defalt = category_set;
+ CHECK_CONS (character);
+ CHECK_CHARACTER_CAR (character);
+ CHECK_CHARACTER_CDR (character);
+ start = XFASTINT (XCAR (character));
+ end = XFASTINT (XCDR (character));
}
- table = val;
- val = XCHAR_TABLE (table)->contents[c1];
- if (CATEGORY_SET_P (val))
- category_set = val;
- else if (!SUB_CHAR_TABLE_P (val))
- {
- category_set = val = Fcopy_sequence (XCHAR_TABLE (table)->defalt);
- XCHAR_TABLE (table)->contents[c1] = category_set;
- }
+ CHECK_CATEGORY (category);
+ table = check_category_table (table);
- if (c2 <= 0)
- {
- if (SUB_CHAR_TABLE_P (val))
- /* All characters in C1 group of CHARSET should be the same as
- for CATEGORY. */
- modify_lower_category_set (val, category, set_value);
- else
- SET_CATEGORY_SET (category_set, category, set_value);
- return Qnil;
- }
+ if (NILP (CATEGORY_DOCSTRING (table, XFASTINT (category))))
+ error ("Undefined category: %c", XFASTINT (category));
- /* The third (bottom) level table. */
- if (!SUB_CHAR_TABLE_P (val))
- {
- val = make_sub_char_table (Qnil);
- XCHAR_TABLE (table)->contents[c1] = val;
- /* We must set default category set of CHARSET and C1 in
- `defalt' slot. */
- XCHAR_TABLE (val)->defalt = category_set;
- }
- table = val;
+ set_value = NILP (reset) ? Qt : Qnil;
- val = XCHAR_TABLE (table)->contents[c2];
- if (CATEGORY_SET_P (val))
- category_set = val;
- else if (!SUB_CHAR_TABLE_P (val))
+ while (start <= end)
{
- category_set = Fcopy_sequence (XCHAR_TABLE (table)->defalt);
- XCHAR_TABLE (table)->contents[c2] = category_set;
+ category_set = char_table_ref_and_range (table, start, &from, &to);
+ if (CATEGORY_MEMBER (XFASTINT (category), category_set) != NILP (reset))
+ {
+ category_set = Fcopy_sequence (category_set);
+ SET_CATEGORY_SET (category_set, category, set_value);
+ if (to > end)
+ char_table_set_range (table, start, end, category_set);
+ else
+ char_table_set_range (table, start, to, category_set);
+ }
+ start = to + 1;
}
- else
- /* This should never happen. */
- error ("Invalid category table");
-
- SET_CATEGORY_SET (category_set, category, set_value);
return Qnil;
}
diff --git a/src/category.h b/src/category.h
index be534fb47f..3687e06ce1 100644
--- a/src/category.h
+++ b/src/category.h
@@ -3,6 +3,9 @@
2005, 2006, 2007
National Institute of Advanced Industrial Science and Technology (AIST)
Registration Number H14PRO021
+ Copyright (C) 2003
+ National Institute of Advanced Industrial Science and Technology (AIST)
+ Registration Number H13PRO009
This file is part of GNU Emacs.
@@ -93,21 +96,7 @@ extern Lisp_Object _temp_category_set;
#define Vstandard_category_table buffer_defaults.category_table
/* Return the category set of character C in the current category table. */
-#ifdef __GNUC__
-#define CATEGORY_SET(c) \
- ({ Lisp_Object table = current_buffer->category_table; \
- Lisp_Object temp; \
- if ((c) < CHAR_TABLE_SINGLE_BYTE_SLOTS) \
- while (NILP (temp = XCHAR_TABLE (table)->contents[(unsigned char) c]) \
- && NILP (temp = XCHAR_TABLE (table)->defalt)) \
- table = XCHAR_TABLE (table)->parent; \
- else \
- temp = Faref (table, make_number (c)); \
- temp; })
-#else
-#define CATEGORY_SET(c) \
- Faref (current_buffer->category_table, make_number (c))
-#endif
+#define CATEGORY_SET(c) char_category_set (c)
/* Return the doc string of CATEGORY in category table TABLE. */
#define CATEGORY_DOCSTRING(table, category) \
@@ -120,8 +109,8 @@ extern Lisp_Object _temp_category_set;
/* Return 1 if there is a word boundary between two word-constituent
characters C1 and C2 if they appear in this order, else return 0.
- There is no word boundary between two word-constituent ASCII
- characters. */
+ There is no word boundary between two word-constituent ASCII and
+ Latin-1 characters. */
#define WORD_BOUNDARY_P(c1, c2) \
(!(SINGLE_BYTE_CHAR_P (c1) && SINGLE_BYTE_CHAR_P (c2)) \
&& word_boundary_p (c1, c2))
diff --git a/src/ccl.c b/src/ccl.c
index 564fd4ba4f..d51743c243 100644
--- a/src/ccl.c
+++ b/src/ccl.c
@@ -5,6 +5,9 @@
2005, 2006, 2007
National Institute of Advanced Industrial Science and Technology (AIST)
Registration Number H14PRO021
+ Copyright (C) 2003
+ National Institute of Advanced Industrial Science and Technology (AIST)
+ Registration Number H13PRO009
This file is part of GNU Emacs.
@@ -28,10 +31,13 @@ Boston, MA 02110-1301, USA. */
#include <stdio.h>
#include "lisp.h"
+#include "character.h"
#include "charset.h"
#include "ccl.h"
#include "coding.h"
+Lisp_Object Qccl, Qcclp;
+
/* This contains all code conversion map available to CCL. */
Lisp_Object Vcode_conversion_map_vector;
@@ -67,6 +73,8 @@ Lisp_Object Vtranslation_hash_table_vector;
#define GET_HASH_TABLE(id) \
(XHASH_TABLE (XCDR(XVECTOR(Vtranslation_hash_table_vector)->contents[(id)])))
+extern int charset_unicode;
+
/* CCL (Code Conversion Language) is a simple language which has
operations on one input buffer, one output buffer, and 7 registers.
The syntax of CCL is described in `ccl.el'. Emacs Lisp function
@@ -199,10 +207,13 @@ Lisp_Object Vtranslation_hash_table_vector;
#define CCL_WriteStringJump 0x0A /* Write string and jump:
1:A--D--D--R--E--S--S-000XXXXX
2:LENGTH
- 3:0000STRIN[0]STRIN[1]STRIN[2]
+ 3:000MSTRIN[0]STRIN[1]STRIN[2]
...
------------------------------
- write_string (STRING, LENGTH);
+ if (M)
+ write_multibyte_string (STRING, LENGTH);
+ else
+ write_string (STRING, LENGTH);
IC += ADDRESS;
*/
@@ -309,13 +320,16 @@ Lisp_Object Vtranslation_hash_table_vector;
#define CCL_WriteConstString 0x14 /* Write a constant or a string:
1:CCCCCCCCCCCCCCCCCCCCrrrXXXXX
- [2:0000STRIN[0]STRIN[1]STRIN[2]]
+ [2:000MSTRIN[0]STRIN[1]STRIN[2]]
[...]
-----------------------------
if (!rrr)
write (CC..C)
else
- write_string (STRING, CC..C);
+ if (M)
+ write_multibyte_string (STRING, CC..C);
+ else
+ write_string (STRING, CC..C);
IC += (CC..C + 2) / 3;
*/
@@ -743,136 +757,87 @@ while(0)
/* Encode one character CH to multibyte form and write to the current
output buffer. If CH is less than 256, CH is written as is. */
-#define CCL_WRITE_CHAR(ch) \
- do { \
- int bytes = SINGLE_BYTE_CHAR_P (ch) ? 1: CHAR_BYTES (ch); \
- if (!dst) \
- CCL_INVALID_CMD; \
- else if (dst + bytes + extra_bytes < (dst_bytes ? dst_end : src)) \
- { \
- if (bytes == 1) \
- { \
- *dst++ = (ch); \
- if (extra_bytes && (ch) >= 0x80 && (ch) < 0xA0) \
- /* We may have to convert this eight-bit char to \
- multibyte form later. */ \
- extra_bytes++; \
- } \
- else if (CHAR_VALID_P (ch, 0)) \
- dst += CHAR_STRING (ch, dst); \
- else \
- CCL_INVALID_CMD; \
- } \
- else \
- CCL_SUSPEND (CCL_STAT_SUSPEND_BY_DST); \
- } while (0)
-
-/* Encode one character CH to multibyte form and write to the current
- output buffer. The output bytes always forms a valid multibyte
- sequence. */
-#define CCL_WRITE_MULTIBYTE_CHAR(ch) \
- do { \
- int bytes = CHAR_BYTES (ch); \
- if (!dst) \
- CCL_INVALID_CMD; \
- else if (dst + bytes + extra_bytes < (dst_bytes ? dst_end : src)) \
- { \
- if (CHAR_VALID_P ((ch), 0)) \
- dst += CHAR_STRING ((ch), dst); \
- else \
- CCL_INVALID_CMD; \
- } \
- else \
- CCL_SUSPEND (CCL_STAT_SUSPEND_BY_DST); \
+#define CCL_WRITE_CHAR(ch) \
+ do { \
+ if (! dst) \
+ CCL_INVALID_CMD; \
+ else if (dst < dst_end) \
+ *dst++ = (ch); \
+ else \
+ CCL_SUSPEND (CCL_STAT_SUSPEND_BY_DST); \
} while (0)
/* Write a string at ccl_prog[IC] of length LEN to the current output
buffer. */
-#define CCL_WRITE_STRING(len) \
- do { \
- if (!dst) \
- CCL_INVALID_CMD; \
- else if (dst + len <= (dst_bytes ? dst_end : src)) \
- for (i = 0; i < len; i++) \
- *dst++ = ((XFASTINT (ccl_prog[ic + (i / 3)])) \
- >> ((2 - (i % 3)) * 8)) & 0xFF; \
- else \
- CCL_SUSPEND (CCL_STAT_SUSPEND_BY_DST); \
- } while (0)
-
-/* Read one byte from the current input buffer into REGth register. */
-#define CCL_READ_CHAR(REG) \
- do { \
- if (!src) \
- CCL_INVALID_CMD; \
- else if (src < src_end) \
- { \
- REG = *src++; \
- if (REG == '\n' \
- && ccl->eol_type != CODING_EOL_LF) \
- { \
- /* We are encoding. */ \
- if (ccl->eol_type == CODING_EOL_CRLF) \
- { \
- if (ccl->cr_consumed) \
- ccl->cr_consumed = 0; \
- else \
- { \
- ccl->cr_consumed = 1; \
- REG = '\r'; \
- src--; \
- } \
- } \
- else \
- REG = '\r'; \
- } \
- if (REG == LEADING_CODE_8_BIT_CONTROL \
- && ccl->multibyte) \
- REG = *src++ - 0x20; \
- } \
- else if (ccl->last_block) \
- { \
- REG = -1; \
- ic = eof_ic; \
- goto ccl_repeat; \
- } \
- else \
- CCL_SUSPEND (CCL_STAT_SUSPEND_BY_SRC); \
- } while (0)
-
-
-/* Set C to the character code made from CHARSET and CODE. This is
- like MAKE_CHAR but check the validity of CHARSET and CODE. If they
- are not valid, set C to (CODE & 0xFF) because that is usually the
- case that CCL_ReadMultibyteChar2 read an invalid code and it set
- CODE to that invalid byte. */
-
-#define CCL_MAKE_CHAR(charset, code, c) \
+#define CCL_WRITE_STRING(len) \
do { \
- if (charset == CHARSET_ASCII) \
- c = code & 0xFF; \
- else if (CHARSET_DEFINED_P (charset) \
- && (code & 0x7F) >= 32 \
- && (code < 256 || ((code >> 7) & 0x7F) >= 32)) \
+ int i; \
+ if (!dst) \
+ CCL_INVALID_CMD; \
+ else if (dst + len <= dst_end) \
{ \
- int c1 = code & 0x7F, c2 = 0; \
- \
- if (code >= 256) \
- c2 = c1, c1 = (code >> 7) & 0x7F; \
- c = MAKE_CHAR (charset, c1, c2); \
+ if (XFASTINT (ccl_prog[ic]) & 0x1000000) \
+ for (i = 0; i < len; i++) \
+ *dst++ = XFASTINT (ccl_prog[ic + i]) & 0xFFFFFF; \
+ else \
+ for (i = 0; i < len; i++) \
+ *dst++ = ((XFASTINT (ccl_prog[ic + (i / 3)])) \
+ >> ((2 - (i % 3)) * 8)) & 0xFF; \
} \
else \
- c = code & 0xFF; \
+ CCL_SUSPEND (CCL_STAT_SUSPEND_BY_DST); \
} while (0)
+/* Read one byte from the current input buffer into Rth register. */
+#define CCL_READ_CHAR(r) \
+ do { \
+ if (! src) \
+ CCL_INVALID_CMD; \
+ else if (src < src_end) \
+ r = *src++; \
+ else if (ccl->last_block) \
+ { \
+ r = -1; \
+ ic = ccl->eof_ic; \
+ goto ccl_repeat; \
+ } \
+ else \
+ CCL_SUSPEND (CCL_STAT_SUSPEND_BY_SRC); \
+ } while (0)
+
+/* Decode CODE by a charset whose id is ID. If ID is 0, return CODE
+ as is for backward compatibility. Assume that we can use the
+ variable `charset'. */
+
+#define CCL_DECODE_CHAR(id, code) \
+ ((id) == 0 ? (code) \
+ : (charset = CHARSET_FROM_ID ((id)), DECODE_CHAR (charset, (code))))
+
+/* Encode character C by some of charsets in CHARSET_LIST. Set ID to
+ the id of the used charset, ENCODED to the resulf of encoding.
+ Assume that we can use the variable `charset'. */
+
+#define CCL_ENCODE_CHAR(c, charset_list, id, encoded) \
+ do { \
+ unsigned code; \
+ \
+ charset = char_charset ((c), (charset_list), &code); \
+ if (! charset && ! NILP (charset_list)) \
+ charset = char_charset ((c), Qnil, &code); \
+ if (charset) \
+ { \
+ (id) = CHARSET_ID (charset); \
+ (encoded) = code; \
+ } \
+ } while (0)
-/* Execute CCL code on SRC_BYTES length text at SOURCE. The resulting
- text goes to a place pointed by DESTINATION, the length of which
- should not exceed DST_BYTES. The bytes actually processed is
- returned as *CONSUMED. The return value is the length of the
- resulting text. As a side effect, the contents of CCL registers
- are updated. If SOURCE or DESTINATION is NULL, only operations on
- registers are permitted. */
+/* Execute CCL code on characters at SOURCE (length SRC_SIZE). The
+ resulting text goes to a place pointed by DESTINATION, the length
+ of which should not exceed DST_SIZE. As a side effect, how many
+ characters are consumed and produced are recorded in CCL->consumed
+ and CCL->produced, and the contents of CCL registers are updated.
+ If SOURCE or DESTINATION is NULL, only operations on registers are
+ permitted. */
#ifdef CCL_DEBUG
#define CCL_DEBUG_BACKTRACE_LEN 256
@@ -897,36 +862,32 @@ struct ccl_prog_stack
/* For the moment, we only support depth 256 of stack. */
static struct ccl_prog_stack ccl_prog_stack_struct[256];
-int
-ccl_driver (ccl, source, destination, src_bytes, dst_bytes, consumed)
+void
+ccl_driver (ccl, source, destination, src_size, dst_size, charset_list)
struct ccl_program *ccl;
- unsigned char *source, *destination;
- int src_bytes, dst_bytes;
- int *consumed;
+ int *source, *destination;
+ int src_size, dst_size;
+ Lisp_Object charset_list;
{
register int *reg = ccl->reg;
register int ic = ccl->ic;
register int code = 0, field1, field2;
register Lisp_Object *ccl_prog = ccl->prog;
- unsigned char *src = source, *src_end = src + src_bytes;
- unsigned char *dst = destination, *dst_end = dst + dst_bytes;
+ int *src = source, *src_end = src + src_size;
+ int *dst = destination, *dst_end = dst + dst_size;
int jump_address;
int i = 0, j, op;
int stack_idx = ccl->stack_idx;
/* Instruction counter of the current CCL code. */
int this_ic = 0;
- /* CCL_WRITE_CHAR will produce 8-bit code of range 0x80..0x9F. But,
- each of them will be converted to multibyte form of 2-byte
- sequence. For that conversion, we remember how many more bytes
- we must keep in DESTINATION in this variable. */
- int extra_bytes = ccl->eight_bit_control;
+ struct charset *charset;
int eof_ic = ccl->eof_ic;
int eof_hit = 0;
if (ic >= eof_ic)
ic = CCL_HEADER_MAIN;
- if (ccl->buf_magnification == 0) /* We can't produce any bytes. */
+ if (ccl->buf_magnification == 0) /* We can't read/produce any bytes. */
dst = NULL;
/* Set mapping stack pointer. */
@@ -951,8 +912,8 @@ ccl_driver (ccl, source, destination, src_bytes, dst_bytes, consumed)
/* We can't just signal Qquit, instead break the loop as if
the whole data is processed. Don't reset Vquit_flag, it
must be handled later at a safer place. */
- if (consumed)
- src = source + src_bytes;
+ if (src)
+ src = source + src_size;
ccl->status = CCL_STAT_QUIT;
break;
}
@@ -1273,8 +1234,22 @@ ccl_driver (ccl, source, destination, src_bytes, dst_bytes, consumed)
case CCL_LE: reg[rrr] = i <= j; break;
case CCL_GE: reg[rrr] = i >= j; break;
case CCL_NE: reg[rrr] = i != j; break;
- case CCL_DECODE_SJIS: DECODE_SJIS (i, j, reg[rrr], reg[7]); break;
- case CCL_ENCODE_SJIS: ENCODE_SJIS (i, j, reg[rrr], reg[7]); break;
+ case CCL_DECODE_SJIS:
+ {
+ i = (i << 8) | j;
+ SJIS_TO_JIS (i);
+ reg[rrr] = i >> 8;
+ reg[7] = i & 0xFF;
+ break;
+ }
+ case CCL_ENCODE_SJIS:
+ {
+ i = (i << 8) | j;
+ JIS_TO_SJIS (i);
+ reg[rrr] = i >> 8;
+ reg[7] = i & 0xFF;
+ break;
+ }
default: CCL_INVALID_CMD;
}
code &= 0x1F;
@@ -1294,166 +1269,29 @@ ccl_driver (ccl, source, destination, src_bytes, dst_bytes, consumed)
case CCL_ReadMultibyteChar2:
if (!src)
CCL_INVALID_CMD;
-
- if (src >= src_end)
- {
- src++;
- goto ccl_read_multibyte_character_suspend;
- }
-
- if (!ccl->multibyte)
- {
- int bytes;
- if (!UNIBYTE_STR_AS_MULTIBYTE_P (src, src_end - src, bytes))
- {
- reg[RRR] = CHARSET_8_BIT_CONTROL;
- reg[rrr] = *src++;
- break;
- }
- }
- i = *src++;
- if (i == '\n' && ccl->eol_type != CODING_EOL_LF)
- {
- /* We are encoding. */
- if (ccl->eol_type == CODING_EOL_CRLF)
- {
- if (ccl->cr_consumed)
- ccl->cr_consumed = 0;
- else
- {
- ccl->cr_consumed = 1;
- i = '\r';
- src--;
- }
- }
- else
- i = '\r';
- reg[rrr] = i;
- reg[RRR] = CHARSET_ASCII;
- }
- else if (i < 0x80)
- {
- /* ASCII */
- reg[rrr] = i;
- reg[RRR] = CHARSET_ASCII;
- }
- else if (i <= MAX_CHARSET_OFFICIAL_DIMENSION2)
- {
- int dimension = BYTES_BY_CHAR_HEAD (i) - 1;
-
- if (dimension == 0)
- {
- /* `i' is a leading code for an undefined charset. */
- reg[RRR] = CHARSET_8_BIT_GRAPHIC;
- reg[rrr] = i;
- }
- else if (src + dimension > src_end)
- goto ccl_read_multibyte_character_suspend;
- else
- {
- reg[RRR] = i;
- i = (*src++ & 0x7F);
- if (dimension == 1)
- reg[rrr] = i;
- else
- reg[rrr] = ((i << 7) | (*src++ & 0x7F));
- }
- }
- else if ((i == LEADING_CODE_PRIVATE_11)
- || (i == LEADING_CODE_PRIVATE_12))
- {
- if ((src + 1) >= src_end)
- goto ccl_read_multibyte_character_suspend;
- reg[RRR] = *src++;
- reg[rrr] = (*src++ & 0x7F);
- }
- else if ((i == LEADING_CODE_PRIVATE_21)
- || (i == LEADING_CODE_PRIVATE_22))
- {
- if ((src + 2) >= src_end)
- goto ccl_read_multibyte_character_suspend;
- reg[RRR] = *src++;
- i = (*src++ & 0x7F);
- reg[rrr] = ((i << 7) | (*src & 0x7F));
- src++;
- }
- else if (i == LEADING_CODE_8_BIT_CONTROL)
- {
- if (src >= src_end)
- goto ccl_read_multibyte_character_suspend;
- reg[RRR] = CHARSET_8_BIT_CONTROL;
- reg[rrr] = (*src++ - 0x20);
- }
- else if (i >= 0xA0)
- {
- reg[RRR] = CHARSET_8_BIT_GRAPHIC;
- reg[rrr] = i;
- }
- else
- {
- /* INVALID CODE. Return a single byte character. */
- reg[RRR] = CHARSET_ASCII;
- reg[rrr] = i;
- }
- break;
-
- ccl_read_multibyte_character_suspend:
- if (src <= src_end && !ccl->multibyte && ccl->last_block)
- {
- reg[RRR] = CHARSET_8_BIT_CONTROL;
- reg[rrr] = i;
- break;
- }
- src--;
- if (ccl->last_block)
- {
- ic = eof_ic;
- eof_hit = 1;
- goto ccl_repeat;
- }
- else
- CCL_SUSPEND (CCL_STAT_SUSPEND_BY_SRC);
-
+ CCL_READ_CHAR (i);
+ CCL_ENCODE_CHAR (i, charset_list, reg[RRR], reg[rrr]);
break;
case CCL_WriteMultibyteChar2:
- i = reg[RRR]; /* charset */
- if (i == CHARSET_ASCII
- || i == CHARSET_8_BIT_CONTROL
- || i == CHARSET_8_BIT_GRAPHIC)
- i = reg[rrr] & 0xFF;
- else if (CHARSET_DIMENSION (i) == 1)
- i = ((i - 0x70) << 7) | (reg[rrr] & 0x7F);
- else if (i < MIN_CHARSET_PRIVATE_DIMENSION2)
- i = ((i - 0x8F) << 14) | reg[rrr];
- else
- i = ((i - 0xE0) << 14) | reg[rrr];
-
- CCL_WRITE_MULTIBYTE_CHAR (i);
-
+ if (! dst)
+ CCL_INVALID_CMD;
+ i = CCL_DECODE_CHAR (reg[RRR], reg[rrr]);
+ CCL_WRITE_CHAR (i);
break;
case CCL_TranslateCharacter:
- CCL_MAKE_CHAR (reg[RRR], reg[rrr], i);
- op = translate_char (GET_TRANSLATION_TABLE (reg[Rrr]),
- i, -1, 0, 0);
- SPLIT_CHAR (op, reg[RRR], i, j);
- if (j != -1)
- i = (i << 7) | j;
-
- reg[rrr] = i;
+ i = CCL_DECODE_CHAR (reg[RRR], reg[rrr]);
+ op = translate_char (GET_TRANSLATION_TABLE (reg[Rrr]), i);
+ CCL_ENCODE_CHAR (op, charset_list, reg[RRR], reg[rrr]);
break;
case CCL_TranslateCharacterConstTbl:
op = XINT (ccl_prog[ic]); /* table */
ic++;
- CCL_MAKE_CHAR (reg[RRR], reg[rrr], i);
- op = translate_char (GET_TRANSLATION_TABLE (op), i, -1, 0, 0);
- SPLIT_CHAR (op, reg[RRR], i, j);
- if (j != -1)
- i = (i << 7) | j;
-
- reg[rrr] = i;
+ i = CCL_DECODE_CHAR (reg[RRR], reg[rrr]);
+ op = translate_char (GET_TRANSLATION_TABLE (op), i);
+ CCL_ENCODE_CHAR (op, charset_list, reg[RRR], reg[rrr]);
break;
case CCL_LookupIntConstTbl:
@@ -1467,12 +1305,10 @@ ccl_driver (ccl, source, destination, src_bytes, dst_bytes, consumed)
{
Lisp_Object opl;
opl = HASH_VALUE (h, op);
- if (!CHAR_VALID_P (XINT (opl), 0))
+ if (! CHARACTERP (opl))
CCL_INVALID_CMD;
- SPLIT_CHAR (XINT (opl), reg[RRR], i, j);
- if (j != -1)
- i = (i << 7) | j;
- reg[rrr] = i;
+ reg[RRR] = charset_unicode;
+ reg[rrr] = op;
reg[7] = 1; /* r7 true for success */
}
else
@@ -1483,7 +1319,7 @@ ccl_driver (ccl, source, destination, src_bytes, dst_bytes, consumed)
case CCL_LookupCharConstTbl:
op = XINT (ccl_prog[ic]); /* table */
ic++;
- CCL_MAKE_CHAR (reg[RRR], reg[rrr], i);
+ i = CCL_DECODE_CHAR (reg[RRR], reg[rrr]);
{
struct Lisp_Hash_Table *h = GET_HASH_TABLE (op);
@@ -1917,10 +1753,10 @@ ccl_driver (ccl, source, destination, src_bytes, dst_bytes, consumed)
}
msglen = strlen (msg);
- if (dst + msglen <= (dst_bytes ? dst_end : src))
+ if (dst + msglen <= dst_end)
{
- bcopy (msg, dst, msglen);
- dst += msglen;
+ for (i = 0; i < msglen; i++)
+ *dst++ = msg[i];
}
if (ccl->status == CCL_STAT_INVALID_CMD)
@@ -1946,10 +1782,11 @@ ccl_driver (ccl, source, destination, src_bytes, dst_bytes, consumed)
ccl->ic = ic;
ccl->stack_idx = stack_idx;
ccl->prog = ccl_prog;
- ccl->eight_bit_control = (extra_bytes > 1);
- if (consumed)
- *consumed = src - source;
- return (dst ? dst - destination : 0);
+ ccl->consumed = src - source;
+ if (dst != NULL)
+ ccl->produced = dst - destination;
+ else
+ ccl->produced = 0;
}
/* Resolve symbols in the specified CCL code (Lisp vector). This
@@ -2109,7 +1946,6 @@ setup_ccl_program (ccl, ccl_prog)
ccl->private_state = 0;
ccl->status = 0;
ccl->stack_idx = 0;
- ccl->eol_type = CODING_EOL_LF;
ccl->suppress_error = 0;
ccl->eight_bit_control = 0;
return 0;
@@ -2197,7 +2033,7 @@ programs. */)
? XINT (AREF (reg, i))
: 0);
- ccl_driver (&ccl, (unsigned char *)0, (unsigned char *)0, 0, 0, (int *)0);
+ ccl_driver (&ccl, NULL, NULL, 0, 0, Qnil);
QUIT;
if (ccl.status != CCL_STAT_SUCCESS)
error ("Error in CCL program at %dth code", ccl.ic);
@@ -2239,10 +2075,13 @@ usage: (ccl-execute-on-string CCL-PROGRAM STATUS STRING &optional CONTINUE UNIBY
{
Lisp_Object val;
struct ccl_program ccl;
- int i, produced;
+ int i;
int outbufsize;
- char *outbuf;
- struct gcpro gcpro1, gcpro2;
+ unsigned char *outbuf, *outp;
+ int str_chars, str_bytes;
+#define CCL_EXECUTE_BUF_SIZE 1024
+ int source[CCL_EXECUTE_BUF_SIZE], destination[CCL_EXECUTE_BUF_SIZE];
+ int consumed_chars, consumed_bytes, produced_chars;
if (setup_ccl_program (&ccl, ccl_prog) < 0)
error ("Invalid CCL program");
@@ -2252,7 +2091,8 @@ usage: (ccl-execute-on-string CCL-PROGRAM STATUS STRING &optional CONTINUE UNIBY
error ("Length of vector STATUS is not 9");
CHECK_STRING (str);
- GCPRO2 (status, str);
+ str_chars = SCHARS (str);
+ str_bytes = SBYTES (str);
for (i = 0; i < 8; i++)
{
@@ -2267,33 +2107,90 @@ usage: (ccl-execute-on-string CCL-PROGRAM STATUS STRING &optional CONTINUE UNIBY
if (ccl.ic < i && i < ccl.size)
ccl.ic = i;
}
- outbufsize = SBYTES (str) * ccl.buf_magnification + 256;
- outbuf = (char *) xmalloc (outbufsize);
- ccl.last_block = NILP (contin);
- ccl.multibyte = STRING_MULTIBYTE (str);
- produced = ccl_driver (&ccl, SDATA (str), outbuf,
- SBYTES (str), outbufsize, (int *) 0);
+
+ outbufsize = (ccl.buf_magnification
+ ? str_bytes * ccl.buf_magnification + 256
+ : str_bytes + 256);
+ outp = outbuf = (unsigned char *) xmalloc (outbufsize);
+
+ consumed_chars = consumed_bytes = 0;
+ produced_chars = 0;
+ while (1)
+ {
+ const unsigned char *p = SDATA (str) + consumed_bytes;
+ const unsigned char *endp = SDATA (str) + str_bytes;
+ int i = 0;
+ int *src, src_size;
+
+ if (endp - p == str_chars - consumed_chars)
+ while (i < CCL_EXECUTE_BUF_SIZE && p < endp)
+ source[i++] = *p++;
+ else
+ while (i < CCL_EXECUTE_BUF_SIZE && p < endp)
+ source[i++] = STRING_CHAR_ADVANCE (p);
+ consumed_chars += i;
+ consumed_bytes = p - SDATA (str);
+
+ if (consumed_bytes == str_bytes)
+ ccl.last_block = NILP (contin);
+ src = source;
+ src_size = i;
+ while (1)
+ {
+ ccl_driver (&ccl, src, destination, src_size, CCL_EXECUTE_BUF_SIZE,
+ Qnil);
+ produced_chars += ccl.produced;
+ if (NILP (unibyte_p))
+ {
+ if (outp - outbuf + MAX_MULTIBYTE_LENGTH * ccl.produced
+ > outbufsize)
+ {
+ int offset = outp - outbuf;
+ outbufsize += MAX_MULTIBYTE_LENGTH * ccl.produced;
+ outbuf = (unsigned char *) xrealloc (outbuf, outbufsize);
+ outp = outbuf + offset;
+ }
+ for (i = 0; i < ccl.produced; i++)
+ CHAR_STRING_ADVANCE (destination[i], outp);
+ }
+ else
+ {
+ if (outp - outbuf + ccl.produced > outbufsize)
+ {
+ int offset = outp - outbuf;
+ outbufsize += ccl.produced;
+ outbuf = (unsigned char *) xrealloc (outbuf, outbufsize);
+ outp = outbuf + offset;
+ }
+ for (i = 0; i < ccl.produced; i++)
+ *outp++ = destination[i];
+ }
+ src += ccl.consumed;
+ src_size -= ccl.consumed;
+ if (ccl.status != CCL_STAT_SUSPEND_BY_DST)
+ break;
+ }
+
+ if (ccl.status != CCL_STAT_SUSPEND_BY_SRC
+ || str_chars == consumed_chars)
+ break;
+ }
+
+ if (ccl.status == CCL_STAT_INVALID_CMD)
+ error ("Error in CCL program at %dth code", ccl.ic);
+ if (ccl.status == CCL_STAT_QUIT)
+ error ("CCL program interrupted at %dth code", ccl.ic);
+
for (i = 0; i < 8; i++)
ASET (status, i, make_number (ccl.reg[i]));
ASET (status, 8, make_number (ccl.ic));
- UNGCPRO;
if (NILP (unibyte_p))
- {
- int nchars;
-
- produced = str_as_multibyte (outbuf, outbufsize, produced, &nchars);
- val = make_multibyte_string (outbuf, nchars, produced);
- }
+ val = make_multibyte_string ((char *) outbuf, produced_chars,
+ outp - outbuf);
else
- val = make_unibyte_string (outbuf, produced);
+ val = make_unibyte_string ((char *) outbuf, produced_chars);
xfree (outbuf);
- QUIT;
- if (ccl.status == CCL_STAT_SUSPEND_BY_DST)
- error ("Output buffer for the CCL programs overflow");
- if (ccl.status != CCL_STAT_SUCCESS
- && ccl.status != CCL_STAT_SUSPEND_BY_SRC)
- error ("Error in CCL program at %dth code", ccl.ic);
return val;
}
@@ -2440,6 +2337,12 @@ syms_of_ccl ()
staticpro (&Vccl_program_table);
Vccl_program_table = Fmake_vector (make_number (32), Qnil);
+ Qccl = intern ("ccl");
+ staticpro (&Qccl);
+
+ Qcclp = intern ("cclp");
+ staticpro (&Qcclp);
+
Qccl_program = intern ("ccl-program");
staticpro (&Qccl_program);
diff --git a/src/ccl.h b/src/ccl.h
index 7199170a15..d76038c857 100644
--- a/src/ccl.h
+++ b/src/ccl.h
@@ -3,6 +3,9 @@
2005, 2006, 2007
National Institute of Advanced Industrial Science and Technology (AIST)
Registration Number H14PRO021
+ Copyright (C) 2003
+ National Institute of Advanced Industrial Science and Technology (AIST)
+ Registration Number H13PRO009
This file is part of GNU Emacs.
@@ -59,16 +62,14 @@ struct ccl_program {
many times bigger the output buffer
should be than the input buffer. */
int stack_idx; /* How deep the call of CCL_Call is nested. */
- int eol_type; /* When the CCL program is used for
- encoding by a coding system, set to
- the eol_type of the coding system.
- In other cases, always
- CODING_EOL_LF. */
- int multibyte; /* 1 if the source text is multibyte. */
+ int src_multibyte; /* 1 if the input buffer is multibyte. */
+ int dst_multibyte; /* 1 if the output buffer is multibyte. */
int cr_consumed; /* Flag for encoding DOS-like EOL
format when the CCL program is used
for encoding by a coding
system. */
+ int consumed;
+ int produced;
int suppress_error; /* If nonzero, don't insert error
message in the output. */
int eight_bit_control; /* If nonzero, ccl_driver counts all
@@ -82,13 +83,13 @@ struct ccl_program {
coding_system. */
struct ccl_spec {
- struct ccl_program decoder;
- struct ccl_program encoder;
- unsigned char valid_codes[256];
+ struct ccl_program ccl;
int cr_carryover; /* CR carryover flag. */
unsigned char eight_bit_carryover[MAX_MULTIBYTE_LENGTH];
};
+#define CODING_SPEC_CCL_PROGRAM(coding) ((coding)->spec.ccl.ccl)
+
/* Alist of fontname patterns vs corresponding CCL program. */
extern Lisp_Object Vfont_ccl_encoder_alist;
@@ -99,8 +100,8 @@ extern int setup_ccl_program P_ ((struct ccl_program *, Lisp_Object));
/* Check if CCL is updated or not. If not, re-setup members of CCL. */
extern int check_ccl_update P_ ((struct ccl_program *));
-extern int ccl_driver P_ ((struct ccl_program *, unsigned char *,
- unsigned char *, int, int, int *));
+extern void ccl_driver P_ ((struct ccl_program *, int *, int *, int, int,
+ Lisp_Object));
/* Vector of CCL program names vs corresponding program data. */
extern Lisp_Object Vccl_program_table;
@@ -109,6 +110,16 @@ extern Lisp_Object Vccl_program_table;
is an index for Vccl_protram_table. */
extern Lisp_Object Qccl_program_idx;
+extern Lisp_Object Qccl, Qcclp;
+
+EXFUN (Fccl_program_p, 1);
+
+#define CHECK_CCL_PROGRAM(x) \
+ do { \
+ if (NILP (Fccl_program_p (x))) \
+ x = wrong_type_argument (Qcclp, (x)); \
+ } while (0);
+
#endif /* EMACS_CCL_H */
/* arch-tag: 14681df7-876d-43de-bc71-6b78e23a4e3c
diff --git a/src/character.c b/src/character.c
new file mode 100644
index 0000000000..15a2c45fdf
--- /dev/null
+++ b/src/character.c
@@ -0,0 +1,1041 @@
+/* Basic character support.
+ Copyright (C) 1995, 1997, 1998, 2001 Electrotechnical Laboratory, JAPAN.
+ Licensed to the Free Software Foundation.
+ Copyright (C) 2001, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2006
+ National Institute of Advanced Industrial Science and Technology (AIST)
+ Registration Number H13PRO009
+
+This file is part of GNU Emacs.
+
+GNU Emacs is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Emacs is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Emacs; see the file COPYING. If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+/* At first, see the document in `character.h' to understand the code
+ in this file. */
+
+#ifdef emacs
+#include <config.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef emacs
+
+#include <sys/types.h>
+#include "lisp.h"
+#include "character.h"
+#include "buffer.h"
+#include "charset.h"
+#include "composite.h"
+#include "disptab.h"
+
+#else /* not emacs */
+
+#include "mulelib.h"
+
+#endif /* emacs */
+
+Lisp_Object Qcharacterp;
+
+/* Vector of translation table ever defined.
+ ID of a translation table is used to index this vector. */
+Lisp_Object Vtranslation_table_vector;
+
+/* A char-table for characters which may invoke auto-filling. */
+Lisp_Object Vauto_fill_chars;
+
+Lisp_Object Qauto_fill_chars;
+
+/* Char-table of information about which character to unify to which
+ Unicode character. */
+Lisp_Object Vchar_unify_table;
+
+/* A char-table. An element is non-nil iff the corresponding
+ character has a printable glyph. */
+Lisp_Object Vprintable_chars;
+
+/* A char-table. An elemnent is a column-width of the corresponding
+ character. */
+Lisp_Object Vchar_width_table;
+
+/* A char-table. An element is a symbol indicating the direction
+ property of corresponding character. */
+Lisp_Object Vchar_direction_table;
+
+/* Variable used locally in the macro FETCH_MULTIBYTE_CHAR. */
+unsigned char *_fetch_multibyte_char_p;
+
+/* Char table of scripts. */
+Lisp_Object Vchar_script_table;
+
+/* Alist of scripts vs representative characters. */
+Lisp_Object Vscript_representative_chars;
+
+static Lisp_Object Qchar_script_table;
+
+/* Mapping table from unibyte chars to multibyte chars. */
+int unibyte_to_multibyte_table[256];
+
+/* Nth element is 1 iff unibyte char N can be mapped to a multibyte
+ char. */
+char unibyte_has_multibyte_table[256];
+
+
+
+/* Store multibyte form of character C at P. If C has modifier bits,
+ handle them appropriately. */
+
+int
+char_string (c, p)
+ unsigned c;
+ unsigned char *p;
+{
+ int bytes;
+
+ if (c & CHAR_MODIFIER_MASK)
+ {
+ /* As an non-ASCII character can't have modifier bits, we just
+ ignore the bits. */
+ if (ASCII_CHAR_P ((c & ~CHAR_MODIFIER_MASK)))
+ {
+ /* For Meta, Shift, and Control modifiers, we need special care. */
+ if (c & CHAR_META)
+ {
+ /* Move the meta bit to the right place for a string. */
+ c = (c & ~CHAR_META) | 0x80;
+ }
+ if (c & CHAR_SHIFT)
+ {
+ /* Shift modifier is valid only with [A-Za-z]. */
+ if ((c & 0377) >= 'A' && (c & 0377) <= 'Z')
+ c &= ~CHAR_SHIFT;
+ else if ((c & 0377) >= 'a' && (c & 0377) <= 'z')
+ c = (c & ~CHAR_SHIFT) - ('a' - 'A');
+ }
+ if (c & CHAR_CTL)
+ {
+ /* Simulate the code in lread.c. */
+ /* Allow `\C- ' and `\C-?'. */
+ if (c == (CHAR_CTL | ' '))
+ c = 0;
+ else if (c == (CHAR_CTL | '?'))
+ c = 127;
+ /* ASCII control chars are made from letters (both cases),
+ as well as the non-letters within 0100...0137. */
+ else if ((c & 0137) >= 0101 && (c & 0137) <= 0132)
+ c &= (037 | (~0177 & ~CHAR_CTL));
+ else if ((c & 0177) >= 0100 && (c & 0177) <= 0137)
+ c &= (037 | (~0177 & ~CHAR_CTL));
+ }
+ }
+
+ /* If C still has any modifier bits, just ignore it. */
+ c &= ~CHAR_MODIFIER_MASK;
+ }
+
+ MAYBE_UNIFY_CHAR (c);
+
+ if (c <= MAX_3_BYTE_CHAR)
+ {
+ bytes = CHAR_STRING (c, p);
+ }
+ else if (c <= MAX_4_BYTE_CHAR)
+ {
+ p[0] = (0xF0 | (c >> 18));
+ p[1] = (0x80 | ((c >> 12) & 0x3F));
+ p[2] = (0x80 | ((c >> 6) & 0x3F));
+ p[3] = (0x80 | (c & 0x3F));
+ bytes = 4;
+ }
+ else if (c <= MAX_5_BYTE_CHAR)
+ {
+ p[0] = 0xF8;
+ p[1] = (0x80 | ((c >> 18) & 0x0F));
+ p[2] = (0x80 | ((c >> 12) & 0x3F));
+ p[3] = (0x80 | ((c >> 6) & 0x3F));
+ p[4] = (0x80 | (c & 0x3F));
+ bytes = 5;
+ }
+ else if (c <= MAX_CHAR)
+ {
+ c = CHAR_TO_BYTE8 (c);
+ bytes = BYTE8_STRING (c, p);
+ }
+ else
+ error ("Invalid character: %d", c);
+
+ return bytes;
+}
+
+
+/* Return a character whose multibyte form is at P. Set LEN is not
+ NULL, it must be a pointer to integer. In that case, set *LEN to
+ the byte length of the multibyte form. If ADVANCED is not NULL, is
+ must be a pointer to unsigned char. In that case, set *ADVANCED to
+ the ending address (i.e. the starting address of the next
+ character) of the multibyte form. */
+
+int
+string_char (p, advanced, len)
+ const unsigned char *p;
+ const unsigned char **advanced;
+ int *len;
+{
+ int c;
+ const unsigned char *saved_p = p;
+
+ if (*p < 0x80 || ! (*p & 0x20) || ! (*p & 0x10))
+ {
+ c = STRING_CHAR_ADVANCE (p);
+ }
+ else if (! (*p & 0x08))
+ {
+ c = ((((p)[0] & 0xF) << 18)
+ | (((p)[1] & 0x3F) << 12)
+ | (((p)[2] & 0x3F) << 6)
+ | ((p)[3] & 0x3F));
+ p += 4;
+ }
+ else
+ {
+ c = ((((p)[1] & 0x3F) << 18)
+ | (((p)[2] & 0x3F) << 12)
+ | (((p)[3] & 0x3F) << 6)
+ | ((p)[4] & 0x3F));
+ p += 5;
+ }
+
+ MAYBE_UNIFY_CHAR (c);
+
+ if (len)
+ *len = p - saved_p;
+ if (advanced)
+ *advanced = p;
+ return c;
+}
+
+
+/* Translate character C by translation table TABLE. If C is
+ negative, translate a character specified by CHARSET and CODE. If
+ no translation is found in TABLE, return the untranslated
+ character. If TABLE is a list, elements are char tables. In this
+ case, translace C by all tables. */
+
+int
+translate_char (table, c)
+ Lisp_Object table;
+ int c;
+{
+ if (CHAR_TABLE_P (table))
+ {
+ Lisp_Object ch;
+
+ ch = CHAR_TABLE_REF (table, c);
+ if (CHARACTERP (ch))
+ c = XINT (ch);
+ }
+ else
+ {
+ for (; CONSP (table); table = XCDR (table))
+ c = translate_char (XCAR (table), c);
+ }
+ return c;
+}
+
+/* Convert the multibyte character C to unibyte 8-bit character based
+ on the current value of charset_unibyte. If dimension of
+ charset_unibyte is more than one, return (C & 0xFF).
+
+ The argument REV_TBL is now ignored. It will be removed in the
+ future. */
+
+int
+multibyte_char_to_unibyte (c, rev_tbl)
+ int c;
+ Lisp_Object rev_tbl;
+{
+ struct charset *charset;
+ unsigned c1;
+
+ if (CHAR_BYTE8_P (c))
+ return CHAR_TO_BYTE8 (c);
+ charset = CHARSET_FROM_ID (charset_unibyte);
+ c1 = ENCODE_CHAR (charset, c);
+ return ((c1 != CHARSET_INVALID_CODE (charset)) ? c1 : c & 0xFF);
+}
+
+/* Like multibyte_char_to_unibyte, but return -1 if C is not supported
+ by charset_unibyte. */
+
+int
+multibyte_char_to_unibyte_safe (c)
+ int c;
+{
+ struct charset *charset;
+ unsigned c1;
+
+ if (CHAR_BYTE8_P (c))
+ return CHAR_TO_BYTE8 (c);
+ charset = CHARSET_FROM_ID (charset_unibyte);
+ c1 = ENCODE_CHAR (charset, c);
+ return ((c1 != CHARSET_INVALID_CODE (charset)) ? c1 : -1);
+}
+
+DEFUN ("characterp", Fcharacterp, Scharacterp, 1, 2, 0,
+ doc: /* Return non-nil if OBJECT is a character. */)
+ (object, ignore)
+ Lisp_Object object, ignore;
+{
+ return (CHARACTERP (object) ? Qt : Qnil);
+}
+
+DEFUN ("max-char", Fmax_char, Smax_char, 0, 0, 0,
+ doc: /* Return the character of the maximum code. */)
+ ()
+{
+ return make_number (MAX_CHAR);
+}
+
+DEFUN ("unibyte-char-to-multibyte", Funibyte_char_to_multibyte,
+ Sunibyte_char_to_multibyte, 1, 1, 0,
+ doc: /* Convert the unibyte character CH to multibyte character.
+The multibyte character is a result of decoding CH by
+the current unibyte charset (see `unibyte-charset'). */)
+ (ch)
+ Lisp_Object ch;
+{
+ int c;
+ struct charset *charset;
+
+ CHECK_CHARACTER (ch);
+ c = XFASTINT (ch);
+ if (c >= 0400)
+ error ("Invalid unibyte character: %d", c);
+ charset = CHARSET_FROM_ID (charset_unibyte);
+ c = DECODE_CHAR (charset, c);
+ if (c < 0)
+ c = BYTE8_TO_CHAR (XFASTINT (ch));
+ return make_number (c);
+}
+
+DEFUN ("multibyte-char-to-unibyte", Fmultibyte_char_to_unibyte,
+ Smultibyte_char_to_unibyte, 1, 1, 0,
+ doc: /* Convert the multibyte character CH to unibyte character.\n\
+The unibyte character is a result of encoding CH by
+the current primary charset (value of `charset-primary'). */)
+ (ch)
+ Lisp_Object ch;
+{
+ int c;
+
+ CHECK_CHARACTER (ch);
+ c = XFASTINT (ch);
+ c = CHAR_TO_BYTE8 (c);
+ return make_number (c);
+}
+
+DEFUN ("char-bytes", Fchar_bytes, Schar_bytes, 1, 1, 0,
+ doc: /* Return 1 regardless of the argument CHAR.
+This is now an obsolete function. We keep it just for backward compatibility. */)
+ (ch)
+ Lisp_Object ch;
+{
+ CHECK_CHARACTER (ch);
+ return make_number (1);
+}
+
+DEFUN ("char-width", Fchar_width, Schar_width, 1, 1, 0,
+ doc: /* Return width of CHAR when displayed in the current buffer.
+The width is measured by how many columns it occupies on the screen.
+Tab is taken to occupy `tab-width' columns. */)
+ (ch)
+ Lisp_Object ch;
+{
+ Lisp_Object disp;
+ int c, width;
+ struct Lisp_Char_Table *dp = buffer_display_table ();
+
+ CHECK_CHARACTER (ch);
+ c = XINT (ch);
+
+ /* Get the way the display table would display it. */
+ disp = dp ? DISP_CHAR_VECTOR (dp, c) : Qnil;
+
+ if (VECTORP (disp))
+ width = ASIZE (disp);
+ else
+ width = CHAR_WIDTH (c);
+
+ return make_number (width);
+}
+
+/* Return width of string STR of length LEN when displayed in the
+ current buffer. The width is measured by how many columns it
+ occupies on the screen. If PRECISION > 0, return the width of
+ longest substring that doesn't exceed PRECISION, and set number of
+ characters and bytes of the substring in *NCHARS and *NBYTES
+ respectively. */
+
+int
+c_string_width (str, len, precision, nchars, nbytes)
+ const unsigned char *str;
+ int precision, *nchars, *nbytes;
+{
+ int i = 0, i_byte = 0;
+ int width = 0;
+ struct Lisp_Char_Table *dp = buffer_display_table ();
+
+ while (i_byte < len)
+ {
+ int bytes, thiswidth;
+ Lisp_Object val;
+ int c = STRING_CHAR_AND_LENGTH (str + i_byte, len - i_byte, bytes);
+
+ if (dp)
+ {
+ val = DISP_CHAR_VECTOR (dp, c);
+ if (VECTORP (val))
+ thiswidth = XVECTOR (val)->size;
+ else
+ thiswidth = CHAR_WIDTH (c);
+ }
+ else
+ {
+ thiswidth = CHAR_WIDTH (c);
+ }
+
+ if (precision > 0
+ && (width + thiswidth > precision))
+ {
+ *nchars = i;
+ *nbytes = i_byte;
+ return width;
+ }
+ i++;
+ i_byte += bytes;
+ width += thiswidth;
+ }
+
+ if (precision > 0)
+ {
+ *nchars = i;
+ *nbytes = i_byte;
+ }
+
+ return width;
+}
+
+/* Return width of string STR of length LEN when displayed in the
+ current buffer. The width is measured by how many columns it
+ occupies on the screen. */
+
+int
+strwidth (str, len)
+ unsigned char *str;
+ int len;
+{
+ return c_string_width (str, len, -1, NULL, NULL);
+}
+
+/* Return width of Lisp string STRING when displayed in the current
+ buffer. The width is measured by how many columns it occupies on
+ the screen while paying attention to compositions. If PRECISION >
+ 0, return the width of longest substring that doesn't exceed
+ PRECISION, and set number of characters and bytes of the substring
+ in *NCHARS and *NBYTES respectively. */
+
+int
+lisp_string_width (string, precision, nchars, nbytes)
+ Lisp_Object string;
+ int precision, *nchars, *nbytes;
+{
+ int len = SCHARS (string);
+ /* This set multibyte to 0 even if STRING is multibyte when it
+ contains only ascii and eight-bit-graphic, but that's
+ intentional. */
+ int multibyte = len < SBYTES (string);
+ unsigned char *str = SDATA (string);
+ int i = 0, i_byte = 0;
+ int width = 0;
+ struct Lisp_Char_Table *dp = buffer_display_table ();
+
+ while (i < len)
+ {
+ int chars, bytes, thiswidth;
+ Lisp_Object val;
+ int cmp_id;
+ EMACS_INT ignore, end;
+
+ if (find_composition (i, -1, &ignore, &end, &val, string)
+ && ((cmp_id = get_composition_id (i, i_byte, end - i, val, string))
+ >= 0))
+ {
+ thiswidth = composition_table[cmp_id]->width;
+ chars = end - i;
+ bytes = string_char_to_byte (string, end) - i_byte;
+ }
+ else
+ {
+ int c;
+
+ if (multibyte)
+ c = STRING_CHAR_AND_LENGTH (str + i_byte, len - i_byte, bytes);
+ else
+ c = str[i_byte], bytes = 1;
+ chars = 1;
+ if (dp)
+ {
+ val = DISP_CHAR_VECTOR (dp, c);
+ if (VECTORP (val))
+ thiswidth = XVECTOR (val)->size;
+ else
+ thiswidth = CHAR_WIDTH (c);
+ }
+ else
+ {
+ thiswidth = CHAR_WIDTH (c);
+ }
+ }
+
+ if (precision > 0
+ && (width + thiswidth > precision))
+ {
+ *nchars = i;
+ *nbytes = i_byte;
+ return width;
+ }
+ i += chars;
+ i_byte += bytes;
+ width += thiswidth;
+ }
+
+ if (precision > 0)
+ {
+ *nchars = i;
+ *nbytes = i_byte;
+ }
+
+ return width;
+}
+
+DEFUN ("string-width", Fstring_width, Sstring_width, 1, 1, 0,
+ doc: /* Return width of STRING when displayed in the current buffer.
+Width is measured by how many columns it occupies on the screen.
+When calculating width of a multibyte character in STRING,
+only the base leading-code is considered; the validity of
+the following bytes is not checked. Tabs in STRING are always
+taken to occupy `tab-width' columns. */)
+ (str)
+ Lisp_Object str;
+{
+ Lisp_Object val;
+
+ CHECK_STRING (str);
+ XSETFASTINT (val, lisp_string_width (str, -1, NULL, NULL));
+ return val;
+}
+
+DEFUN ("char-direction", Fchar_direction, Schar_direction, 1, 1, 0,
+ doc: /* Return the direction of CHAR.
+The returned value is 0 for left-to-right and 1 for right-to-left. */)
+ (ch)
+ Lisp_Object ch;
+{
+ int c;
+
+ CHECK_CHARACTER (ch);
+ c = XINT (ch);
+ return CHAR_TABLE_REF (Vchar_direction_table, c);
+}
+
+/* Return the number of characters in the NBYTES bytes at PTR.
+ This works by looking at the contents and checking for multibyte
+ sequences while assuming that there's no invalid sequence.
+ However, if the current buffer has enable-multibyte-characters =
+ nil, we treat each byte as a character. */
+
+int
+chars_in_text (ptr, nbytes)
+ const unsigned char *ptr;
+ int nbytes;
+{
+ /* current_buffer is null at early stages of Emacs initialization. */
+ if (current_buffer == 0
+ || NILP (current_buffer->enable_multibyte_characters))
+ return nbytes;
+
+ return multibyte_chars_in_text (ptr, nbytes);
+}
+
+/* Return the number of characters in the NBYTES bytes at PTR.
+ This works by looking at the contents and checking for multibyte
+ sequences while assuming that there's no invalid sequence. It
+ ignores enable-multibyte-characters. */
+
+int
+multibyte_chars_in_text (ptr, nbytes)
+ const unsigned char *ptr;
+ int nbytes;
+{
+ const unsigned char *endp = ptr + nbytes;
+ int chars = 0;
+
+ while (ptr < endp)
+ {
+ int len = MULTIBYTE_LENGTH (ptr, endp);
+
+ if (len == 0)
+ abort ();
+ ptr += len;
+ chars++;
+ }
+
+ return chars;
+}
+
+/* Parse unibyte text at STR of LEN bytes as a multibyte text, count
+ characters and bytes in it, and store them in *NCHARS and *NBYTES
+ respectively. On counting bytes, pay attention to that 8-bit
+ characters not constructing a valid multibyte sequence are
+ represented by 2-byte in a multibyte text. */
+
+void
+parse_str_as_multibyte (str, len, nchars, nbytes)
+ const unsigned char *str;
+ int len, *nchars, *nbytes;
+{
+ const unsigned char *endp = str + len;
+ int n, chars = 0, bytes = 0;
+
+ if (len >= MAX_MULTIBYTE_LENGTH)
+ {
+ const unsigned char *adjusted_endp = endp - MAX_MULTIBYTE_LENGTH;
+ while (str < adjusted_endp)
+ {
+ if ((n = MULTIBYTE_LENGTH_NO_CHECK (str)) > 0)
+ str += n, bytes += n;
+ else
+ str++, bytes += 2;
+ chars++;
+ }
+ }
+ while (str < endp)
+ {
+ if ((n = MULTIBYTE_LENGTH (str, endp)) > 0)
+ str += n, bytes += n;
+ else
+ str++, bytes += 2;
+ chars++;
+ }
+
+ *nchars = chars;
+ *nbytes = bytes;
+ return;
+}
+
+/* Arrange unibyte text at STR of NBYTES bytes as a multibyte text.
+ It actually converts only such 8-bit characters that don't contruct
+ a multibyte sequence to multibyte forms of Latin-1 characters. If
+ NCHARS is nonzero, set *NCHARS to the number of characters in the
+ text. It is assured that we can use LEN bytes at STR as a work
+ area and that is enough. Return the number of bytes of the
+ resulting text. */
+
+int
+str_as_multibyte (str, len, nbytes, nchars)
+ unsigned char *str;
+ int len, nbytes, *nchars;
+{
+ unsigned char *p = str, *endp = str + nbytes;
+ unsigned char *to;
+ int chars = 0;
+ int n;
+
+ if (nbytes >= MAX_MULTIBYTE_LENGTH)
+ {
+ unsigned char *adjusted_endp = endp - MAX_MULTIBYTE_LENGTH;
+ while (p < adjusted_endp
+ && (n = MULTIBYTE_LENGTH_NO_CHECK (p)) > 0)
+ p += n, chars++;
+ }
+ while ((n = MULTIBYTE_LENGTH (p, endp)) > 0)
+ p += n, chars++;
+ if (nchars)
+ *nchars = chars;
+ if (p == endp)
+ return nbytes;
+
+ to = p;
+ nbytes = endp - p;
+ endp = str + len;
+ safe_bcopy ((char *) p, (char *) (endp - nbytes), nbytes);
+ p = endp - nbytes;
+
+ if (nbytes >= MAX_MULTIBYTE_LENGTH)
+ {
+ unsigned char *adjusted_endp = endp - MAX_MULTIBYTE_LENGTH;
+ while (p < adjusted_endp)
+ {
+ if ((n = MULTIBYTE_LENGTH_NO_CHECK (p)) > 0)
+ {
+ while (n--)
+ *to++ = *p++;
+ }
+ else
+ {
+ int c = *p++;
+ c = BYTE8_TO_CHAR (c);
+ to += CHAR_STRING (c, to);
+ }
+ }
+ chars++;
+ }
+ while (p < endp)
+ {
+ if ((n = MULTIBYTE_LENGTH (p, endp)) > 0)
+ {
+ while (n--)
+ *to++ = *p++;
+ }
+ else
+ {
+ int c = *p++;
+ c = BYTE8_TO_CHAR (c);
+ to += CHAR_STRING (c, to);
+ }
+ chars++;
+ }
+ if (nchars)
+ *nchars = chars;
+ return (to - str);
+}
+
+/* Parse unibyte string at STR of LEN bytes, and return the number of
+ bytes it may ocupy when converted to multibyte string by
+ `str_to_multibyte'. */
+
+int
+parse_str_to_multibyte (str, len)
+ unsigned char *str;
+ int len;
+{
+ unsigned char *endp = str + len;
+ int bytes;
+
+ for (bytes = 0; str < endp; str++)
+ bytes += (*str < 0x80) ? 1 : 2;
+ return bytes;
+}
+
+
+/* Convert unibyte text at STR of NBYTES bytes to a multibyte text
+ that contains the same single-byte characters. It actually
+ converts all 8-bit characters to multibyte forms. It is assured
+ that we can use LEN bytes at STR as a work area and that is
+ enough. */
+
+int
+str_to_multibyte (str, len, bytes)
+ unsigned char *str;
+ int len, bytes;
+{
+ unsigned char *p = str, *endp = str + bytes;
+ unsigned char *to;
+
+ while (p < endp && *p < 0x80) p++;
+ if (p == endp)
+ return bytes;
+ to = p;
+ bytes = endp - p;
+ endp = str + len;
+ safe_bcopy ((char *) p, (char *) (endp - bytes), bytes);
+ p = endp - bytes;
+ while (p < endp)
+ {
+ int c = *p++;
+
+ if (c >= 0x80)
+ c = BYTE8_TO_CHAR (c);
+ to += CHAR_STRING (c, to);
+ }
+ return (to - str);
+}
+
+/* Arrange multibyte text at STR of LEN bytes as a unibyte text. It
+ actually converts characters in the range 0x80..0xFF to
+ unibyte. */
+
+int
+str_as_unibyte (str, bytes)
+ unsigned char *str;
+ int bytes;
+{
+ const unsigned char *p = str, *endp = str + bytes;
+ unsigned char *to;
+ int c, len;
+
+ while (p < endp)
+ {
+ c = *p;
+ len = BYTES_BY_CHAR_HEAD (c);
+ if (CHAR_BYTE8_HEAD_P (c))
+ break;
+ p += len;
+ }
+ to = str + (p - str);
+ while (p < endp)
+ {
+ c = *p;
+ len = BYTES_BY_CHAR_HEAD (c);
+ if (CHAR_BYTE8_HEAD_P (c))
+ {
+ c = STRING_CHAR_ADVANCE (p);
+ *to++ = CHAR_TO_BYTE8 (c);
+ }
+ else
+ {
+ while (len--) *to++ = *p++;
+ }
+ }
+ return (to - str);
+}
+
+int
+string_count_byte8 (string)
+ Lisp_Object string;
+{
+ int multibyte = STRING_MULTIBYTE (string);
+ int nbytes = SBYTES (string);
+ unsigned char *p = SDATA (string);
+ unsigned char *pend = p + nbytes;
+ int count = 0;
+ int c, len;
+
+ if (multibyte)
+ while (p < pend)
+ {
+ c = *p;
+ len = BYTES_BY_CHAR_HEAD (c);
+
+ if (CHAR_BYTE8_HEAD_P (c))
+ count++;
+ p += len;
+ }
+ else
+ while (p < pend)
+ {
+ if (*p++ >= 0x80)
+ count++;
+ }
+ return count;
+}
+
+
+Lisp_Object
+string_escape_byte8 (string)
+ Lisp_Object string;
+{
+ int nchars = SCHARS (string);
+ int nbytes = SBYTES (string);
+ int multibyte = STRING_MULTIBYTE (string);
+ int byte8_count;
+ const unsigned char *src, *src_end;
+ unsigned char *dst;
+ Lisp_Object val;
+ int c, len;
+
+ if (multibyte && nchars == nbytes)
+ return string;
+
+ byte8_count = string_count_byte8 (string);
+
+ if (byte8_count == 0)
+ return string;
+
+ if (multibyte)
+ /* Convert 2-byte sequence of byte8 chars to 4-byte octal. */
+ val = make_uninit_multibyte_string (nchars + byte8_count * 3,
+ nbytes + byte8_count * 2);
+ else
+ /* Convert 1-byte sequence of byte8 chars to 4-byte octal. */
+ val = make_uninit_string (nbytes + byte8_count * 3);
+
+ src = SDATA (string);
+ src_end = src + nbytes;
+ dst = SDATA (val);
+ if (multibyte)
+ while (src < src_end)
+ {
+ c = *src;
+ len = BYTES_BY_CHAR_HEAD (c);
+
+ if (CHAR_BYTE8_HEAD_P (c))
+ {
+ c = STRING_CHAR_ADVANCE (src);
+ c = CHAR_TO_BYTE8 (c);
+ sprintf ((char *) dst, "\\%03o", c);
+ dst += 4;
+ }
+ else
+ while (len--) *dst++ = *src++;
+ }
+ else
+ while (src < src_end)
+ {
+ c = *src++;
+ if (c >= 0x80)
+ {
+ sprintf ((char *) dst, "\\%03o", c);
+ dst += 4;
+ }
+ else
+ *dst++ = c;
+ }
+ return val;
+}
+
+
+DEFUN ("string", Fstring, Sstring, 0, MANY, 0,
+ doc: /*
+Concatenate all the argument characters and make the result a string.
+usage: (string &rest CHARACTERS) */)
+ (n, args)
+ int n;
+ Lisp_Object *args;
+{
+ int i;
+ unsigned char *buf = (unsigned char *) alloca (MAX_MULTIBYTE_LENGTH * n);
+ unsigned char *p = buf;
+ int c;
+
+ for (i = 0; i < n; i++)
+ {
+ CHECK_CHARACTER (args[i]);
+ c = XINT (args[i]);
+ p += CHAR_STRING (c, p);
+ }
+
+ return make_string_from_bytes ((char *) buf, n, p - buf);
+}
+
+DEFUN ("unibyte-string", Funibyte_string, Sunibyte_string, 0, MANY, 0,
+ doc: /* Concatenate all the argument bytes and make the result a unibyte string.
+usage: (unibyte-string &rest BYTES) */)
+ (n, args)
+ int n;
+ Lisp_Object *args;
+{
+ int i;
+ unsigned char *buf = (unsigned char *) alloca (n);
+ unsigned char *p = buf;
+ unsigned c;
+
+ for (i = 0; i < n; i++)
+ {
+ CHECK_NATNUM (args[i]);
+ c = XFASTINT (args[i]);
+ if (c >= 256)
+ args_out_of_range_3 (args[i], make_number (0), make_number (255));
+ *p++ = c;
+ }
+
+ return make_string_from_bytes ((char *) buf, n, p - buf);
+}
+
+void
+init_character_once ()
+{
+}
+
+#ifdef emacs
+
+void
+syms_of_character ()
+{
+ DEFSYM (Qcharacterp, "characterp");
+ DEFSYM (Qauto_fill_chars, "auto-fill-chars");
+
+ staticpro (&Vchar_unify_table);
+ Vchar_unify_table = Qnil;
+
+ defsubr (&Smax_char);
+ defsubr (&Scharacterp);
+ defsubr (&Sunibyte_char_to_multibyte);
+ defsubr (&Smultibyte_char_to_unibyte);
+ defsubr (&Schar_bytes);
+ defsubr (&Schar_width);
+ defsubr (&Sstring_width);
+ defsubr (&Schar_direction);
+ defsubr (&Sstring);
+ defsubr (&Sunibyte_string);
+
+ DEFVAR_LISP ("translation-table-vector", &Vtranslation_table_vector,
+ doc: /*
+Vector recording all translation tables ever defined.
+Each element is a pair (SYMBOL . TABLE) relating the table to the
+symbol naming it. The ID of a translation table is an index into this vector. */);
+ Vtranslation_table_vector = Fmake_vector (make_number (16), Qnil);
+
+ DEFVAR_LISP ("auto-fill-chars", &Vauto_fill_chars,
+ doc: /*
+A char-table for characters which invoke auto-filling.
+Such characters have value t in this table. */);
+ Vauto_fill_chars = Fmake_char_table (Qauto_fill_chars, Qnil);
+ CHAR_TABLE_SET (Vauto_fill_chars, ' ', Qt);
+ CHAR_TABLE_SET (Vauto_fill_chars, '\n', Qt);
+
+ DEFVAR_LISP ("char-width-table", &Vchar_width_table,
+ doc: /*
+A char-table for width (columns) of each character. */);
+ Vchar_width_table = Fmake_char_table (Qnil, make_number (1));
+ char_table_set_range (Vchar_width_table, 0x80, 0x9F, make_number (4));
+ char_table_set_range (Vchar_width_table, MAX_5_BYTE_CHAR + 1, MAX_CHAR,
+ make_number (4));
+
+ DEFVAR_LISP ("char-direction-table", &Vchar_direction_table,
+ doc: /* A char-table for direction of each character. */);
+ Vchar_direction_table = Fmake_char_table (Qnil, make_number (1));
+
+ DEFVAR_LISP ("printable-chars", &Vprintable_chars,
+ doc: /* A char-table for each printable character. */);
+ Vprintable_chars = Fmake_char_table (Qnil, Qnil);
+ Fset_char_table_range (Vprintable_chars,
+ Fcons (make_number (32), make_number (126)), Qt);
+ Fset_char_table_range (Vprintable_chars,
+ Fcons (make_number (160),
+ make_number (MAX_5_BYTE_CHAR)), Qt);
+
+ DEFVAR_LISP ("char-script-table", &Vchar_script_table,
+ doc: /* Char table of script symbols.
+It has one extra slot whose value is a list of script symbols. */);
+
+ /* Intern this now in case it isn't already done.
+ Setting this variable twice is harmless.
+ But don't staticpro it here--that is done in alloc.c. */
+ Qchar_table_extra_slots = intern ("char-table-extra-slots");
+ DEFSYM (Qchar_script_table, "char-script-table");
+ Fput (Qchar_script_table, Qchar_table_extra_slots, make_number (1));
+ Vchar_script_table = Fmake_char_table (Qchar_script_table, Qnil);
+
+ DEFVAR_LISP ("script-representative-chars", &Vscript_representative_chars,
+ doc: /* Alist of scripts vs the representative characters. */);
+ Vscript_representative_chars = Qnil;
+}
+
+#endif /* emacs */
+
+/* arch-tag: b6665960-3c3d-4184-85cd-af4318197999
+ (do not change this comment) */
diff --git a/src/character.h b/src/character.h
new file mode 100644
index 0000000000..1e4a120e03
--- /dev/null
+++ b/src/character.h
@@ -0,0 +1,667 @@
+/* Header for multibyte character handler.
+ Copyright (C) 1995, 1997, 1998 Electrotechnical Laboratory, JAPAN.
+ Licensed to the Free Software Foundation.
+ Copyright (C) 2003, 2006
+ National Institute of Advanced Industrial Science and Technology (AIST)
+ Registration Number H13PRO009
+
+This file is part of GNU Emacs.
+
+GNU Emacs is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Emacs is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Emacs; see the file COPYING. If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+#ifndef EMACS_CHARACTER_H
+#define EMACS_CHARACTER_H
+
+/* character code 1st byte byte sequence
+ -------------- -------- -------------
+ 0-7F 00..7F 0xxxxxxx
+ 80-7FF C2..DF 110xxxxx 10xxxxxx
+ 800-FFFF E0..EF 1110xxxx 10xxxxxx 10xxxxxx
+ 10000-1FFFFF F0..F7 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
+ 200000-3FFF7F F8 11111000 1000xxxx 10xxxxxx 10xxxxxx 10xxxxxx
+ 3FFF80-3FFFFF C0..C1 1100000x 10xxxxxx (for eight-bit-char)
+ 400000-... invalid
+
+ invalid 1st byte 80..BF 10xxxxxx
+ F9..FF 11111xxx (xxx != 000)
+*/
+
+/* Maximum character code ((1 << CHARACTERBITS) - 1). */
+#define MAX_CHAR 0x3FFFFF
+
+/* Maximum Unicode character code. */
+#define MAX_UNICODE_CHAR 0x10FFFF
+
+/* Maximum N-byte character codes. */
+#define MAX_1_BYTE_CHAR 0x7F
+#define MAX_2_BYTE_CHAR 0x7FF
+#define MAX_3_BYTE_CHAR 0xFFFF
+#define MAX_4_BYTE_CHAR 0x1FFFFF
+#define MAX_5_BYTE_CHAR 0x3FFF7F
+
+/* Minimum leading code of multibyte characters. */
+#define MIN_MULTIBYTE_LEADING_CODE 0xC0
+/* Maximum leading code of multibyte characters. */
+#define MAX_MULTIBYTE_LEADING_CODE 0xF8
+
+/* Nonzero iff C is a character that corresponds to a raw 8-bit
+ byte. */
+#define CHAR_BYTE8_P(c) ((c) > MAX_5_BYTE_CHAR)
+
+/* Return the character code for raw 8-bit byte BYTE. */
+#define BYTE8_TO_CHAR(byte) ((byte) + 0x3FFF00)
+
+/* Return the raw 8-bit byte for character C. */
+#define CHAR_TO_BYTE8(c) \
+ (CHAR_BYTE8_P (c) \
+ ? (c) - 0x3FFF00 \
+ : multibyte_char_to_unibyte (c, Qnil))
+
+/* Nonzero iff BYTE is the 1st byte of a multibyte form of a character
+ that corresponds to a raw 8-bit byte. */
+#define CHAR_BYTE8_HEAD_P(byte) ((byte) == 0xC0 || (byte) == 0xC1)
+
+/* Mapping table from unibyte chars to multibyte chars. */
+extern int unibyte_to_multibyte_table[256];
+
+/* Convert the unibyte character C to the corresponding multibyte
+ character. If C can't be converted, return C. */
+#define unibyte_char_to_multibyte(c) \
+ ((c) < 256 ? unibyte_to_multibyte_table[(c)] : (c))
+
+/* Nth element is 1 iff unibyte char N can be mapped to a multibyte
+ char. */
+extern char unibyte_has_multibyte_table[256];
+
+#define UNIBYTE_CHAR_HAS_MULTIBYTE_P(c) (unibyte_has_multibyte_table[(c)])
+
+/* If C is not ASCII, make it unibyte. */
+#define MAKE_CHAR_UNIBYTE(c) \
+ do { \
+ if (! ASCII_CHAR_P (c)) \
+ c = CHAR_TO_BYTE8 (c); \
+ } while (0)
+
+
+/* If C is not ASCII, make it multibyte. It assumes C < 256. */
+#define MAKE_CHAR_MULTIBYTE(c) ((c) = unibyte_to_multibyte_table[(c)])
+
+/* This is the maximum byte length of multibyte form. */
+#define MAX_MULTIBYTE_LENGTH 5
+
+/* Return a Lisp character whose character code is C. It assumes C is
+ a valid character code. */
+#define make_char(c) make_number (c)
+
+/* Nonzero iff C is an ASCII byte. */
+#define ASCII_BYTE_P(c) ((unsigned) (c) < 0x80)
+
+/* Nonzero iff X is a character. */
+#define CHARACTERP(x) (NATNUMP (x) && XFASTINT (x) <= MAX_CHAR)
+
+/* Nonzero iff C is valid as a character code. GENERICP is not used
+ now. */
+#define CHAR_VALID_P(c, genericp) ((unsigned) (c) <= MAX_CHAR)
+
+/* Check if Lisp object X is a character or not. */
+#define CHECK_CHARACTER(x) \
+ CHECK_TYPE (CHARACTERP (x), Qcharacterp, x)
+
+#define CHECK_CHARACTER_CAR(x) \
+ do { \
+ Lisp_Object tmp = XCAR (x); \
+ CHECK_CHARACTER (tmp); \
+ XSETCAR ((x), tmp); \
+ } while (0)
+
+#define CHECK_CHARACTER_CDR(x) \
+ do { \
+ Lisp_Object tmp = XCDR (x); \
+ CHECK_CHARACTER (tmp); \
+ XSETCDR ((x), tmp); \
+ } while (0)
+
+/* Nonzero iff C is an ASCII character. */
+#define ASCII_CHAR_P(c) ((unsigned) (c) < 0x80)
+
+/* Nonzero iff C is a character of code less than 0x100. */
+#define SINGLE_BYTE_CHAR_P(c) ((unsigned) (c) < 0x100)
+
+/* Nonzero if character C has a printable glyph. */
+#define CHAR_PRINTABLE_P(c) \
+ (((c) >= 32 && ((c) < 127) \
+ || ! NILP (CHAR_TABLE_REF (Vprintable_chars, (c)))))
+
+/* Return byte length of multibyte form for character C. */
+#define CHAR_BYTES(c) \
+ ( (c) <= MAX_1_BYTE_CHAR ? 1 \
+ : (c) <= MAX_2_BYTE_CHAR ? 2 \
+ : (c) <= MAX_3_BYTE_CHAR ? 3 \
+ : (c) <= MAX_4_BYTE_CHAR ? 4 \
+ : (c) <= MAX_5_BYTE_CHAR ? 5 \
+ : 2)
+
+
+/* Return the leading code of multibyte form of C. */
+#define CHAR_LEADING_CODE(c) \
+ ((c) <= MAX_1_BYTE_CHAR ? c \
+ : (c) <= MAX_2_BYTE_CHAR ? (0xC0 | ((c) >> 6)) \
+ : (c) <= MAX_3_BYTE_CHAR ? (0xE0 | ((c) >> 12)) \
+ : (c) <= MAX_4_BYTE_CHAR ? (0xF0 | ((c) >> 18)) \
+ : (c) <= MAX_5_BYTE_CHAR ? 0xF8 \
+ : (0xC0 | (((c) >> 6) & 0x01)))
+
+
+/* Store multibyte form of the character C in P. The caller should
+ allocate at least MAX_MULTIBYTE_LENGTH bytes area at P in advance.
+ Returns the length of the multibyte form. */
+
+#define CHAR_STRING(c, p) \
+ ((unsigned) (c) <= MAX_1_BYTE_CHAR \
+ ? ((p)[0] = (c), \
+ 1) \
+ : (unsigned) (c) <= MAX_2_BYTE_CHAR \
+ ? ((p)[0] = (0xC0 | ((c) >> 6)), \
+ (p)[1] = (0x80 | ((c) & 0x3F)), \
+ 2) \
+ : (unsigned) (c) <= MAX_3_BYTE_CHAR \
+ ? ((p)[0] = (0xE0 | ((c) >> 12)), \
+ (p)[1] = (0x80 | (((c) >> 6) & 0x3F)), \
+ (p)[2] = (0x80 | ((c) & 0x3F)), \
+ 3) \
+ : char_string ((unsigned) c, p))
+
+/* Store multibyte form of byte B in P. The caller should allocate at
+ least MAX_MULTIBYTE_LENGTH bytes area at P in advance. Returns the
+ length of the multibyte form. */
+
+#define BYTE8_STRING(b, p) \
+ ((p)[0] = (0xC0 | (((b) >> 6) & 0x01)), \
+ (p)[1] = (0x80 | ((b) & 0x3F)), \
+ 2)
+
+
+/* Store multibyte form of the character C in P. The caller should
+ allocate at least MAX_MULTIBYTE_LENGTH bytes area at P in advance.
+ And, advance P to the end of the multibyte form. */
+
+#define CHAR_STRING_ADVANCE(c, p) \
+ do { \
+ if ((c) <= MAX_1_BYTE_CHAR) \
+ *(p)++ = (c); \
+ else if ((c) <= MAX_2_BYTE_CHAR) \
+ *(p)++ = (0xC0 | ((c) >> 6)), \
+ *(p)++ = (0x80 | ((c) & 0x3F)); \
+ else if ((c) <= MAX_3_BYTE_CHAR) \
+ *(p)++ = (0xE0 | ((c) >> 12)), \
+ *(p)++ = (0x80 | (((c) >> 6) & 0x3F)), \
+ *(p)++ = (0x80 | ((c) & 0x3F)); \
+ else \
+ (p) += char_string ((c), (p)); \
+ } while (0)
+
+
+/* Nonzero iff BYTE starts a non-ASCII character in a multibyte
+ form. */
+#define LEADING_CODE_P(byte) (((byte) & 0xC0) == 0xC0)
+
+/* Nonzero iff BYTE is a trailing code of a non-ASCII character in a
+ multibyte form. */
+#define TRAILING_CODE_P(byte) (((byte) & 0xC0) == 0x80)
+
+/* Nonzero iff BYTE starts a character in a multibyte form.
+ This is equivalent to:
+ (ASCII_BYTE_P (byte) || LEADING_CODE_P (byte)) */
+#define CHAR_HEAD_P(byte) (((byte) & 0xC0) != 0x80)
+
+/* Just kept for backward compatibility. This macro will be removed
+ in the future. */
+#define BASE_LEADING_CODE_P LEADING_CODE_P
+
+/* How many bytes a character that starts with BYTE occupies in a
+ multibyte form. */
+#define BYTES_BY_CHAR_HEAD(byte) \
+ (!((byte) & 0x80) ? 1 \
+ : !((byte) & 0x20) ? 2 \
+ : !((byte) & 0x10) ? 3 \
+ : !((byte) & 0x08) ? 4 \
+ : 5)
+
+
+/* Return the length of the multi-byte form at string STR of length
+ LEN while assuming that STR points a valid multi-byte form. As
+ this macro isn't necessary anymore, all callers will be changed to
+ use BYTES_BY_CHAR_HEAD directly in the future. */
+
+#define MULTIBYTE_FORM_LENGTH(str, len) \
+ BYTES_BY_CHAR_HEAD (*(str))
+
+/* Parse multibyte string STR of length LENGTH and set BYTES to the
+ byte length of a character at STR while assuming that STR points a
+ valid multibyte form. As this macro isn't necessary anymore, all
+ callers will be changed to use BYTES_BY_CHAR_HEAD directly in the
+ future. */
+
+#define PARSE_MULTIBYTE_SEQ(str, length, bytes) \
+ (bytes) = BYTES_BY_CHAR_HEAD (*(str))
+
+/* The byte length of multibyte form at unibyte string P ending at
+ PEND. If STR doesn't point a valid multibyte form, return 0. */
+
+#define MULTIBYTE_LENGTH(p, pend) \
+ (p >= pend ? 0 \
+ : !((p)[0] & 0x80) ? 1 \
+ : ((p + 1 >= pend) || (((p)[1] & 0xC0) != 0x80)) ? 0 \
+ : ((p)[0] & 0xE0) == 0xC0 ? 2 \
+ : ((p + 2 >= pend) || (((p)[2] & 0xC0) != 0x80)) ? 0 \
+ : ((p)[0] & 0xF0) == 0xE0 ? 3 \
+ : ((p + 3 >= pend) || (((p)[3] & 0xC0) != 0x80)) ? 0 \
+ : ((p)[0] & 0xF8) == 0xF0 ? 4 \
+ : ((p + 4 >= pend) || (((p)[4] & 0xC0) != 0x80)) ? 0 \
+ : (p)[0] == 0xF8 && ((p)[1] & 0xF0) == 0x80 ? 5 \
+ : 0)
+
+
+/* Like MULTIBYTE_LENGTH but don't check the ending address. */
+
+#define MULTIBYTE_LENGTH_NO_CHECK(p) \
+ (!((p)[0] & 0x80) ? 1 \
+ : ((p)[1] & 0xC0) != 0x80 ? 0 \
+ : ((p)[0] & 0xE0) == 0xC0 ? 2 \
+ : ((p)[2] & 0xC0) != 0x80 ? 0 \
+ : ((p)[0] & 0xF0) == 0xE0 ? 3 \
+ : ((p)[3] & 0xC0) != 0x80 ? 0 \
+ : ((p)[0] & 0xF8) == 0xF0 ? 4 \
+ : ((p)[4] & 0xC0) != 0x80 ? 0 \
+ : (p)[0] == 0xF8 && ((p)[1] & 0xF0) == 0x80 ? 5 \
+ : 0)
+
+/* If P is before LIMIT, advance P to the next character boundary. It
+ assumes that P is already at a character boundary of the sane
+ mulitbyte form whose end address is LIMIT. */
+
+#define NEXT_CHAR_BOUNDARY(p, limit) \
+ do { \
+ if ((p) < (limit)) \
+ (p) += BYTES_BY_CHAR_HEAD (*(p)); \
+ } while (0)
+
+
+/* If P is after LIMIT, advance P to the previous character boundary.
+ It assumes that P is already at a character boundary of the sane
+ mulitbyte form whose beginning address is LIMIT. */
+
+#define PREV_CHAR_BOUNDARY(p, limit) \
+ do { \
+ if ((p) > (limit)) \
+ { \
+ const unsigned char *p0 = (p); \
+ do { \
+ p0--; \
+ } while (p0 >= limit && ! CHAR_HEAD_P (*p0)); \
+ (p) = (BYTES_BY_CHAR_HEAD (*p0) == (p) - p0) ? p0 : (p) - 1; \
+ } \
+ } while (0)
+
+/* Return the character code of character whose multibyte form is at
+ P. The argument LEN is ignored. It will be removed in the
+ future. */
+
+#define STRING_CHAR(p, len) \
+ (!((p)[0] & 0x80) \
+ ? (p)[0] \
+ : ! ((p)[0] & 0x20) \
+ ? (((((p)[0] & 0x1F) << 6) \
+ | ((p)[1] & 0x3F)) \
+ + (((unsigned char) (p)[0]) < 0xC2 ? 0x3FFF80 : 0)) \
+ : ! ((p)[0] & 0x10) \
+ ? ((((p)[0] & 0x0F) << 12) \
+ | (((p)[1] & 0x3F) << 6) \
+ | ((p)[2] & 0x3F)) \
+ : string_char ((p), NULL, NULL))
+
+
+/* Like STRING_CHAR but set ACTUAL_LEN to the length of multibyte
+ form. The argument LEN is ignored. It will be removed in the
+ future. */
+
+#define STRING_CHAR_AND_LENGTH(p, len, actual_len) \
+ (!((p)[0] & 0x80) \
+ ? ((actual_len) = 1, (p)[0]) \
+ : ! ((p)[0] & 0x20) \
+ ? ((actual_len) = 2, \
+ (((((p)[0] & 0x1F) << 6) \
+ | ((p)[1] & 0x3F)) \
+ + (((unsigned char) (p)[0]) < 0xC2 ? 0x3FFF80 : 0))) \
+ : ! ((p)[0] & 0x10) \
+ ? ((actual_len) = 3, \
+ ((((p)[0] & 0x0F) << 12) \
+ | (((p)[1] & 0x3F) << 6) \
+ | ((p)[2] & 0x3F))) \
+ : string_char ((p), NULL, &actual_len))
+
+
+/* Like STRING_CHAR but advance P to the end of multibyte form. */
+
+#define STRING_CHAR_ADVANCE(p) \
+ (!((p)[0] & 0x80) \
+ ? *(p)++ \
+ : ! ((p)[0] & 0x20) \
+ ? ((p) += 2, \
+ ((((p)[-2] & 0x1F) << 6) \
+ | ((p)[-1] & 0x3F) \
+ | ((unsigned char) ((p)[-2]) < 0xC2 ? 0x3FFF80 : 0))) \
+ : ! ((p)[0] & 0x10) \
+ ? ((p) += 3, \
+ ((((p)[-3] & 0x0F) << 12) \
+ | (((p)[-2] & 0x3F) << 6) \
+ | ((p)[-1] & 0x3F))) \
+ : string_char ((p), &(p), NULL))
+
+
+/* Fetch the "next" character from Lisp string STRING at byte position
+ BYTEIDX, character position CHARIDX. Store it into OUTPUT.
+
+ All the args must be side-effect-free.
+ BYTEIDX and CHARIDX must be lvalues;
+ we increment them past the character fetched. */
+
+#define FETCH_STRING_CHAR_ADVANCE(OUTPUT, STRING, CHARIDX, BYTEIDX) \
+ if (1) \
+ { \
+ CHARIDX++; \
+ if (STRING_MULTIBYTE (STRING)) \
+ { \
+ unsigned char *ptr = &XSTRING (STRING)->data[BYTEIDX]; \
+ int len; \
+ \
+ OUTPUT = STRING_CHAR_AND_LENGTH (ptr, 0, len); \
+ BYTEIDX += len; \
+ } \
+ else \
+ OUTPUT = XSTRING (STRING)->data[BYTEIDX++]; \
+ } \
+ else
+
+/* Like FETCH_STRING_CHAR_ADVANCE but return a multibyte character eve
+ if STRING is unibyte. */
+
+#define FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE(OUTPUT, STRING, CHARIDX, BYTEIDX) \
+ if (1) \
+ { \
+ CHARIDX++; \
+ if (STRING_MULTIBYTE (STRING)) \
+ { \
+ unsigned char *ptr = &XSTRING (STRING)->data[BYTEIDX]; \
+ int len; \
+ \
+ OUTPUT = STRING_CHAR_AND_LENGTH (ptr, 0, len); \
+ BYTEIDX += len; \
+ } \
+ else \
+ { \
+ OUTPUT = XSTRING (STRING)->data[BYTEIDX++]; \
+ MAKE_CHAR_MULTIBYTE (OUTPUT); \
+ } \
+ } \
+ else
+
+
+/* Like FETCH_STRING_CHAR_ADVANCE but assumes STRING is multibyte. */
+
+#define FETCH_STRING_CHAR_ADVANCE_NO_CHECK(OUTPUT, STRING, CHARIDX, BYTEIDX) \
+ if (1) \
+ { \
+ unsigned char *ptr = &XSTRING (STRING)->data[BYTEIDX]; \
+ int len; \
+ \
+ OUTPUT = STRING_CHAR_AND_LENGTH (ptr, 0, len); \
+ BYTEIDX += len; \
+ CHARIDX++; \
+ } \
+ else
+
+
+/* Like FETCH_STRING_CHAR_ADVANCE but fetch character from the current
+ buffer. */
+
+#define FETCH_CHAR_ADVANCE(OUTPUT, CHARIDX, BYTEIDX) \
+ if (1) \
+ { \
+ CHARIDX++; \
+ if (!NILP (current_buffer->enable_multibyte_characters)) \
+ { \
+ unsigned char *ptr = BYTE_POS_ADDR (BYTEIDX); \
+ int len; \
+ \
+ OUTPUT= STRING_CHAR_AND_LENGTH (ptr, 0, len); \
+ BYTEIDX += len; \
+ } \
+ else \
+ { \
+ OUTPUT = *(BYTE_POS_ADDR (BYTEIDX)); \
+ BYTEIDX++; \
+ } \
+ } \
+ else
+
+
+/* Like FETCH_CHAR_ADVANCE but assumes the current buffer is multibyte. */
+
+#define FETCH_CHAR_ADVANCE_NO_CHECK(OUTPUT, CHARIDX, BYTEIDX) \
+ if (1) \
+ { \
+ unsigned char *ptr = BYTE_POS_ADDR (BYTEIDX); \
+ int len; \
+ \
+ OUTPUT= STRING_CHAR_AND_LENGTH (ptr, 0, len); \
+ BYTEIDX += len; \
+ CHARIDX++; \
+ } \
+ else
+
+
+/* Increase the buffer byte position POS_BYTE of the current buffer to
+ the next character boundary. No range checking of POS. */
+
+#define INC_POS(pos_byte) \
+ do { \
+ unsigned char *p = BYTE_POS_ADDR (pos_byte); \
+ pos_byte += BYTES_BY_CHAR_HEAD (*p); \
+ } while (0)
+
+
+/* Decrease the buffer byte position POS_BYTE of the current buffer to
+ the previous character boundary. No range checking of POS. */
+
+#define DEC_POS(pos_byte) \
+ do { \
+ unsigned char *p; \
+ \
+ pos_byte--; \
+ if (pos_byte < GPT_BYTE) \
+ p = BEG_ADDR + pos_byte - 1; \
+ else \
+ p = BEG_ADDR + GAP_SIZE + pos_byte - 1; \
+ while (!CHAR_HEAD_P (*p)) \
+ { \
+ p--; \
+ pos_byte--; \
+ } \
+ } while (0)
+
+/* Increment both CHARPOS and BYTEPOS, each in the appropriate way. */
+
+#define INC_BOTH(charpos, bytepos) \
+ do \
+ { \
+ (charpos)++; \
+ if (NILP (current_buffer->enable_multibyte_characters)) \
+ (bytepos)++; \
+ else \
+ INC_POS ((bytepos)); \
+ } \
+ while (0)
+
+
+/* Decrement both CHARPOS and BYTEPOS, each in the appropriate way. */
+
+#define DEC_BOTH(charpos, bytepos) \
+ do \
+ { \
+ (charpos)--; \
+ if (NILP (current_buffer->enable_multibyte_characters)) \
+ (bytepos)--; \
+ else \
+ DEC_POS ((bytepos)); \
+ } \
+ while (0)
+
+
+/* Increase the buffer byte position POS_BYTE of the current buffer to
+ the next character boundary. This macro relies on the fact that
+ *GPT_ADDR and *Z_ADDR are always accessible and the values are
+ '\0'. No range checking of POS_BYTE. */
+
+#define BUF_INC_POS(buf, pos_byte) \
+ do { \
+ unsigned char *p = BUF_BYTE_ADDRESS (buf, pos_byte); \
+ pos_byte += BYTES_BY_CHAR_HEAD (*p); \
+ } while (0)
+
+
+/* Decrease the buffer byte position POS_BYTE of the current buffer to
+ the previous character boundary. No range checking of POS_BYTE. */
+
+#define BUF_DEC_POS(buf, pos_byte) \
+ do { \
+ unsigned char *p; \
+ pos_byte--; \
+ if (pos_byte < BUF_GPT_BYTE (buf)) \
+ p = BUF_BEG_ADDR (buf) + pos_byte - 1; \
+ else \
+ p = BUF_BEG_ADDR (buf) + BUF_GAP_SIZE (buf) + pos_byte - 1; \
+ while (!CHAR_HEAD_P (*p)) \
+ { \
+ p--; \
+ pos_byte--; \
+ } \
+ } while (0)
+
+
+/* If C is a character to be unified with a Unicode character, return
+ the unified Unicode character. */
+
+#define MAYBE_UNIFY_CHAR(c) \
+ if (c > MAX_UNICODE_CHAR \
+ && CHAR_TABLE_P (Vchar_unify_table)) \
+ { \
+ Lisp_Object val; \
+ int unified; \
+ \
+ val = CHAR_TABLE_REF (Vchar_unify_table, c); \
+ if (! NILP (val)) \
+ { \
+ if (SYMBOLP (val)) \
+ { \
+ Funify_charset (val, Qnil, Qnil); \
+ val = CHAR_TABLE_REF (Vchar_unify_table, c); \
+ } \
+ if ((unified = XINT (val)) >= 0) \
+ c = unified; \
+ } \
+ } \
+ else
+
+
+/* Return the width of ASCII character C. The width is measured by
+ how many columns occupied on the screen when displayed in the
+ current buffer. */
+
+#define ASCII_CHAR_WIDTH(c) \
+ (c < 0x20 \
+ ? (c == '\t' \
+ ? XFASTINT (current_buffer->tab_width) \
+ : (c == '\n' ? 0 : (NILP (current_buffer->ctl_arrow) ? 4 : 2))) \
+ : (c < 0x7f \
+ ? 1 \
+ : ((NILP (current_buffer->ctl_arrow) ? 4 : 2))))
+
+/* Return the width of character C. The width is measured by how many
+ columns occupied on the screen when displayed in the current
+ buffer. */
+
+#define CHAR_WIDTH(c) \
+ (ASCII_CHAR_P (c) \
+ ? ASCII_CHAR_WIDTH (c) \
+ : XINT (CHAR_TABLE_REF (Vchar_width_table, c)))
+
+extern int char_resolve_modifier_mask P_ ((int));
+extern int char_string P_ ((unsigned, unsigned char *));
+extern int string_char P_ ((const unsigned char *,
+ const unsigned char **, int *));
+
+extern int translate_char P_ ((Lisp_Object, int c));
+extern int char_printable_p P_ ((int c));
+extern void parse_str_as_multibyte P_ ((const unsigned char *, int, int *,
+ int *));
+extern int parse_str_to_multibyte P_ ((unsigned char *, int));
+extern int str_as_multibyte P_ ((unsigned char *, int, int, int *));
+extern int str_to_multibyte P_ ((unsigned char *, int, int));
+extern int str_as_unibyte P_ ((unsigned char *, int));
+extern int strwidth P_ ((unsigned char *, int));
+extern int c_string_width P_ ((const unsigned char *, int, int, int *, int *));
+extern int lisp_string_width P_ ((Lisp_Object, int, int *, int *));
+
+extern Lisp_Object Vprintable_chars;
+
+extern Lisp_Object Qcharacterp, Qauto_fill_chars;
+extern Lisp_Object Vtranslation_table_vector;
+extern Lisp_Object Vchar_width_table;
+extern Lisp_Object Vchar_direction_table;
+extern Lisp_Object Vchar_unify_table;
+
+extern Lisp_Object string_escape_byte8 P_ ((Lisp_Object));
+
+/* Return a translation table of id number ID. */
+#define GET_TRANSLATION_TABLE(id) \
+ (XCDR(XVECTOR(Vtranslation_table_vector)->contents[(id)]))
+
+/* A char-table for characters which may invoke auto-filling. */
+extern Lisp_Object Vauto_fill_chars;
+
+extern Lisp_Object Vchar_script_table;
+extern Lisp_Object Vscript_representative_chars;
+
+/* Copy LEN bytes from FROM to TO. This macro should be used only
+ when a caller knows that LEN is short and the obvious copy loop is
+ faster than calling bcopy which has some overhead. Copying a
+ multibyte sequence of a character is the typical case. */
+
+#define BCOPY_SHORT(from, to, len) \
+ do { \
+ int i = len; \
+ unsigned char *from_p = from, *to_p = to; \
+ while (i--) *to_p++ = *from_p++; \
+ } while (0)
+
+#define DEFSYM(sym, name) \
+ do { (sym) = intern ((name)); staticpro (&(sym)); } while (0)
+
+#endif /* EMACS_CHARACTER_H */
+
+/* arch-tag: 4ef86004-2eff-4073-8cea-cfcbcf7188ac
+ (do not change this comment) */
diff --git a/src/charset.c b/src/charset.c
index 1a85cd39c7..299918587f 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -1,4 +1,4 @@
-/* Basic multilingual character support.
+/* Basic character set support.
Copyright (C) 2001, 2002, 2003, 2004, 2005,
2006, 2007 Free Software Foundation, Inc.
Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
@@ -6,6 +6,10 @@
National Institute of Advanced Industrial Science and Technology (AIST)
Registration Number H14PRO021
+ Copyright (C) 2003, 2004
+ National Institute of Advanced Industrial Science and Technology (AIST)
+ Registration Number H13PRO009
+
This file is part of GNU Emacs.
GNU Emacs is free software; you can redistribute it and/or modify
@@ -23,720 +27,1244 @@ along with GNU Emacs; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
-/* At first, see the document in `charset.h' to understand the code in
- this file. */
-
-#ifdef emacs
#include <config.h>
-#endif
#include <stdio.h>
-
-#ifdef emacs
-
+#include <unistd.h>
+#include <ctype.h>
#include <sys/types.h>
#include "lisp.h"
-#include "buffer.h"
+#include "character.h"
#include "charset.h"
-#include "composite.h"
#include "coding.h"
#include "disptab.h"
+#include "buffer.h"
-#else /* not emacs */
+/*** GENERAL NOTES on CODED CHARACTER SETS (CHARSETS) ***
-#include "mulelib.h"
+ A coded character set ("charset" hereafter) is a meaningful
+ collection (i.e. language, culture, functionality, etc.) of
+ characters. Emacs handles multiple charsets at once. In Emacs Lisp
+ code, a charset is represented by a symbol. In C code, a charset is
+ represented by its ID number or by a pointer to a struct charset.
-#endif /* emacs */
+ The actual information about each charset is stored in two places.
+ Lispy information is stored in the hash table Vcharset_hash_table as
+ a vector (charset attributes). The other information is stored in
+ charset_table as a struct charset.
-Lisp_Object Qcharset, Qascii, Qeight_bit_control, Qeight_bit_graphic;
-Lisp_Object Qunknown;
-
-/* Declaration of special leading-codes. */
-EMACS_INT leading_code_private_11; /* for private DIMENSION1 of 1-column */
-EMACS_INT leading_code_private_12; /* for private DIMENSION1 of 2-column */
-EMACS_INT leading_code_private_21; /* for private DIMENSION2 of 1-column */
-EMACS_INT leading_code_private_22; /* for private DIMENSION2 of 2-column */
-
-/* Declaration of special charsets. The values are set by
- Fsetup_special_charsets. */
-int charset_latin_iso8859_1; /* ISO8859-1 (Latin-1) */
-int charset_jisx0208_1978; /* JISX0208.1978 (Japanese Kanji old set) */
-int charset_jisx0208; /* JISX0208.1983 (Japanese Kanji) */
-int charset_katakana_jisx0201; /* JISX0201.Kana (Japanese Katakana) */
-int charset_latin_jisx0201; /* JISX0201.Roman (Japanese Roman) */
-int charset_big5_1; /* Big5 Level 1 (Chinese Traditional) */
-int charset_big5_2; /* Big5 Level 2 (Chinese Traditional) */
-int charset_mule_unicode_0100_24ff;
-int charset_mule_unicode_2500_33ff;
-int charset_mule_unicode_e000_ffff;
-
-Lisp_Object Qcharset_table;
-
-/* A char-table containing information of each character set. */
-Lisp_Object Vcharset_table;
-
-/* A vector of charset symbol indexed by charset-id. This is used
- only for returning charset symbol from C functions. */
-Lisp_Object Vcharset_symbol_table;
-
-/* A list of charset symbols ever defined. */
+*/
+
+/* List of all charsets. This variable is used only from Emacs
+ Lisp. */
Lisp_Object Vcharset_list;
-/* Vector of translation table ever defined.
- ID of a translation table is used to index this vector. */
-Lisp_Object Vtranslation_table_vector;
+/* Hash table that contains attributes of each charset. Keys are
+ charset symbols, and values are vectors of charset attributes. */
+Lisp_Object Vcharset_hash_table;
-/* A char-table for characters which may invoke auto-filling. */
-Lisp_Object Vauto_fill_chars;
+/* Table of struct charset. */
+struct charset *charset_table;
-Lisp_Object Qauto_fill_chars;
+static int charset_table_size;
+static int charset_table_used;
-/* Tables used by macros BYTES_BY_CHAR_HEAD and WIDTH_BY_CHAR_HEAD. */
-int bytes_by_char_head[256];
-int width_by_char_head[256];
+Lisp_Object Qcharsetp;
-/* Mapping table from ISO2022's charset (specified by DIMENSION,
- CHARS, and FINAL-CHAR) to Emacs' charset. */
-int iso_charset_table[2][2][128];
+/* Special charset symbols. */
+Lisp_Object Qascii;
+Lisp_Object Qeight_bit;
+Lisp_Object Qiso_8859_1;
+Lisp_Object Qunicode;
+
+/* The corresponding charsets. */
+int charset_ascii;
+int charset_eight_bit;
+int charset_iso_8859_1;
+int charset_unicode;
+
+/* The other special charsets. */
+int charset_jisx0201_roman;
+int charset_jisx0208_1978;
+int charset_jisx0208;
-/* Variables used locally in the macro FETCH_MULTIBYTE_CHAR. */
-unsigned char *_fetch_multibyte_char_p;
-int _fetch_multibyte_char_len;
+/* Value of charset attribute `charset-iso-plane'. */
+Lisp_Object Qgl, Qgr;
-/* Offset to add to a non-ASCII value when inserting it. */
-EMACS_INT nonascii_insert_offset;
+/* Charset of unibyte characters. */
+int charset_unibyte;
-/* Translation table for converting non-ASCII unibyte characters
- to multibyte codes, or nil. */
-Lisp_Object Vnonascii_translation_table;
+/* List of charsets ordered by the priority. */
+Lisp_Object Vcharset_ordered_list;
+
+/* Incremented everytime we change Vcharset_ordered_list. This is
+ unsigned short so that it fits in Lisp_Int and never matches
+ -1. */
+unsigned short charset_ordered_list_tick;
+
+/* List of iso-2022 charsets. */
+Lisp_Object Viso_2022_charset_list;
+
+/* List of emacs-mule charsets. */
+Lisp_Object Vemacs_mule_charset_list;
+
+struct charset *emacs_mule_charset[256];
+
+/* Mapping table from ISO2022's charset (specified by DIMENSION,
+ CHARS, and FINAL-CHAR) to Emacs' charset. */
+int iso_charset_table[ISO_MAX_DIMENSION][ISO_MAX_CHARS][ISO_MAX_FINAL];
+
+Lisp_Object Vcharset_map_path;
+
+Lisp_Object Vchar_unified_charset_table;
+
+/* Defined in chartab.c */
+extern void
+map_char_table_for_charset P_ ((void (*c_function) (Lisp_Object, Lisp_Object),
+ Lisp_Object function, Lisp_Object table,
+ Lisp_Object arg, struct charset *charset,
+ unsigned from, unsigned to));
+
+#define CODE_POINT_TO_INDEX(charset, code) \
+ ((charset)->code_linear_p \
+ ? (code) - (charset)->min_code \
+ : (((charset)->code_space_mask[(code) >> 24] & 0x8) \
+ && ((charset)->code_space_mask[((code) >> 16) & 0xFF] & 0x4) \
+ && ((charset)->code_space_mask[((code) >> 8) & 0xFF] & 0x2) \
+ && ((charset)->code_space_mask[(code) & 0xFF] & 0x1)) \
+ ? (((((code) >> 24) - (charset)->code_space[12]) \
+ * (charset)->code_space[11]) \
+ + (((((code) >> 16) & 0xFF) - (charset)->code_space[8]) \
+ * (charset)->code_space[7]) \
+ + (((((code) >> 8) & 0xFF) - (charset)->code_space[4]) \
+ * (charset)->code_space[3]) \
+ + (((code) & 0xFF) - (charset)->code_space[0]) \
+ - ((charset)->char_index_offset)) \
+ : -1)
+
+
+/* Convert the character index IDX to code-point CODE for CHARSET.
+ It is assumed that IDX is in a valid range. */
+
+#define INDEX_TO_CODE_POINT(charset, idx) \
+ ((charset)->code_linear_p \
+ ? (idx) + (charset)->min_code \
+ : (idx += (charset)->char_index_offset, \
+ (((charset)->code_space[0] + (idx) % (charset)->code_space[2]) \
+ | (((charset)->code_space[4] \
+ + ((idx) / (charset)->code_space[3] % (charset)->code_space[6])) \
+ << 8) \
+ | (((charset)->code_space[8] \
+ + ((idx) / (charset)->code_space[7] % (charset)->code_space[10])) \
+ << 16) \
+ | (((charset)->code_space[12] + ((idx) / (charset)->code_space[11])) \
+ << 24))))
-/* List of all possible generic characters. */
-Lisp_Object Vgeneric_character_list;
-void
-invalid_character (c)
- int c;
-{
- error ("Invalid character: %d, #o%o, #x%x", c, c, c);
-}
-/* Parse string STR of length LENGTH and fetch information of a
- character at STR. Set BYTES to the byte length the character
- occupies, CHARSET, C1, C2 to proper values of the character. */
-
-#define SPLIT_MULTIBYTE_SEQ(str, length, bytes, charset, c1, c2) \
- do { \
- (c1) = *(str); \
- (bytes) = BYTES_BY_CHAR_HEAD (c1); \
- if ((bytes) == 1) \
- (charset) = ASCII_BYTE_P (c1) ? CHARSET_ASCII : CHARSET_8_BIT_GRAPHIC; \
- else if ((bytes) == 2) \
- { \
- if ((c1) == LEADING_CODE_8_BIT_CONTROL) \
- (charset) = CHARSET_8_BIT_CONTROL, (c1) = (str)[1] - 0x20; \
- else \
- (charset) = (c1), (c1) = (str)[1] & 0x7F; \
- } \
- else if ((bytes) == 3) \
- { \
- if ((c1) < LEADING_CODE_PRIVATE_11) \
- (charset) = (c1), (c1) = (str)[1] & 0x7F, (c2) = (str)[2] & 0x7F; \
- else \
- (charset) = (str)[1], (c1) = (str)[2] & 0x7F; \
- } \
- else \
- (charset) = (str)[1], (c1) = (str)[2] & 0x7F, (c2) = (str)[3] & 0x7F; \
- } while (0)
-
-/* 1 if CHARSET, C1, and C2 compose a valid character, else 0.
- Note that this intentionally allows invalid components, such
- as 0xA0 0xA0, because there exist many files that contain
- such invalid byte sequences, especially in EUC-GB. */
-#define CHAR_COMPONENTS_VALID_P(charset, c1, c2) \
- ((charset) == CHARSET_ASCII \
- ? ((c1) >= 0 && (c1) <= 0x7F) \
- : ((charset) == CHARSET_8_BIT_CONTROL \
- ? ((c1) >= 0x80 && (c1) <= 0x9F) \
- : ((charset) == CHARSET_8_BIT_GRAPHIC \
- ? ((c1) >= 0x80 && (c1) <= 0xFF) \
- : (CHARSET_DIMENSION (charset) == 1 \
- ? ((c1) >= 0x20 && (c1) <= 0x7F) \
- : ((c1) >= 0x20 && (c1) <= 0x7F \
- && (c2) >= 0x20 && (c2) <= 0x7F)))))
-
-/* Store multi-byte form of the character C in STR. The caller should
- allocate at least 4-byte area at STR in advance. Returns the
- length of the multi-byte form. If C is an invalid character code,
- return -1. */
+/* Set to 1 to warn that a charset map is loaded and thus a buffer
+ text and a string data may be relocated. */
+int charset_map_loaded;
-int
-char_to_string_1 (c, str)
- int c;
- unsigned char *str;
+struct charset_map_entries
{
- unsigned char *p = str;
+ struct {
+ unsigned from, to;
+ int c;
+ } entry[0x10000];
+ struct charset_map_entries *next;
+};
+
+/* Load the mapping information for CHARSET from ENTRIES.
+
+ If CONTROL_FLAG is 0, setup CHARSET->min_char and CHARSET->max_char.
+
+ If CONTROL_FLAG is 1, setup CHARSET->min_char, CHARSET->max_char,
+ CHARSET->decoder, and CHARSET->encoder.
+
+ If CONTROL_FLAG is 2, setup CHARSET->deunifier and
+ Vchar_unify_table. If Vchar_unified_charset_table is non-nil,
+ setup it too. */
+
+static void
+load_charset_map (charset, entries, n_entries, control_flag)
+ struct charset *charset;
+ struct charset_map_entries *entries;
+ int n_entries;
+ int control_flag;
+{
+ Lisp_Object vec, table;
+ unsigned max_code = CHARSET_MAX_CODE (charset);
+ int ascii_compatible_p = charset->ascii_compatible_p;
+ int min_char, max_char, nonascii_min_char;
+ int i;
+ unsigned char *fast_map = charset->fast_map;
- if (c & CHAR_MODIFIER_MASK) /* This includes the case C is negative. */
+ if (n_entries <= 0)
+ return;
+
+ if (control_flag > 0)
{
- /* Multibyte character can't have a modifier bit. */
- if (! SINGLE_BYTE_CHAR_P ((c & ~CHAR_MODIFIER_MASK)))
- return -1;
+ int n = CODE_POINT_TO_INDEX (charset, max_code) + 1;
+
+ table = Fmake_char_table (Qnil, Qnil);
+ if (control_flag == 1)
+ vec = Fmake_vector (make_number (n), make_number (-1));
+ else if (! CHAR_TABLE_P (Vchar_unify_table))
+ Vchar_unify_table = Fmake_char_table (Qnil, Qnil);
+
+ charset_map_loaded = 1;
+ }
- /* For Meta, Shift, and Control modifiers, we need special care. */
- if (c & CHAR_META)
+ min_char = max_char = entries->entry[0].c;
+ nonascii_min_char = MAX_CHAR;
+ for (i = 0; i < n_entries; i++)
+ {
+ unsigned from, to;
+ int from_index, to_index;
+ int from_c, to_c;
+ int idx = i % 0x10000;
+
+ if (i > 0 && idx == 0)
+ entries = entries->next;
+ from = entries->entry[idx].from;
+ to = entries->entry[idx].to;
+ from_c = entries->entry[idx].c;
+ from_index = CODE_POINT_TO_INDEX (charset, from);
+ if (from == to)
{
- /* Move the meta bit to the right place for a string. */
- c = (c & ~CHAR_META) | 0x80;
+ to_index = from_index;
+ to_c = from_c;
}
- if (c & CHAR_SHIFT)
+ else
{
- /* Shift modifier is valid only with [A-Za-z]. */
- if ((c & 0377) >= 'A' && (c & 0377) <= 'Z')
- c &= ~CHAR_SHIFT;
- else if ((c & 0377) >= 'a' && (c & 0377) <= 'z')
- c = (c & ~CHAR_SHIFT) - ('a' - 'A');
+ to_index = CODE_POINT_TO_INDEX (charset, to);
+ to_c = from_c + (to_index - from_index);
}
- if (c & CHAR_CTL)
+ if (from_index < 0 || to_index < 0)
+ continue;
+
+ if (control_flag < 2)
{
- /* Simulate the code in lread.c. */
- /* Allow `\C- ' and `\C-?'. */
- if (c == (CHAR_CTL | ' '))
- c = 0;
- else if (c == (CHAR_CTL | '?'))
- c = 127;
- /* ASCII control chars are made from letters (both cases),
- as well as the non-letters within 0100...0137. */
- else if ((c & 0137) >= 0101 && (c & 0137) <= 0132)
- c &= (037 | (~0177 & ~CHAR_CTL));
- else if ((c & 0177) >= 0100 && (c & 0177) <= 0137)
- c &= (037 | (~0177 & ~CHAR_CTL));
+ int c;
+
+ if (to_c > max_char)
+ max_char = to_c;
+ else if (from_c < min_char)
+ min_char = from_c;
+ if (ascii_compatible_p)
+ {
+ if (! ASCII_BYTE_P (from_c))
+ {
+ if (from_c < nonascii_min_char)
+ nonascii_min_char = from_c;
+ }
+ else if (! ASCII_BYTE_P (to_c))
+ {
+ nonascii_min_char = 0x80;
+ }
+ }
+
+ for (c = from_c; c <= to_c; c++)
+ CHARSET_FAST_MAP_SET (c, fast_map);
+
+ if (control_flag == 1)
+ {
+ unsigned code = from;
+
+ if (CHARSET_COMPACT_CODES_P (charset))
+ while (1)
+ {
+ ASET (vec, from_index, make_number (from_c));
+ if (NILP (CHAR_TABLE_REF (table, from_c)))
+ CHAR_TABLE_SET (table, from_c, make_number (code));
+ if (from_index == to_index)
+ break;
+ from_index++, from_c++;
+ code = INDEX_TO_CODE_POINT (charset, from_index);
+ }
+ else
+ for (; from_index <= to_index; from_index++, from_c++)
+ {
+ ASET (vec, from_index, make_number (from_c));
+ if (NILP (CHAR_TABLE_REF (table, from_c)))
+ CHAR_TABLE_SET (table, from_c, make_number (from_index));
+ }
+ }
}
+ else
+ {
+ unsigned code = from;
- /* If C still has any modifier bits, just ignore it. */
- c &= ~CHAR_MODIFIER_MASK;
+ while (1)
+ {
+ int c1 = DECODE_CHAR (charset, code);
+
+ if (c1 >= 0)
+ {
+ CHAR_TABLE_SET (table, from_c, make_number (c1));
+ CHAR_TABLE_SET (Vchar_unify_table, c1, make_number (from_c));
+ if (CHAR_TABLE_P (Vchar_unified_charset_table))
+ CHAR_TABLE_SET (Vchar_unified_charset_table, c1,
+ CHARSET_NAME (charset));
+ }
+ if (from_index == to_index)
+ break;
+ from_index++, from_c++;
+ code = INDEX_TO_CODE_POINT (charset, from_index);
+ }
+ }
}
- if (SINGLE_BYTE_CHAR_P (c))
+ if (control_flag < 2)
{
- if (ASCII_BYTE_P (c) || c >= 0xA0)
- *p++ = c;
- else
+ CHARSET_MIN_CHAR (charset) = (ascii_compatible_p
+ ? nonascii_min_char : min_char);
+ CHARSET_MAX_CHAR (charset) = max_char;
+ if (control_flag == 1)
{
- *p++ = LEADING_CODE_8_BIT_CONTROL;
- *p++ = c + 0x20;
+ CHARSET_DECODER (charset) = vec;
+ CHARSET_ENCODER (charset) = table;
}
}
- else if (CHAR_VALID_P (c, 0))
- {
- int charset, c1, c2;
+ else
+ CHARSET_DEUNIFIER (charset) = table;
+}
- SPLIT_CHAR (c, charset, c1, c2);
- if (charset >= LEADING_CODE_EXT_11)
- *p++ = (charset < LEADING_CODE_EXT_12
- ? LEADING_CODE_PRIVATE_11
- : (charset < LEADING_CODE_EXT_21
- ? LEADING_CODE_PRIVATE_12
- : (charset < LEADING_CODE_EXT_22
- ? LEADING_CODE_PRIVATE_21
- : LEADING_CODE_PRIVATE_22)));
- *p++ = charset;
- if ((c1 > 0 && c1 < 32) || (c2 > 0 && c2 < 32))
- return -1;
- if (c1)
+/* Read a hexadecimal number (preceded by "0x") from the file FP while
+ paying attention to comment charcter '#'. */
+
+static INLINE unsigned
+read_hex (fp, eof)
+ FILE *fp;
+ int *eof;
+{
+ int c;
+ unsigned n;
+
+ while ((c = getc (fp)) != EOF)
+ {
+ if (c == '#')
{
- *p++ = c1 | 0x80;
- if (c2 > 0)
- *p++ = c2 | 0x80;
+ while ((c = getc (fp)) != EOF && c != '\n');
+ }
+ else if (c == '0')
+ {
+ if ((c = getc (fp)) == EOF || c == 'x')
+ break;
}
}
+ if (c == EOF)
+ {
+ *eof = 1;
+ return 0;
+ }
+ *eof = 0;
+ n = 0;
+ if (c == 'x')
+ while ((c = getc (fp)) != EOF && isxdigit (c))
+ n = ((n << 4)
+ | (c <= '9' ? c - '0' : c <= 'F' ? c - 'A' + 10 : c - 'a' + 10));
else
- return -1;
-
- return (p - str);
+ while ((c = getc (fp)) != EOF && isdigit (c))
+ n = (n * 10) + c - '0';
+ if (c != EOF)
+ ungetc (c, fp);
+ return n;
}
-/* Store multi-byte form of the character C in STR. The caller should
- allocate at least 4-byte area at STR in advance. Returns the
- length of the multi-byte form. If C is an invalid character code,
- signal an error.
+/* Return a mapping vector for CHARSET loaded from MAPFILE.
+ Each line of MAPFILE has this form
+ 0xAAAA 0xCCCC
+ where 0xAAAA is a code-point and 0xCCCC is the corresponding
+ character code, or this form
+ 0xAAAA-0xBBBB 0xCCCC
+ where 0xAAAA and 0xBBBB are code-points specifying a range, and
+ 0xCCCC is the first character code of the range.
- Use macro `CHAR_STRING (C, STR)' instead of calling this function
- directly if C can be an ASCII character. */
+ The returned vector has this form:
+ [ CODE1 CHAR1 CODE2 CHAR2 .... ]
+ where CODE1 is a code-point or a cons of code-points specifying a
+ range. */
-int
-char_to_string (c, str)
- int c;
- unsigned char *str;
+extern void add_to_log P_ ((char *, Lisp_Object, Lisp_Object));
+
+static void
+load_charset_map_from_file (charset, mapfile, control_flag)
+ struct charset *charset;
+ Lisp_Object mapfile;
+ int control_flag;
{
- int len;
- len = char_to_string_1 (c, str);
- if (len == -1)
- invalid_character (c);
- return len;
-}
+ unsigned min_code = CHARSET_MIN_CODE (charset);
+ unsigned max_code = CHARSET_MAX_CODE (charset);
+ int fd;
+ FILE *fp;
+ int eof;
+ Lisp_Object suffixes;
+ struct charset_map_entries *head, *entries;
+ int n_entries;
+
+ suffixes = Fcons (build_string (".map"),
+ Fcons (build_string (".TXT"), Qnil));
+
+ fd = openp (Vcharset_map_path, mapfile, suffixes, NULL, Qnil);
+ if (fd < 0
+ || ! (fp = fdopen (fd, "r")))
+ {
+ add_to_log ("Failure in loading charset map: %S", mapfile, Qnil);
+ return;
+ }
+ head = entries = ((struct charset_map_entries *)
+ alloca (sizeof (struct charset_map_entries)));
+ n_entries = 0;
+ eof = 0;
+ while (1)
+ {
+ unsigned from, to;
+ int c;
+ int idx;
-/* Return the non-ASCII character corresponding to multi-byte form at
- STR of length LEN. If ACTUAL_LEN is not NULL, store the byte
- length of the multibyte form in *ACTUAL_LEN.
+ from = read_hex (fp, &eof);
+ if (eof)
+ break;
+ if (getc (fp) == '-')
+ to = read_hex (fp, &eof);
+ else
+ to = from;
+ c = (int) read_hex (fp, &eof);
- Use macros STRING_CHAR or STRING_CHAR_AND_LENGTH instead of calling
- this function directly if you want ot handle ASCII characters as
- well. */
+ if (from < min_code || to > max_code || from > to || c > MAX_CHAR)
+ continue;
-int
-string_to_char (str, len, actual_len)
- const unsigned char *str;
- int len, *actual_len;
-{
- int c, bytes, charset, c1, c2;
+ if (n_entries > 0 && (n_entries % 0x10000) == 0)
+ {
+ entries->next = ((struct charset_map_entries *)
+ alloca (sizeof (struct charset_map_entries)));
+ entries = entries->next;
+ }
+ idx = n_entries % 0x10000;
+ entries->entry[idx].from = from;
+ entries->entry[idx].to = to;
+ entries->entry[idx].c = c;
+ n_entries++;
+ }
+ fclose (fp);
+ close (fd);
- SPLIT_MULTIBYTE_SEQ (str, len, bytes, charset, c1, c2);
- c = MAKE_CHAR (charset, c1, c2);
- if (actual_len)
- *actual_len = bytes;
- return c;
+ load_charset_map (charset, head, n_entries, control_flag);
}
-/* Return the length of the multi-byte form at string STR of length LEN.
- Use the macro MULTIBYTE_FORM_LENGTH instead. */
-int
-multibyte_form_length (str, len)
- const unsigned char *str;
- int len;
+static void
+load_charset_map_from_vector (charset, vec, control_flag)
+ struct charset *charset;
+ Lisp_Object vec;
+ int control_flag;
{
- int bytes;
+ unsigned min_code = CHARSET_MIN_CODE (charset);
+ unsigned max_code = CHARSET_MAX_CODE (charset);
+ struct charset_map_entries *head, *entries;
+ int n_entries;
+ int len = ASIZE (vec);
+ int i;
- PARSE_MULTIBYTE_SEQ (str, len, bytes);
- return bytes;
-}
+ if (len % 2 == 1)
+ {
+ add_to_log ("Failure in loading charset map: %V", vec, Qnil);
+ return;
+ }
-/* Check multibyte form at string STR of length LEN and set variables
- pointed by CHARSET, C1, and C2 to charset and position codes of the
- character at STR, and return 0. If there's no multibyte character,
- return -1. This should be used only in the macro SPLIT_STRING
- which checks range of STR in advance. */
+ head = entries = ((struct charset_map_entries *)
+ alloca (sizeof (struct charset_map_entries)));
+ n_entries = 0;
+ for (i = 0; i < len; i += 2)
+ {
+ Lisp_Object val, val2;
+ unsigned from, to;
+ int c;
+ int idx;
-int
-split_string (str, len, charset, c1, c2)
- const unsigned char *str;
- unsigned char *c1, *c2;
- int len, *charset;
-{
- register int bytes, cs, code1, code2 = -1;
+ val = AREF (vec, i);
+ if (CONSP (val))
+ {
+ val2 = XCDR (val);
+ val = XCAR (val);
+ CHECK_NATNUM (val);
+ CHECK_NATNUM (val2);
+ from = XFASTINT (val);
+ to = XFASTINT (val2);
+ }
+ else
+ {
+ CHECK_NATNUM (val);
+ from = to = XFASTINT (val);
+ }
+ val = AREF (vec, i + 1);
+ CHECK_NATNUM (val);
+ c = XFASTINT (val);
- SPLIT_MULTIBYTE_SEQ (str, len, bytes, cs, code1, code2);
- if (cs == CHARSET_ASCII)
- return -1;
- *charset = cs;
- *c1 = code1;
- *c2 = code2;
- return 0;
+ if (from < min_code || to > max_code || from > to || c > MAX_CHAR)
+ continue;
+
+ if (n_entries > 0 && (n_entries % 0x10000) == 0)
+ {
+ entries->next = ((struct charset_map_entries *)
+ alloca (sizeof (struct charset_map_entries)));
+ entries = entries->next;
+ }
+ idx = n_entries % 0x10000;
+ entries->entry[idx].from = from;
+ entries->entry[idx].to = to;
+ entries->entry[idx].c = c;
+ n_entries++;
+ }
+
+ load_charset_map (charset, head, n_entries, control_flag);
}
-/* Return 1 if character C has valid printable glyph.
- Use the macro CHAR_PRINTABLE_P instead. */
-int
-char_printable_p (c)
- int c;
+static void
+load_charset (charset)
+ struct charset *charset;
{
- int charset, c1, c2;
-
- if (ASCII_BYTE_P (c))
- return 1;
- else if (SINGLE_BYTE_CHAR_P (c))
- return 0;
- else if (c >= MAX_CHAR)
- return 0;
+ if (CHARSET_METHOD (charset) == CHARSET_METHOD_MAP_DEFERRED)
+ {
+ Lisp_Object map;
- SPLIT_CHAR (c, charset, c1, c2);
- if (! CHARSET_DEFINED_P (charset))
- return 0;
- if (CHARSET_CHARS (charset) == 94
- ? c1 <= 32 || c1 >= 127
- : c1 < 32)
- return 0;
- if (CHARSET_DIMENSION (charset) == 2
- && (CHARSET_CHARS (charset) == 94
- ? c2 <= 32 || c2 >= 127
- : c2 < 32))
- return 0;
- return 1;
+ map = CHARSET_MAP (charset);
+ if (STRINGP (map))
+ load_charset_map_from_file (charset, map, 1);
+ else
+ load_charset_map_from_vector (charset, map, 1);
+ CHARSET_METHOD (charset) = CHARSET_METHOD_MAP;
+ }
}
-/* Translate character C by translation table TABLE. If C
- is negative, translate a character specified by CHARSET, C1, and C2
- (C1 and C2 are code points of the character). If no translation is
- found in TABLE, return C. */
-int
-translate_char (table, c, charset, c1, c2)
- Lisp_Object table;
- int c, charset, c1, c2;
+
+DEFUN ("charsetp", Fcharsetp, Scharsetp, 1, 1, 0,
+ doc: /* Return non-nil if and only if OBJECT is a charset.*/)
+ (object)
+ Lisp_Object object;
{
- Lisp_Object ch;
- int alt_charset, alt_c1, alt_c2, dimension;
-
- if (c < 0) c = MAKE_CHAR (charset, (c1 & 0x7F) , (c2 & 0x7F));
- if (!CHAR_TABLE_P (table)
- || (ch = Faref (table, make_number (c)), !NATNUMP (ch)))
- return c;
-
- SPLIT_CHAR (XFASTINT (ch), alt_charset, alt_c1, alt_c2);
- dimension = CHARSET_DIMENSION (alt_charset);
- if ((dimension == 1 && alt_c1 > 0) || (dimension == 2 && alt_c2 > 0))
- /* CH is not a generic character, just return it. */
- return XFASTINT (ch);
-
- /* Since CH is a generic character, we must return a specific
- charater which has the same position codes as C from CH. */
- if (charset < 0)
- SPLIT_CHAR (c, charset, c1, c2);
- if (dimension != CHARSET_DIMENSION (charset))
- /* We can't make such a character because of dimension mismatch. */
- return c;
- return MAKE_CHAR (alt_charset, c1, c2);
+ return (CHARSETP (object) ? Qt : Qnil);
}
-/* Convert the unibyte character C to multibyte based on
- Vnonascii_translation_table or nonascii_insert_offset. If they can't
- convert C to a valid multibyte character, convert it based on
- DEFAULT_NONASCII_INSERT_OFFSET which makes C a Latin-1 character. */
-int
-unibyte_char_to_multibyte (c)
- int c;
+void
+map_charset_chars (c_function, function, arg,
+ charset, from, to)
+ void (*c_function) P_ ((Lisp_Object, Lisp_Object));
+ Lisp_Object function, arg;
+ struct charset *charset;
+ unsigned from, to;
{
- if (c < 0400 && c >= 0200)
+ Lisp_Object range;
+ int partial;
+
+ if (CHARSET_METHOD (charset) == CHARSET_METHOD_MAP_DEFERRED)
+ load_charset (charset);
+
+ partial = (from > CHARSET_MIN_CODE (charset)
+ || to < CHARSET_MAX_CODE (charset));
+
+ if (CHARSET_UNIFIED_P (charset)
+ && CHAR_TABLE_P (CHARSET_DEUNIFIER (charset)))
{
- int c_save = c;
+ map_char_table_for_charset (c_function, function,
+ CHARSET_DEUNIFIER (charset), arg,
+ partial ? charset : NULL, from, to);
+ }
- if (! NILP (Vnonascii_translation_table))
- {
- c = XINT (Faref (Vnonascii_translation_table, make_number (c)));
- if (c >= 0400 && ! char_valid_p (c, 0))
- c = c_save + DEFAULT_NONASCII_INSERT_OFFSET;
- }
- else if (c >= 0240 && nonascii_insert_offset > 0)
+ if (CHARSET_METHOD (charset) == CHARSET_METHOD_OFFSET)
+ {
+ int from_idx = CODE_POINT_TO_INDEX (charset, from);
+ int to_idx = CODE_POINT_TO_INDEX (charset, to);
+ int from_c = from_idx + CHARSET_CODE_OFFSET (charset);
+ int to_c = to_idx + CHARSET_CODE_OFFSET (charset);
+
+ range = Fcons (make_number (from_c), make_number (to_c));
+ if (NILP (function))
+ (*c_function) (arg, range);
+ else
+ call2 (function, range, arg);
+ }
+ else if (CHARSET_METHOD (charset) == CHARSET_METHOD_MAP)
+ {
+ if (! CHAR_TABLE_P (CHARSET_ENCODER (charset)))
+ return;
+ map_char_table_for_charset (c_function, function,
+ CHARSET_ENCODER (charset), arg,
+ partial ? charset : NULL, from, to);
+ }
+ else if (CHARSET_METHOD (charset) == CHARSET_METHOD_SUBSET)
+ {
+ Lisp_Object subset_info;
+ int offset;
+
+ subset_info = CHARSET_SUBSET (charset);
+ charset = CHARSET_FROM_ID (XFASTINT (AREF (subset_info, 0)));
+ offset = XINT (AREF (subset_info, 3));
+ from -= offset;
+ if (from < XFASTINT (AREF (subset_info, 1)))
+ from = XFASTINT (AREF (subset_info, 1));
+ to -= offset;
+ if (to > XFASTINT (AREF (subset_info, 2)))
+ to = XFASTINT (AREF (subset_info, 2));
+ map_charset_chars (c_function, function, arg, charset, from, to);
+ }
+ else /* i.e. CHARSET_METHOD_SUPERSET */
+ {
+ Lisp_Object parents;
+
+ for (parents = CHARSET_SUPERSET (charset); CONSP (parents);
+ parents = XCDR (parents))
{
- c += nonascii_insert_offset;
- if (c < 0400 || ! char_valid_p (c, 0))
- c = c_save + DEFAULT_NONASCII_INSERT_OFFSET;
+ int offset;
+ unsigned this_from, this_to;
+
+ charset = CHARSET_FROM_ID (XFASTINT (XCAR (XCAR (parents))));
+ offset = XINT (XCDR (XCAR (parents)));
+ this_from = from - offset;
+ this_to = to - offset;
+ if (this_from < CHARSET_MIN_CODE (charset))
+ this_from = CHARSET_MIN_CODE (charset);
+ if (this_to > CHARSET_MAX_CODE (charset))
+ this_to = CHARSET_MAX_CODE (charset);
+ map_charset_chars (c_function, function, arg, charset,
+ this_from, this_to);
}
- else if (c >= 0240)
- c = c_save + DEFAULT_NONASCII_INSERT_OFFSET;
}
- return c;
}
+DEFUN ("map-charset-chars", Fmap_charset_chars, Smap_charset_chars, 2, 5, 0,
+ doc: /* Call FUNCTION for all characters in CHARSET.
+FUNCTION is called with an argument RANGE and the optional 3rd
+argument ARG.
-/* Convert the multibyte character C to unibyte 8-bit character based
- on Vnonascii_translation_table or nonascii_insert_offset. If
- REV_TBL is non-nil, it should be a reverse table of
- Vnonascii_translation_table, i.e. what given by:
- Fchar_table_extra_slot (Vnonascii_translation_table, make_number (0)) */
+RANGE is a cons (FROM . TO), where FROM and TO indicate a range of
+characters contained in CHARSET.
-int
-multibyte_char_to_unibyte (c, rev_tbl)
- int c;
- Lisp_Object rev_tbl;
+The optional 4th and 5th arguments FROM-CODE and TO-CODE specify the
+range of code points of target characters. */)
+ (function, charset, arg, from_code, to_code)
+ Lisp_Object function, charset, arg, from_code, to_code;
{
- if (!SINGLE_BYTE_CHAR_P (c))
+ struct charset *cs;
+ unsigned from, to;
+
+ CHECK_CHARSET_GET_CHARSET (charset, cs);
+ if (NILP (from_code))
+ from = CHARSET_MIN_CODE (cs);
+ else
+ {
+ CHECK_NATNUM (from_code);
+ from = XINT (from_code);
+ if (from < CHARSET_MIN_CODE (cs))
+ from = CHARSET_MIN_CODE (cs);
+ }
+ if (NILP (to_code))
+ to = CHARSET_MAX_CODE (cs);
+ else
+ {
+ CHECK_NATNUM (to_code);
+ to = XINT (to_code);
+ if (to > CHARSET_MAX_CODE (cs))
+ to = CHARSET_MAX_CODE (cs);
+ }
+ map_charset_chars (NULL, function, arg, cs, from, to);
+ return Qnil;
+}
+
+
+/* Define a charset according to the arguments. The Nth argument is
+ the Nth attribute of the charset (the last attribute `charset-id'
+ is not included). See the docstring of `define-charset' for the
+ detail. */
+
+DEFUN ("define-charset-internal", Fdefine_charset_internal,
+ Sdefine_charset_internal, charset_arg_max, MANY, 0,
+ doc: /* For internal use only.
+usage: (define-charset-internal ...) */)
+ (nargs, args)
+ int nargs;
+ Lisp_Object *args;
+{
+ /* Charset attr vector. */
+ Lisp_Object attrs;
+ Lisp_Object val;
+ unsigned hash_code;
+ struct Lisp_Hash_Table *hash_table = XHASH_TABLE (Vcharset_hash_table);
+ int i, j;
+ struct charset charset;
+ int id;
+ int dimension;
+ int new_definition_p;
+ int nchars;
+
+ if (nargs != charset_arg_max)
+ return Fsignal (Qwrong_number_of_arguments,
+ Fcons (intern ("define-charset-internal"),
+ make_number (nargs)));
+
+ attrs = Fmake_vector (make_number (charset_attr_max), Qnil);
+
+ CHECK_SYMBOL (args[charset_arg_name]);
+ ASET (attrs, charset_name, args[charset_arg_name]);
+
+ val = args[charset_arg_code_space];
+ for (i = 0, dimension = 0, nchars = 1; i < 4; i++)
{
- int c_save = c;
+ int min_byte, max_byte;
+
+ min_byte = XINT (Faref (val, make_number (i * 2)));
+ max_byte = XINT (Faref (val, make_number (i * 2 + 1)));
+ if (min_byte < 0 || min_byte > max_byte || max_byte >= 256)
+ error ("Invalid :code-space value");
+ charset.code_space[i * 4] = min_byte;
+ charset.code_space[i * 4 + 1] = max_byte;
+ charset.code_space[i * 4 + 2] = max_byte - min_byte + 1;
+ nchars *= charset.code_space[i * 4 + 2];
+ charset.code_space[i * 4 + 3] = nchars;
+ if (max_byte > 0)
+ dimension = i + 1;
+ }
+
+ val = args[charset_arg_dimension];
+ if (NILP (val))
+ charset.dimension = dimension;
+ else
+ {
+ CHECK_NATNUM (val);
+ charset.dimension = XINT (val);
+ if (charset.dimension < 1 || charset.dimension > 4)
+ args_out_of_range_3 (val, make_number (1), make_number (4));
+ }
+
+ charset.code_linear_p
+ = (charset.dimension == 1
+ || (charset.code_space[2] == 256
+ && (charset.dimension == 2
+ || (charset.code_space[6] == 256
+ && (charset.dimension == 3
+ || charset.code_space[10] == 256)))));
+
+ if (! charset.code_linear_p)
+ {
+ charset.code_space_mask = (unsigned char *) xmalloc (256);
+ bzero (charset.code_space_mask, 256);
+ for (i = 0; i < 4; i++)
+ for (j = charset.code_space[i * 4]; j <= charset.code_space[i * 4 + 1];
+ j++)
+ charset.code_space_mask[j] |= (1 << i);
+ }
+
+ charset.iso_chars_96 = charset.code_space[2] == 96;
- if (! CHAR_TABLE_P (rev_tbl)
- && CHAR_TABLE_P (Vnonascii_translation_table))
- rev_tbl = Fchar_table_extra_slot (Vnonascii_translation_table,
- make_number (0));
- if (CHAR_TABLE_P (rev_tbl))
+ charset.min_code = (charset.code_space[0]
+ | (charset.code_space[4] << 8)
+ | (charset.code_space[8] << 16)
+ | (charset.code_space[12] << 24));
+ charset.max_code = (charset.code_space[1]
+ | (charset.code_space[5] << 8)
+ | (charset.code_space[9] << 16)
+ | (charset.code_space[13] << 24));
+ charset.char_index_offset = 0;
+
+ val = args[charset_arg_min_code];
+ if (! NILP (val))
+ {
+ unsigned code;
+
+ if (INTEGERP (val))
+ code = XINT (val);
+ else
{
- Lisp_Object temp;
- temp = Faref (rev_tbl, make_number (c));
- if (INTEGERP (temp))
- c = XINT (temp);
- if (c >= 256)
- c = (c_save & 0177) + 0200;
+ CHECK_CONS (val);
+ CHECK_NUMBER_CAR (val);
+ CHECK_NUMBER_CDR (val);
+ code = (XINT (XCAR (val)) << 16) | (XINT (XCDR (val)));
}
+ if (code < charset.min_code
+ || code > charset.max_code)
+ args_out_of_range_3 (make_number (charset.min_code),
+ make_number (charset.max_code), val);
+ charset.char_index_offset = CODE_POINT_TO_INDEX (&charset, code);
+ charset.min_code = code;
+ }
+
+ val = args[charset_arg_max_code];
+ if (! NILP (val))
+ {
+ unsigned code;
+
+ if (INTEGERP (val))
+ code = XINT (val);
else
{
- if (nonascii_insert_offset > 0)
- c -= nonascii_insert_offset;
- if (c < 128 || c >= 256)
- c = (c_save & 0177) + 0200;
+ CHECK_CONS (val);
+ CHECK_NUMBER_CAR (val);
+ CHECK_NUMBER_CDR (val);
+ code = (XINT (XCAR (val)) << 16) | (XINT (XCDR (val)));
}
+ if (code < charset.min_code
+ || code > charset.max_code)
+ args_out_of_range_3 (make_number (charset.min_code),
+ make_number (charset.max_code), val);
+ charset.max_code = code;
}
- return c;
-}
+ charset.compact_codes_p = charset.max_code < 0x1000000;
-
-/* Update the table Vcharset_table with the given arguments (see the
- document of `define-charset' for the meaning of each argument).
- Several other table contents are also updated. The caller should
- check the validity of CHARSET-ID and the remaining arguments in
- advance. */
+ val = args[charset_arg_invalid_code];
+ if (NILP (val))
+ {
+ if (charset.min_code > 0)
+ charset.invalid_code = 0;
+ else
+ {
+ XSETINT (val, charset.max_code + 1);
+ if (XINT (val) == charset.max_code + 1)
+ charset.invalid_code = charset.max_code + 1;
+ else
+ error ("Attribute :invalid-code must be specified");
+ }
+ }
+ else
+ {
+ CHECK_NATNUM (val);
+ charset.invalid_code = XFASTINT (val);
+ }
-void
-update_charset_table (charset_id, dimension, chars, width, direction,
- iso_final_char, iso_graphic_plane,
- short_name, long_name, description)
- Lisp_Object charset_id, dimension, chars, width, direction;
- Lisp_Object iso_final_char, iso_graphic_plane;
- Lisp_Object short_name, long_name, description;
-{
- int charset = XINT (charset_id);
- int bytes;
- unsigned char leading_code_base, leading_code_ext;
-
- if (NILP (CHARSET_TABLE_ENTRY (charset)))
- CHARSET_TABLE_ENTRY (charset)
- = Fmake_vector (make_number (CHARSET_MAX_IDX), Qnil);
-
- if (NILP (long_name))
- long_name = short_name;
- if (NILP (description))
- description = long_name;
-
- /* Get byte length of multibyte form, base leading-code, and
- extended leading-code of the charset. See the comment under the
- title "GENERAL NOTE on CHARACTER SET (CHARSET)" in charset.h. */
- bytes = XINT (dimension);
- if (charset < MIN_CHARSET_PRIVATE_DIMENSION1)
- {
- /* Official charset, it doesn't have an extended leading-code. */
- if (charset != CHARSET_ASCII && charset != CHARSET_8_BIT_GRAPHIC)
- bytes += 1; /* For a base leading-code. */
- leading_code_base = charset;
- leading_code_ext = 0;
+ val = args[charset_arg_iso_final];
+ if (NILP (val))
+ charset.iso_final = -1;
+ else
+ {
+ CHECK_NUMBER (val);
+ if (XINT (val) < '0' || XINT (val) > 127)
+ error ("Invalid iso-final-char: %d", XINT (val));
+ charset.iso_final = XINT (val);
}
+
+ val = args[charset_arg_iso_revision];
+ if (NILP (val))
+ charset.iso_revision = -1;
else
{
- /* Private charset. */
- bytes += 2; /* For base and extended leading-codes. */
- leading_code_base
- = (charset < LEADING_CODE_EXT_12
- ? LEADING_CODE_PRIVATE_11
- : (charset < LEADING_CODE_EXT_21
- ? LEADING_CODE_PRIVATE_12
- : (charset < LEADING_CODE_EXT_22
- ? LEADING_CODE_PRIVATE_21
- : LEADING_CODE_PRIVATE_22)));
- leading_code_ext = charset;
- if (BYTES_BY_CHAR_HEAD (leading_code_base) != bytes)
- error ("Invalid dimension for the charset-ID %d", charset);
- }
-
- CHARSET_TABLE_INFO (charset, CHARSET_ID_IDX) = charset_id;
- CHARSET_TABLE_INFO (charset, CHARSET_BYTES_IDX) = make_number (bytes);
- CHARSET_TABLE_INFO (charset, CHARSET_DIMENSION_IDX) = dimension;
- CHARSET_TABLE_INFO (charset, CHARSET_CHARS_IDX) = chars;
- CHARSET_TABLE_INFO (charset, CHARSET_WIDTH_IDX) = width;
- CHARSET_TABLE_INFO (charset, CHARSET_DIRECTION_IDX) = direction;
- CHARSET_TABLE_INFO (charset, CHARSET_LEADING_CODE_BASE_IDX)
- = make_number (leading_code_base);
- CHARSET_TABLE_INFO (charset, CHARSET_LEADING_CODE_EXT_IDX)
- = make_number (leading_code_ext);
- CHARSET_TABLE_INFO (charset, CHARSET_ISO_FINAL_CHAR_IDX) = iso_final_char;
- CHARSET_TABLE_INFO (charset, CHARSET_ISO_GRAPHIC_PLANE_IDX)
- = iso_graphic_plane;
- CHARSET_TABLE_INFO (charset, CHARSET_SHORT_NAME_IDX) = short_name;
- CHARSET_TABLE_INFO (charset, CHARSET_LONG_NAME_IDX) = long_name;
- CHARSET_TABLE_INFO (charset, CHARSET_DESCRIPTION_IDX) = description;
- CHARSET_TABLE_INFO (charset, CHARSET_PLIST_IDX) = Qnil;
+ CHECK_NUMBER (val);
+ if (XINT (val) > 63)
+ args_out_of_range (make_number (63), val);
+ charset.iso_revision = XINT (val);
+ }
- {
- /* If we have already defined a charset which has the same
- DIMENSION, CHARS and ISO-FINAL-CHAR but the different
- DIRECTION, we must update the entry REVERSE-CHARSET of both
- charsets. If there's no such charset, the value of the entry
- is set to nil. */
- int i;
-
- for (i = 0; i <= MAX_CHARSET; i++)
- if (!NILP (CHARSET_TABLE_ENTRY (i)))
+ val = args[charset_arg_emacs_mule_id];
+ if (NILP (val))
+ charset.emacs_mule_id = -1;
+ else
+ {
+ CHECK_NATNUM (val);
+ if ((XINT (val) > 0 && XINT (val) <= 128) || XINT (val) >= 256)
+ error ("Invalid emacs-mule-id: %d", XINT (val));
+ charset.emacs_mule_id = XINT (val);
+ }
+
+ charset.ascii_compatible_p = ! NILP (args[charset_arg_ascii_compatible_p]);
+
+ charset.supplementary_p = ! NILP (args[charset_arg_supplementary_p]);
+
+ charset.unified_p = 0;
+
+ bzero (charset.fast_map, sizeof (charset.fast_map));
+
+ if (! NILP (args[charset_arg_code_offset]))
+ {
+ val = args[charset_arg_code_offset];
+ CHECK_NUMBER (val);
+
+ charset.method = CHARSET_METHOD_OFFSET;
+ charset.code_offset = XINT (val);
+
+ i = CODE_POINT_TO_INDEX (&charset, charset.min_code);
+ charset.min_char = i + charset.code_offset;
+ i = CODE_POINT_TO_INDEX (&charset, charset.max_code);
+ charset.max_char = i + charset.code_offset;
+ if (charset.max_char > MAX_CHAR)
+ error ("Unsupported max char: %d", charset.max_char);
+
+ i = (charset.min_char >> 7) << 7;
+ for (; i < 0x10000 && i <= charset.max_char; i += 128)
+ CHARSET_FAST_MAP_SET (i, charset.fast_map);
+ i = (i >> 12) << 12;
+ for (; i <= charset.max_char; i += 0x1000)
+ CHARSET_FAST_MAP_SET (i, charset.fast_map);
+ }
+ else if (! NILP (args[charset_arg_map]))
+ {
+ val = args[charset_arg_map];
+ ASET (attrs, charset_map, val);
+ if (STRINGP (val))
+ load_charset_map_from_file (&charset, val, 0);
+ else
+ load_charset_map_from_vector (&charset, val, 0);
+ charset.method = CHARSET_METHOD_MAP_DEFERRED;
+ }
+ else if (! NILP (args[charset_arg_subset]))
+ {
+ Lisp_Object parent;
+ Lisp_Object parent_min_code, parent_max_code, parent_code_offset;
+ struct charset *parent_charset;
+
+ val = args[charset_arg_subset];
+ parent = Fcar (val);
+ CHECK_CHARSET_GET_CHARSET (parent, parent_charset);
+ parent_min_code = Fnth (make_number (1), val);
+ CHECK_NATNUM (parent_min_code);
+ parent_max_code = Fnth (make_number (2), val);
+ CHECK_NATNUM (parent_max_code);
+ parent_code_offset = Fnth (make_number (3), val);
+ CHECK_NUMBER (parent_code_offset);
+ val = Fmake_vector (make_number (4), Qnil);
+ ASET (val, 0, make_number (parent_charset->id));
+ ASET (val, 1, parent_min_code);
+ ASET (val, 2, parent_max_code);
+ ASET (val, 3, parent_code_offset);
+ ASET (attrs, charset_subset, val);
+
+ charset.method = CHARSET_METHOD_SUBSET;
+ /* Here, we just copy the parent's fast_map. It's not accurate,
+ but at least it works for quickly detecting which character
+ DOESN'T belong to this charset. */
+ for (i = 0; i < 190; i++)
+ charset.fast_map[i] = parent_charset->fast_map[i];
+
+ /* We also copy these for parents. */
+ charset.min_char = parent_charset->min_char;
+ charset.max_char = parent_charset->max_char;
+ }
+ else if (! NILP (args[charset_arg_superset]))
+ {
+ val = args[charset_arg_superset];
+ charset.method = CHARSET_METHOD_SUPERSET;
+ val = Fcopy_sequence (val);
+ ASET (attrs, charset_superset, val);
+
+ charset.min_char = MAX_CHAR;
+ charset.max_char = 0;
+ for (; ! NILP (val); val = Fcdr (val))
{
- if (CHARSET_DIMENSION (i) == XINT (dimension)
- && CHARSET_CHARS (i) == XINT (chars)
- && CHARSET_ISO_FINAL_CHAR (i) == XINT (iso_final_char)
- && CHARSET_DIRECTION (i) != XINT (direction))
+ Lisp_Object elt, car_part, cdr_part;
+ int this_id, offset;
+ struct charset *this_charset;
+
+ elt = Fcar (val);
+ if (CONSP (elt))
{
- CHARSET_TABLE_INFO (charset, CHARSET_REVERSE_CHARSET_IDX)
- = make_number (i);
- CHARSET_TABLE_INFO (i, CHARSET_REVERSE_CHARSET_IDX) = charset_id;
- break;
+ car_part = XCAR (elt);
+ cdr_part = XCDR (elt);
+ CHECK_CHARSET_GET_ID (car_part, this_id);
+ CHECK_NUMBER (cdr_part);
+ offset = XINT (cdr_part);
}
+ else
+ {
+ CHECK_CHARSET_GET_ID (elt, this_id);
+ offset = 0;
+ }
+ XSETCAR (val, Fcons (make_number (this_id), make_number (offset)));
+
+ this_charset = CHARSET_FROM_ID (this_id);
+ if (charset.min_char > this_charset->min_char)
+ charset.min_char = this_charset->min_char;
+ if (charset.max_char < this_charset->max_char)
+ charset.max_char = this_charset->max_char;
+ for (i = 0; i < 190; i++)
+ charset.fast_map[i] |= this_charset->fast_map[i];
}
- if (i > MAX_CHARSET)
- /* No such a charset. */
- CHARSET_TABLE_INFO (charset, CHARSET_REVERSE_CHARSET_IDX)
- = make_number (-1);
- }
+ }
+ else
+ error ("None of :code-offset, :map, :parents are specified");
+
+ val = args[charset_arg_unify_map];
+ if (! NILP (val) && !STRINGP (val))
+ CHECK_VECTOR (val);
+ ASET (attrs, charset_unify_map, val);
+
+ CHECK_LIST (args[charset_arg_plist]);
+ ASET (attrs, charset_plist, args[charset_arg_plist]);
- if (charset != CHARSET_ASCII && charset != CHARSET_8_BIT_GRAPHIC
- && charset < MIN_CHARSET_PRIVATE_DIMENSION1)
+ charset.hash_index = hash_lookup (hash_table, args[charset_arg_name],
+ &hash_code);
+ if (charset.hash_index >= 0)
+ {
+ new_definition_p = 0;
+ id = XFASTINT (CHARSET_SYMBOL_ID (args[charset_arg_name]));
+ HASH_VALUE (hash_table, charset.hash_index) = attrs;
+ }
+ else
{
- bytes_by_char_head[leading_code_base] = bytes;
- width_by_char_head[leading_code_base] = XINT (width);
+ charset.hash_index = hash_put (hash_table, args[charset_arg_name], attrs,
+ hash_code);
+ if (charset_table_used == charset_table_size)
+ {
+ struct charset *new_table
+ = (struct charset *) xmalloc (sizeof (struct charset)
+ * (charset_table_size + 16));
+ bcopy (charset_table, new_table,
+ sizeof (struct charset) * charset_table_size);
+ charset_table_size += 16;
+ charset_table = new_table;
+ }
+ id = charset_table_used++;
+ new_definition_p = 1;
+ }
+
+ ASET (attrs, charset_id, make_number (id));
+ charset.id = id;
+ charset_table[id] = charset;
- /* Update table emacs_code_class. */
- emacs_code_class[charset] = (bytes == 2
- ? EMACS_leading_code_2
- : (bytes == 3
- ? EMACS_leading_code_3
- : EMACS_leading_code_4));
+ if (charset.iso_final >= 0)
+ {
+ ISO_CHARSET_TABLE (charset.dimension, charset.iso_chars_96,
+ charset.iso_final) = id;
+ if (new_definition_p)
+ Viso_2022_charset_list = nconc2 (Viso_2022_charset_list,
+ Fcons (make_number (id), Qnil));
+ if (ISO_CHARSET_TABLE (1, 0, 'J') == id)
+ charset_jisx0201_roman = id;
+ else if (ISO_CHARSET_TABLE (2, 0, '@') == id)
+ charset_jisx0208_1978 = id;
+ else if (ISO_CHARSET_TABLE (2, 0, 'B') == id)
+ charset_jisx0208 = id;
+ }
+
+ if (charset.emacs_mule_id >= 0)
+ {
+ emacs_mule_charset[charset.emacs_mule_id] = CHARSET_FROM_ID (id);
+ if (charset.emacs_mule_id < 0xA0)
+ emacs_mule_bytes[charset.emacs_mule_id] = charset.dimension + 1;
+ else
+ emacs_mule_bytes[charset.emacs_mule_id] = charset.dimension + 2;
+ if (new_definition_p)
+ Vemacs_mule_charset_list = nconc2 (Vemacs_mule_charset_list,
+ Fcons (make_number (id), Qnil));
}
- /* Update table iso_charset_table. */
- if (XINT (iso_final_char) >= 0
- && ISO_CHARSET_TABLE (dimension, chars, iso_final_char) < 0)
- ISO_CHARSET_TABLE (dimension, chars, iso_final_char) = charset;
+ if (new_definition_p)
+ {
+ Vcharset_list = Fcons (args[charset_arg_name], Vcharset_list);
+ Vcharset_ordered_list = nconc2 (Vcharset_ordered_list,
+ Fcons (make_number (id), Qnil));
+ charset_ordered_list_tick++;
+ }
+
+ return Qnil;
}
-#ifdef emacs
-/* Return charset id of CHARSET_SYMBOL, or return -1 if CHARSET_SYMBOL
- is invalid. */
-int
-get_charset_id (charset_symbol)
- Lisp_Object charset_symbol;
+/* Same as Fdefine_charset_internal but arguments are more convenient
+ to call from C (typically in syms_of_charset). This can define a
+ charset of `offset' method only. Return the ID of the new
+ charset. */
+
+static int
+define_charset_internal (name, dimension, code_space, min_code, max_code,
+ iso_final, iso_revision, emacs_mule_id,
+ ascii_compatible, supplementary,
+ code_offset)
+ Lisp_Object name;
+ int dimension;
+ unsigned char *code_space;
+ unsigned min_code, max_code;
+ int iso_final, iso_revision, emacs_mule_id;
+ int ascii_compatible, supplementary;
+ int code_offset;
{
+ Lisp_Object args[charset_arg_max];
+ Lisp_Object plist[14];
Lisp_Object val;
- int charset;
-
- /* This originally used a ?: operator, but reportedly the HP-UX
- compiler version HP92453-01 A.10.32.22 miscompiles that. */
- if (SYMBOLP (charset_symbol)
- && VECTORP (val = Fget (charset_symbol, Qcharset))
- && CHARSET_VALID_P (charset =
- XINT (XVECTOR (val)->contents[CHARSET_ID_IDX])))
- return charset;
- else
- return -1;
+ int i;
+
+ args[charset_arg_name] = name;
+ args[charset_arg_dimension] = make_number (dimension);
+ val = Fmake_vector (make_number (8), make_number (0));
+ for (i = 0; i < 8; i++)
+ ASET (val, i, make_number (code_space[i]));
+ args[charset_arg_code_space] = val;
+ args[charset_arg_min_code] = make_number (min_code);
+ args[charset_arg_max_code] = make_number (max_code);
+ args[charset_arg_iso_final]
+ = (iso_final < 0 ? Qnil : make_number (iso_final));
+ args[charset_arg_iso_revision] = make_number (iso_revision);
+ args[charset_arg_emacs_mule_id]
+ = (emacs_mule_id < 0 ? Qnil : make_number (emacs_mule_id));
+ args[charset_arg_ascii_compatible_p] = ascii_compatible ? Qt : Qnil;
+ args[charset_arg_supplementary_p] = supplementary ? Qt : Qnil;
+ args[charset_arg_invalid_code] = Qnil;
+ args[charset_arg_code_offset] = make_number (code_offset);
+ args[charset_arg_map] = Qnil;
+ args[charset_arg_subset] = Qnil;
+ args[charset_arg_superset] = Qnil;
+ args[charset_arg_unify_map] = Qnil;
+
+ plist[0] = intern (":name");
+ plist[1] = args[charset_arg_name];
+ plist[2] = intern (":dimension");
+ plist[3] = args[charset_arg_dimension];
+ plist[4] = intern (":code-space");
+ plist[5] = args[charset_arg_code_space];
+ plist[6] = intern (":iso-final-char");
+ plist[7] = args[charset_arg_iso_final];
+ plist[8] = intern (":emacs-mule-id");
+ plist[9] = args[charset_arg_emacs_mule_id];
+ plist[10] = intern (":ascii-compatible-p");
+ plist[11] = args[charset_arg_ascii_compatible_p];
+ plist[12] = intern (":code-offset");
+ plist[13] = args[charset_arg_code_offset];
+
+ args[charset_arg_plist] = Flist (14, plist);
+ Fdefine_charset_internal (charset_arg_max, args);
+
+ return XINT (CHARSET_SYMBOL_ID (name));
}
-/* Return an identification number for a new private charset of
- DIMENSION and WIDTH. If there's no more room for the new charset,
- return 0. */
-Lisp_Object
-get_new_private_charset_id (dimension, width)
- int dimension, width;
+
+DEFUN ("define-charset-alias", Fdefine_charset_alias,
+ Sdefine_charset_alias, 2, 2, 0,
+ doc: /* Define ALIAS as an alias for charset CHARSET. */)
+ (alias, charset)
+ Lisp_Object alias, charset;
{
- int charset, from, to;
+ Lisp_Object attr;
- if (dimension == 1)
- {
- from = LEADING_CODE_EXT_11;
- to = LEADING_CODE_EXT_21;
- }
- else
+ CHECK_CHARSET_GET_ATTR (charset, attr);
+ Fputhash (alias, attr, Vcharset_hash_table);
+ Vcharset_list = Fcons (alias, Vcharset_list);
+ return Qnil;
+}
+
+
+DEFUN ("unibyte-charset", Funibyte_charset, Sunibyte_charset, 0, 0, 0,
+ doc: /* Return the unibyte charset (set by `set-unibyte-charset'). */)
+ ()
+{
+ return CHARSET_NAME (CHARSET_FROM_ID (charset_unibyte));
+}
+
+
+DEFUN ("set-unibyte-charset", Fset_unibyte_charset, Sset_unibyte_charset,
+ 1, 1, 0,
+ doc: /* Set the unibyte charset to CHARSET.
+This determines how unibyte/multibyte conversion is done. See also
+function `unibyte-charset'. */)
+ (charset)
+ Lisp_Object charset;
+{
+ struct charset *cs;
+ int i, c;
+
+ CHECK_CHARSET_GET_CHARSET (charset, cs);
+ if (! cs->ascii_compatible_p
+ || cs->dimension != 1)
+ error ("Inappropriate unibyte charset: %s", SDATA (SYMBOL_NAME (charset)));
+ charset_unibyte = cs->id;
+ memset (unibyte_has_multibyte_table, 1, 128);
+ for (i = 128; i < 256; i++)
{
- from = LEADING_CODE_EXT_21;
- to = LEADING_CODE_EXT_MAX + 1;
+ c = DECODE_CHAR (cs, i);
+ unibyte_to_multibyte_table[i] = (c < 0 ? BYTE8_TO_CHAR (i) : c);
+ unibyte_has_multibyte_table[i] = c >= 0;
}
- for (charset = from; charset < to; charset++)
- if (!CHARSET_DEFINED_P (charset)) break;
+ return Qnil;
+}
+
- return make_number (charset < to ? charset : 0);
+DEFUN ("charset-plist", Fcharset_plist, Scharset_plist, 1, 1, 0,
+ doc: /* Return the property list of CHARSET. */)
+ (charset)
+ Lisp_Object charset;
+{
+ Lisp_Object attrs;
+
+ CHECK_CHARSET_GET_ATTR (charset, attrs);
+ return CHARSET_ATTR_PLIST (attrs);
}
-DEFUN ("define-charset", Fdefine_charset, Sdefine_charset, 3, 3, 0,
- doc: /* Define CHARSET-ID as the identification number of CHARSET with INFO-VECTOR.
-If CHARSET-ID is nil, it is decided automatically, which means CHARSET is
- treated as a private charset.
-INFO-VECTOR is a vector of the format:
- [DIMENSION CHARS WIDTH DIRECTION ISO-FINAL-CHAR ISO-GRAPHIC-PLANE
- SHORT-NAME LONG-NAME DESCRIPTION]
-The meanings of each elements is as follows:
-DIMENSION (integer) is the number of bytes to represent a character: 1 or 2.
-CHARS (integer) is the number of characters in a dimension: 94 or 96.
-WIDTH (integer) is the number of columns a character in the charset
-occupies on the screen: one of 0, 1, and 2.
-
-DIRECTION (integer) is the rendering direction of characters in the
-charset when rendering. If 0, render from left to right, else
-render from right to left.
-
-ISO-FINAL-CHAR (character) is the final character of the
-corresponding ISO 2022 charset.
-It may be -1 if the charset is internal use only.
-
-ISO-GRAPHIC-PLANE (integer) is the graphic plane to be invoked
-while encoding to variants of ISO 2022 coding system, one of the
-following: 0/graphic-plane-left(GL), 1/graphic-plane-right(GR).
-It may be -1 if the charset is internal use only.
-
-SHORT-NAME (string) is the short name to refer to the charset.
-
-LONG-NAME (string) is the long name to refer to the charset.
-
-DESCRIPTION (string) is the description string of the charset. */)
- (charset_id, charset_symbol, info_vector)
- Lisp_Object charset_id, charset_symbol, info_vector;
+
+DEFUN ("set-charset-plist", Fset_charset_plist, Sset_charset_plist, 2, 2, 0,
+ doc: /* Set CHARSET's property list to PLIST. */)
+ (charset, plist)
+ Lisp_Object charset, plist;
{
- Lisp_Object *vec;
-
- if (!NILP (charset_id))
- CHECK_NUMBER (charset_id);
- CHECK_SYMBOL (charset_symbol);
- CHECK_VECTOR (info_vector);
-
- if (! NILP (charset_id))
- {
- if (! CHARSET_VALID_P (XINT (charset_id)))
- error ("Invalid CHARSET: %d", XINT (charset_id));
- else if (CHARSET_DEFINED_P (XINT (charset_id)))
- error ("Already defined charset: %d", XINT (charset_id));
- }
-
- vec = XVECTOR (info_vector)->contents;
- if (XVECTOR (info_vector)->size != 9
- || !INTEGERP (vec[0]) || !(XINT (vec[0]) == 1 || XINT (vec[0]) == 2)
- || !INTEGERP (vec[1]) || !(XINT (vec[1]) == 94 || XINT (vec[1]) == 96)
- || !INTEGERP (vec[2]) || !(XINT (vec[2]) == 1 || XINT (vec[2]) == 2)
- || !INTEGERP (vec[3]) || !(XINT (vec[3]) == 0 || XINT (vec[3]) == 1)
- || !INTEGERP (vec[4])
- || !(XINT (vec[4]) == -1 || (XINT (vec[4]) >= '0' && XINT (vec[4]) <= '~'))
- || !INTEGERP (vec[5])
- || !(XINT (vec[5]) == -1 || XINT (vec[5]) == 0 || XINT (vec[5]) == 1)
- || !STRINGP (vec[6])
- || !STRINGP (vec[7])
- || !STRINGP (vec[8]))
- error ("Invalid info-vector argument for defining charset %s",
- SDATA (SYMBOL_NAME (charset_symbol)));
-
- if (NILP (charset_id))
- {
- charset_id = get_new_private_charset_id (XINT (vec[0]), XINT (vec[2]));
- if (XINT (charset_id) == 0)
- error ("There's no room for a new private charset %s",
- SDATA (SYMBOL_NAME (charset_symbol)));
- }
-
- update_charset_table (charset_id, vec[0], vec[1], vec[2], vec[3],
- vec[4], vec[5], vec[6], vec[7], vec[8]);
- Fput (charset_symbol, Qcharset, CHARSET_TABLE_ENTRY (XINT (charset_id)));
- CHARSET_SYMBOL (XINT (charset_id)) = charset_symbol;
- Vcharset_list = Fcons (charset_symbol, Vcharset_list);
- Fupdate_coding_systems_internal ();
- return Qnil;
+ Lisp_Object attrs;
+
+ CHECK_CHARSET_GET_ATTR (charset, attrs);
+ CHARSET_ATTR_PLIST (attrs) = plist;
+ return plist;
}
-DEFUN ("generic-character-list", Fgeneric_character_list,
- Sgeneric_character_list, 0, 0, 0,
- doc: /* Return a list of all possible generic characters.
-It includes a generic character for a charset not yet defined. */)
- ()
+
+DEFUN ("unify-charset", Funify_charset, Sunify_charset, 1, 3, 0,
+ doc: /* Unify characters of CHARSET with Unicode.
+This means reading the relevant file and installing the table defined
+by CHARSET's `:unify-map' property.
+
+Optional second arg UNIFY-MAP is a file name string or a vector. It has
+the same meaning as the `:unify-map' attribute in the function
+`define-charset' (which see).
+
+Optional third argument DEUNIFY, if non-nil, means to de-unify CHARSET. */)
+ (charset, unify_map, deunify)
+ Lisp_Object charset, unify_map, deunify;
{
- return Vgeneric_character_list;
+ int id;
+ struct charset *cs;
+
+ CHECK_CHARSET_GET_ID (charset, id);
+ cs = CHARSET_FROM_ID (id);
+ if (CHARSET_METHOD (cs) == CHARSET_METHOD_MAP_DEFERRED)
+ load_charset (cs);
+ if (NILP (deunify)
+ ? CHARSET_UNIFIED_P (cs) && ! NILP (CHARSET_DEUNIFIER (cs))
+ : ! CHARSET_UNIFIED_P (cs))
+ return Qnil;
+
+ CHARSET_UNIFIED_P (cs) = 0;
+ if (NILP (deunify))
+ {
+ if (CHARSET_METHOD (cs) != CHARSET_METHOD_OFFSET)
+ error ("Can't unify charset: %s", SDATA (SYMBOL_NAME (charset)));
+ if (NILP (unify_map))
+ unify_map = CHARSET_UNIFY_MAP (cs);
+ if (STRINGP (unify_map))
+ load_charset_map_from_file (cs, unify_map, 2);
+ else if (VECTORP (unify_map))
+ load_charset_map_from_vector (cs, unify_map, 2);
+ else if (NILP (unify_map))
+ error ("No unify-map for charset");
+ else
+ error ("Bad unify-map arg");
+ CHARSET_UNIFIED_P (cs) = 1;
+ }
+ else if (CHAR_TABLE_P (Vchar_unify_table))
+ {
+ int min_code = CHARSET_MIN_CODE (cs);
+ int max_code = CHARSET_MAX_CODE (cs);
+ int min_char = DECODE_CHAR (cs, min_code);
+ int max_char = DECODE_CHAR (cs, max_code);
+
+ char_table_set_range (Vchar_unify_table, min_char, max_char, Qnil);
+ }
+
+ return Qnil;
}
DEFUN ("get-unused-iso-final-char", Fget_unused_iso_final_char,
Sget_unused_iso_final_char, 2, 2, 0,
- doc: /* Return an unused ISO's final char for a charset of DIMENSION and CHARS.
+ doc: /*
+Return an unused ISO final char for a charset of DIMENISION and CHARS.
DIMENSION is the number of bytes to represent a character: 1 or 2.
CHARS is the number of characters in a dimension: 94 or 96.
@@ -750,20 +1278,33 @@ return nil. */)
CHECK_NUMBER (dimension);
CHECK_NUMBER (chars);
- if (XINT (dimension) != 1 && XINT (dimension) != 2)
- error ("Invalid charset dimension %d, it should be 1 or 2",
- XINT (dimension));
+ if (XINT (dimension) != 1 && XINT (dimension) != 2 && XINT (dimension) != 3)
+ args_out_of_range_3 (dimension, make_number (1), make_number (3));
if (XINT (chars) != 94 && XINT (chars) != 96)
- error ("Invalid charset chars %d, it should be 94 or 96",
- XINT (chars));
+ args_out_of_range_3 (chars, make_number (94), make_number (96));
for (final_char = '0'; final_char <= '?'; final_char++)
- {
- if (ISO_CHARSET_TABLE (dimension, chars, make_number (final_char)) < 0)
- break;
- }
+ if (ISO_CHARSET_TABLE (XINT (dimension), XINT (chars), final_char) < 0)
+ break;
return (final_char <= '?' ? make_number (final_char) : Qnil);
}
+static void
+check_iso_charset_parameter (dimension, chars, final_char)
+ Lisp_Object dimension, chars, final_char;
+{
+ CHECK_NATNUM (dimension);
+ CHECK_NATNUM (chars);
+ CHECK_NATNUM (final_char);
+
+ if (XINT (dimension) > 3)
+ error ("Invalid DIMENSION %d, it should be 1, 2, or 3", XINT (dimension));
+ if (XINT (chars) != 94 && XINT (chars) != 96)
+ error ("Invalid CHARS %d, it should be 94 or 96", XINT (chars));
+ if (XINT (final_char) < '0' || XINT (final_char) > '~')
+ error ("Invalid FINAL-CHAR %c, it should be `0'..`~'", XINT (chars));
+}
+
+
DEFUN ("declare-equiv-charset", Fdeclare_equiv_charset, Sdeclare_equiv_charset,
4, 4, 0,
doc: /* Declare an equivalent charset for ISO-2022 decoding.
@@ -774,104 +1315,96 @@ if CHARSET is designated instead. */)
(dimension, chars, final_char, charset)
Lisp_Object dimension, chars, final_char, charset;
{
- int charset_id;
-
- CHECK_NUMBER (dimension);
- CHECK_NUMBER (chars);
- CHECK_NUMBER (final_char);
- CHECK_SYMBOL (charset);
-
- if (XINT (dimension) != 1 && XINT (dimension) != 2)
- error ("Invalid DIMENSION %d, it should be 1 or 2", XINT (dimension));
- if (XINT (chars) != 94 && XINT (chars) != 96)
- error ("Invalid CHARS %d, it should be 94 or 96", XINT (chars));
- if (XINT (final_char) < '0' || XFASTINT (final_char) > '~')
- error ("Invalid FINAL-CHAR %c, it should be `0'..`~'", XINT (chars));
- if ((charset_id = get_charset_id (charset)) < 0)
- error ("Invalid charset %s", SDATA (SYMBOL_NAME (charset)));
+ int id;
+ int chars_flag;
- ISO_CHARSET_TABLE (dimension, chars, final_char) = charset_id;
+ CHECK_CHARSET_GET_ID (charset, id);
+ check_iso_charset_parameter (dimension, chars, final_char);
+ chars_flag = XINT (chars) == 96;
+ ISO_CHARSET_TABLE (XINT (dimension), chars_flag, XINT (final_char)) = id;
return Qnil;
}
+
/* Return information about charsets in the text at PTR of NBYTES
bytes, which are NCHARS characters. The value is:
0: Each character is represented by one byte. This is always
- true for unibyte text.
- 1: No charsets other than ascii eight-bit-control,
- eight-bit-graphic, and latin-1 are found.
- 2: Otherwise.
+ true for a unibyte string. For a multibyte string, true if
+ it contains only ASCII characters.
+
+ 1: No charsets other than ascii, control-1, and latin-1 are
+ found.
- In addition, if CHARSETS is nonzero, for each found charset N, set
- CHARSETS[N] to 1. For that, callers should allocate CHARSETS
- (MAX_CHARSET + 1 elements) in advance. It may lookup a translation
- table TABLE if supplied. For invalid charsets, set CHARSETS[1] to
- 1 (note that there's no charset whose ID is 1). */
+ 2: Otherwise.
+*/
int
-find_charset_in_text (ptr, nchars, nbytes, charsets, table)
- const unsigned char *ptr;
- int nchars, nbytes, *charsets;
- Lisp_Object table;
+string_xstring_p (string)
+ Lisp_Object string;
{
- if (nchars == nbytes)
- {
- if (charsets && nbytes > 0)
- {
- const unsigned char *endp = ptr + nbytes;
- int maskbits = 0;
+ const unsigned char *p = SDATA (string);
+ const unsigned char *endp = p + SBYTES (string);
- while (ptr < endp && maskbits != 7)
- {
- maskbits |= (*ptr < 0x80 ? 1 : *ptr < 0xA0 ? 2 : 4);
- ptr++;
- }
+ if (SCHARS (string) == SBYTES (string))
+ return 0;
- if (maskbits & 1)
- charsets[CHARSET_ASCII] = 1;
- if (maskbits & 2)
- charsets[CHARSET_8_BIT_CONTROL] = 1;
- if (maskbits & 4)
- charsets[CHARSET_8_BIT_GRAPHIC] = 1;
- }
- return 0;
- }
- else
+ while (p < endp)
{
- int return_val = 1;
- int bytes, charset, c1, c2;
+ int c = STRING_CHAR_ADVANCE (p);
- if (! CHAR_TABLE_P (table))
- table = Qnil;
+ if (c >= 0x100)
+ return 2;
+ }
+ return 1;
+}
- while (nchars-- > 0)
- {
- SPLIT_MULTIBYTE_SEQ (ptr, len, bytes, charset, c1, c2);
- ptr += bytes;
- if (!CHARSET_DEFINED_P (charset))
- charset = 1;
- else if (! NILP (table))
- {
- int c = translate_char (table, -1, charset, c1, c2);
- if (c >= 0)
- charset = CHAR_CHARSET (c);
- }
+/* Find charsets in the string at PTR of NCHARS and NBYTES.
- if (return_val == 1
- && charset != CHARSET_ASCII
- && charset != CHARSET_8_BIT_CONTROL
- && charset != CHARSET_8_BIT_GRAPHIC
- && charset != charset_latin_iso8859_1)
- return_val = 2;
+ CHARSETS is a vector. If Nth element is non-nil, it means the
+ charset whose id is N is already found.
- if (charsets)
- charsets[charset] = 1;
- else if (return_val == 2)
- break;
+ It may lookup a translation table TABLE if supplied. */
+
+static void
+find_charsets_in_text (ptr, nchars, nbytes, charsets, table, multibyte)
+ const unsigned char *ptr;
+ EMACS_INT nchars, nbytes;
+ Lisp_Object charsets, table;
+ int multibyte;
+{
+ const unsigned char *pend = ptr + nbytes;
+
+ if (nchars == nbytes)
+ {
+ if (multibyte)
+ ASET (charsets, charset_ascii, Qt);
+ else
+ while (ptr < pend)
+ {
+ int c = *ptr++;
+
+ if (!NILP (table))
+ c = translate_char (table, c);
+ if (ASCII_BYTE_P (c))
+ ASET (charsets, charset_ascii, Qt);
+ else
+ ASET (charsets, charset_eight_bit, Qt);
+ }
+ }
+ else
+ {
+ while (ptr < pend)
+ {
+ int c = STRING_CHAR_ADVANCE (ptr);
+ struct charset *charset;
+
+ if (!NILP (table))
+ c = translate_char (table, c);
+ charset = CHAR_CHARSET (c);
+ ASET (charsets, CHARSET_ID (charset), Qt);
}
- return return_val;
}
}
@@ -881,17 +1414,16 @@ DEFUN ("find-charset-region", Ffind_charset_region, Sfind_charset_region,
BEG and END are buffer positions.
Optional arg TABLE if non-nil is a translation table to look up.
-If the region contains invalid multibyte characters,
-`unknown' is included in the returned list.
-
If the current buffer is unibyte, the returned list may contain
only `ascii', `eight-bit-control', and `eight-bit-graphic'. */)
(beg, end, table)
Lisp_Object beg, end, table;
{
- int charsets[MAX_CHARSET + 1];
- int from, from_byte, to, stop, stop_byte, i;
+ Lisp_Object charsets;
+ EMACS_INT from, from_byte, to, stop, stop_byte;
+ int i;
Lisp_Object val;
+ int multibyte = ! NILP (current_buffer->enable_multibyte_characters);
validate_region (&beg, &end);
from = XFASTINT (beg);
@@ -907,11 +1439,12 @@ only `ascii', `eight-bit-control', and `eight-bit-graphic'. */)
from_byte = CHAR_TO_BYTE (from);
- bzero (charsets, (MAX_CHARSET + 1) * sizeof (int));
+ charsets = Fmake_vector (make_number (charset_table_used), Qnil);
while (1)
{
- find_charset_in_text (BYTE_POS_ADDR (from_byte), stop - from,
- stop_byte - from_byte, charsets, table);
+ find_charsets_in_text (BYTE_POS_ADDR (from_byte), stop - from,
+ stop_byte - from_byte, charsets, table,
+ multibyte);
if (stop < to)
{
from = stop, from_byte = stop_byte;
@@ -922,13 +1455,9 @@ only `ascii', `eight-bit-control', and `eight-bit-graphic'. */)
}
val = Qnil;
- if (charsets[1])
- val = Fcons (Qunknown, val);
- for (i = MAX_CHARSET; i >= MIN_CHARSET_OFFICIAL_DIMENSION1; i--)
- if (charsets[i])
- val = Fcons (CHARSET_SYMBOL (i), val);
- if (charsets[0])
- val = Fcons (Qascii, val);
+ for (i = charset_table_used - 1; i >= 0; i--)
+ if (!NILP (AREF (charsets, i)))
+ val = Fcons (CHARSET_NAME (charset_table + i), val);
return val;
}
@@ -937,850 +1466,607 @@ DEFUN ("find-charset-string", Ffind_charset_string, Sfind_charset_string,
doc: /* Return a list of charsets in STR.
Optional arg TABLE if non-nil is a translation table to look up.
-If the string contains invalid multibyte characters,
-`unknown' is included in the returned list.
-
If STR is unibyte, the returned list may contain
-only `ascii', `eight-bit-control', and `eight-bit-graphic'. */)
+only `ascii', `eight-bit-control', and `eight-bit-graphic'. */)
(str, table)
Lisp_Object str, table;
{
- int charsets[MAX_CHARSET + 1];
+ Lisp_Object charsets;
int i;
Lisp_Object val;
CHECK_STRING (str);
- bzero (charsets, (MAX_CHARSET + 1) * sizeof (int));
- find_charset_in_text (SDATA (str), SCHARS (str),
- SBYTES (str), charsets, table);
-
+ charsets = Fmake_vector (make_number (charset_table_used), Qnil);
+ find_charsets_in_text (SDATA (str), SCHARS (str), SBYTES (str),
+ charsets, table,
+ STRING_MULTIBYTE (str));
val = Qnil;
- if (charsets[1])
- val = Fcons (Qunknown, val);
- for (i = MAX_CHARSET; i >= MIN_CHARSET_OFFICIAL_DIMENSION1; i--)
- if (charsets[i])
- val = Fcons (CHARSET_SYMBOL (i), val);
- if (charsets[0])
- val = Fcons (Qascii, val);
+ for (i = charset_table_used - 1; i >= 0; i--)
+ if (!NILP (AREF (charsets, i)))
+ val = Fcons (CHARSET_NAME (charset_table + i), val);
return val;
}
-DEFUN ("make-char-internal", Fmake_char_internal, Smake_char_internal, 1, 3, 0,
- doc: /* Return a character made from arguments.
-Internal use only. */)
- (charset, code1, code2)
- Lisp_Object charset, code1, code2;
+
+/* Return a character correponding to the code-point CODE of
+ CHARSET. */
+
+int
+decode_char (charset, code)
+ struct charset *charset;
+ unsigned code;
{
- int charset_id, c1, c2;
+ int c, char_index;
+ enum charset_method method = CHARSET_METHOD (charset);
- CHECK_NUMBER (charset);
- charset_id = XINT (charset);
- if (!CHARSET_DEFINED_P (charset_id))
- error ("Invalid charset ID: %d", XINT (charset));
+ if (code < CHARSET_MIN_CODE (charset) || code > CHARSET_MAX_CODE (charset))
+ return -1;
- if (NILP (code1))
- c1 = 0;
- else
+ if (method == CHARSET_METHOD_MAP_DEFERRED)
{
- CHECK_NUMBER (code1);
- c1 = XINT (code1);
- }
- if (NILP (code2))
- c2 = 0;
- else
- {
- CHECK_NUMBER (code2);
- c2 = XINT (code2);
+ load_charset (charset);
+ method = CHARSET_METHOD (charset);
}
- if (charset_id == CHARSET_ASCII)
+ if (method == CHARSET_METHOD_SUBSET)
{
- if (c1 < 0 || c1 > 0x7F)
- goto invalid_code_posints;
- return make_number (c1);
+ Lisp_Object subset_info;
+
+ subset_info = CHARSET_SUBSET (charset);
+ charset = CHARSET_FROM_ID (XFASTINT (AREF (subset_info, 0)));
+ code -= XINT (AREF (subset_info, 3));
+ if (code < XFASTINT (AREF (subset_info, 1))
+ || code > XFASTINT (AREF (subset_info, 2)))
+ c = -1;
+ else
+ c = DECODE_CHAR (charset, code);
}
- else if (charset_id == CHARSET_8_BIT_CONTROL)
+ else if (method == CHARSET_METHOD_SUPERSET)
{
- if (NILP (code1))
- c1 = 0x80;
- else if (c1 < 0x80 || c1 > 0x9F)
- goto invalid_code_posints;
- return make_number (c1);
+ Lisp_Object parents;
+
+ parents = CHARSET_SUPERSET (charset);
+ c = -1;
+ for (; CONSP (parents); parents = XCDR (parents))
+ {
+ int id = XINT (XCAR (XCAR (parents)));
+ int code_offset = XINT (XCDR (XCAR (parents)));
+ unsigned this_code = code - code_offset;
+
+ charset = CHARSET_FROM_ID (id);
+ if ((c = DECODE_CHAR (charset, this_code)) >= 0)
+ break;
+ }
}
- else if (charset_id == CHARSET_8_BIT_GRAPHIC)
+ else
{
- if (NILP (code1))
- c1 = 0xA0;
- else if (c1 < 0xA0 || c1 > 0xFF)
- goto invalid_code_posints;
- return make_number (c1);
- }
- else if (c1 < 0 || c1 > 0xFF || c2 < 0 || c2 > 0xFF)
- goto invalid_code_posints;
- c1 &= 0x7F;
- c2 &= 0x7F;
- if (c1 == 0
- ? c2 != 0
- : (c2 == 0
- ? !CHAR_COMPONENTS_VALID_P (charset_id, c1, 0x20)
- : !CHAR_COMPONENTS_VALID_P (charset_id, c1, c2)))
- goto invalid_code_posints;
- return make_number (MAKE_CHAR (charset_id, c1, c2));
-
- invalid_code_posints:
- error ("Invalid code points for charset ID %d: %d %d", charset_id, c1, c2);
-}
+ char_index = CODE_POINT_TO_INDEX (charset, code);
+ if (char_index < 0)
+ return -1;
-DEFUN ("split-char", Fsplit_char, Ssplit_char, 1, 1, 0,
- doc: /* Return list of charset and one or two position-codes of CH.
-If CH is invalid as a character code,
-return a list of symbol `unknown' and CH. */)
- (ch)
- Lisp_Object ch;
-{
- int c, charset, c1, c2;
+ if (method == CHARSET_METHOD_MAP)
+ {
+ Lisp_Object decoder;
- CHECK_NUMBER (ch);
- c = XFASTINT (ch);
- if (!CHAR_VALID_P (c, 1))
- return Fcons (Qunknown, Fcons (ch, Qnil));
- SPLIT_CHAR (XFASTINT (ch), charset, c1, c2);
- return (c2 >= 0
- ? Fcons (CHARSET_SYMBOL (charset),
- Fcons (make_number (c1), Fcons (make_number (c2), Qnil)))
- : Fcons (CHARSET_SYMBOL (charset), Fcons (make_number (c1), Qnil)));
-}
+ decoder = CHARSET_DECODER (charset);
+ if (! VECTORP (decoder))
+ return -1;
+ c = XINT (AREF (decoder, char_index));
+ }
+ else
+ {
+ c = char_index + CHARSET_CODE_OFFSET (charset);
+ }
+ }
-DEFUN ("char-charset", Fchar_charset, Schar_charset, 1, 1, 0,
- doc: /* Return charset of CH. */)
- (ch)
- Lisp_Object ch;
-{
- CHECK_NUMBER (ch);
+ if (CHARSET_UNIFIED_P (charset)
+ && c >= 0)
+ {
+ MAYBE_UNIFY_CHAR (c);
+ }
- return CHARSET_SYMBOL (CHAR_CHARSET (XINT (ch)));
+ return c;
}
-DEFUN ("charset-after", Fcharset_after, Scharset_after, 0, 1, 0,
- doc: /* Return charset of a character in the current buffer at position POS.
-If POS is nil, it defauls to the current point.
-If POS is out of range, the value is nil. */)
- (pos)
- Lisp_Object pos;
-{
- Lisp_Object ch;
- int charset;
+/* Variable used temporarily by the macro ENCODE_CHAR. */
+Lisp_Object charset_work;
- ch = Fchar_after (pos);
- if (! INTEGERP (ch))
- return ch;
- charset = CHAR_CHARSET (XINT (ch));
- return CHARSET_SYMBOL (charset);
-}
-
-DEFUN ("iso-charset", Fiso_charset, Siso_charset, 3, 3, 0,
- doc: /* Return charset of ISO's specification DIMENSION, CHARS, and FINAL-CHAR.
+/* Return a code-point of CHAR in CHARSET. If CHAR doesn't belong to
+ CHARSET, return CHARSET_INVALID_CODE (CHARSET). If STRICT is true,
+ use CHARSET's strict_max_char instead of max_char. */
-ISO 2022's designation sequence (escape sequence) distinguishes charsets
-by their DIMENSION, CHARS, and FINAL-CHAR,
-where as Emacs distinguishes them by charset symbol.
-See the documentation of the function `charset-info' for the meanings of
-DIMENSION, CHARS, and FINAL-CHAR. */)
- (dimension, chars, final_char)
- Lisp_Object dimension, chars, final_char;
-{
- int charset;
-
- CHECK_NUMBER (dimension);
- CHECK_NUMBER (chars);
- CHECK_NUMBER (final_char);
-
- if ((charset = ISO_CHARSET_TABLE (dimension, chars, final_char)) < 0)
- return Qnil;
- return CHARSET_SYMBOL (charset);
-}
-
-/* If GENERICP is nonzero, return nonzero if C is a valid normal or
- generic character. If GENERICP is zero, return nonzero if C is a
- valid normal character. Do not call this function directly,
- instead use macro CHAR_VALID_P. */
-int
-char_valid_p (c, genericp)
- int c, genericp;
+unsigned
+encode_char (charset, c)
+ struct charset *charset;
+ int c;
{
- int charset, c1, c2;
+ unsigned code;
+ enum charset_method method = CHARSET_METHOD (charset);
- if (c < 0 || c >= MAX_CHAR)
- return 0;
- if (SINGLE_BYTE_CHAR_P (c))
- return 1;
- SPLIT_CHAR (c, charset, c1, c2);
- if (genericp)
+ if (CHARSET_UNIFIED_P (charset))
{
- if (c1)
- {
- if (c2 <= 0) c2 = 0x20;
- }
- else
+ Lisp_Object deunifier, deunified;
+
+ deunifier = CHARSET_DEUNIFIER (charset);
+ if (! CHAR_TABLE_P (deunifier))
{
- if (c2 <= 0) c1 = c2 = 0x20;
+ Funify_charset (CHARSET_NAME (charset), Qnil, Qnil);
+ deunifier = CHARSET_DEUNIFIER (charset);
}
+ deunified = CHAR_TABLE_REF (deunifier, c);
+ if (! NILP (deunified))
+ c = XINT (deunified);
}
- return (CHARSET_DEFINED_P (charset)
- && CHAR_COMPONENTS_VALID_P (charset, c1, c2));
-}
-DEFUN ("char-valid-p", Fchar_valid_p, Schar_valid_p, 1, 2, 0,
- doc: /* Return t if OBJECT is a valid normal character.
-If optional arg GENERICP is non-nil, also return t if OBJECT is
-a valid generic character. */)
- (object, genericp)
- Lisp_Object object, genericp;
-{
- if (! NATNUMP (object))
- return Qnil;
- return (CHAR_VALID_P (XFASTINT (object), !NILP (genericp)) ? Qt : Qnil);
-}
+ if (method == CHARSET_METHOD_SUBSET)
+ {
+ Lisp_Object subset_info;
+ struct charset *this_charset;
+
+ subset_info = CHARSET_SUBSET (charset);
+ this_charset = CHARSET_FROM_ID (XFASTINT (AREF (subset_info, 0)));
+ code = ENCODE_CHAR (this_charset, c);
+ if (code == CHARSET_INVALID_CODE (this_charset)
+ || code < XFASTINT (AREF (subset_info, 1))
+ || code > XFASTINT (AREF (subset_info, 2)))
+ return CHARSET_INVALID_CODE (charset);
+ code += XINT (AREF (subset_info, 3));
+ return code;
+ }
-DEFUN ("unibyte-char-to-multibyte", Funibyte_char_to_multibyte,
- Sunibyte_char_to_multibyte, 1, 1, 0,
- doc: /* Convert the unibyte character CH to multibyte character.
-The conversion is done based on `nonascii-translation-table' (which see)
- or `nonascii-insert-offset' (which see). */)
- (ch)
- Lisp_Object ch;
-{
- int c;
+ if (method == CHARSET_METHOD_SUPERSET)
+ {
+ Lisp_Object parents;
- CHECK_NUMBER (ch);
- c = XINT (ch);
- if (c < 0 || c >= 0400)
- error ("Invalid unibyte character: %d", c);
- c = unibyte_char_to_multibyte (c);
- if (c < 0)
- error ("Can't convert to multibyte character: %d", XINT (ch));
- return make_number (c);
-}
+ parents = CHARSET_SUPERSET (charset);
+ for (; CONSP (parents); parents = XCDR (parents))
+ {
+ int id = XINT (XCAR (XCAR (parents)));
+ int code_offset = XINT (XCDR (XCAR (parents)));
+ struct charset *this_charset = CHARSET_FROM_ID (id);
-DEFUN ("multibyte-char-to-unibyte", Fmultibyte_char_to_unibyte,
- Smultibyte_char_to_unibyte, 1, 1, 0,
- doc: /* Convert the multibyte character CH to unibyte character.
-The conversion is done based on `nonascii-translation-table' (which see)
- or `nonascii-insert-offset' (which see). */)
- (ch)
- Lisp_Object ch;
-{
- int c;
+ code = ENCODE_CHAR (this_charset, c);
+ if (code != CHARSET_INVALID_CODE (this_charset))
+ return code + code_offset;
+ }
+ return CHARSET_INVALID_CODE (charset);
+ }
- CHECK_NUMBER (ch);
- c = XINT (ch);
- if (! CHAR_VALID_P (c, 0))
- error ("Invalid multibyte character: %d", c);
- c = multibyte_char_to_unibyte (c, Qnil);
- if (c < 0)
- error ("Can't convert to unibyte character: %d", XINT (ch));
- return make_number (c);
-}
+ if (! CHARSET_FAST_MAP_REF ((c), charset->fast_map)
+ || c < CHARSET_MIN_CHAR (charset) || c > CHARSET_MAX_CHAR (charset))
+ return CHARSET_INVALID_CODE (charset);
-DEFUN ("char-bytes", Fchar_bytes, Schar_bytes, 1, 1, 0,
- doc: /* Return 1 regardless of the argument CH. */)
- (ch)
- Lisp_Object ch;
-{
- CHECK_NUMBER (ch);
- return make_number (1);
-}
+ if (method == CHARSET_METHOD_MAP_DEFERRED)
+ {
+ load_charset (charset);
+ method = CHARSET_METHOD (charset);
+ }
-/* Return how many bytes C will occupy in a multibyte buffer.
- Don't call this function directly, instead use macro CHAR_BYTES. */
-int
-char_bytes (c)
- int c;
-{
- int charset;
+ if (method == CHARSET_METHOD_MAP)
+ {
+ Lisp_Object encoder;
+ Lisp_Object val;
- if (ASCII_BYTE_P (c) || (c & ~((1 << CHARACTERBITS) -1)))
- return 1;
- if (SINGLE_BYTE_CHAR_P (c) && c >= 0xA0)
- return 1;
+ encoder = CHARSET_ENCODER (charset);
+ if (! CHAR_TABLE_P (CHARSET_ENCODER (charset)))
+ return CHARSET_INVALID_CODE (charset);
+ val = CHAR_TABLE_REF (encoder, c);
+ if (NILP (val))
+ return CHARSET_INVALID_CODE (charset);
+ code = XINT (val);
+ if (! CHARSET_COMPACT_CODES_P (charset))
+ code = INDEX_TO_CODE_POINT (charset, code);
+ }
+ else /* method == CHARSET_METHOD_OFFSET */
+ {
+ code = c - CHARSET_CODE_OFFSET (charset);
+ code = INDEX_TO_CODE_POINT (charset, code);
+ }
- charset = CHAR_CHARSET (c);
- return (CHARSET_DEFINED_P (charset) ? CHARSET_BYTES (charset) : 1);
+ return code;
}
-/* Return the width of character of which multi-byte form starts with
- C. The width is measured by how many columns occupied on the
- screen when displayed in the current buffer. */
-
-#define ONE_BYTE_CHAR_WIDTH(c) \
- (c < 0x20 \
- ? (c == '\t' \
- ? XFASTINT (current_buffer->tab_width) \
- : (c == '\n' ? 0 : (NILP (current_buffer->ctl_arrow) ? 4 : 2))) \
- : (c < 0x7f \
- ? 1 \
- : (c == 0x7F \
- ? (NILP (current_buffer->ctl_arrow) ? 4 : 2) \
- : ((! NILP (current_buffer->enable_multibyte_characters) \
- && BASE_LEADING_CODE_P (c)) \
- ? WIDTH_BY_CHAR_HEAD (c) \
- : 4))))
-
-DEFUN ("char-width", Fchar_width, Schar_width, 1, 1, 0,
- doc: /* Return width of CH when displayed in the current buffer.
-The width is measured by how many columns it occupies on the screen.
-Tab is taken to occupy `tab-width' columns. */)
- (ch)
- Lisp_Object ch;
-{
- Lisp_Object val, disp;
- int c;
- struct Lisp_Char_Table *dp = buffer_display_table ();
- CHECK_NUMBER (ch);
+DEFUN ("decode-char", Fdecode_char, Sdecode_char, 2, 3, 0,
+ doc: /* Decode the pair of CHARSET and CODE-POINT into a character.
+Return nil if CODE-POINT is not valid in CHARSET.
- c = XINT (ch);
+CODE-POINT may be a cons (HIGHER-16-BIT-VALUE . LOWER-16-BIT-VALUE).
- /* Get the way the display table would display it. */
- disp = dp ? DISP_CHAR_VECTOR (dp, c) : Qnil;
+Optional argument RESTRICTION specifies a way to map the pair of CCS
+and CODE-POINT to a chracter. Currently not supported and just ignored. */)
+ (charset, code_point, restriction)
+ Lisp_Object charset, code_point, restriction;
+{
+ int c, id;
+ unsigned code;
+ struct charset *charsetp;
- if (VECTORP (disp))
- XSETINT (val, XVECTOR (disp)->size);
- else if (SINGLE_BYTE_CHAR_P (c))
- XSETINT (val, ONE_BYTE_CHAR_WIDTH (c));
+ CHECK_CHARSET_GET_ID (charset, id);
+ if (CONSP (code_point))
+ {
+ CHECK_NATNUM_CAR (code_point);
+ CHECK_NATNUM_CDR (code_point);
+ code = (XINT (XCAR (code_point)) << 16) | (XINT (XCDR (code_point)));
+ }
else
{
- int charset = CHAR_CHARSET (c);
-
- XSETFASTINT (val, CHARSET_WIDTH (charset));
+ CHECK_NATNUM (code_point);
+ code = XINT (code_point);
}
- return val;
+ charsetp = CHARSET_FROM_ID (id);
+ c = DECODE_CHAR (charsetp, code);
+ return (c >= 0 ? make_number (c) : Qnil);
}
-/* Return width of string STR of length LEN when displayed in the
- current buffer. The width is measured by how many columns it
- occupies on the screen. */
-int
-strwidth (str, len)
- unsigned char *str;
- int len;
+DEFUN ("encode-char", Fencode_char, Sencode_char, 2, 3, 0,
+ doc: /* Encode the character CH into a code-point of CHARSET.
+Return nil if CHARSET doesn't include CH.
+
+Optional argument RESTRICTION specifies a way to map CHAR to a
+code-point in CCS. Currently not supported and just ignored. */)
+ (ch, charset, restriction)
+ Lisp_Object ch, charset, restriction;
{
- return c_string_width (str, len, -1, NULL, NULL);
+ int id;
+ unsigned code;
+ struct charset *charsetp;
+
+ CHECK_CHARSET_GET_ID (charset, id);
+ CHECK_NATNUM (ch);
+ charsetp = CHARSET_FROM_ID (id);
+ code = ENCODE_CHAR (charsetp, XINT (ch));
+ if (code == CHARSET_INVALID_CODE (charsetp))
+ return Qnil;
+ if (code > 0x7FFFFFF)
+ return Fcons (make_number (code >> 16), make_number (code & 0xFFFF));
+ return make_number (code);
}
-/* Return width of string STR of length LEN when displayed in the
- current buffer. The width is measured by how many columns it
- occupies on the screen. If PRECISION > 0, return the width of
- longest substring that doesn't exceed PRECISION, and set number of
- characters and bytes of the substring in *NCHARS and *NBYTES
- respectively. */
-int
-c_string_width (str, len, precision, nchars, nbytes)
- const unsigned char *str;
- int len, precision, *nchars, *nbytes;
+DEFUN ("make-char", Fmake_char, Smake_char, 1, 5, 0,
+ doc:
+ /* Return a character of CHARSET whose position codes are CODEn.
+
+CODE1 through CODE4 are optional, but if you don't supply sufficient
+position codes, it is assumed that the minimum code in each dimension
+is specified. */)
+ (charset, code1, code2, code3, code4)
+ Lisp_Object charset, code1, code2, code3, code4;
{
- int i = 0, i_byte = 0;
- int width = 0;
- int chars;
- struct Lisp_Char_Table *dp = buffer_display_table ();
+ int id, dimension;
+ struct charset *charsetp;
+ unsigned code;
+ int c;
+
+ CHECK_CHARSET_GET_ID (charset, id);
+ charsetp = CHARSET_FROM_ID (id);
- while (i_byte < len)
+ dimension = CHARSET_DIMENSION (charsetp);
+ if (NILP (code1))
+ code = (CHARSET_ASCII_COMPATIBLE_P (charsetp)
+ ? 0 : CHARSET_MIN_CODE (charsetp));
+ else
{
- int bytes, thiswidth;
- Lisp_Object val;
+ CHECK_NATNUM (code1);
+ if (XFASTINT (code1) >= 0x100)
+ args_out_of_range (make_number (0xFF), code1);
+ code = XFASTINT (code1);
- if (dp)
+ if (dimension > 1)
{
- int c = STRING_CHAR_AND_LENGTH (str + i_byte, len - i_byte, bytes);
-
- chars = 1;
- val = DISP_CHAR_VECTOR (dp, c);
- if (VECTORP (val))
- thiswidth = XVECTOR (val)->size;
+ code <<= 8;
+ if (NILP (code2))
+ code |= charsetp->code_space[(dimension - 2) * 4];
else
- thiswidth = ONE_BYTE_CHAR_WIDTH (str[i_byte]);
- }
- else
- {
- chars = 1;
- PARSE_MULTIBYTE_SEQ (str + i_byte, len - i_byte, bytes);
- thiswidth = ONE_BYTE_CHAR_WIDTH (str[i_byte]);
- }
+ {
+ CHECK_NATNUM (code2);
+ if (XFASTINT (code2) >= 0x100)
+ args_out_of_range (make_number (0xFF), code2);
+ code |= XFASTINT (code2);
+ }
- if (precision > 0
- && (width + thiswidth > precision))
- {
- *nchars = i;
- *nbytes = i_byte;
- return width;
+ if (dimension > 2)
+ {
+ code <<= 8;
+ if (NILP (code3))
+ code |= charsetp->code_space[(dimension - 3) * 4];
+ else
+ {
+ CHECK_NATNUM (code3);
+ if (XFASTINT (code3) >= 0x100)
+ args_out_of_range (make_number (0xFF), code3);
+ code |= XFASTINT (code3);
+ }
+
+ if (dimension > 3)
+ {
+ code <<= 8;
+ if (NILP (code4))
+ code |= charsetp->code_space[0];
+ else
+ {
+ CHECK_NATNUM (code4);
+ if (XFASTINT (code4) >= 0x100)
+ args_out_of_range (make_number (0xFF), code4);
+ code |= XFASTINT (code4);
+ }
+ }
+ }
}
- i++;
- i_byte += bytes;
- width += thiswidth;
- }
-
- if (precision > 0)
- {
- *nchars = i;
- *nbytes = i_byte;
}
- return width;
+ if (CHARSET_ISO_FINAL (charsetp) >= 0)
+ code &= 0x7F7F7F7F;
+ c = DECODE_CHAR (charsetp, code);
+ if (c < 0)
+ error ("Invalid code(s)");
+ return make_number (c);
}
-/* Return width of Lisp string STRING when displayed in the current
- buffer. The width is measured by how many columns it occupies on
- the screen while paying attention to compositions. If PRECISION >
- 0, return the width of longest substring that doesn't exceed
- PRECISION, and set number of characters and bytes of the substring
- in *NCHARS and *NBYTES respectively. */
-int
-lisp_string_width (string, precision, nchars, nbytes)
- Lisp_Object string;
- int precision, *nchars, *nbytes;
-{
- int len = SCHARS (string);
- int len_byte = SBYTES (string);
- /* This set multibyte to 0 even if STRING is multibyte when it
- contains only ascii and eight-bit-graphic, but that's
- intentional. */
- int multibyte = len < len_byte;
- const unsigned char *str = SDATA (string);
- int i = 0, i_byte = 0;
- int width = 0;
- struct Lisp_Char_Table *dp = buffer_display_table ();
-
- while (i < len)
- {
- int chars, bytes, thiswidth;
- Lisp_Object val;
- int cmp_id;
- int ignore, end;
+/* Return the first charset in CHARSET_LIST that contains C.
+ CHARSET_LIST is a list of charset IDs. If it is nil, use
+ Vcharset_ordered_list. */
- if (find_composition (i, -1, &ignore, &end, &val, string)
- && ((cmp_id = get_composition_id (i, i_byte, end - i, val, string))
- >= 0))
- {
- thiswidth = composition_table[cmp_id]->width;
- chars = end - i;
- bytes = string_char_to_byte (string, end) - i_byte;
- }
- else if (dp)
- {
- int c;
+struct charset *
+char_charset (c, charset_list, code_return)
+ int c;
+ Lisp_Object charset_list;
+ unsigned *code_return;
+{
+ if (NILP (charset_list))
+ charset_list = Vcharset_ordered_list;
- if (multibyte)
- c = STRING_CHAR_AND_LENGTH (str + i_byte, len - i_byte, bytes);
- else
- c = str[i_byte], bytes = 1;
- chars = 1;
- val = DISP_CHAR_VECTOR (dp, c);
- if (VECTORP (val))
- thiswidth = XVECTOR (val)->size;
- else
- thiswidth = ONE_BYTE_CHAR_WIDTH (str[i_byte]);
- }
- else
- {
- chars = 1;
- if (multibyte)
- PARSE_MULTIBYTE_SEQ (str + i_byte, len_byte - i_byte, bytes);
- else
- bytes = 1;
- thiswidth = ONE_BYTE_CHAR_WIDTH (str[i_byte]);
- }
+ while (CONSP (charset_list))
+ {
+ struct charset *charset = CHARSET_FROM_ID (XINT (XCAR (charset_list)));
+ unsigned code = ENCODE_CHAR (charset, c);
- if (precision > 0
- && (width + thiswidth > precision))
+ if (code != CHARSET_INVALID_CODE (charset))
{
- *nchars = i;
- *nbytes = i_byte;
- return width;
+ if (code_return)
+ *code_return = code;
+ return charset;
}
- i += chars;
- i_byte += bytes;
- width += thiswidth;
- }
-
- if (precision > 0)
- {
- *nchars = i;
- *nbytes = i_byte;
+ charset_list = XCDR (charset_list);
}
-
- return width;
+ return NULL;
}
-DEFUN ("string-width", Fstring_width, Sstring_width, 1, 1, 0,
- doc: /* Return width of STRING when displayed in the current buffer.
-Width is measured by how many columns it occupies on the screen.
-When calculating width of a multibyte character in STRING,
-only the base leading-code is considered; the validity of
-the following bytes is not checked. Tabs in STRING are always
-taken to occupy `tab-width' columns. */)
- (string)
- Lisp_Object string;
-{
- Lisp_Object val;
-
- CHECK_STRING (string);
- XSETFASTINT (val, lisp_string_width (string, -1, NULL, NULL));
- return val;
-}
-DEFUN ("char-direction", Fchar_direction, Schar_direction, 1, 1, 0,
- doc: /* Return the direction of CH.
-The returned value is 0 for left-to-right and 1 for right-to-left. */)
+DEFUN ("split-char", Fsplit_char, Ssplit_char, 1, 1, 0,
+ doc:
+ /*Return list of charset and one to four position-codes of CHAR.
+The charset is decided by the current priority order of charsets.
+A position-code is a byte value of each dimension of the code-point of
+CHAR in the charset. */)
(ch)
Lisp_Object ch;
{
- int charset;
+ struct charset *charset;
+ int c, dimension;
+ unsigned code;
+ Lisp_Object val;
- CHECK_NUMBER (ch);
- charset = CHAR_CHARSET (XFASTINT (ch));
- if (!CHARSET_DEFINED_P (charset))
- invalid_character (XINT (ch));
- return CHARSET_TABLE_INFO (charset, CHARSET_DIRECTION_IDX);
+ CHECK_CHARACTER (ch);
+ c = XFASTINT (ch);
+ charset = CHAR_CHARSET (c);
+ if (! charset)
+ abort ();
+ code = ENCODE_CHAR (charset, c);
+ if (code == CHARSET_INVALID_CODE (charset))
+ abort ();
+ dimension = CHARSET_DIMENSION (charset);
+ for (val = Qnil; dimension > 0; dimension--)
+ {
+ val = Fcons (make_number (code & 0xFF), val);
+ code >>= 8;
+ }
+ return Fcons (CHARSET_NAME (charset), val);
}
-/* Return the number of characters in the NBYTES bytes at PTR.
- This works by looking at the contents and checking for multibyte sequences.
- However, if the current buffer has enable-multibyte-characters = nil,
- we treat each byte as a character. */
-int
-chars_in_text (ptr, nbytes)
- const unsigned char *ptr;
- int nbytes;
+DEFUN ("char-charset", Fchar_charset, Schar_charset, 1, 1, 0,
+ doc: /* Return the charset of highest priority that contains CH. */)
+ (ch)
+ Lisp_Object ch;
{
- /* current_buffer is null at early stages of Emacs initialization. */
- if (current_buffer == 0
- || NILP (current_buffer->enable_multibyte_characters))
- return nbytes;
+ struct charset *charset;
- return multibyte_chars_in_text (ptr, nbytes);
+ CHECK_CHARACTER (ch);
+ charset = CHAR_CHARSET (XINT (ch));
+ return (CHARSET_NAME (charset));
}
-/* Return the number of characters in the NBYTES bytes at PTR.
- This works by looking at the contents and checking for multibyte sequences.
- It ignores enable-multibyte-characters. */
-int
-multibyte_chars_in_text (ptr, nbytes)
- const unsigned char *ptr;
- int nbytes;
+DEFUN ("charset-after", Fcharset_after, Scharset_after, 0, 1, 0,
+ doc: /*
+Return charset of a character in the current buffer at position POS.
+If POS is nil, it defauls to the current point.
+If POS is out of range, the value is nil. */)
+ (pos)
+ Lisp_Object pos;
{
- const unsigned char *endp;
- int chars, bytes;
+ Lisp_Object ch;
+ struct charset *charset;
- endp = ptr + nbytes;
- chars = 0;
+ ch = Fchar_after (pos);
+ if (! INTEGERP (ch))
+ return ch;
+ charset = CHAR_CHARSET (XINT (ch));
+ return (CHARSET_NAME (charset));
+}
- while (ptr < endp)
- {
- PARSE_MULTIBYTE_SEQ (ptr, endp - ptr, bytes);
- ptr += bytes;
- chars++;
- }
- return chars;
-}
+DEFUN ("iso-charset", Fiso_charset, Siso_charset, 3, 3, 0,
+ doc: /*
+Return charset of ISO's specification DIMENSION, CHARS, and FINAL-CHAR.
-/* Parse unibyte text at STR of LEN bytes as multibyte text, and
- count the numbers of characters and bytes in it. On counting
- bytes, pay attention to the fact that 8-bit characters in the range
- 0x80..0x9F are represented by 2 bytes in multibyte text. */
-void
-parse_str_as_multibyte (str, len, nchars, nbytes)
- const unsigned char *str;
- int len, *nchars, *nbytes;
+ISO 2022's designation sequence (escape sequence) distinguishes charsets
+by their DIMENSION, CHARS, and FINAL-CHAR,
+where as Emacs distinguishes them by charset symbol.
+See the documentation of the function `charset-info' for the meanings of
+DIMENSION, CHARS, and FINAL-CHAR. */)
+ (dimension, chars, final_char)
+ Lisp_Object dimension, chars, final_char;
{
- const unsigned char *endp = str + len;
- int n, chars = 0, bytes = 0;
-
- while (str < endp)
- {
- if (UNIBYTE_STR_AS_MULTIBYTE_P (str, endp - str, n))
- str += n, bytes += n;
- else
- str++, bytes += 2;
- chars++;
- }
- *nchars = chars;
- *nbytes = bytes;
- return;
+ int id;
+ int chars_flag;
+
+ check_iso_charset_parameter (dimension, chars, final_char);
+ chars_flag = XFASTINT (chars) == 96;
+ id = ISO_CHARSET_TABLE (XFASTINT (dimension), chars_flag,
+ XFASTINT (final_char));
+ return (id >= 0 ? CHARSET_NAME (CHARSET_FROM_ID (id)) : Qnil);
}
-/* Arrange unibyte text at STR of NBYTES bytes as multibyte text.
- It actually converts only 8-bit characters in the range 0x80..0x9F
- that don't contruct multibyte characters to multibyte forms. If
- NCHARS is nonzero, set *NCHARS to the number of characters in the
- text. It is assured that we can use LEN bytes at STR as a work
- area and that is enough. Return the number of bytes of the
- resulting text. */
-int
-str_as_multibyte (str, len, nbytes, nchars)
- unsigned char *str;
- int len, nbytes, *nchars;
+DEFUN ("clear-charset-maps", Fclear_charset_maps, Sclear_charset_maps,
+ 0, 0, 0,
+ doc: /*
+Clear encoder and decoder of charsets that are loaded from mapfiles. */)
+ ()
{
- unsigned char *p = str, *endp = str + nbytes;
- unsigned char *to;
- int chars = 0;
- int n;
-
- while (p < endp && UNIBYTE_STR_AS_MULTIBYTE_P (p, endp - p, n))
- p += n, chars++;
- if (nchars)
- *nchars = chars;
- if (p == endp)
- return nbytes;
-
- to = p;
- nbytes = endp - p;
- endp = str + len;
- safe_bcopy (p, endp - nbytes, nbytes);
- p = endp - nbytes;
- while (p < endp)
+ int i;
+ struct charset *charset;
+ Lisp_Object attrs;
+
+ for (i = 0; i < charset_table_used; i++)
{
- if (UNIBYTE_STR_AS_MULTIBYTE_P (p, endp - p, n))
- {
- while (n--)
- *to++ = *p++;
- }
- else
+ charset = CHARSET_FROM_ID (i);
+ attrs = CHARSET_ATTRIBUTES (charset);
+
+ if (CHARSET_METHOD (charset) == CHARSET_METHOD_MAP)
{
- *to++ = LEADING_CODE_8_BIT_CONTROL;
- *to++ = *p++ + 0x20;
+ CHARSET_ATTR_DECODER (attrs) = Qnil;
+ CHARSET_ATTR_ENCODER (attrs) = Qnil;
+ CHARSET_METHOD (charset) = CHARSET_METHOD_MAP_DEFERRED;
}
- chars++;
- }
- if (nchars)
- *nchars = chars;
- return (to - str);
-}
-/* Parse unibyte string at STR of LEN bytes, and return the number of
- bytes it may ocupy when converted to multibyte string by
- `str_to_multibyte'. */
-
-int
-parse_str_to_multibyte (str, len)
- unsigned char *str;
- int len;
-{
- unsigned char *endp = str + len;
- int bytes;
-
- for (bytes = 0; str < endp; str++)
- bytes += (*str < 0x80 || *str >= 0xA0) ? 1 : 2;
- return bytes;
-}
-
-/* Convert unibyte text at STR of NBYTES bytes to multibyte text
- that contains the same single-byte characters. It actually
- converts all 8-bit characters to multibyte forms. It is assured
- that we can use LEN bytes at STR as a work area and that is
- enough. */
+ if (CHARSET_UNIFIED_P (charset))
+ CHARSET_ATTR_DEUNIFIER (attrs) = Qnil;
+ }
-int
-str_to_multibyte (str, len, bytes)
- unsigned char *str;
- int len, bytes;
-{
- unsigned char *p = str, *endp = str + bytes;
- unsigned char *to;
-
- while (p < endp && (*p < 0x80 || *p >= 0xA0)) p++;
- if (p == endp)
- return bytes;
- to = p;
- bytes = endp - p;
- endp = str + len;
- safe_bcopy (p, endp - bytes, bytes);
- p = endp - bytes;
- while (p < endp)
+ if (CHAR_TABLE_P (Vchar_unified_charset_table))
{
- if (*p < 0x80 || *p >= 0xA0)
- *to++ = *p++;
- else
- *to++ = LEADING_CODE_8_BIT_CONTROL, *to++ = *p++ + 0x20;
+ Foptimize_char_table (Vchar_unified_charset_table);
+ Vchar_unify_table = Vchar_unified_charset_table;
+ Vchar_unified_charset_table = Qnil;
}
- return (to - str);
-}
-/* Arrange multibyte text at STR of LEN bytes as a unibyte text. It
- actually converts only 8-bit characters in the range 0x80..0x9F to
- unibyte forms. */
+ return Qnil;
+}
-int
-str_as_unibyte (str, bytes)
- unsigned char *str;
- int bytes;
+DEFUN ("charset-priority-list", Fcharset_priority_list,
+ Scharset_priority_list, 0, 1, 0,
+ doc: /* Return the list of charsets ordered by priority.
+HIGHESTP non-nil means just return the highest priority one. */)
+ (highestp)
+ Lisp_Object highestp;
{
- unsigned char *p = str, *endp = str + bytes;
- unsigned char *to = str;
+ Lisp_Object val = Qnil, list = Vcharset_ordered_list;
- while (p < endp && *p != LEADING_CODE_8_BIT_CONTROL) p++;
- to = p;
- while (p < endp)
+ if (!NILP (highestp))
+ return CHARSET_NAME (CHARSET_FROM_ID (XINT (Fcar (list))));
+
+ while (!NILP (list))
{
- if (*p == LEADING_CODE_8_BIT_CONTROL)
- *to++ = *(p + 1) - 0x20, p += 2;
- else
- *to++ = *p++;
+ val = Fcons (CHARSET_NAME (CHARSET_FROM_ID (XINT (XCAR (list)))), val);
+ list = XCDR (list);
}
- return (to - str);
+ return Fnreverse (val);
}
-
-DEFUN ("string", Fstring, Sstring, 0, MANY, 0,
- doc: /* Concatenate all the argument characters and make the result a string.
-usage: (string &rest CHARACTERS) */)
- (n, args)
- int n;
+DEFUN ("set-charset-priority", Fset_charset_priority, Sset_charset_priority,
+ 1, MANY, 0,
+ doc: /* Assign higher priority to the charsets given as arguments.
+usage: (set-charset-priority &rest charsets) */)
+ (nargs, args)
+ int nargs;
Lisp_Object *args;
{
- int i, bufsize;
- unsigned char *buf, *p;
- int c;
- int multibyte = 0;
- Lisp_Object ret;
- USE_SAFE_ALLOCA;
-
- bufsize = MAX_MULTIBYTE_LENGTH * n;
- SAFE_ALLOCA (buf, unsigned char *, bufsize);
- p = buf;
+ Lisp_Object new_head, old_list, arglist[2];
+ Lisp_Object list_2022, list_emacs_mule;
+ int i, id;
- for (i = 0; i < n; i++)
+ old_list = Fcopy_sequence (Vcharset_ordered_list);
+ new_head = Qnil;
+ for (i = 0; i < nargs; i++)
{
- CHECK_NUMBER (args[i]);
- if (!multibyte && !SINGLE_BYTE_CHAR_P (XFASTINT (args[i])))
- multibyte = 1;
+ CHECK_CHARSET_GET_ID (args[i], id);
+ if (! NILP (Fmemq (make_number (id), old_list)))
+ {
+ old_list = Fdelq (make_number (id), old_list);
+ new_head = Fcons (make_number (id), new_head);
+ }
}
+ arglist[0] = Fnreverse (new_head);
+ arglist[1] = old_list;
+ Vcharset_ordered_list = Fnconc (2, arglist);
+ charset_ordered_list_tick++;
- for (i = 0; i < n; i++)
+ for (old_list = Vcharset_ordered_list, list_2022 = list_emacs_mule = Qnil;
+ CONSP (old_list); old_list = XCDR (old_list))
{
- c = XINT (args[i]);
- if (multibyte)
- p += CHAR_STRING (c, p);
- else
- *p++ = c;
+ if (! NILP (Fmemq (XCAR (old_list), Viso_2022_charset_list)))
+ list_2022 = Fcons (XCAR (old_list), list_2022);
+ if (! NILP (Fmemq (XCAR (old_list), Vemacs_mule_charset_list)))
+ list_emacs_mule = Fcons (XCAR (old_list), list_emacs_mule);
}
+ Viso_2022_charset_list = Fnreverse (list_2022);
+ Vemacs_mule_charset_list = Fnreverse (list_emacs_mule);
- ret = make_string_from_bytes (buf, n, p - buf);
- SAFE_FREE ();
-
- return ret;
+ return Qnil;
}
-#endif /* emacs */
-
-int
-charset_id_internal (charset_name)
- char *charset_name;
+DEFUN ("charset-id-internal", Fcharset_id_internal, Scharset_id_internal,
+ 0, 1, 0,
+ doc: /* Internal use only.
+Return charset identification number of CHARSET. */)
+ (charset)
+ Lisp_Object charset;
{
- Lisp_Object val;
-
- val= Fget (intern (charset_name), Qcharset);
- if (!VECTORP (val))
- error ("Charset %s is not defined", charset_name);
+ int id;
- return (XINT (XVECTOR (val)->contents[0]));
+ CHECK_CHARSET_GET_ID (charset, id);
+ return make_number (id);
}
-DEFUN ("setup-special-charsets", Fsetup_special_charsets,
- Ssetup_special_charsets, 0, 0, 0, doc: /* Internal use only. */)
- ()
+
+void
+init_charset ()
{
- charset_latin_iso8859_1 = charset_id_internal ("latin-iso8859-1");
- charset_jisx0208_1978 = charset_id_internal ("japanese-jisx0208-1978");
- charset_jisx0208 = charset_id_internal ("japanese-jisx0208");
- charset_katakana_jisx0201 = charset_id_internal ("katakana-jisx0201");
- charset_latin_jisx0201 = charset_id_internal ("latin-jisx0201");
- charset_big5_1 = charset_id_internal ("chinese-big5-1");
- charset_big5_2 = charset_id_internal ("chinese-big5-2");
- charset_mule_unicode_0100_24ff
- = charset_id_internal ("mule-unicode-0100-24ff");
- charset_mule_unicode_2500_33ff
- = charset_id_internal ("mule-unicode-2500-33ff");
- charset_mule_unicode_e000_ffff
- = charset_id_internal ("mule-unicode-e000-ffff");
- return Qnil;
+ Vcharset_map_path
+ = Fcons (Fexpand_file_name (build_string ("charsets"), Vdata_directory),
+ Qnil);
}
+
void
init_charset_once ()
{
int i, j, k;
- staticpro (&Vcharset_table);
- staticpro (&Vcharset_symbol_table);
- staticpro (&Vgeneric_character_list);
-
- /* This has to be done here, before we call Fmake_char_table. */
- Qcharset_table = intern ("charset-table");
- staticpro (&Qcharset_table);
-
- /* Intern this now in case it isn't already done.
- Setting this variable twice is harmless.
- But don't staticpro it here--that is done in alloc.c. */
- Qchar_table_extra_slots = intern ("char-table-extra-slots");
-
- /* Now we are ready to set up this property, so we can
- create the charset table. */
- Fput (Qcharset_table, Qchar_table_extra_slots, make_number (0));
- Vcharset_table = Fmake_char_table (Qcharset_table, Qnil);
-
- Qunknown = intern ("unknown");
- staticpro (&Qunknown);
- Vcharset_symbol_table = Fmake_vector (make_number (MAX_CHARSET + 1),
- Qunknown);
-
- /* Setup tables. */
- for (i = 0; i < 2; i++)
- for (j = 0; j < 2; j++)
- for (k = 0; k < 128; k++)
- iso_charset_table [i][j][k] = -1;
+ for (i = 0; i < ISO_MAX_DIMENSION; i++)
+ for (j = 0; j < ISO_MAX_CHARS; j++)
+ for (k = 0; k < ISO_MAX_FINAL; k++)
+ iso_charset_table[i][j][k] = -1;
for (i = 0; i < 256; i++)
- bytes_by_char_head[i] = 1;
- bytes_by_char_head[LEADING_CODE_PRIVATE_11] = 3;
- bytes_by_char_head[LEADING_CODE_PRIVATE_12] = 3;
- bytes_by_char_head[LEADING_CODE_PRIVATE_21] = 4;
- bytes_by_char_head[LEADING_CODE_PRIVATE_22] = 4;
+ emacs_mule_charset[i] = NULL;
+
+ charset_jisx0201_roman = -1;
+ charset_jisx0208_1978 = -1;
+ charset_jisx0208 = -1;
for (i = 0; i < 128; i++)
- width_by_char_head[i] = 1;
+ unibyte_to_multibyte_table[i] = i;
for (; i < 256; i++)
- width_by_char_head[i] = 4;
- width_by_char_head[LEADING_CODE_PRIVATE_11] = 1;
- width_by_char_head[LEADING_CODE_PRIVATE_12] = 2;
- width_by_char_head[LEADING_CODE_PRIVATE_21] = 1;
- width_by_char_head[LEADING_CODE_PRIVATE_22] = 2;
-
- {
- Lisp_Object val;
-
- val = Qnil;
- for (i = 0x81; i < 0x90; i++)
- val = Fcons (make_number ((i - 0x70) << 7), val);
- for (; i < 0x9A; i++)
- val = Fcons (make_number ((i - 0x8F) << 14), val);
- for (i = 0xA0; i < 0xF0; i++)
- val = Fcons (make_number ((i - 0x70) << 7), val);
- for (; i < 0xFF; i++)
- val = Fcons (make_number ((i - 0xE0) << 14), val);
- Vgeneric_character_list = Fnreverse (val);
- }
-
- nonascii_insert_offset = 0;
- Vnonascii_translation_table = Qnil;
+ unibyte_to_multibyte_table[i] = BYTE8_TO_CHAR (i);
}
#ifdef emacs
@@ -1788,140 +2074,87 @@ init_charset_once ()
void
syms_of_charset ()
{
- Qcharset = intern ("charset");
- staticpro (&Qcharset);
-
- Qascii = intern ("ascii");
- staticpro (&Qascii);
-
- Qeight_bit_control = intern ("eight-bit-control");
- staticpro (&Qeight_bit_control);
-
- Qeight_bit_graphic = intern ("eight-bit-graphic");
- staticpro (&Qeight_bit_graphic);
-
- /* Define special charsets ascii, eight-bit-control, and
- eight-bit-graphic. */
- update_charset_table (make_number (CHARSET_ASCII),
- make_number (1), make_number (94),
- make_number (1),
- make_number (0),
- make_number ('B'),
- make_number (0),
- build_string ("ASCII"),
- Qnil, /* same as above */
- build_string ("ASCII (ISO646 IRV)"));
- CHARSET_SYMBOL (CHARSET_ASCII) = Qascii;
- Fput (Qascii, Qcharset, CHARSET_TABLE_ENTRY (CHARSET_ASCII));
-
- update_charset_table (make_number (CHARSET_8_BIT_CONTROL),
- make_number (1), make_number (96),
- make_number (4),
- make_number (0),
- make_number (-1),
- make_number (-1),
- build_string ("8-bit control code (0x80..0x9F)"),
- Qnil, /* same as above */
- Qnil); /* same as above */
- CHARSET_SYMBOL (CHARSET_8_BIT_CONTROL) = Qeight_bit_control;
- Fput (Qeight_bit_control, Qcharset,
- CHARSET_TABLE_ENTRY (CHARSET_8_BIT_CONTROL));
-
- update_charset_table (make_number (CHARSET_8_BIT_GRAPHIC),
- make_number (1), make_number (96),
- make_number (4),
- make_number (0),
- make_number (-1),
- make_number (-1),
- build_string ("8-bit graphic char (0xA0..0xFF)"),
- Qnil, /* same as above */
- Qnil); /* same as above */
- CHARSET_SYMBOL (CHARSET_8_BIT_GRAPHIC) = Qeight_bit_graphic;
- Fput (Qeight_bit_graphic, Qcharset,
- CHARSET_TABLE_ENTRY (CHARSET_8_BIT_GRAPHIC));
-
- Qauto_fill_chars = intern ("auto-fill-chars");
- staticpro (&Qauto_fill_chars);
- Fput (Qauto_fill_chars, Qchar_table_extra_slots, make_number (0));
-
- defsubr (&Sdefine_charset);
- defsubr (&Sgeneric_character_list);
+ DEFSYM (Qcharsetp, "charsetp");
+
+ DEFSYM (Qascii, "ascii");
+ DEFSYM (Qunicode, "unicode");
+ DEFSYM (Qeight_bit, "eight-bit");
+ DEFSYM (Qiso_8859_1, "iso-8859-1");
+
+ DEFSYM (Qgl, "gl");
+ DEFSYM (Qgr, "gr");
+
+ staticpro (&Vcharset_ordered_list);
+ Vcharset_ordered_list = Qnil;
+
+ staticpro (&Viso_2022_charset_list);
+ Viso_2022_charset_list = Qnil;
+
+ staticpro (&Vemacs_mule_charset_list);
+ Vemacs_mule_charset_list = Qnil;
+
+ staticpro (&Vcharset_hash_table);
+ {
+ Lisp_Object args[2];
+ args[0] = QCtest;
+ args[1] = Qeq;
+ Vcharset_hash_table = Fmake_hash_table (2, args);
+ }
+
+ charset_table_size = 128;
+ charset_table = ((struct charset *)
+ xmalloc (sizeof (struct charset) * charset_table_size));
+ charset_table_used = 0;
+
+ staticpro (&Vchar_unified_charset_table);
+ Vchar_unified_charset_table = Fmake_char_table (Qnil, make_number (-1));
+
+ defsubr (&Scharsetp);
+ defsubr (&Smap_charset_chars);
+ defsubr (&Sdefine_charset_internal);
+ defsubr (&Sdefine_charset_alias);
+ defsubr (&Sunibyte_charset);
+ defsubr (&Sset_unibyte_charset);
+ defsubr (&Scharset_plist);
+ defsubr (&Sset_charset_plist);
+ defsubr (&Sunify_charset);
defsubr (&Sget_unused_iso_final_char);
defsubr (&Sdeclare_equiv_charset);
defsubr (&Sfind_charset_region);
defsubr (&Sfind_charset_string);
- defsubr (&Smake_char_internal);
+ defsubr (&Sdecode_char);
+ defsubr (&Sencode_char);
defsubr (&Ssplit_char);
+ defsubr (&Smake_char);
defsubr (&Schar_charset);
defsubr (&Scharset_after);
defsubr (&Siso_charset);
- defsubr (&Schar_valid_p);
- defsubr (&Sunibyte_char_to_multibyte);
- defsubr (&Smultibyte_char_to_unibyte);
- defsubr (&Schar_bytes);
- defsubr (&Schar_width);
- defsubr (&Sstring_width);
- defsubr (&Schar_direction);
- defsubr (&Sstring);
- defsubr (&Ssetup_special_charsets);
+ defsubr (&Sclear_charset_maps);
+ defsubr (&Scharset_priority_list);
+ defsubr (&Sset_charset_priority);
+ defsubr (&Scharset_id_internal);
+
+ DEFVAR_LISP ("charset-map-path", &Vcharset_map_path,
+ doc: /* *Lisp of directories to search for charset map files. */);
+ Vcharset_map_path = Qnil;
DEFVAR_LISP ("charset-list", &Vcharset_list,
- doc: /* List of charsets ever defined. */);
- Vcharset_list = Fcons (Qascii, Fcons (Qeight_bit_control,
- Fcons (Qeight_bit_graphic, Qnil)));
-
- DEFVAR_LISP ("translation-table-vector", &Vtranslation_table_vector,
- doc: /* Vector of cons cell of a symbol and translation table ever defined.
-An ID of a translation table is an index of this vector. */);
- Vtranslation_table_vector = Fmake_vector (make_number (16), Qnil);
-
- DEFVAR_INT ("leading-code-private-11", &leading_code_private_11,
- doc: /* Leading-code of private TYPE9N charset of column-width 1. */);
- leading_code_private_11 = LEADING_CODE_PRIVATE_11;
-
- DEFVAR_INT ("leading-code-private-12", &leading_code_private_12,
- doc: /* Leading-code of private TYPE9N charset of column-width 2. */);
- leading_code_private_12 = LEADING_CODE_PRIVATE_12;
-
- DEFVAR_INT ("leading-code-private-21", &leading_code_private_21,
- doc: /* Leading-code of private TYPE9Nx9N charset of column-width 1. */);
- leading_code_private_21 = LEADING_CODE_PRIVATE_21;
-
- DEFVAR_INT ("leading-code-private-22", &leading_code_private_22,
- doc: /* Leading-code of private TYPE9Nx9N charset of column-width 2. */);
- leading_code_private_22 = LEADING_CODE_PRIVATE_22;
-
- DEFVAR_INT ("nonascii-insert-offset", &nonascii_insert_offset,
- doc: /* Offset for converting non-ASCII unibyte codes 0240...0377 to multibyte.
-This is used for converting unibyte text to multibyte,
-and for inserting character codes specified by number.
-
-This serves to convert a Latin-1 or similar 8-bit character code
-to the corresponding Emacs multibyte character code.
-Typically the value should be (- (make-char CHARSET 0) 128),
-for your choice of character set.
-If `nonascii-translation-table' is non-nil, it overrides this variable. */);
- nonascii_insert_offset = 0;
-
- DEFVAR_LISP ("nonascii-translation-table", &Vnonascii_translation_table,
- doc: /* Translation table to convert non-ASCII unibyte codes to multibyte.
-This is used for converting unibyte text to multibyte,
-and for inserting character codes specified by number.
-
-Conversion is performed only when multibyte characters are enabled,
-and it serves to convert a Latin-1 or similar 8-bit character code
-to the corresponding Emacs character code.
-
-If this is nil, `nonascii-insert-offset' is used instead.
-See also the docstring of `make-translation-table'. */);
- Vnonascii_translation_table = Qnil;
-
- DEFVAR_LISP ("auto-fill-chars", &Vauto_fill_chars,
- doc: /* A char-table for characters which invoke auto-filling.
-Such characters have value t in this table. */);
- Vauto_fill_chars = Fmake_char_table (Qauto_fill_chars, Qnil);
- CHAR_TABLE_SET (Vauto_fill_chars, make_number (' '), Qt);
- CHAR_TABLE_SET (Vauto_fill_chars, make_number ('\n'), Qt);
+ doc: /* List of all charsets ever defined. */);
+ Vcharset_list = Qnil;
+
+ charset_ascii
+ = define_charset_internal (Qascii, 1, "\x00\x7F\x00\x00\x00\x00",
+ 0, 127, 'B', -1, 0, 1, 0, 0);
+ charset_iso_8859_1
+ = define_charset_internal (Qiso_8859_1, 1, "\x00\xFF\x00\x00\x00\x00",
+ 0, 255, -1, -1, -1, 1, 0, 0);
+ charset_unicode
+ = define_charset_internal (Qunicode, 3, "\x00\xFF\x00\xFF\x00\x10",
+ 0, MAX_UNICODE_CHAR, -1, 0, -1, 1, 0, 0);
+ charset_eight_bit
+ = define_charset_internal (Qeight_bit, 1, "\x80\xFF\x00\x00\x00\x00",
+ 128, 255, -1, 0, -1, 0, 0,
+ MAX_5_BYTE_CHAR + 1);
}
#endif /* emacs */
diff --git a/src/charset.h b/src/charset.h
index c20766f910..6d34a5feea 100644
--- a/src/charset.h
+++ b/src/charset.h
@@ -1,4 +1,4 @@
-/* Header for multibyte character handler.
+/* Header for charset handler.
Copyright (C) 2001, 2002, 2003, 2004, 2005,
2006, 2007 Free Software Foundation, Inc.
Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
@@ -6,6 +6,10 @@
National Institute of Advanced Industrial Science and Technology (AIST)
Registration Number H14PRO021
+ Copyright (C) 2003
+ National Institute of Advanced Industrial Science and Technology (AIST)
+ Registration Number H13PRO009
+
This file is part of GNU Emacs.
GNU Emacs is free software; you can redistribute it and/or modify
@@ -26,866 +30,523 @@ Boston, MA 02110-1301, USA. */
#ifndef EMACS_CHARSET_H
#define EMACS_CHARSET_H
-/* #define BYTE_COMBINING_DEBUG */
-
-/*** GENERAL NOTE on CHARACTER SET (CHARSET) ***
-
- A character set ("charset" hereafter) is a meaningful collection
- (i.e. language, culture, functionality, etc) of characters. Emacs
- handles multiple charsets at once. Each charset corresponds to one
- of the ISO charsets. Emacs identifies a charset by a unique
- identification number, whereas ISO identifies a charset by a triplet
- of DIMENSION, CHARS and FINAL-CHAR. So, hereafter, just saying
- "charset" means an identification number (integer value).
-
- The value range of charsets is 0x00, 0x81..0xFE. There are four
- kinds of charset depending on DIMENSION (1 or 2) and CHARS (94 or
- 96). For instance, a charset of DIMENSION2_CHARS94 contains 94x94
- characters.
-
- Within Emacs Lisp, a charset is treated as a symbol which has a
- property `charset'. The property value is a vector containing
- various information about the charset. For readability of C code,
- we use the following convention for C variable names:
- charset_symbol: Emacs Lisp symbol of a charset
- charset_id: Emacs Lisp integer of an identification number of a charset
- charset: C integer of an identification number of a charset
-
- Each charset (except for ascii) is assigned a base leading-code
- (range 0x80..0x9E). In addition, a charset of greater than 0xA0
- (whose base leading-code is 0x9A..0x9D) is assigned an extended
- leading-code (range 0xA0..0xFE). In this case, each base
- leading-code specifies the allowable range of extended leading-code
- as shown in the table below. A leading-code is used to represent a
- character in Emacs' buffer and string.
-
- We call a charset which has extended leading-code a "private
- charset" because those are mainly for a charset which is not yet
- registered by ISO. On the contrary, we call a charset which does
- not have extended leading-code an "official charset".
-
- ---------------------------------------------------------------------------
- charset dimension base leading-code extended leading-code
- ---------------------------------------------------------------------------
- 0x00 official dim1 -- none -- -- none --
- (ASCII)
- 0x01..0x7F --never used--
- 0x80 official dim1 -- none -- -- none --
- (eight-bit-graphic)
- 0x81..0x8F official dim1 same as charset -- none --
- 0x90..0x99 official dim2 same as charset -- none --
- 0x9A..0x9D --never used--
- 0x9E official dim1 same as charset -- none --
- (eight-bit-control)
- 0x9F --never used--
- 0xA0..0xDF private dim1 0x9A same as charset
- of 1-column width
- 0xE0..0xEF private dim1 0x9B same as charset
- of 2-column width
- 0xF0..0xF4 private dim2 0x9C same as charset
- of 1-column width
- 0xF5..0xFE private dim2 0x9D same as charset
- of 2-column width
- 0xFF --never used--
- ---------------------------------------------------------------------------
-
-*/
-
-/* Definition of special leading-codes. */
-/* Leading-code followed by extended leading-code. */
-#define LEADING_CODE_PRIVATE_11 0x9A /* for private DIMENSION1 of 1-column */
-#define LEADING_CODE_PRIVATE_12 0x9B /* for private DIMENSION1 of 2-column */
-#define LEADING_CODE_PRIVATE_21 0x9C /* for private DIMENSION2 of 1-column */
-#define LEADING_CODE_PRIVATE_22 0x9D /* for private DIMENSION2 of 2-column */
-
-#define LEADING_CODE_8_BIT_CONTROL 0x9E /* for `eight-bit-control' */
-
-/* Extended leading-code. */
-/* Start of each extended leading-codes. */
-#define LEADING_CODE_EXT_11 0xA0 /* follows LEADING_CODE_PRIVATE_11 */
-#define LEADING_CODE_EXT_12 0xE0 /* follows LEADING_CODE_PRIVATE_12 */
-#define LEADING_CODE_EXT_21 0xF0 /* follows LEADING_CODE_PRIVATE_21 */
-#define LEADING_CODE_EXT_22 0xF5 /* follows LEADING_CODE_PRIVATE_22 */
-/* Maximum value of extended leading-codes. */
-#define LEADING_CODE_EXT_MAX 0xFE
-
-/* Definition of minimum/maximum charset of each DIMENSION. */
-#define MIN_CHARSET_OFFICIAL_DIMENSION1 0x80
-#define MAX_CHARSET_OFFICIAL_DIMENSION1 0x8F
-#define MIN_CHARSET_OFFICIAL_DIMENSION2 0x90
-#define MAX_CHARSET_OFFICIAL_DIMENSION2 0x99
-#define MIN_CHARSET_PRIVATE_DIMENSION1 LEADING_CODE_EXT_11
-#define MIN_CHARSET_PRIVATE_DIMENSION2 LEADING_CODE_EXT_21
-
-/* Maximum value of overall charset identification number. */
-#define MAX_CHARSET 0xFE
-
-/* Definition of special charsets. */
-#define CHARSET_ASCII 0 /* 0x00..0x7F */
-#define CHARSET_8_BIT_CONTROL 0x9E /* 0x80..0x9F */
-#define CHARSET_8_BIT_GRAPHIC 0x80 /* 0xA0..0xFF */
-
-extern int charset_latin_iso8859_1; /* ISO8859-1 (Latin-1) */
-extern int charset_jisx0208_1978; /* JISX0208.1978 (Japanese Kanji old set) */
-extern int charset_jisx0208; /* JISX0208.1983 (Japanese Kanji) */
-extern int charset_katakana_jisx0201; /* JISX0201.Kana (Japanese Katakana) */
-extern int charset_latin_jisx0201; /* JISX0201.Roman (Japanese Roman) */
-extern int charset_big5_1; /* Big5 Level 1 (Chinese Traditional) */
-extern int charset_big5_2; /* Big5 Level 2 (Chinese Traditional) */
-extern int charset_mule_unicode_0100_24ff;
-extern int charset_mule_unicode_2500_33ff;
-extern int charset_mule_unicode_e000_ffff;
-
-/* Check if CH is an ASCII character or a base leading-code.
- Nowadays, any byte can be the first byte of a character in a
- multibyte buffer/string. So this macro name is not appropriate. */
-#define CHAR_HEAD_P(ch) ((unsigned char) (ch) < 0xA0)
-
-/*** GENERAL NOTE on CHARACTER REPRESENTATION ***
-
- Firstly, the term "character" or "char" is used for a multilingual
- character (of course, including ASCII characters), not for a byte in
- computer memory. We use the term "code" or "byte" for the latter
- case.
-
- A character is identified by charset and one or two POSITION-CODEs.
- POSITION-CODE is the position of the character in the charset. A
- character of DIMENSION1 charset has one POSITION-CODE: POSITION-CODE-1.
- A character of DIMENSION2 charset has two POSITION-CODE:
- POSITION-CODE-1 and POSITION-CODE-2. The code range of
- POSITION-CODE is 0x20..0x7F.
-
- Emacs has two kinds of representation of a character: multi-byte
- form (for buffers and strings) and single-word form (for character
- objects in Emacs Lisp). The latter is called "character code"
- hereafter. Both representations encode the information of charset
- and POSITION-CODE but in a different way (for instance, the MSB of
- POSITION-CODE is set in multi-byte form).
-
- For details of the multi-byte form, see the section "2. Emacs
- internal format handlers" of `coding.c'.
-
- Emacs uses 19 bits for a character code. The bits are divided into
- 3 fields: FIELD1(5bits):FIELD2(7bits):FIELD3(7bits).
-
- A character code of DIMENSION1 character uses FIELD2 to hold charset
- and FIELD3 to hold POSITION-CODE-1. A character code of DIMENSION2
- character uses FIELD1 to hold charset, FIELD2 and FIELD3 to hold
- POSITION-CODE-1 and POSITION-CODE-2 respectively.
-
- More precisely...
-
- FIELD2 of DIMENSION1 character (except for ascii, eight-bit-control,
- and eight-bit-graphic) is "charset - 0x70". This is to make all
- character codes except for ASCII and 8-bit codes greater than 256.
- So, the range of FIELD2 of DIMENSION1 character is 0, 1, or
- 0x11..0x7F.
-
- FIELD1 of DIMENSION2 character is "charset - 0x8F" for official
- charset and "charset - 0xE0" for private charset. So, the range of
- FIELD1 of DIMENSION2 character is 0x01..0x1E.
-
- -----------------------------------------------------------------------------
- charset FIELD1 (5-bit) FIELD2 (7-bit) FIELD3 (7-bit)
- -----------------------------------------------------------------------------
- ascii 0 0 0x00..0x7F
- eight-bit-control 0 1 0x00..0x1F
- eight-bit-graphic 0 1 0x20..0x7F
- DIMENSION1 0 charset - 0x70 POSITION-CODE-1
- DIMENSION2(o) charset - 0x8F POSITION-CODE-1 POSITION-CODE-2
- DIMENSION2(p) charset - 0xE0 POSITION-CODE-1 POSITION-CODE-2
- -----------------------------------------------------------------------------
- "(o)": official, "(p)": private
- -----------------------------------------------------------------------------
-*/
-
-/* Masks of each field of character code. */
-#define CHAR_FIELD1_MASK (0x1F << 14)
-#define CHAR_FIELD2_MASK (0x7F << 7)
-#define CHAR_FIELD3_MASK 0x7F
-
-/* Macros to access each field of character C. */
-#define CHAR_FIELD1(c) (((c) & CHAR_FIELD1_MASK) >> 14)
-#define CHAR_FIELD2(c) (((c) & CHAR_FIELD2_MASK) >> 7)
-#define CHAR_FIELD3(c) ((c) & CHAR_FIELD3_MASK)
-
-/* Minimum character code of character of each DIMENSION. */
-#define MIN_CHAR_OFFICIAL_DIMENSION1 \
- ((0x81 - 0x70) << 7)
-#define MIN_CHAR_PRIVATE_DIMENSION1 \
- ((MIN_CHARSET_PRIVATE_DIMENSION1 - 0x70) << 7)
-#define MIN_CHAR_OFFICIAL_DIMENSION2 \
- ((MIN_CHARSET_OFFICIAL_DIMENSION2 - 0x8F) << 14)
-#define MIN_CHAR_PRIVATE_DIMENSION2 \
- ((MIN_CHARSET_PRIVATE_DIMENSION2 - 0xE0) << 14)
-/* Maximum character code currently used plus 1. */
-#define MAX_CHAR (0x1F << 14)
-
-/* 1 if C is a single byte character, else 0. */
-#define SINGLE_BYTE_CHAR_P(c) (((unsigned)(c) & 0xFF) == (c))
-
-/* 1 if BYTE is an ASCII character in itself, in multibyte mode. */
-#define ASCII_BYTE_P(byte) ((byte) < 0x80)
-
-/* A char-table containing information on each character set.
-
- Unlike ordinary char-tables, this doesn't contain any nested tables.
- Only the top level elements are used. Each element is a vector of
- the following information:
- CHARSET-ID, BYTES, DIMENSION, CHARS, WIDTH, DIRECTION,
- LEADING-CODE-BASE, LEADING-CODE-EXT,
- ISO-FINAL-CHAR, ISO-GRAPHIC-PLANE,
- REVERSE-CHARSET, SHORT-NAME, LONG-NAME, DESCRIPTION,
- PLIST.
-
- CHARSET-ID (integer) is the identification number of the charset.
-
- BYTES (integer) is the length of the multi-byte form of a character
- in the charset: one of 1, 2, 3, and 4.
-
- DIMENSION (integer) is the number of bytes to represent a character: 1 or 2.
-
- CHARS (integer) is the number of characters in a dimension: 94 or 96.
-
- WIDTH (integer) is the number of columns a character in the charset
- occupies on the screen: one of 0, 1, and 2..
-
- DIRECTION (integer) is the rendering direction of characters in the
- charset when rendering. If 0, render from left to right, else
- render from right to left.
-
- LEADING-CODE-BASE (integer) is the base leading-code for the
- charset.
-
- LEADING-CODE-EXT (integer) is the extended leading-code for the
- charset. All charsets of less than 0xA0 have the value 0.
-
- ISO-FINAL-CHAR (character) is the final character of the
- corresponding ISO 2022 charset. It is -1 for such a character
- that is used only internally (e.g. `eight-bit-control').
-
- ISO-GRAPHIC-PLANE (integer) is the graphic plane to be invoked
- while encoding to variants of ISO 2022 coding system, one of the
- following: 0/graphic-plane-left(GL), 1/graphic-plane-right(GR). It
- is -1 for such a character that is used only internally
- (e.g. `eight-bit-control').
-
- REVERSE-CHARSET (integer) is the charset which differs only in
- LEFT-TO-RIGHT value from the charset. If there's no such a
- charset, the value is -1.
-
- SHORT-NAME (string) is the short name to refer to the charset.
-
- LONG-NAME (string) is the long name to refer to the charset.
-
- DESCRIPTION (string) is the description string of the charset.
-
- PLIST (property list) may contain any type of information a user
- wants to put and get by functions `put-charset-property' and
- `get-charset-property' respectively. */
-extern Lisp_Object Vcharset_table;
-
-/* Macros to access various information of CHARSET in Vcharset_table.
- We provide these macros for efficiency. No range check of CHARSET. */
-
-/* Return entry of CHARSET (C integer) in Vcharset_table. */
-#define CHARSET_TABLE_ENTRY(charset) \
- XCHAR_TABLE (Vcharset_table)->contents[((charset) == CHARSET_ASCII \
- ? 0 : (charset) + 128)]
-
-/* Return information INFO-IDX of CHARSET. */
-#define CHARSET_TABLE_INFO(charset, info_idx) \
- XVECTOR (CHARSET_TABLE_ENTRY (charset))->contents[info_idx]
-
-#define CHARSET_ID_IDX (0)
-#define CHARSET_BYTES_IDX (1)
-#define CHARSET_DIMENSION_IDX (2)
-#define CHARSET_CHARS_IDX (3)
-#define CHARSET_WIDTH_IDX (4)
-#define CHARSET_DIRECTION_IDX (5)
-#define CHARSET_LEADING_CODE_BASE_IDX (6)
-#define CHARSET_LEADING_CODE_EXT_IDX (7)
-#define CHARSET_ISO_FINAL_CHAR_IDX (8)
-#define CHARSET_ISO_GRAPHIC_PLANE_IDX (9)
-#define CHARSET_REVERSE_CHARSET_IDX (10)
-#define CHARSET_SHORT_NAME_IDX (11)
-#define CHARSET_LONG_NAME_IDX (12)
-#define CHARSET_DESCRIPTION_IDX (13)
-#define CHARSET_PLIST_IDX (14)
-/* Size of a vector of each entry of Vcharset_table. */
-#define CHARSET_MAX_IDX (15)
-
-/* And several more macros to be used frequently. */
-#define CHARSET_BYTES(charset) \
- XFASTINT (CHARSET_TABLE_INFO (charset, CHARSET_BYTES_IDX))
-#define CHARSET_DIMENSION(charset) \
- XFASTINT (CHARSET_TABLE_INFO (charset, CHARSET_DIMENSION_IDX))
-#define CHARSET_CHARS(charset) \
- XFASTINT (CHARSET_TABLE_INFO (charset, CHARSET_CHARS_IDX))
-#define CHARSET_WIDTH(charset) \
- XFASTINT (CHARSET_TABLE_INFO (charset, CHARSET_WIDTH_IDX))
-#define CHARSET_DIRECTION(charset) \
- XFASTINT (CHARSET_TABLE_INFO (charset, CHARSET_DIRECTION_IDX))
-#define CHARSET_LEADING_CODE_BASE(charset) \
- XFASTINT (CHARSET_TABLE_INFO (charset, CHARSET_LEADING_CODE_BASE_IDX))
-#define CHARSET_LEADING_CODE_EXT(charset) \
- XFASTINT (CHARSET_TABLE_INFO (charset, CHARSET_LEADING_CODE_EXT_IDX))
-#define CHARSET_ISO_FINAL_CHAR(charset) \
- XINT (CHARSET_TABLE_INFO (charset, CHARSET_ISO_FINAL_CHAR_IDX))
-#define CHARSET_ISO_GRAPHIC_PLANE(charset) \
- XINT (CHARSET_TABLE_INFO (charset, CHARSET_ISO_GRAPHIC_PLANE_IDX))
-#define CHARSET_REVERSE_CHARSET(charset) \
- XINT (CHARSET_TABLE_INFO (charset, CHARSET_REVERSE_CHARSET_IDX))
-
-/* Macros to specify direction of a charset. */
-#define CHARSET_DIRECTION_LEFT_TO_RIGHT 0
-#define CHARSET_DIRECTION_RIGHT_TO_LEFT 1
-
-/* A vector of charset symbol indexed by charset-id. This is used
- only for returning charset symbol from C functions. */
-extern Lisp_Object Vcharset_symbol_table;
-
-/* Return symbol of CHARSET. */
-#define CHARSET_SYMBOL(charset) \
- XVECTOR (Vcharset_symbol_table)->contents[charset]
-
-/* 1 if CHARSET is in valid value range, else 0. */
-#define CHARSET_VALID_P(charset) \
- ((charset) == 0 \
- || ((charset) > 0x80 && (charset) <= MAX_CHARSET_OFFICIAL_DIMENSION2) \
- || ((charset) >= MIN_CHARSET_PRIVATE_DIMENSION1 \
- && (charset) <= MAX_CHARSET) \
- || ((charset) == CHARSET_8_BIT_CONTROL) \
- || ((charset) == CHARSET_8_BIT_GRAPHIC))
-
-/* 1 if CHARSET is already defined, else 0. */
-#define CHARSET_DEFINED_P(charset) \
- (((charset) >= 0) && ((charset) <= MAX_CHARSET) \
- && !NILP (CHARSET_TABLE_ENTRY (charset)))
-
-/* Since the information CHARSET-BYTES and CHARSET-WIDTH of
- Vcharset_table can be retrieved only by the first byte of
- multi-byte form (an ASCII code or a base leading-code), we provide
- here tables to be used by macros BYTES_BY_CHAR_HEAD and
- WIDTH_BY_CHAR_HEAD for faster information retrieval. */
-extern int bytes_by_char_head[256];
-extern int width_by_char_head[256];
-
-#define BYTES_BY_CHAR_HEAD(char_head) \
- (ASCII_BYTE_P (char_head) ? 1 : bytes_by_char_head[char_head])
-#define WIDTH_BY_CHAR_HEAD(char_head) \
- (ASCII_BYTE_P (char_head) ? 1 : width_by_char_head[char_head])
-
-/* Charset of the character C. */
-#define CHAR_CHARSET(c) \
- (SINGLE_BYTE_CHAR_P (c) \
- ? (ASCII_BYTE_P (c) \
- ? CHARSET_ASCII \
- : (c) < 0xA0 ? CHARSET_8_BIT_CONTROL : CHARSET_8_BIT_GRAPHIC) \
- : ((c) < MIN_CHAR_OFFICIAL_DIMENSION2 \
- ? CHAR_FIELD2 (c) + 0x70 \
- : ((c) < MIN_CHAR_PRIVATE_DIMENSION2 \
- ? CHAR_FIELD1 (c) + 0x8F \
- : CHAR_FIELD1 (c) + 0xE0)))
+/* Index to arguments of Fdefine_charset_internal. */
+
+enum define_charset_arg_index
+ {
+ charset_arg_name,
+ charset_arg_dimension,
+ charset_arg_code_space,
+ charset_arg_min_code,
+ charset_arg_max_code,
+ charset_arg_iso_final,
+ charset_arg_iso_revision,
+ charset_arg_emacs_mule_id,
+ charset_arg_ascii_compatible_p,
+ charset_arg_supplementary_p,
+ charset_arg_invalid_code,
+ charset_arg_code_offset,
+ charset_arg_map,
+ charset_arg_subset,
+ charset_arg_superset,
+ charset_arg_unify_map,
+ charset_arg_plist,
+ charset_arg_max
+ };
+
+
+/* Indices to charset attributes vector. */
+
+enum charset_attr_index
+ {
+ /* ID number of the charset. */
+ charset_id,
+
+ /* Name of the charset (symbol). */
+ charset_name,
+
+ /* Property list of the charset. */
+ charset_plist,
+
+ /* If the method of the charset is `MAP_DEFERRED', the value is a
+ mapping vector or a file name that contains mapping vector.
+ Otherwise, nil. */
+ charset_map,
+
+ /* If the method of the charset is `MAP', the value is a vector
+ that maps code points of the charset to characters. The vector
+ is indexed by a character index. A character index is
+ calculated from a code point and the code-space table of the
+ charset. */
+ charset_decoder,
+
+ /* If the method of the charset is `MAP', the value is a
+ char-table that maps characters of the charset to code
+ points. */
+ charset_encoder,
+
+ /* If the method of the charset is `SUBSET', the value is a vector
+ that has this form:
+
+ [ CHARSET-ID MIN-CODE MAX-CODE OFFSET ]
+
+ CHARSET-ID is an ID number of a parent charset. MIN-CODE and
+ MAX-CODE specify the range of characters inherited from the
+ parent. OFFSET is an integer value to add to a code point of
+ the parent charset to get the corresponding code point of this
+ charset. */
+ charset_subset,
+
+ /* If the method of the charset is `SUPERSET', the value is a list
+ whose elements have this form:
+
+ (CHARSET-ID . OFFSET)
+
+ CHARSET-IDs are ID numbers of parent charsets. OFFSET is an
+ integer value to add to a code point of the parent charset to
+ get the corresponding code point of this charset. */
+ charset_superset,
+
+ /* The value is a mapping vector or a file name that contains the
+ mapping. This defines how characters in the charset should be
+ unified with Unicode. The value of the member
+ `charset_deunifier' is created from this information. */
+ charset_unify_map,
+
+ /* If characters in the charset must be unified Unicode, the value
+ is a char table that maps a unified Unicode character code to
+ the non-unified character code in the charset. */
+ charset_deunifier,
+
+ /* The length of the charset attribute vector. */
+ charset_attr_max
+ };
+
+/* Methods for converting code points and characters of charsets. */
+
+enum charset_method
+ {
+ /* For a charset of this method, a character code is calculated
+ from a character index (which is calculated from a code point)
+ simply by adding an offset value. */
+ CHARSET_METHOD_OFFSET,
+
+ /* For a charset of this method, a decoder vector and an encoder
+ char-table is used for code point <-> character code
+ conversion. */
+ CHARSET_METHOD_MAP,
+
+ /* Same as above but decoder and encoder are loaded from a file on
+ demand. Once loaded, the method is changed to
+ CHARSET_METHOD_MAP. */
+ CHARSET_METHOD_MAP_DEFERRED,
+
+ /* A charset of this method is a subset of another charset. */
+ CHARSET_METHOD_SUBSET,
+
+ /* A charset of this method is a superset of other charsets. */
+ CHARSET_METHOD_SUPERSET
+ };
+
+struct charset
+{
+ /* Index to charset_table. */
+ int id;
-/* Check if two characters C1 and C2 belong to the same charset. */
-#define SAME_CHARSET_P(c1, c2) \
- (c1 < MIN_CHAR_OFFICIAL_DIMENSION2 \
- ? (c1 & CHAR_FIELD2_MASK) == (c2 & CHAR_FIELD2_MASK) \
- : (c1 & CHAR_FIELD1_MASK) == (c2 & CHAR_FIELD1_MASK))
-
-/* Return a character of which charset is CHARSET and position-codes
- are C1 and C2. DIMENSION1 character ignores C2. */
-#define MAKE_CHAR(charset, c1, c2) \
- ((charset) == CHARSET_ASCII \
- ? (c1) & 0x7F \
- : (((charset) == CHARSET_8_BIT_CONTROL \
- || (charset) == CHARSET_8_BIT_GRAPHIC) \
- ? ((c1) & 0x7F) | 0x80 \
- : ((CHARSET_DEFINED_P (charset) \
- ? CHARSET_DIMENSION (charset) == 1 \
- : (charset) < MIN_CHARSET_PRIVATE_DIMENSION2) \
- ? (((charset) - 0x70) << 7) | ((c1) <= 0 ? 0 : ((c1) & 0x7F)) \
- : ((((charset) \
- - ((charset) < MIN_CHARSET_PRIVATE_DIMENSION2 ? 0x8F : 0xE0)) \
- << 14) \
- | ((c2) <= 0 ? 0 : ((c2) & 0x7F)) \
- | ((c1) <= 0 ? 0 : (((c1) & 0x7F) << 7))))))
-
-
-/* If GENERICP is nonzero, return nonzero if C is a valid normal or
- generic character. If GENERICP is zero, return nonzero if C is a
- valid normal character. */
-#define CHAR_VALID_P(c, genericp) \
- ((c) >= 0 \
- && (SINGLE_BYTE_CHAR_P (c) || char_valid_p (c, genericp)))
-
-/* This default value is used when nonascii-translation-table or
- nonascii-insert-offset fail to convert unibyte character to a valid
- multibyte character. This makes a Latin-1 character. */
-
-#define DEFAULT_NONASCII_INSERT_OFFSET 0x800
-
-/* Parse multibyte string STR of length LENGTH and set BYTES to the
- byte length of a character at STR. */
-
-#ifdef BYTE_COMBINING_DEBUG
-
-#define PARSE_MULTIBYTE_SEQ(str, length, bytes) \
+ /* Index to Vcharset_hash_table. */
+ int hash_index;
+
+ /* Dimension of the charset: 1, 2, 3, or 4. */
+ int dimension;
+
+ /* Byte code range of each dimension. <code_space>[4N] is a mininum
+ byte code of the (N+1)th dimension, <code_space>[4N+1] is a
+ maximum byte code of the (N+1)th dimension, <code_space>[4N+2] is
+ (<code_space>[4N+1] - <code_space>[4N] + 1), <code_space>[4N+3]
+ is a number of characters containd in the first to (N+1)th
+ dismesions. We get `char-index' of a `code-point' from this
+ information. */
+ int code_space[16];
+
+ /* If B is a byte of Nth dimension of a code-point, the (N-1)th bit
+ of code_space_mask[B] is set. This array is used to quickly
+ check if a code-point is in a valid range. */
+ unsigned char *code_space_mask;
+
+ /* 1 if there's no gap in code-points. */
+ int code_linear_p;
+
+ /* If the charset is treated as 94-chars in ISO-2022, the value is 0.
+ If the charset is treated as 96-chars in ISO-2022, the value is 1. */
+ int iso_chars_96;
+
+ /* ISO final byte of the charset: 48..127. It may be -1 if the
+ charset doesn't conform to ISO-2022. */
+ int iso_final;
+
+ /* ISO revision number of the charset. */
+ int iso_revision;
+
+ /* If the charset is identical to what supported by Emacs 21 and the
+ priors, the identification number of the charset used in those
+ version. Otherwise, -1. */
+ int emacs_mule_id;
+
+ /* Nonzero if the charset is compatible with ASCII. */
+ int ascii_compatible_p;
+
+ /* Nonzero if the charset is supplementary. */
+ int supplementary_p;
+
+ /* Nonzero if all the code points are representable by Lisp_Int. */
+ int compact_codes_p;
+
+ /* The method for encoding/decoding characters of the charset. */
+ enum charset_method method;
+
+ /* Mininum and Maximum code points of the charset. */
+ unsigned min_code, max_code;
+
+ /* Offset value used by macros CODE_POINT_TO_INDEX and
+ INDEX_TO_CODE_POINT. . */
+ unsigned char_index_offset;
+
+ /* Mininum and Maximum character codes of the charset. If the
+ charset is compatible with ASCII, min_char is a minimum non-ASCII
+ character of the charset. If the method of charset is
+ CHARSET_METHOD_OFFSET, even if the charset is unified, min_char
+ and max_char doesn't change. */
+ int min_char, max_char;
+
+ /* The code returned by ENCODE_CHAR if a character is not encodable
+ by the charset. */
+ unsigned invalid_code;
+
+ /* If the method of the charset is CHARSET_METHOD_MAP, this is a
+ table of bits used to quickly and roughly guess if a character
+ belongs to the charset.
+
+ The first 64 elements are 512 bits for characters less than
+ 0x10000. Each bit corresponds to 128-character block. The last
+ 126 elements are 1008 bits for the greater characters
+ (0x10000..0x3FFFFF). Each bit corresponds to 4096-character
+ block.
+
+ If a bit is 1, at least one character in the corresponding block is
+ in this charset. */
+ unsigned char fast_map[190];
+
+ /* Offset value to calculate a character code from code-point, and
+ visa versa. */
+ int code_offset;
+
+ int unified_p;
+};
+
+/* Hash table of charset symbols vs. the correponding attribute
+ vectors. */
+extern Lisp_Object Vcharset_hash_table;
+
+/* Table of struct charset. */
+extern struct charset *charset_table;
+
+#define CHARSET_FROM_ID(id) (charset_table + (id))
+
+extern Lisp_Object Vcharset_ordered_list;
+
+/* Incremented everytime we change the priority of charsets. */
+extern unsigned short charset_ordered_list_tick;
+
+extern Lisp_Object Vcharset_list;
+extern Lisp_Object Viso_2022_charset_list;
+extern Lisp_Object Vemacs_mule_charset_list;
+
+extern struct charset *emacs_mule_charset[256];
+
+
+/* Macros to access information about charset. */
+
+/* Return the attribute vector of charset whose symbol is SYMBOL. */
+#define CHARSET_SYMBOL_ATTRIBUTES(symbol) \
+ Fgethash ((symbol), Vcharset_hash_table, Qnil)
+
+#define CHARSET_ATTR_ID(attrs) AREF ((attrs), charset_id)
+#define CHARSET_ATTR_NAME(attrs) AREF ((attrs), charset_name)
+#define CHARSET_ATTR_PLIST(attrs) AREF ((attrs), charset_plist)
+#define CHARSET_ATTR_MAP(attrs) AREF ((attrs), charset_map)
+#define CHARSET_ATTR_DECODER(attrs) AREF ((attrs), charset_decoder)
+#define CHARSET_ATTR_ENCODER(attrs) AREF ((attrs), charset_encoder)
+#define CHARSET_ATTR_SUBSET(attrs) AREF ((attrs), charset_subset)
+#define CHARSET_ATTR_SUPERSET(attrs) AREF ((attrs), charset_superset)
+#define CHARSET_ATTR_UNIFY_MAP(attrs) AREF ((attrs), charset_unify_map)
+#define CHARSET_ATTR_DEUNIFIER(attrs) AREF ((attrs), charset_deunifier)
+
+#define CHARSET_SYMBOL_ID(symbol) \
+ CHARSET_ATTR_ID (CHARSET_SYMBOL_ATTRIBUTES (symbol))
+
+/* Return an index to Vcharset_hash_table of the charset whose symbol
+ is SYMBOL. */
+#define CHARSET_SYMBOL_HASH_INDEX(symbol) \
+ hash_lookup (XHASH_TABLE (Vcharset_hash_table), symbol, NULL)
+
+/* Return the attribute vector of CHARSET. */
+#define CHARSET_ATTRIBUTES(charset) \
+ (HASH_VALUE (XHASH_TABLE (Vcharset_hash_table), (charset)->hash_index))
+
+#define CHARSET_ID(charset) ((charset)->id)
+#define CHARSET_HASH_INDEX(charset) ((charset)->hash_index)
+#define CHARSET_DIMENSION(charset) ((charset)->dimension)
+#define CHARSET_CODE_SPACE(charset) ((charset)->code_space)
+#define CHARSET_CODE_LINEAR_P(charset) ((charset)->code_linear_p)
+#define CHARSET_ISO_CHARS_96(charset) ((charset)->iso_chars_96)
+#define CHARSET_ISO_FINAL(charset) ((charset)->iso_final)
+#define CHARSET_ISO_PLANE(charset) ((charset)->iso_plane)
+#define CHARSET_ISO_REVISION(charset) ((charset)->iso_revision)
+#define CHARSET_EMACS_MULE_ID(charset) ((charset)->emacs_mule_id)
+#define CHARSET_ASCII_COMPATIBLE_P(charset) ((charset)->ascii_compatible_p)
+#define CHARSET_COMPACT_CODES_P(charset) ((charset)->compact_codes_p)
+#define CHARSET_METHOD(charset) ((charset)->method)
+#define CHARSET_MIN_CODE(charset) ((charset)->min_code)
+#define CHARSET_MAX_CODE(charset) ((charset)->max_code)
+#define CHARSET_INVALID_CODE(charset) ((charset)->invalid_code)
+#define CHARSET_MIN_CHAR(charset) ((charset)->min_char)
+#define CHARSET_MAX_CHAR(charset) ((charset)->max_char)
+#define CHARSET_CODE_OFFSET(charset) ((charset)->code_offset)
+#define CHARSET_UNIFIED_P(charset) ((charset)->unified_p)
+
+#define CHARSET_NAME(charset) \
+ (CHARSET_ATTR_NAME (CHARSET_ATTRIBUTES (charset)))
+#define CHARSET_MAP(charset) \
+ (CHARSET_ATTR_MAP (CHARSET_ATTRIBUTES (charset)))
+#define CHARSET_DECODER(charset) \
+ (CHARSET_ATTR_DECODER (CHARSET_ATTRIBUTES (charset)))
+#define CHARSET_ENCODER(charset) \
+ (CHARSET_ATTR_ENCODER (CHARSET_ATTRIBUTES (charset)))
+#define CHARSET_SUBSET(charset) \
+ (CHARSET_ATTR_SUBSET (CHARSET_ATTRIBUTES (charset)))
+#define CHARSET_SUPERSET(charset) \
+ (CHARSET_ATTR_SUPERSET (CHARSET_ATTRIBUTES (charset)))
+#define CHARSET_UNIFY_MAP(charset) \
+ (CHARSET_ATTR_UNIFY_MAP (CHARSET_ATTRIBUTES (charset)))
+#define CHARSET_DEUNIFIER(charset) \
+ (CHARSET_ATTR_DEUNIFIER (CHARSET_ATTRIBUTES (charset)))
+
+
+/* Nonzero if OBJ is a valid charset symbol. */
+#define CHARSETP(obj) (CHARSET_SYMBOL_HASH_INDEX (obj) >= 0)
+
+/* Check if X is a valid charset symbol. If not, signal an error. */
+#define CHECK_CHARSET(x) \
do { \
- int i = 1; \
- while (i < (length) && ! CHAR_HEAD_P ((str)[i])) i++; \
- (bytes) = BYTES_BY_CHAR_HEAD ((str)[0]); \
- if ((bytes) > i) \
- abort (); \
+ if (! SYMBOLP (x) || CHARSET_SYMBOL_HASH_INDEX (x) < 0) \
+ x = wrong_type_argument (Qcharsetp, (x)); \
} while (0)
-#else /* not BYTE_COMBINING_DEBUG */
-
-#define PARSE_MULTIBYTE_SEQ(str, length, bytes) \
- ((void)(length), (bytes) = BYTES_BY_CHAR_HEAD ((str)[0]))
-
-#endif /* not BYTE_COMBINING_DEBUG */
-
-#define VALID_LEADING_CODE_P(code) \
- (! NILP (CHARSET_TABLE_ENTRY (code)))
-
-/* Return 1 if the byte sequence at unibyte string STR (LENGTH bytes)
- is valid as a multibyte form. If valid, by a side effect, BYTES is
- set to the byte length of the multibyte form. */
-
-#define UNIBYTE_STR_AS_MULTIBYTE_P(str, length, bytes) \
- (((str)[0] < 0x80 || (str)[0] >= 0xA0) \
- ? ((bytes) = 1) \
- : (((bytes) = BYTES_BY_CHAR_HEAD ((str)[0])), \
- ((bytes) <= (length) \
- && !CHAR_HEAD_P ((str)[1]) \
- && ((bytes) == 2 \
- ? (str)[0] != LEADING_CODE_8_BIT_CONTROL \
- : (!CHAR_HEAD_P ((str)[2]) \
- && ((bytes) == 3 \
- ? (((str)[0] != LEADING_CODE_PRIVATE_11 \
- && (str)[0] != LEADING_CODE_PRIVATE_12) \
- || VALID_LEADING_CODE_P (str[1])) \
- : (!CHAR_HEAD_P ((str)[3]) \
- && VALID_LEADING_CODE_P (str[1]))))))))
-
-
-/* Return 1 if the byte sequence at multibyte string STR is valid as
- a unibyte form. By a side effect, BYTES is set to the byte length
- of one character at STR. */
-
-#define MULTIBYTE_STR_AS_UNIBYTE_P(str, bytes) \
- ((bytes) = BYTES_BY_CHAR_HEAD ((str)[0]), \
- (str)[0] != LEADING_CODE_8_BIT_CONTROL)
-
-/* The charset of character C is stored in CHARSET, and the
- position-codes of C are stored in C1 and C2.
- We store -1 in C2 if the dimension of the charset is 1. */
-
-#define SPLIT_CHAR(c, charset, c1, c2) \
- (SINGLE_BYTE_CHAR_P (c) \
- ? ((charset \
- = (ASCII_BYTE_P (c) \
- ? CHARSET_ASCII \
- : ((c) < 0xA0 ? CHARSET_8_BIT_CONTROL : CHARSET_8_BIT_GRAPHIC))), \
- c1 = (c), c2 = -1) \
- : ((c) & CHAR_FIELD1_MASK \
- ? (charset = (CHAR_FIELD1 (c) \
- + ((c) < MIN_CHAR_PRIVATE_DIMENSION2 ? 0x8F : 0xE0)), \
- c1 = CHAR_FIELD2 (c), \
- c2 = CHAR_FIELD3 (c)) \
- : (charset = CHAR_FIELD2 (c) + 0x70, \
- c1 = CHAR_FIELD3 (c), \
- c2 = -1)))
-
-/* Return 1 if character C has valid printable glyph. */
-#define CHAR_PRINTABLE_P(c) (ASCII_BYTE_P (c) || char_printable_p (c))
-
-/* The charset of the character at STR is stored in CHARSET, and the
- position-codes are stored in C1 and C2.
- We store -1 in C2 if the character is just 2 bytes. */
-
-#define SPLIT_STRING(str, len, charset, c1, c2) \
- ((BYTES_BY_CHAR_HEAD ((unsigned char) *(str)) < 2 \
- || BYTES_BY_CHAR_HEAD ((unsigned char) *(str)) > len \
- || split_string (str, len, &charset, &c1, &c2) < 0) \
- ? c1 = *(str), charset = CHARSET_ASCII \
- : charset)
-/* Mapping table from ISO2022's charset (specified by DIMENSION,
- CHARS, and FINAL_CHAR) to Emacs' charset. Should be accessed by
- macro ISO_CHARSET_TABLE (DIMENSION, CHARS, FINAL_CHAR). */
-extern int iso_charset_table[2][2][128];
-
-#define ISO_CHARSET_TABLE(dimension, chars, final_char) \
- iso_charset_table[XINT (dimension) - 1][XINT (chars) > 94][XINT (final_char)]
-
-#define BASE_LEADING_CODE_P(c) (BYTES_BY_CHAR_HEAD ((unsigned char) (c)) > 1)
-
-/* Return how many bytes C will occupy in a multibyte buffer. */
-#define CHAR_BYTES(c) \
- (SINGLE_BYTE_CHAR_P (c) \
- ? ((ASCII_BYTE_P (c) || (c) >= 0xA0) ? 1 : 2) \
- : char_bytes (c))
-
-/* The following two macros CHAR_STRING and STRING_CHAR are the main
- entry points to convert between Emacs's two types of character
- representations: multi-byte form and single-word form (character
- code). */
-
-/* Store multi-byte form of the character C in STR. The caller should
- allocate at least MAX_MULTIBYTE_LENGTH bytes area at STR in
- advance. Returns the length of the multi-byte form. If C is an
- invalid character code, signal an error. */
-
-#define CHAR_STRING(c, str) \
- (SINGLE_BYTE_CHAR_P (c) \
- ? ((ASCII_BYTE_P (c) || c >= 0xA0) \
- ? (*(str) = (unsigned char)(c), 1) \
- : (*(str) = LEADING_CODE_8_BIT_CONTROL, *((str)+ 1) = c + 0x20, 2)) \
- : char_to_string (c, (unsigned char *) str))
-
-/* Like CHAR_STRING but don't signal an error if C is invalid.
- Value is -1 in this case. */
-
-#define CHAR_STRING_NO_SIGNAL(c, str) \
- (SINGLE_BYTE_CHAR_P (c) \
- ? ((ASCII_BYTE_P (c) || c >= 0xA0) \
- ? (*(str) = (unsigned char)(c), 1) \
- : (*(str) = LEADING_CODE_8_BIT_CONTROL, *((str)+ 1) = c + 0x20, 2)) \
- : char_to_string_1 (c, (unsigned char *) str))
-
-/* Return a character code of the character of which multi-byte form
- is at STR and the length is LEN. If STR doesn't contain valid
- multi-byte form, only the first byte in STR is returned. */
-
-#define STRING_CHAR(str, len) \
- (BYTES_BY_CHAR_HEAD ((unsigned char) *(str)) == 1 \
- ? (unsigned char) *(str) \
- : string_to_char (str, len, 0))
-
-/* This is like STRING_CHAR but the third arg ACTUAL_LEN is set to the
- length of the multi-byte form. Just to know the length, use
- MULTIBYTE_FORM_LENGTH. */
-
-#define STRING_CHAR_AND_LENGTH(str, len, actual_len) \
- (BYTES_BY_CHAR_HEAD ((unsigned char) *(str)) == 1 \
- ? ((actual_len) = 1), (unsigned char) *(str) \
- : string_to_char (str, len, &(actual_len)))
-
-/* Fetch the "next" character from Lisp string STRING at byte position
- BYTEIDX, character position CHARIDX. Store it into OUTPUT.
-
- All the args must be side-effect-free.
- BYTEIDX and CHARIDX must be lvalues;
- we increment them past the character fetched. */
-
-#define FETCH_STRING_CHAR_ADVANCE(OUTPUT, STRING, CHARIDX, BYTEIDX) \
-if (1) \
- { \
- CHARIDX++; \
- if (STRING_MULTIBYTE (STRING)) \
- { \
- const unsigned char *ptr = SDATA (STRING) + BYTEIDX; \
- int space_left = SBYTES (STRING) - BYTEIDX; \
- int actual_len; \
- \
- OUTPUT = STRING_CHAR_AND_LENGTH (ptr, space_left, actual_len); \
- BYTEIDX += actual_len; \
- } \
- else \
- OUTPUT = SREF (STRING, BYTEIDX++); \
- } \
-else
-
-/* Like FETCH_STRING_CHAR_ADVANCE but assume STRING is multibyte. */
-
-#define FETCH_STRING_CHAR_ADVANCE_NO_CHECK(OUTPUT, STRING, CHARIDX, BYTEIDX) \
-if (1) \
- { \
- const unsigned char *fetch_string_char_ptr = SDATA (STRING) + BYTEIDX; \
- int fetch_string_char_space_left = SBYTES (STRING) - BYTEIDX; \
- int actual_len; \
- \
- OUTPUT \
- = STRING_CHAR_AND_LENGTH (fetch_string_char_ptr, \
- fetch_string_char_space_left, actual_len); \
- \
- BYTEIDX += actual_len; \
- CHARIDX++; \
- } \
-else
-
-/* Like FETCH_STRING_CHAR_ADVANCE but fetch character from the current
- buffer. */
-
-#define FETCH_CHAR_ADVANCE(OUTPUT, CHARIDX, BYTEIDX) \
-if (1) \
- { \
- CHARIDX++; \
- if (!NILP (current_buffer->enable_multibyte_characters)) \
- { \
- unsigned char *ptr = BYTE_POS_ADDR (BYTEIDX); \
- int space_left = ((CHARIDX < GPT ? GPT_BYTE : Z_BYTE) - BYTEIDX); \
- int actual_len; \
- \
- OUTPUT= STRING_CHAR_AND_LENGTH (ptr, space_left, actual_len); \
- BYTEIDX += actual_len; \
- } \
- else \
- { \
- OUTPUT = *(BYTE_POS_ADDR (BYTEIDX)); \
- BYTEIDX++; \
- } \
- } \
-else
-
-/* Return the length of the multi-byte form at string STR of length LEN. */
-
-#define MULTIBYTE_FORM_LENGTH(str, len) \
- (BYTES_BY_CHAR_HEAD (*(unsigned char *)(str)) == 1 \
- ? 1 \
- : multibyte_form_length (str, len))
-
-/* If P is before LIMIT, advance P to the next character boundary. It
- assumes that P is already at a character boundary of the sane
- mulitbyte form whose end address is LIMIT. */
-
-#define NEXT_CHAR_BOUNDARY(p, limit) \
- do { \
- if ((p) < (limit)) \
- (p) += BYTES_BY_CHAR_HEAD (*(p)); \
+/* Check if X is a valid charset symbol. If valid, set ID to the id
+ number of the charset. Otherwise, signal an error. */
+#define CHECK_CHARSET_GET_ID(x, id) \
+ do { \
+ int idx; \
+ \
+ if (! SYMBOLP (x) || (idx = CHARSET_SYMBOL_HASH_INDEX (x)) < 0) \
+ x = wrong_type_argument (Qcharsetp, (x)); \
+ id = XINT (AREF (HASH_VALUE (XHASH_TABLE (Vcharset_hash_table), idx), \
+ charset_id)); \
} while (0)
-/* If P is after LIMIT, advance P to the previous character boundary. */
-
-#define PREV_CHAR_BOUNDARY(p, limit) \
+/* Check if X is a valid charset symbol. If valid, set ATTR to the
+ attr vector of the charset. Otherwise, signal an error. */
+#define CHECK_CHARSET_GET_ATTR(x, attr) \
do { \
- if ((p) > (limit)) \
- { \
- const unsigned char *p0 = (p); \
- const unsigned char *p_limit = max (limit, p0 - MAX_MULTIBYTE_LENGTH);\
- do { \
- p0--; \
- } while (p0 >= p_limit && ! CHAR_HEAD_P (*p0)); \
- /* If BBCH(*p0) > p-p0, it means we were not on a boundary. */ \
- (p) = (BYTES_BY_CHAR_HEAD (*p0) >= (p) - p0) ? p0 : (p) - 1; \
- } \
+ if (!SYMBOLP (x) || NILP (attr = CHARSET_SYMBOL_ATTRIBUTES (x))) \
+ x = wrong_type_argument (Qcharsetp, (x)); \
} while (0)
-#define AT_CHAR_BOUNDARY_P(result, p, limit) \
+
+#define CHECK_CHARSET_GET_CHARSET(x, charset) \
do { \
- if (CHAR_HEAD_P (*(p)) || (p) <= limit) \
- /* Optimization for the common case. */ \
- (result) = 1; \
- else \
- { \
- const unsigned char *p_aux = (p)+1; \
- PREV_CHAR_BOUNDARY (p_aux, limit); \
- (result) = (p_aux == (p)); \
- } \
-} while (0)
-
-#ifdef emacs
-
-/* Increase the buffer byte position POS_BYTE of the current buffer to
- the next character boundary. This macro relies on the fact that
- *GPT_ADDR and *Z_ADDR are always accessible and the values are
- '\0'. No range checking of POS. */
-
-#ifdef BYTE_COMBINING_DEBUG
-
-#define INC_POS(pos_byte) \
- do { \
- unsigned char *p = BYTE_POS_ADDR (pos_byte); \
- if (BASE_LEADING_CODE_P (*p)) \
- { \
- int len, bytes; \
- len = Z_BYTE - pos_byte; \
- PARSE_MULTIBYTE_SEQ (p, len, bytes); \
- pos_byte += bytes; \
- } \
- else \
- pos_byte++; \
+ int id; \
+ CHECK_CHARSET_GET_ID (x, id); \
+ charset = CHARSET_FROM_ID (id); \
} while (0)
-#else /* not BYTE_COMBINING_DEBUG */
-#define INC_POS(pos_byte) \
- do { \
- unsigned char *p = BYTE_POS_ADDR (pos_byte); \
- pos_byte += BYTES_BY_CHAR_HEAD (*p); \
- } while (0)
+/* Lookup Vcharset_order_list and return the first charset that
+ contains the character C. */
+#define CHAR_CHARSET(c) \
+ ((c) < 0x80 ? CHARSET_FROM_ID (charset_ascii) \
+ : char_charset ((c), Qnil, NULL))
-#endif /* not BYTE_COMBINING_DEBUG */
+#if 0
+/* Char-table of charset-sets. Each element is a bool vector indexed
+ by a charset ID. */
+extern Lisp_Object Vchar_charset_set;
-/* Decrease the buffer byte position POS_BYTE of the current buffer to
- the previous character boundary. No range checking of POS. */
-#define DEC_POS(pos_byte) \
- do { \
- unsigned char *p, *p_min; \
- \
- pos_byte--; \
- if (pos_byte < GPT_BYTE) \
- p = BEG_ADDR + pos_byte - BEG_BYTE, p_min = BEG_ADDR; \
- else \
- p = BEG_ADDR + GAP_SIZE + pos_byte - BEG_BYTE, p_min = GAP_END_ADDR;\
- if (p > p_min && !CHAR_HEAD_P (*p)) \
- { \
- unsigned char *pend = p--; \
- int len, bytes; \
- if (p_min < p - MAX_MULTIBYTE_LENGTH) \
- p_min = p - MAX_MULTIBYTE_LENGTH; \
- while (p > p_min && !CHAR_HEAD_P (*p)) p--; \
- len = pend + 1 - p; \
- PARSE_MULTIBYTE_SEQ (p, len, bytes); \
- if (bytes == len) \
- pos_byte -= len - 1; \
- } \
- } while (0)
+/* Charset-bag of character C. */
+#define CHAR_CHARSET_SET(c) \
+ CHAR_TABLE_REF (Vchar_charset_set, c)
-/* Increment both CHARPOS and BYTEPOS, each in the appropriate way. */
+/* Check if two characters C1 and C2 belong to the same charset. */
+#define SAME_CHARSET_P(c1, c2) \
+ intersection_p (CHAR_CHARSET_SET (c1), CHAR_CHARSET_SET (c2))
+
+#endif
+
+
+/* Return a character correponding to the code-point CODE of CHARSET.
+ Try some optimization before calling decode_char. */
+
+#define DECODE_CHAR(charset, code) \
+ ((ASCII_BYTE_P (code) && (charset)->ascii_compatible_p) \
+ ? (code) \
+ : ((code) < (charset)->min_code || (code) > (charset)->max_code) \
+ ? -1 \
+ : (charset)->unified_p \
+ ? decode_char ((charset), (code)) \
+ : (charset)->method == CHARSET_METHOD_OFFSET \
+ ? ((charset)->code_linear_p \
+ ? (code) - (charset)->min_code + (charset)->code_offset \
+ : decode_char ((charset), (code))) \
+ : (charset)->method == CHARSET_METHOD_MAP \
+ ? ((charset)->code_linear_p \
+ ? XINT (AREF (CHARSET_DECODER (charset), \
+ (code) - (charset)->min_code)) \
+ : decode_char ((charset), (code))) \
+ : decode_char ((charset), (code)))
+
+
+/* If CHARSET is a simple offset base charset, return it's offset,
+ otherwise return -1. */
+#define CHARSET_OFFSET(charset) \
+ (((charset)->method == CHARSET_METHOD_OFFSET \
+ && (charset)->code_linear_p \
+ && ! (charset)->unified_p) \
+ ? (charset)->code_offset - (charset)->min_code \
+ : -1)
+
+extern Lisp_Object charset_work;
+
+/* Return a code point of CHAR in CHARSET.
+ Try some optimization before calling encode_char. */
+
+#define ENCODE_CHAR(charset, c) \
+ ((ASCII_CHAR_P (c) && (charset)->ascii_compatible_p) \
+ ? (c) \
+ : ((charset)->unified_p \
+ || (charset)->method == CHARSET_METHOD_SUBSET \
+ || (charset)->method == CHARSET_METHOD_SUPERSET) \
+ ? encode_char ((charset), (c)) \
+ : ((c) < (charset)->min_char || (c) > (charset)->max_char) \
+ ? (charset)->invalid_code \
+ : (charset)->method == CHARSET_METHOD_OFFSET \
+ ? ((charset)->code_linear_p \
+ ? (c) - (charset)->code_offset + (charset)->min_code \
+ : encode_char ((charset), (c))) \
+ : (charset)->method == CHARSET_METHOD_MAP \
+ ? ((charset)->compact_codes_p \
+ ? (charset_work = CHAR_TABLE_REF (CHARSET_ENCODER (charset), (c)), \
+ (NILP (charset_work) \
+ ? (charset)->invalid_code \
+ : XFASTINT (charset_work))) \
+ : encode_char ((charset), (c))) \
+ : encode_char ((charset), (c)))
+
+
+/* Set to 1 when a charset map is loaded to warn that a buffer text
+ and a string data may be relocated. */
+extern int charset_map_loaded;
+
+
+/* Set CHARSET to the charset highest priority of C, CODE to the
+ code-point of C in CHARSET. */
+#define SPLIT_CHAR(c, charset, code) \
+ ((charset) = char_charset ((c), Qnil, &(code)))
+
+
+#define ISO_MAX_DIMENSION 3
+#define ISO_MAX_CHARS 2
+#define ISO_MAX_FINAL 0x80 /* only 0x30..0xFF are used */
-#define INC_BOTH(charpos, bytepos) \
-do \
- { \
- (charpos)++; \
- if (NILP (current_buffer->enable_multibyte_characters)) \
- (bytepos)++; \
- else \
- INC_POS ((bytepos)); \
- } \
-while (0)
-
-/* Decrement both CHARPOS and BYTEPOS, each in the appropriate way. */
-
-#define DEC_BOTH(charpos, bytepos) \
-do \
- { \
- (charpos)--; \
- if (NILP (current_buffer->enable_multibyte_characters)) \
- (bytepos)--; \
- else \
- DEC_POS ((bytepos)); \
- } \
-while (0)
+/* Mapping table from ISO2022's charset (specified by DIMENSION,
+ CHARS, and FINAL_CHAR) to Emacs' charset ID. Should be accessed by
+ macro ISO_CHARSET_TABLE (DIMENSION, CHARS, FINAL_CHAR). */
+extern int iso_charset_table[ISO_MAX_DIMENSION][ISO_MAX_CHARS][ISO_MAX_FINAL];
-/* Increase the buffer byte position POS_BYTE of the current buffer to
- the next character boundary. This macro relies on the fact that
- *GPT_ADDR and *Z_ADDR are always accessible and the values are
- '\0'. No range checking of POS_BYTE. */
+/* A charset of type iso2022 who has DIMENSION, CHARS, and FINAL
+ (final character). */
+#define ISO_CHARSET_TABLE(dimension, chars_96, final) \
+ iso_charset_table[(dimension) - 1][(chars_96)][(final)]
-#ifdef BYTE_COMBINING_DEBUG
+/* Nonzero if the charset who has FAST_MAP may contain C. */
+#define CHARSET_FAST_MAP_REF(c, fast_map) \
+ ((c) < 0x10000 \
+ ? fast_map[(c) >> 10] & (1 << (((c) >> 7) & 7)) \
+ : fast_map[((c) >> 15) + 62] & (1 << (((c) >> 12) & 7)))
-#define BUF_INC_POS(buf, pos_byte) \
+#define CHARSET_FAST_MAP_SET(c, fast_map) \
do { \
- unsigned char *p = BUF_BYTE_ADDRESS (buf, pos_byte); \
- if (BASE_LEADING_CODE_P (*p)) \
- { \
- int len, bytes; \
- len = BUF_Z_BYTE (buf) - pos_byte; \
- PARSE_MULTIBYTE_SEQ (p, len, bytes); \
- pos_byte += bytes; \
- } \
+ if ((c) < 0x10000) \
+ (fast_map)[(c) >> 10] |= 1 << (((c) >> 7) & 7); \
else \
- pos_byte++; \
+ (fast_map)[((c) >> 15) + 62] |= 1 << (((c) >> 12) & 7); \
} while (0)
-#else /* not BYTE_COMBINING_DEBUG */
-#define BUF_INC_POS(buf, pos_byte) \
- do { \
- unsigned char *p = BUF_BYTE_ADDRESS (buf, pos_byte); \
- pos_byte += BYTES_BY_CHAR_HEAD (*p); \
- } while (0)
-#endif /* not BYTE_COMBINING_DEBUG */
+/* 1 if CHARSET may contain the character C. */
+#define CHAR_CHARSET_P(c, charset) \
+ ((ASCII_CHAR_P (c) && (charset)->ascii_compatible_p) \
+ || ((CHARSET_UNIFIED_P (charset) \
+ || (charset)->method == CHARSET_METHOD_SUBSET \
+ || (charset)->method == CHARSET_METHOD_SUPERSET) \
+ ? encode_char ((charset), (c)) != (charset)->invalid_code \
+ : (CHARSET_FAST_MAP_REF ((c), (charset)->fast_map) \
+ && ((charset)->method == CHARSET_METHOD_OFFSET \
+ ? (c) >= (charset)->min_char && (c) <= (charset)->max_char \
+ : ((charset)->method == CHARSET_METHOD_MAP \
+ && (charset)->compact_codes_p) \
+ ? ! NILP (CHAR_TABLE_REF (CHARSET_ENCODER (charset), (c))) \
+ : encode_char ((charset), (c)) != (charset)->invalid_code))))
-/* Decrease the buffer byte position POS_BYTE of the current buffer to
- the previous character boundary. No range checking of POS_BYTE. */
-#define BUF_DEC_POS(buf, pos_byte) \
- do { \
- unsigned char *p, *p_min; \
- pos_byte--; \
- if (pos_byte < BUF_GPT_BYTE (buf)) \
- { \
- p = BUF_BEG_ADDR (buf) + pos_byte - BEG_BYTE; \
- p_min = BUF_BEG_ADDR (buf); \
- } \
- else \
- { \
- p = BUF_BEG_ADDR (buf) + BUF_GAP_SIZE (buf) + pos_byte - BEG_BYTE;\
- p_min = BUF_GAP_END_ADDR (buf); \
- } \
- if (p > p_min && !CHAR_HEAD_P (*p)) \
- { \
- unsigned char *pend = p--; \
- int len, bytes; \
- if (p_min < p - MAX_MULTIBYTE_LENGTH) \
- p_min = p - MAX_MULTIBYTE_LENGTH; \
- while (p > p_min && !CHAR_HEAD_P (*p)) p--; \
- len = pend + 1 - p; \
- PARSE_MULTIBYTE_SEQ (p, len, bytes); \
- if (bytes == len) \
- pos_byte -= len - 1; \
- } \
- } while (0)
+
+/* Special macros for emacs-mule encoding. */
-#endif /* emacs */
-
-/* This is the maximum byte length of multi-byte sequence. */
-#define MAX_MULTIBYTE_LENGTH 4
-
-extern void invalid_character P_ ((int)) NO_RETURN;
-
-extern int translate_char P_ ((Lisp_Object, int, int, int, int));
-extern int split_string P_ ((const unsigned char *, int, int *,
- unsigned char *, unsigned char *));
-extern int char_to_string P_ ((int, unsigned char *));
-extern int char_to_string_1 P_ ((int, unsigned char *));
-extern int string_to_char P_ ((const unsigned char *, int, int *));
-extern int char_printable_p P_ ((int c));
-extern int multibyte_form_length P_ ((const unsigned char *, int));
-extern void parse_str_as_multibyte P_ ((const unsigned char *, int, int *,
- int *));
-extern int str_as_multibyte P_ ((unsigned char *, int, int, int *));
-extern int parse_str_to_multibyte P_ ((unsigned char *, int));
-extern int str_to_multibyte P_ ((unsigned char *, int, int));
-extern int str_as_unibyte P_ ((unsigned char *, int));
-extern int get_charset_id P_ ((Lisp_Object));
-extern int find_charset_in_text P_ ((const unsigned char *, int, int, int *,
- Lisp_Object));
-extern int strwidth P_ ((unsigned char *, int));
-extern int c_string_width P_ ((const unsigned char *, int, int, int *, int *));
-extern int lisp_string_width P_ ((Lisp_Object, int, int *, int *));
-extern int char_bytes P_ ((int));
-extern int char_valid_p P_ ((int, int));
-
-EXFUN (Funibyte_char_to_multibyte, 1);
-
-extern Lisp_Object Vtranslation_table_vector;
-
-/* Return a translation table of id number ID. */
-#define GET_TRANSLATION_TABLE(id) \
- (XCDR(XVECTOR(Vtranslation_table_vector)->contents[(id)]))
-
-/* A char-table for characters which may invoke auto-filling. */
-extern Lisp_Object Vauto_fill_chars;
-
-/* Copy LEN bytes from FROM to TO. This macro should be used only
- when a caller knows that LEN is short and the obvious copy loop is
- faster than calling bcopy which has some overhead. Copying a
- multibyte sequence of a multibyte character is the typical case. */
-
-#define BCOPY_SHORT(from, to, len) \
- do { \
- int i = len; \
- const unsigned char *from_p = from; \
- unsigned char *to_p = to; \
- while (i--) *to_p++ = *from_p++; \
- } while (0)
+/* Leading-code followed by extended leading-code. DIMENSION/COLUMN */
+#define EMACS_MULE_LEADING_CODE_PRIVATE_11 0x9A /* 1/1 */
+#define EMACS_MULE_LEADING_CODE_PRIVATE_12 0x9B /* 1/2 */
+#define EMACS_MULE_LEADING_CODE_PRIVATE_21 0x9C /* 2/2 */
+#define EMACS_MULE_LEADING_CODE_PRIVATE_22 0x9D /* 2/2 */
+
+extern struct charset *emacs_mule_charset[256];
+
+
+
+extern Lisp_Object Qcharsetp;
+
+extern Lisp_Object Qascii, Qunicode;
+extern int charset_ascii, charset_eight_bit;
+extern int charset_iso_8859_1;
+extern int charset_unicode;
+extern int charset_jisx0201_roman;
+extern int charset_jisx0208_1978;
+extern int charset_jisx0208;
+
+extern int charset_unibyte;
+
+extern struct charset *char_charset P_ ((int, Lisp_Object, unsigned *));
+extern Lisp_Object charset_attributes P_ ((int));
+
+extern int decode_char P_ ((struct charset *, unsigned));
+extern unsigned encode_char P_ ((struct charset *, int));
+extern int string_xstring_p P_ ((Lisp_Object));
+
+extern void map_charset_chars P_ ((void (*) (Lisp_Object, Lisp_Object),
+ Lisp_Object, Lisp_Object,
+ struct charset *, unsigned, unsigned));
+
+EXFUN (Funify_charset, 3);
#endif /* EMACS_CHARSET_H */
diff --git a/src/chartab.c b/src/chartab.c
new file mode 100644
index 0000000000..021b163618
--- /dev/null
+++ b/src/chartab.c
@@ -0,0 +1,1045 @@
+/* chartab.c -- char-table support
+ Copyright (C) 2003
+ National Institute of Advanced Industrial Science and Technology (AIST)
+ Registration Number H13PRO009
+
+This file is part of GNU Emacs.
+
+GNU Emacs is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Emacs is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Emacs; see the file COPYING. If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+#include <config.h>
+#include "lisp.h"
+#include "character.h"
+#include "charset.h"
+#include "ccl.h"
+
+/* 64/16/32/128 */
+
+/* Number of elements in Nth level char-table. */
+const int chartab_size[4] =
+ { (1 << CHARTAB_SIZE_BITS_0),
+ (1 << CHARTAB_SIZE_BITS_1),
+ (1 << CHARTAB_SIZE_BITS_2),
+ (1 << CHARTAB_SIZE_BITS_3) };
+
+/* Number of characters each element of Nth level char-table
+ covers. */
+const int chartab_chars[4] =
+ { (1 << (CHARTAB_SIZE_BITS_1 + CHARTAB_SIZE_BITS_2 + CHARTAB_SIZE_BITS_3)),
+ (1 << (CHARTAB_SIZE_BITS_2 + CHARTAB_SIZE_BITS_3)),
+ (1 << CHARTAB_SIZE_BITS_3),
+ 1 };
+
+/* Number of characters (in bits) each element of Nth level char-table
+ covers. */
+const int chartab_bits[4] =
+ { (CHARTAB_SIZE_BITS_1 + CHARTAB_SIZE_BITS_2 + CHARTAB_SIZE_BITS_3),
+ (CHARTAB_SIZE_BITS_2 + CHARTAB_SIZE_BITS_3),
+ CHARTAB_SIZE_BITS_3,
+ 0 };
+
+#define CHARTAB_IDX(c, depth, min_char) \
+ (((c) - (min_char)) >> chartab_bits[(depth)])
+
+
+DEFUN ("make-char-table", Fmake_char_table, Smake_char_table, 1, 2, 0,
+ doc: /* Return a newly created char-table, with purpose PURPOSE.
+Each element is initialized to INIT, which defaults to nil.
+
+PURPOSE should be a symbol. If it has a `char-table-extra-slots'
+property, the property's value should be an integer between 0 and 10
+that specifies how many extra slots the char-table has. Otherwise,
+the char-table has no extra slot. */)
+ (purpose, init)
+ register Lisp_Object purpose, init;
+{
+ Lisp_Object vector;
+ Lisp_Object n;
+ int n_extras;
+ int size;
+
+ CHECK_SYMBOL (purpose);
+ n = Fget (purpose, Qchar_table_extra_slots);
+ if (NILP (n))
+ n_extras = 0;
+ else
+ {
+ CHECK_NATNUM (n);
+ n_extras = XINT (n);
+ if (n_extras > 10)
+ args_out_of_range (n, Qnil);
+ }
+
+ size = VECSIZE (struct Lisp_Char_Table) - 1 + n_extras;
+ vector = Fmake_vector (make_number (size), init);
+ XCHAR_TABLE (vector)->parent = Qnil;
+ XCHAR_TABLE (vector)->purpose = purpose;
+ XSETCHAR_TABLE (vector, XCHAR_TABLE (vector));
+ return vector;
+}
+
+static Lisp_Object
+make_sub_char_table (depth, min_char, defalt)
+ int depth, min_char;
+ Lisp_Object defalt;
+{
+ Lisp_Object table;
+ int size = VECSIZE (struct Lisp_Sub_Char_Table) - 1 + chartab_size[depth];
+
+ table = Fmake_vector (make_number (size), defalt);
+ XSUB_CHAR_TABLE (table)->depth = make_number (depth);
+ XSUB_CHAR_TABLE (table)->min_char = make_number (min_char);
+ XSETSUB_CHAR_TABLE (table, XSUB_CHAR_TABLE (table));
+
+ return table;
+}
+
+static Lisp_Object
+char_table_ascii (table)
+ Lisp_Object table;
+{
+ Lisp_Object sub;
+
+ sub = XCHAR_TABLE (table)->contents[0];
+ if (! SUB_CHAR_TABLE_P (sub))
+ return sub;
+ sub = XSUB_CHAR_TABLE (sub)->contents[0];
+ if (! SUB_CHAR_TABLE_P (sub))
+ return sub;
+ return XSUB_CHAR_TABLE (sub)->contents[0];
+}
+
+Lisp_Object
+copy_sub_char_table (table)
+ Lisp_Object table;
+{
+ Lisp_Object copy;
+ int depth = XINT (XSUB_CHAR_TABLE (table)->depth);
+ int min_char = XINT (XSUB_CHAR_TABLE (table)->min_char);
+ Lisp_Object val;
+ int i;
+
+ copy = make_sub_char_table (depth, min_char, Qnil);
+ /* Recursively copy any sub char-tables. */
+ for (i = 0; i < chartab_size[depth]; i++)
+ {
+ val = XSUB_CHAR_TABLE (table)->contents[i];
+ if (SUB_CHAR_TABLE_P (val))
+ XSUB_CHAR_TABLE (copy)->contents[i] = copy_sub_char_table (val);
+ else
+ XSUB_CHAR_TABLE (copy)->contents[i] = val;
+ }
+
+ return copy;
+}
+
+
+Lisp_Object
+copy_char_table (table)
+ Lisp_Object table;
+{
+ Lisp_Object copy;
+ int size = XCHAR_TABLE (table)->size & PSEUDOVECTOR_SIZE_MASK;
+ int i;
+
+ copy = Fmake_vector (make_number (size), Qnil);
+ XCHAR_TABLE (copy)->defalt = XCHAR_TABLE (table)->defalt;
+ XCHAR_TABLE (copy)->parent = XCHAR_TABLE (table)->parent;
+ XCHAR_TABLE (copy)->purpose = XCHAR_TABLE (table)->purpose;
+ XCHAR_TABLE (copy)->ascii = XCHAR_TABLE (table)->ascii;
+ for (i = 0; i < chartab_size[0]; i++)
+ XCHAR_TABLE (copy)->contents[i]
+ = (SUB_CHAR_TABLE_P (XCHAR_TABLE (table)->contents[i])
+ ? copy_sub_char_table (XCHAR_TABLE (table)->contents[i])
+ : XCHAR_TABLE (table)->contents[i]);
+ if (SUB_CHAR_TABLE_P (XCHAR_TABLE (copy)->ascii))
+ XCHAR_TABLE (copy)->ascii = char_table_ascii (copy);
+ size -= VECSIZE (struct Lisp_Char_Table) - 1;
+ for (i = 0; i < size; i++)
+ XCHAR_TABLE (copy)->extras[i] = XCHAR_TABLE (table)->extras[i];
+
+ XSETCHAR_TABLE (copy, XCHAR_TABLE (copy));
+ return copy;
+}
+
+Lisp_Object
+sub_char_table_ref (table, c)
+ Lisp_Object table;
+ int c;
+{
+ struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table);
+ int depth = XINT (tbl->depth);
+ int min_char = XINT (tbl->min_char);
+ Lisp_Object val;
+
+ val = tbl->contents[CHARTAB_IDX (c, depth, min_char)];
+ if (SUB_CHAR_TABLE_P (val))
+ val = sub_char_table_ref (val, c);
+ return val;
+}
+
+Lisp_Object
+char_table_ref (table, c)
+ Lisp_Object table;
+ int c;
+{
+ struct Lisp_Char_Table *tbl = XCHAR_TABLE (table);
+ Lisp_Object val;
+
+ if (ASCII_CHAR_P (c))
+ {
+ val = tbl->ascii;
+ if (SUB_CHAR_TABLE_P (val))
+ val = XSUB_CHAR_TABLE (val)->contents[c];
+ }
+ else
+ {
+ val = tbl->contents[CHARTAB_IDX (c, 0, 0)];
+ if (SUB_CHAR_TABLE_P (val))
+ val = sub_char_table_ref (val, c);
+ }
+ if (NILP (val))
+ {
+ val = tbl->defalt;
+ if (NILP (val) && CHAR_TABLE_P (tbl->parent))
+ val = char_table_ref (tbl->parent, c);
+ }
+ return val;
+}
+
+static Lisp_Object
+sub_char_table_ref_and_range (table, c, from, to, defalt)
+ Lisp_Object table;
+ int c;
+ int *from, *to;
+ Lisp_Object defalt;
+{
+ struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table);
+ int depth = XINT (tbl->depth);
+ int min_char = XINT (tbl->min_char);
+ int max_char = min_char + chartab_chars[depth - 1] - 1;
+ int index = CHARTAB_IDX (c, depth, min_char);
+ Lisp_Object val;
+
+ val = tbl->contents[index];
+ *from = min_char + index * chartab_chars[depth];
+ *to = *from + chartab_chars[depth] - 1;
+ if (SUB_CHAR_TABLE_P (val))
+ val = sub_char_table_ref_and_range (val, c, from, to, defalt);
+ else if (NILP (val))
+ val = defalt;
+
+ while (*from > min_char
+ && *from == min_char + index * chartab_chars[depth])
+ {
+ Lisp_Object this_val;
+ int this_from = *from - chartab_chars[depth];
+ int this_to = *from - 1;
+
+ index--;
+ this_val = tbl->contents[index];
+ if (SUB_CHAR_TABLE_P (this_val))
+ this_val = sub_char_table_ref_and_range (this_val, this_to,
+ &this_from, &this_to,
+ defalt);
+ else if (NILP (this_val))
+ this_val = defalt;
+
+ if (! EQ (this_val, val))
+ break;
+ *from = this_from;
+ }
+ index = CHARTAB_IDX (c, depth, min_char);
+ while (*to < max_char
+ && *to == min_char + (index + 1) * chartab_chars[depth] - 1)
+ {
+ Lisp_Object this_val;
+ int this_from = *to + 1;
+ int this_to = this_from + chartab_chars[depth] - 1;
+
+ index++;
+ this_val = tbl->contents[index];
+ if (SUB_CHAR_TABLE_P (this_val))
+ this_val = sub_char_table_ref_and_range (this_val, this_from,
+ &this_from, &this_to,
+ defalt);
+ else if (NILP (this_val))
+ this_val = defalt;
+ if (! EQ (this_val, val))
+ break;
+ *to = this_to;
+ }
+
+ return val;
+}
+
+
+/* Return the value for C in char-table TABLE. Set *FROM and *TO to
+ the range of characters (containing C) that have the same value as
+ C. It is not assured that the value of (*FROM - 1) and (*TO + 1)
+ is different from that of C. */
+
+Lisp_Object
+char_table_ref_and_range (table, c, from, to)
+ Lisp_Object table;
+ int c;
+ int *from, *to;
+{
+ struct Lisp_Char_Table *tbl = XCHAR_TABLE (table);
+ int index = CHARTAB_IDX (c, 0, 0);
+ Lisp_Object val;
+
+ val = tbl->contents[index];
+ *from = index * chartab_chars[0];
+ *to = *from + chartab_chars[0] - 1;
+ if (SUB_CHAR_TABLE_P (val))
+ val = sub_char_table_ref_and_range (val, c, from, to, tbl->defalt);
+ else if (NILP (val))
+ val = tbl->defalt;
+
+ while (*from > 0 && *from == index * chartab_chars[0])
+ {
+ Lisp_Object this_val;
+ int this_from = *from - chartab_chars[0];
+ int this_to = *from - 1;
+
+ index--;
+ this_val = tbl->contents[index];
+ if (SUB_CHAR_TABLE_P (this_val))
+ this_val = sub_char_table_ref_and_range (this_val, this_to,
+ &this_from, &this_to,
+ tbl->defalt);
+ else if (NILP (this_val))
+ this_val = tbl->defalt;
+
+ if (! EQ (this_val, val))
+ break;
+ *from = this_from;
+ }
+ while (*to < MAX_CHAR && *to == (index + 1) * chartab_chars[0] - 1)
+ {
+ Lisp_Object this_val;
+ int this_from = *to + 1;
+ int this_to = this_from + chartab_chars[0] - 1;
+
+ index++;
+ this_val = tbl->contents[index];
+ if (SUB_CHAR_TABLE_P (this_val))
+ this_val = sub_char_table_ref_and_range (this_val, this_from,
+ &this_from, &this_to,
+ tbl->defalt);
+ else if (NILP (this_val))
+ this_val = tbl->defalt;
+ if (! EQ (this_val, val))
+ break;
+ *to = this_to;
+ }
+
+ return val;
+}
+
+
+#define ASET_RANGE(ARRAY, FROM, TO, LIMIT, VAL) \
+ do { \
+ int limit = (TO) < (LIMIT) ? (TO) : (LIMIT); \
+ for (; (FROM) < limit; (FROM)++) (ARRAY)->contents[(FROM)] = (VAL); \
+ } while (0)
+
+#define GET_SUB_CHAR_TABLE(TABLE, SUBTABLE, IDX, DEPTH, MIN_CHAR) \
+ do { \
+ (SUBTABLE) = (TABLE)->contents[(IDX)]; \
+ if (!SUB_CHAR_TABLE_P (SUBTABLE)) \
+ (SUBTABLE) = make_sub_char_table ((DEPTH), (MIN_CHAR), (SUBTABLE)); \
+ } while (0)
+
+
+static void
+sub_char_table_set (table, c, val)
+ Lisp_Object table;
+ int c;
+ Lisp_Object val;
+{
+ struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table);
+ int depth = XINT ((tbl)->depth);
+ int min_char = XINT ((tbl)->min_char);
+ int i = CHARTAB_IDX (c, depth, min_char);
+ Lisp_Object sub;
+
+ if (depth == 3)
+ tbl->contents[i] = val;
+ else
+ {
+ sub = tbl->contents[i];
+ if (! SUB_CHAR_TABLE_P (sub))
+ {
+ sub = make_sub_char_table (depth + 1,
+ min_char + i * chartab_chars[depth], sub);
+ tbl->contents[i] = sub;
+ }
+ sub_char_table_set (sub, c, val);
+ }
+}
+
+Lisp_Object
+char_table_set (table, c, val)
+ Lisp_Object table;
+ int c;
+ Lisp_Object val;
+{
+ struct Lisp_Char_Table *tbl = XCHAR_TABLE (table);
+
+ if (ASCII_CHAR_P (c)
+ && SUB_CHAR_TABLE_P (tbl->ascii))
+ {
+ XSUB_CHAR_TABLE (tbl->ascii)->contents[c] = val;
+ }
+ else
+ {
+ int i = CHARTAB_IDX (c, 0, 0);
+ Lisp_Object sub;
+
+ sub = tbl->contents[i];
+ if (! SUB_CHAR_TABLE_P (sub))
+ {
+ sub = make_sub_char_table (1, i * chartab_chars[0], sub);
+ tbl->contents[i] = sub;
+ }
+ sub_char_table_set (sub, c, val);
+ if (ASCII_CHAR_P (c))
+ tbl->ascii = char_table_ascii (table);
+ }
+ return val;
+}
+
+static void
+sub_char_table_set_range (table, depth, min_char, from, to, val)
+ Lisp_Object *table;
+ int depth;
+ int min_char;
+ int from, to;
+ Lisp_Object val;
+{
+ int max_char = min_char + chartab_chars[depth] - 1;
+
+ if (depth == 3 || (from <= min_char && to >= max_char))
+ *table = val;
+ else
+ {
+ int i, j;
+
+ depth++;
+ if (! SUB_CHAR_TABLE_P (*table))
+ *table = make_sub_char_table (depth, min_char, *table);
+ if (from < min_char)
+ from = min_char;
+ if (to > max_char)
+ to = max_char;
+ i = CHARTAB_IDX (from, depth, min_char);
+ j = CHARTAB_IDX (to, depth, min_char);
+ min_char += chartab_chars[depth] * i;
+ for (; i <= j; i++, min_char += chartab_chars[depth])
+ sub_char_table_set_range (XSUB_CHAR_TABLE (*table)->contents + i,
+ depth, min_char, from, to, val);
+ }
+}
+
+
+Lisp_Object
+char_table_set_range (table, from, to, val)
+ Lisp_Object table;
+ int from, to;
+ Lisp_Object val;
+{
+ struct Lisp_Char_Table *tbl = XCHAR_TABLE (table);
+ Lisp_Object *contents = tbl->contents;
+ int i, min_char;
+
+ if (from == to)
+ char_table_set (table, from, val);
+ else
+ {
+ for (i = CHARTAB_IDX (from, 0, 0), min_char = i * chartab_chars[0];
+ min_char <= to;
+ i++, min_char += chartab_chars[0])
+ sub_char_table_set_range (contents + i, 0, min_char, from, to, val);
+ if (ASCII_CHAR_P (from))
+ tbl->ascii = char_table_ascii (table);
+ }
+ return val;
+}
+
+
+DEFUN ("char-table-subtype", Fchar_table_subtype, Schar_table_subtype,
+ 1, 1, 0,
+ doc: /*
+Return the subtype of char-table CHAR-TABLE. The value is a symbol. */)
+ (char_table)
+ Lisp_Object char_table;
+{
+ CHECK_CHAR_TABLE (char_table);
+
+ return XCHAR_TABLE (char_table)->purpose;
+}
+
+DEFUN ("char-table-parent", Fchar_table_parent, Schar_table_parent,
+ 1, 1, 0,
+ doc: /* Return the parent char-table of CHAR-TABLE.
+The value is either nil or another char-table.
+If CHAR-TABLE holds nil for a given character,
+then the actual applicable value is inherited from the parent char-table
+\(or from its parents, if necessary). */)
+ (char_table)
+ Lisp_Object char_table;
+{
+ CHECK_CHAR_TABLE (char_table);
+
+ return XCHAR_TABLE (char_table)->parent;
+}
+
+DEFUN ("set-char-table-parent", Fset_char_table_parent, Sset_char_table_parent,
+ 2, 2, 0,
+ doc: /* Set the parent char-table of CHAR-TABLE to PARENT.
+Return PARENT. PARENT must be either nil or another char-table. */)
+ (char_table, parent)
+ Lisp_Object char_table, parent;
+{
+ Lisp_Object temp;
+
+ CHECK_CHAR_TABLE (char_table);
+
+ if (!NILP (parent))
+ {
+ CHECK_CHAR_TABLE (parent);
+
+ for (temp = parent; !NILP (temp); temp = XCHAR_TABLE (temp)->parent)
+ if (EQ (temp, char_table))
+ error ("Attempt to make a chartable be its own parent");
+ }
+
+ XCHAR_TABLE (char_table)->parent = parent;
+
+ return parent;
+}
+
+DEFUN ("char-table-extra-slot", Fchar_table_extra_slot, Schar_table_extra_slot,
+ 2, 2, 0,
+ doc: /* Return the value of CHAR-TABLE's extra-slot number N. */)
+ (char_table, n)
+ Lisp_Object char_table, n;
+{
+ CHECK_CHAR_TABLE (char_table);
+ CHECK_NUMBER (n);
+ if (XINT (n) < 0
+ || XINT (n) >= CHAR_TABLE_EXTRA_SLOTS (XCHAR_TABLE (char_table)))
+ args_out_of_range (char_table, n);
+
+ return XCHAR_TABLE (char_table)->extras[XINT (n)];
+}
+
+DEFUN ("set-char-table-extra-slot", Fset_char_table_extra_slot,
+ Sset_char_table_extra_slot,
+ 3, 3, 0,
+ doc: /* Set CHAR-TABLE's extra-slot number N to VALUE. */)
+ (char_table, n, value)
+ Lisp_Object char_table, n, value;
+{
+ CHECK_CHAR_TABLE (char_table);
+ CHECK_NUMBER (n);
+ if (XINT (n) < 0
+ || XINT (n) >= CHAR_TABLE_EXTRA_SLOTS (XCHAR_TABLE (char_table)))
+ args_out_of_range (char_table, n);
+
+ return XCHAR_TABLE (char_table)->extras[XINT (n)] = value;
+}
+
+DEFUN ("char-table-range", Fchar_table_range, Schar_table_range,
+ 2, 2, 0,
+ doc: /* Return the value in CHAR-TABLE for a range of characters RANGE.
+RANGE should be nil (for the default value),
+a cons of character codes (for characters in the range), or a character code. */)
+ (char_table, range)
+ Lisp_Object char_table, range;
+{
+ Lisp_Object val;
+ CHECK_CHAR_TABLE (char_table);
+
+ if (EQ (range, Qnil))
+ val = XCHAR_TABLE (char_table)->defalt;
+ else if (INTEGERP (range))
+ val = CHAR_TABLE_REF (char_table, XINT (range));
+ else if (CONSP (range))
+ {
+ int from, to;
+
+ CHECK_CHARACTER_CAR (range);
+ CHECK_CHARACTER_CDR (range);
+ val = char_table_ref_and_range (char_table, XINT (XCAR (range)),
+ &from, &to);
+ /* Not yet implemented. */
+ }
+ else
+ error ("Invalid RANGE argument to `char-table-range'");
+ return val;
+}
+
+DEFUN ("set-char-table-range", Fset_char_table_range, Sset_char_table_range,
+ 3, 3, 0,
+ doc: /* Set the value in CHAR-TABLE for a range of characters RANGE to VALUE.
+RANGE should be t (for all characters), nil (for the default value),
+a cons of character codes (for characters in the range),
+or a character code. Return VALUE. */)
+ (char_table, range, value)
+ Lisp_Object char_table, range, value;
+{
+ CHECK_CHAR_TABLE (char_table);
+ if (EQ (range, Qt))
+ {
+ int i;
+
+ XCHAR_TABLE (char_table)->ascii = Qnil;
+ for (i = 0; i < chartab_size[0]; i++)
+ XCHAR_TABLE (char_table)->contents[i] = Qnil;
+ XCHAR_TABLE (char_table)->defalt = value;
+ }
+ else if (EQ (range, Qnil))
+ XCHAR_TABLE (char_table)->defalt = value;
+ else if (INTEGERP (range))
+ char_table_set (char_table, XINT (range), value);
+ else if (CONSP (range))
+ {
+ CHECK_CHARACTER_CAR (range);
+ CHECK_CHARACTER_CDR (range);
+ char_table_set_range (char_table,
+ XINT (XCAR (range)), XINT (XCDR (range)), value);
+ }
+ else
+ error ("Invalid RANGE argument to `set-char-table-range'");
+
+ return value;
+}
+
+DEFUN ("set-char-table-default", Fset_char_table_default,
+ Sset_char_table_default, 3, 3, 0,
+ doc: /*
+This function is obsolete and has no effect. */)
+ (char_table, ch, value)
+ Lisp_Object char_table, ch, value;
+{
+ return Qnil;
+}
+
+/* Look up the element in TABLE at index CH, and return it as an
+ integer. If the element is not a character, return CH itself. */
+
+int
+char_table_translate (table, ch)
+ Lisp_Object table;
+ int ch;
+{
+ Lisp_Object value;
+ value = Faref (table, make_number (ch));
+ if (! CHARACTERP (value))
+ return ch;
+ return XINT (value);
+}
+
+static Lisp_Object
+optimize_sub_char_table (table)
+ Lisp_Object table;
+{
+ struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table);
+ int depth = XINT (tbl->depth);
+ Lisp_Object elt, this;
+ int i;
+
+ elt = XSUB_CHAR_TABLE (table)->contents[0];
+ if (SUB_CHAR_TABLE_P (elt))
+ elt = XSUB_CHAR_TABLE (table)->contents[0] = optimize_sub_char_table (elt);
+ if (SUB_CHAR_TABLE_P (elt))
+ return table;
+ for (i = 1; i < chartab_size[depth]; i++)
+ {
+ this = XSUB_CHAR_TABLE (table)->contents[i];
+ if (SUB_CHAR_TABLE_P (this))
+ this = XSUB_CHAR_TABLE (table)->contents[i]
+ = optimize_sub_char_table (this);
+ if (SUB_CHAR_TABLE_P (this)
+ || NILP (Fequal (this, elt)))
+ break;
+ }
+
+ return (i < chartab_size[depth] ? table : elt);
+}
+
+DEFUN ("optimize-char-table", Foptimize_char_table, Soptimize_char_table,
+ 1, 1, 0,
+ doc: /* Optimize CHAR-TABLE. */)
+ (char_table)
+ Lisp_Object char_table;
+{
+ Lisp_Object elt;
+ int i;
+
+ CHECK_CHAR_TABLE (char_table);
+
+ for (i = 0; i < chartab_size[0]; i++)
+ {
+ elt = XCHAR_TABLE (char_table)->contents[i];
+ if (SUB_CHAR_TABLE_P (elt))
+ XCHAR_TABLE (char_table)->contents[i] = optimize_sub_char_table (elt);
+ }
+ return Qnil;
+}
+
+
+/* Map C_FUNCTION or FUNCTION over TABLE (top or sub char-table),
+ calling it for each character or group of characters that share a
+ value. RANGE is a cons (FROM . TO) specifying the range of target
+ characters, VAL is a value of FROM in TABLE, DEFAULT_VAL is the
+ default value of the char-table, PARENT is the parent of the
+ char-table.
+
+ ARG is passed to C_FUNCTION when that is called.
+
+ It returns the value of last character covered by TABLE (not the
+ value inheritted from the parent), and by side-effect, the car part
+ of RANGE is updated to the minimum character C where C and all the
+ following characters in TABLE have the same value. */
+
+static Lisp_Object
+map_sub_char_table (c_function, function, table, arg, val, range,
+ default_val, parent)
+ void (*c_function) P_ ((Lisp_Object, Lisp_Object, Lisp_Object));
+ Lisp_Object function, table, arg, val, range, default_val, parent;
+{
+ /* Pointer to the elements of TABLE. */
+ Lisp_Object *contents;
+ /* Depth of TABLE. */
+ int depth;
+ /* Minimum and maxinum characters covered by TABLE. */
+ int min_char, max_char;
+ /* Number of characters covered by one element of TABLE. */
+ int chars_in_block;
+ int from = XINT (XCAR (range)), to = XINT (XCDR (range));
+ int i, c;
+
+ if (SUB_CHAR_TABLE_P (table))
+ {
+ struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table);
+
+ depth = XINT (tbl->depth);
+ contents = tbl->contents;
+ min_char = XINT (tbl->min_char);
+ max_char = min_char + chartab_chars[depth - 1] - 1;
+ }
+ else
+ {
+ depth = 0;
+ contents = XCHAR_TABLE (table)->contents;
+ min_char = 0;
+ max_char = MAX_CHAR;
+ }
+ chars_in_block = chartab_chars[depth];
+
+ if (to < max_char)
+ max_char = to;
+ /* Set I to the index of the first element to check. */
+ if (from <= min_char)
+ i = 0;
+ else
+ i = (from - min_char) / chars_in_block;
+ for (c = min_char + chars_in_block * i; c <= max_char;
+ i++, c += chars_in_block)
+ {
+ Lisp_Object this = contents[i];
+ int nextc = c + chars_in_block;
+
+ if (SUB_CHAR_TABLE_P (this))
+ {
+ if (to >= nextc)
+ XSETCDR (range, make_number (nextc - 1));
+ val = map_sub_char_table (c_function, function, this, arg,
+ val, range, default_val, parent);
+ }
+ else
+ {
+ if (NILP (this))
+ this = default_val;
+ if (NILP (Fequal (val, this)))
+ {
+ int different_value = 1;
+
+ if (NILP (val))
+ {
+ if (! NILP (parent))
+ {
+ Lisp_Object temp = XCHAR_TABLE (parent)->parent;
+
+ /* This is to get a value of FROM in PARENT
+ without checking the parent of PARENT. */
+ XCHAR_TABLE (parent)->parent = Qnil;
+ val = CHAR_TABLE_REF (parent, from);
+ XCHAR_TABLE (parent)->parent = temp;
+ XSETCDR (range, make_number (c - 1));
+ val = map_sub_char_table (c_function, function,
+ parent, arg, val, range,
+ XCHAR_TABLE (parent)->defalt,
+ XCHAR_TABLE (parent)->parent);
+ if (! NILP (Fequal (val, this)))
+ different_value = 0;
+ }
+ }
+ if (! NILP (val) && different_value)
+ {
+ XSETCDR (range, make_number (c - 1));
+ if (EQ (XCAR (range), XCDR (range)))
+ {
+ if (c_function)
+ (*c_function) (arg, XCAR (range), val);
+ else
+ call2 (function, XCAR (range), val);
+ }
+ else
+ {
+ if (c_function)
+ (*c_function) (arg, range, val);
+ else
+ call2 (function, range, val);
+ }
+ }
+ val = this;
+ from = c;
+ XSETCAR (range, make_number (c));
+ }
+ }
+ XSETCDR (range, make_number (to));
+ }
+ return val;
+}
+
+
+/* Map C_FUNCTION or FUNCTION over TABLE, calling it for each
+ character or group of characters that share a value.
+
+ ARG is passed to C_FUNCTION when that is called. */
+
+void
+map_char_table (c_function, function, table, arg)
+ void (*c_function) P_ ((Lisp_Object, Lisp_Object, Lisp_Object));
+ Lisp_Object function, table, arg;
+{
+ Lisp_Object range, val;
+ int c, i;
+ struct gcpro gcpro1, gcpro2, gcpro3;
+
+ range = Fcons (make_number (0), make_number (MAX_CHAR));
+ GCPRO3 (table, arg, range);
+ val = XCHAR_TABLE (table)->ascii;
+ if (SUB_CHAR_TABLE_P (val))
+ val = XSUB_CHAR_TABLE (val)->contents[0];
+ val = map_sub_char_table (c_function, function, table, arg, val, range,
+ XCHAR_TABLE (table)->defalt,
+ XCHAR_TABLE (table)->parent);
+ /* If VAL is nil and TABLE has a parent, we must consult the parent
+ recursively. */
+ while (NILP (val) && ! NILP (XCHAR_TABLE (table)->parent))
+ {
+ Lisp_Object parent = XCHAR_TABLE (table)->parent;
+ Lisp_Object temp = XCHAR_TABLE (parent)->parent;
+ int from = XINT (XCAR (range));
+
+ /* This is to get a value of FROM in PARENT without checking the
+ parent of PARENT. */
+ XCHAR_TABLE (parent)->parent = Qnil;
+ val = CHAR_TABLE_REF (parent, from);
+ XCHAR_TABLE (parent)->parent = temp;
+ val = map_sub_char_table (c_function, function, parent, arg, val, range,
+ XCHAR_TABLE (parent)->defalt,
+ XCHAR_TABLE (parent)->parent);
+ table = parent;
+ }
+
+ if (! NILP (val))
+ {
+ if (EQ (XCAR (range), XCDR (range)))
+ {
+ if (c_function)
+ (*c_function) (arg, XCAR (range), val);
+ else
+ call2 (function, XCAR (range), val);
+ }
+ else
+ {
+ if (c_function)
+ (*c_function) (arg, range, val);
+ else
+ call2 (function, range, val);
+ }
+ }
+
+ UNGCPRO;
+}
+
+DEFUN ("map-char-table", Fmap_char_table, Smap_char_table,
+ 2, 2, 0,
+ doc: /*
+Call FUNCTION for each character in CHAR-TABLE that has non-nil value.
+FUNCTION is called with two arguments--a key and a value.
+The key is a character code or a cons of character codes specifying a
+range of characters that have the same value. */)
+ (function, char_table)
+ Lisp_Object function, char_table;
+{
+ CHECK_CHAR_TABLE (char_table);
+
+ map_char_table (NULL, function, char_table, char_table);
+ return Qnil;
+}
+
+
+static void
+map_sub_char_table_for_charset (c_function, function, table, arg, range,
+ charset, from, to)
+ void (*c_function) P_ ((Lisp_Object, Lisp_Object));
+ Lisp_Object function, table, arg, range;
+ struct charset *charset;
+ unsigned from, to;
+{
+ struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table);
+ int depth = XINT (tbl->depth);
+ int c, i;
+
+ if (depth < 3)
+ for (i = 0, c = XINT (tbl->min_char); i < chartab_size[depth];
+ i++, c += chartab_chars[depth])
+ {
+ Lisp_Object this;
+
+ this = tbl->contents[i];
+ if (SUB_CHAR_TABLE_P (this))
+ map_sub_char_table_for_charset (c_function, function, this, arg,
+ range, charset, from, to);
+ else
+ {
+ if (! NILP (XCAR (range)))
+ {
+ XSETCDR (range, make_number (c - 1));
+ if (c_function)
+ (*c_function) (arg, range);
+ else
+ call2 (function, range, arg);
+ }
+ XSETCAR (range, Qnil);
+ }
+ }
+ else
+ for (i = 0, c = XINT (tbl->min_char); i < chartab_size[depth]; i++, c ++)
+ {
+ Lisp_Object this;
+ unsigned code;
+
+ this = tbl->contents[i];
+ if (NILP (this)
+ || (charset
+ && (code = ENCODE_CHAR (charset, c),
+ (code < from || code > to))))
+ {
+ if (! NILP (XCAR (range)))
+ {
+ XSETCDR (range, make_number (c - 1));
+ if (c_function)
+ (*c_function) (arg, range);
+ else
+ call2 (function, range, arg);
+ XSETCAR (range, Qnil);
+ }
+ }
+ else
+ {
+ if (NILP (XCAR (range)))
+ XSETCAR (range, make_number (c));
+ }
+ }
+}
+
+
+void
+map_char_table_for_charset (c_function, function, table, arg,
+ charset, from, to)
+ void (*c_function) P_ ((Lisp_Object, Lisp_Object));
+ Lisp_Object function, table, arg;
+ struct charset *charset;
+ unsigned from, to;
+{
+ Lisp_Object range;
+ int c, i;
+ struct gcpro gcpro1;
+
+ range = Fcons (Qnil, Qnil);
+ GCPRO1 (range);
+
+ for (i = 0, c = 0; i < chartab_size[0]; i++, c += chartab_chars[0])
+ {
+ Lisp_Object this;
+
+ this = XCHAR_TABLE (table)->contents[i];
+ if (SUB_CHAR_TABLE_P (this))
+ map_sub_char_table_for_charset (c_function, function, this, arg,
+ range, charset, from, to);
+ else
+ {
+ if (! NILP (XCAR (range)))
+ {
+ XSETCDR (range, make_number (c - 1));
+ if (c_function)
+ (*c_function) (arg, range);
+ else
+ call2 (function, range, arg);
+ }
+ XSETCAR (range, Qnil);
+ }
+ }
+ if (! NILP (XCAR (range)))
+ {
+ XSETCDR (range, make_number (c - 1));
+ if (c_function)
+ (*c_function) (arg, range);
+ else
+ call2 (function, range, arg);
+ }
+
+ UNGCPRO;
+}
+
+
+void
+syms_of_chartab ()
+{
+ defsubr (&Smake_char_table);
+ defsubr (&Schar_table_parent);
+ defsubr (&Schar_table_subtype);
+ defsubr (&Sset_char_table_parent);
+ defsubr (&Schar_table_extra_slot);
+ defsubr (&Sset_char_table_extra_slot);
+ defsubr (&Schar_table_range);
+ defsubr (&Sset_char_table_range);
+ defsubr (&Sset_char_table_default);
+ defsubr (&Soptimize_char_table);
+ defsubr (&Smap_char_table);
+}
+
+/* arch-tag: 18b5b560-7ab5-4108-b09e-d5dd65dc6fda
+ (do not change this comment) */
diff --git a/src/cm.c b/src/cm.c
index ad8ec080c9..1833121677 100644
--- a/src/cm.c
+++ b/src/cm.c
@@ -23,13 +23,8 @@ Boston, MA 02110-1301, USA. */
#include <config.h>
#include <stdio.h>
-
-#include "lisp.h"
-#include "frame.h"
#include "cm.h"
#include "termhooks.h"
-#include "termchar.h"
-
/* For now, don't try to include termcap.h. On some systems,
configure finds a non-standard termcap.h that the main build
@@ -58,16 +53,13 @@ evalcost (c)
return c;
}
-/* The terminal to use for low-level output. */
-struct tty_display_info *current_tty;
-
int
cmputc (c)
char c;
{
- if (current_tty->termscript)
- putc (c & 0177, current_tty->termscript);
- putc (c & 0177, current_tty->output);
+ if (termscript)
+ fputc (c & 0177, termscript);
+ putchar (c & 0177);
return c;
}
@@ -80,9 +72,9 @@ cmputc (c)
*/
static
-at (tty, row, col) {
- curY (tty) = row;
- curX (tty) = col;
+at (row, col) {
+ curY = row;
+ curX = col;
}
/*
@@ -90,8 +82,8 @@ at (tty, row, col) {
*/
static
-addcol (tty, n) {
- curX (tty) += n;
+addcol (n) {
+ curX += n;
/*
* If cursor hit edge of screen, what happened?
@@ -101,21 +93,21 @@ addcol (tty, n) {
* of the last line.
*/
- if (curX (tty) == tty->Wcm->cm_cols) {
+ if (curX == Wcm.cm_cols) {
/*
* Well, if magicwrap, still there, past the edge of the
* screen (!). If autowrap, on the col 0 of the next line.
* Otherwise on last column.
*/
- if (tty->Wcm->cm_magicwrap)
+ if (Wcm.cm_magicwrap)
; /* "limbo" */
- else if (tty->Wcm->cm_autowrap) {
- curX (tty) = 0;
- curY (tty) ++; /* Beware end of screen! */
+ else if (Wcm.cm_autowrap) {
+ curX = 0;
+ curY++; /* Beware end of screen! */
}
else
- curX (tty)--;
+ curX--;
}
}
#endif
@@ -131,20 +123,20 @@ addcol (tty, n) {
* after we reach the last column; this takes us to a known state.
*/
void
-cmcheckmagic (struct tty_display_info *tty)
+cmcheckmagic ()
{
- if (curX (tty) == FrameCols (tty))
+ if (curX == FrameCols)
{
- if (!MagicWrap (tty) || curY (tty) >= FrameRows (tty) - 1)
+ if (!MagicWrap || curY >= FrameRows - 1)
abort ();
- if (tty->termscript)
- putc ('\r', tty->termscript);
- putc ('\r', tty->output);
- if (tty->termscript)
- putc ('\n', tty->termscript);
- putc ('\n', tty->output);
- curX (tty) = 0;
- curY (tty)++;
+ if (termscript)
+ putc ('\r', termscript);
+ putchar ('\r');
+ if (termscript)
+ putc ('\n', termscript);
+ putchar ('\n');
+ curX = 0;
+ curY++;
}
}
@@ -156,21 +148,21 @@ cmcheckmagic (struct tty_display_info *tty)
*/
void
-cmcostinit (struct tty_display_info *tty)
+cmcostinit ()
{
char *p;
#define COST(x,e) (x ? (cost = 0, tputs (x, 1, e), cost) : BIG)
#define CMCOST(x,e) ((x == 0) ? BIG : (p = tgoto(x, 0, 0), COST(p ,e)))
- tty->Wcm->cc_up = COST (tty->Wcm->cm_up, evalcost);
- tty->Wcm->cc_down = COST (tty->Wcm->cm_down, evalcost);
- tty->Wcm->cc_left = COST (tty->Wcm->cm_left, evalcost);
- tty->Wcm->cc_right = COST (tty->Wcm->cm_right, evalcost);
- tty->Wcm->cc_home = COST (tty->Wcm->cm_home, evalcost);
- tty->Wcm->cc_cr = COST (tty->Wcm->cm_cr, evalcost);
- tty->Wcm->cc_ll = COST (tty->Wcm->cm_ll, evalcost);
- tty->Wcm->cc_tab = tty->Wcm->cm_tabwidth ? COST (tty->Wcm->cm_tab, evalcost) : BIG;
+ Wcm.cc_up = COST (Wcm.cm_up, evalcost);
+ Wcm.cc_down = COST (Wcm.cm_down, evalcost);
+ Wcm.cc_left = COST (Wcm.cm_left, evalcost);
+ Wcm.cc_right = COST (Wcm.cm_right, evalcost);
+ Wcm.cc_home = COST (Wcm.cm_home, evalcost);
+ Wcm.cc_cr = COST (Wcm.cm_cr, evalcost);
+ Wcm.cc_ll = COST (Wcm.cm_ll, evalcost);
+ Wcm.cc_tab = Wcm.cm_tabwidth ? COST (Wcm.cm_tab, evalcost) : BIG;
/*
* These last three are actually minimum costs. When (if) they are
@@ -181,9 +173,9 @@ cmcostinit (struct tty_display_info *tty)
* cursor motion seem to take straight numeric values. --ACT)
*/
- tty->Wcm->cc_abs = CMCOST (tty->Wcm->cm_abs, evalcost);
- tty->Wcm->cc_habs = CMCOST (tty->Wcm->cm_habs, evalcost);
- tty->Wcm->cc_vabs = CMCOST (tty->Wcm->cm_vabs, evalcost);
+ Wcm.cc_abs = CMCOST (Wcm.cm_abs, evalcost);
+ Wcm.cc_habs = CMCOST (Wcm.cm_habs, evalcost);
+ Wcm.cc_vabs = CMCOST (Wcm.cm_vabs, evalcost);
#undef CMCOST
#undef COST
@@ -196,8 +188,8 @@ cmcostinit (struct tty_display_info *tty)
*/
static int
-calccost (struct tty_display_info *tty,
- int srcy, int srcx, int dsty, int dstx, int doit)
+calccost (srcy, srcx, dsty, dstx, doit)
+ int srcy, srcx, dsty, dstx, doit;
{
register int deltay,
deltax,
@@ -214,16 +206,16 @@ calccost (struct tty_display_info *tty,
don't believe the cursor position: give up here
and force use of absolute positioning. */
- if (curX (tty) == tty->Wcm->cm_cols)
+ if (curX == Wcm.cm_cols)
goto fail;
totalcost = 0;
if ((deltay = dsty - srcy) == 0)
goto x;
if (deltay < 0)
- p = tty->Wcm->cm_up, c = tty->Wcm->cc_up, deltay = -deltay;
+ p = Wcm.cm_up, c = Wcm.cc_up, deltay = -deltay;
else
- p = tty->Wcm->cm_down, c = tty->Wcm->cc_down;
+ p = Wcm.cm_down, c = Wcm.cc_down;
if (c == BIG) { /* caint get thar from here */
if (doit)
printf ("OOPS");
@@ -232,16 +224,16 @@ calccost (struct tty_display_info *tty,
totalcost = c * deltay;
if (doit)
while (--deltay >= 0)
- emacs_tputs (tty, p, 1, cmputc);
+ tputs (p, 1, cmputc);
x:
if ((deltax = dstx - srcx) == 0)
goto done;
if (deltax < 0) {
- p = tty->Wcm->cm_left, c = tty->Wcm->cc_left, deltax = -deltax;
+ p = Wcm.cm_left, c = Wcm.cc_left, deltax = -deltax;
goto dodelta; /* skip all the tab junk */
}
/* Tabs (the toughie) */
- if (tty->Wcm->cc_tab >= BIG || !tty->Wcm->cm_usetabs)
+ if (Wcm.cc_tab >= BIG || !Wcm.cm_usetabs)
goto olddelta; /* forget it! */
/*
@@ -252,12 +244,12 @@ x:
* we will put into tabx (for ntabs) and tab2x (for n2tabs)).
*/
- ntabs = (deltax + srcx % tty->Wcm->cm_tabwidth) / tty->Wcm->cm_tabwidth;
+ ntabs = (deltax + srcx % Wcm.cm_tabwidth) / Wcm.cm_tabwidth;
n2tabs = ntabs + 1;
- tabx = (srcx / tty->Wcm->cm_tabwidth + ntabs) * tty->Wcm->cm_tabwidth;
- tab2x = tabx + tty->Wcm->cm_tabwidth;
+ tabx = (srcx / Wcm.cm_tabwidth + ntabs) * Wcm.cm_tabwidth;
+ tab2x = tabx + Wcm.cm_tabwidth;
- if (tab2x >= tty->Wcm->cm_cols) /* too far (past edge) */
+ if (tab2x >= Wcm.cm_cols) /* too far (past edge) */
n2tabs = 0;
/*
@@ -265,12 +257,12 @@ x:
* for using n2tabs, then pick the minimum.
*/
- /* cost for ntabs + cost for right motion */
- tabcost = ntabs ? ntabs * tty->Wcm->cc_tab + (dstx - tabx) * tty->Wcm->cc_right
+ /* cost for ntabs + cost for right motion */
+ tabcost = ntabs ? ntabs * Wcm.cc_tab + (dstx - tabx) * Wcm.cc_right
: BIG;
- /* cost for n2tabs + cost for left motion */
- c = n2tabs ? n2tabs * tty->Wcm->cc_tab + (tab2x - dstx) * tty->Wcm->cc_left
+ /* cost for n2tabs + cost for left motion */
+ c = n2tabs ? n2tabs * Wcm.cc_tab + (tab2x - dstx) * Wcm.cc_left
: BIG;
if (c < tabcost) /* then cheaper to overshoot & back up */
@@ -283,11 +275,11 @@ x:
* See if tabcost is less than just moving right
*/
- if (tabcost < (deltax * tty->Wcm->cc_right)) {
+ if (tabcost < (deltax * Wcm.cc_right)) {
totalcost += tabcost; /* use the tabs */
if (doit)
while (--ntabs >= 0)
- emacs_tputs (tty, tty->Wcm->cm_tab, 1, cmputc);
+ tputs (Wcm.cm_tab, 1, cmputc);
srcx = tabx;
}
@@ -300,9 +292,9 @@ newdelta:
goto done;
olddelta:
if (deltax > 0)
- p = tty->Wcm->cm_right, c = tty->Wcm->cc_right;
+ p = Wcm.cm_right, c = Wcm.cc_right;
else
- p = tty->Wcm->cm_left, c = tty->Wcm->cc_left, deltax = -deltax;
+ p = Wcm.cm_left, c = Wcm.cc_left, deltax = -deltax;
dodelta:
if (c == BIG) { /* caint get thar from here */
@@ -314,7 +306,7 @@ fail:
totalcost += c * deltax;
if (doit)
while (--deltax >= 0)
- emacs_tputs (tty, p, 1, cmputc);
+ tputs (p, 1, cmputc);
done:
return totalcost;
}
@@ -332,8 +324,7 @@ losecursor ()
#define USECR 3
void
-cmgoto (tty, row, col)
- struct tty_display_info *tty;
+cmgoto (row, col)
int row, col;
{
int homecost,
@@ -346,47 +337,47 @@ cmgoto (tty, row, col)
*dcm;
/* First the degenerate case */
- if (row == curY (tty) && col == curX (tty)) /* already there */
+ if (row == curY && col == curX) /* already there */
return;
- if (curY (tty) >= 0 && curX (tty) >= 0)
+ if (curY >= 0 && curX >= 0)
{
/* We may have quick ways to go to the upper-left, bottom-left,
* start-of-line, or start-of-next-line. Or it might be best to
* start where we are. Examine the options, and pick the cheapest.
*/
- relcost = calccost (tty, curY (tty), curX (tty), row, col, 0);
+ relcost = calccost (curY, curX, row, col, 0);
use = USEREL;
- if ((homecost = tty->Wcm->cc_home) < BIG)
- homecost += calccost (tty, 0, 0, row, col, 0);
+ if ((homecost = Wcm.cc_home) < BIG)
+ homecost += calccost (0, 0, row, col, 0);
if (homecost < relcost)
- relcost = homecost, use = USEHOME;
- if ((llcost = tty->Wcm->cc_ll) < BIG)
- llcost += calccost (tty, tty->Wcm->cm_rows - 1, 0, row, col, 0);
+ relcost = homecost, use = USEHOME;
+ if ((llcost = Wcm.cc_ll) < BIG)
+ llcost += calccost (Wcm.cm_rows - 1, 0, row, col, 0);
if (llcost < relcost)
- relcost = llcost, use = USELL;
- if ((crcost = tty->Wcm->cc_cr) < BIG) {
- if (tty->Wcm->cm_autolf)
- if (curY (tty) + 1 >= tty->Wcm->cm_rows)
- crcost = BIG;
+ relcost = llcost, use = USELL;
+ if ((crcost = Wcm.cc_cr) < BIG) {
+ if (Wcm.cm_autolf)
+ if (curY + 1 >= Wcm.cm_rows)
+ crcost = BIG;
else
- crcost += calccost (tty, curY (tty) + 1, 0, row, col, 0);
+ crcost += calccost (curY + 1, 0, row, col, 0);
else
- crcost += calccost (tty, curY (tty), 0, row, col, 0);
+ crcost += calccost (curY, 0, row, col, 0);
}
if (crcost < relcost)
relcost = crcost, use = USECR;
- directcost = tty->Wcm->cc_abs, dcm = tty->Wcm->cm_abs;
- if (row == curY (tty) && tty->Wcm->cc_habs < BIG)
- directcost = tty->Wcm->cc_habs, dcm = tty->Wcm->cm_habs;
- else if (col == curX (tty) && tty->Wcm->cc_vabs < BIG)
- directcost = tty->Wcm->cc_vabs, dcm = tty->Wcm->cm_vabs;
+ directcost = Wcm.cc_abs, dcm = Wcm.cm_abs;
+ if (row == curY && Wcm.cc_habs < BIG)
+ directcost = Wcm.cc_habs, dcm = Wcm.cm_habs;
+ else if (col == curX && Wcm.cc_vabs < BIG)
+ directcost = Wcm.cc_vabs, dcm = Wcm.cm_vabs;
}
else
{
directcost = 0, relcost = 100000;
- dcm = tty->Wcm->cm_abs;
+ dcm = Wcm.cm_abs;
}
/*
@@ -397,14 +388,13 @@ cmgoto (tty, row, col)
{
/* compute REAL direct cost */
cost = 0;
- p = (dcm == tty->Wcm->cm_habs
- ? tgoto (dcm, row, col)
- : tgoto (dcm, col, row));
- emacs_tputs (tty, p, 1, evalcost);
+ p = dcm == Wcm.cm_habs ? tgoto (dcm, row, col) :
+ tgoto (dcm, col, row);
+ tputs (p, 1, evalcost);
if (cost <= relcost)
{ /* really is cheaper */
- emacs_tputs (tty, p, 1, cmputc);
- curY (tty) = row, curX (tty) = col;
+ tputs (p, 1, cmputc);
+ curY = row, curX = col;
return;
}
}
@@ -412,25 +402,25 @@ cmgoto (tty, row, col)
switch (use)
{
case USEHOME:
- emacs_tputs (tty, tty->Wcm->cm_home, 1, cmputc);
- curY (tty) = 0, curX (tty) = 0;
+ tputs (Wcm.cm_home, 1, cmputc);
+ curY = 0, curX = 0;
break;
case USELL:
- emacs_tputs (tty, tty->Wcm->cm_ll, 1, cmputc);
- curY (tty) = tty->Wcm->cm_rows - 1, curX (tty) = 0;
+ tputs (Wcm.cm_ll, 1, cmputc);
+ curY = Wcm.cm_rows - 1, curX = 0;
break;
case USECR:
- emacs_tputs (tty, tty->Wcm->cm_cr, 1, cmputc);
- if (tty->Wcm->cm_autolf)
- curY (tty)++;
- curX (tty) = 0;
+ tputs (Wcm.cm_cr, 1, cmputc);
+ if (Wcm.cm_autolf)
+ curY++;
+ curX = 0;
break;
}
- (void) calccost (tty, curY (tty), curX (tty), row, col, 1);
- curY (tty) = row, curX (tty) = col;
+ (void) calccost (curY, curX, row, col, 1);
+ curY = row, curX = col;
}
/* Clear out all terminal info.
@@ -438,9 +428,9 @@ cmgoto (tty, row, col)
*/
void
-Wcm_clear (struct tty_display_info *tty)
+Wcm_clear ()
{
- bzero (tty->Wcm, sizeof (struct cm));
+ bzero (&Wcm, sizeof Wcm);
UP = 0;
BC = 0;
}
@@ -453,21 +443,21 @@ Wcm_clear (struct tty_display_info *tty)
*/
int
-Wcm_init (struct tty_display_info *tty)
+Wcm_init ()
{
#if 0
- if (tty->Wcm->cm_abs && !tty->Wcm->cm_ds)
+ if (Wcm.cm_abs && !Wcm.cm_ds)
return 0;
#endif
- if (tty->Wcm->cm_abs)
+ if (Wcm.cm_abs)
return 0;
/* Require up and left, and, if no absolute, down and right */
- if (!tty->Wcm->cm_up || !tty->Wcm->cm_left)
+ if (!Wcm.cm_up || !Wcm.cm_left)
return - 1;
- if (!tty->Wcm->cm_abs && (!tty->Wcm->cm_down || !tty->Wcm->cm_right))
+ if (!Wcm.cm_abs && (!Wcm.cm_down || !Wcm.cm_right))
return - 1;
/* Check that we know the size of the screen.... */
- if (tty->Wcm->cm_rows <= 0 || tty->Wcm->cm_cols <= 0)
+ if (Wcm.cm_rows <= 0 || Wcm.cm_cols <= 0)
return - 2;
return 0;
}
diff --git a/src/cm.h b/src/cm.h
index 36413703a9..7c26a9ce66 100644
--- a/src/cm.h
+++ b/src/cm.h
@@ -99,78 +99,76 @@ struct cm
int cc_vabs;
};
+extern struct cm Wcm; /* Terminal capabilities */
extern char PC; /* Pad character */
/* Shorthand */
#ifndef NoCMShortHand
-#define curY(tty) (tty)->Wcm->cm_curY
-#define curX(tty) (tty)->Wcm->cm_curX
-#define Up(tty) (tty)->Wcm->cm_up
-#define Down(tty) (tty)->Wcm->cm_down
-#define Left(tty) (tty)->Wcm->cm_left
-#define Right(tty) (tty)->Wcm->cm_right
-#define Tab(tty) (tty)->Wcm->cm_tab
-#define BackTab(tty) (tty)->Wcm->cm_backtab
-#define TabWidth(tty) (tty)->Wcm->cm_tabwidth
-#define CR(tty) (tty)->Wcm->cm_cr
-#define Home(tty) (tty)->Wcm->cm_home
-#define LastLine(tty) (tty)->Wcm->cm_ll
-#define AbsPosition(tty) (tty)->Wcm->cm_abs
-#define ColPosition(tty) (tty)->Wcm->cm_habs
-#define RowPosition(tty) (tty)->Wcm->cm_vabs
-#define MultiUp(tty) (tty)->Wcm->cm_multiup
-#define MultiDown(tty) (tty)->Wcm->cm_multidown
-#define MultiLeft(tty) (tty)->Wcm->cm_multileft
-#define MultiRight(tty) (tty)->Wcm->cm_multiright
-#define AutoWrap(tty) (tty)->Wcm->cm_autowrap
-#define MagicWrap(tty) (tty)->Wcm->cm_magicwrap
-#define UseTabs(tty) (tty)->Wcm->cm_usetabs
-#define FrameRows(tty) (tty)->Wcm->cm_rows
-#define FrameCols(tty) (tty)->Wcm->cm_cols
-
-#define UpCost(tty) (tty)->Wcm->cc_up
-#define DownCost(tty) (tty)->Wcm->cc_down
-#define LeftCost(tty) (tty)->Wcm->cc_left
-#define RightCost(tty) (tty)->Wcm->cc_right
-#define HomeCost(tty) (tty)->Wcm->cc_home
-#define CRCost(tty) (tty)->Wcm->cc_cr
-#define LastLineCost(tty) (tty)->Wcm->cc_ll
-#define TabCost(tty) (tty)->Wcm->cc_tab
-#define BackTabCost(tty) (tty)->Wcm->cc_backtab
-#define AbsPositionCost(tty) (tty)->Wcm->cc_abs
-#define ColPositionCost(tty) (tty)->Wcm->cc_habs
-#define RowPositionCost(tty) (tty)->Wcm->cc_vabs
-#define MultiUpCost(tty) (tty)->Wcm->cc_multiup
-#define MultiDownCost(tty) (tty)->Wcm->cc_multidown
-#define MultiLeftCost(tty) (tty)->Wcm->cc_multileft
-#define MultiRightCost(tty) (tty)->Wcm->cc_multiright
+#define curY Wcm.cm_curY
+#define curX Wcm.cm_curX
+#define Up Wcm.cm_up
+#define Down Wcm.cm_down
+#define Left Wcm.cm_left
+#define Right Wcm.cm_right
+#define Tab Wcm.cm_tab
+#define BackTab Wcm.cm_backtab
+#define TabWidth Wcm.cm_tabwidth
+#define CR Wcm.cm_cr
+#define Home Wcm.cm_home
+#define LastLine Wcm.cm_ll
+#define AbsPosition Wcm.cm_abs
+#define ColPosition Wcm.cm_habs
+#define RowPosition Wcm.cm_vabs
+#define MultiUp Wcm.cm_multiup
+#define MultiDown Wcm.cm_multidown
+#define MultiLeft Wcm.cm_multileft
+#define MultiRight Wcm.cm_multiright
+#define AutoWrap Wcm.cm_autowrap
+#define MagicWrap Wcm.cm_magicwrap
+#define UseTabs Wcm.cm_usetabs
+#define FrameRows Wcm.cm_rows
+#define FrameCols Wcm.cm_cols
+
+#define UpCost Wcm.cc_up
+#define DownCost Wcm.cc_down
+#define LeftCost Wcm.cc_left
+#define RightCost Wcm.cc_right
+#define HomeCost Wcm.cc_home
+#define CRCost Wcm.cc_cr
+#define LastLineCost Wcm.cc_ll
+#define TabCost Wcm.cc_tab
+#define BackTabCost Wcm.cc_backtab
+#define AbsPositionCost Wcm.cc_abs
+#define ColPositionCost Wcm.cc_habs
+#define RowPositionCost Wcm.cc_vabs
+#define MultiUpCost Wcm.cc_multiup
+#define MultiDownCost Wcm.cc_multidown
+#define MultiLeftCost Wcm.cc_multileft
+#define MultiRightCost Wcm.cc_multiright
#endif
-#define cmat(tty,row,col) (curY(tty) = (row), curX(tty) = (col))
-#define cmplus(tty,n) \
- { \
- if ((curX (tty) += (n)) >= FrameCols (tty) && !MagicWrap (tty)) \
- { \
- if ((tty)->Wcm->cm_losewrap) losecursor (tty); \
- else if (AutoWrap (tty)) curX (tty) = 0, curY (tty)++; \
- else curX (tty)--; \
- } \
+#define cmat(row,col) (curY = (row), curX = (col))
+#define cmplus(n) \
+ { \
+ if ((curX += (n)) >= FrameCols && !MagicWrap) \
+ { \
+ if (Wcm.cm_losewrap) losecursor (); \
+ else if (AutoWrap) curX = 0, curY++; \
+ else curX--; \
+ } \
}
-#define losecursor(tty) (curX(tty) = -1, curY(tty) = -1)
+#define losecursor() (curX = -1, curY = -1)
extern int cost;
extern int evalcost ();
-#define emacs_tputs(tty, str, affcnt, putc) (current_tty = (tty), tputs (str, affcnt, putc))
-
-extern struct tty_display_info *current_tty;
-extern void cmcheckmagic P_ ((struct tty_display_info *));
-extern int cmputc P_ ((int));
-extern void cmcostinit P_ ((struct tty_display_info *));
-extern void cmgoto P_ ((struct tty_display_info *, int, int));
-extern void Wcm_clear P_ ((struct tty_display_info *));
-extern int Wcm_init P_ ((struct tty_display_info *));
+extern void cmcheckmagic ();
+extern int cmputc ();
+extern void cmcostinit ();
+extern void cmgoto ();
+extern void Wcm_clear ();
+extern int Wcm_init ();
/* arch-tag: acc1535a-7136-49d6-b22d-9bc85702251b
(do not change this comment) */
diff --git a/src/cmds.c b/src/cmds.c
index b89074fbc5..45b3f87fff 100644
--- a/src/cmds.c
+++ b/src/cmds.c
@@ -24,7 +24,7 @@ Boston, MA 02110-1301, USA. */
#include "lisp.h"
#include "commands.h"
#include "buffer.h"
-#include "charset.h"
+#include "character.h"
#include "syntax.h"
#include "window.h"
#include "keyboard.h"
@@ -327,11 +327,11 @@ Whichever character you type to run this command is inserted. */)
CHECK_NUMBER (n);
/* Barf if the key that invoked this was not a character. */
- if (!INTEGERP (last_command_char))
+ if (!CHARACTERP (last_command_char))
bitch_at_user ();
{
int character = translate_char (Vtranslation_table_for_input,
- XINT (last_command_char), 0, 0, 0);
+ XINT (last_command_char));
if (XINT (n) >= 2 && NILP (current_buffer->overwrite_mode))
{
int modified_char = character;
@@ -395,7 +395,6 @@ internal_self_insert (c, noautofill)
/* At first, get multi-byte form of C in STR. */
if (!NILP (current_buffer->enable_multibyte_characters))
{
- c = unibyte_char_to_multibyte (c);
len = CHAR_STRING (c, str);
if (len == 1)
/* If C has modifier bits, this makes C an appropriate
@@ -472,10 +471,19 @@ internal_self_insert (c, noautofill)
}
hairy = 2;
}
+
+ if (NILP (current_buffer->enable_multibyte_characters))
+ MAKE_CHAR_MULTIBYTE (c);
+ synt = SYNTAX (c);
+
if (!NILP (current_buffer->abbrev_mode)
- && SYNTAX (c) != Sword
+ && synt != Sword
&& NILP (current_buffer->read_only)
- && PT > BEGV && SYNTAX (XFASTINT (Fprevious_char ())) == Sword)
+ && PT > BEGV
+ && (!NILP (current_buffer->enable_multibyte_characters)
+ ? SYNTAX (XFASTINT (Fprevious_char ())) == Sword
+ : (SYNTAX (unibyte_char_to_multibyte (XFASTINT (Fprevious_char ())))
+ == Sword)))
{
int modiff = MODIFF;
Lisp_Object sym;
@@ -544,7 +552,6 @@ internal_self_insert (c, noautofill)
Vself_insert_face = Qnil;
}
- synt = SYNTAX (c);
if ((synt == Sclose || synt == Smath)
&& !NILP (Vblink_paren_function) && INTERACTIVE
&& !noautofill)
diff --git a/src/coding.c b/src/coding.c
index b6299097d5..20c6c000c7 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -1,10 +1,13 @@
-/* Coding system handler (conversion, detection, and etc).
+/* Coding system handler (conversion, detection, etc).
Copyright (C) 2001, 2002, 2003, 2004, 2005,
2006, 2007 Free Software Foundation, Inc.
Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
2005, 2006, 2007
National Institute of Advanced Industrial Science and Technology (AIST)
Registration Number H14PRO021
+ Copyright (C) 2003
+ National Institute of Advanced Industrial Science and Technology (AIST)
+ Registration Number H13PRO009
This file is part of GNU Emacs.
@@ -27,385 +30,325 @@ Boston, MA 02110-1301, USA. */
0. General comments
1. Preamble
- 2. Emacs' internal format (emacs-mule) handlers
- 3. ISO2022 handlers
- 4. Shift-JIS and BIG5 handlers
- 5. CCL handlers
- 6. End-of-line handlers
- 7. C library functions
- 8. Emacs Lisp library functions
- 9. Post-amble
+ 2. Emacs' internal format (emacs-utf-8) handlers
+ 3. UTF-8 handlers
+ 4. UTF-16 handlers
+ 5. Charset-base coding systems handlers
+ 6. emacs-mule (old Emacs' internal format) handlers
+ 7. ISO2022 handlers
+ 8. Shift-JIS and BIG5 handlers
+ 9. CCL handlers
+ 10. C library functions
+ 11. Emacs Lisp library functions
+ 12. Postamble
*/
-/*** 0. General comments ***/
+/*** 0. General comments ***
-/*** GENERAL NOTE on CODING SYSTEMS ***
+CODING SYSTEM
- A coding system is an encoding mechanism for one or more character
- sets. Here's a list of coding systems which Emacs can handle. When
- we say "decode", it means converting some other coding system to
- Emacs' internal format (emacs-mule), and when we say "encode",
- it means converting the coding system emacs-mule to some other
+ A coding system is an object for an encoding mechanism that contains
+ information about how to convert byte sequences to character
+ sequences and vice versa. When we say "decode", it means converting
+ a byte sequence of a specific coding system into a character
+ sequence that is represented by Emacs' internal coding system
+ `emacs-utf-8', and when we say "encode", it means converting a
+ character sequence of emacs-utf-8 to a byte sequence of a specific
coding system.
- 0. Emacs' internal format (emacs-mule)
+ In Emacs Lisp, a coding system is represented by a Lisp symbol. In
+ C level, a coding system is represented by a vector of attributes
+ stored in the hash table Vcharset_hash_table. The conversion from
+ coding system symbol to attributes vector is done by looking up
+ Vcharset_hash_table by the symbol.
+
+ Coding systems are classified into the following types depending on
+ the encoding mechanism. Here's a brief description of the types.
+
+ o UTF-8
+
+ o UTF-16
+
+ o Charset-base coding system
+
+ A coding system defined by one or more (coded) character sets.
+ Decoding and encoding are done by a code converter defined for each
+ character set.
+
+ o Old Emacs internal format (emacs-mule)
- Emacs itself holds a multi-lingual character in buffers and strings
- in a special format. Details are described in section 2.
+ The coding system adopted by old versions of Emacs (20 and 21).
- 1. ISO2022
+ o ISO2022-base coding system
The most famous coding system for multiple character sets. X's
- Compound Text, various EUCs (Extended Unix Code), and coding
- systems used in Internet communication such as ISO-2022-JP are
- all variants of ISO2022. Details are described in section 3.
+ Compound Text, various EUCs (Extended Unix Code), and coding systems
+ used in the Internet communication such as ISO-2022-JP are all
+ variants of ISO2022.
- 2. SJIS (or Shift-JIS or MS-Kanji-Code)
+ o SJIS (or Shift-JIS or MS-Kanji-Code)
A coding system to encode character sets: ASCII, JISX0201, and
JISX0208. Widely used for PC's in Japan. Details are described in
- section 4.
+ section 8.
- 3. BIG5
+ o BIG5
- A coding system to encode the character sets ASCII and Big5. Widely
+ A coding system to encode character sets: ASCII and Big5. Widely
used for Chinese (mainly in Taiwan and Hong Kong). Details are
- described in section 4. In this file, when we write "BIG5"
- (all uppercase), we mean the coding system, and when we write
- "Big5" (capitalized), we mean the character set.
+ described in section 8. In this file, when we write "big5" (all
+ lowercase), we mean the coding system, and when we write "Big5"
+ (capitalized), we mean the character set.
- 4. Raw text
+ o CCL
- A coding system for text containing random 8-bit code. Emacs does
- no code conversion on such text except for end-of-line format.
+ If a user wants to decode/encode text encoded in a coding system
+ not listed above, he can supply a decoder and an encoder for it in
+ CCL (Code Conversion Language) programs. Emacs executes the CCL
+ program while decoding/encoding.
- 5. Other
+ o Raw-text
- If a user wants to read/write text encoded in a coding system not
- listed above, he can supply a decoder and an encoder for it as CCL
- (Code Conversion Language) programs. Emacs executes the CCL program
- while reading/writing.
+ A coding system for text containing raw eight-bit data. Emacs
+ treats each byte of source text as a character (except for
+ end-of-line conversion).
- Emacs represents a coding system by a Lisp symbol that has a property
- `coding-system'. But, before actually using the coding system, the
- information about it is set in a structure of type `struct
- coding_system' for rapid processing. See section 6 for more details.
+ o No-conversion
+
+ Like raw text, but don't do end-of-line conversion.
-*/
-/*** GENERAL NOTES on END-OF-LINE FORMAT ***
+END-OF-LINE FORMAT
- How end-of-line of text is encoded depends on the operating system.
- For instance, Unix's format is just one byte of `line-feed' code,
+ How text end-of-line is encoded depends on operating system. For
+ instance, Unix's format is just one byte of LF (line-feed) code,
whereas DOS's format is two-byte sequence of `carriage-return' and
`line-feed' codes. MacOS's format is usually one byte of
`carriage-return'.
Since text character encoding and end-of-line encoding are
- independent, any coding system described above can have any
- end-of-line format. So Emacs has information about end-of-line
- format in each coding-system. See section 6 for more details.
+ independent, any coding system described above can take any format
+ of end-of-line (except for no-conversion).
+
+STRUCT CODING_SYSTEM
+
+ Before using a coding system for code conversion (i.e. decoding and
+ encoding), we setup a structure of type `struct coding_system'.
+ This structure keeps various information about a specific code
+ conversion (e.g. the location of source and destination data).
*/
+/* COMMON MACROS */
+
+
/*** GENERAL NOTES on `detect_coding_XXX ()' functions ***
- These functions check if a text between SRC and SRC_END is encoded
- in the coding system category XXX. Each returns an integer value in
- which appropriate flag bits for the category XXX are set. The flag
- bits are defined in macros CODING_CATEGORY_MASK_XXX. Below is the
- template for these functions. If MULTIBYTEP is nonzero, 8-bit codes
- of the range 0x80..0x9F are in multibyte form. */
+ These functions check if a byte sequence specified as a source in
+ CODING conforms to the format of XXX, and update the members of
+ DETECT_INFO.
+
+ Return 1 if the byte sequence conforms to XXX, otherwise return 0.
+
+ Below is the template of these functions. */
+
#if 0
-int
-detect_coding_emacs_mule (src, src_end, multibytep)
- unsigned char *src, *src_end;
- int multibytep;
+static int
+detect_coding_XXX (coding, detect_info)
+ struct coding_system *coding;
+ struct coding_detection_info *detect_info;
{
- ...
+ const unsigned char *src = coding->source;
+ const unsigned char *src_end = coding->source + coding->src_bytes;
+ int multibytep = coding->src_multibyte;
+ int consumed_chars = 0;
+ int found = 0;
+ ...;
+
+ while (1)
+ {
+ /* Get one byte from the source. If the souce is exausted, jump
+ to no_more_source:. */
+ ONE_MORE_BYTE (c);
+
+ if (! __C_conforms_to_XXX___ (c))
+ break;
+ if (! __C_strongly_suggests_XXX__ (c))
+ found = CATEGORY_MASK_XXX;
+ }
+ /* The byte sequence is invalid for XXX. */
+ detect_info->rejected |= CATEGORY_MASK_XXX;
+ return 0;
+
+ no_more_source:
+ /* The source exausted successfully. */
+ detect_info->found |= found;
+ return 1;
}
#endif
/*** GENERAL NOTES on `decode_coding_XXX ()' functions ***
- These functions decode SRC_BYTES length of unibyte text at SOURCE
- encoded in CODING to Emacs' internal format. The resulting
- multibyte text goes to a place pointed to by DESTINATION, the length
- of which should not exceed DST_BYTES.
+ These functions decode a byte sequence specified as a source by
+ CODING. The resulting multibyte text goes to a place pointed to by
+ CODING->charbuf, the length of which should not exceed
+ CODING->charbuf_size;
- These functions set the information about original and decoded texts
- in the members `produced', `produced_char', `consumed', and
- `consumed_char' of the structure *CODING. They also set the member
- `result' to one of CODING_FINISH_XXX indicating how the decoding
- finished.
+ These functions set the information of original and decoded texts in
+ CODING->consumed, CODING->consumed_char, and CODING->charbuf_used.
+ They also set CODING->result to one of CODING_RESULT_XXX indicating
+ how the decoding is finished.
- DST_BYTES zero means that the source area and destination area are
- overlapped, which means that we can produce a decoded text until it
- reaches the head of the not-yet-decoded source text.
+ Below is the template of these functions. */
- Below is a template for these functions. */
#if 0
static void
-decode_coding_XXX (coding, source, destination, src_bytes, dst_bytes)
+decode_coding_XXXX (coding)
struct coding_system *coding;
- const unsigned char *source;
- unsigned char *destination;
- int src_bytes, dst_bytes;
{
- ...
+ const unsigned char *src = coding->source + coding->consumed;
+ const unsigned char *src_end = coding->source + coding->src_bytes;
+ /* SRC_BASE remembers the start position in source in each loop.
+ The loop will be exited when there's not enough source code, or
+ when there's no room in CHARBUF for a decoded character. */
+ const unsigned char *src_base;
+ /* A buffer to produce decoded characters. */
+ int *charbuf = coding->charbuf + coding->charbuf_used;
+ int *charbuf_end = coding->charbuf + coding->charbuf_size;
+ int multibytep = coding->src_multibyte;
+
+ while (1)
+ {
+ src_base = src;
+ if (charbuf < charbuf_end)
+ /* No more room to produce a decoded character. */
+ break;
+ ONE_MORE_BYTE (c);
+ /* Decode it. */
+ }
+
+ no_more_source:
+ if (src_base < src_end
+ && coding->mode & CODING_MODE_LAST_BLOCK)
+ /* If the source ends by partial bytes to construct a character,
+ treat them as eight-bit raw data. */
+ while (src_base < src_end && charbuf < charbuf_end)
+ *charbuf++ = *src_base++;
+ /* Remember how many bytes and characters we consumed. If the
+ source is multibyte, the bytes and chars are not identical. */
+ coding->consumed = coding->consumed_char = src_base - coding->source;
+ /* Remember how many characters we produced. */
+ coding->charbuf_used = charbuf - coding->charbuf;
}
#endif
/*** GENERAL NOTES on `encode_coding_XXX ()' functions ***
- These functions encode SRC_BYTES length text at SOURCE from Emacs'
- internal multibyte format to CODING. The resulting unibyte text
+ These functions encode SRC_BYTES length text at SOURCE of Emacs'
+ internal multibyte format by CODING. The resulting byte sequence
goes to a place pointed to by DESTINATION, the length of which
should not exceed DST_BYTES.
- These functions set the information about original and encoded texts
- in the members `produced', `produced_char', `consumed', and
- `consumed_char' of the structure *CODING. They also set the member
- `result' to one of CODING_FINISH_XXX indicating how the encoding
- finished.
+ These functions set the information of original and encoded texts in
+ the members produced, produced_char, consumed, and consumed_char of
+ the structure *CODING. They also set the member result to one of
+ CODING_RESULT_XXX indicating how the encoding finished.
- DST_BYTES zero means that the source area and destination area are
- overlapped, which means that we can produce encoded text until it
- reaches at the head of the not-yet-encoded source text.
+ DST_BYTES zero means that source area and destination area are
+ overlapped, which means that we can produce a encoded text until it
+ reaches at the head of not-yet-encoded source text.
- Below is a template for these functions. */
+ Below is a template of these functions. */
#if 0
static void
-encode_coding_XXX (coding, source, destination, src_bytes, dst_bytes)
+encode_coding_XXX (coding)
struct coding_system *coding;
- unsigned char *source, *destination;
- int src_bytes, dst_bytes;
{
- ...
+ int multibytep = coding->dst_multibyte;
+ int *charbuf = coding->charbuf;
+ int *charbuf_end = charbuf->charbuf + coding->charbuf_used;
+ unsigned char *dst = coding->destination + coding->produced;
+ unsigned char *dst_end = coding->destination + coding->dst_bytes;
+ unsigned char *adjusted_dst_end = dst_end - _MAX_BYTES_PRODUCED_IN_LOOP_;
+ int produced_chars = 0;
+
+ for (; charbuf < charbuf_end && dst < adjusted_dst_end; charbuf++)
+ {
+ int c = *charbuf;
+ /* Encode C into DST, and increment DST. */
+ }
+ label_no_more_destination:
+ /* How many chars and bytes we produced. */
+ coding->produced_char += produced_chars;
+ coding->produced = dst - coding->destination;
}
#endif
-/*** COMMONLY USED MACROS ***/
-
-/* The following two macros ONE_MORE_BYTE and TWO_MORE_BYTES safely
- get one, two, and three bytes from the source text respectively.
- If there are not enough bytes in the source, they jump to
- `label_end_of_loop'. The caller should set variables `coding',
- `src' and `src_end' to appropriate pointer in advance. These
- macros are called from decoding routines `decode_coding_XXX', thus
- it is assumed that the source text is unibyte. */
-
-#define ONE_MORE_BYTE(c1) \
- do { \
- if (src >= src_end) \
- { \
- coding->result = CODING_FINISH_INSUFFICIENT_SRC; \
- goto label_end_of_loop; \
- } \
- c1 = *src++; \
- } while (0)
-
-#define TWO_MORE_BYTES(c1, c2) \
- do { \
- if (src + 1 >= src_end) \
- { \
- coding->result = CODING_FINISH_INSUFFICIENT_SRC; \
- goto label_end_of_loop; \
- } \
- c1 = *src++; \
- c2 = *src++; \
- } while (0)
-
-
-/* Like ONE_MORE_BYTE, but 8-bit bytes of data at SRC are in multibyte
- form if MULTIBYTEP is nonzero. In addition, if SRC is not less
- than SRC_END, return with RET. */
-
-#define ONE_MORE_BYTE_CHECK_MULTIBYTE(c1, multibytep, ret) \
- do { \
- if (src >= src_end) \
- { \
- coding->result = CODING_FINISH_INSUFFICIENT_SRC; \
- return ret; \
- } \
- c1 = *src++; \
- if (multibytep && c1 == LEADING_CODE_8_BIT_CONTROL) \
- c1 = *src++ - 0x20; \
- } while (0)
-
-/* Set C to the next character at the source text pointed by `src'.
- If there are not enough characters in the source, jump to
- `label_end_of_loop'. The caller should set variables `coding'
- `src', `src_end', and `translation_table' to appropriate pointers
- in advance. This macro is used in encoding routines
- `encode_coding_XXX', thus it assumes that the source text is in
- multibyte form except for 8-bit characters. 8-bit characters are
- in multibyte form if coding->src_multibyte is nonzero, else they
- are represented by a single byte. */
-
-#define ONE_MORE_CHAR(c) \
- do { \
- int len = src_end - src; \
- int bytes; \
- if (len <= 0) \
- { \
- coding->result = CODING_FINISH_INSUFFICIENT_SRC; \
- goto label_end_of_loop; \
- } \
- if (coding->src_multibyte \
- || UNIBYTE_STR_AS_MULTIBYTE_P (src, len, bytes)) \
- c = STRING_CHAR_AND_LENGTH (src, len, bytes); \
- else \
- c = *src, bytes = 1; \
- if (!NILP (translation_table)) \
- c = translate_char (translation_table, c, -1, 0, 0); \
- src += bytes; \
- } while (0)
-
-
-/* Produce a multibyte form of character C to `dst'. Jump to
- `label_end_of_loop' if there's not enough space at `dst'.
-
- If we are now in the middle of a composition sequence, the decoded
- character may be ALTCHAR (for the current composition). In that
- case, the character goes to coding->cmp_data->data instead of
- `dst'.
-
- This macro is used in decoding routines. */
-
-#define EMIT_CHAR(c) \
- do { \
- if (! COMPOSING_P (coding) \
- || coding->composing == COMPOSITION_RELATIVE \
- || coding->composing == COMPOSITION_WITH_RULE) \
- { \
- int bytes = CHAR_BYTES (c); \
- if ((dst + bytes) > (dst_bytes ? dst_end : src)) \
- { \
- coding->result = CODING_FINISH_INSUFFICIENT_DST; \
- goto label_end_of_loop; \
- } \
- dst += CHAR_STRING (c, dst); \
- coding->produced_char++; \
- } \
- \
- if (COMPOSING_P (coding) \
- && coding->composing != COMPOSITION_RELATIVE) \
- { \
- CODING_ADD_COMPOSITION_COMPONENT (coding, c); \
- coding->composition_rule_follows \
- = coding->composing != COMPOSITION_WITH_ALTCHARS; \
- } \
- } while (0)
-
-
-#define EMIT_ONE_BYTE(c) \
- do { \
- if (dst >= (dst_bytes ? dst_end : src)) \
- { \
- coding->result = CODING_FINISH_INSUFFICIENT_DST; \
- goto label_end_of_loop; \
- } \
- *dst++ = c; \
- } while (0)
-
-#define EMIT_TWO_BYTES(c1, c2) \
- do { \
- if (dst + 2 > (dst_bytes ? dst_end : src)) \
- { \
- coding->result = CODING_FINISH_INSUFFICIENT_DST; \
- goto label_end_of_loop; \
- } \
- *dst++ = c1, *dst++ = c2; \
- } while (0)
-
-#define EMIT_BYTES(from, to) \
- do { \
- if (dst + (to - from) > (dst_bytes ? dst_end : src)) \
- { \
- coding->result = CODING_FINISH_INSUFFICIENT_DST; \
- goto label_end_of_loop; \
- } \
- while (from < to) \
- *dst++ = *from++; \
- } while (0)
-
/*** 1. Preamble ***/
-#ifdef emacs
#include <config.h>
-#endif
-
#include <stdio.h>
-#ifdef emacs
-
#include "lisp.h"
#include "buffer.h"
+#include "character.h"
#include "charset.h"
-#include "composite.h"
#include "ccl.h"
+#include "composite.h"
#include "coding.h"
#include "window.h"
-#include "intervals.h"
-#include "frame.h"
-#include "termhooks.h"
-#else /* not emacs */
+Lisp_Object Vcoding_system_hash_table;
-#include "mulelib.h"
-
-#endif /* not emacs */
-
-Lisp_Object Qcoding_system, Qeol_type;
+Lisp_Object Qcoding_system, Qcoding_aliases, Qeol_type;
+Lisp_Object Qunix, Qdos;
+extern Lisp_Object Qmac; /* frame.c */
Lisp_Object Qbuffer_file_coding_system;
Lisp_Object Qpost_read_conversion, Qpre_write_conversion;
+Lisp_Object Qdefault_char;
Lisp_Object Qno_conversion, Qundecided;
+Lisp_Object Qcharset, Qiso_2022, Qutf_8, Qutf_16, Qshift_jis, Qbig5;
+Lisp_Object Qbig, Qlittle;
Lisp_Object Qcoding_system_history;
-Lisp_Object Qsafe_chars;
Lisp_Object Qvalid_codes;
-Lisp_Object Qascii_incompatible;
+Lisp_Object QCcategory, QCmnemonic, QCdefalut_char;
+Lisp_Object QCdecode_translation_table, QCencode_translation_table;
+Lisp_Object QCpost_read_conversion, QCpre_write_conversion;
+Lisp_Object QCascii_compatible_p;
extern Lisp_Object Qinsert_file_contents, Qwrite_region;
Lisp_Object Qcall_process, Qcall_process_region;
Lisp_Object Qstart_process, Qopen_network_stream;
Lisp_Object Qtarget_idx;
+Lisp_Object Qinsufficient_source, Qinconsistent_eol, Qinvalid_source;
+Lisp_Object Qinterrupted, Qinsufficient_memory;
+
/* If a symbol has this property, evaluate the value to define the
symbol as a coding system. */
-Lisp_Object Qcoding_system_define_form;
-
-Lisp_Object Vselect_safe_coding_system_function;
+static Lisp_Object Qcoding_system_define_form;
int coding_system_require_warning;
+Lisp_Object Vselect_safe_coding_system_function;
+
/* Mnemonic string for each format of end-of-line. */
Lisp_Object eol_mnemonic_unix, eol_mnemonic_dos, eol_mnemonic_mac;
/* Mnemonic string to indicate format of end-of-line is not yet
decided. */
Lisp_Object eol_mnemonic_undecided;
-/* Format of end-of-line decided by system. This is CODING_EOL_LF on
- Unix, CODING_EOL_CRLF on DOS/Windows, and CODING_EOL_CR on Mac.
+/* Format of end-of-line decided by system. This is Qunix on
+ Unix and Mac, Qdos on DOS/Windows.
This has an effect only for external encoding (i.e. for output to
file and process), not for in-buffer or Lisp string encoding. */
-int system_eol_type;
+static Lisp_Object system_eol_type;
#ifdef emacs
-/* Information about which coding system is safe for which chars.
- The value has the form (GENERIC-LIST . NON-GENERIC-ALIST).
-
- GENERIC-LIST is a list of generic coding systems which can encode
- any characters.
-
- NON-GENERIC-ALIST is an alist of non generic coding systems vs the
- corresponding char table that contains safe chars. */
-Lisp_Object Vcoding_system_safe_chars;
-
Lisp_Object Vcoding_system_list, Vcoding_system_alist;
Lisp_Object Qcoding_system_p, Qcoding_system_error;
@@ -413,8 +356,7 @@ Lisp_Object Qcoding_system_p, Qcoding_system_error;
/* Coding system emacs-mule and raw-text are for converting only
end-of-line format. */
Lisp_Object Qemacs_mule, Qraw_text;
-
-Lisp_Object Qutf_8;
+Lisp_Object Qutf_8_emacs;
/* Coding-systems are handed between Emacs Lisp programs and C internal
routines by the following three variables. */
@@ -424,7 +366,8 @@ Lisp_Object Vcoding_system_for_read;
Lisp_Object Vcoding_system_for_write;
/* Coding-system actually used in the latest I/O. */
Lisp_Object Vlast_coding_system_used;
-
+/* Set to non-nil when an error is detected while code conversion. */
+Lisp_Object Vlast_code_conversion_error;
/* A vector of length 256 which contains information about special
Latin codes (especially for dealing with Microsoft codes). */
Lisp_Object Vlatin_extra_code_table;
@@ -438,12 +381,15 @@ int inhibit_iso_escape_detection;
/* Flag to make buffer-file-coding-system inherit from process-coding. */
int inherit_process_coding_system;
+/* Coding system to be used to encode text for terminal display. */
+struct coding_system terminal_coding;
+
/* Coding system to be used to encode text for terminal display when
terminal coding system is nil. */
struct coding_system safe_terminal_coding;
-/* Default coding system to be used to write a file. */
-struct coding_system default_buffer_file_coding;
+/* Coding system of what is sent from terminal keyboard. */
+struct coding_system keyboard_coding;
Lisp_Object Vfile_coding_system_alist;
Lisp_Object Vprocess_coding_system_alist;
@@ -453,42 +399,6 @@ Lisp_Object Vlocale_coding_system;
#endif /* emacs */
-Lisp_Object Qcoding_category, Qcoding_category_index;
-
-/* List of symbols `coding-category-xxx' ordered by priority. */
-Lisp_Object Vcoding_category_list;
-
-/* Table of coding categories (Lisp symbols). */
-Lisp_Object Vcoding_category_table;
-
-/* Table of names of symbol for each coding-category. */
-char *coding_category_name[CODING_CATEGORY_IDX_MAX] = {
- "coding-category-emacs-mule",
- "coding-category-sjis",
- "coding-category-iso-7",
- "coding-category-iso-7-tight",
- "coding-category-iso-8-1",
- "coding-category-iso-8-2",
- "coding-category-iso-7-else",
- "coding-category-iso-8-else",
- "coding-category-ccl",
- "coding-category-big5",
- "coding-category-utf-8",
- "coding-category-utf-16-be",
- "coding-category-utf-16-le",
- "coding-category-raw-text",
- "coding-category-binary"
-};
-
-/* Table of pointers to coding systems corresponding to each coding
- categories. */
-struct coding_system *coding_system_table[CODING_CATEGORY_IDX_MAX];
-
-/* Table of coding category masks. Nth element is a mask for a coding
- category of which priority is Nth. */
-static
-int coding_priorities[CODING_CATEGORY_IDX_MAX];
-
/* Flag to tell if we look up translation table on character code
conversion. */
Lisp_Object Venable_character_translation;
@@ -503,7 +413,7 @@ Lisp_Object Qtranslation_table_for_decode;
Lisp_Object Qtranslation_table_for_encode;
/* Alist of charsets vs revision number. */
-Lisp_Object Vcharset_revision_alist;
+static Lisp_Object Vcharset_revision_table;
/* Default coding systems used for process I/O. */
Lisp_Object Vdefault_process_coding_system;
@@ -511,34 +421,1200 @@ Lisp_Object Vdefault_process_coding_system;
/* Char table for translating Quail and self-inserting input. */
Lisp_Object Vtranslation_table_for_input;
-/* Global flag to tell that we can't call post-read-conversion and
- pre-write-conversion functions. Usually the value is zero, but it
- is set to 1 temporarily while such functions are running. This is
- to avoid infinite recursive call. */
-static int inhibit_pre_post_conversion;
+/* Two special coding systems. */
+Lisp_Object Vsjis_coding_system;
+Lisp_Object Vbig5_coding_system;
+
+/* ISO2022 section */
+
+#define CODING_ISO_INITIAL(coding, reg) \
+ (XINT (AREF (AREF (CODING_ID_ATTRS ((coding)->id), \
+ coding_attr_iso_initial), \
+ reg)))
+
+
+#define CODING_ISO_REQUEST(coding, charset_id) \
+ ((charset_id <= (coding)->max_charset_id \
+ ? (coding)->safe_charsets[charset_id] \
+ : -1))
+
+
+#define CODING_ISO_FLAGS(coding) \
+ ((coding)->spec.iso_2022.flags)
+#define CODING_ISO_DESIGNATION(coding, reg) \
+ ((coding)->spec.iso_2022.current_designation[reg])
+#define CODING_ISO_INVOCATION(coding, plane) \
+ ((coding)->spec.iso_2022.current_invocation[plane])
+#define CODING_ISO_SINGLE_SHIFTING(coding) \
+ ((coding)->spec.iso_2022.single_shifting)
+#define CODING_ISO_BOL(coding) \
+ ((coding)->spec.iso_2022.bol)
+#define CODING_ISO_INVOKED_CHARSET(coding, plane) \
+ CODING_ISO_DESIGNATION ((coding), CODING_ISO_INVOCATION ((coding), (plane)))
+
+/* Control characters of ISO2022. */
+ /* code */ /* function */
+#define ISO_CODE_LF 0x0A /* line-feed */
+#define ISO_CODE_CR 0x0D /* carriage-return */
+#define ISO_CODE_SO 0x0E /* shift-out */
+#define ISO_CODE_SI 0x0F /* shift-in */
+#define ISO_CODE_SS2_7 0x19 /* single-shift-2 for 7-bit code */
+#define ISO_CODE_ESC 0x1B /* escape */
+#define ISO_CODE_SS2 0x8E /* single-shift-2 */
+#define ISO_CODE_SS3 0x8F /* single-shift-3 */
+#define ISO_CODE_CSI 0x9B /* control-sequence-introducer */
+
+/* All code (1-byte) of ISO2022 is classified into one of the
+ followings. */
+enum iso_code_class_type
+ {
+ ISO_control_0, /* Control codes in the range
+ 0x00..0x1F and 0x7F, except for the
+ following 5 codes. */
+ ISO_shift_out, /* ISO_CODE_SO (0x0E) */
+ ISO_shift_in, /* ISO_CODE_SI (0x0F) */
+ ISO_single_shift_2_7, /* ISO_CODE_SS2_7 (0x19) */
+ ISO_escape, /* ISO_CODE_SO (0x1B) */
+ ISO_control_1, /* Control codes in the range
+ 0x80..0x9F, except for the
+ following 3 codes. */
+ ISO_single_shift_2, /* ISO_CODE_SS2 (0x8E) */
+ ISO_single_shift_3, /* ISO_CODE_SS3 (0x8F) */
+ ISO_control_sequence_introducer, /* ISO_CODE_CSI (0x9B) */
+ ISO_0x20_or_0x7F, /* Codes of the values 0x20 or 0x7F. */
+ ISO_graphic_plane_0, /* Graphic codes in the range 0x21..0x7E. */
+ ISO_0xA0_or_0xFF, /* Codes of the values 0xA0 or 0xFF. */
+ ISO_graphic_plane_1 /* Graphic codes in the range 0xA1..0xFE. */
+ };
+
+/** The macros CODING_ISO_FLAG_XXX defines a flag bit of the
+ `iso-flags' attribute of an iso2022 coding system. */
-Lisp_Object Qchar_coding_system;
+/* If set, produce long-form designation sequence (e.g. ESC $ ( A)
+ instead of the correct short-form sequence (e.g. ESC $ A). */
+#define CODING_ISO_FLAG_LONG_FORM 0x0001
-/* Return `safe-chars' property of CODING_SYSTEM (symbol). Don't check
- its validity. */
+/* If set, reset graphic planes and registers at end-of-line to the
+ initial state. */
+#define CODING_ISO_FLAG_RESET_AT_EOL 0x0002
-Lisp_Object
-coding_safe_chars (coding_system)
- Lisp_Object coding_system;
+/* If set, reset graphic planes and registers before any control
+ characters to the initial state. */
+#define CODING_ISO_FLAG_RESET_AT_CNTL 0x0004
+
+/* If set, encode by 7-bit environment. */
+#define CODING_ISO_FLAG_SEVEN_BITS 0x0008
+
+/* If set, use locking-shift function. */
+#define CODING_ISO_FLAG_LOCKING_SHIFT 0x0010
+
+/* If set, use single-shift function. Overwrite
+ CODING_ISO_FLAG_LOCKING_SHIFT. */
+#define CODING_ISO_FLAG_SINGLE_SHIFT 0x0020
+
+/* If set, use designation escape sequence. */
+#define CODING_ISO_FLAG_DESIGNATION 0x0040
+
+/* If set, produce revision number sequence. */
+#define CODING_ISO_FLAG_REVISION 0x0080
+
+/* If set, produce ISO6429's direction specifying sequence. */
+#define CODING_ISO_FLAG_DIRECTION 0x0100
+
+/* If set, assume designation states are reset at beginning of line on
+ output. */
+#define CODING_ISO_FLAG_INIT_AT_BOL 0x0200
+
+/* If set, designation sequence should be placed at beginning of line
+ on output. */
+#define CODING_ISO_FLAG_DESIGNATE_AT_BOL 0x0400
+
+/* If set, do not encode unsafe charactes on output. */
+#define CODING_ISO_FLAG_SAFE 0x0800
+
+/* If set, extra latin codes (128..159) are accepted as a valid code
+ on input. */
+#define CODING_ISO_FLAG_LATIN_EXTRA 0x1000
+
+#define CODING_ISO_FLAG_COMPOSITION 0x2000
+
+#define CODING_ISO_FLAG_EUC_TW_SHIFT 0x4000
+
+#define CODING_ISO_FLAG_USE_ROMAN 0x8000
+
+#define CODING_ISO_FLAG_USE_OLDJIS 0x10000
+
+#define CODING_ISO_FLAG_FULL_SUPPORT 0x100000
+
+/* A character to be produced on output if encoding of the original
+ character is prohibited by CODING_ISO_FLAG_SAFE. */
+#define CODING_INHIBIT_CHARACTER_SUBSTITUTION '?'
+
+
+/* UTF-16 section */
+#define CODING_UTF_16_BOM(coding) \
+ ((coding)->spec.utf_16.bom)
+
+#define CODING_UTF_16_ENDIAN(coding) \
+ ((coding)->spec.utf_16.endian)
+
+#define CODING_UTF_16_SURROGATE(coding) \
+ ((coding)->spec.utf_16.surrogate)
+
+
+/* CCL section */
+#define CODING_CCL_DECODER(coding) \
+ AREF (CODING_ID_ATTRS ((coding)->id), coding_attr_ccl_decoder)
+#define CODING_CCL_ENCODER(coding) \
+ AREF (CODING_ID_ATTRS ((coding)->id), coding_attr_ccl_encoder)
+#define CODING_CCL_VALIDS(coding) \
+ (SDATA (AREF (CODING_ID_ATTRS ((coding)->id), coding_attr_ccl_valids)))
+
+/* Index for each coding category in `coding_categories' */
+
+enum coding_category
+ {
+ coding_category_iso_7,
+ coding_category_iso_7_tight,
+ coding_category_iso_8_1,
+ coding_category_iso_8_2,
+ coding_category_iso_7_else,
+ coding_category_iso_8_else,
+ coding_category_utf_8,
+ coding_category_utf_16_auto,
+ coding_category_utf_16_be,
+ coding_category_utf_16_le,
+ coding_category_utf_16_be_nosig,
+ coding_category_utf_16_le_nosig,
+ coding_category_charset,
+ coding_category_sjis,
+ coding_category_big5,
+ coding_category_ccl,
+ coding_category_emacs_mule,
+ /* All above are targets of code detection. */
+ coding_category_raw_text,
+ coding_category_undecided,
+ coding_category_max
+ };
+
+/* Definitions of flag bits used in detect_coding_XXXX. */
+#define CATEGORY_MASK_ISO_7 (1 << coding_category_iso_7)
+#define CATEGORY_MASK_ISO_7_TIGHT (1 << coding_category_iso_7_tight)
+#define CATEGORY_MASK_ISO_8_1 (1 << coding_category_iso_8_1)
+#define CATEGORY_MASK_ISO_8_2 (1 << coding_category_iso_8_2)
+#define CATEGORY_MASK_ISO_7_ELSE (1 << coding_category_iso_7_else)
+#define CATEGORY_MASK_ISO_8_ELSE (1 << coding_category_iso_8_else)
+#define CATEGORY_MASK_UTF_8 (1 << coding_category_utf_8)
+#define CATEGORY_MASK_UTF_16_AUTO (1 << coding_category_utf_16_auto)
+#define CATEGORY_MASK_UTF_16_BE (1 << coding_category_utf_16_be)
+#define CATEGORY_MASK_UTF_16_LE (1 << coding_category_utf_16_le)
+#define CATEGORY_MASK_UTF_16_BE_NOSIG (1 << coding_category_utf_16_be_nosig)
+#define CATEGORY_MASK_UTF_16_LE_NOSIG (1 << coding_category_utf_16_le_nosig)
+#define CATEGORY_MASK_CHARSET (1 << coding_category_charset)
+#define CATEGORY_MASK_SJIS (1 << coding_category_sjis)
+#define CATEGORY_MASK_BIG5 (1 << coding_category_big5)
+#define CATEGORY_MASK_CCL (1 << coding_category_ccl)
+#define CATEGORY_MASK_EMACS_MULE (1 << coding_category_emacs_mule)
+#define CATEGORY_MASK_RAW_TEXT (1 << coding_category_raw_text)
+
+/* This value is returned if detect_coding_mask () find nothing other
+ than ASCII characters. */
+#define CATEGORY_MASK_ANY \
+ (CATEGORY_MASK_ISO_7 \
+ | CATEGORY_MASK_ISO_7_TIGHT \
+ | CATEGORY_MASK_ISO_8_1 \
+ | CATEGORY_MASK_ISO_8_2 \
+ | CATEGORY_MASK_ISO_7_ELSE \
+ | CATEGORY_MASK_ISO_8_ELSE \
+ | CATEGORY_MASK_UTF_8 \
+ | CATEGORY_MASK_UTF_16_BE \
+ | CATEGORY_MASK_UTF_16_LE \
+ | CATEGORY_MASK_UTF_16_BE_NOSIG \
+ | CATEGORY_MASK_UTF_16_LE_NOSIG \
+ | CATEGORY_MASK_CHARSET \
+ | CATEGORY_MASK_SJIS \
+ | CATEGORY_MASK_BIG5 \
+ | CATEGORY_MASK_CCL \
+ | CATEGORY_MASK_EMACS_MULE)
+
+
+#define CATEGORY_MASK_ISO_7BIT \
+ (CATEGORY_MASK_ISO_7 | CATEGORY_MASK_ISO_7_TIGHT)
+
+#define CATEGORY_MASK_ISO_8BIT \
+ (CATEGORY_MASK_ISO_8_1 | CATEGORY_MASK_ISO_8_2)
+
+#define CATEGORY_MASK_ISO_ELSE \
+ (CATEGORY_MASK_ISO_7_ELSE | CATEGORY_MASK_ISO_8_ELSE)
+
+#define CATEGORY_MASK_ISO_ESCAPE \
+ (CATEGORY_MASK_ISO_7 \
+ | CATEGORY_MASK_ISO_7_TIGHT \
+ | CATEGORY_MASK_ISO_7_ELSE \
+ | CATEGORY_MASK_ISO_8_ELSE)
+
+#define CATEGORY_MASK_ISO \
+ ( CATEGORY_MASK_ISO_7BIT \
+ | CATEGORY_MASK_ISO_8BIT \
+ | CATEGORY_MASK_ISO_ELSE)
+
+#define CATEGORY_MASK_UTF_16 \
+ (CATEGORY_MASK_UTF_16_BE \
+ | CATEGORY_MASK_UTF_16_LE \
+ | CATEGORY_MASK_UTF_16_BE_NOSIG \
+ | CATEGORY_MASK_UTF_16_LE_NOSIG)
+
+
+/* List of symbols `coding-category-xxx' ordered by priority. This
+ variable is exposed to Emacs Lisp. */
+static Lisp_Object Vcoding_category_list;
+
+/* Table of coding categories (Lisp symbols). This variable is for
+ internal use oly. */
+static Lisp_Object Vcoding_category_table;
+
+/* Table of coding-categories ordered by priority. */
+static enum coding_category coding_priorities[coding_category_max];
+
+/* Nth element is a coding context for the coding system bound to the
+ Nth coding category. */
+static struct coding_system coding_categories[coding_category_max];
+
+/*** Commonly used macros and functions ***/
+
+#ifndef min
+#define min(a, b) ((a) < (b) ? (a) : (b))
+#endif
+#ifndef max
+#define max(a, b) ((a) > (b) ? (a) : (b))
+#endif
+
+#define CODING_GET_INFO(coding, attrs, charset_list) \
+ do { \
+ (attrs) = CODING_ID_ATTRS ((coding)->id); \
+ (charset_list) = CODING_ATTR_CHARSET_LIST (attrs); \
+ } while (0)
+
+
+/* Safely get one byte from the source text pointed by SRC which ends
+ at SRC_END, and set C to that byte. If there are not enough bytes
+ in the source, it jumps to `no_more_source'. If multibytep is
+ nonzero, and a multibyte character is found at SRC, set C to the
+ negative value of the character code. The caller should declare
+ and set these variables appropriately in advance:
+ src, src_end, multibytep */
+
+#define ONE_MORE_BYTE(c) \
+ do { \
+ if (src == src_end) \
+ { \
+ if (src_base < src) \
+ record_conversion_result \
+ (coding, CODING_RESULT_INSUFFICIENT_SRC); \
+ goto no_more_source; \
+ } \
+ c = *src++; \
+ if (multibytep && (c & 0x80)) \
+ { \
+ if ((c & 0xFE) == 0xC0) \
+ c = ((c & 1) << 6) | *src++; \
+ else \
+ { \
+ src--; \
+ c = - string_char (src, &src, NULL); \
+ record_conversion_result \
+ (coding, CODING_RESULT_INVALID_SRC); \
+ } \
+ } \
+ consumed_chars++; \
+ } while (0)
+
+
+#define ONE_MORE_BYTE_NO_CHECK(c) \
+ do { \
+ c = *src++; \
+ if (multibytep && (c & 0x80)) \
+ { \
+ if ((c & 0xFE) == 0xC0) \
+ c = ((c & 1) << 6) | *src++; \
+ else \
+ { \
+ src--; \
+ c = - string_char (src, &src, NULL); \
+ record_conversion_result \
+ (coding, CODING_RESULT_INVALID_SRC); \
+ } \
+ } \
+ consumed_chars++; \
+ } while (0)
+
+
+/* Store a byte C in the place pointed by DST and increment DST to the
+ next free point, and increment PRODUCED_CHARS. The caller should
+ assure that C is 0..127, and declare and set the variable `dst'
+ appropriately in advance.
+*/
+
+
+#define EMIT_ONE_ASCII_BYTE(c) \
+ do { \
+ produced_chars++; \
+ *dst++ = (c); \
+ } while (0)
+
+
+/* Like EMIT_ONE_ASCII_BYTE byt store two bytes; C1 and C2. */
+
+#define EMIT_TWO_ASCII_BYTES(c1, c2) \
+ do { \
+ produced_chars += 2; \
+ *dst++ = (c1), *dst++ = (c2); \
+ } while (0)
+
+
+/* Store a byte C in the place pointed by DST and increment DST to the
+ next free point, and increment PRODUCED_CHARS. If MULTIBYTEP is
+ nonzero, store in an appropriate multibyte from. The caller should
+ declare and set the variables `dst' and `multibytep' appropriately
+ in advance. */
+
+#define EMIT_ONE_BYTE(c) \
+ do { \
+ produced_chars++; \
+ if (multibytep) \
+ { \
+ int ch = (c); \
+ if (ch >= 0x80) \
+ ch = BYTE8_TO_CHAR (ch); \
+ CHAR_STRING_ADVANCE (ch, dst); \
+ } \
+ else \
+ *dst++ = (c); \
+ } while (0)
+
+
+/* Like EMIT_ONE_BYTE, but emit two bytes; C1 and C2. */
+
+#define EMIT_TWO_BYTES(c1, c2) \
+ do { \
+ produced_chars += 2; \
+ if (multibytep) \
+ { \
+ int ch; \
+ \
+ ch = (c1); \
+ if (ch >= 0x80) \
+ ch = BYTE8_TO_CHAR (ch); \
+ CHAR_STRING_ADVANCE (ch, dst); \
+ ch = (c2); \
+ if (ch >= 0x80) \
+ ch = BYTE8_TO_CHAR (ch); \
+ CHAR_STRING_ADVANCE (ch, dst); \
+ } \
+ else \
+ { \
+ *dst++ = (c1); \
+ *dst++ = (c2); \
+ } \
+ } while (0)
+
+
+#define EMIT_THREE_BYTES(c1, c2, c3) \
+ do { \
+ EMIT_ONE_BYTE (c1); \
+ EMIT_TWO_BYTES (c2, c3); \
+ } while (0)
+
+
+#define EMIT_FOUR_BYTES(c1, c2, c3, c4) \
+ do { \
+ EMIT_TWO_BYTES (c1, c2); \
+ EMIT_TWO_BYTES (c3, c4); \
+ } while (0)
+
+
+/* Prototypes for static functions. */
+static void record_conversion_result P_ ((struct coding_system *coding,
+ enum coding_result_code result));
+static int detect_coding_utf_8 P_ ((struct coding_system *,
+ struct coding_detection_info *info));
+static void decode_coding_utf_8 P_ ((struct coding_system *));
+static int encode_coding_utf_8 P_ ((struct coding_system *));
+
+static int detect_coding_utf_16 P_ ((struct coding_system *,
+ struct coding_detection_info *info));
+static void decode_coding_utf_16 P_ ((struct coding_system *));
+static int encode_coding_utf_16 P_ ((struct coding_system *));
+
+static int detect_coding_iso_2022 P_ ((struct coding_system *,
+ struct coding_detection_info *info));
+static void decode_coding_iso_2022 P_ ((struct coding_system *));
+static int encode_coding_iso_2022 P_ ((struct coding_system *));
+
+static int detect_coding_emacs_mule P_ ((struct coding_system *,
+ struct coding_detection_info *info));
+static void decode_coding_emacs_mule P_ ((struct coding_system *));
+static int encode_coding_emacs_mule P_ ((struct coding_system *));
+
+static int detect_coding_sjis P_ ((struct coding_system *,
+ struct coding_detection_info *info));
+static void decode_coding_sjis P_ ((struct coding_system *));
+static int encode_coding_sjis P_ ((struct coding_system *));
+
+static int detect_coding_big5 P_ ((struct coding_system *,
+ struct coding_detection_info *info));
+static void decode_coding_big5 P_ ((struct coding_system *));
+static int encode_coding_big5 P_ ((struct coding_system *));
+
+static int detect_coding_ccl P_ ((struct coding_system *,
+ struct coding_detection_info *info));
+static void decode_coding_ccl P_ ((struct coding_system *));
+static int encode_coding_ccl P_ ((struct coding_system *));
+
+static void decode_coding_raw_text P_ ((struct coding_system *));
+static int encode_coding_raw_text P_ ((struct coding_system *));
+
+static void coding_set_source P_ ((struct coding_system *));
+static void coding_set_destination P_ ((struct coding_system *));
+static void coding_alloc_by_realloc P_ ((struct coding_system *, EMACS_INT));
+static void coding_alloc_by_making_gap P_ ((struct coding_system *,
+ EMACS_INT, EMACS_INT));
+static unsigned char *alloc_destination P_ ((struct coding_system *,
+ EMACS_INT, unsigned char *));
+static void setup_iso_safe_charsets P_ ((Lisp_Object));
+static unsigned char *encode_designation_at_bol P_ ((struct coding_system *,
+ int *, int *,
+ unsigned char *));
+static int detect_eol P_ ((const unsigned char *,
+ EMACS_INT, enum coding_category));
+static Lisp_Object adjust_coding_eol_type P_ ((struct coding_system *, int));
+static void decode_eol P_ ((struct coding_system *));
+static Lisp_Object get_translation_table P_ ((Lisp_Object, int, int *));
+static Lisp_Object get_translation P_ ((Lisp_Object, int *, int *,
+ int, int *, int *));
+static int produce_chars P_ ((struct coding_system *, Lisp_Object, int));
+static INLINE void produce_composition P_ ((struct coding_system *, int *,
+ EMACS_INT));
+static INLINE void produce_charset P_ ((struct coding_system *, int *,
+ EMACS_INT));
+static void produce_annotation P_ ((struct coding_system *, EMACS_INT));
+static int decode_coding P_ ((struct coding_system *));
+static INLINE int *handle_composition_annotation P_ ((EMACS_INT, EMACS_INT,
+ struct coding_system *,
+ int *, EMACS_INT *));
+static INLINE int *handle_charset_annotation P_ ((EMACS_INT, EMACS_INT,
+ struct coding_system *,
+ int *, EMACS_INT *));
+static void consume_chars P_ ((struct coding_system *, Lisp_Object, int));
+static int encode_coding P_ ((struct coding_system *));
+static Lisp_Object make_conversion_work_buffer P_ ((int));
+static Lisp_Object code_conversion_restore P_ ((Lisp_Object));
+static INLINE int char_encodable_p P_ ((int, Lisp_Object));
+static Lisp_Object make_subsidiaries P_ ((Lisp_Object));
+
+static void
+record_conversion_result (struct coding_system *coding,
+ enum coding_result_code result)
+{
+ coding->result = result;
+ switch (result)
+ {
+ case CODING_RESULT_INSUFFICIENT_SRC:
+ Vlast_code_conversion_error = Qinsufficient_source;
+ break;
+ case CODING_RESULT_INCONSISTENT_EOL:
+ Vlast_code_conversion_error = Qinconsistent_eol;
+ break;
+ case CODING_RESULT_INVALID_SRC:
+ Vlast_code_conversion_error = Qinvalid_source;
+ break;
+ case CODING_RESULT_INTERRUPT:
+ Vlast_code_conversion_error = Qinterrupted;
+ break;
+ case CODING_RESULT_INSUFFICIENT_MEM:
+ Vlast_code_conversion_error = Qinsufficient_memory;
+ break;
+ default:
+ Vlast_code_conversion_error = intern ("Unknown error");
+ }
+}
+
+#define CODING_DECODE_CHAR(coding, src, src_base, src_end, charset, code, c) \
+ do { \
+ charset_map_loaded = 0; \
+ c = DECODE_CHAR (charset, code); \
+ if (charset_map_loaded) \
+ { \
+ const unsigned char *orig = coding->source; \
+ EMACS_INT offset; \
+ \
+ coding_set_source (coding); \
+ offset = coding->source - orig; \
+ src += offset; \
+ src_base += offset; \
+ src_end += offset; \
+ } \
+ } while (0)
+
+
+#define ASSURE_DESTINATION(bytes) \
+ do { \
+ if (dst + (bytes) >= dst_end) \
+ { \
+ int more_bytes = charbuf_end - charbuf + (bytes); \
+ \
+ dst = alloc_destination (coding, more_bytes, dst); \
+ dst_end = coding->destination + coding->dst_bytes; \
+ } \
+ } while (0)
+
+
+
+static void
+coding_set_source (coding)
+ struct coding_system *coding;
+{
+ if (BUFFERP (coding->src_object))
+ {
+ struct buffer *buf = XBUFFER (coding->src_object);
+
+ if (coding->src_pos < 0)
+ coding->source = BUF_GAP_END_ADDR (buf) + coding->src_pos_byte;
+ else
+ coding->source = BUF_BYTE_ADDRESS (buf, coding->src_pos_byte);
+ }
+ else if (STRINGP (coding->src_object))
+ {
+ coding->source = SDATA (coding->src_object) + coding->src_pos_byte;
+ }
+ else
+ /* Otherwise, the source is C string and is never relocated
+ automatically. Thus we don't have to update anything. */
+ ;
+}
+
+static void
+coding_set_destination (coding)
+ struct coding_system *coding;
+{
+ if (BUFFERP (coding->dst_object))
+ {
+ if (coding->src_pos < 0)
+ {
+ coding->destination = BEG_ADDR + coding->dst_pos_byte - 1;
+ coding->dst_bytes = (GAP_END_ADDR
+ - (coding->src_bytes - coding->consumed)
+ - coding->destination);
+ }
+ else
+ {
+ /* We are sure that coding->dst_pos_byte is before the gap
+ of the buffer. */
+ coding->destination = (BUF_BEG_ADDR (XBUFFER (coding->dst_object))
+ + coding->dst_pos_byte - 1);
+ coding->dst_bytes = (BUF_GAP_END_ADDR (XBUFFER (coding->dst_object))
+ - coding->destination);
+ }
+ }
+ else
+ /* Otherwise, the destination is C string and is never relocated
+ automatically. Thus we don't have to update anything. */
+ ;
+}
+
+
+static void
+coding_alloc_by_realloc (coding, bytes)
+ struct coding_system *coding;
+ EMACS_INT bytes;
+{
+ coding->destination = (unsigned char *) xrealloc (coding->destination,
+ coding->dst_bytes + bytes);
+ coding->dst_bytes += bytes;
+}
+
+static void
+coding_alloc_by_making_gap (coding, offset, bytes)
+ struct coding_system *coding;
+ EMACS_INT offset, bytes;
+{
+ if (BUFFERP (coding->dst_object)
+ && EQ (coding->src_object, coding->dst_object))
+ {
+ EMACS_INT add = offset + (coding->src_bytes - coding->consumed);
+
+ GPT += offset, GPT_BYTE += offset;
+ GAP_SIZE -= add; ZV += add; Z += add; ZV_BYTE += add; Z_BYTE += add;
+ make_gap (bytes);
+ GAP_SIZE += add; ZV -= add; Z -= add; ZV_BYTE -= add; Z_BYTE -= add;
+ GPT -= offset, GPT_BYTE -= offset;
+ }
+ else
+ {
+ Lisp_Object this_buffer;
+
+ this_buffer = Fcurrent_buffer ();
+ set_buffer_internal (XBUFFER (coding->dst_object));
+ make_gap (bytes);
+ set_buffer_internal (XBUFFER (this_buffer));
+ }
+}
+
+
+static unsigned char *
+alloc_destination (coding, nbytes, dst)
+ struct coding_system *coding;
+ EMACS_INT nbytes;
+ unsigned char *dst;
+{
+ EMACS_INT offset = dst - coding->destination;
+
+ if (BUFFERP (coding->dst_object))
+ coding_alloc_by_making_gap (coding, offset, nbytes);
+ else
+ coding_alloc_by_realloc (coding, nbytes);
+ record_conversion_result (coding, CODING_RESULT_SUCCESS);
+ coding_set_destination (coding);
+ dst = coding->destination + offset;
+ return dst;
+}
+
+/** Macros for annotations. */
+
+/* Maximum length of annotation data (sum of annotations for
+ composition and charset). */
+#define MAX_ANNOTATION_LENGTH (4 + (MAX_COMPOSITION_COMPONENTS * 2) - 1 + 4)
+
+/* An annotation data is stored in the array coding->charbuf in this
+ format:
+ [ -LENGTH ANNOTATION_MASK NCHARS ... ]
+ LENGTH is the number of elements in the annotation.
+ ANNOTATION_MASK is one of CODING_ANNOTATE_XXX_MASK.
+ NCHARS is the number of characters in the text annotated.
+
+ The format of the following elements depend on ANNOTATION_MASK.
+
+ In the case of CODING_ANNOTATE_COMPOSITION_MASK, these elements
+ follows:
+ ... METHOD [ COMPOSITION-COMPONENTS ... ]
+ METHOD is one of enum composition_method.
+ Optionnal COMPOSITION-COMPONENTS are characters and composition
+ rules.
+
+ In the case of CODING_ANNOTATE_CHARSET_MASK, one element CHARSET-ID
+ follows. */
+
+#define ADD_ANNOTATION_DATA(buf, len, mask, nchars) \
+ do { \
+ *(buf)++ = -(len); \
+ *(buf)++ = (mask); \
+ *(buf)++ = (nchars); \
+ coding->annotated = 1; \
+ } while (0);
+
+#define ADD_COMPOSITION_DATA(buf, nchars, method) \
+ do { \
+ ADD_ANNOTATION_DATA (buf, 4, CODING_ANNOTATE_COMPOSITION_MASK, nchars); \
+ *buf++ = method; \
+ } while (0)
+
+
+#define ADD_CHARSET_DATA(buf, nchars, id) \
+ do { \
+ ADD_ANNOTATION_DATA (buf, 4, CODING_ANNOTATE_CHARSET_MASK, nchars); \
+ *buf++ = id; \
+ } while (0)
+
+
+/*** 2. Emacs' internal format (emacs-utf-8) ***/
+
+
+
+
+/*** 3. UTF-8 ***/
+
+/* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions".
+ Check if a text is encoded in UTF-8. If it is, return 1, else
+ return 0. */
+
+#define UTF_8_1_OCTET_P(c) ((c) < 0x80)
+#define UTF_8_EXTRA_OCTET_P(c) (((c) & 0xC0) == 0x80)
+#define UTF_8_2_OCTET_LEADING_P(c) (((c) & 0xE0) == 0xC0)
+#define UTF_8_3_OCTET_LEADING_P(c) (((c) & 0xF0) == 0xE0)
+#define UTF_8_4_OCTET_LEADING_P(c) (((c) & 0xF8) == 0xF0)
+#define UTF_8_5_OCTET_LEADING_P(c) (((c) & 0xFC) == 0xF8)
+
+static int
+detect_coding_utf_8 (coding, detect_info)
+ struct coding_system *coding;
+ struct coding_detection_info *detect_info;
+{
+ const unsigned char *src = coding->source, *src_base;
+ const unsigned char *src_end = coding->source + coding->src_bytes;
+ int multibytep = coding->src_multibyte;
+ int consumed_chars = 0;
+ int found = 0;
+
+ detect_info->checked |= CATEGORY_MASK_UTF_8;
+ /* A coding system of this category is always ASCII compatible. */
+ src += coding->head_ascii;
+
+ while (1)
+ {
+ int c, c1, c2, c3, c4;
+
+ src_base = src;
+ ONE_MORE_BYTE (c);
+ if (c < 0 || UTF_8_1_OCTET_P (c))
+ continue;
+ ONE_MORE_BYTE (c1);
+ if (c1 < 0 || ! UTF_8_EXTRA_OCTET_P (c1))
+ break;
+ if (UTF_8_2_OCTET_LEADING_P (c))
+ {
+ found = CATEGORY_MASK_UTF_8;
+ continue;
+ }
+ ONE_MORE_BYTE (c2);
+ if (c2 < 0 || ! UTF_8_EXTRA_OCTET_P (c2))
+ break;
+ if (UTF_8_3_OCTET_LEADING_P (c))
+ {
+ found = CATEGORY_MASK_UTF_8;
+ continue;
+ }
+ ONE_MORE_BYTE (c3);
+ if (c3 < 0 || ! UTF_8_EXTRA_OCTET_P (c3))
+ break;
+ if (UTF_8_4_OCTET_LEADING_P (c))
+ {
+ found = CATEGORY_MASK_UTF_8;
+ continue;
+ }
+ ONE_MORE_BYTE (c4);
+ if (c4 < 0 || ! UTF_8_EXTRA_OCTET_P (c4))
+ break;
+ if (UTF_8_5_OCTET_LEADING_P (c))
+ {
+ found = CATEGORY_MASK_UTF_8;
+ continue;
+ }
+ break;
+ }
+ detect_info->rejected |= CATEGORY_MASK_UTF_8;
+ return 0;
+
+ no_more_source:
+ if (src_base < src && coding->mode & CODING_MODE_LAST_BLOCK)
+ {
+ detect_info->rejected |= CATEGORY_MASK_UTF_8;
+ return 0;
+ }
+ detect_info->found |= found;
+ return 1;
+}
+
+
+static void
+decode_coding_utf_8 (coding)
+ struct coding_system *coding;
+{
+ const unsigned char *src = coding->source + coding->consumed;
+ const unsigned char *src_end = coding->source + coding->src_bytes;
+ const unsigned char *src_base;
+ int *charbuf = coding->charbuf + coding->charbuf_used;
+ int *charbuf_end = coding->charbuf + coding->charbuf_size;
+ int consumed_chars = 0, consumed_chars_base;
+ int multibytep = coding->src_multibyte;
+ Lisp_Object attr, charset_list;
+
+ CODING_GET_INFO (coding, attr, charset_list);
+
+ while (1)
+ {
+ int c, c1, c2, c3, c4, c5;
+
+ src_base = src;
+ consumed_chars_base = consumed_chars;
+
+ if (charbuf >= charbuf_end)
+ break;
+
+ ONE_MORE_BYTE (c1);
+ if (c1 < 0)
+ {
+ c = - c1;
+ }
+ else if (UTF_8_1_OCTET_P(c1))
+ {
+ c = c1;
+ }
+ else
+ {
+ ONE_MORE_BYTE (c2);
+ if (c2 < 0 || ! UTF_8_EXTRA_OCTET_P (c2))
+ goto invalid_code;
+ if (UTF_8_2_OCTET_LEADING_P (c1))
+ {
+ c = ((c1 & 0x1F) << 6) | (c2 & 0x3F);
+ /* Reject overlong sequences here and below. Encoders
+ producing them are incorrect, they can be misleading,
+ and they mess up read/write invariance. */
+ if (c < 128)
+ goto invalid_code;
+ }
+ else
+ {
+ ONE_MORE_BYTE (c3);
+ if (c3 < 0 || ! UTF_8_EXTRA_OCTET_P (c3))
+ goto invalid_code;
+ if (UTF_8_3_OCTET_LEADING_P (c1))
+ {
+ c = (((c1 & 0xF) << 12)
+ | ((c2 & 0x3F) << 6) | (c3 & 0x3F));
+ if (c < 0x800
+ || (c >= 0xd800 && c < 0xe000)) /* surrogates (invalid) */
+ goto invalid_code;
+ }
+ else
+ {
+ ONE_MORE_BYTE (c4);
+ if (c4 < 0 || ! UTF_8_EXTRA_OCTET_P (c4))
+ goto invalid_code;
+ if (UTF_8_4_OCTET_LEADING_P (c1))
+ {
+ c = (((c1 & 0x7) << 18) | ((c2 & 0x3F) << 12)
+ | ((c3 & 0x3F) << 6) | (c4 & 0x3F));
+ if (c < 0x10000)
+ goto invalid_code;
+ }
+ else
+ {
+ ONE_MORE_BYTE (c5);
+ if (c5 < 0 || ! UTF_8_EXTRA_OCTET_P (c5))
+ goto invalid_code;
+ if (UTF_8_5_OCTET_LEADING_P (c1))
+ {
+ c = (((c1 & 0x3) << 24) | ((c2 & 0x3F) << 18)
+ | ((c3 & 0x3F) << 12) | ((c4 & 0x3F) << 6)
+ | (c5 & 0x3F));
+ if ((c > MAX_CHAR) || (c < 0x200000))
+ goto invalid_code;
+ }
+ else
+ goto invalid_code;
+ }
+ }
+ }
+ }
+
+ *charbuf++ = c;
+ continue;
+
+ invalid_code:
+ src = src_base;
+ consumed_chars = consumed_chars_base;
+ ONE_MORE_BYTE (c);
+ *charbuf++ = ASCII_BYTE_P (c) ? c : BYTE8_TO_CHAR (c);
+ coding->errors++;
+ }
+
+ no_more_source:
+ coding->consumed_char += consumed_chars_base;
+ coding->consumed = src_base - coding->source;
+ coding->charbuf_used = charbuf - coding->charbuf;
+}
+
+
+static int
+encode_coding_utf_8 (coding)
+ struct coding_system *coding;
{
- Lisp_Object coding_spec, plist, safe_chars;
+ int multibytep = coding->dst_multibyte;
+ int *charbuf = coding->charbuf;
+ int *charbuf_end = charbuf + coding->charbuf_used;
+ unsigned char *dst = coding->destination + coding->produced;
+ unsigned char *dst_end = coding->destination + coding->dst_bytes;
+ int produced_chars = 0;
+ int c;
+
+ if (multibytep)
+ {
+ int safe_room = MAX_MULTIBYTE_LENGTH * 2;
+
+ while (charbuf < charbuf_end)
+ {
+ unsigned char str[MAX_MULTIBYTE_LENGTH], *p, *pend = str;
+
+ ASSURE_DESTINATION (safe_room);
+ c = *charbuf++;
+ if (CHAR_BYTE8_P (c))
+ {
+ c = CHAR_TO_BYTE8 (c);
+ EMIT_ONE_BYTE (c);
+ }
+ else
+ {
+ CHAR_STRING_ADVANCE (c, pend);
+ for (p = str; p < pend; p++)
+ EMIT_ONE_BYTE (*p);
+ }
+ }
+ }
+ else
+ {
+ int safe_room = MAX_MULTIBYTE_LENGTH;
+
+ while (charbuf < charbuf_end)
+ {
+ ASSURE_DESTINATION (safe_room);
+ c = *charbuf++;
+ if (CHAR_BYTE8_P (c))
+ *dst++ = CHAR_TO_BYTE8 (c);
+ else
+ dst += CHAR_STRING (c, dst);
+ produced_chars++;
+ }
+ }
+ record_conversion_result (coding, CODING_RESULT_SUCCESS);
+ coding->produced_char += produced_chars;
+ coding->produced = dst - coding->destination;
+ return 0;
+}
+
+
+/* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions".
+ Check if a text is encoded in one of UTF-16 based coding systems.
+ If it is, return 1, else return 0. */
+
+#define UTF_16_HIGH_SURROGATE_P(val) \
+ (((val) & 0xFC00) == 0xD800)
+
+#define UTF_16_LOW_SURROGATE_P(val) \
+ (((val) & 0xFC00) == 0xDC00)
+
+#define UTF_16_INVALID_P(val) \
+ (((val) == 0xFFFE) \
+ || ((val) == 0xFFFF) \
+ || UTF_16_LOW_SURROGATE_P (val))
+
+
+static int
+detect_coding_utf_16 (coding, detect_info)
+ struct coding_system *coding;
+ struct coding_detection_info *detect_info;
+{
+ const unsigned char *src = coding->source, *src_base = src;
+ const unsigned char *src_end = coding->source + coding->src_bytes;
+ int multibytep = coding->src_multibyte;
+ int consumed_chars = 0;
+ int c1, c2;
+
+ detect_info->checked |= CATEGORY_MASK_UTF_16;
+ if (coding->mode & CODING_MODE_LAST_BLOCK
+ && (coding->src_chars & 1))
+ {
+ detect_info->rejected |= CATEGORY_MASK_UTF_16;
+ return 0;
+ }
+
+ ONE_MORE_BYTE (c1);
+ ONE_MORE_BYTE (c2);
+ if ((c1 == 0xFF) && (c2 == 0xFE))
+ {
+ detect_info->found |= (CATEGORY_MASK_UTF_16_LE
+ | CATEGORY_MASK_UTF_16_AUTO);
+ detect_info->rejected |= (CATEGORY_MASK_UTF_16_BE
+ | CATEGORY_MASK_UTF_16_BE_NOSIG
+ | CATEGORY_MASK_UTF_16_LE_NOSIG);
+ }
+ else if ((c1 == 0xFE) && (c2 == 0xFF))
+ {
+ detect_info->found |= (CATEGORY_MASK_UTF_16_BE
+ | CATEGORY_MASK_UTF_16_AUTO);
+ detect_info->rejected |= (CATEGORY_MASK_UTF_16_LE
+ | CATEGORY_MASK_UTF_16_BE_NOSIG
+ | CATEGORY_MASK_UTF_16_LE_NOSIG);
+ }
+ else if (c1 >= 0 && c2 >= 0)
+ {
+ detect_info->rejected
+ |= (CATEGORY_MASK_UTF_16_BE | CATEGORY_MASK_UTF_16_LE);
+ }
+ no_more_source:
+ return 1;
+}
+
+static void
+decode_coding_utf_16 (coding)
+ struct coding_system *coding;
+{
+ const unsigned char *src = coding->source + coding->consumed;
+ const unsigned char *src_end = coding->source + coding->src_bytes;
+ const unsigned char *src_base;
+ int *charbuf = coding->charbuf + coding->charbuf_used;
+ int *charbuf_end = coding->charbuf + coding->charbuf_size;
+ int consumed_chars = 0, consumed_chars_base;
+ int multibytep = coding->src_multibyte;
+ enum utf_16_bom_type bom = CODING_UTF_16_BOM (coding);
+ enum utf_16_endian_type endian = CODING_UTF_16_ENDIAN (coding);
+ int surrogate = CODING_UTF_16_SURROGATE (coding);
+ Lisp_Object attr, charset_list;
+
+ CODING_GET_INFO (coding, attr, charset_list);
+
+ if (bom == utf_16_with_bom)
+ {
+ int c, c1, c2;
+
+ src_base = src;
+ ONE_MORE_BYTE (c1);
+ ONE_MORE_BYTE (c2);
+ c = (c1 << 8) | c2;
+
+ if (endian == utf_16_big_endian
+ ? c != 0xFEFF : c != 0xFFFE)
+ {
+ /* The first two bytes are not BOM. Treat them as bytes
+ for a normal character. */
+ src = src_base;
+ coding->errors++;
+ }
+ CODING_UTF_16_BOM (coding) = utf_16_without_bom;
+ }
+ else if (bom == utf_16_detect_bom)
+ {
+ /* We have already tried to detect BOM and failed in
+ detect_coding. */
+ CODING_UTF_16_BOM (coding) = utf_16_without_bom;
+ }
+
+ while (1)
+ {
+ int c, c1, c2;
+
+ src_base = src;
+ consumed_chars_base = consumed_chars;
+
+ if (charbuf + 2 >= charbuf_end)
+ break;
+
+ ONE_MORE_BYTE (c1);
+ if (c1 < 0)
+ {
+ *charbuf++ = -c1;
+ continue;
+ }
+ ONE_MORE_BYTE (c2);
+ if (c2 < 0)
+ {
+ *charbuf++ = ASCII_BYTE_P (c1) ? c1 : BYTE8_TO_CHAR (c1);
+ *charbuf++ = -c2;
+ continue;
+ }
+ c = (endian == utf_16_big_endian
+ ? ((c1 << 8) | c2) : ((c2 << 8) | c1));
+ if (surrogate)
+ {
+ if (! UTF_16_LOW_SURROGATE_P (c))
+ {
+ if (endian == utf_16_big_endian)
+ c1 = surrogate >> 8, c2 = surrogate & 0xFF;
+ else
+ c1 = surrogate & 0xFF, c2 = surrogate >> 8;
+ *charbuf++ = c1;
+ *charbuf++ = c2;
+ coding->errors++;
+ if (UTF_16_HIGH_SURROGATE_P (c))
+ CODING_UTF_16_SURROGATE (coding) = surrogate = c;
+ else
+ *charbuf++ = c;
+ }
+ else
+ {
+ c = ((surrogate - 0xD800) << 10) | (c - 0xDC00);
+ CODING_UTF_16_SURROGATE (coding) = surrogate = 0;
+ *charbuf++ = 0x10000 + c;
+ }
+ }
+ else
+ {
+ if (UTF_16_HIGH_SURROGATE_P (c))
+ CODING_UTF_16_SURROGATE (coding) = surrogate = c;
+ else
+ *charbuf++ = c;
+ }
+ }
- coding_spec = Fget (coding_system, Qcoding_system);
- plist = XVECTOR (coding_spec)->contents[3];
- safe_chars = Fplist_get (XVECTOR (coding_spec)->contents[3], Qsafe_chars);
- return (CHAR_TABLE_P (safe_chars) ? safe_chars : Qt);
+ no_more_source:
+ coding->consumed_char += consumed_chars_base;
+ coding->consumed = src_base - coding->source;
+ coding->charbuf_used = charbuf - coding->charbuf;
}
-#define CODING_SAFE_CHAR_P(safe_chars, c) \
- (EQ (safe_chars, Qt) || !NILP (CHAR_TABLE_REF (safe_chars, c)))
+static int
+encode_coding_utf_16 (coding)
+ struct coding_system *coding;
+{
+ int multibytep = coding->dst_multibyte;
+ int *charbuf = coding->charbuf;
+ int *charbuf_end = charbuf + coding->charbuf_used;
+ unsigned char *dst = coding->destination + coding->produced;
+ unsigned char *dst_end = coding->destination + coding->dst_bytes;
+ int safe_room = 8;
+ enum utf_16_bom_type bom = CODING_UTF_16_BOM (coding);
+ int big_endian = CODING_UTF_16_ENDIAN (coding) == utf_16_big_endian;
+ int produced_chars = 0;
+ Lisp_Object attrs, charset_list;
+ int c;
+
+ CODING_GET_INFO (coding, attrs, charset_list);
+
+ if (bom != utf_16_without_bom)
+ {
+ ASSURE_DESTINATION (safe_room);
+ if (big_endian)
+ EMIT_TWO_BYTES (0xFE, 0xFF);
+ else
+ EMIT_TWO_BYTES (0xFF, 0xFE);
+ CODING_UTF_16_BOM (coding) = utf_16_without_bom;
+ }
+
+ while (charbuf < charbuf_end)
+ {
+ ASSURE_DESTINATION (safe_room);
+ c = *charbuf++;
+ if (c >= MAX_UNICODE_CHAR)
+ c = coding->default_char;
+
+ if (c < 0x10000)
+ {
+ if (big_endian)
+ EMIT_TWO_BYTES (c >> 8, c & 0xFF);
+ else
+ EMIT_TWO_BYTES (c & 0xFF, c >> 8);
+ }
+ else
+ {
+ int c1, c2;
+
+ c -= 0x10000;
+ c1 = (c >> 10) + 0xD800;
+ c2 = (c & 0x3FF) + 0xDC00;
+ if (big_endian)
+ EMIT_FOUR_BYTES (c1 >> 8, c1 & 0xFF, c2 >> 8, c2 & 0xFF);
+ else
+ EMIT_FOUR_BYTES (c1 & 0xFF, c1 >> 8, c2 & 0xFF, c2 >> 8);
+ }
+ }
+ record_conversion_result (coding, CODING_RESULT_SUCCESS);
+ coding->produced = dst - coding->destination;
+ coding->produced_char += produced_chars;
+ return 0;
+}
-/*** 2. Emacs internal format (emacs-mule) handlers ***/
+/*** 6. Old Emacs' internal format (emacs-mule) ***/
/* Emacs' internal format for representation of multiple character
sets is a kind of multi-byte encoding, i.e. characters are
@@ -580,7 +1656,7 @@ coding_safe_chars (coding_system)
In that case, a sequence of one-byte codes has a slightly different
form.
- Firstly, all characters in eight-bit-control are represented by
+ At first, all characters in eight-bit-control are represented by
one-byte sequences which are their 8-bit code.
Next, character composition data are represented by the byte
@@ -589,12 +1665,12 @@ coding_safe_chars (coding_system)
METHOD is 0xF0 plus one of composition method (enum
composition_method),
- BYTES is 0xA0 plus the byte length of these composition data,
+ BYTES is 0xA0 plus a byte length of this composition data,
- CHARS is 0xA0 plus the number of characters composed by these
+ CHARS is 0x20 plus a number of characters composed by this
data,
- COMPONENTs are characters of multibyte form or composition
+ COMPONENTs are characters of multibye form or composition
rules encoded by two-byte of ASCII codes.
In addition, for backward compatibility, the following formats are
@@ -611,596 +1687,601 @@ coding_safe_chars (coding_system)
represents a composition rule.
*/
-enum emacs_code_class_type emacs_code_class[256];
-
-/* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions".
- Check if a text is encoded in Emacs' internal format. If it is,
- return CODING_CATEGORY_MASK_EMACS_MULE, else return 0. */
+char emacs_mule_bytes[256];
-static int
-detect_coding_emacs_mule (src, src_end, multibytep)
- unsigned char *src, *src_end;
- int multibytep;
+int
+emacs_mule_char (coding, src, nbytes, nchars, id)
+ struct coding_system *coding;
+ const unsigned char *src;
+ int *nbytes, *nchars, *id;
{
- unsigned char c;
- int composing = 0;
- /* Dummy for ONE_MORE_BYTE. */
- struct coding_system dummy_coding;
- struct coding_system *coding = &dummy_coding;
+ const unsigned char *src_end = coding->source + coding->src_bytes;
+ const unsigned char *src_base = src;
+ int multibytep = coding->src_multibyte;
+ struct charset *charset;
+ unsigned code;
+ int c;
+ int consumed_chars = 0;
- while (1)
+ ONE_MORE_BYTE (c);
+ if (c < 0)
+ {
+ c = -c;
+ charset = emacs_mule_charset[0];
+ }
+ else
{
- ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep,
- CODING_CATEGORY_MASK_EMACS_MULE);
- if (composing)
+ if (c >= 0xA0)
{
- if (c < 0xA0)
- composing = 0;
- else if (c == 0xA0)
+ /* Old style component character of a compostion. */
+ if (c == 0xA0)
{
- ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, 0);
- c &= 0x7F;
+ ONE_MORE_BYTE (c);
+ c -= 0x80;
}
else
c -= 0x20;
}
- if (c < 0x20)
- {
- if (c == ISO_CODE_ESC || c == ISO_CODE_SI || c == ISO_CODE_SO)
- return 0;
- }
- else if (c >= 0x80 && c < 0xA0)
+ switch (emacs_mule_bytes[c])
{
- if (c == 0x80)
- /* Old leading code for a composite character. */
- composing = 1;
+ case 2:
+ if (! (charset = emacs_mule_charset[c]))
+ goto invalid_code;
+ ONE_MORE_BYTE (c);
+ if (c < 0xA0)
+ goto invalid_code;
+ code = c & 0x7F;
+ break;
+
+ case 3:
+ if (c == EMACS_MULE_LEADING_CODE_PRIVATE_11
+ || c == EMACS_MULE_LEADING_CODE_PRIVATE_12)
+ {
+ ONE_MORE_BYTE (c);
+ if (c < 0xA0 || ! (charset = emacs_mule_charset[c]))
+ goto invalid_code;
+ ONE_MORE_BYTE (c);
+ if (c < 0xA0)
+ goto invalid_code;
+ code = c & 0x7F;
+ }
else
{
- unsigned char *src_base = src - 1;
- int bytes;
-
- if (!UNIBYTE_STR_AS_MULTIBYTE_P (src_base, src_end - src_base,
- bytes))
- return 0;
- src = src_base + bytes;
+ if (! (charset = emacs_mule_charset[c]))
+ goto invalid_code;
+ ONE_MORE_BYTE (c);
+ if (c < 0xA0)
+ goto invalid_code;
+ code = (c & 0x7F) << 8;
+ ONE_MORE_BYTE (c);
+ if (c < 0xA0)
+ goto invalid_code;
+ code |= c & 0x7F;
}
+ break;
+
+ case 4:
+ ONE_MORE_BYTE (c);
+ if (c < 0 || ! (charset = emacs_mule_charset[c]))
+ goto invalid_code;
+ ONE_MORE_BYTE (c);
+ if (c < 0xA0)
+ goto invalid_code;
+ code = (c & 0x7F) << 8;
+ ONE_MORE_BYTE (c);
+ if (c < 0xA0)
+ goto invalid_code;
+ code |= c & 0x7F;
+ break;
+
+ case 1:
+ code = c;
+ charset = CHARSET_FROM_ID (ASCII_BYTE_P (code)
+ ? charset_ascii : charset_eight_bit);
+ break;
+
+ default:
+ abort ();
}
+ c = DECODE_CHAR (charset, code);
+ if (c < 0)
+ goto invalid_code;
}
+ *nbytes = src - src_base;
+ *nchars = consumed_chars;
+ if (id)
+ *id = charset->id;
+ return c;
+
+ no_more_source:
+ return -2;
+
+ invalid_code:
+ return -1;
}
-/* Record the starting position START and METHOD of one composition. */
+/* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions".
+ Check if a text is encoded in `emacs-mule'. If it is, return 1,
+ else return 0. */
-#define CODING_ADD_COMPOSITION_START(coding, start, method) \
- do { \
- struct composition_data *cmp_data = coding->cmp_data; \
- int *data = cmp_data->data + cmp_data->used; \
- coding->cmp_data_start = cmp_data->used; \
- data[0] = -1; \
- data[1] = cmp_data->char_offset + start; \
- data[3] = (int) method; \
- cmp_data->used += 4; \
- } while (0)
+static int
+detect_coding_emacs_mule (coding, detect_info)
+ struct coding_system *coding;
+ struct coding_detection_info *detect_info;
+{
+ const unsigned char *src = coding->source, *src_base;
+ const unsigned char *src_end = coding->source + coding->src_bytes;
+ int multibytep = coding->src_multibyte;
+ int consumed_chars = 0;
+ int c;
+ int found = 0;
-/* Record the ending position END of the current composition. */
+ detect_info->checked |= CATEGORY_MASK_EMACS_MULE;
+ /* A coding system of this category is always ASCII compatible. */
+ src += coding->head_ascii;
-#define CODING_ADD_COMPOSITION_END(coding, end) \
- do { \
- struct composition_data *cmp_data = coding->cmp_data; \
- int *data = cmp_data->data + coding->cmp_data_start; \
- data[0] = cmp_data->used - coding->cmp_data_start; \
- data[2] = cmp_data->char_offset + end; \
- } while (0)
+ while (1)
+ {
+ src_base = src;
+ ONE_MORE_BYTE (c);
+ if (c < 0)
+ continue;
+ if (c == 0x80)
+ {
+ /* Perhaps the start of composite character. We simple skip
+ it because analyzing it is too heavy for detecting. But,
+ at least, we check that the composite character
+ constitues of more than 4 bytes. */
+ const unsigned char *src_base;
-/* Record one COMPONENT (alternate character or composition rule). */
+ repeat:
+ src_base = src;
+ do
+ {
+ ONE_MORE_BYTE (c);
+ }
+ while (c >= 0xA0);
-#define CODING_ADD_COMPOSITION_COMPONENT(coding, component) \
- do { \
- coding->cmp_data->data[coding->cmp_data->used++] = component; \
- if (coding->cmp_data->used - coding->cmp_data_start \
- == COMPOSITION_DATA_MAX_BUNCH_LENGTH) \
- { \
- CODING_ADD_COMPOSITION_END (coding, coding->produced_char); \
- coding->composing = COMPOSITION_NO; \
- } \
- } while (0)
+ if (src - src_base <= 4)
+ break;
+ found = CATEGORY_MASK_EMACS_MULE;
+ if (c == 0x80)
+ goto repeat;
+ }
+ if (c < 0x80)
+ {
+ if (c < 0x20
+ && (c == ISO_CODE_ESC || c == ISO_CODE_SI || c == ISO_CODE_SO))
+ break;
+ }
+ else
+ {
+ int more_bytes = emacs_mule_bytes[*src_base] - 1;
-/* Get one byte from a data pointed by SRC and increment SRC. If SRC
- is not less than SRC_END, return -1 without incrementing Src. */
+ while (more_bytes > 0)
+ {
+ ONE_MORE_BYTE (c);
+ if (c < 0xA0)
+ {
+ src--; /* Unread the last byte. */
+ break;
+ }
+ more_bytes--;
+ }
+ if (more_bytes != 0)
+ break;
+ found = CATEGORY_MASK_EMACS_MULE;
+ }
+ }
+ detect_info->rejected |= CATEGORY_MASK_EMACS_MULE;
+ return 0;
-#define SAFE_ONE_MORE_BYTE() (src >= src_end ? -1 : *src++)
+ no_more_source:
+ if (src_base < src && coding->mode & CODING_MODE_LAST_BLOCK)
+ {
+ detect_info->rejected |= CATEGORY_MASK_EMACS_MULE;
+ return 0;
+ }
+ detect_info->found |= found;
+ return 1;
+}
-/* Decode a character represented as a component of composition
- sequence of Emacs 20 style at SRC. Set C to that character, store
- its multibyte form sequence at P, and set P to the end of that
- sequence. If no valid character is found, set C to -1. */
+/* See the above "GENERAL NOTES on `decode_coding_XXX ()' functions". */
-#define DECODE_EMACS_MULE_COMPOSITION_CHAR(c, p) \
- do { \
- int bytes; \
- \
- c = SAFE_ONE_MORE_BYTE (); \
- if (c < 0) \
- break; \
- if (CHAR_HEAD_P (c)) \
- c = -1; \
- else if (c == 0xA0) \
- { \
- c = SAFE_ONE_MORE_BYTE (); \
- if (c < 0xA0) \
- c = -1; \
- else \
- { \
- c -= 0x80; \
- *p++ = c; \
- } \
- } \
- else if (BASE_LEADING_CODE_P (c - 0x20)) \
- { \
- unsigned char *p0 = p; \
+/* Decode a character represented as a component of composition
+ sequence of Emacs 20/21 style at SRC. Set C to that character and
+ update SRC to the head of next character (or an encoded composition
+ rule). If SRC doesn't points a composition component, set C to -1.
+ If SRC points an invalid byte sequence, global exit by a return
+ value 0. */
+
+#define DECODE_EMACS_MULE_COMPOSITION_CHAR(buf) \
+ if (1) \
+ { \
+ int c; \
+ int nbytes, nchars; \
\
- c -= 0x20; \
- *p++ = c; \
- bytes = BYTES_BY_CHAR_HEAD (c); \
- while (--bytes) \
- { \
- c = SAFE_ONE_MORE_BYTE (); \
- if (c < 0) \
- break; \
- *p++ = c; \
- } \
- if (UNIBYTE_STR_AS_MULTIBYTE_P (p0, p - p0, bytes) \
- || (coding->flags /* We are recovering a file. */ \
- && p0[0] == LEADING_CODE_8_BIT_CONTROL \
- && ! CHAR_HEAD_P (p0[1]))) \
- c = STRING_CHAR (p0, bytes); \
- else \
- c = -1; \
- } \
- else \
- c = -1; \
- } while (0)
+ if (src == src_end) \
+ break; \
+ c = emacs_mule_char (coding, src, &nbytes, &nchars, NULL);\
+ if (c < 0) \
+ { \
+ if (c == -2) \
+ break; \
+ goto invalid_code; \
+ } \
+ *buf++ = c; \
+ src += nbytes; \
+ consumed_chars += nchars; \
+ } \
+ else
/* Decode a composition rule represented as a component of composition
- sequence of Emacs 20 style at SRC. Set C to the rule. If not
- valid rule is found, set C to -1. */
+ sequence of Emacs 20 style at SRC. Store the decoded rule in *BUF,
+ and increment BUF. If SRC points an invalid byte sequence, set C
+ to -1. */
-#define DECODE_EMACS_MULE_COMPOSITION_RULE(c) \
+#define DECODE_EMACS_MULE_COMPOSITION_RULE_20(buf) \
do { \
- c = SAFE_ONE_MORE_BYTE (); \
+ int c, gref, nref; \
+ \
+ if (src >= src_end) \
+ goto invalid_code; \
+ ONE_MORE_BYTE_NO_CHECK (c); \
c -= 0xA0; \
if (c < 0 || c >= 81) \
- c = -1; \
- else \
- { \
- gref = c / 9, nref = c % 9; \
- c = COMPOSITION_ENCODE_RULE (gref, nref); \
- } \
+ goto invalid_code; \
+ \
+ gref = c / 9, nref = c % 9; \
+ *buf++ = COMPOSITION_ENCODE_RULE (gref, nref); \
} while (0)
-/* Decode composition sequence encoded by `emacs-mule' at the source
- pointed by SRC. SRC_END is the end of source. Store information
- of the composition in CODING->cmp_data.
-
- For backward compatibility, decode also a composition sequence of
- Emacs 20 style. In that case, the composition sequence contains
- characters that should be extracted into a buffer or string. Store
- those characters at *DESTINATION in multibyte form.
-
- If we encounter an invalid byte sequence, return 0.
- If we encounter an insufficient source or destination, or
- insufficient space in CODING->cmp_data, return 1.
- Otherwise, return consumed bytes in the source.
+/* Decode a composition rule represented as a component of composition
+ sequence of Emacs 21 style at SRC. Store the decoded rule in *BUF,
+ and increment BUF. If SRC points an invalid byte sequence, set C
+ to -1. */
-*/
-static INLINE int
-decode_composition_emacs_mule (coding, src, src_end,
- destination, dst_end, dst_bytes)
- struct coding_system *coding;
- const unsigned char *src, *src_end;
- unsigned char **destination, *dst_end;
- int dst_bytes;
-{
- unsigned char *dst = *destination;
- int method, data_len, nchars;
- const unsigned char *src_base = src++;
- /* Store components of composition. */
- int component[COMPOSITION_DATA_MAX_BUNCH_LENGTH];
- int ncomponent;
- /* Store multibyte form of characters to be composed. This is for
- Emacs 20 style composition sequence. */
- unsigned char buf[MAX_COMPOSITION_COMPONENTS * MAX_MULTIBYTE_LENGTH];
- unsigned char *bufp = buf;
- int c, i, gref, nref;
+#define DECODE_EMACS_MULE_COMPOSITION_RULE_21(buf) \
+ do { \
+ int gref, nref; \
+ \
+ if (src + 1>= src_end) \
+ goto invalid_code; \
+ ONE_MORE_BYTE_NO_CHECK (gref); \
+ gref -= 0x20; \
+ ONE_MORE_BYTE_NO_CHECK (nref); \
+ nref -= 0x20; \
+ if (gref < 0 || gref >= 81 \
+ || nref < 0 || nref >= 81) \
+ goto invalid_code; \
+ *buf++ = COMPOSITION_ENCODE_RULE (gref, nref); \
+ } while (0)
- if (coding->cmp_data->used + COMPOSITION_DATA_MAX_BUNCH_LENGTH
- >= COMPOSITION_DATA_SIZE)
- {
- coding->result = CODING_FINISH_INSUFFICIENT_CMP;
- return -1;
- }
- ONE_MORE_BYTE (c);
- if (c - 0xF0 >= COMPOSITION_RELATIVE
- && c - 0xF0 <= COMPOSITION_WITH_RULE_ALTCHARS)
- {
- int with_rule;
+#define DECODE_EMACS_MULE_21_COMPOSITION(c) \
+ do { \
+ /* Emacs 21 style format. The first three bytes at SRC are \
+ (METHOD - 0xF2), (BYTES - 0xA0), (CHARS - 0xA0), where BYTES is \
+ the byte length of this composition information, CHARS is the \
+ number of characters composed by this composition. */ \
+ enum composition_method method = c - 0xF2; \
+ int *charbuf_base = charbuf; \
+ int consumed_chars_limit; \
+ int nbytes, nchars; \
+ \
+ ONE_MORE_BYTE (c); \
+ if (c < 0) \
+ goto invalid_code; \
+ nbytes = c - 0xA0; \
+ if (nbytes < 3) \
+ goto invalid_code; \
+ ONE_MORE_BYTE (c); \
+ if (c < 0) \
+ goto invalid_code; \
+ nchars = c - 0xA0; \
+ ADD_COMPOSITION_DATA (charbuf, nchars, method); \
+ consumed_chars_limit = consumed_chars_base + nbytes; \
+ if (method != COMPOSITION_RELATIVE) \
+ { \
+ int i = 0; \
+ while (consumed_chars < consumed_chars_limit) \
+ { \
+ if (i % 2 && method != COMPOSITION_WITH_ALTCHARS) \
+ DECODE_EMACS_MULE_COMPOSITION_RULE_21 (charbuf); \
+ else \
+ DECODE_EMACS_MULE_COMPOSITION_CHAR (charbuf); \
+ i++; \
+ } \
+ if (consumed_chars < consumed_chars_limit) \
+ goto invalid_code; \
+ charbuf_base[0] -= i; \
+ } \
+ } while (0)
- method = c - 0xF0;
- with_rule = (method == COMPOSITION_WITH_RULE
- || method == COMPOSITION_WITH_RULE_ALTCHARS);
- ONE_MORE_BYTE (c);
- data_len = c - 0xA0;
- if (data_len < 4
- || src_base + data_len > src_end)
- return 0;
- ONE_MORE_BYTE (c);
- nchars = c - 0xA0;
- if (c < 1)
- return 0;
- for (ncomponent = 0; src < src_base + data_len; ncomponent++)
- {
- /* If it is longer than this, it can't be valid. */
- if (ncomponent >= COMPOSITION_DATA_MAX_BUNCH_LENGTH)
- return 0;
- if (ncomponent % 2 && with_rule)
- {
- ONE_MORE_BYTE (gref);
- gref -= 32;
- ONE_MORE_BYTE (nref);
- nref -= 32;
- c = COMPOSITION_ENCODE_RULE (gref, nref);
- }
- else
- {
- int bytes;
- if (UNIBYTE_STR_AS_MULTIBYTE_P (src, src_end - src, bytes)
- || (coding->flags /* We are recovering a file. */
- && src[0] == LEADING_CODE_8_BIT_CONTROL
- && ! CHAR_HEAD_P (src[1])))
- c = STRING_CHAR (src, bytes);
- else
- c = *src, bytes = 1;
- src += bytes;
- }
- component[ncomponent] = c;
- }
- }
- else if (c >= 0x80)
- {
- /* This may be an old Emacs 20 style format. See the comment at
- the section 2 of this file. */
- while (src < src_end && !CHAR_HEAD_P (*src)) src++;
- if (src == src_end
- && !(coding->mode & CODING_MODE_LAST_BLOCK))
- goto label_end_of_loop;
+#define DECODE_EMACS_MULE_20_RELATIVE_COMPOSITION(c) \
+ do { \
+ /* Emacs 20 style format for relative composition. */ \
+ /* Store multibyte form of characters to be composed. */ \
+ enum composition_method method = COMPOSITION_RELATIVE; \
+ int components[MAX_COMPOSITION_COMPONENTS * 2 - 1]; \
+ int *buf = components; \
+ int i, j; \
+ \
+ src = src_base; \
+ ONE_MORE_BYTE (c); /* skip 0x80 */ \
+ for (i = 0; *src >= 0xA0 && i < MAX_COMPOSITION_COMPONENTS; i++) \
+ DECODE_EMACS_MULE_COMPOSITION_CHAR (buf); \
+ if (i < 2) \
+ goto invalid_code; \
+ ADD_COMPOSITION_DATA (charbuf, i, method); \
+ for (j = 0; j < i; j++) \
+ *charbuf++ = components[j]; \
+ } while (0)
- src_end = src;
- src = src_base + 1;
- if (c < 0xC0)
- {
- method = COMPOSITION_RELATIVE;
- for (ncomponent = 0; ncomponent < MAX_COMPOSITION_COMPONENTS;)
- {
- DECODE_EMACS_MULE_COMPOSITION_CHAR (c, bufp);
- if (c < 0)
- break;
- component[ncomponent++] = c;
- }
- if (ncomponent < 2)
- return 0;
- nchars = ncomponent;
- }
- else if (c == 0xFF)
- {
- method = COMPOSITION_WITH_RULE;
- src++;
- DECODE_EMACS_MULE_COMPOSITION_CHAR (c, bufp);
- if (c < 0)
- return 0;
- component[0] = c;
- for (ncomponent = 1;
- ncomponent < MAX_COMPOSITION_COMPONENTS * 2 - 1;)
- {
- DECODE_EMACS_MULE_COMPOSITION_RULE (c);
- if (c < 0)
- break;
- component[ncomponent++] = c;
- DECODE_EMACS_MULE_COMPOSITION_CHAR (c, bufp);
- if (c < 0)
- break;
- component[ncomponent++] = c;
- }
- if (ncomponent < 3)
- return 0;
- nchars = (ncomponent + 1) / 2;
- }
- else
- return 0;
- }
- else
- return 0;
- if (buf == bufp || dst + (bufp - buf) <= (dst_bytes ? dst_end : src))
- {
- CODING_ADD_COMPOSITION_START (coding, coding->produced_char, method);
- for (i = 0; i < ncomponent; i++)
- CODING_ADD_COMPOSITION_COMPONENT (coding, component[i]);
- CODING_ADD_COMPOSITION_END (coding, coding->produced_char + nchars);
- if (buf < bufp)
- {
- unsigned char *p = buf;
- EMIT_BYTES (p, bufp);
- *destination += bufp - buf;
- coding->produced_char += nchars;
- }
- return (src - src_base);
- }
- label_end_of_loop:
- return -1;
-}
+#define DECODE_EMACS_MULE_20_RULEBASE_COMPOSITION(c) \
+ do { \
+ /* Emacs 20 style format for rule-base composition. */ \
+ /* Store multibyte form of characters to be composed. */ \
+ enum composition_method method = COMPOSITION_WITH_RULE; \
+ int *charbuf_base = charbuf; \
+ int components[MAX_COMPOSITION_COMPONENTS * 2 - 1]; \
+ int *buf = components; \
+ int i, j; \
+ \
+ DECODE_EMACS_MULE_COMPOSITION_CHAR (buf); \
+ for (i = 1; i < MAX_COMPOSITION_COMPONENTS; i++) \
+ { \
+ if (*src < 0xA0) \
+ break; \
+ DECODE_EMACS_MULE_COMPOSITION_RULE_20 (buf); \
+ DECODE_EMACS_MULE_COMPOSITION_CHAR (buf); \
+ } \
+ if (i <= 1 || (buf - components) % 2 == 0) \
+ goto invalid_code; \
+ if (charbuf + i + (i / 2) + 1 >= charbuf_end) \
+ goto no_more_source; \
+ ADD_COMPOSITION_DATA (charbuf, i, method); \
+ i = i * 2 - 1; \
+ for (j = 0; j < i; j++) \
+ *charbuf++ = components[j]; \
+ charbuf_base[0] -= i; \
+ for (j = 0; j < i; j += 2) \
+ *charbuf++ = components[j]; \
+ } while (0)
-/* See the above "GENERAL NOTES on `decode_coding_XXX ()' functions". */
static void
-decode_coding_emacs_mule (coding, source, destination, src_bytes, dst_bytes)
+decode_coding_emacs_mule (coding)
struct coding_system *coding;
- const unsigned char *source;
- unsigned char *destination;
- int src_bytes, dst_bytes;
{
- const unsigned char *src = source;
- const unsigned char *src_end = source + src_bytes;
- unsigned char *dst = destination;
- unsigned char *dst_end = destination + dst_bytes;
- /* SRC_BASE remembers the start position in source in each loop.
- The loop will be exited when there's not enough source code, or
- when there's not enough destination area to produce a
- character. */
+ const unsigned char *src = coding->source + coding->consumed;
+ const unsigned char *src_end = coding->source + coding->src_bytes;
const unsigned char *src_base;
+ int *charbuf = coding->charbuf + coding->charbuf_used;
+ int *charbuf_end
+ = coding->charbuf + coding->charbuf_size - MAX_ANNOTATION_LENGTH;
+ int consumed_chars = 0, consumed_chars_base;
+ int multibytep = coding->src_multibyte;
+ Lisp_Object attrs, charset_list;
+ int char_offset = coding->produced_char;
+ int last_offset = char_offset;
+ int last_id = charset_ascii;
+
+ CODING_GET_INFO (coding, attrs, charset_list);
- coding->produced_char = 0;
- while ((src_base = src) < src_end)
+ while (1)
{
- unsigned char tmp[MAX_MULTIBYTE_LENGTH];
- const unsigned char *p;
- int bytes;
+ int c;
- if (*src == '\r')
- {
- int c = *src++;
+ src_base = src;
+ consumed_chars_base = consumed_chars;
- if (coding->eol_type == CODING_EOL_CR)
- c = '\n';
- else if (coding->eol_type == CODING_EOL_CRLF)
- {
- ONE_MORE_BYTE (c);
- if (c != '\n')
- {
- src--;
- c = '\r';
- }
- }
- *dst++ = c;
- coding->produced_char++;
- continue;
- }
- else if (*src == '\n')
+ if (charbuf >= charbuf_end)
+ break;
+
+ ONE_MORE_BYTE (c);
+ if (c < 0)
{
- if ((coding->eol_type == CODING_EOL_CR
- || coding->eol_type == CODING_EOL_CRLF)
- && coding->mode & CODING_MODE_INHIBIT_INCONSISTENT_EOL)
- {
- coding->result = CODING_FINISH_INCONSISTENT_EOL;
- goto label_end_of_loop;
- }
- *dst++ = *src++;
- coding->produced_char++;
- continue;
+ *charbuf++ = -c;
+ char_offset++;
}
- else if (*src == 0x80 && coding->cmp_data)
+ else if (c < 0x80)
{
- /* Start of composition data. */
- int consumed = decode_composition_emacs_mule (coding, src, src_end,
- &dst, dst_end,
- dst_bytes);
- if (consumed < 0)
- goto label_end_of_loop;
- else if (consumed > 0)
- {
- src += consumed;
- continue;
- }
- bytes = CHAR_STRING (*src, tmp);
- p = tmp;
- src++;
+ *charbuf++ = c;
+ char_offset++;
}
- else if (UNIBYTE_STR_AS_MULTIBYTE_P (src, src_end - src, bytes)
- || (coding->flags /* We are recovering a file. */
- && src[0] == LEADING_CODE_8_BIT_CONTROL
- && ! CHAR_HEAD_P (src[1])))
+ else if (c == 0x80)
{
- p = src;
- src += bytes;
+ ONE_MORE_BYTE (c);
+ if (c < 0)
+ goto invalid_code;
+ if (c - 0xF2 >= COMPOSITION_RELATIVE
+ && c - 0xF2 <= COMPOSITION_WITH_RULE_ALTCHARS)
+ DECODE_EMACS_MULE_21_COMPOSITION (c);
+ else if (c < 0xC0)
+ DECODE_EMACS_MULE_20_RELATIVE_COMPOSITION (c);
+ else if (c == 0xFF)
+ DECODE_EMACS_MULE_20_RULEBASE_COMPOSITION (c);
+ else
+ goto invalid_code;
}
- else
+ else if (c < 0xA0 && emacs_mule_bytes[c] > 1)
{
- int i, c;
+ int nbytes, nchars;
+ int id;
- bytes = BYTES_BY_CHAR_HEAD (*src);
- src++;
- for (i = 1; i < bytes; i++)
+ src = src_base;
+ consumed_chars = consumed_chars_base;
+ c = emacs_mule_char (coding, src, &nbytes, &nchars, &id);
+ if (c < 0)
{
- ONE_MORE_BYTE (c);
- if (CHAR_HEAD_P (c))
+ if (c == -2)
break;
+ goto invalid_code;
}
- if (i < bytes)
- {
- bytes = CHAR_STRING (*src_base, tmp);
- p = tmp;
- src = src_base + 1;
- }
- else
+ if (last_id != id)
{
- p = src_base;
+ if (last_id != charset_ascii)
+ ADD_CHARSET_DATA (charbuf, char_offset - last_offset, last_id);
+ last_id = id;
+ last_offset = char_offset;
}
+ *charbuf++ = c;
+ src += nbytes;
+ consumed_chars += nchars;
+ char_offset++;
}
- if (dst + bytes >= (dst_bytes ? dst_end : src))
- {
- coding->result = CODING_FINISH_INSUFFICIENT_DST;
- break;
- }
- while (bytes--) *dst++ = *p++;
- coding->produced_char++;
+ else
+ goto invalid_code;
+ continue;
+
+ invalid_code:
+ src = src_base;
+ consumed_chars = consumed_chars_base;
+ ONE_MORE_BYTE (c);
+ *charbuf++ = ASCII_BYTE_P (c) ? c : BYTE8_TO_CHAR (c);
+ char_offset++;
+ coding->errors++;
}
- label_end_of_loop:
- coding->consumed = coding->consumed_char = src_base - source;
- coding->produced = dst - destination;
-}
+ no_more_source:
+ if (last_id != charset_ascii)
+ ADD_CHARSET_DATA (charbuf, char_offset - last_offset, last_id);
+ coding->consumed_char += consumed_chars_base;
+ coding->consumed = src_base - coding->source;
+ coding->charbuf_used = charbuf - coding->charbuf;
+}
-/* Encode composition data stored at DATA into a special byte sequence
- starting by 0x80. Update CODING->cmp_data_start and maybe
- CODING->cmp_data for the next call. */
-
-#define ENCODE_COMPOSITION_EMACS_MULE(coding, data) \
- do { \
- unsigned char buf[1024], *p0 = buf, *p; \
- int len = data[0]; \
- int i; \
- \
- buf[0] = 0x80; \
- buf[1] = 0xF0 + data[3]; /* METHOD */ \
- buf[3] = 0xA0 + (data[2] - data[1]); /* COMPOSED-CHARS */ \
- p = buf + 4; \
- if (data[3] == COMPOSITION_WITH_RULE \
- || data[3] == COMPOSITION_WITH_RULE_ALTCHARS) \
- { \
- p += CHAR_STRING (data[4], p); \
- for (i = 5; i < len; i += 2) \
- { \
- int gref, nref; \
- COMPOSITION_DECODE_RULE (data[i], gref, nref); \
- *p++ = 0x20 + gref; \
- *p++ = 0x20 + nref; \
- p += CHAR_STRING (data[i + 1], p); \
- } \
- } \
- else \
- { \
- for (i = 4; i < len; i++) \
- p += CHAR_STRING (data[i], p); \
- } \
- buf[2] = 0xA0 + (p - buf); /* COMPONENTS-BYTES */ \
- \
- if (dst + (p - buf) + 4 > (dst_bytes ? dst_end : src)) \
- { \
- coding->result = CODING_FINISH_INSUFFICIENT_DST; \
- goto label_end_of_loop; \
- } \
- while (p0 < p) \
- *dst++ = *p0++; \
- coding->cmp_data_start += data[0]; \
- if (coding->cmp_data_start == coding->cmp_data->used \
- && coding->cmp_data->next) \
- { \
- coding->cmp_data = coding->cmp_data->next; \
- coding->cmp_data_start = 0; \
- } \
- } while (0)
+#define EMACS_MULE_LEADING_CODES(id, codes) \
+ do { \
+ if (id < 0xA0) \
+ codes[0] = id, codes[1] = 0; \
+ else if (id < 0xE0) \
+ codes[0] = 0x9A, codes[1] = id; \
+ else if (id < 0xF0) \
+ codes[0] = 0x9B, codes[1] = id; \
+ else if (id < 0xF5) \
+ codes[0] = 0x9C, codes[1] = id; \
+ else \
+ codes[0] = 0x9D, codes[1] = id; \
+ } while (0);
-static void encode_eol P_ ((struct coding_system *, const unsigned char *,
- unsigned char *, int, int));
-static void
-encode_coding_emacs_mule (coding, source, destination, src_bytes, dst_bytes)
+static int
+encode_coding_emacs_mule (coding)
struct coding_system *coding;
- const unsigned char *source;
- unsigned char *destination;
- int src_bytes, dst_bytes;
{
- const unsigned char *src = source;
- const unsigned char *src_end = source + src_bytes;
- unsigned char *dst = destination;
- unsigned char *dst_end = destination + dst_bytes;
- const unsigned char *src_base;
+ int multibytep = coding->dst_multibyte;
+ int *charbuf = coding->charbuf;
+ int *charbuf_end = charbuf + coding->charbuf_used;
+ unsigned char *dst = coding->destination + coding->produced;
+ unsigned char *dst_end = coding->destination + coding->dst_bytes;
+ int safe_room = 8;
+ int produced_chars = 0;
+ Lisp_Object attrs, charset_list;
int c;
- int char_offset;
- int *data;
-
- Lisp_Object translation_table;
+ int preferred_charset_id = -1;
- translation_table = Qnil;
-
- /* Optimization for the case that there's no composition. */
- if (!coding->cmp_data || coding->cmp_data->used == 0)
+ CODING_GET_INFO (coding, attrs, charset_list);
+ if (! EQ (charset_list, Vemacs_mule_charset_list))
{
- encode_eol (coding, source, destination, src_bytes, dst_bytes);
- return;
+ CODING_ATTR_CHARSET_LIST (attrs)
+ = charset_list = Vemacs_mule_charset_list;
}
- char_offset = coding->cmp_data->char_offset;
- data = coding->cmp_data->data + coding->cmp_data_start;
- while (1)
+ while (charbuf < charbuf_end)
{
- src_base = src;
+ ASSURE_DESTINATION (safe_room);
+ c = *charbuf++;
- /* If SRC starts a composition, encode the information about the
- composition in advance. */
- if (coding->cmp_data_start < coding->cmp_data->used
- && char_offset + coding->consumed_char == data[1])
+ if (c < 0)
{
- ENCODE_COMPOSITION_EMACS_MULE (coding, data);
- char_offset = coding->cmp_data->char_offset;
- data = coding->cmp_data->data + coding->cmp_data_start;
+ /* Handle an annotation. */
+ switch (*charbuf)
+ {
+ case CODING_ANNOTATE_COMPOSITION_MASK:
+ /* Not yet implemented. */
+ break;
+ case CODING_ANNOTATE_CHARSET_MASK:
+ preferred_charset_id = charbuf[3];
+ if (preferred_charset_id >= 0
+ && NILP (Fmemq (make_number (preferred_charset_id),
+ charset_list)))
+ preferred_charset_id = -1;
+ break;
+ default:
+ abort ();
+ }
+ charbuf += -c - 1;
+ continue;
}
- ONE_MORE_CHAR (c);
- if (c == '\n' && (coding->eol_type == CODING_EOL_CRLF
- || coding->eol_type == CODING_EOL_CR))
+ if (ASCII_CHAR_P (c))
+ EMIT_ONE_ASCII_BYTE (c);
+ else if (CHAR_BYTE8_P (c))
{
- if (coding->eol_type == CODING_EOL_CRLF)
- EMIT_TWO_BYTES ('\r', c);
- else
- EMIT_ONE_BYTE ('\r');
+ c = CHAR_TO_BYTE8 (c);
+ EMIT_ONE_BYTE (c);
}
- else if (SINGLE_BYTE_CHAR_P (c))
+ else
{
- if (coding->flags && ! ASCII_BYTE_P (c))
- {
- /* As we are auto saving, retain the multibyte form for
- 8-bit chars. */
- unsigned char buf[MAX_MULTIBYTE_LENGTH];
- int bytes = CHAR_STRING (c, buf);
+ struct charset *charset;
+ unsigned code;
+ int dimension;
+ int emacs_mule_id;
+ unsigned char leading_codes[2];
- if (bytes == 1)
- EMIT_ONE_BYTE (buf[0]);
- else
- EMIT_TWO_BYTES (buf[0], buf[1]);
+ if (preferred_charset_id >= 0)
+ {
+ charset = CHARSET_FROM_ID (preferred_charset_id);
+ if (! CHAR_CHARSET_P (c, charset))
+ charset = char_charset (c, charset_list, NULL);
}
else
- EMIT_ONE_BYTE (c);
+ charset = char_charset (c, charset_list, &code);
+ if (! charset)
+ {
+ c = coding->default_char;
+ if (ASCII_CHAR_P (c))
+ {
+ EMIT_ONE_ASCII_BYTE (c);
+ continue;
+ }
+ charset = char_charset (c, charset_list, &code);
+ }
+ dimension = CHARSET_DIMENSION (charset);
+ emacs_mule_id = CHARSET_EMACS_MULE_ID (charset);
+ EMACS_MULE_LEADING_CODES (emacs_mule_id, leading_codes);
+ EMIT_ONE_BYTE (leading_codes[0]);
+ if (leading_codes[1])
+ EMIT_ONE_BYTE (leading_codes[1]);
+ if (dimension == 1)
+ EMIT_ONE_BYTE (code | 0x80);
+ else
+ {
+ code |= 0x8080;
+ EMIT_ONE_BYTE (code >> 8);
+ EMIT_ONE_BYTE (code & 0xFF);
+ }
}
- else
- EMIT_BYTES (src_base, src);
- coding->consumed_char++;
}
- label_end_of_loop:
- coding->consumed = src_base - source;
- coding->produced = coding->produced_char = dst - destination;
- return;
+ record_conversion_result (coding, CODING_RESULT_SUCCESS);
+ coding->produced_char += produced_chars;
+ coding->produced = dst - coding->destination;
+ return 0;
}
-/*** 3. ISO2022 handlers ***/
+/*** 7. ISO2022 handlers ***/
/* The following note describes the coding system ISO2022 briefly.
Since the intention of this note is to help understand the
@@ -1330,7 +2411,7 @@ encode_coding_emacs_mule (coding, source, destination, src_bytes, dst_bytes)
7-bit environment, non-locking-shift, and non-single-shift.
Note (**): If <F> is '@', 'A', or 'B', the intermediate character
- '(' can be omitted. We refer to this as "short-form" hereafter.
+ '(' must be omitted. We refer to this as "short-form" hereafter.
Now you may notice that there are a lot of ways of encoding the
same multilingual text in ISO2022. Actually, there exist many
@@ -1360,10 +2441,10 @@ encode_coding_emacs_mule (coding, source, destination, src_bytes, dst_bytes)
Since these are not standard escape sequences of any ISO standard,
the use of them with these meanings is restricted to Emacs only.
- (*) This form is used only in Emacs 20.5 and older versions,
- but the newer versions can safely decode it.
+ (*) This form is used only in Emacs 20.7 and older versions,
+ but newer versions can safely decode it.
(**) This form is used only in Emacs 21.1 and newer versions,
- and the older versions can't decode it.
+ and older versions can't decode it.
Here's a list of example usages of these composition escape
sequences (categorized by `enum composition_method').
@@ -1379,422 +2460,438 @@ encode_coding_emacs_mule (coding, source, destination, src_bytes, dst_bytes)
enum iso_code_class_type iso_code_class[256];
-#define CHARSET_OK(idx, charset, c) \
- (coding_system_table[idx] \
- && (charset == CHARSET_ASCII \
- || (safe_chars = coding_safe_chars (coding_system_table[idx]->symbol), \
- CODING_SAFE_CHAR_P (safe_chars, c))) \
- && (CODING_SPEC_ISO_REQUESTED_DESIGNATION (coding_system_table[idx], \
- charset) \
- != CODING_SPEC_ISO_NO_REQUESTED_DESIGNATION))
+#define SAFE_CHARSET_P(coding, id) \
+ ((id) <= (coding)->max_charset_id \
+ && (coding)->safe_charsets[id] >= 0)
+
-#define SHIFT_OUT_OK(idx) \
- (CODING_SPEC_ISO_INITIAL_DESIGNATION (coding_system_table[idx], 1) >= 0)
+#define SHIFT_OUT_OK(category) \
+ (CODING_ISO_INITIAL (&coding_categories[category], 1) >= 0)
+
+static void
+setup_iso_safe_charsets (attrs)
+ Lisp_Object attrs;
+{
+ Lisp_Object charset_list, safe_charsets;
+ Lisp_Object request;
+ Lisp_Object reg_usage;
+ Lisp_Object tail;
+ int reg94, reg96;
+ int flags = XINT (AREF (attrs, coding_attr_iso_flags));
+ int max_charset_id;
+
+ charset_list = CODING_ATTR_CHARSET_LIST (attrs);
+ if ((flags & CODING_ISO_FLAG_FULL_SUPPORT)
+ && ! EQ (charset_list, Viso_2022_charset_list))
+ {
+ CODING_ATTR_CHARSET_LIST (attrs)
+ = charset_list = Viso_2022_charset_list;
+ ASET (attrs, coding_attr_safe_charsets, Qnil);
+ }
+
+ if (STRINGP (AREF (attrs, coding_attr_safe_charsets)))
+ return;
+
+ max_charset_id = 0;
+ for (tail = charset_list; CONSP (tail); tail = XCDR (tail))
+ {
+ int id = XINT (XCAR (tail));
+ if (max_charset_id < id)
+ max_charset_id = id;
+ }
+
+ safe_charsets = Fmake_string (make_number (max_charset_id + 1),
+ make_number (255));
+ request = AREF (attrs, coding_attr_iso_request);
+ reg_usage = AREF (attrs, coding_attr_iso_usage);
+ reg94 = XINT (XCAR (reg_usage));
+ reg96 = XINT (XCDR (reg_usage));
+
+ for (tail = charset_list; CONSP (tail); tail = XCDR (tail))
+ {
+ Lisp_Object id;
+ Lisp_Object reg;
+ struct charset *charset;
+
+ id = XCAR (tail);
+ charset = CHARSET_FROM_ID (XINT (id));
+ reg = Fcdr (Fassq (id, request));
+ if (! NILP (reg))
+ SSET (safe_charsets, XINT (id), XINT (reg));
+ else if (charset->iso_chars_96)
+ {
+ if (reg96 < 4)
+ SSET (safe_charsets, XINT (id), reg96);
+ }
+ else
+ {
+ if (reg94 < 4)
+ SSET (safe_charsets, XINT (id), reg94);
+ }
+ }
+ ASET (attrs, coding_attr_safe_charsets, safe_charsets);
+}
-#define COMPOSITION_OK(idx) \
- (coding_system_table[idx]->composing != COMPOSITION_DISABLED)
/* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions".
- Check if a text is encoded in ISO2022. If it is, return an
- integer in which appropriate flag bits any of:
- CODING_CATEGORY_MASK_ISO_7
- CODING_CATEGORY_MASK_ISO_7_TIGHT
- CODING_CATEGORY_MASK_ISO_8_1
- CODING_CATEGORY_MASK_ISO_8_2
- CODING_CATEGORY_MASK_ISO_7_ELSE
- CODING_CATEGORY_MASK_ISO_8_ELSE
- are set. If a code which should never appear in ISO2022 is found,
- returns 0. */
+ Check if a text is encoded in one of ISO-2022 based codig systems.
+ If it is, return 1, else return 0. */
static int
-detect_coding_iso2022 (src, src_end, multibytep)
- unsigned char *src, *src_end;
- int multibytep;
+detect_coding_iso_2022 (coding, detect_info)
+ struct coding_system *coding;
+ struct coding_detection_info *detect_info;
{
- int mask = CODING_CATEGORY_MASK_ISO;
- int mask_found = 0;
- int reg[4], shift_out = 0, single_shifting = 0;
- int c, c1, charset;
- /* Dummy for ONE_MORE_BYTE. */
- struct coding_system dummy_coding;
- struct coding_system *coding = &dummy_coding;
- Lisp_Object safe_chars;
-
- reg[0] = CHARSET_ASCII, reg[1] = reg[2] = reg[3] = -1;
- while (mask)
- {
- ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, mask & mask_found);
- retry:
+ const unsigned char *src = coding->source, *src_base = src;
+ const unsigned char *src_end = coding->source + coding->src_bytes;
+ int multibytep = coding->src_multibyte;
+ int single_shifting = 0;
+ int id;
+ int c, c1;
+ int consumed_chars = 0;
+ int i;
+ int rejected = 0;
+ int found = 0;
+
+ detect_info->checked |= CATEGORY_MASK_ISO;
+
+ for (i = coding_category_iso_7; i <= coding_category_iso_8_else; i++)
+ {
+ struct coding_system *this = &(coding_categories[i]);
+ Lisp_Object attrs, val;
+
+ attrs = CODING_ID_ATTRS (this->id);
+ if (CODING_ISO_FLAGS (this) & CODING_ISO_FLAG_FULL_SUPPORT
+ && ! EQ (CODING_ATTR_SAFE_CHARSETS (attrs), Viso_2022_charset_list))
+ setup_iso_safe_charsets (attrs);
+ val = CODING_ATTR_SAFE_CHARSETS (attrs);
+ this->max_charset_id = SCHARS (val) - 1;
+ this->safe_charsets = (char *) SDATA (val);
+ }
+
+ /* A coding system of this category is always ASCII compatible. */
+ src += coding->head_ascii;
+
+ while (rejected != CATEGORY_MASK_ISO)
+ {
+ src_base = src;
+ ONE_MORE_BYTE (c);
switch (c)
{
case ISO_CODE_ESC:
if (inhibit_iso_escape_detection)
break;
single_shifting = 0;
- ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, mask & mask_found);
+ ONE_MORE_BYTE (c);
if (c >= '(' && c <= '/')
{
/* Designation sequence for a charset of dimension 1. */
- ONE_MORE_BYTE_CHECK_MULTIBYTE (c1, multibytep, mask & mask_found);
+ ONE_MORE_BYTE (c1);
if (c1 < ' ' || c1 >= 0x80
- || (charset = iso_charset_table[0][c >= ','][c1]) < 0)
+ || (id = iso_charset_table[0][c >= ','][c1]) < 0)
/* Invalid designation sequence. Just ignore. */
break;
- reg[(c - '(') % 4] = charset;
}
else if (c == '$')
{
/* Designation sequence for a charset of dimension 2. */
- ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, mask & mask_found);
+ ONE_MORE_BYTE (c);
if (c >= '@' && c <= 'B')
/* Designation for JISX0208.1978, GB2312, or JISX0208. */
- reg[0] = charset = iso_charset_table[1][0][c];
+ id = iso_charset_table[1][0][c];
else if (c >= '(' && c <= '/')
{
- ONE_MORE_BYTE_CHECK_MULTIBYTE (c1, multibytep,
- mask & mask_found);
+ ONE_MORE_BYTE (c1);
if (c1 < ' ' || c1 >= 0x80
- || (charset = iso_charset_table[1][c >= ','][c1]) < 0)
+ || (id = iso_charset_table[1][c >= ','][c1]) < 0)
/* Invalid designation sequence. Just ignore. */
break;
- reg[(c - '(') % 4] = charset;
}
else
- /* Invalid designation sequence. Just ignore. */
+ /* Invalid designation sequence. Just ignore it. */
break;
}
else if (c == 'N' || c == 'O')
{
/* ESC <Fe> for SS2 or SS3. */
- mask &= CODING_CATEGORY_MASK_ISO_7_ELSE;
+ single_shifting = 1;
+ rejected |= CATEGORY_MASK_ISO_7BIT | CATEGORY_MASK_ISO_8BIT;
break;
}
else if (c >= '0' && c <= '4')
{
/* ESC <Fp> for start/end composition. */
- if (COMPOSITION_OK (CODING_CATEGORY_IDX_ISO_7))
- mask_found |= CODING_CATEGORY_MASK_ISO_7;
- else
- mask &= ~CODING_CATEGORY_MASK_ISO_7;
- if (COMPOSITION_OK (CODING_CATEGORY_IDX_ISO_7_TIGHT))
- mask_found |= CODING_CATEGORY_MASK_ISO_7_TIGHT;
- else
- mask &= ~CODING_CATEGORY_MASK_ISO_7_TIGHT;
- if (COMPOSITION_OK (CODING_CATEGORY_IDX_ISO_8_1))
- mask_found |= CODING_CATEGORY_MASK_ISO_8_1;
- else
- mask &= ~CODING_CATEGORY_MASK_ISO_8_1;
- if (COMPOSITION_OK (CODING_CATEGORY_IDX_ISO_8_2))
- mask_found |= CODING_CATEGORY_MASK_ISO_8_2;
- else
- mask &= ~CODING_CATEGORY_MASK_ISO_8_2;
- if (COMPOSITION_OK (CODING_CATEGORY_IDX_ISO_7_ELSE))
- mask_found |= CODING_CATEGORY_MASK_ISO_7_ELSE;
- else
- mask &= ~CODING_CATEGORY_MASK_ISO_7_ELSE;
- if (COMPOSITION_OK (CODING_CATEGORY_IDX_ISO_8_ELSE))
- mask_found |= CODING_CATEGORY_MASK_ISO_8_ELSE;
- else
- mask &= ~CODING_CATEGORY_MASK_ISO_8_ELSE;
+ found |= CATEGORY_MASK_ISO;
break;
}
else
- /* Invalid escape sequence. Just ignore. */
- break;
+ {
+ /* Invalid escape sequence. Just ignore it. */
+ break;
+ }
/* We found a valid designation sequence for CHARSET. */
- mask &= ~CODING_CATEGORY_MASK_ISO_8BIT;
- c = MAKE_CHAR (charset, 0, 0);
- if (CHARSET_OK (CODING_CATEGORY_IDX_ISO_7, charset, c))
- mask_found |= CODING_CATEGORY_MASK_ISO_7;
+ rejected |= CATEGORY_MASK_ISO_8BIT;
+ if (SAFE_CHARSET_P (&coding_categories[coding_category_iso_7],
+ id))
+ found |= CATEGORY_MASK_ISO_7;
else
- mask &= ~CODING_CATEGORY_MASK_ISO_7;
- if (CHARSET_OK (CODING_CATEGORY_IDX_ISO_7_TIGHT, charset, c))
- mask_found |= CODING_CATEGORY_MASK_ISO_7_TIGHT;
+ rejected |= CATEGORY_MASK_ISO_7;
+ if (SAFE_CHARSET_P (&coding_categories[coding_category_iso_7_tight],
+ id))
+ found |= CATEGORY_MASK_ISO_7_TIGHT;
else
- mask &= ~CODING_CATEGORY_MASK_ISO_7_TIGHT;
- if (CHARSET_OK (CODING_CATEGORY_IDX_ISO_7_ELSE, charset, c))
- mask_found |= CODING_CATEGORY_MASK_ISO_7_ELSE;
+ rejected |= CATEGORY_MASK_ISO_7_TIGHT;
+ if (SAFE_CHARSET_P (&coding_categories[coding_category_iso_7_else],
+ id))
+ found |= CATEGORY_MASK_ISO_7_ELSE;
else
- mask &= ~CODING_CATEGORY_MASK_ISO_7_ELSE;
- if (CHARSET_OK (CODING_CATEGORY_IDX_ISO_8_ELSE, charset, c))
- mask_found |= CODING_CATEGORY_MASK_ISO_8_ELSE;
+ rejected |= CATEGORY_MASK_ISO_7_ELSE;
+ if (SAFE_CHARSET_P (&coding_categories[coding_category_iso_8_else],
+ id))
+ found |= CATEGORY_MASK_ISO_8_ELSE;
else
- mask &= ~CODING_CATEGORY_MASK_ISO_8_ELSE;
+ rejected |= CATEGORY_MASK_ISO_8_ELSE;
break;
case ISO_CODE_SO:
- if (inhibit_iso_escape_detection)
- break;
- single_shifting = 0;
- if (shift_out == 0
- && (reg[1] >= 0
- || SHIFT_OUT_OK (CODING_CATEGORY_IDX_ISO_7_ELSE)
- || SHIFT_OUT_OK (CODING_CATEGORY_IDX_ISO_8_ELSE)))
- {
- /* Locking shift out. */
- mask &= ~CODING_CATEGORY_MASK_ISO_7BIT;
- mask_found |= CODING_CATEGORY_MASK_ISO_SHIFT;
- }
- break;
-
case ISO_CODE_SI:
+ /* Locking shift out/in. */
if (inhibit_iso_escape_detection)
break;
single_shifting = 0;
- if (shift_out == 1)
- {
- /* Locking shift in. */
- mask &= ~CODING_CATEGORY_MASK_ISO_7BIT;
- mask_found |= CODING_CATEGORY_MASK_ISO_SHIFT;
- }
+ rejected |= CATEGORY_MASK_ISO_7BIT | CATEGORY_MASK_ISO_8BIT;
break;
case ISO_CODE_CSI:
+ /* Control sequence introducer. */
single_shifting = 0;
+ rejected |= CATEGORY_MASK_ISO_7BIT | CATEGORY_MASK_ISO_7_ELSE;
+ found |= CATEGORY_MASK_ISO_8_ELSE;
+ goto check_extra_latin;
+
case ISO_CODE_SS2:
case ISO_CODE_SS3:
- {
- int newmask = CODING_CATEGORY_MASK_ISO_8_ELSE;
-
- if (inhibit_iso_escape_detection)
- break;
- if (c != ISO_CODE_CSI)
- {
- if (coding_system_table[CODING_CATEGORY_IDX_ISO_8_1]->flags
- & CODING_FLAG_ISO_SINGLE_SHIFT)
- newmask |= CODING_CATEGORY_MASK_ISO_8_1;
- if (coding_system_table[CODING_CATEGORY_IDX_ISO_8_2]->flags
- & CODING_FLAG_ISO_SINGLE_SHIFT)
- newmask |= CODING_CATEGORY_MASK_ISO_8_2;
- single_shifting = 1;
- }
- if (VECTORP (Vlatin_extra_code_table)
- && !NILP (XVECTOR (Vlatin_extra_code_table)->contents[c]))
- {
- if (coding_system_table[CODING_CATEGORY_IDX_ISO_8_1]->flags
- & CODING_FLAG_ISO_LATIN_EXTRA)
- newmask |= CODING_CATEGORY_MASK_ISO_8_1;
- if (coding_system_table[CODING_CATEGORY_IDX_ISO_8_2]->flags
- & CODING_FLAG_ISO_LATIN_EXTRA)
- newmask |= CODING_CATEGORY_MASK_ISO_8_2;
- }
- mask &= newmask;
- mask_found |= newmask;
- }
- break;
+ /* Single shift. */
+ if (inhibit_iso_escape_detection)
+ break;
+ single_shifting = 0;
+ rejected |= CATEGORY_MASK_ISO_7BIT;
+ if (CODING_ISO_FLAGS (&coding_categories[coding_category_iso_8_1])
+ & CODING_ISO_FLAG_SINGLE_SHIFT)
+ found |= CATEGORY_MASK_ISO_8_1, single_shifting = 1;
+ if (CODING_ISO_FLAGS (&coding_categories[coding_category_iso_8_2])
+ & CODING_ISO_FLAG_SINGLE_SHIFT)
+ found |= CATEGORY_MASK_ISO_8_2, single_shifting = 1;
+ if (single_shifting)
+ break;
+ goto check_extra_latin;
default:
+ if (c < 0)
+ continue;
if (c < 0x80)
{
single_shifting = 0;
break;
}
- else if (c < 0xA0)
- {
- single_shifting = 0;
- if (VECTORP (Vlatin_extra_code_table)
- && !NILP (XVECTOR (Vlatin_extra_code_table)->contents[c]))
- {
- int newmask = 0;
-
- if (coding_system_table[CODING_CATEGORY_IDX_ISO_8_1]->flags
- & CODING_FLAG_ISO_LATIN_EXTRA)
- newmask |= CODING_CATEGORY_MASK_ISO_8_1;
- if (coding_system_table[CODING_CATEGORY_IDX_ISO_8_2]->flags
- & CODING_FLAG_ISO_LATIN_EXTRA)
- newmask |= CODING_CATEGORY_MASK_ISO_8_2;
- mask &= newmask;
- mask_found |= newmask;
- }
- else
- return 0;
- }
- else
+ if (c >= 0xA0)
{
- mask &= ~(CODING_CATEGORY_MASK_ISO_7BIT
- | CODING_CATEGORY_MASK_ISO_7_ELSE);
- mask_found |= CODING_CATEGORY_MASK_ISO_8_1;
+ rejected |= CATEGORY_MASK_ISO_7BIT | CATEGORY_MASK_ISO_7_ELSE;
+ found |= CATEGORY_MASK_ISO_8_1;
/* Check the length of succeeding codes of the range
- 0xA0..0FF. If the byte length is odd, we exclude
- CODING_CATEGORY_MASK_ISO_8_2. We can check this only
- when we are not single shifting. */
- if (!single_shifting
- && mask & CODING_CATEGORY_MASK_ISO_8_2)
+ 0xA0..0FF. If the byte length is even, we include
+ CATEGORY_MASK_ISO_8_2 in `found'. We can check this
+ only when we are not single shifting. */
+ if (! single_shifting
+ && ! (rejected & CATEGORY_MASK_ISO_8_2))
{
int i = 1;
-
- c = -1;
while (src < src_end)
{
- ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep,
- mask & mask_found);
+ ONE_MORE_BYTE (c);
if (c < 0xA0)
break;
i++;
}
if (i & 1 && src < src_end)
- mask &= ~CODING_CATEGORY_MASK_ISO_8_2;
+ rejected |= CATEGORY_MASK_ISO_8_2;
else
- mask_found |= CODING_CATEGORY_MASK_ISO_8_2;
- if (c >= 0)
- /* This means that we have read one extra byte. */
- goto retry;
+ found |= CATEGORY_MASK_ISO_8_2;
}
+ break;
}
- break;
+ check_extra_latin:
+ single_shifting = 0;
+ if (! VECTORP (Vlatin_extra_code_table)
+ || NILP (XVECTOR (Vlatin_extra_code_table)->contents[c]))
+ {
+ rejected = CATEGORY_MASK_ISO;
+ break;
+ }
+ if (CODING_ISO_FLAGS (&coding_categories[coding_category_iso_8_1])
+ & CODING_ISO_FLAG_LATIN_EXTRA)
+ found |= CATEGORY_MASK_ISO_8_1;
+ else
+ rejected |= CATEGORY_MASK_ISO_8_1;
+ rejected |= CATEGORY_MASK_ISO_8_2;
}
}
- return (mask & mask_found);
-}
+ detect_info->rejected |= CATEGORY_MASK_ISO;
+ return 0;
-/* Decode a character of which charset is CHARSET, the 1st position
- code is C1, the 2nd position code is C2, and return the decoded
- character code. If the variable `translation_table' is non-nil,
- returned the translated code. */
+ no_more_source:
+ detect_info->rejected |= rejected;
+ detect_info->found |= (found & ~rejected);
+ return 1;
+}
-#define DECODE_ISO_CHARACTER(charset, c1, c2) \
- (NILP (translation_table) \
- ? MAKE_CHAR (charset, c1, c2) \
- : translate_char (translation_table, -1, charset, c1, c2))
-/* Set designation state into CODING. */
-#define DECODE_DESIGNATION(reg, dimension, chars, final_char) \
- do { \
- int charset, c; \
- \
- if (final_char < '0' || final_char >= 128) \
- goto label_invalid_code; \
- charset = ISO_CHARSET_TABLE (make_number (dimension), \
- make_number (chars), \
- make_number (final_char)); \
- c = MAKE_CHAR (charset, 0, 0); \
- if (charset >= 0 \
- && (CODING_SPEC_ISO_REQUESTED_DESIGNATION (coding, charset) == reg \
- || CODING_SAFE_CHAR_P (safe_chars, c))) \
- { \
- if (coding->spec.iso2022.last_invalid_designation_register == 0 \
- && reg == 0 \
- && charset == CHARSET_ASCII) \
- { \
- /* We should insert this designation sequence as is so \
- that it is surely written back to a file. */ \
- coding->spec.iso2022.last_invalid_designation_register = -1; \
- goto label_invalid_code; \
- } \
- coding->spec.iso2022.last_invalid_designation_register = -1; \
- if ((coding->mode & CODING_MODE_DIRECTION) \
- && CHARSET_REVERSE_CHARSET (charset) >= 0) \
- charset = CHARSET_REVERSE_CHARSET (charset); \
- CODING_SPEC_ISO_DESIGNATION (coding, reg) = charset; \
- } \
- else \
- { \
- coding->spec.iso2022.last_invalid_designation_register = reg; \
- goto label_invalid_code; \
- } \
+/* Set designation state into CODING. Set CHARS_96 to -1 if the
+ escape sequence should be kept. */
+#define DECODE_DESIGNATION(reg, dim, chars_96, final) \
+ do { \
+ int id, prev; \
+ \
+ if (final < '0' || final >= 128 \
+ || ((id = ISO_CHARSET_TABLE (dim, chars_96, final)) < 0) \
+ || !SAFE_CHARSET_P (coding, id)) \
+ { \
+ CODING_ISO_DESIGNATION (coding, reg) = -2; \
+ chars_96 = -1; \
+ break; \
+ } \
+ prev = CODING_ISO_DESIGNATION (coding, reg); \
+ if (id == charset_jisx0201_roman) \
+ { \
+ if (CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_USE_ROMAN) \
+ id = charset_ascii; \
+ } \
+ else if (id == charset_jisx0208_1978) \
+ { \
+ if (CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_USE_OLDJIS) \
+ id = charset_jisx0208; \
+ } \
+ CODING_ISO_DESIGNATION (coding, reg) = id; \
+ /* If there was an invalid designation to REG previously, and this \
+ designation is ASCII to REG, we should keep this designation \
+ sequence. */ \
+ if (prev == -2 && id == charset_ascii) \
+ chars_96 = -1; \
} while (0)
-/* Allocate a memory block for storing information about compositions.
- The block is chained to the already allocated blocks. */
-void
-coding_allocate_composition_data (coding, char_offset)
- struct coding_system *coding;
- int char_offset;
-{
- struct composition_data *cmp_data
- = (struct composition_data *) xmalloc (sizeof *cmp_data);
-
- cmp_data->char_offset = char_offset;
- cmp_data->used = 0;
- cmp_data->prev = coding->cmp_data;
- cmp_data->next = NULL;
- if (coding->cmp_data)
- coding->cmp_data->next = cmp_data;
- coding->cmp_data = cmp_data;
- coding->cmp_data_start = 0;
- coding->composing = COMPOSITION_NO;
-}
+#define MAYBE_FINISH_COMPOSITION() \
+ do { \
+ int i; \
+ if (composition_state == COMPOSING_NO) \
+ break; \
+ /* It is assured that we have enough room for producing \
+ characters stored in the table `components'. */ \
+ if (charbuf + component_idx > charbuf_end) \
+ goto no_more_source; \
+ composition_state = COMPOSING_NO; \
+ if (method == COMPOSITION_RELATIVE \
+ || method == COMPOSITION_WITH_ALTCHARS) \
+ { \
+ for (i = 0; i < component_idx; i++) \
+ *charbuf++ = components[i]; \
+ char_offset += component_idx; \
+ } \
+ else \
+ { \
+ for (i = 0; i < component_idx; i += 2) \
+ *charbuf++ = components[i]; \
+ char_offset += (component_idx / 2) + 1; \
+ } \
+ } while (0)
+
/* Handle composition start sequence ESC 0, ESC 2, ESC 3, or ESC 4.
ESC 0 : relative composition : ESC 0 CHAR ... ESC 1
ESC 2 : rulebase composition : ESC 2 CHAR RULE CHAR RULE ... CHAR ESC 1
- ESC 3 : altchar composition : ESC 3 ALT ... ESC 0 CHAR ... ESC 1
- ESC 4 : alt&rule composition : ESC 4 ALT RULE .. ALT ESC 0 CHAR ... ESC 1
+ ESC 3 : altchar composition : ESC 3 CHAR ... ESC 0 CHAR ... ESC 1
+ ESC 4 : alt&rule composition : ESC 4 CHAR RULE ... CHAR ESC 0 CHAR ... ESC 1
*/
-#define DECODE_COMPOSITION_START(c1) \
- do { \
- if (coding->composing == COMPOSITION_DISABLED) \
- { \
- *dst++ = ISO_CODE_ESC; \
- *dst++ = c1 & 0x7f; \
- coding->produced_char += 2; \
- } \
- else if (!COMPOSING_P (coding)) \
- { \
- /* This is surely the start of a composition. We must be sure \
- that coding->cmp_data has enough space to store the \
- information about the composition. If not, terminate the \
- current decoding loop, allocate one more memory block for \
- coding->cmp_data in the caller, then start the decoding \
- loop again. We can't allocate memory here directly because \
- it may cause buffer/string relocation. */ \
- if (!coding->cmp_data \
- || (coding->cmp_data->used + COMPOSITION_DATA_MAX_BUNCH_LENGTH \
- >= COMPOSITION_DATA_SIZE)) \
- { \
- coding->result = CODING_FINISH_INSUFFICIENT_CMP; \
- goto label_end_of_loop; \
- } \
- coding->composing = (c1 == '0' ? COMPOSITION_RELATIVE \
- : c1 == '2' ? COMPOSITION_WITH_RULE \
- : c1 == '3' ? COMPOSITION_WITH_ALTCHARS \
- : COMPOSITION_WITH_RULE_ALTCHARS); \
- CODING_ADD_COMPOSITION_START (coding, coding->produced_char, \
- coding->composing); \
- coding->composition_rule_follows = 0; \
- } \
- else \
- { \
- /* We are already handling a composition. If the method is \
- the following two, the codes following the current escape \
- sequence are actual characters stored in a buffer. */ \
- if (coding->composing == COMPOSITION_WITH_ALTCHARS \
- || coding->composing == COMPOSITION_WITH_RULE_ALTCHARS) \
- { \
- coding->composing = COMPOSITION_RELATIVE; \
- coding->composition_rule_follows = 0; \
- } \
- } \
+#define DECODE_COMPOSITION_START(c1) \
+ do { \
+ if (c1 == '0' \
+ && composition_state == COMPOSING_COMPONENT_RULE) \
+ { \
+ component_len = component_idx; \
+ composition_state = COMPOSING_CHAR; \
+ } \
+ else \
+ { \
+ const unsigned char *p; \
+ \
+ MAYBE_FINISH_COMPOSITION (); \
+ if (charbuf + MAX_COMPOSITION_COMPONENTS > charbuf_end) \
+ goto no_more_source; \
+ for (p = src; p < src_end - 1; p++) \
+ if (*p == ISO_CODE_ESC && p[1] == '1') \
+ break; \
+ if (p == src_end - 1) \
+ { \
+ /* The current composition doesn't end in the current \
+ source. */ \
+ record_conversion_result \
+ (coding, CODING_RESULT_INSUFFICIENT_SRC); \
+ goto no_more_source; \
+ } \
+ \
+ /* This is surely the start of a composition. */ \
+ method = (c1 == '0' ? COMPOSITION_RELATIVE \
+ : c1 == '2' ? COMPOSITION_WITH_RULE \
+ : c1 == '3' ? COMPOSITION_WITH_ALTCHARS \
+ : COMPOSITION_WITH_RULE_ALTCHARS); \
+ composition_state = (c1 <= '2' ? COMPOSING_CHAR \
+ : COMPOSING_COMPONENT_CHAR); \
+ component_idx = component_len = 0; \
+ } \
} while (0)
-/* Handle composition end sequence ESC 1. */
-#define DECODE_COMPOSITION_END(c1) \
+/* Handle compositoin end sequence ESC 1. */
+
+#define DECODE_COMPOSITION_END() \
do { \
- if (! COMPOSING_P (coding)) \
+ int nchars = (component_len > 0 ? component_idx - component_len \
+ : method == COMPOSITION_RELATIVE ? component_idx \
+ : (component_idx + 1) / 2); \
+ int i; \
+ int *saved_charbuf = charbuf; \
+ \
+ ADD_COMPOSITION_DATA (charbuf, nchars, method); \
+ if (method != COMPOSITION_RELATIVE) \
{ \
- *dst++ = ISO_CODE_ESC; \
- *dst++ = c1; \
- coding->produced_char += 2; \
+ if (component_len == 0) \
+ for (i = 0; i < component_idx; i++) \
+ *charbuf++ = components[i]; \
+ else \
+ for (i = 0; i < component_len; i++) \
+ *charbuf++ = components[i]; \
+ *saved_charbuf = saved_charbuf - charbuf; \
} \
+ if (method == COMPOSITION_WITH_RULE) \
+ for (i = 0; i < component_idx; i += 2, char_offset++) \
+ *charbuf++ = components[i]; \
else \
- { \
- CODING_ADD_COMPOSITION_END (coding, coding->produced_char); \
- coding->composing = COMPOSITION_NO; \
- } \
+ for (i = component_len; i < component_idx; i++, char_offset++) \
+ *charbuf++ = components[i]; \
+ coding->annotated = 1; \
+ composition_state = COMPOSING_NO; \
} while (0)
+
/* Decode a composition rule from the byte C1 (and maybe one more byte
from SRC) and store one encoded composition rule in
coding->cmp_data. */
#define DECODE_COMPOSITION_RULE(c1) \
do { \
- int rule = 0; \
(c1) -= 32; \
if (c1 < 81) /* old format (before ver.21) */ \
{ \
@@ -1802,168 +2899,164 @@ coding_allocate_composition_data (coding, char_offset)
int nref = (c1) % 9; \
if (gref == 4) gref = 10; \
if (nref == 4) nref = 10; \
- rule = COMPOSITION_ENCODE_RULE (gref, nref); \
+ c1 = COMPOSITION_ENCODE_RULE (gref, nref); \
} \
else if (c1 < 93) /* new format (after ver.21) */ \
{ \
ONE_MORE_BYTE (c2); \
- rule = COMPOSITION_ENCODE_RULE (c1 - 81, c2 - 32); \
+ c1 = COMPOSITION_ENCODE_RULE (c1 - 81, c2 - 32); \
} \
- CODING_ADD_COMPOSITION_COMPONENT (coding, rule); \
- coding->composition_rule_follows = 0; \
+ else \
+ c1 = 0; \
} while (0)
/* See the above "GENERAL NOTES on `decode_coding_XXX ()' functions". */
static void
-decode_coding_iso2022 (coding, source, destination, src_bytes, dst_bytes)
+decode_coding_iso_2022 (coding)
struct coding_system *coding;
- const unsigned char *source;
- unsigned char *destination;
- int src_bytes, dst_bytes;
{
- const unsigned char *src = source;
- const unsigned char *src_end = source + src_bytes;
- unsigned char *dst = destination;
- unsigned char *dst_end = destination + dst_bytes;
- /* Charsets invoked to graphic plane 0 and 1 respectively. */
- int charset0 = CODING_SPEC_ISO_PLANE_CHARSET (coding, 0);
- int charset1 = CODING_SPEC_ISO_PLANE_CHARSET (coding, 1);
- /* SRC_BASE remembers the start position in source in each loop.
- The loop will be exited when there's not enough source code
- (within macro ONE_MORE_BYTE), or when there's not enough
- destination area to produce a character (within macro
- EMIT_CHAR). */
+ const unsigned char *src = coding->source + coding->consumed;
+ const unsigned char *src_end = coding->source + coding->src_bytes;
const unsigned char *src_base;
- int c, charset;
- Lisp_Object translation_table;
- Lisp_Object safe_chars;
-
- safe_chars = coding_safe_chars (coding->symbol);
-
- if (NILP (Venable_character_translation))
- translation_table = Qnil;
- else
- {
- translation_table = coding->translation_table_for_decode;
- if (NILP (translation_table))
- translation_table = Vstandard_translation_table_for_decode;
- }
-
- coding->result = CODING_FINISH_NORMAL;
+ int *charbuf = coding->charbuf + coding->charbuf_used;
+ int *charbuf_end
+ = coding->charbuf + coding->charbuf_size - 4 - MAX_ANNOTATION_LENGTH;
+ int consumed_chars = 0, consumed_chars_base;
+ int multibytep = coding->src_multibyte;
+ /* Charsets invoked to graphic plane 0 and 1 respectively. */
+ int charset_id_0 = CODING_ISO_INVOKED_CHARSET (coding, 0);
+ int charset_id_1 = CODING_ISO_INVOKED_CHARSET (coding, 1);
+ int charset_id_2, charset_id_3;
+ struct charset *charset;
+ int c;
+ /* For handling composition sequence. */
+#define COMPOSING_NO 0
+#define COMPOSING_CHAR 1
+#define COMPOSING_RULE 2
+#define COMPOSING_COMPONENT_CHAR 3
+#define COMPOSING_COMPONENT_RULE 4
+
+ int composition_state = COMPOSING_NO;
+ enum composition_method method;
+ int components[MAX_COMPOSITION_COMPONENTS * 2 + 1];
+ int component_idx;
+ int component_len;
+ Lisp_Object attrs, charset_list;
+ int char_offset = coding->produced_char;
+ int last_offset = char_offset;
+ int last_id = charset_ascii;
+
+ CODING_GET_INFO (coding, attrs, charset_list);
+ setup_iso_safe_charsets (attrs);
+ /* Charset list may have been changed. */
+ charset_list = CODING_ATTR_CHARSET_LIST (attrs);
+ coding->safe_charsets = (char *) SDATA (CODING_ATTR_SAFE_CHARSETS(attrs));
while (1)
{
- int c1, c2 = 0;
+ int c1, c2;
src_base = src;
+ consumed_chars_base = consumed_chars;
+
+ if (charbuf >= charbuf_end)
+ break;
+
ONE_MORE_BYTE (c1);
+ if (c1 < 0)
+ goto invalid_code;
- /* We produce no character or one character. */
+ /* We produce at most one character. */
switch (iso_code_class [c1])
{
case ISO_0x20_or_0x7F:
- if (COMPOSING_P (coding) && coding->composition_rule_follows)
- {
- DECODE_COMPOSITION_RULE (c1);
- continue;
- }
- if (charset0 < 0 || CHARSET_CHARS (charset0) == 94)
+ if (composition_state != COMPOSING_NO)
{
- /* This is SPACE or DEL. */
- charset = CHARSET_ASCII;
- break;
+ if (composition_state == COMPOSING_RULE
+ || composition_state == COMPOSING_COMPONENT_RULE)
+ {
+ DECODE_COMPOSITION_RULE (c1);
+ components[component_idx++] = c1;
+ composition_state--;
+ continue;
+ }
}
- /* This is a graphic character, we fall down ... */
+ if (charset_id_0 < 0
+ || ! CHARSET_ISO_CHARS_96 (CHARSET_FROM_ID (charset_id_0)))
+ /* This is SPACE or DEL. */
+ charset = CHARSET_FROM_ID (charset_ascii);
+ else
+ charset = CHARSET_FROM_ID (charset_id_0);
+ break;
case ISO_graphic_plane_0:
- if (COMPOSING_P (coding) && coding->composition_rule_follows)
+ if (composition_state != COMPOSING_NO)
{
- DECODE_COMPOSITION_RULE (c1);
- continue;
+ if (composition_state == COMPOSING_RULE
+ || composition_state == COMPOSING_COMPONENT_RULE)
+ {
+ DECODE_COMPOSITION_RULE (c1);
+ components[component_idx++] = c1;
+ composition_state--;
+ continue;
+ }
}
- charset = charset0;
+ if (charset_id_0 < 0)
+ charset = CHARSET_FROM_ID (charset_ascii);
+ else
+ charset = CHARSET_FROM_ID (charset_id_0);
break;
case ISO_0xA0_or_0xFF:
- if (charset1 < 0 || CHARSET_CHARS (charset1) == 94
- || coding->flags & CODING_FLAG_ISO_SEVEN_BITS)
- goto label_invalid_code;
+ if (charset_id_1 < 0
+ || ! CHARSET_ISO_CHARS_96 (CHARSET_FROM_ID (charset_id_1))
+ || CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_SEVEN_BITS)
+ goto invalid_code;
/* This is a graphic character, we fall down ... */
case ISO_graphic_plane_1:
- if (charset1 < 0)
- goto label_invalid_code;
- charset = charset1;
+ if (charset_id_1 < 0)
+ goto invalid_code;
+ charset = CHARSET_FROM_ID (charset_id_1);
break;
case ISO_control_0:
- if (COMPOSING_P (coding))
- DECODE_COMPOSITION_END ('1');
-
- /* All ISO2022 control characters in this class have the
- same representation in Emacs internal format. */
- if (c1 == '\n'
- && (coding->mode & CODING_MODE_INHIBIT_INCONSISTENT_EOL)
- && (coding->eol_type == CODING_EOL_CR
- || coding->eol_type == CODING_EOL_CRLF))
- {
- coding->result = CODING_FINISH_INCONSISTENT_EOL;
- goto label_end_of_loop;
- }
- charset = CHARSET_ASCII;
+ MAYBE_FINISH_COMPOSITION ();
+ charset = CHARSET_FROM_ID (charset_ascii);
break;
case ISO_control_1:
- if (COMPOSING_P (coding))
- DECODE_COMPOSITION_END ('1');
- goto label_invalid_code;
-
- case ISO_carriage_return:
- if (COMPOSING_P (coding))
- DECODE_COMPOSITION_END ('1');
-
- if (coding->eol_type == CODING_EOL_CR)
- c1 = '\n';
- else if (coding->eol_type == CODING_EOL_CRLF)
- {
- ONE_MORE_BYTE (c1);
- if (c1 != ISO_CODE_LF)
- {
- src--;
- c1 = '\r';
- }
- }
- charset = CHARSET_ASCII;
- break;
+ MAYBE_FINISH_COMPOSITION ();
+ goto invalid_code;
case ISO_shift_out:
- if (! (coding->flags & CODING_FLAG_ISO_LOCKING_SHIFT)
- || CODING_SPEC_ISO_DESIGNATION (coding, 1) < 0)
- goto label_invalid_code;
- CODING_SPEC_ISO_INVOCATION (coding, 0) = 1;
- charset0 = CODING_SPEC_ISO_PLANE_CHARSET (coding, 0);
+ if (! (CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_LOCKING_SHIFT)
+ || CODING_ISO_DESIGNATION (coding, 1) < 0)
+ goto invalid_code;
+ CODING_ISO_INVOCATION (coding, 0) = 1;
+ charset_id_0 = CODING_ISO_INVOKED_CHARSET (coding, 0);
continue;
case ISO_shift_in:
- if (! (coding->flags & CODING_FLAG_ISO_LOCKING_SHIFT))
- goto label_invalid_code;
- CODING_SPEC_ISO_INVOCATION (coding, 0) = 0;
- charset0 = CODING_SPEC_ISO_PLANE_CHARSET (coding, 0);
+ if (! (CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_LOCKING_SHIFT))
+ goto invalid_code;
+ CODING_ISO_INVOCATION (coding, 0) = 0;
+ charset_id_0 = CODING_ISO_INVOKED_CHARSET (coding, 0);
continue;
case ISO_single_shift_2_7:
case ISO_single_shift_2:
- if (! (coding->flags & CODING_FLAG_ISO_SINGLE_SHIFT))
- goto label_invalid_code;
+ if (! (CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_SINGLE_SHIFT))
+ goto invalid_code;
/* SS2 is handled as an escape sequence of ESC 'N' */
c1 = 'N';
goto label_escape_sequence;
case ISO_single_shift_3:
- if (! (coding->flags & CODING_FLAG_ISO_SINGLE_SHIFT))
- goto label_invalid_code;
+ if (! (CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_SINGLE_SHIFT))
+ goto invalid_code;
/* SS2 is handled as an escape sequence of ESC 'O' */
c1 = 'O';
goto label_escape_sequence;
@@ -1976,7 +3069,7 @@ decode_coding_iso2022 (coding, source, destination, src_bytes, dst_bytes)
case ISO_escape:
ONE_MORE_BYTE (c1);
label_escape_sequence:
- /* Escape sequences handled by Emacs are invocation,
+ /* Escape sequences handled here are invocation,
designation, direction specification, and character
composition specification. */
switch (c1)
@@ -1984,89 +3077,110 @@ decode_coding_iso2022 (coding, source, destination, src_bytes, dst_bytes)
case '&': /* revision of following character set */
ONE_MORE_BYTE (c1);
if (!(c1 >= '@' && c1 <= '~'))
- goto label_invalid_code;
+ goto invalid_code;
ONE_MORE_BYTE (c1);
if (c1 != ISO_CODE_ESC)
- goto label_invalid_code;
+ goto invalid_code;
ONE_MORE_BYTE (c1);
goto label_escape_sequence;
case '$': /* designation of 2-byte character set */
- if (! (coding->flags & CODING_FLAG_ISO_DESIGNATION))
- goto label_invalid_code;
- ONE_MORE_BYTE (c1);
- if (c1 >= '@' && c1 <= 'B')
- { /* designation of JISX0208.1978, GB2312.1980,
+ if (! (CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_DESIGNATION))
+ goto invalid_code;
+ {
+ int reg, chars96;
+
+ ONE_MORE_BYTE (c1);
+ if (c1 >= '@' && c1 <= 'B')
+ { /* designation of JISX0208.1978, GB2312.1980,
or JISX0208.1980 */
- DECODE_DESIGNATION (0, 2, 94, c1);
- }
- else if (c1 >= 0x28 && c1 <= 0x2B)
- { /* designation of DIMENSION2_CHARS94 character set */
- ONE_MORE_BYTE (c2);
- DECODE_DESIGNATION (c1 - 0x28, 2, 94, c2);
- }
- else if (c1 >= 0x2C && c1 <= 0x2F)
- { /* designation of DIMENSION2_CHARS96 character set */
- ONE_MORE_BYTE (c2);
- DECODE_DESIGNATION (c1 - 0x2C, 2, 96, c2);
- }
- else
- goto label_invalid_code;
- /* We must update these variables now. */
- charset0 = CODING_SPEC_ISO_PLANE_CHARSET (coding, 0);
- charset1 = CODING_SPEC_ISO_PLANE_CHARSET (coding, 1);
+ reg = 0, chars96 = 0;
+ }
+ else if (c1 >= 0x28 && c1 <= 0x2B)
+ { /* designation of DIMENSION2_CHARS94 character set */
+ reg = c1 - 0x28, chars96 = 0;
+ ONE_MORE_BYTE (c1);
+ }
+ else if (c1 >= 0x2C && c1 <= 0x2F)
+ { /* designation of DIMENSION2_CHARS96 character set */
+ reg = c1 - 0x2C, chars96 = 1;
+ ONE_MORE_BYTE (c1);
+ }
+ else
+ goto invalid_code;
+ DECODE_DESIGNATION (reg, 2, chars96, c1);
+ /* We must update these variables now. */
+ if (reg == 0)
+ charset_id_0 = CODING_ISO_INVOKED_CHARSET (coding, 0);
+ else if (reg == 1)
+ charset_id_1 = CODING_ISO_INVOKED_CHARSET (coding, 1);
+ if (chars96 < 0)
+ goto invalid_code;
+ }
continue;
case 'n': /* invocation of locking-shift-2 */
- if (! (coding->flags & CODING_FLAG_ISO_LOCKING_SHIFT)
- || CODING_SPEC_ISO_DESIGNATION (coding, 2) < 0)
- goto label_invalid_code;
- CODING_SPEC_ISO_INVOCATION (coding, 0) = 2;
- charset0 = CODING_SPEC_ISO_PLANE_CHARSET (coding, 0);
+ if (! (CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_LOCKING_SHIFT)
+ || CODING_ISO_DESIGNATION (coding, 2) < 0)
+ goto invalid_code;
+ CODING_ISO_INVOCATION (coding, 0) = 2;
+ charset_id_0 = CODING_ISO_INVOKED_CHARSET (coding, 0);
continue;
case 'o': /* invocation of locking-shift-3 */
- if (! (coding->flags & CODING_FLAG_ISO_LOCKING_SHIFT)
- || CODING_SPEC_ISO_DESIGNATION (coding, 3) < 0)
- goto label_invalid_code;
- CODING_SPEC_ISO_INVOCATION (coding, 0) = 3;
- charset0 = CODING_SPEC_ISO_PLANE_CHARSET (coding, 0);
+ if (! (CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_LOCKING_SHIFT)
+ || CODING_ISO_DESIGNATION (coding, 3) < 0)
+ goto invalid_code;
+ CODING_ISO_INVOCATION (coding, 0) = 3;
+ charset_id_0 = CODING_ISO_INVOKED_CHARSET (coding, 0);
continue;
case 'N': /* invocation of single-shift-2 */
- if (! (coding->flags & CODING_FLAG_ISO_SINGLE_SHIFT)
- || CODING_SPEC_ISO_DESIGNATION (coding, 2) < 0)
- goto label_invalid_code;
- charset = CODING_SPEC_ISO_DESIGNATION (coding, 2);
+ if (! (CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_SINGLE_SHIFT)
+ || CODING_ISO_DESIGNATION (coding, 2) < 0)
+ goto invalid_code;
+ charset_id_2 = CODING_ISO_DESIGNATION (coding, 2);
+ if (charset_id_2 < 0)
+ charset = CHARSET_FROM_ID (charset_ascii);
+ else
+ charset = CHARSET_FROM_ID (charset_id_2);
ONE_MORE_BYTE (c1);
if (c1 < 0x20 || (c1 >= 0x80 && c1 < 0xA0))
- goto label_invalid_code;
+ goto invalid_code;
break;
case 'O': /* invocation of single-shift-3 */
- if (! (coding->flags & CODING_FLAG_ISO_SINGLE_SHIFT)
- || CODING_SPEC_ISO_DESIGNATION (coding, 3) < 0)
- goto label_invalid_code;
- charset = CODING_SPEC_ISO_DESIGNATION (coding, 3);
+ if (! (CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_SINGLE_SHIFT)
+ || CODING_ISO_DESIGNATION (coding, 3) < 0)
+ goto invalid_code;
+ charset_id_3 = CODING_ISO_DESIGNATION (coding, 3);
+ if (charset_id_3 < 0)
+ charset = CHARSET_FROM_ID (charset_ascii);
+ else
+ charset = CHARSET_FROM_ID (charset_id_3);
ONE_MORE_BYTE (c1);
if (c1 < 0x20 || (c1 >= 0x80 && c1 < 0xA0))
- goto label_invalid_code;
+ goto invalid_code;
break;
case '0': case '2': case '3': case '4': /* start composition */
+ if (! (coding->common_flags & CODING_ANNOTATE_COMPOSITION_MASK))
+ goto invalid_code;
DECODE_COMPOSITION_START (c1);
continue;
case '1': /* end composition */
- DECODE_COMPOSITION_END (c1);
+ if (composition_state == COMPOSING_NO)
+ goto invalid_code;
+ DECODE_COMPOSITION_END ();
continue;
case '[': /* specification of direction */
- if (coding->flags & CODING_FLAG_ISO_NO_DIRECTION)
- goto label_invalid_code;
+ if (! CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_DIRECTION)
+ goto invalid_code;
/* For the moment, nested direction is not supported.
So, `coding->mode & CODING_MODE_DIRECTION' zero means
- left-to-right, and nonzero means right-to-left. */
+ left-to-right, and nozero means right-to-left. */
ONE_MORE_BYTE (c1);
switch (c1)
{
@@ -2079,7 +3193,7 @@ decode_coding_iso2022 (coding, source, destination, src_bytes, dst_bytes)
if (c1 == ']')
coding->mode &= ~CODING_MODE_DIRECTION;
else
- goto label_invalid_code;
+ goto invalid_code;
break;
case '2': /* start of right-to-left direction */
@@ -2087,17 +3201,15 @@ decode_coding_iso2022 (coding, source, destination, src_bytes, dst_bytes)
if (c1 == ']')
coding->mode |= CODING_MODE_DIRECTION;
else
- goto label_invalid_code;
+ goto invalid_code;
break;
default:
- goto label_invalid_code;
+ goto invalid_code;
}
continue;
case '%':
- if (COMPOSING_P (coding))
- DECODE_COMPOSITION_END ('1');
ONE_MORE_BYTE (c1);
if (c1 == '/')
{
@@ -2106,46 +3218,40 @@ decode_coding_iso2022 (coding, source, destination, src_bytes, dst_bytes)
We keep these bytes as is for the moment.
They may be decoded by post-read-conversion. */
int dim, M, L;
- int size, required;
- int produced_chars;
+ int size;
ONE_MORE_BYTE (dim);
ONE_MORE_BYTE (M);
ONE_MORE_BYTE (L);
size = ((M - 128) * 128) + (L - 128);
- required = 8 + size * 2;
- if (dst + required > (dst_bytes ? dst_end : src))
- goto label_end_of_loop;
- *dst++ = ISO_CODE_ESC;
- *dst++ = '%';
- *dst++ = '/';
- *dst++ = dim;
- produced_chars = 4;
- dst += CHAR_STRING (M, dst), produced_chars++;
- dst += CHAR_STRING (L, dst), produced_chars++;
+ if (charbuf + 8 + size > charbuf_end)
+ goto break_loop;
+ *charbuf++ = ISO_CODE_ESC;
+ *charbuf++ = '%';
+ *charbuf++ = '/';
+ *charbuf++ = dim;
+ *charbuf++ = BYTE8_TO_CHAR (M);
+ *charbuf++ = BYTE8_TO_CHAR (L);
while (size-- > 0)
{
ONE_MORE_BYTE (c1);
- dst += CHAR_STRING (c1, dst), produced_chars++;
+ *charbuf++ = ASCII_BYTE_P (c1) ? c1 : BYTE8_TO_CHAR (c1);
}
- coding->produced_char += produced_chars;
}
else if (c1 == 'G')
{
- unsigned char *d = dst;
- int produced_chars;
-
/* XFree86 extension for embedding UTF-8 in CTEXT:
ESC % G --UTF-8-BYTES-- ESC % @
We keep these bytes as is for the moment.
They may be decoded by post-read-conversion. */
- if (d + 6 > (dst_bytes ? dst_end : src))
- goto label_end_of_loop;
- *d++ = ISO_CODE_ESC;
- *d++ = '%';
- *d++ = 'G';
- produced_chars = 3;
- while (d + 1 < (dst_bytes ? dst_end : src))
+ int *p = charbuf;
+
+ if (p + 6 > charbuf_end)
+ goto break_loop;
+ *p++ = ISO_CODE_ESC;
+ *p++ = '%';
+ *p++ = 'G';
+ while (p < charbuf_end)
{
ONE_MORE_BYTE (c1);
if (c1 == ISO_CODE_ESC
@@ -2156,71 +3262,128 @@ decode_coding_iso2022 (coding, source, destination, src_bytes, dst_bytes)
src += 2;
break;
}
- d += CHAR_STRING (c1, d), produced_chars++;
+ *p++ = ASCII_BYTE_P (c1) ? c1 : BYTE8_TO_CHAR (c1);
}
- if (d + 3 > (dst_bytes ? dst_end : src))
- goto label_end_of_loop;
- *d++ = ISO_CODE_ESC;
- *d++ = '%';
- *d++ = '@';
- dst = d;
- coding->produced_char += produced_chars + 3;
+ if (p + 3 > charbuf_end)
+ goto break_loop;
+ *p++ = ISO_CODE_ESC;
+ *p++ = '%';
+ *p++ = '@';
+ charbuf = p;
}
else
- goto label_invalid_code;
+ goto invalid_code;
continue;
+ break;
default:
- if (! (coding->flags & CODING_FLAG_ISO_DESIGNATION))
- goto label_invalid_code;
- if (c1 >= 0x28 && c1 <= 0x2B)
- { /* designation of DIMENSION1_CHARS94 character set */
- ONE_MORE_BYTE (c2);
- DECODE_DESIGNATION (c1 - 0x28, 1, 94, c2);
- }
- else if (c1 >= 0x2C && c1 <= 0x2F)
- { /* designation of DIMENSION1_CHARS96 character set */
- ONE_MORE_BYTE (c2);
- DECODE_DESIGNATION (c1 - 0x2C, 1, 96, c2);
- }
- else
- goto label_invalid_code;
- /* We must update these variables now. */
- charset0 = CODING_SPEC_ISO_PLANE_CHARSET (coding, 0);
- charset1 = CODING_SPEC_ISO_PLANE_CHARSET (coding, 1);
+ if (! (CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_DESIGNATION))
+ goto invalid_code;
+ {
+ int reg, chars96;
+
+ if (c1 >= 0x28 && c1 <= 0x2B)
+ { /* designation of DIMENSION1_CHARS94 character set */
+ reg = c1 - 0x28, chars96 = 0;
+ ONE_MORE_BYTE (c1);
+ }
+ else if (c1 >= 0x2C && c1 <= 0x2F)
+ { /* designation of DIMENSION1_CHARS96 character set */
+ reg = c1 - 0x2C, chars96 = 1;
+ ONE_MORE_BYTE (c1);
+ }
+ else
+ goto invalid_code;
+ DECODE_DESIGNATION (reg, 1, chars96, c1);
+ /* We must update these variables now. */
+ if (reg == 0)
+ charset_id_0 = CODING_ISO_INVOKED_CHARSET (coding, 0);
+ else if (reg == 1)
+ charset_id_1 = CODING_ISO_INVOKED_CHARSET (coding, 1);
+ if (chars96 < 0)
+ goto invalid_code;
+ }
continue;
}
}
+ if (charset->id != charset_ascii
+ && last_id != charset->id)
+ {
+ if (last_id != charset_ascii)
+ ADD_CHARSET_DATA (charbuf, char_offset - last_offset, last_id);
+ last_id = charset->id;
+ last_offset = char_offset;
+ }
+
/* Now we know CHARSET and 1st position code C1 of a character.
- Produce a multibyte sequence for that character while getting
- 2nd position code C2 if necessary. */
- if (CHARSET_DIMENSION (charset) == 2)
+ Produce a decoded character while getting 2nd position code
+ C2 if necessary. */
+ c1 &= 0x7F;
+ if (CHARSET_DIMENSION (charset) > 1)
{
ONE_MORE_BYTE (c2);
- if (c1 < 0x80 ? c2 < 0x20 || c2 >= 0x80 : c2 < 0xA0)
+ if (c2 < 0x20 || (c2 >= 0x80 && c2 < 0xA0))
/* C2 is not in a valid range. */
- goto label_invalid_code;
+ goto invalid_code;
+ c1 = (c1 << 8) | (c2 & 0x7F);
+ if (CHARSET_DIMENSION (charset) > 2)
+ {
+ ONE_MORE_BYTE (c2);
+ if (c2 < 0x20 || (c2 >= 0x80 && c2 < 0xA0))
+ /* C2 is not in a valid range. */
+ goto invalid_code;
+ c1 = (c1 << 8) | (c2 & 0x7F);
+ }
+ }
+
+ CODING_DECODE_CHAR (coding, src, src_base, src_end, charset, c1, c);
+ if (c < 0)
+ {
+ MAYBE_FINISH_COMPOSITION ();
+ for (; src_base < src; src_base++, char_offset++)
+ {
+ if (ASCII_BYTE_P (*src_base))
+ *charbuf++ = *src_base;
+ else
+ *charbuf++ = BYTE8_TO_CHAR (*src_base);
+ }
+ }
+ else if (composition_state == COMPOSING_NO)
+ {
+ *charbuf++ = c;
+ char_offset++;
+ }
+ else
+ {
+ components[component_idx++] = c;
+ if (method == COMPOSITION_WITH_RULE
+ || (method == COMPOSITION_WITH_RULE_ALTCHARS
+ && composition_state == COMPOSING_COMPONENT_CHAR))
+ composition_state++;
}
- c = DECODE_ISO_CHARACTER (charset, c1, c2);
- EMIT_CHAR (c);
continue;
- label_invalid_code:
- coding->errors++;
- if (COMPOSING_P (coding))
- DECODE_COMPOSITION_END ('1');
+ invalid_code:
+ MAYBE_FINISH_COMPOSITION ();
src = src_base;
- c = *src++;
- if (! NILP (translation_table))
- c = translate_char (translation_table, c, 0, 0, 0);
- EMIT_CHAR (c);
+ consumed_chars = consumed_chars_base;
+ ONE_MORE_BYTE (c);
+ *charbuf++ = c < 0 ? -c : ASCII_BYTE_P (c) ? c : BYTE8_TO_CHAR (c);
+ char_offset++;
+ coding->errors++;
+ continue;
+
+ break_loop:
+ break;
}
- label_end_of_loop:
- coding->consumed = coding->consumed_char = src_base - source;
- coding->produced = dst - destination;
- return;
+ no_more_source:
+ if (last_id != charset_ascii)
+ ADD_CHARSET_DATA (charbuf, char_offset - last_offset, last_id);
+ coding->consumed_char += consumed_chars_base;
+ coding->consumed = src_base - coding->source;
+ coding->charbuf_used = charbuf - coding->charbuf;
}
@@ -2228,9 +3391,9 @@ decode_coding_iso2022 (coding, source, destination, src_bytes, dst_bytes)
/*
It is not enough to say just "ISO2022" on encoding, we have to
- specify more details. In Emacs, each ISO2022 coding system
+ specify more details. In Emacs, each coding system of ISO2022
variant has the following specifications:
- 1. Initial designation to G0 through G3.
+ 1. Initial designation to G0 thru G3.
2. Allows short-form designation?
3. ASCII should be designated to G0 before control characters?
4. ASCII should be designated to G0 at end of line?
@@ -2240,8 +3403,8 @@ decode_coding_iso2022 (coding, source, destination, src_bytes, dst_bytes)
And the following two are only for Japanese:
8. Use ASCII in place of JIS0201-1976-Roman?
9. Use JISX0208-1983 in place of JISX0208-1978?
- These specifications are encoded in `coding->flags' as flag bits
- defined by macros CODING_FLAG_ISO_XXX. See `coding.h' for more
+ These specifications are encoded in CODING_ISO_FLAGS (coding) as flag bits
+ defined by macros CODING_ISO_FLAG_XXX. See `coding.h' for more
details.
*/
@@ -2252,115 +3415,136 @@ decode_coding_iso2022 (coding, source, destination, src_bytes, dst_bytes)
#define ENCODE_DESIGNATION(charset, reg, coding) \
do { \
- unsigned char final_char = CHARSET_ISO_FINAL_CHAR (charset); \
+ unsigned char final_char = CHARSET_ISO_FINAL (charset); \
char *intermediate_char_94 = "()*+"; \
char *intermediate_char_96 = ",-./"; \
- int revision = CODING_SPEC_ISO_REVISION_NUMBER(coding, charset); \
- \
- if (revision < 255) \
+ int revision = -1; \
+ int c; \
+ \
+ if (CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_REVISION) \
+ revision = CHARSET_ISO_REVISION (charset); \
+ \
+ if (revision >= 0) \
{ \
- *dst++ = ISO_CODE_ESC; \
- *dst++ = '&'; \
- *dst++ = '@' + revision; \
+ EMIT_TWO_ASCII_BYTES (ISO_CODE_ESC, '&'); \
+ EMIT_ONE_BYTE ('@' + revision); \
} \
- *dst++ = ISO_CODE_ESC; \
+ EMIT_ONE_ASCII_BYTE (ISO_CODE_ESC); \
if (CHARSET_DIMENSION (charset) == 1) \
{ \
- if (CHARSET_CHARS (charset) == 94) \
- *dst++ = (unsigned char) (intermediate_char_94[reg]); \
+ if (! CHARSET_ISO_CHARS_96 (charset)) \
+ c = intermediate_char_94[reg]; \
else \
- *dst++ = (unsigned char) (intermediate_char_96[reg]); \
+ c = intermediate_char_96[reg]; \
+ EMIT_ONE_ASCII_BYTE (c); \
} \
else \
{ \
- *dst++ = '$'; \
- if (CHARSET_CHARS (charset) == 94) \
+ EMIT_ONE_ASCII_BYTE ('$'); \
+ if (! CHARSET_ISO_CHARS_96 (charset)) \
{ \
- if (! (coding->flags & CODING_FLAG_ISO_SHORT_FORM) \
+ if (CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_LONG_FORM \
|| reg != 0 \
|| final_char < '@' || final_char > 'B') \
- *dst++ = (unsigned char) (intermediate_char_94[reg]); \
+ EMIT_ONE_ASCII_BYTE (intermediate_char_94[reg]); \
} \
else \
- *dst++ = (unsigned char) (intermediate_char_96[reg]); \
+ EMIT_ONE_ASCII_BYTE (intermediate_char_96[reg]); \
} \
- *dst++ = final_char; \
- CODING_SPEC_ISO_DESIGNATION (coding, reg) = charset; \
+ EMIT_ONE_ASCII_BYTE (final_char); \
+ \
+ CODING_ISO_DESIGNATION (coding, reg) = CHARSET_ID (charset); \
} while (0)
+
/* The following two macros produce codes (control character or escape
sequence) for ISO2022 single-shift functions (single-shift-2 and
single-shift-3). */
-#define ENCODE_SINGLE_SHIFT_2 \
- do { \
- if (coding->flags & CODING_FLAG_ISO_SEVEN_BITS) \
- *dst++ = ISO_CODE_ESC, *dst++ = 'N'; \
- else \
- *dst++ = ISO_CODE_SS2; \
- CODING_SPEC_ISO_SINGLE_SHIFTING (coding) = 1; \
+#define ENCODE_SINGLE_SHIFT_2 \
+ do { \
+ if (CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_SEVEN_BITS) \
+ EMIT_TWO_ASCII_BYTES (ISO_CODE_ESC, 'N'); \
+ else \
+ EMIT_ONE_BYTE (ISO_CODE_SS2); \
+ CODING_ISO_SINGLE_SHIFTING (coding) = 1; \
} while (0)
-#define ENCODE_SINGLE_SHIFT_3 \
- do { \
- if (coding->flags & CODING_FLAG_ISO_SEVEN_BITS) \
- *dst++ = ISO_CODE_ESC, *dst++ = 'O'; \
- else \
- *dst++ = ISO_CODE_SS3; \
- CODING_SPEC_ISO_SINGLE_SHIFTING (coding) = 1; \
+
+#define ENCODE_SINGLE_SHIFT_3 \
+ do { \
+ if (CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_SEVEN_BITS) \
+ EMIT_TWO_ASCII_BYTES (ISO_CODE_ESC, 'O'); \
+ else \
+ EMIT_ONE_BYTE (ISO_CODE_SS3); \
+ CODING_ISO_SINGLE_SHIFTING (coding) = 1; \
} while (0)
+
/* The following four macros produce codes (control character or
escape sequence) for ISO2022 locking-shift functions (shift-in,
shift-out, locking-shift-2, and locking-shift-3). */
-#define ENCODE_SHIFT_IN \
- do { \
- *dst++ = ISO_CODE_SI; \
- CODING_SPEC_ISO_INVOCATION (coding, 0) = 0; \
+#define ENCODE_SHIFT_IN \
+ do { \
+ EMIT_ONE_ASCII_BYTE (ISO_CODE_SI); \
+ CODING_ISO_INVOCATION (coding, 0) = 0; \
} while (0)
-#define ENCODE_SHIFT_OUT \
- do { \
- *dst++ = ISO_CODE_SO; \
- CODING_SPEC_ISO_INVOCATION (coding, 0) = 1; \
+
+#define ENCODE_SHIFT_OUT \
+ do { \
+ EMIT_ONE_ASCII_BYTE (ISO_CODE_SO); \
+ CODING_ISO_INVOCATION (coding, 0) = 1; \
} while (0)
-#define ENCODE_LOCKING_SHIFT_2 \
- do { \
- *dst++ = ISO_CODE_ESC, *dst++ = 'n'; \
- CODING_SPEC_ISO_INVOCATION (coding, 0) = 2; \
+
+#define ENCODE_LOCKING_SHIFT_2 \
+ do { \
+ EMIT_TWO_ASCII_BYTES (ISO_CODE_ESC, 'n'); \
+ CODING_ISO_INVOCATION (coding, 0) = 2; \
} while (0)
-#define ENCODE_LOCKING_SHIFT_3 \
- do { \
- *dst++ = ISO_CODE_ESC, *dst++ = 'o'; \
- CODING_SPEC_ISO_INVOCATION (coding, 0) = 3; \
+
+#define ENCODE_LOCKING_SHIFT_3 \
+ do { \
+ EMIT_TWO_ASCII_BYTES (ISO_CODE_ESC, 'n'); \
+ CODING_ISO_INVOCATION (coding, 0) = 3; \
} while (0)
+
/* Produce codes for a DIMENSION1 character whose character set is
CHARSET and whose position-code is C1. Designation and invocation
sequences are also produced in advance if necessary. */
#define ENCODE_ISO_CHARACTER_DIMENSION1(charset, c1) \
do { \
- if (CODING_SPEC_ISO_SINGLE_SHIFTING (coding)) \
+ int id = CHARSET_ID (charset); \
+ \
+ if ((CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_USE_ROMAN) \
+ && id == charset_ascii) \
{ \
- if (coding->flags & CODING_FLAG_ISO_SEVEN_BITS) \
- *dst++ = c1 & 0x7F; \
+ id = charset_jisx0201_roman; \
+ charset = CHARSET_FROM_ID (id); \
+ } \
+ \
+ if (CODING_ISO_SINGLE_SHIFTING (coding)) \
+ { \
+ if (CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_SEVEN_BITS) \
+ EMIT_ONE_ASCII_BYTE (c1 & 0x7F); \
else \
- *dst++ = c1 | 0x80; \
- CODING_SPEC_ISO_SINGLE_SHIFTING (coding) = 0; \
+ EMIT_ONE_BYTE (c1 | 0x80); \
+ CODING_ISO_SINGLE_SHIFTING (coding) = 0; \
break; \
} \
- else if (charset == CODING_SPEC_ISO_PLANE_CHARSET (coding, 0)) \
+ else if (id == CODING_ISO_INVOKED_CHARSET (coding, 0)) \
{ \
- *dst++ = c1 & 0x7F; \
+ EMIT_ONE_ASCII_BYTE (c1 & 0x7F); \
break; \
} \
- else if (charset == CODING_SPEC_ISO_PLANE_CHARSET (coding, 1)) \
+ else if (id == CODING_ISO_INVOKED_CHARSET (coding, 1)) \
{ \
- *dst++ = c1 | 0x80; \
+ EMIT_ONE_BYTE (c1 | 0x80); \
break; \
} \
else \
@@ -2368,32 +3552,43 @@ decode_coding_iso2022 (coding, source, destination, src_bytes, dst_bytes)
must invoke it, or, at first, designate it to some graphic \
register. Then repeat the loop to actually produce the \
character. */ \
- dst = encode_invocation_designation (charset, coding, dst); \
+ dst = encode_invocation_designation (charset, coding, dst, \
+ &produced_chars); \
} while (1)
+
/* Produce codes for a DIMENSION2 character whose character set is
CHARSET and whose position-codes are C1 and C2. Designation and
invocation codes are also produced in advance if necessary. */
#define ENCODE_ISO_CHARACTER_DIMENSION2(charset, c1, c2) \
do { \
- if (CODING_SPEC_ISO_SINGLE_SHIFTING (coding)) \
+ int id = CHARSET_ID (charset); \
+ \
+ if ((CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_USE_OLDJIS) \
+ && id == charset_jisx0208) \
+ { \
+ id = charset_jisx0208_1978; \
+ charset = CHARSET_FROM_ID (id); \
+ } \
+ \
+ if (CODING_ISO_SINGLE_SHIFTING (coding)) \
{ \
- if (coding->flags & CODING_FLAG_ISO_SEVEN_BITS) \
- *dst++ = c1 & 0x7F, *dst++ = c2 & 0x7F; \
+ if (CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_SEVEN_BITS) \
+ EMIT_TWO_ASCII_BYTES ((c1) & 0x7F, (c2) & 0x7F); \
else \
- *dst++ = c1 | 0x80, *dst++ = c2 | 0x80; \
- CODING_SPEC_ISO_SINGLE_SHIFTING (coding) = 0; \
+ EMIT_TWO_BYTES ((c1) | 0x80, (c2) | 0x80); \
+ CODING_ISO_SINGLE_SHIFTING (coding) = 0; \
break; \
} \
- else if (charset == CODING_SPEC_ISO_PLANE_CHARSET (coding, 0)) \
+ else if (id == CODING_ISO_INVOKED_CHARSET (coding, 0)) \
{ \
- *dst++ = c1 & 0x7F, *dst++= c2 & 0x7F; \
+ EMIT_TWO_ASCII_BYTES ((c1) & 0x7F, (c2) & 0x7F); \
break; \
} \
- else if (charset == CODING_SPEC_ISO_PLANE_CHARSET (coding, 1)) \
+ else if (id == CODING_ISO_INVOKED_CHARSET (coding, 1)) \
{ \
- *dst++ = c1 | 0x80, *dst++= c2 | 0x80; \
+ EMIT_TWO_BYTES ((c1) | 0x80, (c2) | 0x80); \
break; \
} \
else \
@@ -2401,73 +3596,49 @@ decode_coding_iso2022 (coding, source, destination, src_bytes, dst_bytes)
must invoke it, or, at first, designate it to some graphic \
register. Then repeat the loop to actually produce the \
character. */ \
- dst = encode_invocation_designation (charset, coding, dst); \
+ dst = encode_invocation_designation (charset, coding, dst, \
+ &produced_chars); \
} while (1)
-#define ENCODE_ISO_CHARACTER(c) \
- do { \
- int charset, c1, c2; \
- \
- SPLIT_CHAR (c, charset, c1, c2); \
- if (CHARSET_DEFINED_P (charset)) \
- { \
- if (CHARSET_DIMENSION (charset) == 1) \
- { \
- if (charset == CHARSET_ASCII \
- && coding->flags & CODING_FLAG_ISO_USE_ROMAN) \
- charset = charset_latin_jisx0201; \
- ENCODE_ISO_CHARACTER_DIMENSION1 (charset, c1); \
- } \
- else \
- { \
- if (charset == charset_jisx0208 \
- && coding->flags & CODING_FLAG_ISO_USE_OLDJIS) \
- charset = charset_jisx0208_1978; \
- ENCODE_ISO_CHARACTER_DIMENSION2 (charset, c1, c2); \
- } \
- } \
- else \
- { \
- *dst++ = c1; \
- if (c2 >= 0) \
- *dst++ = c2; \
- } \
- } while (0)
-
-
-/* Instead of encoding character C, produce one or two `?'s. */
-#define ENCODE_UNSAFE_CHARACTER(c) \
- do { \
- ENCODE_ISO_CHARACTER (CODING_REPLACEMENT_CHARACTER); \
- if (CHARSET_WIDTH (CHAR_CHARSET (c)) > 1) \
- ENCODE_ISO_CHARACTER (CODING_REPLACEMENT_CHARACTER); \
+#define ENCODE_ISO_CHARACTER(charset, c) \
+ do { \
+ int code = ENCODE_CHAR ((charset),(c)); \
+ \
+ if (CHARSET_DIMENSION (charset) == 1) \
+ ENCODE_ISO_CHARACTER_DIMENSION1 ((charset), code); \
+ else \
+ ENCODE_ISO_CHARACTER_DIMENSION2 ((charset), code >> 8, code & 0xFF); \
} while (0)
/* Produce designation and invocation codes at a place pointed by DST
- to use CHARSET. The element `spec.iso2022' of *CODING is updated.
+ to use CHARSET. The element `spec.iso_2022' of *CODING is updated.
Return new DST. */
unsigned char *
-encode_invocation_designation (charset, coding, dst)
- int charset;
+encode_invocation_designation (charset, coding, dst, p_nchars)
+ struct charset *charset;
struct coding_system *coding;
unsigned char *dst;
+ int *p_nchars;
{
+ int multibytep = coding->dst_multibyte;
+ int produced_chars = *p_nchars;
int reg; /* graphic register number */
+ int id = CHARSET_ID (charset);
/* At first, check designations. */
for (reg = 0; reg < 4; reg++)
- if (charset == CODING_SPEC_ISO_DESIGNATION (coding, reg))
+ if (id == CODING_ISO_DESIGNATION (coding, reg))
break;
if (reg >= 4)
{
/* CHARSET is not yet designated to any graphic registers. */
/* At first check the requested designation. */
- reg = CODING_SPEC_ISO_REQUESTED_DESIGNATION (coding, charset);
- if (reg == CODING_SPEC_ISO_NO_REQUESTED_DESIGNATION)
+ reg = CODING_ISO_REQUEST (coding, id);
+ if (reg < 0)
/* Since CHARSET requests no special designation, designate it
to graphic register 0. */
reg = 0;
@@ -2475,8 +3646,8 @@ encode_invocation_designation (charset, coding, dst)
ENCODE_DESIGNATION (charset, reg, coding);
}
- if (CODING_SPEC_ISO_INVOCATION (coding, 0) != reg
- && CODING_SPEC_ISO_INVOCATION (coding, 1) != reg)
+ if (CODING_ISO_INVOCATION (coding, 0) != reg
+ && CODING_ISO_INVOCATION (coding, 1) != reg)
{
/* Since the graphic register REG is not invoked to any graphic
planes, invoke it to graphic plane 0. */
@@ -2491,14 +3662,14 @@ encode_invocation_designation (charset, coding, dst)
break;
case 2: /* graphic register 2 */
- if (coding->flags & CODING_FLAG_ISO_SINGLE_SHIFT)
+ if (CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_SINGLE_SHIFT)
ENCODE_SINGLE_SHIFT_2;
else
ENCODE_LOCKING_SHIFT_2;
break;
case 3: /* graphic register 3 */
- if (coding->flags & CODING_FLAG_ISO_SINGLE_SHIFT)
+ if (CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_SINGLE_SHIFT)
ENCODE_SINGLE_SHIFT_3;
else
ENCODE_LOCKING_SHIFT_3;
@@ -2506,98 +3677,55 @@ encode_invocation_designation (charset, coding, dst)
}
}
+ *p_nchars = produced_chars;
return dst;
}
-/* Produce 2-byte codes for encoded composition rule RULE. */
-
-#define ENCODE_COMPOSITION_RULE(rule) \
- do { \
- int gref, nref; \
- COMPOSITION_DECODE_RULE (rule, gref, nref); \
- *dst++ = 32 + 81 + gref; \
- *dst++ = 32 + nref; \
- } while (0)
-
-/* Produce codes for indicating the start of a composition sequence
- (ESC 0, ESC 3, or ESC 4). DATA points to an array of integers
- which specify information about the composition. See the comment
- in coding.h for the format of DATA. */
-
-#define ENCODE_COMPOSITION_START(coding, data) \
+/* The following three macros produce codes for indicating direction
+ of text. */
+#define ENCODE_CONTROL_SEQUENCE_INTRODUCER \
do { \
- coding->composing = data[3]; \
- *dst++ = ISO_CODE_ESC; \
- if (coding->composing == COMPOSITION_RELATIVE) \
- *dst++ = '0'; \
+ if (CODING_ISO_FLAGS (coding) == CODING_ISO_FLAG_SEVEN_BITS) \
+ EMIT_TWO_ASCII_BYTES (ISO_CODE_ESC, '['); \
else \
- { \
- *dst++ = (coding->composing == COMPOSITION_WITH_ALTCHARS \
- ? '3' : '4'); \
- coding->cmp_data_index = coding->cmp_data_start + 4; \
- coding->composition_rule_follows = 0; \
- } \
+ EMIT_ONE_BYTE (ISO_CODE_CSI); \
} while (0)
-/* Produce codes for indicating the end of the current composition. */
-#define ENCODE_COMPOSITION_END(coding, data) \
- do { \
- *dst++ = ISO_CODE_ESC; \
- *dst++ = '1'; \
- coding->cmp_data_start += data[0]; \
- coding->composing = COMPOSITION_NO; \
- if (coding->cmp_data_start == coding->cmp_data->used \
- && coding->cmp_data->next) \
- { \
- coding->cmp_data = coding->cmp_data->next; \
- coding->cmp_data_start = 0; \
- } \
+#define ENCODE_DIRECTION_R2L() \
+ do { \
+ ENCODE_CONTROL_SEQUENCE_INTRODUCER (dst); \
+ EMIT_TWO_ASCII_BYTES ('2', ']'); \
} while (0)
-/* Produce composition start sequence ESC 0. Here, this sequence
- doesn't mean the start of a new composition but means that we have
- just produced components (alternate chars and composition rules) of
- the composition and the actual text follows in SRC. */
-#define ENCODE_COMPOSITION_FAKE_START(coding) \
+#define ENCODE_DIRECTION_L2R() \
do { \
- *dst++ = ISO_CODE_ESC; \
- *dst++ = '0'; \
- coding->composing = COMPOSITION_RELATIVE; \
+ ENCODE_CONTROL_SEQUENCE_INTRODUCER (dst); \
+ EMIT_TWO_ASCII_BYTES ('0', ']'); \
} while (0)
-/* The following three macros produce codes for indicating direction
- of text. */
-#define ENCODE_CONTROL_SEQUENCE_INTRODUCER \
- do { \
- if (coding->flags == CODING_FLAG_ISO_SEVEN_BITS) \
- *dst++ = ISO_CODE_ESC, *dst++ = '['; \
- else \
- *dst++ = ISO_CODE_CSI; \
- } while (0)
-
-#define ENCODE_DIRECTION_R2L \
- ENCODE_CONTROL_SEQUENCE_INTRODUCER (dst), *dst++ = '2', *dst++ = ']'
-
-#define ENCODE_DIRECTION_L2R \
- ENCODE_CONTROL_SEQUENCE_INTRODUCER (dst), *dst++ = '0', *dst++ = ']'
/* Produce codes for designation and invocation to reset the graphic
planes and registers to initial state. */
-#define ENCODE_RESET_PLANE_AND_REGISTER \
- do { \
- int reg; \
- if (CODING_SPEC_ISO_INVOCATION (coding, 0) != 0) \
- ENCODE_SHIFT_IN; \
- for (reg = 0; reg < 4; reg++) \
- if (CODING_SPEC_ISO_INITIAL_DESIGNATION (coding, reg) >= 0 \
- && (CODING_SPEC_ISO_DESIGNATION (coding, reg) \
- != CODING_SPEC_ISO_INITIAL_DESIGNATION (coding, reg))) \
- ENCODE_DESIGNATION \
- (CODING_SPEC_ISO_INITIAL_DESIGNATION (coding, reg), reg, coding); \
+#define ENCODE_RESET_PLANE_AND_REGISTER() \
+ do { \
+ int reg; \
+ struct charset *charset; \
+ \
+ if (CODING_ISO_INVOCATION (coding, 0) != 0) \
+ ENCODE_SHIFT_IN; \
+ for (reg = 0; reg < 4; reg++) \
+ if (CODING_ISO_INITIAL (coding, reg) >= 0 \
+ && (CODING_ISO_DESIGNATION (coding, reg) \
+ != CODING_ISO_INITIAL (coding, reg))) \
+ { \
+ charset = CHARSET_FROM_ID (CODING_ISO_INITIAL (coding, reg)); \
+ ENCODE_DESIGNATION (charset, reg, coding); \
+ } \
} while (0)
+
/* Produce designation sequences of charsets in the line started from
SRC to a place pointed by DST, and return updated DST.
@@ -2605,41 +3733,51 @@ encode_invocation_designation (charset, coding, dst)
find all the necessary designations. */
static unsigned char *
-encode_designation_at_bol (coding, translation_table, src, src_end, dst)
+encode_designation_at_bol (coding, charbuf, charbuf_end, dst)
struct coding_system *coding;
- Lisp_Object translation_table;
- const unsigned char *src, *src_end;
+ int *charbuf, *charbuf_end;
unsigned char *dst;
{
- int charset, c, found = 0, reg;
+ struct charset *charset;
/* Table of charsets to be designated to each graphic register. */
int r[4];
+ int c, found = 0, reg;
+ int produced_chars = 0;
+ int multibytep = coding->dst_multibyte;
+ Lisp_Object attrs;
+ Lisp_Object charset_list;
+
+ attrs = CODING_ID_ATTRS (coding->id);
+ charset_list = CODING_ATTR_CHARSET_LIST (attrs);
+ if (EQ (charset_list, Qiso_2022))
+ charset_list = Viso_2022_charset_list;
for (reg = 0; reg < 4; reg++)
r[reg] = -1;
while (found < 4)
{
- ONE_MORE_CHAR (c);
+ int id;
+
+ c = *charbuf++;
if (c == '\n')
break;
-
- charset = CHAR_CHARSET (c);
- reg = CODING_SPEC_ISO_REQUESTED_DESIGNATION (coding, charset);
- if (reg != CODING_SPEC_ISO_NO_REQUESTED_DESIGNATION && r[reg] < 0)
+ charset = char_charset (c, charset_list, NULL);
+ id = CHARSET_ID (charset);
+ reg = CODING_ISO_REQUEST (coding, id);
+ if (reg >= 0 && r[reg] < 0)
{
found++;
- r[reg] = charset;
+ r[reg] = id;
}
}
- label_end_of_loop:
if (found)
{
for (reg = 0; reg < 4; reg++)
if (r[reg] >= 0
- && CODING_SPEC_ISO_DESIGNATION (coding, reg) != r[reg])
- ENCODE_DESIGNATION (r[reg], reg, coding);
+ && CODING_ISO_DESIGNATION (coding, reg) != r[reg])
+ ENCODE_DESIGNATION (CHARSET_FROM_ID (r[reg]), reg, coding);
}
return dst;
@@ -2647,188 +3785,160 @@ encode_designation_at_bol (coding, translation_table, src, src_end, dst)
/* See the above "GENERAL NOTES on `encode_coding_XXX ()' functions". */
-static void
-encode_coding_iso2022 (coding, source, destination, src_bytes, dst_bytes)
+static int
+encode_coding_iso_2022 (coding)
struct coding_system *coding;
- const unsigned char *source;
- unsigned char *destination;
- int src_bytes, dst_bytes;
{
- const unsigned char *src = source;
- const unsigned char *src_end = source + src_bytes;
- unsigned char *dst = destination;
- unsigned char *dst_end = destination + dst_bytes;
- /* Since the maximum bytes produced by each loop is 20, we subtract 19
- from DST_END to assure overflow checking is necessary only at the
- head of loop. */
- unsigned char *adjusted_dst_end = dst_end - 19;
- /* SRC_BASE remembers the start position in source in each loop.
- The loop will be exited when there's not enough source text to
- analyze multi-byte codes (within macro ONE_MORE_CHAR), or when
- there's not enough destination area to produce encoded codes
- (within macro EMIT_BYTES). */
- const unsigned char *src_base;
+ int multibytep = coding->dst_multibyte;
+ int *charbuf = coding->charbuf;
+ int *charbuf_end = charbuf + coding->charbuf_used;
+ unsigned char *dst = coding->destination + coding->produced;
+ unsigned char *dst_end = coding->destination + coding->dst_bytes;
+ int safe_room = 16;
+ int bol_designation
+ = (CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_DESIGNATE_AT_BOL
+ && CODING_ISO_BOL (coding));
+ int produced_chars = 0;
+ Lisp_Object attrs, eol_type, charset_list;
+ int ascii_compatible;
int c;
- Lisp_Object translation_table;
- Lisp_Object safe_chars;
+ int preferred_charset_id = -1;
- if (coding->flags & CODING_FLAG_ISO_SAFE)
- coding->mode |= CODING_MODE_INHIBIT_UNENCODABLE_CHAR;
+ CODING_GET_INFO (coding, attrs, charset_list);
+ eol_type = CODING_ID_EOL_TYPE (coding->id);
+ if (VECTORP (eol_type))
+ eol_type = Qunix;
- safe_chars = coding_safe_chars (coding->symbol);
+ setup_iso_safe_charsets (attrs);
+ /* Charset list may have been changed. */
+ charset_list = CODING_ATTR_CHARSET_LIST (attrs);
+ coding->safe_charsets = (char *) SDATA (CODING_ATTR_SAFE_CHARSETS(attrs));
- if (NILP (Venable_character_translation))
- translation_table = Qnil;
- else
- {
- translation_table = coding->translation_table_for_encode;
- if (NILP (translation_table))
- translation_table = Vstandard_translation_table_for_encode;
- }
+ ascii_compatible = ! NILP (CODING_ATTR_ASCII_COMPAT (attrs));
- coding->consumed_char = 0;
- coding->errors = 0;
- while (1)
+ while (charbuf < charbuf_end)
{
- src_base = src;
+ ASSURE_DESTINATION (safe_room);
- if (dst >= (dst_bytes ? adjusted_dst_end : (src - 19)))
+ if (bol_designation)
{
- coding->result = CODING_FINISH_INSUFFICIENT_DST;
- break;
- }
+ unsigned char *dst_prev = dst;
- if (coding->flags & CODING_FLAG_ISO_DESIGNATE_AT_BOL
- && CODING_SPEC_ISO_BOL (coding))
- {
/* We have to produce designation sequences if any now. */
- dst = encode_designation_at_bol (coding, translation_table,
- src, src_end, dst);
- CODING_SPEC_ISO_BOL (coding) = 0;
+ dst = encode_designation_at_bol (coding, charbuf, charbuf_end, dst);
+ bol_designation = 0;
+ /* We are sure that designation sequences are all ASCII bytes. */
+ produced_chars += dst - dst_prev;
}
- /* Check composition start and end. */
- if (coding->composing != COMPOSITION_DISABLED
- && coding->cmp_data_start < coding->cmp_data->used)
- {
- struct composition_data *cmp_data = coding->cmp_data;
- int *data = cmp_data->data + coding->cmp_data_start;
- int this_pos = cmp_data->char_offset + coding->consumed_char;
+ c = *charbuf++;
- if (coding->composing == COMPOSITION_RELATIVE)
- {
- if (this_pos == data[2])
- {
- ENCODE_COMPOSITION_END (coding, data);
- cmp_data = coding->cmp_data;
- data = cmp_data->data + coding->cmp_data_start;
- }
- }
- else if (COMPOSING_P (coding))
- {
- /* COMPOSITION_WITH_ALTCHARS or COMPOSITION_WITH_RULE_ALTCHAR */
- if (coding->cmp_data_index == coding->cmp_data_start + data[0])
- /* We have consumed components of the composition.
- What follows in SRC is the composition's base
- text. */
- ENCODE_COMPOSITION_FAKE_START (coding);
- else
- {
- int c = cmp_data->data[coding->cmp_data_index++];
- if (coding->composition_rule_follows)
- {
- ENCODE_COMPOSITION_RULE (c);
- coding->composition_rule_follows = 0;
- }
- else
- {
- if (coding->mode & CODING_MODE_INHIBIT_UNENCODABLE_CHAR
- && ! CODING_SAFE_CHAR_P (safe_chars, c))
- ENCODE_UNSAFE_CHARACTER (c);
- else
- ENCODE_ISO_CHARACTER (c);
- if (coding->composing == COMPOSITION_WITH_RULE_ALTCHARS)
- coding->composition_rule_follows = 1;
- }
- continue;
- }
- }
- if (!COMPOSING_P (coding))
+ if (c < 0)
+ {
+ /* Handle an annotation. */
+ switch (*charbuf)
{
- if (this_pos == data[1])
- {
- ENCODE_COMPOSITION_START (coding, data);
- continue;
- }
+ case CODING_ANNOTATE_COMPOSITION_MASK:
+ /* Not yet implemented. */
+ break;
+ case CODING_ANNOTATE_CHARSET_MASK:
+ preferred_charset_id = charbuf[2];
+ if (preferred_charset_id >= 0
+ && NILP (Fmemq (make_number (preferred_charset_id),
+ charset_list)))
+ preferred_charset_id = -1;
+ break;
+ default:
+ abort ();
}
+ charbuf += -c - 1;
+ continue;
}
- ONE_MORE_CHAR (c);
-
/* Now encode the character C. */
if (c < 0x20 || c == 0x7F)
{
- if (c == '\r')
+ if (c == '\n'
+ || (c == '\r' && EQ (eol_type, Qmac)))
{
- if (! (coding->mode & CODING_MODE_SELECTIVE_DISPLAY))
+ if (CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_RESET_AT_EOL)
+ ENCODE_RESET_PLANE_AND_REGISTER ();
+ if (CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_INIT_AT_BOL)
{
- if (coding->flags & CODING_FLAG_ISO_RESET_AT_CNTL)
- ENCODE_RESET_PLANE_AND_REGISTER;
- *dst++ = c;
- continue;
+ int i;
+
+ for (i = 0; i < 4; i++)
+ CODING_ISO_DESIGNATION (coding, i)
+ = CODING_ISO_INITIAL (coding, i);
}
- /* fall down to treat '\r' as '\n' ... */
- c = '\n';
- }
- if (c == '\n')
- {
- if (coding->flags & CODING_FLAG_ISO_RESET_AT_EOL)
- ENCODE_RESET_PLANE_AND_REGISTER;
- if (coding->flags & CODING_FLAG_ISO_INIT_AT_BOL)
- bcopy (coding->spec.iso2022.initial_designation,
- coding->spec.iso2022.current_designation,
- sizeof coding->spec.iso2022.initial_designation);
- if (coding->eol_type == CODING_EOL_LF
- || coding->eol_type == CODING_EOL_UNDECIDED)
- *dst++ = ISO_CODE_LF;
- else if (coding->eol_type == CODING_EOL_CRLF)
- *dst++ = ISO_CODE_CR, *dst++ = ISO_CODE_LF;
- else
- *dst++ = ISO_CODE_CR;
- CODING_SPEC_ISO_BOL (coding) = 1;
+ bol_designation
+ = CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_DESIGNATE_AT_BOL;
}
+ else if (CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_RESET_AT_CNTL)
+ ENCODE_RESET_PLANE_AND_REGISTER ();
+ EMIT_ONE_ASCII_BYTE (c);
+ }
+ else if (ASCII_CHAR_P (c))
+ {
+ if (ascii_compatible)
+ EMIT_ONE_ASCII_BYTE (c);
else
{
- if (coding->flags & CODING_FLAG_ISO_RESET_AT_CNTL)
- ENCODE_RESET_PLANE_AND_REGISTER;
- *dst++ = c;
+ struct charset *charset = CHARSET_FROM_ID (charset_ascii);
+ ENCODE_ISO_CHARACTER (charset, c);
}
}
- else if (ASCII_BYTE_P (c))
- ENCODE_ISO_CHARACTER (c);
- else if (SINGLE_BYTE_CHAR_P (c))
+ else if (CHAR_BYTE8_P (c))
{
- *dst++ = c;
- coding->errors++;
+ c = CHAR_TO_BYTE8 (c);
+ EMIT_ONE_BYTE (c);
}
- else if (coding->mode & CODING_MODE_INHIBIT_UNENCODABLE_CHAR
- && ! CODING_SAFE_CHAR_P (safe_chars, c))
- ENCODE_UNSAFE_CHARACTER (c);
else
- ENCODE_ISO_CHARACTER (c);
+ {
+ struct charset *charset;
- coding->consumed_char++;
+ if (preferred_charset_id >= 0)
+ {
+ charset = CHARSET_FROM_ID (preferred_charset_id);
+ if (! CHAR_CHARSET_P (c, charset))
+ charset = char_charset (c, charset_list, NULL);
+ }
+ else
+ charset = char_charset (c, charset_list, NULL);
+ if (!charset)
+ {
+ if (coding->mode & CODING_MODE_SAFE_ENCODING)
+ {
+ c = CODING_INHIBIT_CHARACTER_SUBSTITUTION;
+ charset = CHARSET_FROM_ID (charset_ascii);
+ }
+ else
+ {
+ c = coding->default_char;
+ charset = char_charset (c, charset_list, NULL);
+ }
+ }
+ ENCODE_ISO_CHARACTER (charset, c);
+ }
}
- label_end_of_loop:
- coding->consumed = src_base - source;
- coding->produced = coding->produced_char = dst - destination;
+ if (coding->mode & CODING_MODE_LAST_BLOCK
+ && CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_RESET_AT_EOL)
+ {
+ ASSURE_DESTINATION (safe_room);
+ ENCODE_RESET_PLANE_AND_REGISTER ();
+ }
+ record_conversion_result (coding, CODING_RESULT_SUCCESS);
+ CODING_ISO_BOL (coding) = bol_designation;
+ coding->produced_char += produced_chars;
+ coding->produced = dst - coding->destination;
+ return 0;
}
-/*** 4. SJIS and BIG5 handlers ***/
+/*** 8,9. SJIS and BIG5 handlers ***/
-/* Although SJIS and BIG5 are not ISO coding systems, they are used
+/* Although SJIS and BIG5 are not ISO's coding system, they are used
quite widely. So, for the moment, Emacs supports them in the bare
C code. But, in the future, they may be supported only by CCL. */
@@ -2837,12 +3947,12 @@ encode_coding_iso2022 (coding, source, destination, src_bytes, dst_bytes)
as is. A character of charset katakana-jisx0201 is encoded by
"position-code + 0x80". A character of charset japanese-jisx0208
is encoded in 2-byte but two position-codes are divided and shifted
- so that it fits in the range below.
+ so that it fit in the range below.
--- CODE RANGE of SJIS ---
(character set) (range)
ASCII 0x00 .. 0x7F
- KATAKANA-JISX0201 0xA1 .. 0xDF
+ KATAKANA-JISX0201 0xA0 .. 0xDF
JISX0208 (1st byte) 0x81 .. 0x9F and 0xE0 .. 0xEF
(2nd byte) 0x40 .. 0x7E and 0x80 .. 0xFC
-------------------------------
@@ -2851,7 +3961,7 @@ encode_coding_iso2022 (coding, source, destination, src_bytes, dst_bytes)
/* BIG5 is a coding system encoding two character sets: ASCII and
Big5. An ASCII character is encoded as is. Big5 is a two-byte
- character set and is encoded in two bytes.
+ character set and is encoded in two-byte.
--- CODE RANGE of BIG5 ---
(character set) (range)
@@ -2860,307 +3970,293 @@ encode_coding_iso2022 (coding, source, destination, src_bytes, dst_bytes)
(2nd byte) 0x40 .. 0x7E and 0xA1 .. 0xFE
--------------------------
- Since the number of characters in Big5 is larger than maximum
- characters in Emacs' charset (96x96), it can't be handled as one
- charset. So, in Emacs, Big5 is divided into two: `charset-big5-1'
- and `charset-big5-2'. Both are DIMENSION2 and CHARS94. The former
- contains frequently used characters and the latter contains less
- frequently used characters. */
-
-/* Macros to decode or encode a character of Big5 in BIG5. B1 and B2
- are the 1st and 2nd position-codes of Big5 in BIG5 coding system.
- C1 and C2 are the 1st and 2nd position-codes of Emacs' internal
- format. CHARSET is `charset_big5_1' or `charset_big5_2'. */
-
-/* Number of Big5 characters which have the same code in 1st byte. */
-#define BIG5_SAME_ROW (0xFF - 0xA1 + 0x7F - 0x40)
-
-#define DECODE_BIG5(b1, b2, charset, c1, c2) \
- do { \
- unsigned int temp \
- = (b1 - 0xA1) * BIG5_SAME_ROW + b2 - (b2 < 0x7F ? 0x40 : 0x62); \
- if (b1 < 0xC9) \
- charset = charset_big5_1; \
- else \
- { \
- charset = charset_big5_2; \
- temp -= (0xC9 - 0xA1) * BIG5_SAME_ROW; \
- } \
- c1 = temp / (0xFF - 0xA1) + 0x21; \
- c2 = temp % (0xFF - 0xA1) + 0x21; \
- } while (0)
-
-#define ENCODE_BIG5(charset, c1, c2, b1, b2) \
- do { \
- unsigned int temp = (c1 - 0x21) * (0xFF - 0xA1) + (c2 - 0x21); \
- if (charset == charset_big5_2) \
- temp += BIG5_SAME_ROW * (0xC9 - 0xA1); \
- b1 = temp / BIG5_SAME_ROW + 0xA1; \
- b2 = temp % BIG5_SAME_ROW; \
- b2 += b2 < 0x3F ? 0x40 : 0x62; \
- } while (0)
+ */
/* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions".
Check if a text is encoded in SJIS. If it is, return
- CODING_CATEGORY_MASK_SJIS, else return 0. */
+ CATEGORY_MASK_SJIS, else return 0. */
static int
-detect_coding_sjis (src, src_end, multibytep)
- unsigned char *src, *src_end;
- int multibytep;
+detect_coding_sjis (coding, detect_info)
+ struct coding_system *coding;
+ struct coding_detection_info *detect_info;
{
+ const unsigned char *src = coding->source, *src_base;
+ const unsigned char *src_end = coding->source + coding->src_bytes;
+ int multibytep = coding->src_multibyte;
+ int consumed_chars = 0;
+ int found = 0;
int c;
- /* Dummy for ONE_MORE_BYTE. */
- struct coding_system dummy_coding;
- struct coding_system *coding = &dummy_coding;
+
+ detect_info->checked |= CATEGORY_MASK_SJIS;
+ /* A coding system of this category is always ASCII compatible. */
+ src += coding->head_ascii;
while (1)
{
- ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, CODING_CATEGORY_MASK_SJIS);
+ src_base = src;
+ ONE_MORE_BYTE (c);
if (c < 0x80)
continue;
- if (c == 0x80 || c == 0xA0 || c > 0xEF)
- return 0;
- if (c <= 0x9F || c >= 0xE0)
+ if ((c >= 0x81 && c <= 0x9F) || (c >= 0xE0 && c <= 0xEF))
{
- ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, 0);
+ ONE_MORE_BYTE (c);
if (c < 0x40 || c == 0x7F || c > 0xFC)
- return 0;
+ break;
+ found = CATEGORY_MASK_SJIS;
}
+ else if (c >= 0xA0 && c < 0xE0)
+ found = CATEGORY_MASK_SJIS;
+ else
+ break;
+ }
+ detect_info->rejected |= CATEGORY_MASK_SJIS;
+ return 0;
+
+ no_more_source:
+ if (src_base < src && coding->mode & CODING_MODE_LAST_BLOCK)
+ {
+ detect_info->rejected |= CATEGORY_MASK_SJIS;
+ return 0;
}
+ detect_info->found |= found;
+ return 1;
}
/* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions".
Check if a text is encoded in BIG5. If it is, return
- CODING_CATEGORY_MASK_BIG5, else return 0. */
+ CATEGORY_MASK_BIG5, else return 0. */
static int
-detect_coding_big5 (src, src_end, multibytep)
- unsigned char *src, *src_end;
- int multibytep;
+detect_coding_big5 (coding, detect_info)
+ struct coding_system *coding;
+ struct coding_detection_info *detect_info;
{
+ const unsigned char *src = coding->source, *src_base;
+ const unsigned char *src_end = coding->source + coding->src_bytes;
+ int multibytep = coding->src_multibyte;
+ int consumed_chars = 0;
+ int found = 0;
int c;
- /* Dummy for ONE_MORE_BYTE. */
- struct coding_system dummy_coding;
- struct coding_system *coding = &dummy_coding;
+
+ detect_info->checked |= CATEGORY_MASK_BIG5;
+ /* A coding system of this category is always ASCII compatible. */
+ src += coding->head_ascii;
while (1)
{
- ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, CODING_CATEGORY_MASK_BIG5);
+ src_base = src;
+ ONE_MORE_BYTE (c);
if (c < 0x80)
continue;
- if (c < 0xA1 || c > 0xFE)
- return 0;
- ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, 0);
- if (c < 0x40 || (c > 0x7F && c < 0xA1) || c > 0xFE)
- return 0;
+ if (c >= 0xA1)
+ {
+ ONE_MORE_BYTE (c);
+ if (c < 0x40 || (c >= 0x7F && c <= 0xA0))
+ return 0;
+ found = CATEGORY_MASK_BIG5;
+ }
+ else
+ break;
}
-}
+ detect_info->rejected |= CATEGORY_MASK_BIG5;
+ return 0;
-/* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions".
- Check if a text is encoded in UTF-8. If it is, return
- CODING_CATEGORY_MASK_UTF_8, else return 0. */
+ no_more_source:
+ if (src_base < src && coding->mode & CODING_MODE_LAST_BLOCK)
+ {
+ detect_info->rejected |= CATEGORY_MASK_BIG5;
+ return 0;
+ }
+ detect_info->found |= found;
+ return 1;
+}
-#define UTF_8_1_OCTET_P(c) ((c) < 0x80)
-#define UTF_8_EXTRA_OCTET_P(c) (((c) & 0xC0) == 0x80)
-#define UTF_8_2_OCTET_LEADING_P(c) (((c) & 0xE0) == 0xC0)
-#define UTF_8_3_OCTET_LEADING_P(c) (((c) & 0xF0) == 0xE0)
-#define UTF_8_4_OCTET_LEADING_P(c) (((c) & 0xF8) == 0xF0)
-#define UTF_8_5_OCTET_LEADING_P(c) (((c) & 0xFC) == 0xF8)
-#define UTF_8_6_OCTET_LEADING_P(c) (((c) & 0xFE) == 0xFC)
+/* See the above "GENERAL NOTES on `decode_coding_XXX ()' functions".
+ If SJIS_P is 1, decode SJIS text, else decode BIG5 test. */
-static int
-detect_coding_utf_8 (src, src_end, multibytep)
- unsigned char *src, *src_end;
- int multibytep;
+static void
+decode_coding_sjis (coding)
+ struct coding_system *coding;
{
- unsigned char c;
- int seq_maybe_bytes;
- /* Dummy for ONE_MORE_BYTE. */
- struct coding_system dummy_coding;
- struct coding_system *coding = &dummy_coding;
+ const unsigned char *src = coding->source + coding->consumed;
+ const unsigned char *src_end = coding->source + coding->src_bytes;
+ const unsigned char *src_base;
+ int *charbuf = coding->charbuf + coding->charbuf_used;
+ int *charbuf_end
+ = coding->charbuf + coding->charbuf_size - MAX_ANNOTATION_LENGTH;
+ int consumed_chars = 0, consumed_chars_base;
+ int multibytep = coding->src_multibyte;
+ struct charset *charset_roman, *charset_kanji, *charset_kana;
+ struct charset *charset_kanji2;
+ Lisp_Object attrs, charset_list, val;
+ int char_offset = coding->produced_char;
+ int last_offset = char_offset;
+ int last_id = charset_ascii;
+
+ CODING_GET_INFO (coding, attrs, charset_list);
+
+ val = charset_list;
+ charset_roman = CHARSET_FROM_ID (XINT (XCAR (val))), val = XCDR (val);
+ charset_kana = CHARSET_FROM_ID (XINT (XCAR (val))), val = XCDR (val);
+ charset_kanji = CHARSET_FROM_ID (XINT (XCAR (val))), val = XCDR (val);
+ charset_kanji2 = NILP (val) ? NULL : CHARSET_FROM_ID (XINT (XCAR (val)));
while (1)
{
- ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, CODING_CATEGORY_MASK_UTF_8);
- if (UTF_8_1_OCTET_P (c))
- continue;
- else if (UTF_8_2_OCTET_LEADING_P (c))
- seq_maybe_bytes = 1;
- else if (UTF_8_3_OCTET_LEADING_P (c))
- seq_maybe_bytes = 2;
- else if (UTF_8_4_OCTET_LEADING_P (c))
- seq_maybe_bytes = 3;
- else if (UTF_8_5_OCTET_LEADING_P (c))
- seq_maybe_bytes = 4;
- else if (UTF_8_6_OCTET_LEADING_P (c))
- seq_maybe_bytes = 5;
- else
- return 0;
+ int c, c1;
+ struct charset *charset;
- do
- {
- ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, 0);
- if (!UTF_8_EXTRA_OCTET_P (c))
- return 0;
- seq_maybe_bytes--;
- }
- while (seq_maybe_bytes > 0);
- }
-}
-
-/* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions".
- Check if a text is encoded in UTF-16 Big Endian (endian == 1) or
- Little Endian (otherwise). If it is, return
- CODING_CATEGORY_MASK_UTF_16_BE or CODING_CATEGORY_MASK_UTF_16_LE,
- else return 0. */
-
-#define UTF_16_INVALID_P(val) \
- (((val) == 0xFFFE) \
- || ((val) == 0xFFFF))
-
-#define UTF_16_HIGH_SURROGATE_P(val) \
- (((val) & 0xD800) == 0xD800)
+ src_base = src;
+ consumed_chars_base = consumed_chars;
-#define UTF_16_LOW_SURROGATE_P(val) \
- (((val) & 0xDC00) == 0xDC00)
+ if (charbuf >= charbuf_end)
+ break;
-static int
-detect_coding_utf_16 (src, src_end, multibytep)
- unsigned char *src, *src_end;
- int multibytep;
-{
- unsigned char c1, c2;
- /* Dummy for ONE_MORE_BYTE_CHECK_MULTIBYTE. */
- struct coding_system dummy_coding;
- struct coding_system *coding = &dummy_coding;
+ ONE_MORE_BYTE (c);
+ if (c < 0)
+ goto invalid_code;
+ if (c < 0x80)
+ charset = charset_roman;
+ else if (c == 0x80 || c == 0xA0)
+ goto invalid_code;
+ else if (c >= 0xA1 && c <= 0xDF)
+ {
+ /* SJIS -> JISX0201-Kana */
+ c &= 0x7F;
+ charset = charset_kana;
+ }
+ else if (c <= 0xEF)
+ {
+ /* SJIS -> JISX0208 */
+ ONE_MORE_BYTE (c1);
+ if (c1 < 0x40 || c1 == 0x7F || c1 > 0xFC)
+ goto invalid_code;
+ c = (c << 8) | c1;
+ SJIS_TO_JIS (c);
+ charset = charset_kanji;
+ }
+ else if (c <= 0xFC && charset_kanji2)
+ {
+ /* SJIS -> JISX0213-2 */
+ ONE_MORE_BYTE (c1);
+ if (c1 < 0x40 || c1 == 0x7F || c1 > 0xFC)
+ goto invalid_code;
+ c = (c << 8) | c1;
+ SJIS_TO_JIS2 (c);
+ charset = charset_kanji2;
+ }
+ else
+ goto invalid_code;
+ if (charset->id != charset_ascii
+ && last_id != charset->id)
+ {
+ if (last_id != charset_ascii)
+ ADD_CHARSET_DATA (charbuf, char_offset - last_offset, last_id);
+ last_id = charset->id;
+ last_offset = char_offset;
+ }
+ CODING_DECODE_CHAR (coding, src, src_base, src_end, charset, c, c);
+ *charbuf++ = c;
+ char_offset++;
+ continue;
- ONE_MORE_BYTE_CHECK_MULTIBYTE (c1, multibytep, 0);
- ONE_MORE_BYTE_CHECK_MULTIBYTE (c2, multibytep, 0);
+ invalid_code:
+ src = src_base;
+ consumed_chars = consumed_chars_base;
+ ONE_MORE_BYTE (c);
+ *charbuf++ = c < 0 ? -c : BYTE8_TO_CHAR (c);
+ char_offset++;
+ coding->errors++;
+ }
- if ((c1 == 0xFF) && (c2 == 0xFE))
- return CODING_CATEGORY_MASK_UTF_16_LE;
- else if ((c1 == 0xFE) && (c2 == 0xFF))
- return CODING_CATEGORY_MASK_UTF_16_BE;
- return 0;
+ no_more_source:
+ if (last_id != charset_ascii)
+ ADD_CHARSET_DATA (charbuf, char_offset - last_offset, last_id);
+ coding->consumed_char += consumed_chars_base;
+ coding->consumed = src_base - coding->source;
+ coding->charbuf_used = charbuf - coding->charbuf;
}
-/* See the above "GENERAL NOTES on `decode_coding_XXX ()' functions".
- If SJIS_P is 1, decode SJIS text, else decode BIG5 test. */
-
static void
-decode_coding_sjis_big5 (coding, source, destination,
- src_bytes, dst_bytes, sjis_p)
+decode_coding_big5 (coding)
struct coding_system *coding;
- const unsigned char *source;
- unsigned char *destination;
- int src_bytes, dst_bytes;
- int sjis_p;
{
- const unsigned char *src = source;
- const unsigned char *src_end = source + src_bytes;
- unsigned char *dst = destination;
- unsigned char *dst_end = destination + dst_bytes;
- /* SRC_BASE remembers the start position in source in each loop.
- The loop will be exited when there's not enough source code
- (within macro ONE_MORE_BYTE), or when there's not enough
- destination area to produce a character (within macro
- EMIT_CHAR). */
+ const unsigned char *src = coding->source + coding->consumed;
+ const unsigned char *src_end = coding->source + coding->src_bytes;
const unsigned char *src_base;
- Lisp_Object translation_table;
-
- if (NILP (Venable_character_translation))
- translation_table = Qnil;
- else
- {
- translation_table = coding->translation_table_for_decode;
- if (NILP (translation_table))
- translation_table = Vstandard_translation_table_for_decode;
- }
+ int *charbuf = coding->charbuf + coding->charbuf_used;
+ int *charbuf_end
+ = coding->charbuf + coding->charbuf_size - MAX_ANNOTATION_LENGTH;
+ int consumed_chars = 0, consumed_chars_base;
+ int multibytep = coding->src_multibyte;
+ struct charset *charset_roman, *charset_big5;
+ Lisp_Object attrs, charset_list, val;
+ int char_offset = coding->produced_char;
+ int last_offset = char_offset;
+ int last_id = charset_ascii;
+
+ CODING_GET_INFO (coding, attrs, charset_list);
+ val = charset_list;
+ charset_roman = CHARSET_FROM_ID (XINT (XCAR (val))), val = XCDR (val);
+ charset_big5 = CHARSET_FROM_ID (XINT (XCAR (val)));
- coding->produced_char = 0;
while (1)
{
- int c, charset, c1, c2 = 0;
+ int c, c1;
+ struct charset *charset;
src_base = src;
- ONE_MORE_BYTE (c1);
+ consumed_chars_base = consumed_chars;
- if (c1 < 0x80)
+ if (charbuf >= charbuf_end)
+ break;
+
+ ONE_MORE_BYTE (c);
+
+ if (c < 0)
+ goto invalid_code;
+ if (c < 0x80)
+ charset = charset_roman;
+ else
{
- charset = CHARSET_ASCII;
- if (c1 < 0x20)
- {
- if (c1 == '\r')
- {
- if (coding->eol_type == CODING_EOL_CRLF)
- {
- ONE_MORE_BYTE (c2);
- if (c2 == '\n')
- c1 = c2;
- else
- /* To process C2 again, SRC is subtracted by 1. */
- src--;
- }
- else if (coding->eol_type == CODING_EOL_CR)
- c1 = '\n';
- }
- else if (c1 == '\n'
- && (coding->mode & CODING_MODE_INHIBIT_INCONSISTENT_EOL)
- && (coding->eol_type == CODING_EOL_CR
- || coding->eol_type == CODING_EOL_CRLF))
- {
- coding->result = CODING_FINISH_INCONSISTENT_EOL;
- goto label_end_of_loop;
- }
- }
+ /* BIG5 -> Big5 */
+ if (c < 0xA1 || c > 0xFE)
+ goto invalid_code;
+ ONE_MORE_BYTE (c1);
+ if (c1 < 0x40 || (c1 > 0x7E && c1 < 0xA1) || c1 > 0xFE)
+ goto invalid_code;
+ c = c << 8 | c1;
+ charset = charset_big5;
}
- else
- {
- if (sjis_p)
- {
- if (c1 == 0x80 || c1 == 0xA0 || c1 > 0xEF)
- goto label_invalid_code;
- if (c1 <= 0x9F || c1 >= 0xE0)
- {
- /* SJIS -> JISX0208 */
- ONE_MORE_BYTE (c2);
- if (c2 < 0x40 || c2 == 0x7F || c2 > 0xFC)
- goto label_invalid_code;
- DECODE_SJIS (c1, c2, c1, c2);
- charset = charset_jisx0208;
- }
- else
- /* SJIS -> JISX0201-Kana */
- charset = charset_katakana_jisx0201;
- }
- else
- {
- /* BIG5 -> Big5 */
- if (c1 < 0xA0 || c1 > 0xFE)
- goto label_invalid_code;
- ONE_MORE_BYTE (c2);
- if (c2 < 0x40 || (c2 > 0x7E && c2 < 0xA1) || c2 > 0xFE)
- goto label_invalid_code;
- DECODE_BIG5 (c1, c2, charset, c1, c2);
- }
+ if (charset->id != charset_ascii
+ && last_id != charset->id)
+ {
+ if (last_id != charset_ascii)
+ ADD_CHARSET_DATA (charbuf, char_offset - last_offset, last_id);
+ last_id = charset->id;
+ last_offset = char_offset;
}
-
- c = DECODE_ISO_CHARACTER (charset, c1, c2);
- EMIT_CHAR (c);
+ CODING_DECODE_CHAR (coding, src, src_base, src_end, charset, c, c);
+ *charbuf++ = c;
+ char_offset++;
continue;
- label_invalid_code:
- coding->errors++;
+ invalid_code:
src = src_base;
- c = *src++;
- EMIT_CHAR (c);
+ consumed_chars = consumed_chars_base;
+ ONE_MORE_BYTE (c);
+ *charbuf++ = c < 0 ? -c : BYTE8_TO_CHAR (c);
+ char_offset++;
+ coding->errors++;
}
- label_end_of_loop:
- coding->consumed = coding->consumed_char = src_base - source;
- coding->produced = dst - destination;
- return;
+ no_more_source:
+ if (last_id != charset_ascii)
+ ADD_CHARSET_DATA (charbuf, char_offset - last_offset, last_id);
+ coding->consumed_char += consumed_chars_base;
+ coding->consumed = src_base - coding->source;
+ coding->charbuf_used = charbuf - coding->charbuf;
}
/* See the above "GENERAL NOTES on `encode_coding_XXX ()' functions".
@@ -3171,825 +4267,1013 @@ decode_coding_sjis_big5 (coding, source, destination,
charsets are produced without any encoding. If SJIS_P is 1, encode
SJIS text, else encode BIG5 text. */
-static void
-encode_coding_sjis_big5 (coding, source, destination,
- src_bytes, dst_bytes, sjis_p)
+static int
+encode_coding_sjis (coding)
struct coding_system *coding;
- unsigned char *source, *destination;
- int src_bytes, dst_bytes;
- int sjis_p;
{
- unsigned char *src = source;
- unsigned char *src_end = source + src_bytes;
- unsigned char *dst = destination;
- unsigned char *dst_end = destination + dst_bytes;
- /* SRC_BASE remembers the start position in source in each loop.
- The loop will be exited when there's not enough source text to
- analyze multi-byte codes (within macro ONE_MORE_CHAR), or when
- there's not enough destination area to produce encoded codes
- (within macro EMIT_BYTES). */
- unsigned char *src_base;
- Lisp_Object translation_table;
-
- if (NILP (Venable_character_translation))
- translation_table = Qnil;
- else
- {
- translation_table = coding->translation_table_for_encode;
- if (NILP (translation_table))
- translation_table = Vstandard_translation_table_for_encode;
- }
+ int multibytep = coding->dst_multibyte;
+ int *charbuf = coding->charbuf;
+ int *charbuf_end = charbuf + coding->charbuf_used;
+ unsigned char *dst = coding->destination + coding->produced;
+ unsigned char *dst_end = coding->destination + coding->dst_bytes;
+ int safe_room = 4;
+ int produced_chars = 0;
+ Lisp_Object attrs, charset_list, val;
+ int ascii_compatible;
+ struct charset *charset_roman, *charset_kanji, *charset_kana;
+ struct charset *charset_kanji2;
+ int c;
- while (1)
- {
- int c, charset, c1, c2;
+ CODING_GET_INFO (coding, attrs, charset_list);
+ val = charset_list;
+ charset_roman = CHARSET_FROM_ID (XINT (XCAR (val))), val = XCDR (val);
+ charset_kana = CHARSET_FROM_ID (XINT (XCAR (val))), val = XCDR (val);
+ charset_kanji = CHARSET_FROM_ID (XINT (XCAR (val))), val = XCDR (val);
+ charset_kanji2 = NILP (val) ? NULL : CHARSET_FROM_ID (XINT (XCAR (val)));
- src_base = src;
- ONE_MORE_CHAR (c);
+ ascii_compatible = ! NILP (CODING_ATTR_ASCII_COMPAT (attrs));
+ while (charbuf < charbuf_end)
+ {
+ ASSURE_DESTINATION (safe_room);
+ c = *charbuf++;
/* Now encode the character C. */
- if (SINGLE_BYTE_CHAR_P (c))
+ if (ASCII_CHAR_P (c) && ascii_compatible)
+ EMIT_ONE_ASCII_BYTE (c);
+ else if (CHAR_BYTE8_P (c))
+ {
+ c = CHAR_TO_BYTE8 (c);
+ EMIT_ONE_BYTE (c);
+ }
+ else
{
- switch (c)
+ unsigned code;
+ struct charset *charset = char_charset (c, charset_list, &code);
+
+ if (!charset)
{
- case '\r':
- if (!(coding->mode & CODING_MODE_SELECTIVE_DISPLAY))
+ if (coding->mode & CODING_MODE_SAFE_ENCODING)
{
- EMIT_ONE_BYTE (c);
- break;
+ code = CODING_INHIBIT_CHARACTER_SUBSTITUTION;
+ charset = CHARSET_FROM_ID (charset_ascii);
}
- c = '\n';
- case '\n':
- if (coding->eol_type == CODING_EOL_CRLF)
+ else
{
- EMIT_TWO_BYTES ('\r', c);
- break;
+ c = coding->default_char;
+ charset = char_charset (c, charset_list, &code);
}
- else if (coding->eol_type == CODING_EOL_CR)
- c = '\r';
- default:
- EMIT_ONE_BYTE (c);
}
- }
- else
- {
- SPLIT_CHAR (c, charset, c1, c2);
- if (sjis_p)
+ if (code == CHARSET_INVALID_CODE (charset))
+ abort ();
+ if (charset == charset_kanji)
{
- if (charset == charset_jisx0208
- || charset == charset_jisx0208_1978)
+ int c1, c2;
+ JIS_TO_SJIS (code);
+ c1 = code >> 8, c2 = code & 0xFF;
+ EMIT_TWO_BYTES (c1, c2);
+ }
+ else if (charset == charset_kana)
+ EMIT_ONE_BYTE (code | 0x80);
+ else if (charset_kanji2 && charset == charset_kanji2)
+ {
+ int c1, c2;
+
+ c1 = code >> 8;
+ if (c1 == 0x21 || (c1 >= 0x23 && c1 < 0x25)
+ || (c1 >= 0x2C && c1 <= 0x2F) || c1 >= 0x6E)
{
- ENCODE_SJIS (c1, c2, c1, c2);
+ JIS_TO_SJIS2 (code);
+ c1 = code >> 8, c2 = code & 0xFF;
EMIT_TWO_BYTES (c1, c2);
}
- else if (charset == charset_katakana_jisx0201)
- EMIT_ONE_BYTE (c1 | 0x80);
- else if (charset == charset_latin_jisx0201)
- EMIT_ONE_BYTE (c1);
- else if (coding->mode & CODING_MODE_INHIBIT_UNENCODABLE_CHAR)
- {
- EMIT_ONE_BYTE (CODING_REPLACEMENT_CHARACTER);
- if (CHARSET_WIDTH (charset) > 1)
- EMIT_ONE_BYTE (CODING_REPLACEMENT_CHARACTER);
- }
else
- /* There's no way other than producing the internal
- codes as is. */
- EMIT_BYTES (src_base, src);
+ EMIT_ONE_ASCII_BYTE (code & 0x7F);
}
else
+ EMIT_ONE_ASCII_BYTE (code & 0x7F);
+ }
+ }
+ record_conversion_result (coding, CODING_RESULT_SUCCESS);
+ coding->produced_char += produced_chars;
+ coding->produced = dst - coding->destination;
+ return 0;
+}
+
+static int
+encode_coding_big5 (coding)
+ struct coding_system *coding;
+{
+ int multibytep = coding->dst_multibyte;
+ int *charbuf = coding->charbuf;
+ int *charbuf_end = charbuf + coding->charbuf_used;
+ unsigned char *dst = coding->destination + coding->produced;
+ unsigned char *dst_end = coding->destination + coding->dst_bytes;
+ int safe_room = 4;
+ int produced_chars = 0;
+ Lisp_Object attrs, charset_list, val;
+ int ascii_compatible;
+ struct charset *charset_roman, *charset_big5;
+ int c;
+
+ CODING_GET_INFO (coding, attrs, charset_list);
+ val = charset_list;
+ charset_roman = CHARSET_FROM_ID (XINT (XCAR (val))), val = XCDR (val);
+ charset_big5 = CHARSET_FROM_ID (XINT (XCAR (val)));
+ ascii_compatible = ! NILP (CODING_ATTR_ASCII_COMPAT (attrs));
+
+ while (charbuf < charbuf_end)
+ {
+ ASSURE_DESTINATION (safe_room);
+ c = *charbuf++;
+ /* Now encode the character C. */
+ if (ASCII_CHAR_P (c) && ascii_compatible)
+ EMIT_ONE_ASCII_BYTE (c);
+ else if (CHAR_BYTE8_P (c))
+ {
+ c = CHAR_TO_BYTE8 (c);
+ EMIT_ONE_BYTE (c);
+ }
+ else
+ {
+ unsigned code;
+ struct charset *charset = char_charset (c, charset_list, &code);
+
+ if (! charset)
{
- if (charset == charset_big5_1 || charset == charset_big5_2)
+ if (coding->mode & CODING_MODE_SAFE_ENCODING)
{
- ENCODE_BIG5 (charset, c1, c2, c1, c2);
- EMIT_TWO_BYTES (c1, c2);
+ code = CODING_INHIBIT_CHARACTER_SUBSTITUTION;
+ charset = CHARSET_FROM_ID (charset_ascii);
}
- else if (coding->mode & CODING_MODE_INHIBIT_UNENCODABLE_CHAR)
+ else
{
- EMIT_ONE_BYTE (CODING_REPLACEMENT_CHARACTER);
- if (CHARSET_WIDTH (charset) > 1)
- EMIT_ONE_BYTE (CODING_REPLACEMENT_CHARACTER);
+ c = coding->default_char;
+ charset = char_charset (c, charset_list, &code);
}
- else
- /* There's no way other than producing the internal
- codes as is. */
- EMIT_BYTES (src_base, src);
}
+ if (code == CHARSET_INVALID_CODE (charset))
+ abort ();
+ if (charset == charset_big5)
+ {
+ int c1, c2;
+
+ c1 = code >> 8, c2 = code & 0xFF;
+ EMIT_TWO_BYTES (c1, c2);
+ }
+ else
+ EMIT_ONE_ASCII_BYTE (code & 0x7F);
}
- coding->consumed_char++;
}
-
- label_end_of_loop:
- coding->consumed = src_base - source;
- coding->produced = coding->produced_char = dst - destination;
+ record_conversion_result (coding, CODING_RESULT_SUCCESS);
+ coding->produced_char += produced_chars;
+ coding->produced = dst - coding->destination;
+ return 0;
}
-/*** 5. CCL handlers ***/
+/*** 10. CCL handlers ***/
/* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions".
Check if a text is encoded in a coding system of which
encoder/decoder are written in CCL program. If it is, return
- CODING_CATEGORY_MASK_CCL, else return 0. */
+ CATEGORY_MASK_CCL, else return 0. */
static int
-detect_coding_ccl (src, src_end, multibytep)
- unsigned char *src, *src_end;
- int multibytep;
+detect_coding_ccl (coding, detect_info)
+ struct coding_system *coding;
+ struct coding_detection_info *detect_info;
{
- unsigned char *valid;
- int c;
- /* Dummy for ONE_MORE_BYTE. */
- struct coding_system dummy_coding;
- struct coding_system *coding = &dummy_coding;
-
- /* No coding system is assigned to coding-category-ccl. */
- if (!coding_system_table[CODING_CATEGORY_IDX_CCL])
- return 0;
+ const unsigned char *src = coding->source, *src_base;
+ const unsigned char *src_end = coding->source + coding->src_bytes;
+ int multibytep = coding->src_multibyte;
+ int consumed_chars = 0;
+ int found = 0;
+ unsigned char *valids;
+ int head_ascii = coding->head_ascii;
+ Lisp_Object attrs;
+
+ detect_info->checked |= CATEGORY_MASK_CCL;
+
+ coding = &coding_categories[coding_category_ccl];
+ valids = CODING_CCL_VALIDS (coding);
+ attrs = CODING_ID_ATTRS (coding->id);
+ if (! NILP (CODING_ATTR_ASCII_COMPAT (attrs)))
+ src += head_ascii;
- valid = coding_system_table[CODING_CATEGORY_IDX_CCL]->spec.ccl.valid_codes;
while (1)
{
- ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, CODING_CATEGORY_MASK_CCL);
- if (! valid[c])
- return 0;
+ int c;
+
+ src_base = src;
+ ONE_MORE_BYTE (c);
+ if (c < 0 || ! valids[c])
+ break;
+ if ((valids[c] > 1))
+ found = CATEGORY_MASK_CCL;
+ }
+ detect_info->rejected |= CATEGORY_MASK_CCL;
+ return 0;
+
+ no_more_source:
+ detect_info->found |= found;
+ return 1;
+}
+
+static void
+decode_coding_ccl (coding)
+ struct coding_system *coding;
+{
+ const unsigned char *src = coding->source + coding->consumed;
+ const unsigned char *src_end = coding->source + coding->src_bytes;
+ int *charbuf = coding->charbuf + coding->charbuf_used;
+ int *charbuf_end = coding->charbuf + coding->charbuf_size;
+ int consumed_chars = 0;
+ int multibytep = coding->src_multibyte;
+ struct ccl_program ccl;
+ int source_charbuf[1024];
+ int source_byteidx[1024];
+ Lisp_Object attrs, charset_list;
+
+ CODING_GET_INFO (coding, attrs, charset_list);
+ setup_ccl_program (&ccl, CODING_CCL_DECODER (coding));
+
+ while (src < src_end)
+ {
+ const unsigned char *p = src;
+ int *source, *source_end;
+ int i = 0;
+
+ if (multibytep)
+ while (i < 1024 && p < src_end)
+ {
+ source_byteidx[i] = p - src;
+ source_charbuf[i++] = STRING_CHAR_ADVANCE (p);
+ }
+ else
+ while (i < 1024 && p < src_end)
+ source_charbuf[i++] = *p++;
+
+ if (p == src_end && coding->mode & CODING_MODE_LAST_BLOCK)
+ ccl.last_block = 1;
+
+ source = source_charbuf;
+ source_end = source + i;
+ while (source < source_end)
+ {
+ ccl_driver (&ccl, source, charbuf,
+ source_end - source, charbuf_end - charbuf,
+ charset_list);
+ source += ccl.consumed;
+ charbuf += ccl.produced;
+ if (ccl.status != CCL_STAT_SUSPEND_BY_DST)
+ break;
+ }
+ if (source < source_end)
+ src += source_byteidx[source - source_charbuf];
+ else
+ src = p;
+ consumed_chars += source - source_charbuf;
+
+ if (ccl.status != CCL_STAT_SUSPEND_BY_SRC
+ && ccl.status != CODING_RESULT_INSUFFICIENT_SRC)
+ break;
+ }
+
+ switch (ccl.status)
+ {
+ case CCL_STAT_SUSPEND_BY_SRC:
+ record_conversion_result (coding, CODING_RESULT_INSUFFICIENT_SRC);
+ break;
+ case CCL_STAT_SUSPEND_BY_DST:
+ break;
+ case CCL_STAT_QUIT:
+ case CCL_STAT_INVALID_CMD:
+ record_conversion_result (coding, CODING_RESULT_INTERRUPT);
+ break;
+ default:
+ record_conversion_result (coding, CODING_RESULT_SUCCESS);
+ break;
+ }
+ coding->consumed_char += consumed_chars;
+ coding->consumed = src - coding->source;
+ coding->charbuf_used = charbuf - coding->charbuf;
+}
+
+static int
+encode_coding_ccl (coding)
+ struct coding_system *coding;
+{
+ struct ccl_program ccl;
+ int multibytep = coding->dst_multibyte;
+ int *charbuf = coding->charbuf;
+ int *charbuf_end = charbuf + coding->charbuf_used;
+ unsigned char *dst = coding->destination + coding->produced;
+ unsigned char *dst_end = coding->destination + coding->dst_bytes;
+ int destination_charbuf[1024];
+ int i, produced_chars = 0;
+ Lisp_Object attrs, charset_list;
+
+ CODING_GET_INFO (coding, attrs, charset_list);
+ setup_ccl_program (&ccl, CODING_CCL_ENCODER (coding));
+
+ ccl.last_block = coding->mode & CODING_MODE_LAST_BLOCK;
+ ccl.dst_multibyte = coding->dst_multibyte;
+
+ while (charbuf < charbuf_end)
+ {
+ ccl_driver (&ccl, charbuf, destination_charbuf,
+ charbuf_end - charbuf, 1024, charset_list);
+ if (multibytep)
+ {
+ ASSURE_DESTINATION (ccl.produced * 2);
+ for (i = 0; i < ccl.produced; i++)
+ EMIT_ONE_BYTE (destination_charbuf[i] & 0xFF);
+ }
+ else
+ {
+ ASSURE_DESTINATION (ccl.produced);
+ for (i = 0; i < ccl.produced; i++)
+ *dst++ = destination_charbuf[i] & 0xFF;
+ produced_chars += ccl.produced;
+ }
+ charbuf += ccl.consumed;
+ if (ccl.status == CCL_STAT_QUIT
+ || ccl.status == CCL_STAT_INVALID_CMD)
+ break;
+ }
+
+ switch (ccl.status)
+ {
+ case CCL_STAT_SUSPEND_BY_SRC:
+ record_conversion_result (coding, CODING_RESULT_INSUFFICIENT_SRC);
+ break;
+ case CCL_STAT_SUSPEND_BY_DST:
+ record_conversion_result (coding, CODING_RESULT_INSUFFICIENT_DST);
+ break;
+ case CCL_STAT_QUIT:
+ case CCL_STAT_INVALID_CMD:
+ record_conversion_result (coding, CODING_RESULT_INTERRUPT);
+ break;
+ default:
+ record_conversion_result (coding, CODING_RESULT_SUCCESS);
+ break;
}
+
+ coding->produced_char += produced_chars;
+ coding->produced = dst - coding->destination;
+ return 0;
}
+
-/*** 6. End-of-line handlers ***/
+/*** 10, 11. no-conversion handlers ***/
/* See the above "GENERAL NOTES on `decode_coding_XXX ()' functions". */
static void
-decode_eol (coding, source, destination, src_bytes, dst_bytes)
+decode_coding_raw_text (coding)
struct coding_system *coding;
- const unsigned char *source;
- unsigned char *destination;
- int src_bytes, dst_bytes;
{
- const unsigned char *src = source;
- unsigned char *dst = destination;
- const unsigned char *src_end = src + src_bytes;
- unsigned char *dst_end = dst + dst_bytes;
- Lisp_Object translation_table;
- /* SRC_BASE remembers the start position in source in each loop.
- The loop will be exited when there's not enough source code
- (within macro ONE_MORE_BYTE), or when there's not enough
- destination area to produce a character (within macro
- EMIT_CHAR). */
- const unsigned char *src_base;
+ coding->chars_at_source = 1;
+ coding->consumed_char = 0;
+ coding->consumed = 0;
+ record_conversion_result (coding, CODING_RESULT_SUCCESS);
+}
+
+static int
+encode_coding_raw_text (coding)
+ struct coding_system *coding;
+{
+ int multibytep = coding->dst_multibyte;
+ int *charbuf = coding->charbuf;
+ int *charbuf_end = coding->charbuf + coding->charbuf_used;
+ unsigned char *dst = coding->destination + coding->produced;
+ unsigned char *dst_end = coding->destination + coding->dst_bytes;
+ int produced_chars = 0;
int c;
- translation_table = Qnil;
- switch (coding->eol_type)
+ if (multibytep)
{
- case CODING_EOL_CRLF:
- while (1)
+ int safe_room = MAX_MULTIBYTE_LENGTH * 2;
+
+ if (coding->src_multibyte)
+ while (charbuf < charbuf_end)
+ {
+ ASSURE_DESTINATION (safe_room);
+ c = *charbuf++;
+ if (ASCII_CHAR_P (c))
+ EMIT_ONE_ASCII_BYTE (c);
+ else if (CHAR_BYTE8_P (c))
+ {
+ c = CHAR_TO_BYTE8 (c);
+ EMIT_ONE_BYTE (c);
+ }
+ else
+ {
+ unsigned char str[MAX_MULTIBYTE_LENGTH], *p0 = str, *p1 = str;
+
+ CHAR_STRING_ADVANCE (c, p1);
+ while (p0 < p1)
+ {
+ EMIT_ONE_BYTE (*p0);
+ p0++;
+ }
+ }
+ }
+ else
+ while (charbuf < charbuf_end)
+ {
+ ASSURE_DESTINATION (safe_room);
+ c = *charbuf++;
+ EMIT_ONE_BYTE (c);
+ }
+ }
+ else
+ {
+ if (coding->src_multibyte)
{
- src_base = src;
- ONE_MORE_BYTE (c);
- if (c == '\r')
+ int safe_room = MAX_MULTIBYTE_LENGTH;
+
+ while (charbuf < charbuf_end)
{
- ONE_MORE_BYTE (c);
- if (c != '\n')
- {
- src--;
- c = '\r';
- }
+ ASSURE_DESTINATION (safe_room);
+ c = *charbuf++;
+ if (ASCII_CHAR_P (c))
+ *dst++ = c;
+ else if (CHAR_BYTE8_P (c))
+ *dst++ = CHAR_TO_BYTE8 (c);
+ else
+ CHAR_STRING_ADVANCE (c, dst);
+ produced_chars++;
}
- else if (c == '\n'
- && (coding->mode & CODING_MODE_INHIBIT_INCONSISTENT_EOL))
+ }
+ else
+ {
+ ASSURE_DESTINATION (charbuf_end - charbuf);
+ while (charbuf < charbuf_end && dst < dst_end)
+ *dst++ = *charbuf++;
+ produced_chars = dst - (coding->destination + coding->dst_bytes);
+ }
+ }
+ record_conversion_result (coding, CODING_RESULT_SUCCESS);
+ coding->produced_char += produced_chars;
+ coding->produced = dst - coding->destination;
+ return 0;
+}
+
+/* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions".
+ Check if a text is encoded in a charset-based coding system. If it
+ is, return 1, else return 0. */
+
+static int
+detect_coding_charset (coding, detect_info)
+ struct coding_system *coding;
+ struct coding_detection_info *detect_info;
+{
+ const unsigned char *src = coding->source, *src_base;
+ const unsigned char *src_end = coding->source + coding->src_bytes;
+ int multibytep = coding->src_multibyte;
+ int consumed_chars = 0;
+ Lisp_Object attrs, valids;
+ int found = 0;
+ int head_ascii = coding->head_ascii;
+
+ detect_info->checked |= CATEGORY_MASK_CHARSET;
+
+ coding = &coding_categories[coding_category_charset];
+ attrs = CODING_ID_ATTRS (coding->id);
+ valids = AREF (attrs, coding_attr_charset_valids);
+
+ if (! NILP (CODING_ATTR_ASCII_COMPAT (attrs)))
+ src += head_ascii;
+
+ while (1)
+ {
+ int c;
+ Lisp_Object val;
+ struct charset *charset;
+ int dim, idx;
+
+ src_base = src;
+ ONE_MORE_BYTE (c);
+ if (c < 0)
+ continue;
+ val = AREF (valids, c);
+ if (NILP (val))
+ break;
+ if (c >= 0x80)
+ found = CATEGORY_MASK_CHARSET;
+ if (INTEGERP (val))
+ {
+ charset = CHARSET_FROM_ID (XFASTINT (val));
+ dim = CHARSET_DIMENSION (charset);
+ for (idx = 1; idx < dim; idx++)
{
- coding->result = CODING_FINISH_INCONSISTENT_EOL;
- goto label_end_of_loop;
+ if (src == src_end)
+ goto too_short;
+ ONE_MORE_BYTE (c);
+ if (c < charset->code_space[(dim - 1 - idx) * 2]
+ || c > charset->code_space[(dim - 1 - idx) * 2 + 1])
+ break;
}
- EMIT_CHAR (c);
+ if (idx < dim)
+ break;
}
- break;
-
- case CODING_EOL_CR:
- while (1)
+ else
{
- src_base = src;
- ONE_MORE_BYTE (c);
- if (c == '\n')
+ idx = 1;
+ for (; CONSP (val); val = XCDR (val))
{
- if (coding->mode & CODING_MODE_INHIBIT_INCONSISTENT_EOL)
+ charset = CHARSET_FROM_ID (XFASTINT (XCAR (val)));
+ dim = CHARSET_DIMENSION (charset);
+ while (idx < dim)
{
- coding->result = CODING_FINISH_INCONSISTENT_EOL;
- goto label_end_of_loop;
+ if (src == src_end)
+ goto too_short;
+ ONE_MORE_BYTE (c);
+ if (c < charset->code_space[(dim - 1 - idx) * 4]
+ || c > charset->code_space[(dim - 1 - idx) * 4 + 1])
+ break;
+ idx++;
+ }
+ if (idx == dim)
+ {
+ val = Qnil;
+ break;
}
}
- else if (c == '\r')
- c = '\n';
- EMIT_CHAR (c);
- }
- break;
-
- default: /* no need for EOL handling */
- while (1)
- {
- src_base = src;
- ONE_MORE_BYTE (c);
- EMIT_CHAR (c);
+ if (CONSP (val))
+ break;
}
}
+ too_short:
+ detect_info->rejected |= CATEGORY_MASK_CHARSET;
+ return 0;
- label_end_of_loop:
- coding->consumed = coding->consumed_char = src_base - source;
- coding->produced = dst - destination;
- return;
+ no_more_source:
+ detect_info->found |= found;
+ return 1;
}
-/* See "GENERAL NOTES about `encode_coding_XXX ()' functions". Encode
- format of end-of-line according to `coding->eol_type'. It also
- convert multibyte form 8-bit characters to unibyte if
- CODING->src_multibyte is nonzero. If `coding->mode &
- CODING_MODE_SELECTIVE_DISPLAY' is nonzero, code '\r' in source text
- also means end-of-line. */
-
static void
-encode_eol (coding, source, destination, src_bytes, dst_bytes)
+decode_coding_charset (coding)
struct coding_system *coding;
- const unsigned char *source;
- unsigned char *destination;
- int src_bytes, dst_bytes;
{
- const unsigned char *src = source;
- unsigned char *dst = destination;
- const unsigned char *src_end = src + src_bytes;
- unsigned char *dst_end = dst + dst_bytes;
- Lisp_Object translation_table;
- /* SRC_BASE remembers the start position in source in each loop.
- The loop will be exited when there's not enough source text to
- analyze multi-byte codes (within macro ONE_MORE_CHAR), or when
- there's not enough destination area to produce encoded codes
- (within macro EMIT_BYTES). */
+ const unsigned char *src = coding->source + coding->consumed;
+ const unsigned char *src_end = coding->source + coding->src_bytes;
const unsigned char *src_base;
- unsigned char *tmp;
- int c;
- int selective_display = coding->mode & CODING_MODE_SELECTIVE_DISPLAY;
+ int *charbuf = coding->charbuf + coding->charbuf_used;
+ int *charbuf_end
+ = coding->charbuf + coding->charbuf_size - MAX_ANNOTATION_LENGTH;
+ int consumed_chars = 0, consumed_chars_base;
+ int multibytep = coding->src_multibyte;
+ Lisp_Object attrs, charset_list, valids;
+ int char_offset = coding->produced_char;
+ int last_offset = char_offset;
+ int last_id = charset_ascii;
+
+ CODING_GET_INFO (coding, attrs, charset_list);
+ valids = AREF (attrs, coding_attr_charset_valids);
- translation_table = Qnil;
- if (coding->src_multibyte
- && *(src_end - 1) == LEADING_CODE_8_BIT_CONTROL)
+ while (1)
{
- src_end--;
- src_bytes--;
- coding->result = CODING_FINISH_INSUFFICIENT_SRC;
- }
+ int c;
+ Lisp_Object val;
+ struct charset *charset;
+ int dim;
+ int len = 1;
+ unsigned code;
- if (coding->eol_type == CODING_EOL_CRLF)
- {
- while (src < src_end)
- {
- src_base = src;
- c = *src++;
- if (c >= 0x20)
- EMIT_ONE_BYTE (c);
- else if (c == '\n' || (c == '\r' && selective_display))
- EMIT_TWO_BYTES ('\r', '\n');
- else
- EMIT_ONE_BYTE (c);
- }
src_base = src;
- label_end_of_loop:
- ;
- }
- else
- {
- if (!dst_bytes || src_bytes <= dst_bytes)
+ consumed_chars_base = consumed_chars;
+
+ if (charbuf >= charbuf_end)
+ break;
+
+ ONE_MORE_BYTE (c);
+ if (c < 0)
+ goto invalid_code;
+ code = c;
+
+ val = AREF (valids, c);
+ if (NILP (val))
+ goto invalid_code;
+ if (INTEGERP (val))
{
- safe_bcopy (src, dst, src_bytes);
- src_base = src_end;
- dst += src_bytes;
+ charset = CHARSET_FROM_ID (XFASTINT (val));
+ dim = CHARSET_DIMENSION (charset);
+ while (len < dim)
+ {
+ ONE_MORE_BYTE (c);
+ code = (code << 8) | c;
+ len++;
+ }
+ CODING_DECODE_CHAR (coding, src, src_base, src_end,
+ charset, code, c);
}
else
{
- if (coding->src_multibyte
- && *(src + dst_bytes - 1) == LEADING_CODE_8_BIT_CONTROL)
- dst_bytes--;
- safe_bcopy (src, dst, dst_bytes);
- src_base = src + dst_bytes;
- dst = destination + dst_bytes;
- coding->result = CODING_FINISH_INSUFFICIENT_DST;
+ /* VAL is a list of charset IDs. It is assured that the
+ list is sorted by charset dimensions (smaller one
+ comes first). */
+ while (CONSP (val))
+ {
+ charset = CHARSET_FROM_ID (XFASTINT (XCAR (val)));
+ dim = CHARSET_DIMENSION (charset);
+ while (len < dim)
+ {
+ ONE_MORE_BYTE (c);
+ code = (code << 8) | c;
+ len++;
+ }
+ CODING_DECODE_CHAR (coding, src, src_base,
+ src_end, charset, code, c);
+ if (c >= 0)
+ break;
+ val = XCDR (val);
+ }
+ }
+ if (c < 0)
+ goto invalid_code;
+ if (charset->id != charset_ascii
+ && last_id != charset->id)
+ {
+ if (last_id != charset_ascii)
+ ADD_CHARSET_DATA (charbuf, char_offset - last_offset, last_id);
+ last_id = charset->id;
+ last_offset = char_offset;
}
- if (coding->eol_type == CODING_EOL_CR)
+
+ *charbuf++ = c;
+ char_offset++;
+ continue;
+
+ invalid_code:
+ src = src_base;
+ consumed_chars = consumed_chars_base;
+ ONE_MORE_BYTE (c);
+ *charbuf++ = c < 0 ? -c : ASCII_BYTE_P (c) ? c : BYTE8_TO_CHAR (c);
+ char_offset++;
+ coding->errors++;
+ }
+
+ no_more_source:
+ if (last_id != charset_ascii)
+ ADD_CHARSET_DATA (charbuf, char_offset - last_offset, last_id);
+ coding->consumed_char += consumed_chars_base;
+ coding->consumed = src_base - coding->source;
+ coding->charbuf_used = charbuf - coding->charbuf;
+}
+
+static int
+encode_coding_charset (coding)
+ struct coding_system *coding;
+{
+ int multibytep = coding->dst_multibyte;
+ int *charbuf = coding->charbuf;
+ int *charbuf_end = charbuf + coding->charbuf_used;
+ unsigned char *dst = coding->destination + coding->produced;
+ unsigned char *dst_end = coding->destination + coding->dst_bytes;
+ int safe_room = MAX_MULTIBYTE_LENGTH;
+ int produced_chars = 0;
+ Lisp_Object attrs, charset_list;
+ int ascii_compatible;
+ int c;
+
+ CODING_GET_INFO (coding, attrs, charset_list);
+ ascii_compatible = ! NILP (CODING_ATTR_ASCII_COMPAT (attrs));
+
+ while (charbuf < charbuf_end)
+ {
+ struct charset *charset;
+ unsigned code;
+
+ ASSURE_DESTINATION (safe_room);
+ c = *charbuf++;
+ if (ascii_compatible && ASCII_CHAR_P (c))
+ EMIT_ONE_ASCII_BYTE (c);
+ else if (CHAR_BYTE8_P (c))
{
- for (tmp = destination; tmp < dst; tmp++)
- if (*tmp == '\n') *tmp = '\r';
+ c = CHAR_TO_BYTE8 (c);
+ EMIT_ONE_BYTE (c);
}
- else if (selective_display)
+ else
{
- for (tmp = destination; tmp < dst; tmp++)
- if (*tmp == '\r') *tmp = '\n';
+ charset = char_charset (c, charset_list, &code);
+ if (charset)
+ {
+ if (CHARSET_DIMENSION (charset) == 1)
+ EMIT_ONE_BYTE (code);
+ else if (CHARSET_DIMENSION (charset) == 2)
+ EMIT_TWO_BYTES (code >> 8, code & 0xFF);
+ else if (CHARSET_DIMENSION (charset) == 3)
+ EMIT_THREE_BYTES (code >> 16, (code >> 8) & 0xFF, code & 0xFF);
+ else
+ EMIT_FOUR_BYTES (code >> 24, (code >> 16) & 0xFF,
+ (code >> 8) & 0xFF, code & 0xFF);
+ }
+ else
+ {
+ if (coding->mode & CODING_MODE_SAFE_ENCODING)
+ c = CODING_INHIBIT_CHARACTER_SUBSTITUTION;
+ else
+ c = coding->default_char;
+ EMIT_ONE_BYTE (c);
+ }
}
}
- if (coding->src_multibyte)
- dst = destination + str_as_unibyte (destination, dst - destination);
- coding->consumed = src_base - source;
- coding->produced = dst - destination;
- coding->produced_char = coding->produced;
+ record_conversion_result (coding, CODING_RESULT_SUCCESS);
+ coding->produced_char += produced_chars;
+ coding->produced = dst - coding->destination;
+ return 0;
}
/*** 7. C library functions ***/
-/* In Emacs Lisp, a coding system is represented by a Lisp symbol which
- has a property `coding-system'. The value of this property is a
- vector of length 5 (called the coding-vector). Among elements of
- this vector, the first (element[0]) and the fifth (element[4])
- carry important information for decoding/encoding. Before
- decoding/encoding, this information should be set in fields of a
- structure of type `coding_system'.
-
- The value of the property `coding-system' can be a symbol of another
- subsidiary coding-system. In that case, Emacs gets coding-vector
- from that symbol.
-
- `element[0]' contains information to be set in `coding->type'. The
- value and its meaning is as follows:
-
- 0 -- coding_type_emacs_mule
- 1 -- coding_type_sjis
- 2 -- coding_type_iso2022
- 3 -- coding_type_big5
- 4 -- coding_type_ccl encoder/decoder written in CCL
- nil -- coding_type_no_conversion
- t -- coding_type_undecided (automatic conversion on decoding,
- no-conversion on encoding)
-
- `element[4]' contains information to be set in `coding->flags' and
- `coding->spec'. The meaning varies by `coding->type'.
-
- If `coding->type' is `coding_type_iso2022', element[4] is a vector
- of length 32 (of which the first 13 sub-elements are used now).
- Meanings of these sub-elements are:
-
- sub-element[N] where N is 0 through 3: to be set in `coding->spec.iso2022'
- If the value is an integer of valid charset, the charset is
- assumed to be designated to graphic register N initially.
-
- If the value is minus, it is a minus value of charset which
- reserves graphic register N, which means that the charset is
- not designated initially but should be designated to graphic
- register N just before encoding a character in that charset.
-
- If the value is nil, graphic register N is never used on
- encoding.
-
- sub-element[N] where N is 4 through 11: to be set in `coding->flags'
- Each value takes t or nil. See the section ISO2022 of
- `coding.h' for more information.
-
- If `coding->type' is `coding_type_big5', element[4] is t to denote
- BIG5-ETen or nil to denote BIG5-HKU.
-
- If `coding->type' takes the other value, element[4] is ignored.
-
- Emacs Lisp's coding systems also carry information about format of
- end-of-line in a value of property `eol-type'. If the value is
- integer, 0 means CODING_EOL_LF, 1 means CODING_EOL_CRLF, and 2
- means CODING_EOL_CR. If it is not integer, it should be a vector
- of subsidiary coding systems of which property `eol-type' has one
- of the above values.
-
-*/
-
-/* Extract information for decoding/encoding from CODING_SYSTEM_SYMBOL
- and set it in CODING. If CODING_SYSTEM_SYMBOL is invalid, CODING
- is setup so that no conversion is necessary and return -1, else
- return 0. */
+/* Setup coding context CODING from information about CODING_SYSTEM.
+ If CODING_SYSTEM is nil, `no-conversion' is assumed. If
+ CODING_SYSTEM is invalid, signal an error. */
-int
+void
setup_coding_system (coding_system, coding)
Lisp_Object coding_system;
struct coding_system *coding;
{
- Lisp_Object coding_spec, coding_type, eol_type, plist;
+ Lisp_Object attrs;
+ Lisp_Object eol_type;
+ Lisp_Object coding_type;
Lisp_Object val;
- /* At first, zero clear all members. */
- bzero (coding, sizeof (struct coding_system));
-
- /* Initialize some fields required for all kinds of coding systems. */
- coding->symbol = coding_system;
- coding->heading_ascii = -1;
- coding->post_read_conversion = coding->pre_write_conversion = Qnil;
- coding->composing = COMPOSITION_DISABLED;
- coding->cmp_data = NULL;
-
if (NILP (coding_system))
- goto label_invalid_coding_system;
+ coding_system = Qundecided;
- coding_spec = Fget (coding_system, Qcoding_system);
+ CHECK_CODING_SYSTEM_GET_ID (coding_system, coding->id);
- if (!VECTORP (coding_spec)
- || XVECTOR (coding_spec)->size != 5
- || !CONSP (XVECTOR (coding_spec)->contents[3]))
- goto label_invalid_coding_system;
+ attrs = CODING_ID_ATTRS (coding->id);
+ eol_type = CODING_ID_EOL_TYPE (coding->id);
- eol_type = inhibit_eol_conversion ? Qnil : Fget (coding_system, Qeol_type);
+ coding->mode = 0;
+ coding->head_ascii = -1;
if (VECTORP (eol_type))
+ coding->common_flags = (CODING_REQUIRE_DECODING_MASK
+ | CODING_REQUIRE_DETECTION_MASK);
+ else if (! EQ (eol_type, Qunix))
+ coding->common_flags = (CODING_REQUIRE_DECODING_MASK
+ | CODING_REQUIRE_ENCODING_MASK);
+ else
+ coding->common_flags = 0;
+ if (! NILP (CODING_ATTR_POST_READ (attrs)))
+ coding->common_flags |= CODING_REQUIRE_DECODING_MASK;
+ if (! NILP (CODING_ATTR_PRE_WRITE (attrs)))
+ coding->common_flags |= CODING_REQUIRE_ENCODING_MASK;
+ if (! NILP (CODING_ATTR_FOR_UNIBYTE (attrs)))
+ coding->common_flags |= CODING_FOR_UNIBYTE_MASK;
+
+ val = CODING_ATTR_SAFE_CHARSETS (attrs);
+ coding->max_charset_id = SCHARS (val) - 1;
+ coding->safe_charsets = (char *) SDATA (val);
+ coding->default_char = XINT (CODING_ATTR_DEFAULT_CHAR (attrs));
+
+ coding_type = CODING_ATTR_TYPE (attrs);
+ if (EQ (coding_type, Qundecided))
{
- coding->eol_type = CODING_EOL_UNDECIDED;
- coding->common_flags = CODING_REQUIRE_DETECTION_MASK;
- if (system_eol_type != CODING_EOL_LF)
- coding->common_flags |= CODING_REQUIRE_ENCODING_MASK;
+ coding->detector = NULL;
+ coding->decoder = decode_coding_raw_text;
+ coding->encoder = encode_coding_raw_text;
+ coding->common_flags |= CODING_REQUIRE_DETECTION_MASK;
}
- else if (XFASTINT (eol_type) == 1)
+ else if (EQ (coding_type, Qiso_2022))
{
- coding->eol_type = CODING_EOL_CRLF;
+ int i;
+ int flags = XINT (AREF (attrs, coding_attr_iso_flags));
+
+ /* Invoke graphic register 0 to plane 0. */
+ CODING_ISO_INVOCATION (coding, 0) = 0;
+ /* Invoke graphic register 1 to plane 1 if we can use 8-bit. */
+ CODING_ISO_INVOCATION (coding, 1)
+ = (flags & CODING_ISO_FLAG_SEVEN_BITS ? -1 : 1);
+ /* Setup the initial status of designation. */
+ for (i = 0; i < 4; i++)
+ CODING_ISO_DESIGNATION (coding, i) = CODING_ISO_INITIAL (coding, i);
+ /* Not single shifting initially. */
+ CODING_ISO_SINGLE_SHIFTING (coding) = 0;
+ /* Beginning of buffer should also be regarded as bol. */
+ CODING_ISO_BOL (coding) = 1;
+ coding->detector = detect_coding_iso_2022;
+ coding->decoder = decode_coding_iso_2022;
+ coding->encoder = encode_coding_iso_2022;
+ if (flags & CODING_ISO_FLAG_SAFE)
+ coding->mode |= CODING_MODE_SAFE_ENCODING;
coding->common_flags
- = CODING_REQUIRE_DECODING_MASK | CODING_REQUIRE_ENCODING_MASK;
+ |= (CODING_REQUIRE_DECODING_MASK | CODING_REQUIRE_ENCODING_MASK
+ | CODING_REQUIRE_FLUSHING_MASK);
+ if (flags & CODING_ISO_FLAG_COMPOSITION)
+ coding->common_flags |= CODING_ANNOTATE_COMPOSITION_MASK;
+ if (flags & CODING_ISO_FLAG_DESIGNATION)
+ coding->common_flags |= CODING_ANNOTATE_CHARSET_MASK;
+ if (flags & CODING_ISO_FLAG_FULL_SUPPORT)
+ {
+ setup_iso_safe_charsets (attrs);
+ val = CODING_ATTR_SAFE_CHARSETS (attrs);
+ coding->max_charset_id = SCHARS (val) - 1;
+ coding->safe_charsets = (char *) SDATA (val);
+ }
+ CODING_ISO_FLAGS (coding) = flags;
}
- else if (XFASTINT (eol_type) == 2)
+ else if (EQ (coding_type, Qcharset))
{
- coding->eol_type = CODING_EOL_CR;
+ coding->detector = detect_coding_charset;
+ coding->decoder = decode_coding_charset;
+ coding->encoder = encode_coding_charset;
coding->common_flags
- = CODING_REQUIRE_DECODING_MASK | CODING_REQUIRE_ENCODING_MASK;
+ |= (CODING_REQUIRE_DECODING_MASK | CODING_REQUIRE_ENCODING_MASK);
}
- else
+ else if (EQ (coding_type, Qutf_8))
{
- coding->common_flags = 0;
- coding->eol_type = CODING_EOL_LF;
+ coding->detector = detect_coding_utf_8;
+ coding->decoder = decode_coding_utf_8;
+ coding->encoder = encode_coding_utf_8;
+ coding->common_flags
+ |= (CODING_REQUIRE_DECODING_MASK | CODING_REQUIRE_ENCODING_MASK);
+ }
+ else if (EQ (coding_type, Qutf_16))
+ {
+ val = AREF (attrs, coding_attr_utf_16_bom);
+ CODING_UTF_16_BOM (coding) = (CONSP (val) ? utf_16_detect_bom
+ : EQ (val, Qt) ? utf_16_with_bom
+ : utf_16_without_bom);
+ val = AREF (attrs, coding_attr_utf_16_endian);
+ CODING_UTF_16_ENDIAN (coding) = (EQ (val, Qbig) ? utf_16_big_endian
+ : utf_16_little_endian);
+ CODING_UTF_16_SURROGATE (coding) = 0;
+ coding->detector = detect_coding_utf_16;
+ coding->decoder = decode_coding_utf_16;
+ coding->encoder = encode_coding_utf_16;
+ coding->common_flags
+ |= (CODING_REQUIRE_DECODING_MASK | CODING_REQUIRE_ENCODING_MASK);
+ if (CODING_UTF_16_BOM (coding) == utf_16_detect_bom)
+ coding->common_flags |= CODING_REQUIRE_DETECTION_MASK;
}
-
- coding_type = XVECTOR (coding_spec)->contents[0];
- /* Try short cut. */
- if (SYMBOLP (coding_type))
+ else if (EQ (coding_type, Qccl))
+ {
+ coding->detector = detect_coding_ccl;
+ coding->decoder = decode_coding_ccl;
+ coding->encoder = encode_coding_ccl;
+ coding->common_flags
+ |= (CODING_REQUIRE_DECODING_MASK | CODING_REQUIRE_ENCODING_MASK
+ | CODING_REQUIRE_FLUSHING_MASK);
+ }
+ else if (EQ (coding_type, Qemacs_mule))
{
- if (EQ (coding_type, Qt))
+ coding->detector = detect_coding_emacs_mule;
+ coding->decoder = decode_coding_emacs_mule;
+ coding->encoder = encode_coding_emacs_mule;
+ coding->common_flags
+ |= (CODING_REQUIRE_DECODING_MASK | CODING_REQUIRE_ENCODING_MASK);
+ if (! NILP (AREF (attrs, coding_attr_emacs_mule_full))
+ && ! EQ (CODING_ATTR_CHARSET_LIST (attrs), Vemacs_mule_charset_list))
{
- coding->type = coding_type_undecided;
- coding->common_flags |= CODING_REQUIRE_DETECTION_MASK;
+ Lisp_Object tail, safe_charsets;
+ int max_charset_id = 0;
+
+ for (tail = Vemacs_mule_charset_list; CONSP (tail);
+ tail = XCDR (tail))
+ if (max_charset_id < XFASTINT (XCAR (tail)))
+ max_charset_id = XFASTINT (XCAR (tail));
+ safe_charsets = Fmake_string (make_number (max_charset_id + 1),
+ make_number (255));
+ for (tail = Vemacs_mule_charset_list; CONSP (tail);
+ tail = XCDR (tail))
+ SSET (safe_charsets, XFASTINT (XCAR (tail)), 0);
+ coding->max_charset_id = max_charset_id;
+ coding->safe_charsets = (char *) SDATA (safe_charsets);
}
- else
- coding->type = coding_type_no_conversion;
- /* Initialize this member. Any thing other than
- CODING_CATEGORY_IDX_UTF_16_BE and
- CODING_CATEGORY_IDX_UTF_16_LE are ok because they have
- special treatment in detect_eol. */
- coding->category_idx = CODING_CATEGORY_IDX_EMACS_MULE;
-
- return 0;
- }
-
- /* Get values of coding system properties:
- `post-read-conversion', `pre-write-conversion',
- `translation-table-for-decode', `translation-table-for-encode'. */
- plist = XVECTOR (coding_spec)->contents[3];
- /* Pre & post conversion functions should be disabled if
- inhibit_eol_conversion is nonzero. This is the case that a code
- conversion function is called while those functions are running. */
- if (! inhibit_pre_post_conversion)
- {
- coding->post_read_conversion = Fplist_get (plist, Qpost_read_conversion);
- coding->pre_write_conversion = Fplist_get (plist, Qpre_write_conversion);
- }
- val = Fplist_get (plist, Qtranslation_table_for_decode);
- if (SYMBOLP (val))
- val = Fget (val, Qtranslation_table_for_decode);
- coding->translation_table_for_decode = CHAR_TABLE_P (val) ? val : Qnil;
- val = Fplist_get (plist, Qtranslation_table_for_encode);
- if (SYMBOLP (val))
- val = Fget (val, Qtranslation_table_for_encode);
- coding->translation_table_for_encode = CHAR_TABLE_P (val) ? val : Qnil;
- val = Fplist_get (plist, Qcoding_category);
- if (!NILP (val))
- {
- val = Fget (val, Qcoding_category_index);
- if (INTEGERP (val))
- coding->category_idx = XINT (val);
- else
- goto label_invalid_coding_system;
}
- else
- goto label_invalid_coding_system;
-
- /* If the coding system has non-nil `composition' property, enable
- composition handling. */
- val = Fplist_get (plist, Qcomposition);
- if (!NILP (val))
- coding->composing = COMPOSITION_NO;
-
- /* If the coding system is ascii-incompatible, record it in
- common_flags. */
- val = Fplist_get (plist, Qascii_incompatible);
- if (! NILP (val))
- coding->common_flags |= CODING_ASCII_INCOMPATIBLE_MASK;
-
- switch (XFASTINT (coding_type))
+ else if (EQ (coding_type, Qshift_jis))
{
- case 0:
- coding->type = coding_type_emacs_mule;
+ coding->detector = detect_coding_sjis;
+ coding->decoder = decode_coding_sjis;
+ coding->encoder = encode_coding_sjis;
coding->common_flags
- |= CODING_REQUIRE_DECODING_MASK | CODING_REQUIRE_ENCODING_MASK;
- if (!NILP (coding->post_read_conversion))
- coding->common_flags |= CODING_REQUIRE_DECODING_MASK;
- if (!NILP (coding->pre_write_conversion))
- coding->common_flags |= CODING_REQUIRE_ENCODING_MASK;
- break;
-
- case 1:
- coding->type = coding_type_sjis;
- coding->common_flags
- |= CODING_REQUIRE_DECODING_MASK | CODING_REQUIRE_ENCODING_MASK;
- break;
-
- case 2:
- coding->type = coding_type_iso2022;
- coding->common_flags
- |= CODING_REQUIRE_DECODING_MASK | CODING_REQUIRE_ENCODING_MASK;
- {
- Lisp_Object val, temp;
- Lisp_Object *flags;
- int i, charset, reg_bits = 0;
-
- val = XVECTOR (coding_spec)->contents[4];
-
- if (!VECTORP (val) || XVECTOR (val)->size != 32)
- goto label_invalid_coding_system;
-
- flags = XVECTOR (val)->contents;
- coding->flags
- = ((NILP (flags[4]) ? 0 : CODING_FLAG_ISO_SHORT_FORM)
- | (NILP (flags[5]) ? 0 : CODING_FLAG_ISO_RESET_AT_EOL)
- | (NILP (flags[6]) ? 0 : CODING_FLAG_ISO_RESET_AT_CNTL)
- | (NILP (flags[7]) ? 0 : CODING_FLAG_ISO_SEVEN_BITS)
- | (NILP (flags[8]) ? 0 : CODING_FLAG_ISO_LOCKING_SHIFT)
- | (NILP (flags[9]) ? 0 : CODING_FLAG_ISO_SINGLE_SHIFT)
- | (NILP (flags[10]) ? 0 : CODING_FLAG_ISO_USE_ROMAN)
- | (NILP (flags[11]) ? 0 : CODING_FLAG_ISO_USE_OLDJIS)
- | (NILP (flags[12]) ? 0 : CODING_FLAG_ISO_NO_DIRECTION)
- | (NILP (flags[13]) ? 0 : CODING_FLAG_ISO_INIT_AT_BOL)
- | (NILP (flags[14]) ? 0 : CODING_FLAG_ISO_DESIGNATE_AT_BOL)
- | (NILP (flags[15]) ? 0 : CODING_FLAG_ISO_SAFE)
- | (NILP (flags[16]) ? 0 : CODING_FLAG_ISO_LATIN_EXTRA)
- );
-
- /* Invoke graphic register 0 to plane 0. */
- CODING_SPEC_ISO_INVOCATION (coding, 0) = 0;
- /* Invoke graphic register 1 to plane 1 if we can use full 8-bit. */
- CODING_SPEC_ISO_INVOCATION (coding, 1)
- = (coding->flags & CODING_FLAG_ISO_SEVEN_BITS ? -1 : 1);
- /* Not single shifting at first. */
- CODING_SPEC_ISO_SINGLE_SHIFTING (coding) = 0;
- /* Beginning of buffer should also be regarded as bol. */
- CODING_SPEC_ISO_BOL (coding) = 1;
-
- for (charset = 0; charset <= MAX_CHARSET; charset++)
- CODING_SPEC_ISO_REVISION_NUMBER (coding, charset) = 255;
- val = Vcharset_revision_alist;
- while (CONSP (val))
- {
- charset = get_charset_id (Fcar_safe (XCAR (val)));
- if (charset >= 0
- && (temp = Fcdr_safe (XCAR (val)), INTEGERP (temp))
- && (i = XINT (temp), (i >= 0 && (i + '@') < 128)))
- CODING_SPEC_ISO_REVISION_NUMBER (coding, charset) = i;
- val = XCDR (val);
- }
-
- /* Checks FLAGS[REG] (REG = 0, 1, 2 3) and decide designations.
- FLAGS[REG] can be one of below:
- integer CHARSET: CHARSET occupies register I,
- t: designate nothing to REG initially, but can be used
- by any charsets,
- list of integer, nil, or t: designate the first
- element (if integer) to REG initially, the remaining
- elements (if integer) is designated to REG on request,
- if an element is t, REG can be used by any charsets,
- nil: REG is never used. */
- for (charset = 0; charset <= MAX_CHARSET; charset++)
- CODING_SPEC_ISO_REQUESTED_DESIGNATION (coding, charset)
- = CODING_SPEC_ISO_NO_REQUESTED_DESIGNATION;
- for (i = 0; i < 4; i++)
- {
- if ((INTEGERP (flags[i])
- && (charset = XINT (flags[i]), CHARSET_VALID_P (charset)))
- || (charset = get_charset_id (flags[i])) >= 0)
- {
- CODING_SPEC_ISO_INITIAL_DESIGNATION (coding, i) = charset;
- CODING_SPEC_ISO_REQUESTED_DESIGNATION (coding, charset) = i;
- }
- else if (EQ (flags[i], Qt))
- {
- CODING_SPEC_ISO_INITIAL_DESIGNATION (coding, i) = -1;
- reg_bits |= 1 << i;
- coding->flags |= CODING_FLAG_ISO_DESIGNATION;
- }
- else if (CONSP (flags[i]))
- {
- Lisp_Object tail;
- tail = flags[i];
-
- coding->flags |= CODING_FLAG_ISO_DESIGNATION;
- if ((INTEGERP (XCAR (tail))
- && (charset = XINT (XCAR (tail)),
- CHARSET_VALID_P (charset)))
- || (charset = get_charset_id (XCAR (tail))) >= 0)
- {
- CODING_SPEC_ISO_INITIAL_DESIGNATION (coding, i) = charset;
- CODING_SPEC_ISO_REQUESTED_DESIGNATION (coding, charset) =i;
- }
- else
- CODING_SPEC_ISO_INITIAL_DESIGNATION (coding, i) = -1;
- tail = XCDR (tail);
- while (CONSP (tail))
- {
- if ((INTEGERP (XCAR (tail))
- && (charset = XINT (XCAR (tail)),
- CHARSET_VALID_P (charset)))
- || (charset = get_charset_id (XCAR (tail))) >= 0)
- CODING_SPEC_ISO_REQUESTED_DESIGNATION (coding, charset)
- = i;
- else if (EQ (XCAR (tail), Qt))
- reg_bits |= 1 << i;
- tail = XCDR (tail);
- }
- }
- else
- CODING_SPEC_ISO_INITIAL_DESIGNATION (coding, i) = -1;
-
- CODING_SPEC_ISO_DESIGNATION (coding, i)
- = CODING_SPEC_ISO_INITIAL_DESIGNATION (coding, i);
- }
-
- if (reg_bits && ! (coding->flags & CODING_FLAG_ISO_LOCKING_SHIFT))
- {
- /* REG 1 can be used only by locking shift in 7-bit env. */
- if (coding->flags & CODING_FLAG_ISO_SEVEN_BITS)
- reg_bits &= ~2;
- if (! (coding->flags & CODING_FLAG_ISO_SINGLE_SHIFT))
- /* Without any shifting, only REG 0 and 1 can be used. */
- reg_bits &= 3;
- }
-
- if (reg_bits)
- for (charset = 0; charset <= MAX_CHARSET; charset++)
- {
- if (CHARSET_DEFINED_P (charset)
- && (CODING_SPEC_ISO_REQUESTED_DESIGNATION (coding, charset)
- == CODING_SPEC_ISO_NO_REQUESTED_DESIGNATION))
- {
- /* There exist some default graphic registers to be
- used by CHARSET. */
-
- /* We had better avoid designating a charset of
- CHARS96 to REG 0 as far as possible. */
- if (CHARSET_CHARS (charset) == 96)
- CODING_SPEC_ISO_REQUESTED_DESIGNATION (coding, charset)
- = (reg_bits & 2
- ? 1 : (reg_bits & 4 ? 2 : (reg_bits & 8 ? 3 : 0)));
- else
- CODING_SPEC_ISO_REQUESTED_DESIGNATION (coding, charset)
- = (reg_bits & 1
- ? 0 : (reg_bits & 2 ? 1 : (reg_bits & 4 ? 2 : 3)));
- }
- }
- }
- coding->common_flags |= CODING_REQUIRE_FLUSHING_MASK;
- coding->spec.iso2022.last_invalid_designation_register = -1;
- break;
-
- case 3:
- coding->type = coding_type_big5;
- coding->common_flags
- |= CODING_REQUIRE_DECODING_MASK | CODING_REQUIRE_ENCODING_MASK;
- coding->flags
- = (NILP (XVECTOR (coding_spec)->contents[4])
- ? CODING_FLAG_BIG5_HKU
- : CODING_FLAG_BIG5_ETEN);
- break;
-
- case 4:
- coding->type = coding_type_ccl;
+ |= (CODING_REQUIRE_DECODING_MASK | CODING_REQUIRE_ENCODING_MASK);
+ }
+ else if (EQ (coding_type, Qbig5))
+ {
+ coding->detector = detect_coding_big5;
+ coding->decoder = decode_coding_big5;
+ coding->encoder = encode_coding_big5;
coding->common_flags
- |= CODING_REQUIRE_DECODING_MASK | CODING_REQUIRE_ENCODING_MASK;
- {
- val = XVECTOR (coding_spec)->contents[4];
- if (! CONSP (val)
- || setup_ccl_program (&(coding->spec.ccl.decoder),
- XCAR (val)) < 0
- || setup_ccl_program (&(coding->spec.ccl.encoder),
- XCDR (val)) < 0)
- goto label_invalid_coding_system;
-
- bzero (coding->spec.ccl.valid_codes, 256);
- val = Fplist_get (plist, Qvalid_codes);
- if (CONSP (val))
- {
- Lisp_Object this;
-
- for (; CONSP (val); val = XCDR (val))
- {
- this = XCAR (val);
- if (INTEGERP (this)
- && XINT (this) >= 0 && XINT (this) < 256)
- coding->spec.ccl.valid_codes[XINT (this)] = 1;
- else if (CONSP (this)
- && INTEGERP (XCAR (this))
- && INTEGERP (XCDR (this)))
- {
- int start = XINT (XCAR (this));
- int end = XINT (XCDR (this));
-
- if (start >= 0 && start <= end && end < 256)
- while (start <= end)
- coding->spec.ccl.valid_codes[start++] = 1;
- }
- }
- }
- }
- coding->common_flags |= CODING_REQUIRE_FLUSHING_MASK;
- coding->spec.ccl.cr_carryover = 0;
- coding->spec.ccl.eight_bit_carryover[0] = 0;
- break;
-
- case 5:
- coding->type = coding_type_raw_text;
- break;
+ |= (CODING_REQUIRE_DECODING_MASK | CODING_REQUIRE_ENCODING_MASK);
+ }
+ else /* EQ (coding_type, Qraw_text) */
+ {
+ coding->detector = NULL;
+ coding->decoder = decode_coding_raw_text;
+ coding->encoder = encode_coding_raw_text;
+ if (! EQ (eol_type, Qunix))
+ {
+ coding->common_flags |= CODING_REQUIRE_DECODING_MASK;
+ if (! VECTORP (eol_type))
+ coding->common_flags |= CODING_REQUIRE_ENCODING_MASK;
+ }
- default:
- goto label_invalid_coding_system;
}
- return 0;
- label_invalid_coding_system:
- coding->type = coding_type_no_conversion;
- coding->category_idx = CODING_CATEGORY_IDX_BINARY;
- coding->common_flags = 0;
- coding->eol_type = CODING_EOL_UNDECIDED;
- coding->pre_write_conversion = coding->post_read_conversion = Qnil;
- return NILP (coding_system) ? 0 : -1;
+ return;
}
-/* Free memory blocks allocated for storing composition information. */
+/* Return a list of charsets supported by CODING. */
-void
-coding_free_composition_data (coding)
+Lisp_Object
+coding_charset_list (coding)
struct coding_system *coding;
{
- struct composition_data *cmp_data = coding->cmp_data, *next;
+ Lisp_Object attrs, charset_list;
- if (!cmp_data)
- return;
- /* Memory blocks are chained. At first, rewind to the first, then,
- free blocks one by one. */
- while (cmp_data->prev)
- cmp_data = cmp_data->prev;
- while (cmp_data)
+ CODING_GET_INFO (coding, attrs, charset_list);
+ if (EQ (CODING_ATTR_TYPE (attrs), Qiso_2022))
{
- next = cmp_data->next;
- xfree (cmp_data);
- cmp_data = next;
+ int flags = XINT (AREF (attrs, coding_attr_iso_flags));
+
+ if (flags & CODING_ISO_FLAG_FULL_SUPPORT)
+ charset_list = Viso_2022_charset_list;
+ }
+ else if (EQ (CODING_ATTR_TYPE (attrs), Qemacs_mule))
+ {
+ charset_list = Vemacs_mule_charset_list;
}
- coding->cmp_data = NULL;
+ return charset_list;
}
-/* Set `char_offset' member of all memory blocks pointed by
- coding->cmp_data to POS. */
-void
-coding_adjust_composition_offset (coding, pos)
- struct coding_system *coding;
- int pos;
+/* Return raw-text or one of its subsidiaries that has the same
+ eol_type as CODING-SYSTEM. */
+
+Lisp_Object
+raw_text_coding_system (coding_system)
+ Lisp_Object coding_system;
{
- struct composition_data *cmp_data;
+ Lisp_Object spec, attrs;
+ Lisp_Object eol_type, raw_text_eol_type;
+
+ if (NILP (coding_system))
+ return Qraw_text;
+ spec = CODING_SYSTEM_SPEC (coding_system);
+ attrs = AREF (spec, 0);
- for (cmp_data = coding->cmp_data; cmp_data; cmp_data = cmp_data->next)
- cmp_data->char_offset = pos;
+ if (EQ (CODING_ATTR_TYPE (attrs), Qraw_text))
+ return coding_system;
+
+ eol_type = AREF (spec, 2);
+ if (VECTORP (eol_type))
+ return Qraw_text;
+ spec = CODING_SYSTEM_SPEC (Qraw_text);
+ raw_text_eol_type = AREF (spec, 2);
+ return (EQ (eol_type, Qunix) ? AREF (raw_text_eol_type, 0)
+ : EQ (eol_type, Qdos) ? AREF (raw_text_eol_type, 1)
+ : AREF (raw_text_eol_type, 2));
}
-/* Setup raw-text or one of its subsidiaries in the structure
- coding_system CODING according to the already setup value eol_type
- in CODING. CODING should be setup for some coding system in
- advance. */
-void
-setup_raw_text_coding_system (coding)
- struct coding_system *coding;
+/* If CODING_SYSTEM doesn't specify end-of-line format but PARENT
+ does, return one of the subsidiary that has the same eol-spec as
+ PARENT. Otherwise, return CODING_SYSTEM. If PARENT is nil,
+ inherit end-of-line format from the system's setting
+ (system_eol_type). */
+
+Lisp_Object
+coding_inherit_eol_type (coding_system, parent)
+ Lisp_Object coding_system, parent;
{
- if (coding->type != coding_type_raw_text)
+ Lisp_Object spec, eol_type;
+
+ if (NILP (coding_system))
+ coding_system = Qraw_text;
+ spec = CODING_SYSTEM_SPEC (coding_system);
+ eol_type = AREF (spec, 2);
+ if (VECTORP (eol_type))
{
- coding->symbol = Qraw_text;
- coding->type = coding_type_raw_text;
- if (coding->eol_type != CODING_EOL_UNDECIDED)
+ Lisp_Object parent_eol_type;
+
+ if (! NILP (parent))
{
- Lisp_Object subsidiaries;
- subsidiaries = Fget (Qraw_text, Qeol_type);
+ Lisp_Object parent_spec;
- if (VECTORP (subsidiaries)
- && XVECTOR (subsidiaries)->size == 3)
- coding->symbol
- = XVECTOR (subsidiaries)->contents[coding->eol_type];
+ parent_spec = CODING_SYSTEM_SPEC (parent);
+ parent_eol_type = AREF (parent_spec, 2);
}
- setup_coding_system (coding->symbol, coding);
- }
- return;
+ else
+ parent_eol_type = system_eol_type;
+ if (EQ (parent_eol_type, Qunix))
+ coding_system = AREF (eol_type, 0);
+ else if (EQ (parent_eol_type, Qdos))
+ coding_system = AREF (eol_type, 1);
+ else if (EQ (parent_eol_type, Qmac))
+ coding_system = AREF (eol_type, 2);
+ }
+ return coding_system;
}
/* Emacs has a mechanism to automatically detect a coding system if it
@@ -4042,14 +5326,14 @@ setup_raw_text_coding_system (coding)
o coding-category-iso-7-else
The category for a coding system which has the same code range
- as ISO2022 of 7-bit environment but uses locking shift or
+ as ISO2022 of 7-bit environemnt but uses locking shift or
single shift functions. Assigned the coding-system (Lisp
symbol) `iso-2022-7bit-lock' by default.
o coding-category-iso-8-else
The category for a coding system which has the same code range
- as ISO2022 of 8-bit environment but uses locking shift or
+ as ISO2022 of 8-bit environemnt but uses locking shift or
single shift functions. Assigned the coding-system (Lisp
symbol) `iso-2022-8bit-ss2' by default.
@@ -4092,2425 +5376,1788 @@ setup_raw_text_coding_system (coding)
`no-conversion' by default.
Each of them is a Lisp symbol and the value is an actual
- `coding-system' (this is also a Lisp symbol) assigned by a user.
+ `coding-system's (this is also a Lisp symbol) assigned by a user.
What Emacs does actually is to detect a category of coding system.
Then, it uses a `coding-system' assigned to it. If Emacs can't
- decide a single possible category, it selects a category of the
+ decide only one possible category, it selects a category of the
highest priority. Priorities of categories are also specified by a
user in a Lisp variable `coding-category-list'.
*/
-static
-int ascii_skip_code[256];
+#define EOL_SEEN_NONE 0
+#define EOL_SEEN_LF 1
+#define EOL_SEEN_CR 2
+#define EOL_SEEN_CRLF 4
+
+/* Detect how end-of-line of a text of length SRC_BYTES pointed by
+ SOURCE is encoded. If CATEGORY is one of
+ coding_category_utf_16_XXXX, assume that CR and LF are encoded by
+ two-byte, else they are encoded by one-byte.
-/* Detect how a text of length SRC_BYTES pointed by SOURCE is encoded.
- If it detects possible coding systems, return an integer in which
- appropriate flag bits are set. Flag bits are defined by macros
- CODING_CATEGORY_MASK_XXX in `coding.h'. If PRIORITIES is non-NULL,
- it should point the table `coding_priorities'. In that case, only
- the flag bit for a coding system of the highest priority is set in
- the returned value. If MULTIBYTEP is nonzero, 8-bit codes of the
- range 0x80..0x9F are in multibyte form.
+ Return one of EOL_SEEN_XXX. */
- How many ASCII characters are at the head is returned as *SKIP. */
+#define MAX_EOL_CHECK_COUNT 3
static int
-detect_coding_mask (source, src_bytes, priorities, skip, multibytep)
- unsigned char *source;
- int src_bytes, *priorities, *skip;
- int multibytep;
+detect_eol (source, src_bytes, category)
+ const unsigned char *source;
+ EMACS_INT src_bytes;
+ enum coding_category category;
{
- register unsigned char c;
- unsigned char *src = source, *src_end = source + src_bytes;
- unsigned int mask, utf16_examined_p, iso2022_examined_p;
- int i;
+ const unsigned char *src = source, *src_end = src + src_bytes;
+ unsigned char c;
+ int total = 0;
+ int eol_seen = EOL_SEEN_NONE;
- /* At first, skip all ASCII characters and control characters except
- for three ISO2022 specific control characters. */
- ascii_skip_code[ISO_CODE_SO] = 0;
- ascii_skip_code[ISO_CODE_SI] = 0;
- ascii_skip_code[ISO_CODE_ESC] = 0;
-
- label_loop_detect_coding:
- while (src < src_end && ascii_skip_code[*src]) src++;
- *skip = src - source;
-
- if (src >= src_end)
- /* We found nothing other than ASCII. There's nothing to do. */
- return 0;
-
- c = *src;
- /* The text seems to be encoded in some multilingual coding system.
- Now, try to find in which coding system the text is encoded. */
- if (c < 0x80)
- {
- /* i.e. (c == ISO_CODE_ESC || c == ISO_CODE_SI || c == ISO_CODE_SO) */
- /* C is an ISO2022 specific control code of C0. */
- mask = detect_coding_iso2022 (src, src_end, multibytep);
- if (mask == 0)
- {
- /* No valid ISO2022 code follows C. Try again. */
- src++;
- if (c == ISO_CODE_ESC)
- ascii_skip_code[ISO_CODE_ESC] = 1;
- else
- ascii_skip_code[ISO_CODE_SO] = ascii_skip_code[ISO_CODE_SI] = 1;
- goto label_loop_detect_coding;
- }
- if (priorities)
+ if ((1 << category) & CATEGORY_MASK_UTF_16)
+ {
+ int msb, lsb;
+
+ msb = category == (coding_category_utf_16_le
+ | coding_category_utf_16_le_nosig);
+ lsb = 1 - msb;
+
+ while (src + 1 < src_end)
{
- for (i = 0; i < CODING_CATEGORY_IDX_MAX; i++)
+ c = src[lsb];
+ if (src[msb] == 0 && (c == '\n' || c == '\r'))
{
- if (mask & priorities[i])
- return priorities[i];
+ int this_eol;
+
+ if (c == '\n')
+ this_eol = EOL_SEEN_LF;
+ else if (src + 3 >= src_end
+ || src[msb + 2] != 0
+ || src[lsb + 2] != '\n')
+ this_eol = EOL_SEEN_CR;
+ else
+ this_eol = EOL_SEEN_CRLF;
+
+ if (eol_seen == EOL_SEEN_NONE)
+ /* This is the first end-of-line. */
+ eol_seen = this_eol;
+ else if (eol_seen != this_eol)
+ {
+ /* The found type is different from what found before. */
+ eol_seen = EOL_SEEN_LF;
+ break;
+ }
+ if (++total == MAX_EOL_CHECK_COUNT)
+ break;
}
- return CODING_CATEGORY_MASK_RAW_TEXT;
+ src += 2;
}
}
else
{
- int try;
-
- if (multibytep && c == LEADING_CODE_8_BIT_CONTROL)
- c = src[1] - 0x20;
-
- if (c < 0xA0)
- {
- /* C is the first byte of SJIS character code,
- or a leading-code of Emacs' internal format (emacs-mule),
- or the first byte of UTF-16. */
- try = (CODING_CATEGORY_MASK_SJIS
- | CODING_CATEGORY_MASK_EMACS_MULE
- | CODING_CATEGORY_MASK_UTF_16_BE
- | CODING_CATEGORY_MASK_UTF_16_LE);
-
- /* Or, if C is a special latin extra code,
- or is an ISO2022 specific control code of C1 (SS2 or SS3),
- or is an ISO2022 control-sequence-introducer (CSI),
- we should also consider the possibility of ISO2022 codings. */
- if ((VECTORP (Vlatin_extra_code_table)
- && !NILP (XVECTOR (Vlatin_extra_code_table)->contents[c]))
- || (c == ISO_CODE_SS2 || c == ISO_CODE_SS3)
- || (c == ISO_CODE_CSI
- && (src < src_end
- && (*src == ']'
- || ((*src == '0' || *src == '1' || *src == '2')
- && src + 1 < src_end
- && src[1] == ']')))))
- try |= (CODING_CATEGORY_MASK_ISO_8_ELSE
- | CODING_CATEGORY_MASK_ISO_8BIT);
- }
- else
- /* C is a character of ISO2022 in graphic plane right,
- or a SJIS's 1-byte character code (i.e. JISX0201),
- or the first byte of BIG5's 2-byte code,
- or the first byte of UTF-8/16. */
- try = (CODING_CATEGORY_MASK_ISO_8_ELSE
- | CODING_CATEGORY_MASK_ISO_8BIT
- | CODING_CATEGORY_MASK_SJIS
- | CODING_CATEGORY_MASK_BIG5
- | CODING_CATEGORY_MASK_UTF_8
- | CODING_CATEGORY_MASK_UTF_16_BE
- | CODING_CATEGORY_MASK_UTF_16_LE);
-
- /* Or, we may have to consider the possibility of CCL. */
- if (coding_system_table[CODING_CATEGORY_IDX_CCL]
- && (coding_system_table[CODING_CATEGORY_IDX_CCL]
- ->spec.ccl.valid_codes)[c])
- try |= CODING_CATEGORY_MASK_CCL;
-
- mask = 0;
- utf16_examined_p = iso2022_examined_p = 0;
- if (priorities)
- {
- for (i = 0; i < CODING_CATEGORY_IDX_MAX; i++)
+ while (src < src_end)
+ {
+ c = *src++;
+ if (c == '\n' || c == '\r')
{
- if (!iso2022_examined_p
- && (priorities[i] & try & CODING_CATEGORY_MASK_ISO))
- {
- mask |= detect_coding_iso2022 (src, src_end, multibytep);
- iso2022_examined_p = 1;
- }
- else if (priorities[i] & try & CODING_CATEGORY_MASK_SJIS)
- mask |= detect_coding_sjis (src, src_end, multibytep);
- else if (priorities[i] & try & CODING_CATEGORY_MASK_UTF_8)
- mask |= detect_coding_utf_8 (src, src_end, multibytep);
- else if (!utf16_examined_p
- && (priorities[i] & try &
- CODING_CATEGORY_MASK_UTF_16_BE_LE))
+ int this_eol;
+
+ if (c == '\n')
+ this_eol = EOL_SEEN_LF;
+ else if (src >= src_end || *src != '\n')
+ this_eol = EOL_SEEN_CR;
+ else
+ this_eol = EOL_SEEN_CRLF, src++;
+
+ if (eol_seen == EOL_SEEN_NONE)
+ /* This is the first end-of-line. */
+ eol_seen = this_eol;
+ else if (eol_seen != this_eol)
{
- mask |= detect_coding_utf_16 (src, src_end, multibytep);
- utf16_examined_p = 1;
+ /* The found type is different from what found before. */
+ eol_seen = EOL_SEEN_LF;
+ break;
}
- else if (priorities[i] & try & CODING_CATEGORY_MASK_BIG5)
- mask |= detect_coding_big5 (src, src_end, multibytep);
- else if (priorities[i] & try & CODING_CATEGORY_MASK_EMACS_MULE)
- mask |= detect_coding_emacs_mule (src, src_end, multibytep);
- else if (priorities[i] & try & CODING_CATEGORY_MASK_CCL)
- mask |= detect_coding_ccl (src, src_end, multibytep);
- else if (priorities[i] & CODING_CATEGORY_MASK_RAW_TEXT)
- mask |= CODING_CATEGORY_MASK_RAW_TEXT;
- else if (priorities[i] & CODING_CATEGORY_MASK_BINARY)
- mask |= CODING_CATEGORY_MASK_BINARY;
- if (mask & priorities[i])
- return priorities[i];
+ if (++total == MAX_EOL_CHECK_COUNT)
+ break;
}
- return CODING_CATEGORY_MASK_RAW_TEXT;
- }
- if (try & CODING_CATEGORY_MASK_ISO)
- mask |= detect_coding_iso2022 (src, src_end, multibytep);
- if (try & CODING_CATEGORY_MASK_SJIS)
- mask |= detect_coding_sjis (src, src_end, multibytep);
- if (try & CODING_CATEGORY_MASK_BIG5)
- mask |= detect_coding_big5 (src, src_end, multibytep);
- if (try & CODING_CATEGORY_MASK_UTF_8)
- mask |= detect_coding_utf_8 (src, src_end, multibytep);
- if (try & CODING_CATEGORY_MASK_UTF_16_BE_LE)
- mask |= detect_coding_utf_16 (src, src_end, multibytep);
- if (try & CODING_CATEGORY_MASK_EMACS_MULE)
- mask |= detect_coding_emacs_mule (src, src_end, multibytep);
- if (try & CODING_CATEGORY_MASK_CCL)
- mask |= detect_coding_ccl (src, src_end, multibytep);
- }
- return (mask | CODING_CATEGORY_MASK_RAW_TEXT | CODING_CATEGORY_MASK_BINARY);
+ }
+ }
+ return eol_seen;
}
-/* Detect how a text of length SRC_BYTES pointed by SRC is encoded.
- The information of the detected coding system is set in CODING. */
-void
-detect_coding (coding, src, src_bytes)
+static Lisp_Object
+adjust_coding_eol_type (coding, eol_seen)
struct coding_system *coding;
- const unsigned char *src;
- int src_bytes;
+ int eol_seen;
{
- unsigned int idx;
- int skip, mask;
- Lisp_Object val;
+ Lisp_Object eol_type;
- val = Vcoding_category_list;
- mask = detect_coding_mask (src, src_bytes, coding_priorities, &skip,
- coding->src_multibyte);
- coding->heading_ascii = skip;
-
- if (!mask) return;
-
- /* We found a single coding system of the highest priority in MASK. */
- idx = 0;
- while (mask && ! (mask & 1)) mask >>= 1, idx++;
- if (! mask)
- idx = CODING_CATEGORY_IDX_RAW_TEXT;
-
- val = SYMBOL_VALUE (XVECTOR (Vcoding_category_table)->contents[idx]);
-
- if (coding->eol_type != CODING_EOL_UNDECIDED)
+ eol_type = CODING_ID_EOL_TYPE (coding->id);
+ if (eol_seen & EOL_SEEN_LF)
{
- Lisp_Object tmp;
-
- tmp = Fget (val, Qeol_type);
- if (VECTORP (tmp))
- val = XVECTOR (tmp)->contents[coding->eol_type];
+ coding->id = CODING_SYSTEM_ID (AREF (eol_type, 0));
+ eol_type = Qunix;
}
-
- /* Setup this new coding system while preserving some slots. */
- {
- int src_multibyte = coding->src_multibyte;
- int dst_multibyte = coding->dst_multibyte;
-
- setup_coding_system (val, coding);
- coding->src_multibyte = src_multibyte;
- coding->dst_multibyte = dst_multibyte;
- coding->heading_ascii = skip;
- }
+ else if (eol_seen & EOL_SEEN_CRLF)
+ {
+ coding->id = CODING_SYSTEM_ID (AREF (eol_type, 1));
+ eol_type = Qdos;
+ }
+ else if (eol_seen & EOL_SEEN_CR)
+ {
+ coding->id = CODING_SYSTEM_ID (AREF (eol_type, 2));
+ eol_type = Qmac;
+ }
+ return eol_type;
}
-/* Detect how end-of-line of a text of length SRC_BYTES pointed by
- SOURCE is encoded. Return one of CODING_EOL_LF, CODING_EOL_CRLF,
- CODING_EOL_CR, and CODING_EOL_UNDECIDED.
-
- How many non-eol characters are at the head is returned as *SKIP. */
-
-#define MAX_EOL_CHECK_COUNT 3
+/* Detect how a text specified in CODING is encoded. If a coding
+ system is detected, update fields of CODING by the detected coding
+ system. */
-static int
-detect_eol_type (source, src_bytes, skip)
- const unsigned char *source;
- int src_bytes, *skip;
+void
+detect_coding (coding)
+ struct coding_system *coding;
{
- const unsigned char *src = source, *src_end = src + src_bytes;
- unsigned char c;
- int total = 0; /* How many end-of-lines are found so far. */
- int eol_type = CODING_EOL_UNDECIDED;
- int this_eol_type;
+ const unsigned char *src, *src_end;
- *skip = 0;
+ coding->consumed = coding->consumed_char = 0;
+ coding->produced = coding->produced_char = 0;
+ coding_set_source (coding);
+
+ src_end = coding->source + coding->src_bytes;
- while (src < src_end && total < MAX_EOL_CHECK_COUNT)
+ /* If we have not yet decided the text encoding type, detect it
+ now. */
+ if (EQ (CODING_ATTR_TYPE (CODING_ID_ATTRS (coding->id)), Qundecided))
{
- c = *src++;
- if (c == '\n' || c == '\r')
- {
- if (*skip == 0)
- *skip = src - 1 - source;
- total++;
- if (c == '\n')
- this_eol_type = CODING_EOL_LF;
- else if (src >= src_end || *src != '\n')
- this_eol_type = CODING_EOL_CR;
- else
- this_eol_type = CODING_EOL_CRLF, src++;
+ int c, i;
+ struct coding_detection_info detect_info;
- if (eol_type == CODING_EOL_UNDECIDED)
- /* This is the first end-of-line. */
- eol_type = this_eol_type;
- else if (eol_type != this_eol_type)
+ detect_info.checked = detect_info.found = detect_info.rejected = 0;
+ for (i = 0, src = coding->source; src < src_end; i++, src++)
+ {
+ c = *src;
+ if (c & 0x80)
+ break;
+ if (c < 0x20
+ && (c == ISO_CODE_ESC || c == ISO_CODE_SI || c == ISO_CODE_SO)
+ && ! inhibit_iso_escape_detection
+ && ! detect_info.checked)
{
- /* The found type is different from what found before. */
- eol_type = CODING_EOL_INCONSISTENT;
- break;
+ coding->head_ascii = src - (coding->source + coding->consumed);
+ if (detect_coding_iso_2022 (coding, &detect_info))
+ {
+ /* We have scanned the whole data. */
+ if (! (detect_info.rejected & CATEGORY_MASK_ISO_7_ELSE))
+ /* We didn't find an 8-bit code. */
+ src = src_end;
+ break;
+ }
}
}
+ coding->head_ascii = src - (coding->source + coding->consumed);
+
+ if (coding->head_ascii < coding->src_bytes
+ || detect_info.found)
+ {
+ enum coding_category category;
+ struct coding_system *this;
+
+ if (coding->head_ascii == coding->src_bytes)
+ /* As all bytes are 7-bit, we can ignore non-ISO-2022 codings. */
+ for (i = 0; i < coding_category_raw_text; i++)
+ {
+ category = coding_priorities[i];
+ this = coding_categories + category;
+ if (detect_info.found & (1 << category))
+ break;
+ }
+ else
+ for (i = 0; i < coding_category_raw_text; i++)
+ {
+ category = coding_priorities[i];
+ this = coding_categories + category;
+ if (this->id < 0)
+ {
+ /* No coding system of this category is defined. */
+ detect_info.rejected |= (1 << category);
+ }
+ else if (category >= coding_category_raw_text)
+ continue;
+ else if (detect_info.checked & (1 << category))
+ {
+ if (detect_info.found & (1 << category))
+ break;
+ }
+ else if ((*(this->detector)) (coding, &detect_info)
+ && detect_info.found & (1 << category))
+ {
+ if (category == coding_category_utf_16_auto)
+ {
+ if (detect_info.found & CATEGORY_MASK_UTF_16_LE)
+ category = coding_category_utf_16_le;
+ else
+ category = coding_category_utf_16_be;
+ }
+ break;
+ }
+ }
+
+ if (i < coding_category_raw_text)
+ setup_coding_system (CODING_ID_NAME (this->id), coding);
+ else if (detect_info.rejected == CATEGORY_MASK_ANY)
+ setup_coding_system (Qraw_text, coding);
+ else if (detect_info.rejected)
+ for (i = 0; i < coding_category_raw_text; i++)
+ if (! (detect_info.rejected & (1 << coding_priorities[i])))
+ {
+ this = coding_categories + coding_priorities[i];
+ setup_coding_system (CODING_ID_NAME (this->id), coding);
+ break;
+ }
+ }
}
+ else if (XINT (CODING_ATTR_CATEGORY (CODING_ID_ATTRS (coding->id)))
+ == coding_category_utf_16_auto)
+ {
+ Lisp_Object coding_systems;
+ struct coding_detection_info detect_info;
- if (*skip == 0)
- *skip = src_end - source;
- return eol_type;
+ coding_systems
+ = AREF (CODING_ID_ATTRS (coding->id), coding_attr_utf_16_bom);
+ detect_info.found = detect_info.rejected = 0;
+ if (CONSP (coding_systems)
+ && detect_coding_utf_16 (coding, &detect_info))
+ {
+ if (detect_info.found & CATEGORY_MASK_UTF_16_LE)
+ setup_coding_system (XCAR (coding_systems), coding);
+ else if (detect_info.found & CATEGORY_MASK_UTF_16_BE)
+ setup_coding_system (XCDR (coding_systems), coding);
+ }
+ }
}
-/* Like detect_eol_type, but detect EOL type in 2-octet
- big-endian/little-endian format for coding systems utf-16-be and
- utf-16-le. */
-static int
-detect_eol_type_in_2_octet_form (source, src_bytes, skip, big_endian_p)
- const unsigned char *source;
- int src_bytes, *skip, big_endian_p;
+static void
+decode_eol (coding)
+ struct coding_system *coding;
{
- const unsigned char *src = source, *src_end = src + src_bytes;
- unsigned int c1, c2;
- int total = 0; /* How many end-of-lines are found so far. */
- int eol_type = CODING_EOL_UNDECIDED;
- int this_eol_type;
- int msb, lsb;
-
- if (big_endian_p)
- msb = 0, lsb = 1;
- else
- msb = 1, lsb = 0;
+ Lisp_Object eol_type;
+ unsigned char *p, *pbeg, *pend;
+
+ eol_type = CODING_ID_EOL_TYPE (coding->id);
+ if (EQ (eol_type, Qunix))
+ return;
- *skip = 0;
+ if (NILP (coding->dst_object))
+ pbeg = coding->destination;
+ else
+ pbeg = BYTE_POS_ADDR (coding->dst_pos_byte);
+ pend = pbeg + coding->produced;
- while ((src + 1) < src_end && total < MAX_EOL_CHECK_COUNT)
+ if (VECTORP (eol_type))
{
- c1 = (src[msb] << 8) | (src[lsb]);
- src += 2;
+ int eol_seen = EOL_SEEN_NONE;
- if (c1 == '\n' || c1 == '\r')
+ for (p = pbeg; p < pend; p++)
{
- if (*skip == 0)
- *skip = src - 2 - source;
- total++;
- if (c1 == '\n')
- {
- this_eol_type = CODING_EOL_LF;
- }
- else
+ if (*p == '\n')
+ eol_seen |= EOL_SEEN_LF;
+ else if (*p == '\r')
{
- if ((src + 1) >= src_end)
+ if (p + 1 < pend && *(p + 1) == '\n')
{
- this_eol_type = CODING_EOL_CR;
+ eol_seen |= EOL_SEEN_CRLF;
+ p++;
}
else
- {
- c2 = (src[msb] << 8) | (src[lsb]);
- if (c2 == '\n')
- this_eol_type = CODING_EOL_CRLF, src += 2;
- else
- this_eol_type = CODING_EOL_CR;
- }
- }
-
- if (eol_type == CODING_EOL_UNDECIDED)
- /* This is the first end-of-line. */
- eol_type = this_eol_type;
- else if (eol_type != this_eol_type)
- {
- /* The found type is different from what found before. */
- eol_type = CODING_EOL_INCONSISTENT;
- break;
+ eol_seen |= EOL_SEEN_CR;
}
}
+ if (eol_seen != EOL_SEEN_NONE
+ && eol_seen != EOL_SEEN_LF
+ && eol_seen != EOL_SEEN_CRLF
+ && eol_seen != EOL_SEEN_CR)
+ eol_seen = EOL_SEEN_LF;
+ if (eol_seen != EOL_SEEN_NONE)
+ eol_type = adjust_coding_eol_type (coding, eol_seen);
}
- if (*skip == 0)
- *skip = src_end - source;
- return eol_type;
-}
-
-/* Detect how end-of-line of a text of length SRC_BYTES pointed by SRC
- is encoded. If it detects an appropriate format of end-of-line, it
- sets the information in *CODING. */
-
-void
-detect_eol (coding, src, src_bytes)
- struct coding_system *coding;
- const unsigned char *src;
- int src_bytes;
-{
- Lisp_Object val;
- int skip;
- int eol_type;
-
- switch (coding->category_idx)
+ if (EQ (eol_type, Qmac))
{
- case CODING_CATEGORY_IDX_UTF_16_BE:
- eol_type = detect_eol_type_in_2_octet_form (src, src_bytes, &skip, 1);
- break;
- case CODING_CATEGORY_IDX_UTF_16_LE:
- eol_type = detect_eol_type_in_2_octet_form (src, src_bytes, &skip, 0);
- break;
- default:
- eol_type = detect_eol_type (src, src_bytes, &skip);
- break;
+ for (p = pbeg; p < pend; p++)
+ if (*p == '\r')
+ *p = '\n';
}
-
- if (coding->heading_ascii > skip)
- coding->heading_ascii = skip;
- else
- skip = coding->heading_ascii;
-
- if (eol_type == CODING_EOL_UNDECIDED)
- return;
- if (eol_type == CODING_EOL_INCONSISTENT)
+ else if (EQ (eol_type, Qdos))
{
-#if 0
- /* This code is suppressed until we find a better way to
- distinguish raw text file and binary file. */
+ int n = 0;
- /* If we have already detected that the coding is raw-text, the
- coding should actually be no-conversion. */
- if (coding->type == coding_type_raw_text)
+ if (NILP (coding->dst_object))
{
- setup_coding_system (Qno_conversion, coding);
- return;
+ /* Start deleting '\r' from the tail to minimize the memory
+ movement. */
+ for (p = pend - 2; p >= pbeg; p--)
+ if (*p == '\r')
+ {
+ safe_bcopy ((char *) (p + 1), (char *) p, pend-- - p - 1);
+ n++;
+ }
}
- /* Else, let's decode only text code anyway. */
-#endif /* 0 */
- eol_type = CODING_EOL_LF;
- }
-
- val = Fget (coding->symbol, Qeol_type);
- if (VECTORP (val) && XVECTOR (val)->size == 3)
- {
- int src_multibyte = coding->src_multibyte;
- int dst_multibyte = coding->dst_multibyte;
- struct composition_data *cmp_data = coding->cmp_data;
+ else
+ {
+ int pos_byte = coding->dst_pos_byte;
+ int pos = coding->dst_pos;
+ int pos_end = pos + coding->produced_char - 1;
- setup_coding_system (XVECTOR (val)->contents[eol_type], coding);
- coding->src_multibyte = src_multibyte;
- coding->dst_multibyte = dst_multibyte;
- coding->heading_ascii = skip;
- coding->cmp_data = cmp_data;
+ while (pos < pos_end)
+ {
+ p = BYTE_POS_ADDR (pos_byte);
+ if (*p == '\r' && p[1] == '\n')
+ {
+ del_range_2 (pos, pos_byte, pos + 1, pos_byte + 1, 0);
+ n++;
+ pos_end--;
+ }
+ pos++;
+ pos_byte += BYTES_BY_CHAR_HEAD (*p);
+ }
+ }
+ coding->produced -= n;
+ coding->produced_char -= n;
}
}
-#define CONVERSION_BUFFER_EXTRA_ROOM 256
-
-#define DECODING_BUFFER_MAG(coding) \
- (coding->type == coding_type_iso2022 \
- ? 3 \
- : (coding->type == coding_type_ccl \
- ? coding->spec.ccl.decoder.buf_magnification \
- : 2))
-
-/* Return maximum size (bytes) of a buffer enough for decoding
- SRC_BYTES of text encoded in CODING. */
-
-int
-decoding_buffer_size (coding, src_bytes)
- struct coding_system *coding;
- int src_bytes;
-{
- return (src_bytes * DECODING_BUFFER_MAG (coding)
- + CONVERSION_BUFFER_EXTRA_ROOM);
-}
-/* Return maximum size (bytes) of a buffer enough for encoding
- SRC_BYTES of text to CODING. */
+/* Return a translation table (or list of them) from coding system
+ attribute vector ATTRS for encoding (ENCODEP is nonzero) or
+ decoding (ENCODEP is zero). */
-int
-encoding_buffer_size (coding, src_bytes)
- struct coding_system *coding;
- int src_bytes;
+static Lisp_Object
+get_translation_table (attrs, encodep, max_lookup)
+ Lisp_Object attrs;
+ int encodep, *max_lookup;
{
- int magnification;
+ Lisp_Object standard, translation_table;
+ Lisp_Object val;
- if (coding->type == coding_type_ccl)
- {
- magnification = coding->spec.ccl.encoder.buf_magnification;
- if (coding->eol_type == CODING_EOL_CRLF)
- magnification *= 2;
- }
- else if (CODING_REQUIRE_ENCODING (coding))
- magnification = 3;
+ if (encodep)
+ translation_table = CODING_ATTR_ENCODE_TBL (attrs),
+ standard = Vstandard_translation_table_for_encode;
+ else
+ translation_table = CODING_ATTR_DECODE_TBL (attrs),
+ standard = Vstandard_translation_table_for_decode;
+ if (NILP (translation_table))
+ translation_table = standard;
else
- magnification = 1;
-
- return (src_bytes * magnification + CONVERSION_BUFFER_EXTRA_ROOM);
-}
-
-/* Working buffer for code conversion. */
-struct conversion_buffer
-{
- int size; /* size of data. */
- int on_stack; /* 1 if allocated by alloca. */
- unsigned char *data;
-};
-
-/* Allocate LEN bytes of memory for BUF (struct conversion_buffer). */
-#define allocate_conversion_buffer(buf, len) \
- do { \
- if (len < MAX_ALLOCA) \
- { \
- buf.data = (unsigned char *) alloca (len); \
- buf.on_stack = 1; \
- } \
- else \
- { \
- buf.data = (unsigned char *) xmalloc (len); \
- buf.on_stack = 0; \
- } \
- buf.size = len; \
- } while (0)
-
-/* Double the allocated memory for *BUF. */
-static void
-extend_conversion_buffer (buf)
- struct conversion_buffer *buf;
-{
- if (buf->on_stack)
{
- unsigned char *save = buf->data;
- buf->data = (unsigned char *) xmalloc (buf->size * 2);
- bcopy (save, buf->data, buf->size);
- buf->on_stack = 0;
+ if (SYMBOLP (translation_table))
+ translation_table = Fget (translation_table, Qtranslation_table);
+ else if (CONSP (translation_table))
+ {
+ translation_table = Fcopy_sequence (translation_table);
+ for (val = translation_table; CONSP (val); val = XCDR (val))
+ if (SYMBOLP (XCAR (val)))
+ XSETCAR (val, Fget (XCAR (val), Qtranslation_table));
+ }
+ if (CHAR_TABLE_P (standard))
+ {
+ if (CONSP (translation_table))
+ translation_table = nconc2 (translation_table,
+ Fcons (standard, Qnil));
+ else
+ translation_table = Fcons (translation_table,
+ Fcons (standard, Qnil));
+ }
}
- else
+
+ if (max_lookup)
{
- buf->data = (unsigned char *) xrealloc (buf->data, buf->size * 2);
+ *max_lookup = 1;
+ if (CHAR_TABLE_P (translation_table)
+ && CHAR_TABLE_EXTRA_SLOTS (XCHAR_TABLE (translation_table)) > 1)
+ {
+ val = XCHAR_TABLE (translation_table)->extras[1];
+ if (NATNUMP (val) && *max_lookup < XFASTINT (val))
+ *max_lookup = XFASTINT (val);
+ }
+ else if (CONSP (translation_table))
+ {
+ Lisp_Object tail, val;
+
+ for (tail = translation_table; CONSP (tail); tail = XCDR (tail))
+ if (CHAR_TABLE_P (XCAR (tail))
+ && CHAR_TABLE_EXTRA_SLOTS (XCHAR_TABLE (XCAR (tail))) > 1)
+ {
+ val = XCHAR_TABLE (XCAR (tail))->extras[1];
+ if (NATNUMP (val) && *max_lookup < XFASTINT (val))
+ *max_lookup = XFASTINT (val);
+ }
+ }
}
- buf->size *= 2;
+ return translation_table;
}
-/* Free the allocated memory for BUF if it is not on stack. */
-static void
-free_conversion_buffer (buf)
- struct conversion_buffer *buf;
-{
- if (!buf->on_stack)
- xfree (buf->data);
-}
+#define LOOKUP_TRANSLATION_TABLE(table, c, trans) \
+ do { \
+ trans = Qnil; \
+ if (CHAR_TABLE_P (table)) \
+ { \
+ trans = CHAR_TABLE_REF (table, c); \
+ if (CHARACTERP (trans)) \
+ c = XFASTINT (trans), trans = Qnil; \
+ } \
+ else if (CONSP (table)) \
+ { \
+ Lisp_Object tail; \
+ \
+ for (tail = table; CONSP (tail); tail = XCDR (tail)) \
+ if (CHAR_TABLE_P (XCAR (tail))) \
+ { \
+ trans = CHAR_TABLE_REF (XCAR (tail), c); \
+ if (CHARACTERP (trans)) \
+ c = XFASTINT (trans), trans = Qnil; \
+ else if (! NILP (trans)) \
+ break; \
+ } \
+ } \
+ } while (0)
-int
-ccl_coding_driver (coding, source, destination, src_bytes, dst_bytes, encodep)
- struct coding_system *coding;
- unsigned char *source, *destination;
- int src_bytes, dst_bytes, encodep;
-{
- struct ccl_program *ccl
- = encodep ? &coding->spec.ccl.encoder : &coding->spec.ccl.decoder;
- unsigned char *dst = destination;
- ccl->suppress_error = coding->suppress_error;
- ccl->last_block = coding->mode & CODING_MODE_LAST_BLOCK;
- if (encodep)
- {
- /* On encoding, EOL format is converted within ccl_driver. For
- that, setup proper information in the structure CCL. */
- ccl->eol_type = coding->eol_type;
- if (ccl->eol_type ==CODING_EOL_UNDECIDED)
- ccl->eol_type = CODING_EOL_LF;
- ccl->cr_consumed = coding->spec.ccl.cr_carryover;
- ccl->eight_bit_control = coding->dst_multibyte;
- }
- else
- ccl->eight_bit_control = 1;
- ccl->multibyte = coding->src_multibyte;
- if (coding->spec.ccl.eight_bit_carryover[0] != 0)
+static Lisp_Object
+get_translation (val, buf, buf_end, last_block, from_nchars, to_nchars)
+ Lisp_Object val;
+ int *buf, *buf_end;
+ int last_block;
+ int *from_nchars, *to_nchars;
+{
+ /* VAL is TO or (([FROM-CHAR ...] . TO) ...) where TO is TO-CHAR or
+ [TO-CHAR ...]. */
+ if (CONSP (val))
{
- /* Move carryover bytes to DESTINATION. */
- unsigned char *p = coding->spec.ccl.eight_bit_carryover;
- while (*p)
- *dst++ = *p++;
- coding->spec.ccl.eight_bit_carryover[0] = 0;
- if (dst_bytes)
- dst_bytes -= dst - destination;
- }
-
- coding->produced = (ccl_driver (ccl, source, dst, src_bytes, dst_bytes,
- &(coding->consumed))
- + dst - destination);
+ Lisp_Object from, tail;
+ int i, len;
- if (encodep)
- {
- coding->produced_char = coding->produced;
- coding->spec.ccl.cr_carryover = ccl->cr_consumed;
- }
- else if (!ccl->eight_bit_control)
- {
- /* The produced bytes forms a valid multibyte sequence. */
- coding->produced_char
- = multibyte_chars_in_text (destination, coding->produced);
- coding->spec.ccl.eight_bit_carryover[0] = 0;
- }
- else
- {
- /* On decoding, the destination should always multibyte. But,
- CCL program might have been generated an invalid multibyte
- sequence. Here we make such a sequence valid as
- multibyte. */
- int bytes
- = dst_bytes ? dst_bytes : source + coding->consumed - destination;
-
- if ((coding->consumed < src_bytes
- || !ccl->last_block)
- && coding->produced >= 1
- && destination[coding->produced - 1] >= 0x80)
- {
- /* We should not convert the tailing 8-bit codes to
- multibyte form even if they doesn't form a valid
- multibyte sequence. They may form a valid sequence in
- the next call. */
- int carryover = 0;
-
- if (destination[coding->produced - 1] < 0xA0)
- carryover = 1;
- else if (coding->produced >= 2)
+ for (tail = val; CONSP (tail); tail = XCDR (tail))
+ {
+ val = XCAR (tail);
+ from = XCAR (val);
+ len = ASIZE (from);
+ for (i = 0; i < len; i++)
{
- if (destination[coding->produced - 2] >= 0x80)
+ if (buf + i == buf_end)
{
- if (destination[coding->produced - 2] < 0xA0)
- carryover = 2;
- else if (coding->produced >= 3
- && destination[coding->produced - 3] >= 0x80
- && destination[coding->produced - 3] < 0xA0)
- carryover = 3;
+ if (! last_block)
+ return Qt;
+ break;
}
+ if (XINT (AREF (from, i)) != buf[i])
+ break;
}
- if (carryover > 0)
+ if (i == len)
{
- BCOPY_SHORT (destination + coding->produced - carryover,
- coding->spec.ccl.eight_bit_carryover,
- carryover);
- coding->spec.ccl.eight_bit_carryover[carryover] = 0;
- coding->produced -= carryover;
+ val = XCDR (val);
+ *from_nchars = len;
+ break;
}
}
- coding->produced = str_as_multibyte (destination, bytes,
- coding->produced,
- &(coding->produced_char));
- }
-
- switch (ccl->status)
- {
- case CCL_STAT_SUSPEND_BY_SRC:
- coding->result = CODING_FINISH_INSUFFICIENT_SRC;
- break;
- case CCL_STAT_SUSPEND_BY_DST:
- coding->result = CODING_FINISH_INSUFFICIENT_DST;
- break;
- case CCL_STAT_QUIT:
- case CCL_STAT_INVALID_CMD:
- coding->result = CODING_FINISH_INTERRUPT;
- break;
- default:
- coding->result = CODING_FINISH_NORMAL;
- break;
+ if (! CONSP (tail))
+ return Qnil;
}
- return coding->result;
+ if (VECTORP (val))
+ *buf = XINT (AREF (val, 0)), *to_nchars = ASIZE (val);
+ else
+ *buf = XINT (val);
+ return val;
}
-/* Decode EOL format of the text at PTR of BYTES length destructively
- according to CODING->eol_type. This is called after the CCL
- program produced a decoded text at PTR. If we do CRLF->LF
- conversion, update CODING->produced and CODING->produced_char. */
-static void
-decode_eol_post_ccl (coding, ptr, bytes)
+static int
+produce_chars (coding, translation_table, last_block)
struct coding_system *coding;
- unsigned char *ptr;
- int bytes;
+ Lisp_Object translation_table;
+ int last_block;
{
- Lisp_Object val, saved_coding_symbol;
- unsigned char *pend = ptr + bytes;
- int dummy;
+ unsigned char *dst = coding->destination + coding->produced;
+ unsigned char *dst_end = coding->destination + coding->dst_bytes;
+ int produced;
+ int produced_chars = 0;
+ int carryover = 0;
- /* Remember the current coding system symbol. We set it back when
- an inconsistent EOL is found so that `last-coding-system-used' is
- set to the coding system that doesn't specify EOL conversion. */
- saved_coding_symbol = coding->symbol;
-
- coding->spec.ccl.cr_carryover = 0;
- if (coding->eol_type == CODING_EOL_UNDECIDED)
+ if (! coding->chars_at_source)
{
- /* Here, to avoid the call of setup_coding_system, we directly
- call detect_eol_type. */
- coding->eol_type = detect_eol_type (ptr, bytes, &dummy);
- if (coding->eol_type == CODING_EOL_INCONSISTENT)
- coding->eol_type = CODING_EOL_LF;
- if (coding->eol_type != CODING_EOL_UNDECIDED)
- {
- val = Fget (coding->symbol, Qeol_type);
- if (VECTORP (val) && XVECTOR (val)->size == 3)
- coding->symbol = XVECTOR (val)->contents[coding->eol_type];
- }
- coding->mode |= CODING_MODE_INHIBIT_INCONSISTENT_EOL;
- }
+ /* Characters are in coding->charbuf. */
+ int *buf = coding->charbuf;
+ int *buf_end = buf + coding->charbuf_used;
- if (coding->eol_type == CODING_EOL_LF
- || coding->eol_type == CODING_EOL_UNDECIDED)
- {
- /* We have nothing to do. */
- ptr = pend;
- }
- else if (coding->eol_type == CODING_EOL_CRLF)
- {
- unsigned char *pstart = ptr, *p = ptr;
+ if (BUFFERP (coding->src_object)
+ && EQ (coding->src_object, coding->dst_object))
+ dst_end = ((unsigned char *) coding->source) + coding->consumed;
- if (! (coding->mode & CODING_MODE_LAST_BLOCK)
- && *(pend - 1) == '\r')
- {
- /* If the last character is CR, we can't handle it here
- because LF will be in the not-yet-decoded source text.
- Record that the CR is not yet processed. */
- coding->spec.ccl.cr_carryover = 1;
- coding->produced--;
- coding->produced_char--;
- pend--;
- }
- while (ptr < pend)
+ while (buf < buf_end)
{
- if (*ptr == '\r')
+ int c = *buf, i;
+
+ if (c >= 0)
{
- if (ptr + 1 < pend && *(ptr + 1) == '\n')
+ int from_nchars = 1, to_nchars = 1;
+ Lisp_Object trans = Qnil;
+
+ LOOKUP_TRANSLATION_TABLE (translation_table, c, trans);
+ if (! NILP (trans))
{
- *p++ = '\n';
- ptr += 2;
+ trans = get_translation (trans, buf, buf_end, last_block,
+ &from_nchars, &to_nchars);
+ if (EQ (trans, Qt))
+ break;
+ c = *buf;
}
- else
+
+ if (dst + MAX_MULTIBYTE_LENGTH * to_nchars > dst_end)
{
- if (coding->mode & CODING_MODE_INHIBIT_INCONSISTENT_EOL)
- goto undo_eol_conversion;
- *p++ = *ptr++;
+ dst = alloc_destination (coding,
+ buf_end - buf
+ + MAX_MULTIBYTE_LENGTH * to_nchars,
+ dst);
+ dst_end = coding->destination + coding->dst_bytes;
}
- }
- else if (*ptr == '\n'
- && coding->mode & CODING_MODE_INHIBIT_INCONSISTENT_EOL)
- goto undo_eol_conversion;
- else
- *p++ = *ptr++;
- continue;
-
- undo_eol_conversion:
- /* We have faced with inconsistent EOL format at PTR.
- Convert all LFs before PTR back to CRLFs. */
- for (p--, ptr--; p >= pstart; p--)
- {
- if (*p == '\n')
- *ptr-- = '\n', *ptr-- = '\r';
- else
- *ptr-- = *p;
- }
- /* If carryover is recorded, cancel it because we don't
- convert CRLF anymore. */
- if (coding->spec.ccl.cr_carryover)
- {
- coding->spec.ccl.cr_carryover = 0;
- coding->produced++;
- coding->produced_char++;
- pend++;
- }
- p = ptr = pend;
- coding->eol_type = CODING_EOL_LF;
- coding->symbol = saved_coding_symbol;
- }
- if (p < pend)
- {
- /* As each two-byte sequence CRLF was converted to LF, (PEND
- - P) is the number of deleted characters. */
- coding->produced -= pend - p;
- coding->produced_char -= pend - p;
- }
- }
- else /* i.e. coding->eol_type == CODING_EOL_CR */
- {
- unsigned char *p = ptr;
- for (; ptr < pend; ptr++)
- {
- if (*ptr == '\r')
- *ptr = '\n';
- else if (*ptr == '\n'
- && coding->mode & CODING_MODE_INHIBIT_INCONSISTENT_EOL)
- {
- for (; p < ptr; p++)
+ for (i = 0; i < to_nchars; i++)
{
- if (*p == '\n')
- *p = '\r';
+ if (i > 0)
+ c = XINT (AREF (trans, i));
+ if (coding->dst_multibyte
+ || ! CHAR_BYTE8_P (c))
+ CHAR_STRING_ADVANCE (c, dst);
+ else
+ *dst++ = CHAR_TO_BYTE8 (c);
}
- ptr = pend;
- coding->eol_type = CODING_EOL_LF;
- coding->symbol = saved_coding_symbol;
+ produced_chars += to_nchars;
+ *buf++ = to_nchars;
+ while (--from_nchars > 0)
+ *buf++ = 0;
}
+ else
+ /* This is an annotation datum. (-C) is the length. */
+ buf += -c;
}
+ carryover = buf_end - buf;
}
-}
-
-/* See "GENERAL NOTES about `decode_coding_XXX ()' functions". Before
- decoding, it may detect coding system and format of end-of-line if
- those are not yet decided. The source should be unibyte, the
- result is multibyte if CODING->dst_multibyte is nonzero, else
- unibyte. */
-
-int
-decode_coding (coding, source, destination, src_bytes, dst_bytes)
- struct coding_system *coding;
- const unsigned char *source;
- unsigned char *destination;
- int src_bytes, dst_bytes;
-{
- int extra = 0;
-
- if (coding->type == coding_type_undecided)
- detect_coding (coding, source, src_bytes);
-
- if (coding->eol_type == CODING_EOL_UNDECIDED
- && coding->type != coding_type_ccl)
+ else
{
- detect_eol (coding, source, src_bytes);
- /* We had better recover the original eol format if we
- encounter an inconsistent eol format while decoding. */
- coding->mode |= CODING_MODE_INHIBIT_INCONSISTENT_EOL;
- }
+ const unsigned char *src = coding->source;
+ const unsigned char *src_end = src + coding->src_bytes;
+ Lisp_Object eol_type;
- coding->produced = coding->produced_char = 0;
- coding->consumed = coding->consumed_char = 0;
- coding->errors = 0;
- coding->result = CODING_FINISH_NORMAL;
-
- switch (coding->type)
- {
- case coding_type_sjis:
- decode_coding_sjis_big5 (coding, source, destination,
- src_bytes, dst_bytes, 1);
- break;
+ eol_type = CODING_ID_EOL_TYPE (coding->id);
- case coding_type_iso2022:
- decode_coding_iso2022 (coding, source, destination,
- src_bytes, dst_bytes);
- break;
+ if (coding->src_multibyte != coding->dst_multibyte)
+ {
+ if (coding->src_multibyte)
+ {
+ int multibytep = 1;
+ int consumed_chars;
- case coding_type_big5:
- decode_coding_sjis_big5 (coding, source, destination,
- src_bytes, dst_bytes, 0);
- break;
+ while (1)
+ {
+ const unsigned char *src_base = src;
+ int c;
- case coding_type_emacs_mule:
- decode_coding_emacs_mule (coding, source, destination,
- src_bytes, dst_bytes);
- break;
+ ONE_MORE_BYTE (c);
+ if (c == '\r')
+ {
+ if (EQ (eol_type, Qdos))
+ {
+ if (src == src_end)
+ {
+ record_conversion_result
+ (coding, CODING_RESULT_INSUFFICIENT_SRC);
+ goto no_more_source;
+ }
+ if (*src == '\n')
+ c = *src++;
+ }
+ else if (EQ (eol_type, Qmac))
+ c = '\n';
+ }
+ if (dst == dst_end)
+ {
+ coding->consumed = src - coding->source;
+
+ if (EQ (coding->src_object, coding->dst_object))
+ dst_end = (unsigned char *) src;
+ if (dst == dst_end)
+ {
+ dst = alloc_destination (coding, src_end - src + 1,
+ dst);
+ dst_end = coding->destination + coding->dst_bytes;
+ coding_set_source (coding);
+ src = coding->source + coding->consumed;
+ src_end = coding->source + coding->src_bytes;
+ }
+ }
+ *dst++ = c;
+ produced_chars++;
+ }
+ no_more_source:
+ ;
+ }
+ else
+ while (src < src_end)
+ {
+ int multibytep = 1;
+ int c = *src++;
- case coding_type_ccl:
- if (coding->spec.ccl.cr_carryover)
- {
- /* Put the CR which was not processed by the previous call
- of decode_eol_post_ccl in DESTINATION. It will be
- decoded together with the following LF by the call to
- decode_eol_post_ccl below. */
- *destination = '\r';
- coding->produced++;
- coding->produced_char++;
- dst_bytes--;
- extra = coding->spec.ccl.cr_carryover;
+ if (c == '\r')
+ {
+ if (EQ (eol_type, Qdos))
+ {
+ if (src < src_end
+ && *src == '\n')
+ c = *src++;
+ }
+ else if (EQ (eol_type, Qmac))
+ c = '\n';
+ }
+ if (dst >= dst_end - 1)
+ {
+ coding->consumed = src - coding->source;
+
+ if (EQ (coding->src_object, coding->dst_object))
+ dst_end = (unsigned char *) src;
+ if (dst >= dst_end - 1)
+ {
+ dst = alloc_destination (coding, src_end - src + 2,
+ dst);
+ dst_end = coding->destination + coding->dst_bytes;
+ coding_set_source (coding);
+ src = coding->source + coding->consumed;
+ src_end = coding->source + coding->src_bytes;
+ }
+ }
+ EMIT_ONE_BYTE (c);
+ }
}
- ccl_coding_driver (coding, source, destination + extra,
- src_bytes, dst_bytes, 0);
- if (coding->eol_type != CODING_EOL_LF)
+ else
{
- coding->produced += extra;
- coding->produced_char += extra;
- decode_eol_post_ccl (coding, destination, coding->produced);
- }
- break;
-
- default:
- decode_eol (coding, source, destination, src_bytes, dst_bytes);
- }
+ if (!EQ (coding->src_object, coding->dst_object))
+ {
+ int require = coding->src_bytes - coding->dst_bytes;
- if (coding->result == CODING_FINISH_INSUFFICIENT_SRC
- && coding->mode & CODING_MODE_LAST_BLOCK
- && coding->consumed == src_bytes)
- coding->result = CODING_FINISH_NORMAL;
+ if (require > 0)
+ {
+ EMACS_INT offset = src - coding->source;
- if (coding->mode & CODING_MODE_LAST_BLOCK
- && coding->result == CODING_FINISH_INSUFFICIENT_SRC)
- {
- const unsigned char *src = source + coding->consumed;
- unsigned char *dst = destination + coding->produced;
+ dst = alloc_destination (coding, require, dst);
+ coding_set_source (coding);
+ src = coding->source + offset;
+ src_end = coding->source + coding->src_bytes;
+ }
+ }
+ produced_chars = coding->src_chars;
+ while (src < src_end)
+ {
+ int c = *src++;
- src_bytes -= coding->consumed;
- coding->errors++;
- if (COMPOSING_P (coding))
- DECODE_COMPOSITION_END ('1');
- while (src_bytes--)
- {
- int c = *src++;
- dst += CHAR_STRING (c, dst);
- coding->produced_char++;
+ if (c == '\r')
+ {
+ if (EQ (eol_type, Qdos))
+ {
+ if (src < src_end
+ && *src == '\n')
+ c = *src++;
+ produced_chars--;
+ }
+ else if (EQ (eol_type, Qmac))
+ c = '\n';
+ }
+ *dst++ = c;
+ }
}
- coding->consumed = coding->consumed_char = src - source;
- coding->produced = dst - destination;
- coding->result = CODING_FINISH_NORMAL;
- }
-
- if (!coding->dst_multibyte)
- {
- coding->produced = str_as_unibyte (destination, coding->produced);
- coding->produced_char = coding->produced;
+ coding->consumed = coding->src_bytes;
+ coding->consumed_char = coding->src_chars;
}
- return coding->result;
+ produced = dst - (coding->destination + coding->produced);
+ if (BUFFERP (coding->dst_object) && produced_chars > 0)
+ insert_from_gap (produced_chars, produced);
+ coding->produced += produced;
+ coding->produced_char += produced_chars;
+ return carryover;
}
-/* See "GENERAL NOTES about `encode_coding_XXX ()' functions". The
- multibyteness of the source is CODING->src_multibyte, the
- multibyteness of the result is always unibyte. */
+/* Compose text in CODING->object according to the annotation data at
+ CHARBUF. CHARBUF is an array:
+ [ -LENGTH ANNOTATION_MASK FROM TO METHOD COMP_LEN [ COMPONENTS... ] ]
+ */
-int
-encode_coding (coding, source, destination, src_bytes, dst_bytes)
+static INLINE void
+produce_composition (coding, charbuf, pos)
struct coding_system *coding;
- const unsigned char *source;
- unsigned char *destination;
- int src_bytes, dst_bytes;
+ int *charbuf;
+ EMACS_INT pos;
{
- coding->produced = coding->produced_char = 0;
- coding->consumed = coding->consumed_char = 0;
- coding->errors = 0;
- coding->result = CODING_FINISH_NORMAL;
- if (coding->eol_type == CODING_EOL_UNDECIDED)
- coding->eol_type = CODING_EOL_LF;
-
- switch (coding->type)
- {
- case coding_type_sjis:
- encode_coding_sjis_big5 (coding, source, destination,
- src_bytes, dst_bytes, 1);
- break;
-
- case coding_type_iso2022:
- encode_coding_iso2022 (coding, source, destination,
- src_bytes, dst_bytes);
- break;
-
- case coding_type_big5:
- encode_coding_sjis_big5 (coding, source, destination,
- src_bytes, dst_bytes, 0);
- break;
-
- case coding_type_emacs_mule:
- encode_coding_emacs_mule (coding, source, destination,
- src_bytes, dst_bytes);
- break;
-
- case coding_type_ccl:
- ccl_coding_driver (coding, source, destination,
- src_bytes, dst_bytes, 1);
- break;
+ int len;
+ EMACS_INT to;
+ enum composition_method method;
+ Lisp_Object components;
- default:
- encode_eol (coding, source, destination, src_bytes, dst_bytes);
- }
+ len = -charbuf[0];
+ to = pos + charbuf[2];
+ if (to <= pos)
+ return;
+ method = (enum composition_method) (charbuf[3]);
- if (coding->mode & CODING_MODE_LAST_BLOCK
- && coding->result == CODING_FINISH_INSUFFICIENT_SRC)
+ if (method == COMPOSITION_RELATIVE)
+ components = Qnil;
+ else if (method >= COMPOSITION_WITH_RULE
+ && method <= COMPOSITION_WITH_RULE_ALTCHARS)
{
- const unsigned char *src = source + coding->consumed;
- unsigned char *dst = destination + coding->produced;
+ Lisp_Object args[MAX_COMPOSITION_COMPONENTS * 2 - 1];
+ int i;
- if (coding->type == coding_type_iso2022)
- ENCODE_RESET_PLANE_AND_REGISTER;
- if (COMPOSING_P (coding))
- *dst++ = ISO_CODE_ESC, *dst++ = '1';
- if (coding->consumed < src_bytes)
+ len -= 4;
+ charbuf += 4;
+ for (i = 0; i < len; i++)
{
- int len = src_bytes - coding->consumed;
-
- BCOPY_SHORT (src, dst, len);
- if (coding->src_multibyte)
- len = str_as_unibyte (dst, len);
- dst += len;
- coding->consumed = src_bytes;
+ args[i] = make_number (charbuf[i]);
+ if (charbuf[i] < 0)
+ return;
}
- coding->produced = coding->produced_char = dst - destination;
- coding->result = CODING_FINISH_NORMAL;
+ components = (method == COMPOSITION_WITH_ALTCHARS
+ ? Fstring (len, args) : Fvector (len, args));
}
-
- if (coding->result == CODING_FINISH_INSUFFICIENT_SRC
- && coding->consumed == src_bytes)
- coding->result = CODING_FINISH_NORMAL;
-
- return coding->result;
+ else
+ return;
+ compose_text (pos, to, components, Qnil, coding->dst_object);
}
-/* Scan text in the region between *BEG and *END (byte positions),
- skip characters which we don't have to decode by coding system
- CODING at the head and tail, then set *BEG and *END to the region
- of the text we actually have to convert. The caller should move
- the gap out of the region in advance if the region is from a
- buffer.
- If STR is not NULL, *BEG and *END are indices into STR. */
+/* Put `charset' property on text in CODING->object according to
+ the annotation data at CHARBUF. CHARBUF is an array:
+ [ -LENGTH ANNOTATION_MASK NCHARS CHARSET-ID ]
+ */
-static void
-shrink_decoding_region (beg, end, coding, str)
- int *beg, *end;
+static INLINE void
+produce_charset (coding, charbuf, pos)
struct coding_system *coding;
- unsigned char *str;
+ int *charbuf;
+ EMACS_INT pos;
{
- unsigned char *begp_orig, *begp, *endp_orig, *endp, c;
- int eol_conversion;
- Lisp_Object translation_table;
+ EMACS_INT from = pos - charbuf[2];
+ struct charset *charset = CHARSET_FROM_ID (charbuf[3]);
- if (coding->type == coding_type_ccl
- || coding->type == coding_type_undecided
- || coding->eol_type != CODING_EOL_LF
- || !NILP (coding->post_read_conversion)
- || coding->composing != COMPOSITION_DISABLED)
- {
- /* We can't skip any data. */
- return;
- }
- if (coding->type == coding_type_no_conversion
- || coding->type == coding_type_raw_text
- || coding->type == coding_type_emacs_mule)
- {
- /* We need no conversion, but don't have to skip any data here.
- Decoding routine handles them effectively anyway. */
- return;
- }
+ Fput_text_property (make_number (from), make_number (pos),
+ Qcharset, CHARSET_NAME (charset),
+ coding->dst_object);
+}
- translation_table = coding->translation_table_for_decode;
- if (NILP (translation_table) && !NILP (Venable_character_translation))
- translation_table = Vstandard_translation_table_for_decode;
- if (CHAR_TABLE_P (translation_table))
- {
- int i;
- for (i = 0; i < 128; i++)
- if (!NILP (CHAR_TABLE_REF (translation_table, i)))
- break;
- if (i < 128)
- /* Some ASCII character should be translated. We give up
- shrinking. */
- return;
- }
- if (coding->heading_ascii >= 0)
- /* Detection routine has already found how much we can skip at the
- head. */
- *beg += coding->heading_ascii;
+#define CHARBUF_SIZE 0x4000
- if (str)
- {
- begp_orig = begp = str + *beg;
- endp_orig = endp = str + *end;
- }
- else
- {
- begp_orig = begp = BYTE_POS_ADDR (*beg);
- endp_orig = endp = begp + *end - *beg;
- }
+#define ALLOC_CONVERSION_WORK_AREA(coding) \
+ do { \
+ int size = CHARBUF_SIZE;; \
+ \
+ coding->charbuf = NULL; \
+ while (size > 1024) \
+ { \
+ coding->charbuf = (int *) alloca (sizeof (int) * size); \
+ if (coding->charbuf) \
+ break; \
+ size >>= 1; \
+ } \
+ if (! coding->charbuf) \
+ { \
+ record_conversion_result (coding, CODING_RESULT_INSUFFICIENT_MEM); \
+ return coding->result; \
+ } \
+ coding->charbuf_size = size; \
+ } while (0)
- eol_conversion = (coding->eol_type == CODING_EOL_CR
- || coding->eol_type == CODING_EOL_CRLF);
- switch (coding->type)
+static void
+produce_annotation (coding, pos)
+ struct coding_system *coding;
+ EMACS_INT pos;
+{
+ int *charbuf = coding->charbuf;
+ int *charbuf_end = charbuf + coding->charbuf_used;
+
+ if (NILP (coding->dst_object))
+ return;
+
+ while (charbuf < charbuf_end)
{
- case coding_type_sjis:
- case coding_type_big5:
- /* We can skip all ASCII characters at the head. */
- if (coding->heading_ascii < 0)
+ if (*charbuf >= 0)
+ pos += *charbuf++;
+ else
{
- if (eol_conversion)
- while (begp < endp && *begp < 0x80 && *begp != '\r') begp++;
- else
- while (begp < endp && *begp < 0x80) begp++;
+ int len = -*charbuf;
+ switch (charbuf[1])
+ {
+ case CODING_ANNOTATE_COMPOSITION_MASK:
+ produce_composition (coding, charbuf, pos);
+ break;
+ case CODING_ANNOTATE_CHARSET_MASK:
+ produce_charset (coding, charbuf, pos);
+ break;
+ default:
+ abort ();
+ }
+ charbuf += len;
}
- /* We can skip all ASCII characters at the tail except for the
- second byte of SJIS or BIG5 code. */
- if (eol_conversion)
- while (begp < endp && endp[-1] < 0x80 && endp[-1] != '\r') endp--;
- else
- while (begp < endp && endp[-1] < 0x80) endp--;
- /* Do not consider LF as ascii if preceded by CR, since that
- confuses eol decoding. */
- if (begp < endp && endp < endp_orig && endp[-1] == '\r' && endp[0] == '\n')
- endp++;
- if (begp < endp && endp < endp_orig && endp[-1] >= 0x80)
- endp++;
- break;
+ }
+}
- case coding_type_iso2022:
- if (CODING_SPEC_ISO_INITIAL_DESIGNATION (coding, 0) != CHARSET_ASCII)
- /* We can't skip any data. */
- break;
- if (coding->heading_ascii < 0)
- {
- /* We can skip all ASCII characters at the head except for a
- few control codes. */
- while (begp < endp && (c = *begp) < 0x80
- && c != ISO_CODE_CR && c != ISO_CODE_SO
- && c != ISO_CODE_SI && c != ISO_CODE_ESC
- && (!eol_conversion || c != ISO_CODE_LF))
- begp++;
- }
- switch (coding->category_idx)
- {
- case CODING_CATEGORY_IDX_ISO_8_1:
- case CODING_CATEGORY_IDX_ISO_8_2:
- /* We can skip all ASCII characters at the tail. */
- if (eol_conversion)
- while (begp < endp && (c = endp[-1]) < 0x80 && c != '\r') endp--;
- else
- while (begp < endp && endp[-1] < 0x80) endp--;
- /* Do not consider LF as ascii if preceded by CR, since that
- confuses eol decoding. */
- if (begp < endp && endp < endp_orig && endp[-1] == '\r' && endp[0] == '\n')
- endp++;
- break;
+/* Decode the data at CODING->src_object into CODING->dst_object.
+ CODING->src_object is a buffer, a string, or nil.
+ CODING->dst_object is a buffer.
- case CODING_CATEGORY_IDX_ISO_7:
- case CODING_CATEGORY_IDX_ISO_7_TIGHT:
- {
- /* We can skip all characters at the tail except for 8-bit
- codes and ESC and the following 2-byte at the tail. */
- unsigned char *eight_bit = NULL;
+ If CODING->src_object is a buffer, it must be the current buffer.
+ In this case, if CODING->src_pos is positive, it is a position of
+ the source text in the buffer, otherwise, the source text is in the
+ gap area of the buffer, and CODING->src_pos specifies the offset of
+ the text from GPT (which must be the same as PT). If this is the
+ same buffer as CODING->dst_object, CODING->src_pos must be
+ negative.
- if (eol_conversion)
- while (begp < endp
- && (c = endp[-1]) != ISO_CODE_ESC && c != '\r')
- {
- if (!eight_bit && c & 0x80) eight_bit = endp;
- endp--;
- }
- else
- while (begp < endp
- && (c = endp[-1]) != ISO_CODE_ESC)
- {
- if (!eight_bit && c & 0x80) eight_bit = endp;
- endp--;
- }
- /* Do not consider LF as ascii if preceded by CR, since that
- confuses eol decoding. */
- if (begp < endp && endp < endp_orig
- && endp[-1] == '\r' && endp[0] == '\n')
- endp++;
- if (begp < endp && endp[-1] == ISO_CODE_ESC)
- {
- if (endp + 1 < endp_orig && end[0] == '(' && end[1] == 'B')
- /* This is an ASCII designation sequence. We can
- surely skip the tail. But, if we have
- encountered an 8-bit code, skip only the codes
- after that. */
- endp = eight_bit ? eight_bit : endp + 2;
- else
- /* Hmmm, we can't skip the tail. */
- endp = endp_orig;
- }
- else if (eight_bit)
- endp = eight_bit;
- }
- }
- break;
+ If CODING->src_object is a string, CODING->src_pos is an index to
+ that string.
- default:
- abort ();
- }
- *beg += begp - begp_orig;
- *end += endp - endp_orig;
- return;
-}
+ If CODING->src_object is nil, CODING->source must already point to
+ the non-relocatable memory area. In this case, CODING->src_pos is
+ an offset from CODING->source.
-/* Like shrink_decoding_region but for encoding. */
+ The decoded data is inserted at the current point of the buffer
+ CODING->dst_object.
+*/
-static void
-shrink_encoding_region (beg, end, coding, str)
- int *beg, *end;
+static int
+decode_coding (coding)
struct coding_system *coding;
- unsigned char *str;
{
- unsigned char *begp_orig, *begp, *endp_orig, *endp;
- int eol_conversion;
+ Lisp_Object attrs;
+ Lisp_Object undo_list;
Lisp_Object translation_table;
+ int carryover;
+ int i;
- if (coding->type == coding_type_ccl
- || coding->eol_type == CODING_EOL_CRLF
- || coding->eol_type == CODING_EOL_CR
- || (coding->cmp_data && coding->cmp_data->used > 0))
- {
- /* We can't skip any data. */
- return;
- }
- if (coding->type == coding_type_no_conversion
- || coding->type == coding_type_raw_text
- || coding->type == coding_type_emacs_mule
- || coding->type == coding_type_undecided)
+ if (BUFFERP (coding->src_object)
+ && coding->src_pos > 0
+ && coding->src_pos < GPT
+ && coding->src_pos + coding->src_chars > GPT)
+ move_gap_both (coding->src_pos, coding->src_pos_byte);
+
+ undo_list = Qt;
+ if (BUFFERP (coding->dst_object))
{
- /* We need no conversion, but don't have to skip any data here.
- Encoding routine handles them effectively anyway. */
- return;
+ if (current_buffer != XBUFFER (coding->dst_object))
+ set_buffer_internal (XBUFFER (coding->dst_object));
+ if (GPT != PT)
+ move_gap_both (PT, PT_BYTE);
+ undo_list = current_buffer->undo_list;
+ current_buffer->undo_list = Qt;
}
- translation_table = coding->translation_table_for_encode;
- if (NILP (translation_table) && !NILP (Venable_character_translation))
- translation_table = Vstandard_translation_table_for_encode;
- if (CHAR_TABLE_P (translation_table))
+ coding->consumed = coding->consumed_char = 0;
+ coding->produced = coding->produced_char = 0;
+ coding->chars_at_source = 0;
+ record_conversion_result (coding, CODING_RESULT_SUCCESS);
+ coding->errors = 0;
+
+ ALLOC_CONVERSION_WORK_AREA (coding);
+
+ attrs = CODING_ID_ATTRS (coding->id);
+ translation_table = get_translation_table (attrs, 0, NULL);
+
+ carryover = 0;
+ do
{
- int i;
- for (i = 0; i < 128; i++)
- if (!NILP (CHAR_TABLE_REF (translation_table, i)))
- break;
- if (i < 128)
- /* Some ASCII character should be translated. We give up
- shrinking. */
- return;
+ EMACS_INT pos = coding->dst_pos + coding->produced_char;
+
+ coding_set_source (coding);
+ coding->annotated = 0;
+ coding->charbuf_used = carryover;
+ (*(coding->decoder)) (coding);
+ coding_set_destination (coding);
+ carryover = produce_chars (coding, translation_table, 0);
+ if (coding->annotated)
+ produce_annotation (coding, pos);
+ for (i = 0; i < carryover; i++)
+ coding->charbuf[i]
+ = coding->charbuf[coding->charbuf_used - carryover + i];
}
+ while (coding->consumed < coding->src_bytes
+ && (coding->result == CODING_RESULT_SUCCESS
+ || coding->result == CODING_RESULT_INVALID_SRC));
- if (str)
+ if (carryover > 0)
{
- begp_orig = begp = str + *beg;
- endp_orig = endp = str + *end;
+ coding_set_destination (coding);
+ coding->charbuf_used = carryover;
+ produce_chars (coding, translation_table, 1);
}
- else
+
+ coding->carryover_bytes = 0;
+ if (coding->consumed < coding->src_bytes)
{
- begp_orig = begp = BYTE_POS_ADDR (*beg);
- endp_orig = endp = begp + *end - *beg;
- }
+ int nbytes = coding->src_bytes - coding->consumed;
+ const unsigned char *src;
- eol_conversion = (coding->eol_type == CODING_EOL_CR
- || coding->eol_type == CODING_EOL_CRLF);
+ coding_set_source (coding);
+ coding_set_destination (coding);
+ src = coding->source + coding->consumed;
- /* Here, we don't have to check coding->pre_write_conversion because
- the caller is expected to have handled it already. */
- switch (coding->type)
- {
- case coding_type_iso2022:
- if (CODING_SPEC_ISO_INITIAL_DESIGNATION (coding, 0) != CHARSET_ASCII)
- /* We can't skip any data. */
- break;
- if (coding->flags & CODING_FLAG_ISO_DESIGNATE_AT_BOL)
+ if (coding->mode & CODING_MODE_LAST_BLOCK)
{
- unsigned char *bol = begp;
- while (begp < endp && *begp < 0x80)
+ /* Flush out unprocessed data as binary chars. We are sure
+ that the number of data is less than the size of
+ coding->charbuf. */
+ coding->charbuf_used = 0;
+ while (nbytes-- > 0)
{
- begp++;
- if (begp[-1] == '\n')
- bol = begp;
+ int c = *src++;
+
+ if (c & 0x80)
+ c = BYTE8_TO_CHAR (c);
+ coding->charbuf[coding->charbuf_used++] = c;
}
- begp = bol;
- goto label_skip_tail;
+ produce_chars (coding, Qnil, 1);
}
- /* fall down ... */
-
- case coding_type_sjis:
- case coding_type_big5:
- /* We can skip all ASCII characters at the head and tail. */
- if (eol_conversion)
- while (begp < endp && *begp < 0x80 && *begp != '\n') begp++;
- else
- while (begp < endp && *begp < 0x80) begp++;
- label_skip_tail:
- if (eol_conversion)
- while (begp < endp && endp[-1] < 0x80 && endp[-1] != '\n') endp--;
else
- while (begp < endp && *(endp - 1) < 0x80) endp--;
- break;
-
- default:
- abort ();
+ {
+ /* Record unprocessed bytes in coding->carryover. We are
+ sure that the number of data is less than the size of
+ coding->carryover. */
+ unsigned char *p = coding->carryover;
+
+ coding->carryover_bytes = nbytes;
+ while (nbytes-- > 0)
+ *p++ = *src++;
+ }
+ coding->consumed = coding->src_bytes;
}
- *beg += begp - begp_orig;
- *end += endp - endp_orig;
- return;
+ if (! EQ (CODING_ID_EOL_TYPE (coding->id), Qunix))
+ decode_eol (coding);
+ if (BUFFERP (coding->dst_object))
+ {
+ current_buffer->undo_list = undo_list;
+ record_insert (coding->dst_pos, coding->produced_char);
+ }
+ return coding->result;
}
-/* As shrinking conversion region requires some overhead, we don't try
- shrinking if the length of conversion region is less than this
- value. */
-static int shrink_conversion_region_threshhold = 1024;
-
-#define SHRINK_CONVERSION_REGION(beg, end, coding, str, encodep) \
- do { \
- if (*(end) - *(beg) > shrink_conversion_region_threshhold) \
- { \
- if (encodep) shrink_encoding_region (beg, end, coding, str); \
- else shrink_decoding_region (beg, end, coding, str); \
- } \
- } while (0)
-
-/* ARG is (CODING BUFFER ...) where CODING is what to be set in
- Vlast_coding_system_used and the remaining elements are buffers to
- kill. */
-static Lisp_Object
-code_convert_region_unwind (arg)
- Lisp_Object arg;
-{
- struct gcpro gcpro1;
- GCPRO1 (arg);
- inhibit_pre_post_conversion = 0;
- Vlast_coding_system_used = XCAR (arg);
- for (arg = XCDR (arg); ! NILP (arg); arg = XCDR (arg))
- Fkill_buffer (XCAR (arg));
+/* Extract an annotation datum from a composition starting at POS and
+ ending before LIMIT of CODING->src_object (buffer or string), store
+ the data in BUF, set *STOP to a starting position of the next
+ composition (if any) or to LIMIT, and return the address of the
+ next element of BUF.
- UNGCPRO;
- return Qnil;
-}
+ If such an annotation is not found, set *STOP to a starting
+ position of a composition after POS (if any) or to LIMIT, and
+ return BUF. */
-/* Store information about all compositions in the range FROM and TO
- of OBJ in memory blocks pointed by CODING->cmp_data. OBJ is a
- buffer or a string, defaults to the current buffer. */
-
-void
-coding_save_composition (coding, from, to, obj)
+static INLINE int *
+handle_composition_annotation (pos, limit, coding, buf, stop)
+ EMACS_INT pos, limit;
struct coding_system *coding;
- int from, to;
- Lisp_Object obj;
+ int *buf;
+ EMACS_INT *stop;
{
+ EMACS_INT start, end;
Lisp_Object prop;
- int start, end;
- if (coding->composing == COMPOSITION_DISABLED)
- return;
- if (!coding->cmp_data)
- coding_allocate_composition_data (coding, from);
- if (!find_composition (from, to, &start, &end, &prop, obj)
- || end > to)
- return;
- if (start < from
- && (!find_composition (end, to, &start, &end, &prop, obj)
- || end > to))
- return;
- coding->composing = COMPOSITION_NO;
- do
+ if (! find_composition (pos, limit, &start, &end, &prop, coding->src_object)
+ || end > limit)
+ *stop = limit;
+ else if (start > pos)
+ *stop = start;
+ else
{
- if (COMPOSITION_VALID_P (start, end, prop))
+ if (start == pos)
{
+ /* We found a composition. Store the corresponding
+ annotation data in BUF. */
+ int *head = buf;
enum composition_method method = COMPOSITION_METHOD (prop);
- if (coding->cmp_data->used + COMPOSITION_DATA_MAX_BUNCH_LENGTH
- >= COMPOSITION_DATA_SIZE)
- coding_allocate_composition_data (coding, from);
- /* For relative composition, we remember start and end
- positions, for the other compositions, we also remember
- components. */
- CODING_ADD_COMPOSITION_START (coding, start - from, method);
+ int nchars = COMPOSITION_LENGTH (prop);
+
+ ADD_COMPOSITION_DATA (buf, nchars, method);
if (method != COMPOSITION_RELATIVE)
{
- /* We must store a*/
- Lisp_Object val, ch;
+ Lisp_Object components;
+ int len, i, i_byte;
- val = COMPOSITION_COMPONENTS (prop);
- if (CONSP (val))
- while (CONSP (val))
- {
- ch = XCAR (val), val = XCDR (val);
- CODING_ADD_COMPOSITION_COMPONENT (coding, XINT (ch));
- }
- else if (VECTORP (val) || STRINGP (val))
+ components = COMPOSITION_COMPONENTS (prop);
+ if (VECTORP (components))
{
- int len = (VECTORP (val)
- ? XVECTOR (val)->size : SCHARS (val));
- int i;
+ len = XVECTOR (components)->size;
for (i = 0; i < len; i++)
+ *buf++ = XINT (AREF (components, i));
+ }
+ else if (STRINGP (components))
+ {
+ len = SCHARS (components);
+ i = i_byte = 0;
+ while (i < len)
{
- ch = (STRINGP (val)
- ? Faref (val, make_number (i))
- : XVECTOR (val)->contents[i]);
- CODING_ADD_COMPOSITION_COMPONENT (coding, XINT (ch));
+ FETCH_STRING_CHAR_ADVANCE (*buf, components, i, i_byte);
+ buf++;
}
}
- else /* INTEGERP (val) */
- CODING_ADD_COMPOSITION_COMPONENT (coding, XINT (val));
+ else if (INTEGERP (components))
+ {
+ len = 1;
+ *buf++ = XINT (components);
+ }
+ else if (CONSP (components))
+ {
+ for (len = 0; CONSP (components);
+ len++, components = XCDR (components))
+ *buf++ = XINT (XCAR (components));
+ }
+ else
+ abort ();
+ *head -= len;
}
- CODING_ADD_COMPOSITION_END (coding, end - from);
}
- start = end;
- }
- while (start < to
- && find_composition (start, to, &start, &end, &prop, obj)
- && end <= to);
- /* Make coding->cmp_data point to the first memory block. */
- while (coding->cmp_data->prev)
- coding->cmp_data = coding->cmp_data->prev;
- coding->cmp_data_start = 0;
+ if (find_composition (end, limit, &start, &end, &prop,
+ coding->src_object)
+ && end <= limit)
+ *stop = start;
+ else
+ *stop = limit;
+ }
+ return buf;
}
-/* Reflect the saved information about compositions to OBJ.
- CODING->cmp_data points to a memory block for the information. OBJ
- is a buffer or a string, defaults to the current buffer. */
-
-void
-coding_restore_composition (coding, obj)
- struct coding_system *coding;
- Lisp_Object obj;
-{
- struct composition_data *cmp_data = coding->cmp_data;
-
- if (!cmp_data)
- return;
-
- while (cmp_data->prev)
- cmp_data = cmp_data->prev;
- while (cmp_data)
- {
- int i;
+/* Extract an annotation datum from a text property `charset' at POS of
+ CODING->src_object (buffer of string), store the data in BUF, set
+ *STOP to the position where the value of `charset' property changes
+ (limiting by LIMIT), and return the address of the next element of
+ BUF.
- for (i = 0; i < cmp_data->used && cmp_data->data[i] > 0;
- i += cmp_data->data[i])
- {
- int *data = cmp_data->data + i;
- enum composition_method method = (enum composition_method) data[3];
- Lisp_Object components;
+ If the property value is nil, set *STOP to the position where the
+ property value is non-nil (limiting by LIMIT), and return BUF. */
- if (data[0] < 0 || i + data[0] > cmp_data->used)
- /* Invalid composition data. */
- break;
+static INLINE int *
+handle_charset_annotation (pos, limit, coding, buf, stop)
+ EMACS_INT pos, limit;
+ struct coding_system *coding;
+ int *buf;
+ EMACS_INT *stop;
+{
+ Lisp_Object val, next;
+ int id;
- if (method == COMPOSITION_RELATIVE)
- components = Qnil;
- else
- {
- int len = data[0] - 4, j;
- Lisp_Object args[MAX_COMPOSITION_COMPONENTS * 2 - 1];
-
- if (method == COMPOSITION_WITH_RULE_ALTCHARS
- && len % 2 == 0)
- len --;
- if (len < 1)
- /* Invalid composition data. */
- break;
- for (j = 0; j < len; j++)
- args[j] = make_number (data[4 + j]);
- components = (method == COMPOSITION_WITH_ALTCHARS
- ? Fstring (len, args)
- : Fvector (len, args));
- }
- compose_text (data[1], data[2], components, Qnil, obj);
- }
- cmp_data = cmp_data->next;
- }
+ val = Fget_text_property (make_number (pos), Qcharset, coding->src_object);
+ if (! NILP (val) && CHARSETP (val))
+ id = XINT (CHARSET_SYMBOL_ID (val));
+ else
+ id = -1;
+ ADD_CHARSET_DATA (buf, 0, id);
+ next = Fnext_single_property_change (make_number (pos), Qcharset,
+ coding->src_object,
+ make_number (limit));
+ *stop = XINT (next);
+ return buf;
}
-/* Decode (if ENCODEP is zero) or encode (if ENCODEP is nonzero) the
- text from FROM to TO (byte positions are FROM_BYTE and TO_BYTE) by
- coding system CODING, and return the status code of code conversion
- (currently, this value has no meaning).
-
- How many characters (and bytes) are converted to how many
- characters (and bytes) are recorded in members of the structure
- CODING.
- If REPLACE is nonzero, we do various things as if the original text
- is deleted and a new text is inserted. See the comments in
- replace_range (insdel.c) to know what we are doing.
-
- If REPLACE is zero, it is assumed that the source text is unibyte.
- Otherwise, it is assumed that the source text is multibyte. */
-
-int
-code_convert_region (from, from_byte, to, to_byte, coding, encodep, replace)
- int from, from_byte, to, to_byte, encodep, replace;
+static void
+consume_chars (coding, translation_table, max_lookup)
struct coding_system *coding;
+ Lisp_Object translation_table;
+ int max_lookup;
{
- int len = to - from, len_byte = to_byte - from_byte;
- int nchars_del = 0, nbytes_del = 0;
- int require, inserted, inserted_byte;
- int head_skip, tail_skip, total_skip = 0;
- Lisp_Object saved_coding_symbol;
- int first = 1;
- unsigned char *src, *dst;
- Lisp_Object deletion;
- int orig_point = PT, orig_len = len;
- int prev_Z;
- int multibyte_p = !NILP (current_buffer->enable_multibyte_characters);
+ int *buf = coding->charbuf;
+ int *buf_end = coding->charbuf + coding->charbuf_size;
+ const unsigned char *src = coding->source + coding->consumed;
+ const unsigned char *src_end = coding->source + coding->src_bytes;
+ EMACS_INT pos = coding->src_pos + coding->consumed_char;
+ EMACS_INT end_pos = coding->src_pos + coding->src_chars;
+ int multibytep = coding->src_multibyte;
+ Lisp_Object eol_type;
+ int c;
+ EMACS_INT stop, stop_composition, stop_charset;
+ int *lookup_buf = NULL;
- deletion = Qnil;
- saved_coding_symbol = coding->symbol;
+ if (! NILP (translation_table))
+ lookup_buf = alloca (sizeof (int) * max_lookup);
- if (from < PT && PT < to)
+ eol_type = CODING_ID_EOL_TYPE (coding->id);
+ if (VECTORP (eol_type))
+ eol_type = Qunix;
+
+ /* Note: composition handling is not yet implemented. */
+ coding->common_flags &= ~CODING_ANNOTATE_COMPOSITION_MASK;
+
+ if (NILP (coding->src_object))
+ stop = stop_composition = stop_charset = end_pos;
+ else
{
- TEMP_SET_PT_BOTH (from, from_byte);
- orig_point = from;
+ if (coding->common_flags & CODING_ANNOTATE_COMPOSITION_MASK)
+ stop = stop_composition = pos;
+ else
+ stop = stop_composition = end_pos;
+ if (coding->common_flags & CODING_ANNOTATE_CHARSET_MASK)
+ stop = stop_charset = pos;
+ else
+ stop_charset = end_pos;
}
- if (replace)
+ /* Compensate for CRLF and conversion. */
+ buf_end -= 1 + MAX_ANNOTATION_LENGTH;
+ while (buf < buf_end)
{
- int saved_from = from;
- int saved_inhibit_modification_hooks;
+ Lisp_Object trans;
- prepare_to_modify_buffer (from, to, &from);
- if (saved_from != from)
+ if (pos == stop)
{
- to = from + len;
- from_byte = CHAR_TO_BYTE (from), to_byte = CHAR_TO_BYTE (to);
- len_byte = to_byte - from_byte;
+ if (pos == end_pos)
+ break;
+ if (pos == stop_composition)
+ buf = handle_composition_annotation (pos, end_pos, coding,
+ buf, &stop_composition);
+ if (pos == stop_charset)
+ buf = handle_charset_annotation (pos, end_pos, coding,
+ buf, &stop_charset);
+ stop = (stop_composition < stop_charset
+ ? stop_composition : stop_charset);
}
- /* The code conversion routine can not preserve text properties
- for now. So, we must remove all text properties in the
- region. Here, we must suppress all modification hooks. */
- saved_inhibit_modification_hooks = inhibit_modification_hooks;
- inhibit_modification_hooks = 1;
- Fset_text_properties (make_number (from), make_number (to), Qnil, Qnil);
- inhibit_modification_hooks = saved_inhibit_modification_hooks;
- }
-
- coding->heading_ascii = 0;
-
- if (! encodep && CODING_REQUIRE_DETECTION (coding))
- {
- /* We must detect encoding of text and eol format. */
+ if (! multibytep)
+ {
+ EMACS_INT bytes;
- if (from < GPT && to > GPT)
- move_gap_both (from, from_byte);
- if (coding->type == coding_type_undecided)
+ if (coding->encoder == encode_coding_raw_text)
+ c = *src++, pos++;
+ else if ((bytes = MULTIBYTE_LENGTH (src, src_end)) > 0)
+ c = STRING_CHAR_ADVANCE (src), pos += bytes;
+ else
+ c = BYTE8_TO_CHAR (*src), src++, pos++;
+ }
+ else
+ c = STRING_CHAR_ADVANCE (src), pos++;
+ if ((c == '\r') && (coding->mode & CODING_MODE_SELECTIVE_DISPLAY))
+ c = '\n';
+ if (! EQ (eol_type, Qunix))
{
- detect_coding (coding, BYTE_POS_ADDR (from_byte), len_byte);
- if (coding->type == coding_type_undecided)
+ if (c == '\n')
{
- /* It seems that the text contains only ASCII, but we
- should not leave it undecided because the deeper
- decoding routine (decode_coding) tries to detect the
- encodings again in vain. */
- coding->type = coding_type_emacs_mule;
- coding->category_idx = CODING_CATEGORY_IDX_EMACS_MULE;
- /* As emacs-mule decoder will handle composition, we
- need this setting to allocate coding->cmp_data
- later. */
- coding->composing = COMPOSITION_NO;
+ if (EQ (eol_type, Qdos))
+ *buf++ = '\r';
+ else
+ c = '\r';
}
}
- if (coding->eol_type == CODING_EOL_UNDECIDED
- && coding->type != coding_type_ccl)
+
+ trans = Qnil;
+ LOOKUP_TRANSLATION_TABLE (translation_table, c, trans);
+ if (NILP (trans))
+ *buf++ = c;
+ else
{
- detect_eol (coding, BYTE_POS_ADDR (from_byte), len_byte);
- if (coding->eol_type == CODING_EOL_UNDECIDED)
- coding->eol_type = CODING_EOL_LF;
- /* We had better recover the original eol format if we
- encounter an inconsistent eol format while decoding. */
- coding->mode |= CODING_MODE_INHIBIT_INCONSISTENT_EOL;
+ int from_nchars = 1, to_nchars = 1;
+ int *lookup_buf_end;
+ const unsigned char *p = src;
+ int i;
+
+ lookup_buf[0] = c;
+ for (i = 1; i < max_lookup && p < src_end; i++)
+ lookup_buf[i] = STRING_CHAR_ADVANCE (p);
+ lookup_buf_end = lookup_buf + i;
+ trans = get_translation (trans, lookup_buf, lookup_buf_end, 1,
+ &from_nchars, &to_nchars);
+ if (EQ (trans, Qt)
+ || buf + to_nchars > buf_end)
+ break;
+ *buf++ = *lookup_buf;
+ for (i = 1; i < to_nchars; i++)
+ *buf++ = XINT (AREF (trans, i));
+ for (i = 1; i < from_nchars; i++, pos++)
+ src += MULTIBYTE_LENGTH_NO_CHECK (src);
}
}
- /* Now we convert the text. */
-
- /* For encoding, we must process pre-write-conversion in advance. */
- if (! inhibit_pre_post_conversion
- && encodep
- && SYMBOLP (coding->pre_write_conversion)
- && ! NILP (Ffboundp (coding->pre_write_conversion)))
- {
- /* The function in pre-write-conversion may put a new text in a
- new buffer. */
- struct buffer *prev = current_buffer;
- Lisp_Object new;
-
- record_unwind_protect (code_convert_region_unwind,
- Fcons (Vlast_coding_system_used, Qnil));
- /* We should not call any more pre-write/post-read-conversion
- functions while this pre-write-conversion is running. */
- inhibit_pre_post_conversion = 1;
- call2 (coding->pre_write_conversion,
- make_number (from), make_number (to));
- inhibit_pre_post_conversion = 0;
- /* Discard the unwind protect. */
- specpdl_ptr--;
+ coding->consumed = src - coding->source;
+ coding->consumed_char = pos - coding->src_pos;
+ coding->charbuf_used = buf - coding->charbuf;
+ coding->chars_at_source = 0;
+}
- if (current_buffer != prev)
- {
- len = ZV - BEGV;
- new = Fcurrent_buffer ();
- set_buffer_internal_1 (prev);
- del_range_2 (from, from_byte, to, to_byte, 0);
- TEMP_SET_PT_BOTH (from, from_byte);
- insert_from_buffer (XBUFFER (new), 1, len, 0);
- Fkill_buffer (new);
- if (orig_point >= to)
- orig_point += len - orig_len;
- else if (orig_point > from)
- orig_point = from;
- orig_len = len;
- to = from + len;
- from_byte = CHAR_TO_BYTE (from);
- to_byte = CHAR_TO_BYTE (to);
- len_byte = to_byte - from_byte;
- TEMP_SET_PT_BOTH (from, from_byte);
- }
- }
- if (replace)
- {
- if (! EQ (current_buffer->undo_list, Qt))
- deletion = make_buffer_string_both (from, from_byte, to, to_byte, 1);
- else
- {
- nchars_del = to - from;
- nbytes_del = to_byte - from_byte;
- }
- }
+/* Encode the text at CODING->src_object into CODING->dst_object.
+ CODING->src_object is a buffer or a string.
+ CODING->dst_object is a buffer or nil.
- if (coding->composing != COMPOSITION_DISABLED)
- {
- if (encodep)
- coding_save_composition (coding, from, to, Fcurrent_buffer ());
- else
- coding_allocate_composition_data (coding, from);
- }
+ If CODING->src_object is a buffer, it must be the current buffer.
+ In this case, if CODING->src_pos is positive, it is a position of
+ the source text in the buffer, otherwise. the source text is in the
+ gap area of the buffer, and coding->src_pos specifies the offset of
+ the text from GPT (which must be the same as PT). If this is the
+ same buffer as CODING->dst_object, CODING->src_pos must be
+ negative and CODING should not have `pre-write-conversion'.
- /* Try to skip the heading and tailing ASCIIs. We can't skip them
- if we must run CCL program or there are compositions to
- encode. */
- if (coding->type != coding_type_ccl
- && (! coding->cmp_data || coding->cmp_data->used == 0))
- {
- int from_byte_orig = from_byte, to_byte_orig = to_byte;
+ If CODING->src_object is a string, CODING should not have
+ `pre-write-conversion'.
- if (from < GPT && GPT < to)
- move_gap_both (from, from_byte);
- SHRINK_CONVERSION_REGION (&from_byte, &to_byte, coding, NULL, encodep);
- if (from_byte == to_byte
- && (encodep || NILP (coding->post_read_conversion))
- && ! CODING_REQUIRE_FLUSHING (coding))
- {
- coding->produced = len_byte;
- coding->produced_char = len;
- if (!replace)
- /* We must record and adjust for this new text now. */
- adjust_after_insert (from, from_byte_orig, to, to_byte_orig, len);
- coding_free_composition_data (coding);
- return 0;
- }
-
- head_skip = from_byte - from_byte_orig;
- tail_skip = to_byte_orig - to_byte;
- total_skip = head_skip + tail_skip;
- from += head_skip;
- to -= tail_skip;
- len -= total_skip; len_byte -= total_skip;
- }
-
- /* For conversion, we must put the gap before the text in addition to
- making the gap larger for efficient decoding. The required gap
- size starts from 2000 which is the magic number used in make_gap.
- But, after one batch of conversion, it will be incremented if we
- find that it is not enough . */
- require = 2000;
-
- if (GAP_SIZE < require)
- make_gap (require - GAP_SIZE);
- move_gap_both (from, from_byte);
-
- inserted = inserted_byte = 0;
-
- GAP_SIZE += len_byte;
- ZV -= len;
- Z -= len;
- ZV_BYTE -= len_byte;
- Z_BYTE -= len_byte;
-
- if (GPT - BEG < BEG_UNCHANGED)
- BEG_UNCHANGED = GPT - BEG;
- if (Z - GPT < END_UNCHANGED)
- END_UNCHANGED = Z - GPT;
-
- if (!encodep && coding->src_multibyte)
- {
- /* Decoding routines expects that the source text is unibyte.
- We must convert 8-bit characters of multibyte form to
- unibyte. */
- int len_byte_orig = len_byte;
- len_byte = str_as_unibyte (GAP_END_ADDR - len_byte, len_byte);
- if (len_byte < len_byte_orig)
- safe_bcopy (GAP_END_ADDR - len_byte_orig, GAP_END_ADDR - len_byte,
- len_byte);
- coding->src_multibyte = 0;
- }
-
- for (;;)
- {
- int result;
-
- /* The buffer memory is now:
- +--------+converted-text+---------+-------original-text-------+---+
- |<-from->|<--inserted-->|---------|<--------len_byte--------->|---|
- |<---------------------- GAP ----------------------->| */
- src = GAP_END_ADDR - len_byte;
- dst = GPT_ADDR + inserted_byte;
-
- if (encodep)
- result = encode_coding (coding, src, dst, len_byte, 0);
- else
- {
- if (coding->composing != COMPOSITION_DISABLED)
- coding->cmp_data->char_offset = from + inserted;
- result = decode_coding (coding, src, dst, len_byte, 0);
- }
+ If CODING->dst_object is a buffer, the encoded data is inserted at
+ the current point of that buffer.
- /* The buffer memory is now:
- +--------+-------converted-text----+--+------original-text----+---+
- |<-from->|<-inserted->|<-produced->|--|<-(len_byte-consumed)->|---|
- |<---------------------- GAP ----------------------->| */
+ If CODING->dst_object is nil, the encoded data is placed at the
+ memory area specified by CODING->destination. */
- inserted += coding->produced_char;
- inserted_byte += coding->produced;
- len_byte -= coding->consumed;
+static int
+encode_coding (coding)
+ struct coding_system *coding;
+{
+ Lisp_Object attrs;
+ Lisp_Object translation_table;
+ int max_lookup;
- if (result == CODING_FINISH_INSUFFICIENT_CMP)
- {
- coding_allocate_composition_data (coding, from + inserted);
- continue;
- }
+ attrs = CODING_ID_ATTRS (coding->id);
+ if (coding->encoder == encode_coding_raw_text)
+ translation_table = Qnil, max_lookup = 0;
+ else
+ translation_table = get_translation_table (attrs, 1, &max_lookup);
- src += coding->consumed;
- dst += coding->produced;
+ if (BUFFERP (coding->dst_object))
+ {
+ set_buffer_internal (XBUFFER (coding->dst_object));
+ coding->dst_multibyte
+ = ! NILP (current_buffer->enable_multibyte_characters);
+ }
- if (result == CODING_FINISH_NORMAL)
- {
- src += len_byte;
- break;
- }
- if (! encodep && result == CODING_FINISH_INCONSISTENT_EOL)
- {
- unsigned char *pend = dst, *p = pend - inserted_byte;
- Lisp_Object eol_type;
+ coding->consumed = coding->consumed_char = 0;
+ coding->produced = coding->produced_char = 0;
+ record_conversion_result (coding, CODING_RESULT_SUCCESS);
+ coding->errors = 0;
- /* Encode LFs back to the original eol format (CR or CRLF). */
- if (coding->eol_type == CODING_EOL_CR)
- {
- while (p < pend) if (*p++ == '\n') p[-1] = '\r';
- }
- else
- {
- int count = 0;
+ ALLOC_CONVERSION_WORK_AREA (coding);
- while (p < pend) if (*p++ == '\n') count++;
- if (src - dst < count)
- {
- /* We don't have sufficient room for encoding LFs
- back to CRLF. We must record converted and
- not-yet-converted text back to the buffer
- content, enlarge the gap, then record them out of
- the buffer contents again. */
- int add = len_byte + inserted_byte;
-
- GAP_SIZE -= add;
- ZV += add; Z += add; ZV_BYTE += add; Z_BYTE += add;
- GPT += inserted_byte; GPT_BYTE += inserted_byte;
- make_gap (count - GAP_SIZE);
- GAP_SIZE += add;
- ZV -= add; Z -= add; ZV_BYTE -= add; Z_BYTE -= add;
- GPT -= inserted_byte; GPT_BYTE -= inserted_byte;
- /* Don't forget to update SRC, DST, and PEND. */
- src = GAP_END_ADDR - len_byte;
- dst = GPT_ADDR + inserted_byte;
- pend = dst;
- }
- inserted += count;
- inserted_byte += count;
- coding->produced += count;
- p = dst = pend + count;
- while (count)
- {
- *--p = *--pend;
- if (*p == '\n') count--, *--p = '\r';
- }
- }
+ do {
+ coding_set_source (coding);
+ consume_chars (coding, translation_table, max_lookup);
+ coding_set_destination (coding);
+ (*(coding->encoder)) (coding);
+ } while (coding->consumed_char < coding->src_chars);
- /* Suppress eol-format conversion in the further conversion. */
- coding->eol_type = CODING_EOL_LF;
+ if (BUFFERP (coding->dst_object) && coding->produced_char > 0)
+ insert_from_gap (coding->produced_char, coding->produced);
- /* Set the coding system symbol to that for Unix-like EOL. */
- eol_type = Fget (saved_coding_symbol, Qeol_type);
- if (VECTORP (eol_type)
- && XVECTOR (eol_type)->size == 3
- && SYMBOLP (XVECTOR (eol_type)->contents[CODING_EOL_LF]))
- coding->symbol = XVECTOR (eol_type)->contents[CODING_EOL_LF];
- else
- coding->symbol = saved_coding_symbol;
+ return (coding->result);
+}
- continue;
- }
- if (len_byte <= 0)
- {
- if (coding->type != coding_type_ccl
- || coding->mode & CODING_MODE_LAST_BLOCK)
- break;
- coding->mode |= CODING_MODE_LAST_BLOCK;
- continue;
- }
- if (result == CODING_FINISH_INSUFFICIENT_SRC)
- {
- /* The source text ends in invalid codes. Let's just
- make them valid buffer contents, and finish conversion. */
- if (multibyte_p)
- {
- unsigned char *start = dst;
- inserted += len_byte;
- while (len_byte--)
- {
- int c = *src++;
- dst += CHAR_STRING (c, dst);
- }
+/* Name (or base name) of work buffer for code conversion. */
+static Lisp_Object Vcode_conversion_workbuf_name;
- inserted_byte += dst - start;
- }
- else
- {
- inserted += len_byte;
- inserted_byte += len_byte;
- while (len_byte--)
- *dst++ = *src++;
- }
- break;
- }
- if (result == CODING_FINISH_INTERRUPT)
- {
- /* The conversion procedure was interrupted by a user. */
- break;
- }
- /* Now RESULT == CODING_FINISH_INSUFFICIENT_DST */
- if (coding->consumed < 1)
- {
- /* It's quite strange to require more memory without
- consuming any bytes. Perhaps CCL program bug. */
- break;
- }
- if (first)
- {
- /* We have just done the first batch of conversion which was
- stopped because of insufficient gap. Let's reconsider the
- required gap size (i.e. SRT - DST) now.
+/* A working buffer used by the top level conversion. Once it is
+ created, it is never destroyed. It has the name
+ Vcode_conversion_workbuf_name. The other working buffers are
+ destroyed after the use is finished, and their names are modified
+ versions of Vcode_conversion_workbuf_name. */
+static Lisp_Object Vcode_conversion_reused_workbuf;
- We have converted ORIG bytes (== coding->consumed) into
- NEW bytes (coding->produced). To convert the remaining
- LEN bytes, we may need REQUIRE bytes of gap, where:
- REQUIRE + LEN_BYTE = LEN_BYTE * (NEW / ORIG)
- REQUIRE = LEN_BYTE * (NEW - ORIG) / ORIG
- Here, we are sure that NEW >= ORIG. */
+/* 1 iff Vcode_conversion_reused_workbuf is already in use. */
+static int reused_workbuf_in_use;
- if (coding->produced <= coding->consumed)
- {
- /* This happens because of CCL-based coding system with
- eol-type CRLF. */
- require = 0;
- }
- else
- {
- float ratio = coding->produced - coding->consumed;
- ratio /= coding->consumed;
- require = len_byte * ratio;
- }
- first = 0;
- }
- if ((src - dst) < (require + 2000))
- {
- /* See the comment above the previous call of make_gap. */
- int add = len_byte + inserted_byte;
- GAP_SIZE -= add;
- ZV += add; Z += add; ZV_BYTE += add; Z_BYTE += add;
- GPT += inserted_byte; GPT_BYTE += inserted_byte;
- make_gap (require + 2000);
- GAP_SIZE += add;
- ZV -= add; Z -= add; ZV_BYTE -= add; Z_BYTE -= add;
- GPT -= inserted_byte; GPT_BYTE -= inserted_byte;
- }
- }
- if (src - dst > 0) *dst = 0; /* Put an anchor. */
+/* Return a working buffer of code convesion. MULTIBYTE specifies the
+ multibyteness of returning buffer. */
- if (encodep && coding->dst_multibyte)
- {
- /* The output is unibyte. We must convert 8-bit characters to
- multibyte form. */
- if (inserted_byte * 2 > GAP_SIZE)
- {
- GAP_SIZE -= inserted_byte;
- ZV += inserted_byte; Z += inserted_byte;
- ZV_BYTE += inserted_byte; Z_BYTE += inserted_byte;
- GPT += inserted_byte; GPT_BYTE += inserted_byte;
- make_gap (inserted_byte - GAP_SIZE);
- GAP_SIZE += inserted_byte;
- ZV -= inserted_byte; Z -= inserted_byte;
- ZV_BYTE -= inserted_byte; Z_BYTE -= inserted_byte;
- GPT -= inserted_byte; GPT_BYTE -= inserted_byte;
- }
- inserted_byte = str_to_multibyte (GPT_ADDR, GAP_SIZE, inserted_byte);
- }
+static Lisp_Object
+make_conversion_work_buffer (multibyte)
+ int multibyte;
+{
+ Lisp_Object name, workbuf;
+ struct buffer *current;
- /* If we shrank the conversion area, adjust it now. */
- if (total_skip > 0)
+ if (reused_workbuf_in_use++)
{
- if (tail_skip > 0)
- safe_bcopy (GAP_END_ADDR, GPT_ADDR + inserted_byte, tail_skip);
- inserted += total_skip; inserted_byte += total_skip;
- GAP_SIZE += total_skip;
- GPT -= head_skip; GPT_BYTE -= head_skip;
- ZV -= total_skip; ZV_BYTE -= total_skip;
- Z -= total_skip; Z_BYTE -= total_skip;
- from -= head_skip; from_byte -= head_skip;
- to += tail_skip; to_byte += tail_skip;
+ name = Fgenerate_new_buffer_name (Vcode_conversion_workbuf_name, Qnil);
+ workbuf = Fget_buffer_create (name);
}
-
- prev_Z = Z;
- if (! EQ (current_buffer->undo_list, Qt))
- adjust_after_replace (from, from_byte, deletion, inserted, inserted_byte);
else
- adjust_after_replace_noundo (from, from_byte, nchars_del, nbytes_del,
- inserted, inserted_byte);
- inserted = Z - prev_Z;
-
- if (!encodep && coding->cmp_data && coding->cmp_data->used)
- coding_restore_composition (coding, Fcurrent_buffer ());
- coding_free_composition_data (coding);
-
- if (! inhibit_pre_post_conversion
- && ! encodep && ! NILP (coding->post_read_conversion))
{
- Lisp_Object val;
- Lisp_Object saved_coding_system;
+ name = Vcode_conversion_workbuf_name;
+ workbuf = Fget_buffer_create (name);
+ if (NILP (Vcode_conversion_reused_workbuf))
+ Vcode_conversion_reused_workbuf = workbuf;
+ }
+ current = current_buffer;
+ set_buffer_internal (XBUFFER (workbuf));
+ Ferase_buffer ();
+ current_buffer->undo_list = Qt;
+ current_buffer->enable_multibyte_characters = multibyte ? Qt : Qnil;
+ set_buffer_internal (current);
+ return workbuf;
+}
- if (from != PT)
- TEMP_SET_PT_BOTH (from, from_byte);
- prev_Z = Z;
- record_unwind_protect (code_convert_region_unwind,
- Fcons (Vlast_coding_system_used, Qnil));
- saved_coding_system = Vlast_coding_system_used;
- Vlast_coding_system_used = coding->symbol;
- /* We should not call any more pre-write/post-read-conversion
- functions while this post-read-conversion is running. */
- inhibit_pre_post_conversion = 1;
- val = call1 (coding->post_read_conversion, make_number (inserted));
- inhibit_pre_post_conversion = 0;
- coding->symbol = Vlast_coding_system_used;
- Vlast_coding_system_used = saved_coding_system;
- /* Discard the unwind protect. */
- specpdl_ptr--;
- CHECK_NUMBER (val);
- inserted += Z - prev_Z;
- }
-
- if (orig_point >= from)
- {
- if (orig_point >= from + orig_len)
- orig_point += inserted - orig_len;
- else
- orig_point = from;
- TEMP_SET_PT (orig_point);
- }
- if (replace)
+static Lisp_Object
+code_conversion_restore (arg)
+ Lisp_Object arg;
+{
+ Lisp_Object current, workbuf;
+ struct gcpro gcpro1;
+
+ GCPRO1 (arg);
+ current = XCAR (arg);
+ workbuf = XCDR (arg);
+ if (! NILP (workbuf))
{
- signal_after_change (from, to - from, inserted);
- update_compositions (from, from + inserted, CHECK_BORDER);
+ if (EQ (workbuf, Vcode_conversion_reused_workbuf))
+ reused_workbuf_in_use = 0;
+ else if (! NILP (Fbuffer_live_p (workbuf)))
+ Fkill_buffer (workbuf);
}
+ set_buffer_internal (XBUFFER (current));
+ UNGCPRO;
+ return Qnil;
+}
- {
- coding->consumed = to_byte - from_byte;
- coding->consumed_char = to - from;
- coding->produced = inserted_byte;
- coding->produced_char = inserted;
- }
+Lisp_Object
+code_conversion_save (with_work_buf, multibyte)
+ int with_work_buf, multibyte;
+{
+ Lisp_Object workbuf = Qnil;
- return 0;
+ if (with_work_buf)
+ workbuf = make_conversion_work_buffer (multibyte);
+ record_unwind_protect (code_conversion_restore,
+ Fcons (Fcurrent_buffer (), workbuf));
+ return workbuf;
}
-/* Name (or base name) of work buffer for code conversion. */
-static Lisp_Object Vcode_conversion_workbuf_name;
+int
+decode_coding_gap (coding, chars, bytes)
+ struct coding_system *coding;
+ EMACS_INT chars, bytes;
+{
+ int count = specpdl_ptr - specpdl;
+ Lisp_Object attrs;
+
+ code_conversion_save (0, 0);
+
+ coding->src_object = Fcurrent_buffer ();
+ coding->src_chars = chars;
+ coding->src_bytes = bytes;
+ coding->src_pos = -chars;
+ coding->src_pos_byte = -bytes;
+ coding->src_multibyte = chars < bytes;
+ coding->dst_object = coding->src_object;
+ coding->dst_pos = PT;
+ coding->dst_pos_byte = PT_BYTE;
+ coding->dst_multibyte = ! NILP (current_buffer->enable_multibyte_characters);
-/* Set the current buffer to the working buffer prepared for
- code-conversion. MULTIBYTE specifies the multibyteness of the
- buffer. Return the buffer we set if it must be killed after use.
- Otherwise return Qnil. */
+ if (CODING_REQUIRE_DETECTION (coding))
+ detect_coding (coding);
-static Lisp_Object
-set_conversion_work_buffer (multibyte)
- int multibyte;
-{
- Lisp_Object buffer, buffer_to_kill;
- struct buffer *buf;
+ coding->mode |= CODING_MODE_LAST_BLOCK;
+ current_buffer->text->inhibit_shrinking = 1;
+ decode_coding (coding);
+ current_buffer->text->inhibit_shrinking = 0;
- buffer = Fget_buffer_create (Vcode_conversion_workbuf_name);
- buf = XBUFFER (buffer);
- if (buf == current_buffer)
+ attrs = CODING_ID_ATTRS (coding->id);
+ if (! NILP (CODING_ATTR_POST_READ (attrs)))
{
- /* As we are already in the work buffer, we must generate a new
- buffer for the work. */
- Lisp_Object name;
+ EMACS_INT prev_Z = Z, prev_Z_BYTE = Z_BYTE;
+ Lisp_Object val;
- name = Fgenerate_new_buffer_name (Vcode_conversion_workbuf_name, Qnil);
- buffer = buffer_to_kill = Fget_buffer_create (name);
- buf = XBUFFER (buffer);
+ TEMP_SET_PT_BOTH (coding->dst_pos, coding->dst_pos_byte);
+ val = call1 (CODING_ATTR_POST_READ (attrs),
+ make_number (coding->produced_char));
+ CHECK_NATNUM (val);
+ coding->produced_char += Z - prev_Z;
+ coding->produced += Z_BYTE - prev_Z_BYTE;
}
- else
- buffer_to_kill = Qnil;
-
- delete_all_overlays (buf);
- buf->directory = current_buffer->directory;
- buf->read_only = Qnil;
- buf->filename = Qnil;
- buf->undo_list = Qt;
- eassert (buf->overlays_before == NULL);
- eassert (buf->overlays_after == NULL);
- set_buffer_internal (buf);
- if (BEG != BEGV || Z != ZV)
- Fwiden ();
- del_range_2 (BEG, BEG_BYTE, Z, Z_BYTE, 0);
- buf->enable_multibyte_characters = multibyte ? Qt : Qnil;
- return buffer_to_kill;
+
+ unbind_to (count, Qnil);
+ return coding->result;
}
-Lisp_Object
-run_pre_post_conversion_on_str (str, coding, encodep)
- Lisp_Object str;
+int
+encode_coding_gap (coding, chars, bytes)
struct coding_system *coding;
- int encodep;
+ EMACS_INT chars, bytes;
{
- int count = SPECPDL_INDEX ();
- struct gcpro gcpro1, gcpro2;
- int multibyte = STRING_MULTIBYTE (str);
- Lisp_Object old_deactivate_mark;
- Lisp_Object buffer_to_kill;
- Lisp_Object unwind_arg;
-
- record_unwind_protect (Fset_buffer, Fcurrent_buffer ());
- /* It is not crucial to specbind this. */
- old_deactivate_mark = Vdeactivate_mark;
- GCPRO2 (str, old_deactivate_mark);
-
- /* We must insert the contents of STR as is without
- unibyte<->multibyte conversion. For that, we adjust the
- multibyteness of the working buffer to that of STR. */
- buffer_to_kill = set_conversion_work_buffer (multibyte);
- if (NILP (buffer_to_kill))
- unwind_arg = Fcons (Vlast_coding_system_used, Qnil);
- else
- unwind_arg = list2 (Vlast_coding_system_used, buffer_to_kill);
- record_unwind_protect (code_convert_region_unwind, unwind_arg);
+ int count = specpdl_ptr - specpdl;
- insert_from_string (str, 0, 0,
- SCHARS (str), SBYTES (str), 0);
- UNGCPRO;
- inhibit_pre_post_conversion = 1;
- if (encodep)
- {
- struct buffer *prev = current_buffer;
+ code_conversion_save (0, 0);
- call2 (coding->pre_write_conversion, make_number (BEG), make_number (Z));
- if (prev != current_buffer)
- /* We must kill the current buffer too. */
- Fsetcdr (unwind_arg, Fcons (Fcurrent_buffer (), XCDR (unwind_arg)));
- }
- else
- {
- Vlast_coding_system_used = coding->symbol;
- TEMP_SET_PT_BOTH (BEG, BEG_BYTE);
- call1 (coding->post_read_conversion, make_number (Z - BEG));
- coding->symbol = Vlast_coding_system_used;
- }
- inhibit_pre_post_conversion = 0;
- Vdeactivate_mark = old_deactivate_mark;
- str = make_buffer_string (BEG, Z, 1);
- return unbind_to (count, str);
+ coding->src_object = Fcurrent_buffer ();
+ coding->src_chars = chars;
+ coding->src_bytes = bytes;
+ coding->src_pos = -chars;
+ coding->src_pos_byte = -bytes;
+ coding->src_multibyte = chars < bytes;
+ coding->dst_object = coding->src_object;
+ coding->dst_pos = PT;
+ coding->dst_pos_byte = PT_BYTE;
+
+ encode_coding (coding);
+
+ unbind_to (count, Qnil);
+ return coding->result;
}
-/* Run pre-write-conversion function of CODING on NCHARS/NBYTES
- text in *STR. *SIZE is the allocated bytes for STR. As it
- is intended that this function is called from encode_terminal_code,
- the pre-write-conversion function is run by safe_call and thus
- "Error during redisplay: ..." is logged when an error occurs.
+/* Decode the text in the range FROM/FROM_BYTE and TO/TO_BYTE in
+ SRC_OBJECT into DST_OBJECT by coding context CODING.
+
+ SRC_OBJECT is a buffer, a string, or Qnil.
+
+ If it is a buffer, the text is at point of the buffer. FROM and TO
+ are positions in the buffer.
+
+ If it is a string, the text is at the beginning of the string.
+ FROM and TO are indices to the string.
+
+ If it is nil, the text is at coding->source. FROM and TO are
+ indices to coding->source.
+
+ DST_OBJECT is a buffer, Qt, or Qnil.
+
+ If it is a buffer, the decoded text is inserted at point of the
+ buffer. If the buffer is the same as SRC_OBJECT, the source text
+ is deleted.
- Store the resulting text in *STR and set CODING->produced_char and
- CODING->produced to the number of characters and bytes
- respectively. If the size of *STR is too small, enlarge it by
- xrealloc and update *STR and *SIZE. */
+ If it is Qt, a string is made from the decoded text, and
+ set in CODING->dst_object.
+
+ If it is Qnil, the decoded text is stored at CODING->destination.
+ The caller must allocate CODING->dst_bytes bytes at
+ CODING->destination by xmalloc. If the decoded text is longer than
+ CODING->dst_bytes, CODING->destination is relocated by xrealloc.
+ */
void
-run_pre_write_conversin_on_c_str (str, size, nchars, nbytes, coding)
- unsigned char **str;
- int *size, nchars, nbytes;
+decode_coding_object (coding, src_object, from, from_byte, to, to_byte,
+ dst_object)
struct coding_system *coding;
+ Lisp_Object src_object;
+ EMACS_INT from, from_byte, to, to_byte;
+ Lisp_Object dst_object;
{
- struct gcpro gcpro1, gcpro2;
- struct buffer *cur = current_buffer;
- struct buffer *prev;
- Lisp_Object old_deactivate_mark, old_last_coding_system_used;
- Lisp_Object args[3];
- Lisp_Object buffer_to_kill;
-
- /* It is not crucial to specbind this. */
- old_deactivate_mark = Vdeactivate_mark;
- old_last_coding_system_used = Vlast_coding_system_used;
- GCPRO2 (old_deactivate_mark, old_last_coding_system_used);
-
- /* We must insert the contents of STR as is without
- unibyte<->multibyte conversion. For that, we adjust the
- multibyteness of the working buffer to that of STR. */
- buffer_to_kill = set_conversion_work_buffer (coding->src_multibyte);
- insert_1_both (*str, nchars, nbytes, 0, 0, 0);
- UNGCPRO;
- inhibit_pre_post_conversion = 1;
- prev = current_buffer;
- args[0] = coding->pre_write_conversion;
- args[1] = make_number (BEG);
- args[2] = make_number (Z);
- safe_call (3, args);
- inhibit_pre_post_conversion = 0;
- Vdeactivate_mark = old_deactivate_mark;
- Vlast_coding_system_used = old_last_coding_system_used;
- coding->produced_char = Z - BEG;
- coding->produced = Z_BYTE - BEG_BYTE;
- if (coding->produced > *size)
- {
- *size = coding->produced;
- *str = xrealloc (*str, *size);
- }
- if (BEG < GPT && GPT < Z)
- move_gap (BEG);
- bcopy (BEG_ADDR, *str, coding->produced);
- coding->src_multibyte
- = ! NILP (current_buffer->enable_multibyte_characters);
- if (prev != current_buffer)
- Fkill_buffer (Fcurrent_buffer ());
- set_buffer_internal (cur);
- if (! NILP (buffer_to_kill))
- Fkill_buffer (buffer_to_kill);
-}
+ int count = specpdl_ptr - specpdl;
+ unsigned char *destination;
+ EMACS_INT dst_bytes;
+ EMACS_INT chars = to - from;
+ EMACS_INT bytes = to_byte - from_byte;
+ Lisp_Object attrs;
+ Lisp_Object buffer;
+ int saved_pt = -1, saved_pt_byte;
+ buffer = Fcurrent_buffer ();
-Lisp_Object
-decode_coding_string (str, coding, nocopy)
- Lisp_Object str;
- struct coding_system *coding;
- int nocopy;
-{
- int len;
- struct conversion_buffer buf;
- int from, to_byte;
- Lisp_Object saved_coding_symbol;
- int result;
- int require_decoding;
- int shrinked_bytes = 0;
- Lisp_Object newstr;
- int consumed, consumed_char, produced, produced_char;
-
- from = 0;
- to_byte = SBYTES (str);
-
- saved_coding_symbol = coding->symbol;
- coding->src_multibyte = STRING_MULTIBYTE (str);
- coding->dst_multibyte = 1;
- coding->heading_ascii = 0;
+ if (NILP (dst_object))
+ {
+ destination = coding->destination;
+ dst_bytes = coding->dst_bytes;
+ }
- if (CODING_REQUIRE_DETECTION (coding))
+ coding->src_object = src_object;
+ coding->src_chars = chars;
+ coding->src_bytes = bytes;
+ coding->src_multibyte = chars < bytes;
+
+ if (STRINGP (src_object))
{
- /* See the comments in code_convert_region. */
- if (coding->type == coding_type_undecided)
+ coding->src_pos = from;
+ coding->src_pos_byte = from_byte;
+ }
+ else if (BUFFERP (src_object))
+ {
+ set_buffer_internal (XBUFFER (src_object));
+ if (from != GPT)
+ move_gap_both (from, from_byte);
+ if (EQ (src_object, dst_object))
{
- detect_coding (coding, SDATA (str), to_byte);
- if (coding->type == coding_type_undecided)
- {
- coding->type = coding_type_emacs_mule;
- coding->category_idx = CODING_CATEGORY_IDX_EMACS_MULE;
- /* As emacs-mule decoder will handle composition, we
- need this setting to allocate coding->cmp_data
- later. */
- coding->composing = COMPOSITION_NO;
- }
+ saved_pt = PT, saved_pt_byte = PT_BYTE;
+ TEMP_SET_PT_BOTH (from, from_byte);
+ del_range_both (from, from_byte, to, to_byte, 1);
+ coding->src_pos = -chars;
+ coding->src_pos_byte = -bytes;
}
- if (coding->eol_type == CODING_EOL_UNDECIDED
- && coding->type != coding_type_ccl)
+ else
{
- saved_coding_symbol = coding->symbol;
- detect_eol (coding, SDATA (str), to_byte);
- if (coding->eol_type == CODING_EOL_UNDECIDED)
- coding->eol_type = CODING_EOL_LF;
- /* We had better recover the original eol format if we
- encounter an inconsistent eol format while decoding. */
- coding->mode |= CODING_MODE_INHIBIT_INCONSISTENT_EOL;
+ coding->src_pos = from;
+ coding->src_pos_byte = from_byte;
}
}
- if (coding->type == coding_type_no_conversion
- || coding->type == coding_type_raw_text)
- coding->dst_multibyte = 0;
-
- require_decoding = CODING_REQUIRE_DECODING (coding);
+ if (CODING_REQUIRE_DETECTION (coding))
+ detect_coding (coding);
+ attrs = CODING_ID_ATTRS (coding->id);
- if (STRING_MULTIBYTE (str))
+ if (EQ (dst_object, Qt)
+ || (! NILP (CODING_ATTR_POST_READ (attrs))
+ && NILP (dst_object)))
{
- /* Decoding routines expect the source text to be unibyte. */
- str = Fstring_as_unibyte (str);
- to_byte = SBYTES (str);
- nocopy = 1;
- coding->src_multibyte = 0;
+ coding->dst_object = code_conversion_save (1, 1);
+ coding->dst_pos = BEG;
+ coding->dst_pos_byte = BEG_BYTE;
+ coding->dst_multibyte = 1;
}
-
- /* Try to skip the heading and tailing ASCIIs. */
- if (require_decoding && coding->type != coding_type_ccl)
+ else if (BUFFERP (dst_object))
{
- SHRINK_CONVERSION_REGION (&from, &to_byte, coding, SDATA (str),
- 0);
- if (from == to_byte)
- require_decoding = 0;
- shrinked_bytes = from + (SBYTES (str) - to_byte);
+ code_conversion_save (0, 0);
+ coding->dst_object = dst_object;
+ coding->dst_pos = BUF_PT (XBUFFER (dst_object));
+ coding->dst_pos_byte = BUF_PT_BYTE (XBUFFER (dst_object));
+ coding->dst_multibyte
+ = ! NILP (XBUFFER (dst_object)->enable_multibyte_characters);
}
-
- if (!require_decoding
- && !(SYMBOLP (coding->post_read_conversion)
- && !NILP (Ffboundp (coding->post_read_conversion))))
+ else
{
- coding->consumed = SBYTES (str);
- coding->consumed_char = SCHARS (str);
- if (coding->dst_multibyte)
- {
- str = Fstring_as_multibyte (str);
- nocopy = 1;
- }
- coding->produced = SBYTES (str);
- coding->produced_char = SCHARS (str);
- return (nocopy ? str : Fcopy_sequence (str));
+ code_conversion_save (0, 0);
+ coding->dst_object = Qnil;
+ coding->dst_multibyte = 1;
}
- if (coding->composing != COMPOSITION_DISABLED)
- coding_allocate_composition_data (coding, from);
- len = decoding_buffer_size (coding, to_byte - from);
- allocate_conversion_buffer (buf, len);
+ decode_coding (coding);
- consumed = consumed_char = produced = produced_char = 0;
- while (1)
+ if (BUFFERP (coding->dst_object))
+ set_buffer_internal (XBUFFER (coding->dst_object));
+
+ if (! NILP (CODING_ATTR_POST_READ (attrs)))
{
- result = decode_coding (coding, SDATA (str) + from + consumed,
- buf.data + produced, to_byte - from - consumed,
- buf.size - produced);
- consumed += coding->consumed;
- consumed_char += coding->consumed_char;
- produced += coding->produced;
- produced_char += coding->produced_char;
- if (result == CODING_FINISH_NORMAL
- || result == CODING_FINISH_INTERRUPT
- || (result == CODING_FINISH_INSUFFICIENT_SRC
- && coding->consumed == 0))
- break;
- if (result == CODING_FINISH_INSUFFICIENT_CMP)
- coding_allocate_composition_data (coding, from + produced_char);
- else if (result == CODING_FINISH_INSUFFICIENT_DST)
- extend_conversion_buffer (&buf);
- else if (result == CODING_FINISH_INCONSISTENT_EOL)
- {
- Lisp_Object eol_type;
+ struct gcpro gcpro1, gcpro2;
+ EMACS_INT prev_Z = Z, prev_Z_BYTE = Z_BYTE;
+ Lisp_Object val;
- /* Recover the original EOL format. */
- if (coding->eol_type == CODING_EOL_CR)
- {
- unsigned char *p;
- for (p = buf.data; p < buf.data + produced; p++)
- if (*p == '\n') *p = '\r';
- }
- else if (coding->eol_type == CODING_EOL_CRLF)
+ TEMP_SET_PT_BOTH (coding->dst_pos, coding->dst_pos_byte);
+ GCPRO2 (coding->src_object, coding->dst_object);
+ val = safe_call1 (CODING_ATTR_POST_READ (attrs),
+ make_number (coding->produced_char));
+ UNGCPRO;
+ CHECK_NATNUM (val);
+ coding->produced_char += Z - prev_Z;
+ coding->produced += Z_BYTE - prev_Z_BYTE;
+ }
+
+ if (EQ (dst_object, Qt))
+ {
+ coding->dst_object = Fbuffer_string ();
+ }
+ else if (NILP (dst_object) && BUFFERP (coding->dst_object))
+ {
+ set_buffer_internal (XBUFFER (coding->dst_object));
+ if (dst_bytes < coding->produced)
+ {
+ destination
+ = (unsigned char *) xrealloc (destination, coding->produced);
+ if (! destination)
{
- int num_eol = 0;
- unsigned char *p0, *p1;
- for (p0 = buf.data, p1 = p0 + produced; p0 < p1; p0++)
- if (*p0 == '\n') num_eol++;
- if (produced + num_eol >= buf.size)
- extend_conversion_buffer (&buf);
- for (p0 = buf.data + produced, p1 = p0 + num_eol; p0 > buf.data;)
- {
- *--p1 = *--p0;
- if (*p0 == '\n') *--p1 = '\r';
- }
- produced += num_eol;
- produced_char += num_eol;
+ record_conversion_result (coding,
+ CODING_RESULT_INSUFFICIENT_DST);
+ unbind_to (count, Qnil);
+ return;
}
- /* Suppress eol-format conversion in the further conversion. */
- coding->eol_type = CODING_EOL_LF;
-
- /* Set the coding system symbol to that for Unix-like EOL. */
- eol_type = Fget (saved_coding_symbol, Qeol_type);
- if (VECTORP (eol_type)
- && XVECTOR (eol_type)->size == 3
- && SYMBOLP (XVECTOR (eol_type)->contents[CODING_EOL_LF]))
- coding->symbol = XVECTOR (eol_type)->contents[CODING_EOL_LF];
- else
- coding->symbol = saved_coding_symbol;
-
-
+ if (BEGV < GPT && GPT < BEGV + coding->produced_char)
+ move_gap_both (BEGV, BEGV_BYTE);
+ bcopy (BEGV_ADDR, destination, coding->produced);
+ coding->destination = destination;
}
}
- coding->consumed = consumed;
- coding->consumed_char = consumed_char;
- coding->produced = produced;
- coding->produced_char = produced_char;
+ if (saved_pt >= 0)
+ {
+ /* This is the case of:
+ (BUFFERP (src_object) && EQ (src_object, dst_object))
+ As we have moved PT while replacing the original buffer
+ contents, we must recover it now. */
+ set_buffer_internal (XBUFFER (src_object));
+ if (saved_pt < from)
+ TEMP_SET_PT_BOTH (saved_pt, saved_pt_byte);
+ else if (saved_pt < from + chars)
+ TEMP_SET_PT_BOTH (from, from_byte);
+ else if (! NILP (current_buffer->enable_multibyte_characters))
+ TEMP_SET_PT_BOTH (saved_pt + (coding->produced_char - chars),
+ saved_pt_byte + (coding->produced - bytes));
+ else
+ TEMP_SET_PT_BOTH (saved_pt + (coding->produced - bytes),
+ saved_pt_byte + (coding->produced - bytes));
+ }
- if (coding->dst_multibyte)
- newstr = make_uninit_multibyte_string (produced_char + shrinked_bytes,
- produced + shrinked_bytes);
- else
- newstr = make_uninit_string (produced + shrinked_bytes);
- if (from > 0)
- STRING_COPYIN (newstr, 0, SDATA (str), from);
- STRING_COPYIN (newstr, from, buf.data, produced);
- if (shrinked_bytes > from)
- STRING_COPYIN (newstr, from + produced,
- SDATA (str) + to_byte,
- shrinked_bytes - from);
- free_conversion_buffer (&buf);
-
- coding->consumed += shrinked_bytes;
- coding->consumed_char += shrinked_bytes;
- coding->produced += shrinked_bytes;
- coding->produced_char += shrinked_bytes;
-
- if (coding->cmp_data && coding->cmp_data->used)
- coding_restore_composition (coding, newstr);
- coding_free_composition_data (coding);
-
- if (SYMBOLP (coding->post_read_conversion)
- && !NILP (Ffboundp (coding->post_read_conversion)))
- newstr = run_pre_post_conversion_on_str (newstr, coding, 0);
-
- return newstr;
+ unbind_to (count, coding->dst_object);
}
-Lisp_Object
-encode_coding_string (str, coding, nocopy)
- Lisp_Object str;
+
+void
+encode_coding_object (coding, src_object, from, from_byte, to, to_byte,
+ dst_object)
struct coding_system *coding;
- int nocopy;
+ Lisp_Object src_object;
+ EMACS_INT from, from_byte, to, to_byte;
+ Lisp_Object dst_object;
{
- int len;
- struct conversion_buffer buf;
- int from, to, to_byte;
- int result;
- int shrinked_bytes = 0;
- Lisp_Object newstr;
- int consumed, consumed_char, produced, produced_char;
-
- if (SYMBOLP (coding->pre_write_conversion)
- && !NILP (Ffboundp (coding->pre_write_conversion)))
- {
- str = run_pre_post_conversion_on_str (str, coding, 1);
- /* As STR is just newly generated, we don't have to copy it
- anymore. */
- nocopy = 1;
- }
+ int count = specpdl_ptr - specpdl;
+ EMACS_INT chars = to - from;
+ EMACS_INT bytes = to_byte - from_byte;
+ Lisp_Object attrs;
+ Lisp_Object buffer;
+ int saved_pt = -1, saved_pt_byte;
+ int kill_src_buffer = 0;
+
+ buffer = Fcurrent_buffer ();
+
+ coding->src_object = src_object;
+ coding->src_chars = chars;
+ coding->src_bytes = bytes;
+ coding->src_multibyte = chars < bytes;
+
+ attrs = CODING_ID_ATTRS (coding->id);
+
+ if (! NILP (CODING_ATTR_PRE_WRITE (attrs)))
+ {
+ coding->src_object = code_conversion_save (1, coding->src_multibyte);
+ set_buffer_internal (XBUFFER (coding->src_object));
+ if (STRINGP (src_object))
+ insert_from_string (src_object, from, from_byte, chars, bytes, 0);
+ else if (BUFFERP (src_object))
+ insert_from_buffer (XBUFFER (src_object), from, chars, 0);
+ else
+ insert_1_both (coding->source + from, chars, bytes, 0, 0, 0);
- from = 0;
- to = SCHARS (str);
- to_byte = SBYTES (str);
+ if (EQ (src_object, dst_object))
+ {
+ set_buffer_internal (XBUFFER (src_object));
+ saved_pt = PT, saved_pt_byte = PT_BYTE;
+ del_range_both (from, from_byte, to, to_byte, 1);
+ set_buffer_internal (XBUFFER (coding->src_object));
+ }
- /* Encoding routines determine the multibyteness of the source text
- by coding->src_multibyte. */
- coding->src_multibyte = SCHARS (str) < SBYTES (str);
- coding->dst_multibyte = 0;
- if (! CODING_REQUIRE_ENCODING (coding))
- goto no_need_of_encoding;
+ {
+ Lisp_Object args[3];
- if (coding->composing != COMPOSITION_DISABLED)
- coding_save_composition (coding, from, to, str);
+ args[0] = CODING_ATTR_PRE_WRITE (attrs);
+ args[1] = make_number (BEG);
+ args[2] = make_number (Z);
+ safe_call (3, args);
+ }
+ if (XBUFFER (coding->src_object) != current_buffer)
+ kill_src_buffer = 1;
+ coding->src_object = Fcurrent_buffer ();
+ if (BEG != GPT)
+ move_gap_both (BEG, BEG_BYTE);
+ coding->src_chars = Z - BEG;
+ coding->src_bytes = Z_BYTE - BEG_BYTE;
+ coding->src_pos = BEG;
+ coding->src_pos_byte = BEG_BYTE;
+ coding->src_multibyte = Z < Z_BYTE;
+ }
+ else if (STRINGP (src_object))
+ {
+ code_conversion_save (0, 0);
+ coding->src_pos = from;
+ coding->src_pos_byte = from_byte;
+ }
+ else if (BUFFERP (src_object))
+ {
+ code_conversion_save (0, 0);
+ set_buffer_internal (XBUFFER (src_object));
+ if (EQ (src_object, dst_object))
+ {
+ saved_pt = PT, saved_pt_byte = PT_BYTE;
+ coding->src_object = del_range_1 (from, to, 1, 1);
+ coding->src_pos = 0;
+ coding->src_pos_byte = 0;
+ }
+ else
+ {
+ if (from < GPT && to >= GPT)
+ move_gap_both (from, from_byte);
+ coding->src_pos = from;
+ coding->src_pos_byte = from_byte;
+ }
+ }
+ else
+ code_conversion_save (0, 0);
- /* Try to skip the heading and tailing ASCIIs. We can't skip them
- if we must run CCL program or there are compositions to
- encode. */
- coding->heading_ascii = 0;
- if (coding->type != coding_type_ccl
- && (! coding->cmp_data || coding->cmp_data->used == 0))
+ if (BUFFERP (dst_object))
{
- SHRINK_CONVERSION_REGION (&from, &to_byte, coding, SDATA (str),
- 1);
- if (from == to_byte)
+ coding->dst_object = dst_object;
+ if (EQ (src_object, dst_object))
{
- coding_free_composition_data (coding);
- goto no_need_of_encoding;
+ coding->dst_pos = from;
+ coding->dst_pos_byte = from_byte;
}
- shrinked_bytes = from + (SBYTES (str) - to_byte);
+ else
+ {
+ coding->dst_pos = BUF_PT (XBUFFER (dst_object));
+ coding->dst_pos_byte = BUF_PT_BYTE (XBUFFER (dst_object));
+ }
+ coding->dst_multibyte
+ = ! NILP (XBUFFER (dst_object)->enable_multibyte_characters);
+ }
+ else if (EQ (dst_object, Qt))
+ {
+ coding->dst_object = Qnil;
+ coding->dst_bytes = coding->src_chars;
+ if (coding->dst_bytes == 0)
+ coding->dst_bytes = 1;
+ coding->destination = (unsigned char *) xmalloc (coding->dst_bytes);
+ coding->dst_multibyte = 0;
+ }
+ else
+ {
+ coding->dst_object = Qnil;
+ coding->dst_multibyte = 0;
}
- len = encoding_buffer_size (coding, to_byte - from);
- allocate_conversion_buffer (buf, len);
+ encode_coding (coding);
- consumed = consumed_char = produced = produced_char = 0;
- while (1)
+ if (EQ (dst_object, Qt))
{
- result = encode_coding (coding, SDATA (str) + from + consumed,
- buf.data + produced, to_byte - from - consumed,
- buf.size - produced);
- consumed += coding->consumed;
- consumed_char += coding->consumed_char;
- produced += coding->produced;
- produced_char += coding->produced_char;
- if (result == CODING_FINISH_NORMAL
- || result == CODING_FINISH_INTERRUPT
- || (result == CODING_FINISH_INSUFFICIENT_SRC
- && coding->consumed == 0))
- break;
- /* Now result should be CODING_FINISH_INSUFFICIENT_DST. */
- extend_conversion_buffer (&buf);
- }
-
- coding->consumed = consumed;
- coding->consumed_char = consumed_char;
- coding->produced = produced;
- coding->produced_char = produced_char;
-
- newstr = make_uninit_string (produced + shrinked_bytes);
- if (from > 0)
- STRING_COPYIN (newstr, 0, SDATA (str), from);
- STRING_COPYIN (newstr, from, buf.data, produced);
- if (shrinked_bytes > from)
- STRING_COPYIN (newstr, from + produced,
- SDATA (str) + to_byte,
- shrinked_bytes - from);
-
- free_conversion_buffer (&buf);
- coding_free_composition_data (coding);
-
- return newstr;
-
- no_need_of_encoding:
- coding->consumed = SBYTES (str);
- coding->consumed_char = SCHARS (str);
- if (STRING_MULTIBYTE (str))
- {
- if (nocopy)
- /* We are sure that STR doesn't contain a multibyte
- character. */
- STRING_SET_UNIBYTE (str);
+ if (BUFFERP (coding->dst_object))
+ coding->dst_object = Fbuffer_string ();
else
{
- str = Fstring_as_unibyte (str);
- nocopy = 1;
+ coding->dst_object
+ = make_unibyte_string ((char *) coding->destination,
+ coding->produced);
+ xfree (coding->destination);
}
}
- coding->produced = SBYTES (str);
- coding->produced_char = SCHARS (str);
- return (nocopy ? str : Fcopy_sequence (str));
+
+ if (saved_pt >= 0)
+ {
+ /* This is the case of:
+ (BUFFERP (src_object) && EQ (src_object, dst_object))
+ As we have moved PT while replacing the original buffer
+ contents, we must recover it now. */
+ set_buffer_internal (XBUFFER (src_object));
+ if (saved_pt < from)
+ TEMP_SET_PT_BOTH (saved_pt, saved_pt_byte);
+ else if (saved_pt < from + chars)
+ TEMP_SET_PT_BOTH (from, from_byte);
+ else if (! NILP (current_buffer->enable_multibyte_characters))
+ TEMP_SET_PT_BOTH (saved_pt + (coding->produced_char - chars),
+ saved_pt_byte + (coding->produced - bytes));
+ else
+ TEMP_SET_PT_BOTH (saved_pt + (coding->produced - bytes),
+ saved_pt_byte + (coding->produced - bytes));
+ }
+
+ if (kill_src_buffer)
+ Fkill_buffer (coding->src_object);
+ unbind_to (count, Qnil);
+}
+
+
+Lisp_Object
+preferred_coding_system ()
+{
+ int id = coding_categories[coding_priorities[0]].id;
+
+ return CODING_ID_NAME (id);
}
@@ -6519,21 +7166,18 @@ encode_coding_string (str, coding, nocopy)
DEFUN ("coding-system-p", Fcoding_system_p, Scoding_system_p, 1, 1, 0,
doc: /* Return t if OBJECT is nil or a coding-system.
-See the documentation of `make-coding-system' for information
+See the documentation of `define-coding-system' for information
about coding-system objects. */)
(obj)
Lisp_Object obj;
{
- if (NILP (obj))
+ if (NILP (obj)
+ || CODING_SYSTEM_ID (obj) >= 0)
return Qt;
- if (!SYMBOLP (obj))
+ if (! SYMBOLP (obj)
+ || NILP (Fget (obj, Qcoding_system_define_form)))
return Qnil;
- if (! NILP (Fget (obj, Qcoding_system_define_form)))
- return Qt;
- /* Get coding-spec vector for OBJ. */
- obj = Fget (obj, Qcoding_system);
- return ((VECTORP (obj) && XVECTOR (obj)->size == 5)
- ? Qt : Qnil);
+ return Qt;
}
DEFUN ("read-non-nil-coding-system", Fread_non_nil_coding_system,
@@ -6560,7 +7204,7 @@ If the user enters null input, return second argument DEFAULT-CODING-SYSTEM. */
{
Lisp_Object val;
if (SYMBOLP (default_coding_system))
- default_coding_system = SYMBOL_NAME (default_coding_system);
+ XSETSTRING (default_coding_system, XPNTR (SYMBOL_NAME (default_coding_system)));
val = Fcompleting_read (prompt, Vcoding_system_alist, Qnil,
Qt, Qnil, Qcoding_system_history,
default_coding_system, Qnil);
@@ -6571,9 +7215,9 @@ DEFUN ("check-coding-system", Fcheck_coding_system, Scheck_coding_system,
1, 1, 0,
doc: /* Check validity of CODING-SYSTEM.
If valid, return CODING-SYSTEM, else signal a `coding-system-error' error.
-It is valid if it is nil or a symbol with a non-nil `coding-system' property.
-The value of this property should be a vector of length 5. */)
- (coding_system)
+It is valid if it is nil or a symbol defined as a coding system by the
+function `define-coding-system'. */)
+ (coding_system)
Lisp_Object coding_system;
{
Lisp_Object define_form;
@@ -6588,77 +7232,289 @@ The value of this property should be a vector of length 5. */)
return coding_system;
xsignal1 (Qcoding_system_error, coding_system);
}
+
+/* Detect how the bytes at SRC of length SRC_BYTES are encoded. If
+ HIGHEST is nonzero, return the coding system of the highest
+ priority among the detected coding systems. Otherwize return a
+ list of detected coding systems sorted by their priorities. If
+ MULTIBYTEP is nonzero, it is assumed that the bytes are in correct
+ multibyte form but contains only ASCII and eight-bit chars.
+ Otherwise, the bytes are raw bytes.
+
+ CODING-SYSTEM controls the detection as below:
+
+ If it is nil, detect both text-format and eol-format. If the
+ text-format part of CODING-SYSTEM is already specified
+ (e.g. `iso-latin-1'), detect only eol-format. If the eol-format
+ part of CODING-SYSTEM is already specified (e.g. `undecided-unix'),
+ detect only text-format. */
+
Lisp_Object
-detect_coding_system (src, src_bytes, highest, multibytep)
+detect_coding_system (src, src_chars, src_bytes, highest, multibytep,
+ coding_system)
const unsigned char *src;
- int src_bytes, highest;
+ int src_chars, src_bytes, highest;
int multibytep;
+ Lisp_Object coding_system;
{
- int coding_mask, eol_type;
- Lisp_Object val, tmp;
- int dummy;
+ const unsigned char *src_end = src + src_bytes;
+ Lisp_Object attrs, eol_type;
+ Lisp_Object val;
+ struct coding_system coding;
+ int id;
+ struct coding_detection_info detect_info;
+ enum coding_category base_category;
- coding_mask = detect_coding_mask (src, src_bytes, NULL, &dummy, multibytep);
- eol_type = detect_eol_type (src, src_bytes, &dummy);
- if (eol_type == CODING_EOL_INCONSISTENT)
- eol_type = CODING_EOL_UNDECIDED;
+ if (NILP (coding_system))
+ coding_system = Qundecided;
+ setup_coding_system (coding_system, &coding);
+ attrs = CODING_ID_ATTRS (coding.id);
+ eol_type = CODING_ID_EOL_TYPE (coding.id);
+ coding_system = CODING_ATTR_BASE_NAME (attrs);
+
+ coding.source = src;
+ coding.src_chars = src_chars;
+ coding.src_bytes = src_bytes;
+ coding.src_multibyte = multibytep;
+ coding.consumed = 0;
+ coding.mode |= CODING_MODE_LAST_BLOCK;
+
+ detect_info.checked = detect_info.found = detect_info.rejected = 0;
- if (!coding_mask)
+ /* At first, detect text-format if necessary. */
+ base_category = XINT (CODING_ATTR_CATEGORY (attrs));
+ if (base_category == coding_category_undecided)
{
- val = Qundecided;
- if (eol_type != CODING_EOL_UNDECIDED)
+ enum coding_category category;
+ struct coding_system *this;
+ int c, i;
+
+ /* Skip all ASCII bytes except for a few ISO2022 controls. */
+ for (i = 0; src < src_end; i++, src++)
{
- Lisp_Object val2;
- val2 = Fget (Qundecided, Qeol_type);
- if (VECTORP (val2))
- val = XVECTOR (val2)->contents[eol_type];
+ c = *src;
+ if (c & 0x80)
+ break;
+ if (c < 0x20
+ && (c == ISO_CODE_ESC || c == ISO_CODE_SI || c == ISO_CODE_SO)
+ && ! inhibit_iso_escape_detection)
+ {
+ coding.head_ascii = src - coding.source;
+ if (detect_coding_iso_2022 (&coding, &detect_info))
+ {
+ /* We have scanned the whole data. */
+ if (! (detect_info.rejected & CATEGORY_MASK_ISO_7_ELSE))
+ /* We didn't find an 8-bit code. */
+ src = src_end;
+ break;
+ }
+ }
}
- return (highest ? val : Fcons (val, Qnil));
- }
+ coding.head_ascii = src - coding.source;
- /* At first, gather possible coding systems in VAL. */
- val = Qnil;
- for (tmp = Vcoding_category_list; CONSP (tmp); tmp = XCDR (tmp))
- {
- Lisp_Object category_val, category_index;
+ if (src < src_end
+ || detect_info.found)
+ {
+ if (src == src_end)
+ /* As all bytes are 7-bit, we can ignore non-ISO-2022 codings. */
+ for (i = 0; i < coding_category_raw_text; i++)
+ {
+ category = coding_priorities[i];
+ this = coding_categories + category;
+ if (detect_info.found & (1 << category))
+ break;
+ }
+ else
+ for (i = 0; i < coding_category_raw_text; i++)
+ {
+ category = coding_priorities[i];
+ this = coding_categories + category;
+
+ if (this->id < 0)
+ {
+ /* No coding system of this category is defined. */
+ detect_info.rejected |= (1 << category);
+ }
+ else if (category >= coding_category_raw_text)
+ continue;
+ else if (detect_info.checked & (1 << category))
+ {
+ if (highest
+ && (detect_info.found & (1 << category)))
+ break;
+ }
+ else
+ {
+ if ((*(this->detector)) (&coding, &detect_info)
+ && highest
+ && (detect_info.found & (1 << category)))
+ {
+ if (category == coding_category_utf_16_auto)
+ {
+ if (detect_info.found & CATEGORY_MASK_UTF_16_LE)
+ category = coding_category_utf_16_le;
+ else
+ category = coding_category_utf_16_be;
+ }
+ break;
+ }
+ }
+ }
+ }
- category_index = Fget (XCAR (tmp), Qcoding_category_index);
- category_val = Fsymbol_value (XCAR (tmp));
- if (!NILP (category_val)
- && NATNUMP (category_index)
- && (coding_mask & (1 << XFASTINT (category_index))))
+ if (detect_info.rejected == CATEGORY_MASK_ANY)
{
- val = Fcons (category_val, val);
- if (highest)
- break;
+ detect_info.found = CATEGORY_MASK_RAW_TEXT;
+ id = coding_categories[coding_category_raw_text].id;
+ val = Fcons (make_number (id), Qnil);
}
- }
- if (!highest)
- val = Fnreverse (val);
+ else if (! detect_info.rejected && ! detect_info.found)
+ {
+ detect_info.found = CATEGORY_MASK_ANY;
+ id = coding_categories[coding_category_undecided].id;
+ val = Fcons (make_number (id), Qnil);
+ }
+ else if (highest)
+ {
+ if (detect_info.found)
+ {
+ detect_info.found = 1 << category;
+ val = Fcons (make_number (this->id), Qnil);
+ }
+ else
+ for (i = 0; i < coding_category_raw_text; i++)
+ if (! (detect_info.rejected & (1 << coding_priorities[i])))
+ {
+ detect_info.found = 1 << coding_priorities[i];
+ id = coding_categories[coding_priorities[i]].id;
+ val = Fcons (make_number (id), Qnil);
+ break;
+ }
+ }
+ else
+ {
+ int mask = detect_info.rejected | detect_info.found;
+ int found = 0;
+ val = Qnil;
- /* Then, replace the elements with subsidiary coding systems. */
- for (tmp = val; CONSP (tmp); tmp = XCDR (tmp))
+ for (i = coding_category_raw_text - 1; i >= 0; i--)
+ {
+ category = coding_priorities[i];
+ if (! (mask & (1 << category)))
+ {
+ found |= 1 << category;
+ id = coding_categories[category].id;
+ if (id >= 0)
+ val = Fcons (make_number (id), val);
+ }
+ }
+ for (i = coding_category_raw_text - 1; i >= 0; i--)
+ {
+ category = coding_priorities[i];
+ if (detect_info.found & (1 << category))
+ {
+ id = coding_categories[category].id;
+ val = Fcons (make_number (id), val);
+ }
+ }
+ detect_info.found |= found;
+ }
+ }
+ else if (base_category == coding_category_utf_16_auto)
{
- if (eol_type != CODING_EOL_UNDECIDED
- && eol_type != CODING_EOL_INCONSISTENT)
+ if (detect_coding_utf_16 (&coding, &detect_info))
{
- Lisp_Object eol;
- eol = Fget (XCAR (tmp), Qeol_type);
- if (VECTORP (eol))
- XSETCAR (tmp, XVECTOR (eol)->contents[eol_type]);
+ struct coding_system *this;
+
+ if (detect_info.found & CATEGORY_MASK_UTF_16_LE)
+ this = coding_categories + coding_category_utf_16_le;
+ else if (detect_info.found & CATEGORY_MASK_UTF_16_BE)
+ this = coding_categories + coding_category_utf_16_be;
+ else if (detect_info.rejected & CATEGORY_MASK_UTF_16_LE_NOSIG)
+ this = coding_categories + coding_category_utf_16_be_nosig;
+ else
+ this = coding_categories + coding_category_utf_16_le_nosig;
+ val = Fcons (make_number (this->id), Qnil);
}
}
+ else
+ {
+ detect_info.found = 1 << XINT (CODING_ATTR_CATEGORY (attrs));
+ val = Fcons (make_number (coding.id), Qnil);
+ }
+
+ /* Then, detect eol-format if necessary. */
+ {
+ int normal_eol = -1, utf_16_be_eol = -1, utf_16_le_eol;
+ Lisp_Object tail;
+
+ if (VECTORP (eol_type))
+ {
+ if (detect_info.found & ~CATEGORY_MASK_UTF_16)
+ normal_eol = detect_eol (coding.source, src_bytes,
+ coding_category_raw_text);
+ if (detect_info.found & (CATEGORY_MASK_UTF_16_BE
+ | CATEGORY_MASK_UTF_16_BE_NOSIG))
+ utf_16_be_eol = detect_eol (coding.source, src_bytes,
+ coding_category_utf_16_be);
+ if (detect_info.found & (CATEGORY_MASK_UTF_16_LE
+ | CATEGORY_MASK_UTF_16_LE_NOSIG))
+ utf_16_le_eol = detect_eol (coding.source, src_bytes,
+ coding_category_utf_16_le);
+ }
+ else
+ {
+ if (EQ (eol_type, Qunix))
+ normal_eol = utf_16_be_eol = utf_16_le_eol = EOL_SEEN_LF;
+ else if (EQ (eol_type, Qdos))
+ normal_eol = utf_16_be_eol = utf_16_le_eol = EOL_SEEN_CRLF;
+ else
+ normal_eol = utf_16_be_eol = utf_16_le_eol = EOL_SEEN_CR;
+ }
+
+ for (tail = val; CONSP (tail); tail = XCDR (tail))
+ {
+ enum coding_category category;
+ int this_eol;
+
+ id = XINT (XCAR (tail));
+ attrs = CODING_ID_ATTRS (id);
+ category = XINT (CODING_ATTR_CATEGORY (attrs));
+ eol_type = CODING_ID_EOL_TYPE (id);
+ if (VECTORP (eol_type))
+ {
+ if (category == coding_category_utf_16_be
+ || category == coding_category_utf_16_be_nosig)
+ this_eol = utf_16_be_eol;
+ else if (category == coding_category_utf_16_le
+ || category == coding_category_utf_16_le_nosig)
+ this_eol = utf_16_le_eol;
+ else
+ this_eol = normal_eol;
+
+ if (this_eol == EOL_SEEN_LF)
+ XSETCAR (tail, AREF (eol_type, 0));
+ else if (this_eol == EOL_SEEN_CRLF)
+ XSETCAR (tail, AREF (eol_type, 1));
+ else if (this_eol == EOL_SEEN_CR)
+ XSETCAR (tail, AREF (eol_type, 2));
+ else
+ XSETCAR (tail, CODING_ID_NAME (id));
+ }
+ else
+ XSETCAR (tail, CODING_ID_NAME (id));
+ }
+ }
+
return (highest ? XCAR (val) : val);
}
+
DEFUN ("detect-coding-region", Fdetect_coding_region, Sdetect_coding_region,
2, 3, 0,
- doc: /* Detect how the byte sequence in the region is encoded.
-Return a list of possible coding systems used on decoding a byte
-sequence containing the bytes in the region between START and END when
-the coding system `undecided' is specified. The list is ordered by
-priority decided in the current language environment.
+ doc: /* Detect coding system of the text in the region between START and END.
+Return a list of possible coding systems ordered by priority.
If only ASCII characters are found (except for such ISO-2022 control
characters ISO-2022 as ESC), it returns a list of single element
@@ -6672,7 +7528,6 @@ highest priority. */)
{
int from, to;
int from_byte, to_byte;
- int include_anchor_byte = 0;
CHECK_NUMBER_COERCE_MARKER (start);
CHECK_NUMBER_COERCE_MARKER (end);
@@ -6684,29 +7539,19 @@ highest priority. */)
if (from < GPT && to >= GPT)
move_gap_both (to, to_byte);
- /* If we an anchor byte `\0' follows the region, we include it in
- the detecting source. Then code detectors can handle the tailing
- byte sequence more accurately.
- Fix me: This is not a perfect solution. It is better that we
- add one more argument, say LAST_BLOCK, to all detect_coding_XXX.
- */
- if (to == Z || (to == GPT && GAP_SIZE > 0))
- include_anchor_byte = 1;
return detect_coding_system (BYTE_POS_ADDR (from_byte),
- to_byte - from_byte + include_anchor_byte,
+ to - from, to_byte - from_byte,
!NILP (highest),
!NILP (current_buffer
- ->enable_multibyte_characters));
+ ->enable_multibyte_characters),
+ Qnil);
}
DEFUN ("detect-coding-string", Fdetect_coding_string, Sdetect_coding_string,
1, 2, 0,
- doc: /* Detect how the byte sequence in STRING is encoded.
-Return a list of possible coding systems used on decoding a byte
-sequence containing the bytes in STRING when the coding system
-`undecided' is specified. The list is ordered by priority decided in
-the current language environment.
+ doc: /* Detect coding system of the text in STRING.
+Return a list of possible coding systems ordered by priority.
If only ASCII characters are found (except for such ISO-2022 control
characters ISO-2022 as ESC), it returns a list of single element
@@ -6721,288 +7566,157 @@ highest priority. */)
CHECK_STRING (string);
return detect_coding_system (SDATA (string),
- /* "+ 1" is to include the anchor byte
- `\0'. With this, code detectors can
- handle the tailing bytes more
- accurately. */
- SBYTES (string) + 1,
- !NILP (highest),
- STRING_MULTIBYTE (string));
+ SCHARS (string), SBYTES (string),
+ !NILP (highest), STRING_MULTIBYTE (string),
+ Qnil);
}
-/* Subroutine for Ffind_coding_systems_region_internal.
-
- Return a list of coding systems that safely encode the multibyte
- text between P and PEND. SAFE_CODINGS, if non-nil, is an alist of
- possible coding systems. If it is nil, it means that we have not
- yet found any coding systems.
-
- WORK_TABLE a char-table of which element is set to t once the
- element is looked up.
- If a non-ASCII single byte char is found, set
- *single_byte_char_found to 1. */
-
-static Lisp_Object
-find_safe_codings (p, pend, safe_codings, work_table, single_byte_char_found)
- unsigned char *p, *pend;
- Lisp_Object safe_codings, work_table;
- int *single_byte_char_found;
+static INLINE int
+char_encodable_p (c, attrs)
+ int c;
+ Lisp_Object attrs;
{
- int c, len;
- Lisp_Object val, ch;
- Lisp_Object prev, tail;
+ Lisp_Object tail;
+ struct charset *charset;
+ Lisp_Object translation_table;
- if (NILP (safe_codings))
- goto done_safe_codings;
- while (p < pend)
+ translation_table = CODING_ATTR_TRANS_TBL (attrs);
+ if (! NILP (translation_table))
+ c = translate_char (translation_table, c);
+ for (tail = CODING_ATTR_CHARSET_LIST (attrs);
+ CONSP (tail); tail = XCDR (tail))
{
- c = STRING_CHAR_AND_LENGTH (p, pend - p, len);
- p += len;
- if (ASCII_BYTE_P (c))
- /* We can ignore ASCII characters here. */
- continue;
- if (SINGLE_BYTE_CHAR_P (c))
- *single_byte_char_found = 1;
- /* Check the safe coding systems for C. */
- ch = make_number (c);
- val = Faref (work_table, ch);
- if (EQ (val, Qt))
- /* This element was already checked. Ignore it. */
- continue;
- /* Remember that we checked this element. */
- Faset (work_table, ch, Qt);
-
- for (prev = tail = safe_codings; CONSP (tail); tail = XCDR (tail))
- {
- Lisp_Object elt, translation_table, hash_table, accept_latin_extra;
- int encodable;
-
- elt = XCAR (tail);
- if (CONSP (XCDR (elt)))
- {
- /* This entry has this format now:
- ( CODING SAFE-CHARS TRANSLATION-TABLE HASH-TABLE
- ACCEPT-LATIN-EXTRA ) */
- val = XCDR (elt);
- encodable = ! NILP (Faref (XCAR (val), ch));
- if (! encodable)
- {
- val = XCDR (val);
- translation_table = XCAR (val);
- hash_table = XCAR (XCDR (val));
- accept_latin_extra = XCAR (XCDR (XCDR (val)));
- }
- }
- else
- {
- /* This entry has this format now: ( CODING . SAFE-CHARS) */
- encodable = ! NILP (Faref (XCDR (elt), ch));
- if (! encodable)
- {
- /* Transform the format to:
- ( CODING SAFE-CHARS TRANSLATION-TABLE HASH-TABLE
- ACCEPT-LATIN-EXTRA ) */
- val = Fget (XCAR (elt), Qcoding_system);
- translation_table
- = Fplist_get (AREF (val, 3),
- Qtranslation_table_for_encode);
- if (SYMBOLP (translation_table))
- translation_table = Fget (translation_table,
- Qtranslation_table);
- hash_table
- = (CHAR_TABLE_P (translation_table)
- ? XCHAR_TABLE (translation_table)->extras[1]
- : Qnil);
- accept_latin_extra
- = ((EQ (AREF (val, 0), make_number (2))
- && VECTORP (AREF (val, 4)))
- ? AREF (AREF (val, 4), 16)
- : Qnil);
- XSETCAR (tail, list5 (XCAR (elt), XCDR (elt),
- translation_table, hash_table,
- accept_latin_extra));
- }
- }
-
- if (! encodable
- && ((CHAR_TABLE_P (translation_table)
- && ! NILP (Faref (translation_table, ch)))
- || (HASH_TABLE_P (hash_table)
- && ! NILP (Fgethash (ch, hash_table, Qnil)))
- || (SINGLE_BYTE_CHAR_P (c)
- && ! NILP (accept_latin_extra)
- && VECTORP (Vlatin_extra_code_table)
- && ! NILP (AREF (Vlatin_extra_code_table, c)))))
- encodable = 1;
- if (encodable)
- prev = tail;
- else
- {
- /* Exclude this coding system from SAFE_CODINGS. */
- if (EQ (tail, safe_codings))
- {
- safe_codings = XCDR (safe_codings);
- if (NILP (safe_codings))
- goto done_safe_codings;
- }
- else
- XSETCDR (prev, XCDR (tail));
- }
- }
+ charset = CHARSET_FROM_ID (XINT (XCAR (tail)));
+ if (CHAR_CHARSET_P (c, charset))
+ break;
}
-
- done_safe_codings:
- /* If the above loop was terminated before P reaches PEND, it means
- SAFE_CODINGS was set to nil. If we have not yet found an
- non-ASCII single-byte char, check it now. */
- if (! *single_byte_char_found)
- while (p < pend)
- {
- c = STRING_CHAR_AND_LENGTH (p, pend - p, len);
- p += len;
- if (! ASCII_BYTE_P (c)
- && SINGLE_BYTE_CHAR_P (c))
- {
- *single_byte_char_found = 1;
- break;
- }
- }
- return safe_codings;
+ return (! NILP (tail));
}
+
+/* Return a list of coding systems that safely encode the text between
+ START and END. If EXCLUDE is non-nil, it is a list of coding
+ systems not to check. The returned list doesn't contain any such
+ coding systems. In any case, if the text contains only ASCII or is
+ unibyte, return t. */
+
DEFUN ("find-coding-systems-region-internal",
Ffind_coding_systems_region_internal,
- Sfind_coding_systems_region_internal, 2, 2, 0,
+ Sfind_coding_systems_region_internal, 2, 3, 0,
doc: /* Internal use only. */)
- (start, end)
- Lisp_Object start, end;
+ (start, end, exclude)
+ Lisp_Object start, end, exclude;
{
- Lisp_Object work_table, safe_codings;
- int non_ascii_p = 0;
- int single_byte_char_found = 0;
- const unsigned char *p1, *p1end, *p2, *p2end, *p;
+ Lisp_Object coding_attrs_list, safe_codings;
+ EMACS_INT start_byte, end_byte;
+ const unsigned char *p, *pbeg, *pend;
+ int c;
+ Lisp_Object tail, elt;
if (STRINGP (start))
{
- if (!STRING_MULTIBYTE (start))
+ if (!STRING_MULTIBYTE (start)
+ || SCHARS (start) == SBYTES (start))
return Qt;
- p1 = SDATA (start), p1end = p1 + SBYTES (start);
- p2 = p2end = p1end;
- if (SCHARS (start) != SBYTES (start))
- non_ascii_p = 1;
+ start_byte = 0;
+ end_byte = SBYTES (start);
}
else
{
- int from, to, stop;
-
CHECK_NUMBER_COERCE_MARKER (start);
CHECK_NUMBER_COERCE_MARKER (end);
if (XINT (start) < BEG || XINT (end) > Z || XINT (start) > XINT (end))
args_out_of_range (start, end);
if (NILP (current_buffer->enable_multibyte_characters))
return Qt;
- from = CHAR_TO_BYTE (XINT (start));
- to = CHAR_TO_BYTE (XINT (end));
- stop = from < GPT_BYTE && GPT_BYTE < to ? GPT_BYTE : to;
- p1 = BYTE_POS_ADDR (from), p1end = p1 + (stop - from);
- if (stop == to)
- p2 = p2end = p1end;
- else
- p2 = BYTE_POS_ADDR (stop), p2end = p2 + (to - stop);
- if (XINT (end) - XINT (start) != to - from)
- non_ascii_p = 1;
- }
+ start_byte = CHAR_TO_BYTE (XINT (start));
+ end_byte = CHAR_TO_BYTE (XINT (end));
+ if (XINT (end) - XINT (start) == end_byte - start_byte)
+ return Qt;
- if (!non_ascii_p)
- {
- /* We are sure that the text contains no multibyte character.
- Check if it contains eight-bit-graphic. */
- p = p1;
- for (p = p1; p < p1end && ASCII_BYTE_P (*p); p++);
- if (p == p1end)
+ if (XINT (start) < GPT && XINT (end) > GPT)
{
- for (p = p2; p < p2end && ASCII_BYTE_P (*p); p++);
- if (p == p2end)
- return Qt;
+ if ((GPT - XINT (start)) < (XINT (end) - GPT))
+ move_gap_both (XINT (start), start_byte);
+ else
+ move_gap_both (XINT (end), end_byte);
}
}
- /* The text contains non-ASCII characters. */
+ coding_attrs_list = Qnil;
+ for (tail = Vcoding_system_list; CONSP (tail); tail = XCDR (tail))
+ if (NILP (exclude)
+ || NILP (Fmemq (XCAR (tail), exclude)))
+ {
+ Lisp_Object attrs;
- work_table = Fmake_char_table (Qchar_coding_system, Qnil);
- safe_codings = Fcopy_sequence (XCDR (Vcoding_system_safe_chars));
+ attrs = AREF (CODING_SYSTEM_SPEC (XCAR (tail)), 0);
+ if (EQ (XCAR (tail), CODING_ATTR_BASE_NAME (attrs))
+ && ! EQ (CODING_ATTR_TYPE (attrs), Qundecided))
+ {
+ ASET (attrs, coding_attr_trans_tbl,
+ get_translation_table (attrs, 1, NULL));
+ coding_attrs_list = Fcons (attrs, coding_attrs_list);
+ }
+ }
- safe_codings = find_safe_codings (p1, p1end, safe_codings, work_table,
- &single_byte_char_found);
- if (p2 < p2end)
- safe_codings = find_safe_codings (p2, p2end, safe_codings, work_table,
- &single_byte_char_found);
- if (EQ (safe_codings, XCDR (Vcoding_system_safe_chars)))
- safe_codings = Qt;
+ if (STRINGP (start))
+ p = pbeg = SDATA (start);
else
- {
- /* Turn safe_codings to a list of coding systems... */
- Lisp_Object val;
-
- if (single_byte_char_found)
- /* ... and append these for eight-bit chars. */
- val = Fcons (Qraw_text,
- Fcons (Qemacs_mule, Fcons (Qno_conversion, Qnil)));
- else
- /* ... and append generic coding systems. */
- val = Fcopy_sequence (XCAR (Vcoding_system_safe_chars));
-
- for (; CONSP (safe_codings); safe_codings = XCDR (safe_codings))
- val = Fcons (XCAR (XCAR (safe_codings)), val);
- safe_codings = val;
- }
-
- return safe_codings;
-}
-
-
-/* Search from position POS for such characters that are unencodable
- accoding to SAFE_CHARS, and return a list of their positions. P
- points where in the memory the character at POS exists. Limit the
- search at PEND or when Nth unencodable characters are found.
+ p = pbeg = BYTE_POS_ADDR (start_byte);
+ pend = p + (end_byte - start_byte);
- If SAFE_CHARS is a char table, an element for an unencodable
- character is nil.
+ while (p < pend && ASCII_BYTE_P (*p)) p++;
+ while (p < pend && ASCII_BYTE_P (*(pend - 1))) pend--;
- If SAFE_CHARS is nil, all non-ASCII characters are unencodable.
-
- Otherwise, SAFE_CHARS is t, and only eight-bit-contrl and
- eight-bit-graphic characters are unencodable. */
-
-static Lisp_Object
-unencodable_char_position (safe_chars, pos, p, pend, n)
- Lisp_Object safe_chars;
- int pos;
- unsigned char *p, *pend;
- int n;
-{
- Lisp_Object pos_list;
-
- pos_list = Qnil;
while (p < pend)
{
- int len;
- int c = STRING_CHAR_AND_LENGTH (p, MAX_MULTIBYTE_LENGTH, len);
-
- if (c >= 128
- && (CHAR_TABLE_P (safe_chars)
- ? NILP (CHAR_TABLE_REF (safe_chars, c))
- : (NILP (safe_chars) || c < 256)))
+ if (ASCII_BYTE_P (*p))
+ p++;
+ else
{
- pos_list = Fcons (make_number (pos), pos_list);
- if (--n <= 0)
- break;
+ c = STRING_CHAR_ADVANCE (p);
+
+ charset_map_loaded = 0;
+ for (tail = coding_attrs_list; CONSP (tail);)
+ {
+ elt = XCAR (tail);
+ if (NILP (elt))
+ tail = XCDR (tail);
+ else if (char_encodable_p (c, elt))
+ tail = XCDR (tail);
+ else if (CONSP (XCDR (tail)))
+ {
+ XSETCAR (tail, XCAR (XCDR (tail)));
+ XSETCDR (tail, XCDR (XCDR (tail)));
+ }
+ else
+ {
+ XSETCAR (tail, Qnil);
+ tail = XCDR (tail);
+ }
+ }
+ if (charset_map_loaded)
+ {
+ EMACS_INT p_offset = p - pbeg, pend_offset = pend - pbeg;
+
+ if (STRINGP (start))
+ pbeg = SDATA (start);
+ else
+ pbeg = BYTE_POS_ADDR (start_byte);
+ p = pbeg + p_offset;
+ pend = pbeg + pend_offset;
+ }
}
- pos++;
- p += len;
}
- return Fnreverse (pos_list);
+
+ safe_codings = list2 (Qraw_text, Qno_conversion);
+ for (tail = coding_attrs_list; CONSP (tail); tail = XCDR (tail))
+ if (! NILP (XCAR (tail)))
+ safe_codings = Fcons (CODING_ATTR_BASE_NAME (XCAR (tail)), safe_codings);
+
+ return safe_codings;
}
@@ -7024,24 +7738,36 @@ to the string. */)
Lisp_Object start, end, coding_system, count, string;
{
int n;
- Lisp_Object safe_chars;
struct coding_system coding;
+ Lisp_Object attrs, charset_list, translation_table;
Lisp_Object positions;
int from, to;
- unsigned char *p, *pend;
+ const unsigned char *p, *stop, *pend;
+ int ascii_compatible;
+
+ setup_coding_system (Fcheck_coding_system (coding_system), &coding);
+ attrs = CODING_ID_ATTRS (coding.id);
+ if (EQ (CODING_ATTR_TYPE (attrs), Qraw_text))
+ return Qnil;
+ ascii_compatible = ! NILP (CODING_ATTR_ASCII_COMPAT (attrs));
+ charset_list = CODING_ATTR_CHARSET_LIST (attrs);
+ translation_table = get_translation_table (attrs, 1, NULL);
if (NILP (string))
{
validate_region (&start, &end);
from = XINT (start);
to = XINT (end);
- if (NILP (current_buffer->enable_multibyte_characters))
+ if (NILP (current_buffer->enable_multibyte_characters)
+ || (ascii_compatible
+ && (to - from) == (CHAR_TO_BYTE (to) - (CHAR_TO_BYTE (from)))))
return Qnil;
p = CHAR_POS_ADDR (from);
- if (to == GPT)
- pend = GPT_ADDR;
+ pend = CHAR_POS_ADDR (to);
+ if (from < GPT && to >= GPT)
+ stop = GPT_ADDR;
else
- pend = CHAR_POS_ADDR (to);
+ stop = pend;
}
else
{
@@ -7056,11 +7782,11 @@ to the string. */)
if (! STRING_MULTIBYTE (string))
return Qnil;
p = SDATA (string) + string_char_to_byte (string, from);
- pend = SDATA (string) + string_char_to_byte (string, to);
+ stop = pend = SDATA (string) + string_char_to_byte (string, to);
+ if (ascii_compatible && (to - from) == (pend - p))
+ return Qnil;
}
- setup_coding_system (Fcheck_coding_system (coding_system), &coding);
-
if (NILP (count))
n = 1;
else
@@ -7069,151 +7795,294 @@ to the string. */)
n = XINT (count);
}
- if (coding.type == coding_type_no_conversion
- || coding.type == coding_type_raw_text)
- return Qnil;
+ positions = Qnil;
+ while (1)
+ {
+ int c;
- if (coding.type == coding_type_undecided)
- safe_chars = Qnil;
- else
- safe_chars = coding_safe_chars (coding_system);
+ if (ascii_compatible)
+ while (p < stop && ASCII_BYTE_P (*p))
+ p++, from++;
+ if (p >= stop)
+ {
+ if (p >= pend)
+ break;
+ stop = pend;
+ p = GAP_END_ADDR;
+ }
- if (STRINGP (string)
- || from >= GPT || to <= GPT)
- positions = unencodable_char_position (safe_chars, from, p, pend, n);
+ c = STRING_CHAR_ADVANCE (p);
+ if (! (ASCII_CHAR_P (c) && ascii_compatible)
+ && ! char_charset (translate_char (translation_table, c),
+ charset_list, NULL))
+ {
+ positions = Fcons (make_number (from), positions);
+ n--;
+ if (n == 0)
+ break;
+ }
+
+ from++;
+ }
+
+ return (NILP (count) ? Fcar (positions) : Fnreverse (positions));
+}
+
+
+DEFUN ("check-coding-systems-region", Fcheck_coding_systems_region,
+ Scheck_coding_systems_region, 3, 3, 0,
+ doc: /* Check if the region is encodable by coding systems.
+
+START and END are buffer positions specifying the region.
+CODING-SYSTEM-LIST is a list of coding systems to check.
+
+The value is an alist ((CODING-SYSTEM POS0 POS1 ...) ...), where
+CODING-SYSTEM is a member of CODING-SYSTEM-LIst and can't encode the
+whole region, POS0, POS1, ... are buffer positions where non-encodable
+characters are found.
+
+If all coding systems in CODING-SYSTEM-LIST can encode the region, the
+value is nil.
+
+START may be a string. In that case, check if the string is
+encodable, and the value contains indices to the string instead of
+buffer positions. END is ignored. */)
+ (start, end, coding_system_list)
+ Lisp_Object start, end, coding_system_list;
+{
+ Lisp_Object list;
+ EMACS_INT start_byte, end_byte;
+ int pos;
+ const unsigned char *p, *pbeg, *pend;
+ int c;
+ Lisp_Object tail, elt, attrs;
+
+ if (STRINGP (start))
+ {
+ if (!STRING_MULTIBYTE (start)
+ && SCHARS (start) != SBYTES (start))
+ return Qnil;
+ start_byte = 0;
+ end_byte = SBYTES (start);
+ pos = 0;
+ }
else
{
- Lisp_Object args[2];
+ CHECK_NUMBER_COERCE_MARKER (start);
+ CHECK_NUMBER_COERCE_MARKER (end);
+ if (XINT (start) < BEG || XINT (end) > Z || XINT (start) > XINT (end))
+ args_out_of_range (start, end);
+ if (NILP (current_buffer->enable_multibyte_characters))
+ return Qnil;
+ start_byte = CHAR_TO_BYTE (XINT (start));
+ end_byte = CHAR_TO_BYTE (XINT (end));
+ if (XINT (end) - XINT (start) == end_byte - start_byte)
+ return Qt;
- args[0] = unencodable_char_position (safe_chars, from, p, GPT_ADDR, n);
- n -= XINT (Flength (args[0]));
- if (n <= 0)
- positions = args[0];
+ if (XINT (start) < GPT && XINT (end) > GPT)
+ {
+ if ((GPT - XINT (start)) < (XINT (end) - GPT))
+ move_gap_both (XINT (start), start_byte);
+ else
+ move_gap_both (XINT (end), end_byte);
+ }
+ pos = XINT (start);
+ }
+
+ list = Qnil;
+ for (tail = coding_system_list; CONSP (tail); tail = XCDR (tail))
+ {
+ elt = XCAR (tail);
+ attrs = AREF (CODING_SYSTEM_SPEC (elt), 0);
+ ASET (attrs, coding_attr_trans_tbl,
+ get_translation_table (attrs, 1, NULL));
+ list = Fcons (Fcons (elt, Fcons (attrs, Qnil)), list);
+ }
+
+ if (STRINGP (start))
+ p = pbeg = SDATA (start);
+ else
+ p = pbeg = BYTE_POS_ADDR (start_byte);
+ pend = p + (end_byte - start_byte);
+
+ while (p < pend && ASCII_BYTE_P (*p)) p++, pos++;
+ while (p < pend && ASCII_BYTE_P (*(pend - 1))) pend--;
+
+ while (p < pend)
+ {
+ if (ASCII_BYTE_P (*p))
+ p++;
else
{
- args[1] = unencodable_char_position (safe_chars, GPT, GAP_END_ADDR,
- pend, n);
- positions = Fappend (2, args);
+ c = STRING_CHAR_ADVANCE (p);
+
+ charset_map_loaded = 0;
+ for (tail = list; CONSP (tail); tail = XCDR (tail))
+ {
+ elt = XCDR (XCAR (tail));
+ if (! char_encodable_p (c, XCAR (elt)))
+ XSETCDR (elt, Fcons (make_number (pos), XCDR (elt)));
+ }
+ if (charset_map_loaded)
+ {
+ EMACS_INT p_offset = p - pbeg, pend_offset = pend - pbeg;
+
+ if (STRINGP (start))
+ pbeg = SDATA (start);
+ else
+ pbeg = BYTE_POS_ADDR (start_byte);
+ p = pbeg + p_offset;
+ pend = pbeg + pend_offset;
+ }
}
+ pos++;
+ }
+
+ tail = list;
+ list = Qnil;
+ for (; CONSP (tail); tail = XCDR (tail))
+ {
+ elt = XCAR (tail);
+ if (CONSP (XCDR (XCDR (elt))))
+ list = Fcons (Fcons (XCAR (elt), Fnreverse (XCDR (XCDR (elt)))),
+ list);
}
- return (NILP (count) ? Fcar (positions) : positions);
+ return list;
}
Lisp_Object
-code_convert_region1 (start, end, coding_system, encodep)
- Lisp_Object start, end, coding_system;
- int encodep;
+code_convert_region (start, end, coding_system, dst_object, encodep, norecord)
+ Lisp_Object start, end, coding_system, dst_object;
+ int encodep, norecord;
{
struct coding_system coding;
- int from, to;
+ EMACS_INT from, from_byte, to, to_byte;
+ Lisp_Object src_object;
CHECK_NUMBER_COERCE_MARKER (start);
CHECK_NUMBER_COERCE_MARKER (end);
- CHECK_SYMBOL (coding_system);
+ if (NILP (coding_system))
+ coding_system = Qno_conversion;
+ else
+ CHECK_CODING_SYSTEM (coding_system);
+ src_object = Fcurrent_buffer ();
+ if (NILP (dst_object))
+ dst_object = src_object;
+ else if (! EQ (dst_object, Qt))
+ CHECK_BUFFER (dst_object);
validate_region (&start, &end);
from = XFASTINT (start);
+ from_byte = CHAR_TO_BYTE (from);
to = XFASTINT (end);
+ to_byte = CHAR_TO_BYTE (to);
- if (NILP (coding_system))
- return make_number (to - from);
-
- if (setup_coding_system (Fcheck_coding_system (coding_system), &coding) < 0)
- error ("Invalid coding system: %s", SDATA (SYMBOL_NAME (coding_system)));
-
+ setup_coding_system (coding_system, &coding);
coding.mode |= CODING_MODE_LAST_BLOCK;
- coding.src_multibyte = coding.dst_multibyte
- = !NILP (current_buffer->enable_multibyte_characters);
- code_convert_region (from, CHAR_TO_BYTE (from), to, CHAR_TO_BYTE (to),
- &coding, encodep, 1);
- Vlast_coding_system_used = coding.symbol;
- return make_number (coding.produced_char);
+
+ if (encodep)
+ encode_coding_object (&coding, src_object, from, from_byte, to, to_byte,
+ dst_object);
+ else
+ decode_coding_object (&coding, src_object, from, from_byte, to, to_byte,
+ dst_object);
+ if (! norecord)
+ Vlast_coding_system_used = CODING_ID_NAME (coding.id);
+
+ return (BUFFERP (dst_object)
+ ? make_number (coding.produced_char)
+ : coding.dst_object);
}
+
DEFUN ("decode-coding-region", Fdecode_coding_region, Sdecode_coding_region,
- 3, 3, "r\nzCoding system: ",
+ 3, 4, "r\nzCoding system: ",
doc: /* Decode the current region from the specified coding system.
-When called from a program, takes three arguments:
-START, END, and CODING-SYSTEM. START and END are buffer positions.
+When called from a program, takes four arguments:
+ START, END, CODING-SYSTEM, and DESTINATION.
+START and END are buffer positions.
+
+Optional 4th arguments DESTINATION specifies where the decoded text goes.
+If nil, the region between START and END is replace by the decoded text.
+If buffer, the decoded text is inserted in the buffer.
+If t, the decoded text is returned.
+
This function sets `last-coding-system-used' to the precise coding system
used (which may be different from CODING-SYSTEM if CODING-SYSTEM is
not fully specified.)
It returns the length of the decoded text. */)
- (start, end, coding_system)
- Lisp_Object start, end, coding_system;
+ (start, end, coding_system, destination)
+ Lisp_Object start, end, coding_system, destination;
{
- return code_convert_region1 (start, end, coding_system, 0);
+ return code_convert_region (start, end, coding_system, destination, 0, 0);
}
DEFUN ("encode-coding-region", Fencode_coding_region, Sencode_coding_region,
- 3, 3, "r\nzCoding system: ",
- doc: /* Encode the current region into the specified coding system.
+ 3, 4, "r\nzCoding system: ",
+ doc: /* Encode the current region by specified coding system.
When called from a program, takes three arguments:
START, END, and CODING-SYSTEM. START and END are buffer positions.
+
+Optional 4th arguments DESTINATION specifies where the encoded text goes.
+If nil, the region between START and END is replace by the encoded text.
+If buffer, the encoded text is inserted in the buffer.
+If t, the encoded text is returned.
+
This function sets `last-coding-system-used' to the precise coding system
used (which may be different from CODING-SYSTEM if CODING-SYSTEM is
not fully specified.)
It returns the length of the encoded text. */)
- (start, end, coding_system)
- Lisp_Object start, end, coding_system;
+ (start, end, coding_system, destination)
+ Lisp_Object start, end, coding_system, destination;
{
- return code_convert_region1 (start, end, coding_system, 1);
+ return code_convert_region (start, end, coding_system, destination, 1, 0);
}
Lisp_Object
-code_convert_string1 (string, coding_system, nocopy, encodep)
- Lisp_Object string, coding_system, nocopy;
- int encodep;
+code_convert_string (string, coding_system, dst_object,
+ encodep, nocopy, norecord)
+ Lisp_Object string, coding_system, dst_object;
+ int encodep, nocopy, norecord;
{
struct coding_system coding;
+ EMACS_INT chars, bytes;
CHECK_STRING (string);
- CHECK_SYMBOL (coding_system);
-
if (NILP (coding_system))
- return (NILP (nocopy) ? Fcopy_sequence (string) : string);
+ {
+ if (! norecord)
+ Vlast_coding_system_used = Qno_conversion;
+ if (NILP (dst_object))
+ return (nocopy ? Fcopy_sequence (string) : string);
+ }
- if (setup_coding_system (Fcheck_coding_system (coding_system), &coding) < 0)
- error ("Invalid coding system: %s", SDATA (SYMBOL_NAME (coding_system)));
+ if (NILP (coding_system))
+ coding_system = Qno_conversion;
+ else
+ CHECK_CODING_SYSTEM (coding_system);
+ if (NILP (dst_object))
+ dst_object = Qt;
+ else if (! EQ (dst_object, Qt))
+ CHECK_BUFFER (dst_object);
+ setup_coding_system (coding_system, &coding);
coding.mode |= CODING_MODE_LAST_BLOCK;
- string = (encodep
- ? encode_coding_string (string, &coding, !NILP (nocopy))
- : decode_coding_string (string, &coding, !NILP (nocopy)));
- Vlast_coding_system_used = coding.symbol;
+ chars = SCHARS (string);
+ bytes = SBYTES (string);
+ if (encodep)
+ encode_coding_object (&coding, string, 0, 0, chars, bytes, dst_object);
+ else
+ decode_coding_object (&coding, string, 0, 0, chars, bytes, dst_object);
+ if (! norecord)
+ Vlast_coding_system_used = CODING_ID_NAME (coding.id);
- return string;
+ return (BUFFERP (dst_object)
+ ? make_number (coding.produced_char)
+ : coding.dst_object);
}
-DEFUN ("decode-coding-string", Fdecode_coding_string, Sdecode_coding_string,
- 2, 3, 0,
- doc: /* Decode STRING which is encoded in CODING-SYSTEM, and return the result.
-Optional arg NOCOPY non-nil means it is OK to return STRING itself
-if the decoding operation is trivial.
-This function sets `last-coding-system-used' to the precise coding system
-used (which may be different from CODING-SYSTEM if CODING-SYSTEM is
-not fully specified.) */)
- (string, coding_system, nocopy)
- Lisp_Object string, coding_system, nocopy;
-{
- return code_convert_string1 (string, coding_system, nocopy, 0);
-}
-
-DEFUN ("encode-coding-string", Fencode_coding_string, Sencode_coding_string,
- 2, 3, 0,
- doc: /* Encode STRING to CODING-SYSTEM, and return the result.
-Optional arg NOCOPY non-nil means it is OK to return STRING itself
-if the encoding operation is trivial.
-This function sets `last-coding-system-used' to the precise coding system
-used (which may be different from CODING-SYSTEM if CODING-SYSTEM is
-not fully specified.) */)
- (string, coding_system, nocopy)
- Lisp_Object string, coding_system, nocopy;
-{
- return code_convert_string1 (string, coding_system, nocopy, 1);
-}
/* Encode or decode STRING according to CODING_SYSTEM.
Do not set Vlast_coding_system_used.
@@ -7226,23 +8095,52 @@ code_convert_string_norecord (string, coding_system, encodep)
Lisp_Object string, coding_system;
int encodep;
{
- struct coding_system coding;
+ return code_convert_string (string, coding_system, Qt, encodep, 0, 1);
+}
- CHECK_STRING (string);
- CHECK_SYMBOL (coding_system);
- if (NILP (coding_system))
- return string;
+DEFUN ("decode-coding-string", Fdecode_coding_string, Sdecode_coding_string,
+ 2, 4, 0,
+ doc: /* Decode STRING which is encoded in CODING-SYSTEM, and return the result.
- if (setup_coding_system (Fcheck_coding_system (coding_system), &coding) < 0)
- error ("Invalid coding system: %s", SDATA (SYMBOL_NAME (coding_system)));
+Optional third arg NOCOPY non-nil means it is OK to return STRING itself
+if the decoding operation is trivial.
- coding.composing = COMPOSITION_DISABLED;
- coding.mode |= CODING_MODE_LAST_BLOCK;
- return (encodep
- ? encode_coding_string (string, &coding, 1)
- : decode_coding_string (string, &coding, 1));
+Optional fourth arg BUFFER non-nil meant that the decoded text is
+inserted in BUFFER instead of returned as a string. In this case,
+the return value is BUFFER.
+
+This function sets `last-coding-system-used' to the precise coding system
+used (which may be different from CODING-SYSTEM if CODING-SYSTEM is
+not fully specified. */)
+ (string, coding_system, nocopy, buffer)
+ Lisp_Object string, coding_system, nocopy, buffer;
+{
+ return code_convert_string (string, coding_system, buffer,
+ 0, ! NILP (nocopy), 0);
}
+
+DEFUN ("encode-coding-string", Fencode_coding_string, Sencode_coding_string,
+ 2, 4, 0,
+ doc: /* Encode STRING to CODING-SYSTEM, and return the result.
+
+Optional third arg NOCOPY non-nil means it is OK to return STRING
+itself if the encoding operation is trivial.
+
+Optional fourth arg BUFFER non-nil meant that the encoded text is
+inserted in BUFFER instead of returned as a string. In this case,
+the return value is BUFFER.
+
+This function sets `last-coding-system-used' to the precise coding system
+used (which may be different from CODING-SYSTEM if CODING-SYSTEM is
+not fully specified.) */)
+ (string, coding_system, nocopy, buffer)
+ Lisp_Object string, coding_system, nocopy, buffer;
+{
+ return code_convert_string (string, coding_system, buffer,
+ 1, ! NILP (nocopy), 1);
+}
+
DEFUN ("decode-sjis-char", Fdecode_sjis_char, Sdecode_sjis_char, 1, 1, 0,
doc: /* Decode a Japanese character which has CODE in shift_jis encoding.
@@ -7250,60 +8148,75 @@ Return the corresponding character. */)
(code)
Lisp_Object code;
{
- unsigned char c1, c2, s1, s2;
- Lisp_Object val;
+ Lisp_Object spec, attrs, val;
+ struct charset *charset_roman, *charset_kanji, *charset_kana, *charset;
+ int c;
+
+ CHECK_NATNUM (code);
+ c = XFASTINT (code);
+ CHECK_CODING_SYSTEM_GET_SPEC (Vsjis_coding_system, spec);
+ attrs = AREF (spec, 0);
- CHECK_NUMBER (code);
- s1 = (XFASTINT (code)) >> 8, s2 = (XFASTINT (code)) & 0xFF;
- if (s1 == 0)
+ if (ASCII_BYTE_P (c)
+ && ! NILP (CODING_ATTR_ASCII_COMPAT (attrs)))
+ return code;
+
+ val = CODING_ATTR_CHARSET_LIST (attrs);
+ charset_roman = CHARSET_FROM_ID (XINT (XCAR (val))), val = XCDR (val);
+ charset_kana = CHARSET_FROM_ID (XINT (XCAR (val))), val = XCDR (val);
+ charset_kanji = CHARSET_FROM_ID (XINT (XCAR (val)));
+
+ if (c <= 0x7F)
+ charset = charset_roman;
+ else if (c >= 0xA0 && c < 0xDF)
{
- if (s2 < 0x80)
- XSETFASTINT (val, s2);
- else if (s2 >= 0xA0 || s2 <= 0xDF)
- XSETFASTINT (val, MAKE_CHAR (charset_katakana_jisx0201, s2, 0));
- else
- error ("Invalid Shift JIS code: %x", XFASTINT (code));
+ charset = charset_kana;
+ c -= 0x80;
}
else
{
- if ((s1 < 0x80 || (s1 > 0x9F && s1 < 0xE0) || s1 > 0xEF)
- || (s2 < 0x40 || s2 == 0x7F || s2 > 0xFC))
- error ("Invalid Shift JIS code: %x", XFASTINT (code));
- DECODE_SJIS (s1, s2, c1, c2);
- XSETFASTINT (val, MAKE_CHAR (charset_jisx0208, c1, c2));
+ int s1 = c >> 8, s2 = c & 0xFF;
+
+ if (s1 < 0x81 || (s1 > 0x9F && s1 < 0xE0) || s1 > 0xEF
+ || s2 < 0x40 || s2 == 0x7F || s2 > 0xFC)
+ error ("Invalid code: %d", code);
+ SJIS_TO_JIS (c);
+ charset = charset_kanji;
}
- return val;
+ c = DECODE_CHAR (charset, c);
+ if (c < 0)
+ error ("Invalid code: %d", code);
+ return make_number (c);
}
+
DEFUN ("encode-sjis-char", Fencode_sjis_char, Sencode_sjis_char, 1, 1, 0,
doc: /* Encode a Japanese character CH to shift_jis encoding.
Return the corresponding code in SJIS. */)
(ch)
- Lisp_Object ch;
+ Lisp_Object ch;
{
- int charset, c1, c2, s1, s2;
- Lisp_Object val;
+ Lisp_Object spec, attrs, charset_list;
+ int c;
+ struct charset *charset;
+ unsigned code;
- CHECK_NUMBER (ch);
- SPLIT_CHAR (XFASTINT (ch), charset, c1, c2);
- if (charset == CHARSET_ASCII)
- {
- val = ch;
- }
- else if (charset == charset_jisx0208
- && c1 > 0x20 && c1 < 0x7F && c2 > 0x20 && c2 < 0x7F)
- {
- ENCODE_SJIS (c1, c2, s1, s2);
- XSETFASTINT (val, (s1 << 8) | s2);
- }
- else if (charset == charset_katakana_jisx0201
- && c1 > 0x20 && c2 < 0xE0)
- {
- XSETFASTINT (val, c1 | 0x80);
- }
- else
- error ("Can't encode to shift_jis: %d", XFASTINT (ch));
- return val;
+ CHECK_CHARACTER (ch);
+ c = XFASTINT (ch);
+ CHECK_CODING_SYSTEM_GET_SPEC (Vsjis_coding_system, spec);
+ attrs = AREF (spec, 0);
+
+ if (ASCII_CHAR_P (c)
+ && ! NILP (CODING_ATTR_ASCII_COMPAT (attrs)))
+ return ch;
+
+ charset_list = CODING_ATTR_CHARSET_LIST (attrs);
+ charset = char_charset (c, charset_list, &code);
+ if (code == CHARSET_INVALID_CODE (charset))
+ error ("Can't encode by shift_jis encoding: %d", c);
+ JIS_TO_SJIS (code);
+
+ return make_number (code);
}
DEFUN ("decode-big5-char", Fdecode_big5_char, Sdecode_big5_char, 1, 1, 0,
@@ -7312,27 +8225,37 @@ Return the corresponding character. */)
(code)
Lisp_Object code;
{
- int charset;
- unsigned char b1, b2, c1, c2;
- Lisp_Object val;
+ Lisp_Object spec, attrs, val;
+ struct charset *charset_roman, *charset_big5, *charset;
+ int c;
- CHECK_NUMBER (code);
- b1 = (XFASTINT (code)) >> 8, b2 = (XFASTINT (code)) & 0xFF;
- if (b1 == 0)
- {
- if (b2 >= 0x80)
- error ("Invalid BIG5 code: %x", XFASTINT (code));
- val = code;
- }
+ CHECK_NATNUM (code);
+ c = XFASTINT (code);
+ CHECK_CODING_SYSTEM_GET_SPEC (Vbig5_coding_system, spec);
+ attrs = AREF (spec, 0);
+
+ if (ASCII_BYTE_P (c)
+ && ! NILP (CODING_ATTR_ASCII_COMPAT (attrs)))
+ return code;
+
+ val = CODING_ATTR_CHARSET_LIST (attrs);
+ charset_roman = CHARSET_FROM_ID (XINT (XCAR (val))), val = XCDR (val);
+ charset_big5 = CHARSET_FROM_ID (XINT (XCAR (val)));
+
+ if (c <= 0x7F)
+ charset = charset_roman;
else
{
- if ((b1 < 0xA1 || b1 > 0xFE)
- || (b2 < 0x40 || (b2 > 0x7E && b2 < 0xA1) || b2 > 0xFE))
- error ("Invalid BIG5 code: %x", XFASTINT (code));
- DECODE_BIG5 (b1, b2, charset, c1, c2);
- XSETFASTINT (val, MAKE_CHAR (charset, c1, c2));
+ int b1 = c >> 8, b2 = c & 0x7F;
+ if (b1 < 0xA1 || b1 > 0xFE
+ || b2 < 0x40 || (b2 > 0x7E && b2 < 0xA1) || b2 > 0xFE)
+ error ("Invalid code: %d", code);
+ charset = charset_big5;
}
- return val;
+ c = DECODE_CHAR (charset, (unsigned )c);
+ if (c < 0)
+ error ("Invalid code: %d", code);
+ return make_number (c);
}
DEFUN ("encode-big5-char", Fencode_big5_char, Sencode_big5_char, 1, 1, 0,
@@ -7341,50 +8264,50 @@ Return the corresponding character code in Big5. */)
(ch)
Lisp_Object ch;
{
- int charset, c1, c2, b1, b2;
- Lisp_Object val;
-
- CHECK_NUMBER (ch);
- SPLIT_CHAR (XFASTINT (ch), charset, c1, c2);
- if (charset == CHARSET_ASCII)
- {
- val = ch;
- }
- else if ((charset == charset_big5_1
- && (XFASTINT (ch) >= 0x250a1 && XFASTINT (ch) <= 0x271ec))
- || (charset == charset_big5_2
- && XFASTINT (ch) >= 0x290a1 && XFASTINT (ch) <= 0x2bdb2))
- {
- ENCODE_BIG5 (charset, c1, c2, b1, b2);
- XSETFASTINT (val, (b1 << 8) | b2);
- }
- else
- error ("Can't encode to Big5: %d", XFASTINT (ch));
- return val;
+ Lisp_Object spec, attrs, charset_list;
+ struct charset *charset;
+ int c;
+ unsigned code;
+
+ CHECK_CHARACTER (ch);
+ c = XFASTINT (ch);
+ CHECK_CODING_SYSTEM_GET_SPEC (Vbig5_coding_system, spec);
+ attrs = AREF (spec, 0);
+ if (ASCII_CHAR_P (c)
+ && ! NILP (CODING_ATTR_ASCII_COMPAT (attrs)))
+ return ch;
+
+ charset_list = CODING_ATTR_CHARSET_LIST (attrs);
+ charset = char_charset (c, charset_list, &code);
+ if (code == CHARSET_INVALID_CODE (charset))
+ error ("Can't encode by Big5 encoding: %d", c);
+
+ return make_number (code);
}
+
-DEFUN ("set-terminal-coding-system-internal", Fset_terminal_coding_system_internal,
- Sset_terminal_coding_system_internal, 1, 2, 0,
+DEFUN ("set-terminal-coding-system-internal",
+ Fset_terminal_coding_system_internal,
+ Sset_terminal_coding_system_internal, 1, 1, 0,
doc: /* Internal use only. */)
- (coding_system, terminal)
+ (coding_system)
Lisp_Object coding_system;
- Lisp_Object terminal;
{
- struct coding_system *terminal_coding = TERMINAL_TERMINAL_CODING (get_terminal (terminal, 1));
CHECK_SYMBOL (coding_system);
- setup_coding_system (Fcheck_coding_system (coding_system), terminal_coding);
+ setup_coding_system (Fcheck_coding_system (coding_system),
+ &terminal_coding);
+
/* We had better not send unsafe characters to terminal. */
- terminal_coding->mode |= CODING_MODE_INHIBIT_UNENCODABLE_CHAR;
- /* Character composition should be disabled. */
- terminal_coding->composing = COMPOSITION_DISABLED;
- /* Error notification should be suppressed. */
- terminal_coding->suppress_error = 1;
- terminal_coding->src_multibyte = 1;
- terminal_coding->dst_multibyte = 0;
+ terminal_coding.mode |= CODING_MODE_SAFE_ENCODING;
+ /* Characer composition should be disabled. */
+ terminal_coding.common_flags &= ~CODING_ANNOTATE_COMPOSITION_MASK;
+ terminal_coding.src_multibyte = 1;
+ terminal_coding.dst_multibyte = 0;
return Qnil;
}
-DEFUN ("set-safe-terminal-coding-system-internal", Fset_safe_terminal_coding_system_internal,
+DEFUN ("set-safe-terminal-coding-system-internal",
+ Fset_safe_terminal_coding_system_internal,
Sset_safe_terminal_coding_system_internal, 1, 1, 0,
doc: /* Internal use only. */)
(coding_system)
@@ -7393,52 +8316,46 @@ DEFUN ("set-safe-terminal-coding-system-internal", Fset_safe_terminal_coding_sys
CHECK_SYMBOL (coding_system);
setup_coding_system (Fcheck_coding_system (coding_system),
&safe_terminal_coding);
- /* Character composition should be disabled. */
- safe_terminal_coding.composing = COMPOSITION_DISABLED;
- /* Error notification should be suppressed. */
- safe_terminal_coding.suppress_error = 1;
+ /* Characer composition should be disabled. */
+ safe_terminal_coding.common_flags &= ~CODING_ANNOTATE_COMPOSITION_MASK;
safe_terminal_coding.src_multibyte = 1;
safe_terminal_coding.dst_multibyte = 0;
return Qnil;
}
-DEFUN ("terminal-coding-system", Fterminal_coding_system,
- Sterminal_coding_system, 0, 1, 0,
- doc: /* Return coding system specified for terminal output on the given terminal.
-TERMINAL may be a terminal id, a frame, or nil for the selected
-frame's terminal device. */)
- (terminal)
- Lisp_Object terminal;
+DEFUN ("terminal-coding-system",
+ Fterminal_coding_system, Sterminal_coding_system, 0, 0, 0,
+ doc: /* Return coding system specified for terminal output. */)
+ ()
{
- return TERMINAL_TERMINAL_CODING (get_terminal (terminal, 1))->symbol;
+ Lisp_Object coding_system;
+
+ coding_system = CODING_ID_NAME (terminal_coding.id);
+ /* For backward compatibility, return nil if it is `undecided'. */
+ return (! EQ (coding_system, Qundecided) ? coding_system : Qnil);
}
-DEFUN ("set-keyboard-coding-system-internal", Fset_keyboard_coding_system_internal,
- Sset_keyboard_coding_system_internal, 1, 2, 0,
+DEFUN ("set-keyboard-coding-system-internal",
+ Fset_keyboard_coding_system_internal,
+ Sset_keyboard_coding_system_internal, 1, 1, 0,
doc: /* Internal use only. */)
- (coding_system, terminal)
+ (coding_system)
Lisp_Object coding_system;
- Lisp_Object terminal;
{
- struct terminal *t = get_terminal (terminal, 1);
CHECK_SYMBOL (coding_system);
-
setup_coding_system (Fcheck_coding_system (coding_system),
- TERMINAL_KEYBOARD_CODING (t));
- /* Character composition should be disabled. */
- TERMINAL_KEYBOARD_CODING (t)->composing = COMPOSITION_DISABLED;
+ &keyboard_coding);
+ /* Characer composition should be disabled. */
+ keyboard_coding.common_flags &= ~CODING_ANNOTATE_COMPOSITION_MASK;
return Qnil;
}
-DEFUN ("keyboard-coding-system", Fkeyboard_coding_system,
- Skeyboard_coding_system, 0, 1, 0,
- doc: /* Return coding system for decoding keyboard input on TERMINAL.
-TERMINAL may be a terminal id, a frame, or nil for the selected
-frame's terminal device. */)
- (terminal)
- Lisp_Object terminal;
+DEFUN ("keyboard-coding-system",
+ Fkeyboard_coding_system, Skeyboard_coding_system, 0, 0, 0,
+ doc: /* Return coding system specified for decoding keyboard input. */)
+ ()
{
- return TERMINAL_KEYBOARD_CODING (get_terminal (terminal, 1))->symbol;
+ return CODING_ID_NAME (keyboard_coding.id);
}
@@ -7495,23 +8412,16 @@ usage: (find-operation-coding-system OPERATION ARGUMENTS...) */)
operation = args[0];
if (!SYMBOLP (operation)
|| !INTEGERP (target_idx = Fget (operation, Qtarget_idx)))
- error ("Invalid first argument");
+ error ("Invalid first arguement");
if (nargs < 1 + XINT (target_idx))
error ("Too few arguments for operation: %s",
SDATA (SYMBOL_NAME (operation)));
- /* For write-region, if the 6th argument (i.e. VISIT, the 5th
- argument to write-region) is string, it must be treated as a
- target file name. */
- if (EQ (operation, Qwrite_region)
- && nargs > 5
- && STRINGP (args[5]))
- target_idx = make_number (4);
target = args[XINT (target_idx) + 1];
if (!(STRINGP (target)
|| (EQ (operation, Qinsert_file_contents) && CONSP (target)
&& STRINGP (XCAR (target)) && BUFFERP (XCDR (target)))
|| (EQ (operation, Qopen_network_stream) && INTEGERP (target))))
- error ("Invalid argument %d", XINT (target_idx) + 1);
+ error ("Invalid %dth argument", XINT (target_idx) + 1);
if (CONSP (target))
target = XCAR (target);
@@ -7527,8 +8437,8 @@ usage: (find-operation-coding-system OPERATION ARGUMENTS...) */)
for (; CONSP (chain); chain = XCDR (chain))
{
Lisp_Object elt;
- elt = XCAR (chain);
+ elt = XCAR (chain);
if (CONSP (elt)
&& ((STRINGP (target)
&& STRINGP (XCAR (elt))
@@ -7561,101 +8471,799 @@ usage: (find-operation-coding-system OPERATION ARGUMENTS...) */)
return Qnil;
}
-DEFUN ("update-coding-systems-internal", Fupdate_coding_systems_internal,
- Supdate_coding_systems_internal, 0, 0, 0,
- doc: /* Update internal database for ISO2022 and CCL based coding systems.
-When values of any coding categories are changed, you must
-call this function. */)
- ()
+DEFUN ("set-coding-system-priority", Fset_coding_system_priority,
+ Sset_coding_system_priority, 0, MANY, 0,
+ doc: /* Assign higher priority to the coding systems given as arguments.
+If multiple coding systems belongs to the same category,
+all but the first one are ignored.
+
+usage: (set-coding-system-priority ...) */)
+ (nargs, args)
+ int nargs;
+ Lisp_Object *args;
{
- int i;
+ int i, j;
+ int changed[coding_category_max];
+ enum coding_category priorities[coding_category_max];
+
+ bzero (changed, sizeof changed);
- for (i = CODING_CATEGORY_IDX_EMACS_MULE; i < CODING_CATEGORY_IDX_MAX; i++)
+ for (i = j = 0; i < nargs; i++)
{
- Lisp_Object val;
+ enum coding_category category;
+ Lisp_Object spec, attrs;
- val = SYMBOL_VALUE (XVECTOR (Vcoding_category_table)->contents[i]);
- if (!NILP (val))
- {
- if (! coding_system_table[i])
- coding_system_table[i] = ((struct coding_system *)
- xmalloc (sizeof (struct coding_system)));
- setup_coding_system (val, coding_system_table[i]);
- }
- else if (coding_system_table[i])
- {
- xfree (coding_system_table[i]);
- coding_system_table[i] = NULL;
- }
+ CHECK_CODING_SYSTEM_GET_SPEC (args[i], spec);
+ attrs = AREF (spec, 0);
+ category = XINT (CODING_ATTR_CATEGORY (attrs));
+ if (changed[category])
+ /* Ignore this coding system because a coding system of the
+ same category already had a higher priority. */
+ continue;
+ changed[category] = 1;
+ priorities[j++] = category;
+ if (coding_categories[category].id >= 0
+ && ! EQ (args[i], CODING_ID_NAME (coding_categories[category].id)))
+ setup_coding_system (args[i], &coding_categories[category]);
+ Fset (AREF (Vcoding_category_table, category), args[i]);
+ }
+
+ /* Now we have decided top J priorities. Reflect the order of the
+ original priorities to the remaining priorities. */
+
+ for (i = j, j = 0; i < coding_category_max; i++, j++)
+ {
+ while (j < coding_category_max
+ && changed[coding_priorities[j]])
+ j++;
+ if (j == coding_category_max)
+ abort ();
+ priorities[i] = coding_priorities[j];
}
+ bcopy (priorities, coding_priorities, sizeof priorities);
+
+ /* Update `coding-category-list'. */
+ Vcoding_category_list = Qnil;
+ for (i = coding_category_max - 1; i >= 0; i--)
+ Vcoding_category_list
+ = Fcons (AREF (Vcoding_category_table, priorities[i]),
+ Vcoding_category_list);
+
return Qnil;
}
-DEFUN ("set-coding-priority-internal", Fset_coding_priority_internal,
- Sset_coding_priority_internal, 0, 0, 0,
- doc: /* Update internal database for the current value of `coding-category-list'.
-This function is internal use only. */)
- ()
+DEFUN ("coding-system-priority-list", Fcoding_system_priority_list,
+ Scoding_system_priority_list, 0, 1, 0,
+ doc: /* Return a list of coding systems ordered by their priorities.
+HIGHESTP non-nil means just return the highest priority one. */)
+ (highestp)
+ Lisp_Object highestp;
{
- int i = 0, idx;
+ int i;
Lisp_Object val;
- val = Vcoding_category_list;
-
- while (CONSP (val) && i < CODING_CATEGORY_IDX_MAX)
+ for (i = 0, val = Qnil; i < coding_category_max; i++)
{
- if (! SYMBOLP (XCAR (val)))
- break;
- idx = XFASTINT (Fget (XCAR (val), Qcoding_category_index));
- if (idx >= CODING_CATEGORY_IDX_MAX)
- break;
- coding_priorities[i++] = (1 << idx);
- val = XCDR (val);
+ enum coding_category category = coding_priorities[i];
+ int id = coding_categories[category].id;
+ Lisp_Object attrs;
+
+ if (id < 0)
+ continue;
+ attrs = CODING_ID_ATTRS (id);
+ if (! NILP (highestp))
+ return CODING_ATTR_BASE_NAME (attrs);
+ val = Fcons (CODING_ATTR_BASE_NAME (attrs), val);
}
- /* If coding-category-list is valid and contains all coding
- categories, `i' should be CODING_CATEGORY_IDX_MAX now. If not,
- the following code saves Emacs from crashing. */
- while (i < CODING_CATEGORY_IDX_MAX)
- coding_priorities[i++] = CODING_CATEGORY_MASK_RAW_TEXT;
+ return Fnreverse (val);
+}
- return Qnil;
+static char *suffixes[] = { "-unix", "-dos", "-mac" };
+
+static Lisp_Object
+make_subsidiaries (base)
+ Lisp_Object base;
+{
+ Lisp_Object subsidiaries;
+ int base_name_len = SBYTES (SYMBOL_NAME (base));
+ char *buf = (char *) alloca (base_name_len + 6);
+ int i;
+
+ bcopy (SDATA (SYMBOL_NAME (base)), buf, base_name_len);
+ subsidiaries = Fmake_vector (make_number (3), Qnil);
+ for (i = 0; i < 3; i++)
+ {
+ bcopy (suffixes[i], buf + base_name_len, strlen (suffixes[i]) + 1);
+ ASET (subsidiaries, i, intern (buf));
+ }
+ return subsidiaries;
}
+
DEFUN ("define-coding-system-internal", Fdefine_coding_system_internal,
- Sdefine_coding_system_internal, 1, 1, 0,
- doc: /* Register CODING-SYSTEM as a base coding system.
-This function is internal use only. */)
- (coding_system)
- Lisp_Object coding_system;
+ Sdefine_coding_system_internal, coding_arg_max, MANY, 0,
+ doc: /* For internal use only.
+usage: (define-coding-system-internal ...) */)
+ (nargs, args)
+ int nargs;
+ Lisp_Object *args;
{
- Lisp_Object safe_chars, slot;
+ Lisp_Object name;
+ Lisp_Object spec_vec; /* [ ATTRS ALIASE EOL_TYPE ] */
+ Lisp_Object attrs; /* Vector of attributes. */
+ Lisp_Object eol_type;
+ Lisp_Object aliases;
+ Lisp_Object coding_type, charset_list, safe_charsets;
+ enum coding_category category;
+ Lisp_Object tail, val;
+ int max_charset_id = 0;
+ int i;
+
+ if (nargs < coding_arg_max)
+ goto short_args;
- if (NILP (Fcheck_coding_system (coding_system)))
- xsignal1 (Qcoding_system_error, coding_system);
+ attrs = Fmake_vector (make_number (coding_attr_last_index), Qnil);
- safe_chars = coding_safe_chars (coding_system);
- if (! EQ (safe_chars, Qt) && ! CHAR_TABLE_P (safe_chars))
- error ("No valid safe-chars property for %s",
- SDATA (SYMBOL_NAME (coding_system)));
+ name = args[coding_arg_name];
+ CHECK_SYMBOL (name);
+ CODING_ATTR_BASE_NAME (attrs) = name;
- if (EQ (safe_chars, Qt))
+ val = args[coding_arg_mnemonic];
+ if (! STRINGP (val))
+ CHECK_CHARACTER (val);
+ CODING_ATTR_MNEMONIC (attrs) = val;
+
+ coding_type = args[coding_arg_coding_type];
+ CHECK_SYMBOL (coding_type);
+ CODING_ATTR_TYPE (attrs) = coding_type;
+
+ charset_list = args[coding_arg_charset_list];
+ if (SYMBOLP (charset_list))
{
- if (NILP (Fmemq (coding_system, XCAR (Vcoding_system_safe_chars))))
- XSETCAR (Vcoding_system_safe_chars,
- Fcons (coding_system, XCAR (Vcoding_system_safe_chars)));
+ if (EQ (charset_list, Qiso_2022))
+ {
+ if (! EQ (coding_type, Qiso_2022))
+ error ("Invalid charset-list");
+ charset_list = Viso_2022_charset_list;
+ }
+ else if (EQ (charset_list, Qemacs_mule))
+ {
+ if (! EQ (coding_type, Qemacs_mule))
+ error ("Invalid charset-list");
+ charset_list = Vemacs_mule_charset_list;
+ }
+ for (tail = charset_list; CONSP (tail); tail = XCDR (tail))
+ if (max_charset_id < XFASTINT (XCAR (tail)))
+ max_charset_id = XFASTINT (XCAR (tail));
+ }
+ else
+ {
+ charset_list = Fcopy_sequence (charset_list);
+ for (tail = charset_list; !NILP (tail); tail = Fcdr (tail))
+ {
+ struct charset *charset;
+
+ val = Fcar (tail);
+ CHECK_CHARSET_GET_CHARSET (val, charset);
+ if (EQ (coding_type, Qiso_2022)
+ ? CHARSET_ISO_FINAL (charset) < 0
+ : EQ (coding_type, Qemacs_mule)
+ ? CHARSET_EMACS_MULE_ID (charset) < 0
+ : 0)
+ error ("Can't handle charset `%s'",
+ SDATA (SYMBOL_NAME (CHARSET_NAME (charset))));
+
+ XSETCAR (tail, make_number (charset->id));
+ if (max_charset_id < charset->id)
+ max_charset_id = charset->id;
+ }
}
+ CODING_ATTR_CHARSET_LIST (attrs) = charset_list;
+
+ safe_charsets = Fmake_string (make_number (max_charset_id + 1),
+ make_number (255));
+ for (tail = charset_list; CONSP (tail); tail = XCDR (tail))
+ SSET (safe_charsets, XFASTINT (XCAR (tail)), 0);
+ CODING_ATTR_SAFE_CHARSETS (attrs) = safe_charsets;
+
+ CODING_ATTR_ASCII_COMPAT (attrs) = args[coding_arg_ascii_compatible_p];
+
+ val = args[coding_arg_decode_translation_table];
+ if (! CHAR_TABLE_P (val) && ! CONSP (val))
+ CHECK_SYMBOL (val);
+ CODING_ATTR_DECODE_TBL (attrs) = val;
+
+ val = args[coding_arg_encode_translation_table];
+ if (! CHAR_TABLE_P (val) && ! CONSP (val))
+ CHECK_SYMBOL (val);
+ CODING_ATTR_ENCODE_TBL (attrs) = val;
+
+ val = args[coding_arg_post_read_conversion];
+ CHECK_SYMBOL (val);
+ CODING_ATTR_POST_READ (attrs) = val;
+
+ val = args[coding_arg_pre_write_conversion];
+ CHECK_SYMBOL (val);
+ CODING_ATTR_PRE_WRITE (attrs) = val;
+
+ val = args[coding_arg_default_char];
+ if (NILP (val))
+ CODING_ATTR_DEFAULT_CHAR (attrs) = make_number (' ');
else
{
- slot = Fassq (coding_system, XCDR (Vcoding_system_safe_chars));
- if (NILP (slot))
- XSETCDR (Vcoding_system_safe_chars,
- nconc2 (XCDR (Vcoding_system_safe_chars),
- Fcons (Fcons (coding_system, safe_chars), Qnil)));
+ CHECK_CHARACTER (val);
+ CODING_ATTR_DEFAULT_CHAR (attrs) = val;
+ }
+
+ val = args[coding_arg_for_unibyte];
+ CODING_ATTR_FOR_UNIBYTE (attrs) = NILP (val) ? Qnil : Qt;
+
+ val = args[coding_arg_plist];
+ CHECK_LIST (val);
+ CODING_ATTR_PLIST (attrs) = val;
+
+ if (EQ (coding_type, Qcharset))
+ {
+ /* Generate a lisp vector of 256 elements. Each element is nil,
+ integer, or a list of charset IDs.
+
+ If Nth element is nil, the byte code N is invalid in this
+ coding system.
+
+ If Nth element is a number NUM, N is the first byte of a
+ charset whose ID is NUM.
+
+ If Nth element is a list of charset IDs, N is the first byte
+ of one of them. The list is sorted by dimensions of the
+ charsets. A charset of smaller dimension comes firtst. */
+ val = Fmake_vector (make_number (256), Qnil);
+
+ for (tail = charset_list; CONSP (tail); tail = XCDR (tail))
+ {
+ struct charset *charset = CHARSET_FROM_ID (XFASTINT (XCAR (tail)));
+ int dim = CHARSET_DIMENSION (charset);
+ int idx = (dim - 1) * 4;
+
+ if (CHARSET_ASCII_COMPATIBLE_P (charset))
+ CODING_ATTR_ASCII_COMPAT (attrs) = Qt;
+
+ for (i = charset->code_space[idx];
+ i <= charset->code_space[idx + 1]; i++)
+ {
+ Lisp_Object tmp, tmp2;
+ int dim2;
+
+ tmp = AREF (val, i);
+ if (NILP (tmp))
+ tmp = XCAR (tail);
+ else if (NUMBERP (tmp))
+ {
+ dim2 = CHARSET_DIMENSION (CHARSET_FROM_ID (XFASTINT (tmp)));
+ if (dim < dim2)
+ tmp = Fcons (XCAR (tail), Fcons (tmp, Qnil));
+ else
+ tmp = Fcons (tmp, Fcons (XCAR (tail), Qnil));
+ }
+ else
+ {
+ for (tmp2 = tmp; CONSP (tmp2); tmp2 = XCDR (tmp2))
+ {
+ dim2 = CHARSET_DIMENSION (CHARSET_FROM_ID (XFASTINT (XCAR (tmp2))));
+ if (dim < dim2)
+ break;
+ }
+ if (NILP (tmp2))
+ tmp = nconc2 (tmp, Fcons (XCAR (tail), Qnil));
+ else
+ {
+ XSETCDR (tmp2, Fcons (XCAR (tmp2), XCDR (tmp2)));
+ XSETCAR (tmp2, XCAR (tail));
+ }
+ }
+ ASET (val, i, tmp);
+ }
+ }
+ ASET (attrs, coding_attr_charset_valids, val);
+ category = coding_category_charset;
+ }
+ else if (EQ (coding_type, Qccl))
+ {
+ Lisp_Object valids;
+
+ if (nargs < coding_arg_ccl_max)
+ goto short_args;
+
+ val = args[coding_arg_ccl_decoder];
+ CHECK_CCL_PROGRAM (val);
+ if (VECTORP (val))
+ val = Fcopy_sequence (val);
+ ASET (attrs, coding_attr_ccl_decoder, val);
+
+ val = args[coding_arg_ccl_encoder];
+ CHECK_CCL_PROGRAM (val);
+ if (VECTORP (val))
+ val = Fcopy_sequence (val);
+ ASET (attrs, coding_attr_ccl_encoder, val);
+
+ val = args[coding_arg_ccl_valids];
+ valids = Fmake_string (make_number (256), make_number (0));
+ for (tail = val; !NILP (tail); tail = Fcdr (tail))
+ {
+ int from, to;
+
+ val = Fcar (tail);
+ if (INTEGERP (val))
+ {
+ from = to = XINT (val);
+ if (from < 0 || from > 255)
+ args_out_of_range_3 (val, make_number (0), make_number (255));
+ }
+ else
+ {
+ CHECK_CONS (val);
+ CHECK_NATNUM_CAR (val);
+ CHECK_NATNUM_CDR (val);
+ from = XINT (XCAR (val));
+ if (from > 255)
+ args_out_of_range_3 (XCAR (val),
+ make_number (0), make_number (255));
+ to = XINT (XCDR (val));
+ if (to < from || to > 255)
+ args_out_of_range_3 (XCDR (val),
+ XCAR (val), make_number (255));
+ }
+ for (i = from; i <= to; i++)
+ SSET (valids, i, 1);
+ }
+ ASET (attrs, coding_attr_ccl_valids, valids);
+
+ category = coding_category_ccl;
+ }
+ else if (EQ (coding_type, Qutf_16))
+ {
+ Lisp_Object bom, endian;
+
+ CODING_ATTR_ASCII_COMPAT (attrs) = Qnil;
+
+ if (nargs < coding_arg_utf16_max)
+ goto short_args;
+
+ bom = args[coding_arg_utf16_bom];
+ if (! NILP (bom) && ! EQ (bom, Qt))
+ {
+ CHECK_CONS (bom);
+ val = XCAR (bom);
+ CHECK_CODING_SYSTEM (val);
+ val = XCDR (bom);
+ CHECK_CODING_SYSTEM (val);
+ }
+ ASET (attrs, coding_attr_utf_16_bom, bom);
+
+ endian = args[coding_arg_utf16_endian];
+ CHECK_SYMBOL (endian);
+ if (NILP (endian))
+ endian = Qbig;
+ else if (! EQ (endian, Qbig) && ! EQ (endian, Qlittle))
+ error ("Invalid endian: %s", SDATA (SYMBOL_NAME (endian)));
+ ASET (attrs, coding_attr_utf_16_endian, endian);
+
+ category = (CONSP (bom)
+ ? coding_category_utf_16_auto
+ : NILP (bom)
+ ? (EQ (endian, Qbig)
+ ? coding_category_utf_16_be_nosig
+ : coding_category_utf_16_le_nosig)
+ : (EQ (endian, Qbig)
+ ? coding_category_utf_16_be
+ : coding_category_utf_16_le));
+ }
+ else if (EQ (coding_type, Qiso_2022))
+ {
+ Lisp_Object initial, reg_usage, request, flags;
+ int i;
+
+ if (nargs < coding_arg_iso2022_max)
+ goto short_args;
+
+ initial = Fcopy_sequence (args[coding_arg_iso2022_initial]);
+ CHECK_VECTOR (initial);
+ for (i = 0; i < 4; i++)
+ {
+ val = Faref (initial, make_number (i));
+ if (! NILP (val))
+ {
+ struct charset *charset;
+
+ CHECK_CHARSET_GET_CHARSET (val, charset);
+ ASET (initial, i, make_number (CHARSET_ID (charset)));
+ if (i == 0 && CHARSET_ASCII_COMPATIBLE_P (charset))
+ CODING_ATTR_ASCII_COMPAT (attrs) = Qt;
+ }
+ else
+ ASET (initial, i, make_number (-1));
+ }
+
+ reg_usage = args[coding_arg_iso2022_reg_usage];
+ CHECK_CONS (reg_usage);
+ CHECK_NUMBER_CAR (reg_usage);
+ CHECK_NUMBER_CDR (reg_usage);
+
+ request = Fcopy_sequence (args[coding_arg_iso2022_request]);
+ for (tail = request; ! NILP (tail); tail = Fcdr (tail))
+ {
+ int id;
+ Lisp_Object tmp;
+
+ val = Fcar (tail);
+ CHECK_CONS (val);
+ tmp = XCAR (val);
+ CHECK_CHARSET_GET_ID (tmp, id);
+ CHECK_NATNUM_CDR (val);
+ if (XINT (XCDR (val)) >= 4)
+ error ("Invalid graphic register number: %d", XINT (XCDR (val)));
+ XSETCAR (val, make_number (id));
+ }
+
+ flags = args[coding_arg_iso2022_flags];
+ CHECK_NATNUM (flags);
+ i = XINT (flags);
+ if (EQ (args[coding_arg_charset_list], Qiso_2022))
+ flags = make_number (i | CODING_ISO_FLAG_FULL_SUPPORT);
+
+ ASET (attrs, coding_attr_iso_initial, initial);
+ ASET (attrs, coding_attr_iso_usage, reg_usage);
+ ASET (attrs, coding_attr_iso_request, request);
+ ASET (attrs, coding_attr_iso_flags, flags);
+ setup_iso_safe_charsets (attrs);
+
+ if (i & CODING_ISO_FLAG_SEVEN_BITS)
+ category = ((i & (CODING_ISO_FLAG_LOCKING_SHIFT
+ | CODING_ISO_FLAG_SINGLE_SHIFT))
+ ? coding_category_iso_7_else
+ : EQ (args[coding_arg_charset_list], Qiso_2022)
+ ? coding_category_iso_7
+ : coding_category_iso_7_tight);
else
- XSETCDR (slot, safe_chars);
+ {
+ int id = XINT (AREF (initial, 1));
+
+ category = (((i & CODING_ISO_FLAG_LOCKING_SHIFT)
+ || EQ (args[coding_arg_charset_list], Qiso_2022)
+ || id < 0)
+ ? coding_category_iso_8_else
+ : (CHARSET_DIMENSION (CHARSET_FROM_ID (id)) == 1)
+ ? coding_category_iso_8_1
+ : coding_category_iso_8_2);
+ }
+ if (category != coding_category_iso_8_1
+ && category != coding_category_iso_8_2)
+ CODING_ATTR_ASCII_COMPAT (attrs) = Qnil;
+ }
+ else if (EQ (coding_type, Qemacs_mule))
+ {
+ if (EQ (args[coding_arg_charset_list], Qemacs_mule))
+ ASET (attrs, coding_attr_emacs_mule_full, Qt);
+ CODING_ATTR_ASCII_COMPAT (attrs) = Qt;
+ category = coding_category_emacs_mule;
+ }
+ else if (EQ (coding_type, Qshift_jis))
+ {
+
+ struct charset *charset;
+
+ if (XINT (Flength (charset_list)) != 3
+ && XINT (Flength (charset_list)) != 4)
+ error ("There should be three or four charsets");
+
+ charset = CHARSET_FROM_ID (XINT (XCAR (charset_list)));
+ if (CHARSET_DIMENSION (charset) != 1)
+ error ("Dimension of charset %s is not one",
+ SDATA (SYMBOL_NAME (CHARSET_NAME (charset))));
+ if (CHARSET_ASCII_COMPATIBLE_P (charset))
+ CODING_ATTR_ASCII_COMPAT (attrs) = Qt;
+
+ charset_list = XCDR (charset_list);
+ charset = CHARSET_FROM_ID (XINT (XCAR (charset_list)));
+ if (CHARSET_DIMENSION (charset) != 1)
+ error ("Dimension of charset %s is not one",
+ SDATA (SYMBOL_NAME (CHARSET_NAME (charset))));
+
+ charset_list = XCDR (charset_list);
+ charset = CHARSET_FROM_ID (XINT (XCAR (charset_list)));
+ if (CHARSET_DIMENSION (charset) != 2)
+ error ("Dimension of charset %s is not two",
+ SDATA (SYMBOL_NAME (CHARSET_NAME (charset))));
+
+ charset_list = XCDR (charset_list);
+ if (! NILP (charset_list))
+ {
+ charset = CHARSET_FROM_ID (XINT (XCAR (charset_list)));
+ if (CHARSET_DIMENSION (charset) != 2)
+ error ("Dimension of charset %s is not two",
+ SDATA (SYMBOL_NAME (CHARSET_NAME (charset))));
+ }
+
+ category = coding_category_sjis;
+ Vsjis_coding_system = name;
}
+ else if (EQ (coding_type, Qbig5))
+ {
+ struct charset *charset;
+
+ if (XINT (Flength (charset_list)) != 2)
+ error ("There should be just two charsets");
+
+ charset = CHARSET_FROM_ID (XINT (XCAR (charset_list)));
+ if (CHARSET_DIMENSION (charset) != 1)
+ error ("Dimension of charset %s is not one",
+ SDATA (SYMBOL_NAME (CHARSET_NAME (charset))));
+ if (CHARSET_ASCII_COMPATIBLE_P (charset))
+ CODING_ATTR_ASCII_COMPAT (attrs) = Qt;
+
+ charset_list = XCDR (charset_list);
+ charset = CHARSET_FROM_ID (XINT (XCAR (charset_list)));
+ if (CHARSET_DIMENSION (charset) != 2)
+ error ("Dimension of charset %s is not two",
+ SDATA (SYMBOL_NAME (CHARSET_NAME (charset))));
+
+ category = coding_category_big5;
+ Vbig5_coding_system = name;
+ }
+ else if (EQ (coding_type, Qraw_text))
+ {
+ category = coding_category_raw_text;
+ CODING_ATTR_ASCII_COMPAT (attrs) = Qt;
+ }
+ else if (EQ (coding_type, Qutf_8))
+ {
+ category = coding_category_utf_8;
+ CODING_ATTR_ASCII_COMPAT (attrs) = Qt;
+ }
+ else if (EQ (coding_type, Qundecided))
+ category = coding_category_undecided;
+ else
+ error ("Invalid coding system type: %s",
+ SDATA (SYMBOL_NAME (coding_type)));
+
+ CODING_ATTR_CATEGORY (attrs) = make_number (category);
+ CODING_ATTR_PLIST (attrs)
+ = Fcons (QCcategory, Fcons (AREF (Vcoding_category_table, category),
+ CODING_ATTR_PLIST (attrs)));
+ CODING_ATTR_PLIST (attrs)
+ = Fcons (QCascii_compatible_p,
+ Fcons (CODING_ATTR_ASCII_COMPAT (attrs),
+ CODING_ATTR_PLIST (attrs)));
+
+ eol_type = args[coding_arg_eol_type];
+ if (! NILP (eol_type)
+ && ! EQ (eol_type, Qunix)
+ && ! EQ (eol_type, Qdos)
+ && ! EQ (eol_type, Qmac))
+ error ("Invalid eol-type");
+
+ aliases = Fcons (name, Qnil);
+
+ if (NILP (eol_type))
+ {
+ eol_type = make_subsidiaries (name);
+ for (i = 0; i < 3; i++)
+ {
+ Lisp_Object this_spec, this_name, this_aliases, this_eol_type;
+
+ this_name = AREF (eol_type, i);
+ this_aliases = Fcons (this_name, Qnil);
+ this_eol_type = (i == 0 ? Qunix : i == 1 ? Qdos : Qmac);
+ this_spec = Fmake_vector (make_number (3), attrs);
+ ASET (this_spec, 1, this_aliases);
+ ASET (this_spec, 2, this_eol_type);
+ Fputhash (this_name, this_spec, Vcoding_system_hash_table);
+ Vcoding_system_list = Fcons (this_name, Vcoding_system_list);
+ val = Fassoc (Fsymbol_name (this_name), Vcoding_system_alist);
+ if (NILP (val))
+ Vcoding_system_alist
+ = Fcons (Fcons (Fsymbol_name (this_name), Qnil),
+ Vcoding_system_alist);
+ }
+ }
+
+ spec_vec = Fmake_vector (make_number (3), attrs);
+ ASET (spec_vec, 1, aliases);
+ ASET (spec_vec, 2, eol_type);
+
+ Fputhash (name, spec_vec, Vcoding_system_hash_table);
+ Vcoding_system_list = Fcons (name, Vcoding_system_list);
+ val = Fassoc (Fsymbol_name (name), Vcoding_system_alist);
+ if (NILP (val))
+ Vcoding_system_alist = Fcons (Fcons (Fsymbol_name (name), Qnil),
+ Vcoding_system_alist);
+
+ {
+ int id = coding_categories[category].id;
+
+ if (id < 0 || EQ (name, CODING_ID_NAME (id)))
+ setup_coding_system (name, &coding_categories[category]);
+ }
+
return Qnil;
+
+ short_args:
+ return Fsignal (Qwrong_number_of_arguments,
+ Fcons (intern ("define-coding-system-internal"),
+ make_number (nargs)));
+}
+
+
+DEFUN ("coding-system-put", Fcoding_system_put, Scoding_system_put,
+ 3, 3, 0,
+ doc: /* Change value in CODING-SYSTEM's property list PROP to VAL. */)
+ (coding_system, prop, val)
+ Lisp_Object coding_system, prop, val;
+{
+ Lisp_Object spec, attrs;
+
+ CHECK_CODING_SYSTEM_GET_SPEC (coding_system, spec);
+ attrs = AREF (spec, 0);
+ if (EQ (prop, QCmnemonic))
+ {
+ if (! STRINGP (val))
+ CHECK_CHARACTER (val);
+ CODING_ATTR_MNEMONIC (attrs) = val;
+ }
+ else if (EQ (prop, QCdefalut_char))
+ {
+ if (NILP (val))
+ val = make_number (' ');
+ else
+ CHECK_CHARACTER (val);
+ CODING_ATTR_DEFAULT_CHAR (attrs) = val;
+ }
+ else if (EQ (prop, QCdecode_translation_table))
+ {
+ if (! CHAR_TABLE_P (val) && ! CONSP (val))
+ CHECK_SYMBOL (val);
+ CODING_ATTR_DECODE_TBL (attrs) = val;
+ }
+ else if (EQ (prop, QCencode_translation_table))
+ {
+ if (! CHAR_TABLE_P (val) && ! CONSP (val))
+ CHECK_SYMBOL (val);
+ CODING_ATTR_ENCODE_TBL (attrs) = val;
+ }
+ else if (EQ (prop, QCpost_read_conversion))
+ {
+ CHECK_SYMBOL (val);
+ CODING_ATTR_POST_READ (attrs) = val;
+ }
+ else if (EQ (prop, QCpre_write_conversion))
+ {
+ CHECK_SYMBOL (val);
+ CODING_ATTR_PRE_WRITE (attrs) = val;
+ }
+ else if (EQ (prop, QCascii_compatible_p))
+ {
+ CODING_ATTR_ASCII_COMPAT (attrs) = val;
+ }
+
+ CODING_ATTR_PLIST (attrs)
+ = Fplist_put (CODING_ATTR_PLIST (attrs), prop, val);
+ return val;
+}
+
+
+DEFUN ("define-coding-system-alias", Fdefine_coding_system_alias,
+ Sdefine_coding_system_alias, 2, 2, 0,
+ doc: /* Define ALIAS as an alias for CODING-SYSTEM. */)
+ (alias, coding_system)
+ Lisp_Object alias, coding_system;
+{
+ Lisp_Object spec, aliases, eol_type, val;
+
+ CHECK_SYMBOL (alias);
+ CHECK_CODING_SYSTEM_GET_SPEC (coding_system, spec);
+ aliases = AREF (spec, 1);
+ /* ALISES should be a list of length more than zero, and the first
+ element is a base coding system. Append ALIAS at the tail of the
+ list. */
+ while (!NILP (XCDR (aliases)))
+ aliases = XCDR (aliases);
+ XSETCDR (aliases, Fcons (alias, Qnil));
+
+ eol_type = AREF (spec, 2);
+ if (VECTORP (eol_type))
+ {
+ Lisp_Object subsidiaries;
+ int i;
+
+ subsidiaries = make_subsidiaries (alias);
+ for (i = 0; i < 3; i++)
+ Fdefine_coding_system_alias (AREF (subsidiaries, i),
+ AREF (eol_type, i));
+ }
+
+ Fputhash (alias, spec, Vcoding_system_hash_table);
+ Vcoding_system_list = Fcons (alias, Vcoding_system_list);
+ val = Fassoc (Fsymbol_name (alias), Vcoding_system_alist);
+ if (NILP (val))
+ Vcoding_system_alist = Fcons (Fcons (Fsymbol_name (alias), Qnil),
+ Vcoding_system_alist);
+
+ return Qnil;
+}
+
+DEFUN ("coding-system-base", Fcoding_system_base, Scoding_system_base,
+ 1, 1, 0,
+ doc: /* Return the base of CODING-SYSTEM.
+Any alias or subsidiary coding system is not a base coding system. */)
+ (coding_system)
+ Lisp_Object coding_system;
+{
+ Lisp_Object spec, attrs;
+
+ if (NILP (coding_system))
+ return (Qno_conversion);
+ CHECK_CODING_SYSTEM_GET_SPEC (coding_system, spec);
+ attrs = AREF (spec, 0);
+ return CODING_ATTR_BASE_NAME (attrs);
+}
+
+DEFUN ("coding-system-plist", Fcoding_system_plist, Scoding_system_plist,
+ 1, 1, 0,
+ doc: "Return the property list of CODING-SYSTEM.")
+ (coding_system)
+ Lisp_Object coding_system;
+{
+ Lisp_Object spec, attrs;
+
+ if (NILP (coding_system))
+ coding_system = Qno_conversion;
+ CHECK_CODING_SYSTEM_GET_SPEC (coding_system, spec);
+ attrs = AREF (spec, 0);
+ return CODING_ATTR_PLIST (attrs);
+}
+
+
+DEFUN ("coding-system-aliases", Fcoding_system_aliases, Scoding_system_aliases,
+ 1, 1, 0,
+ doc: /* Return the list of aliases of CODING-SYSTEM. */)
+ (coding_system)
+ Lisp_Object coding_system;
+{
+ Lisp_Object spec;
+
+ if (NILP (coding_system))
+ coding_system = Qno_conversion;
+ CHECK_CODING_SYSTEM_GET_SPEC (coding_system, spec);
+ return AREF (spec, 1);
+}
+
+DEFUN ("coding-system-eol-type", Fcoding_system_eol_type,
+ Scoding_system_eol_type, 1, 1, 0,
+ doc: /* Return eol-type of CODING-SYSTEM.
+An eol-type is integer 0, 1, 2, or a vector of coding systems.
+
+Integer values 0, 1, and 2 indicate a format of end-of-line; LF, CRLF,
+and CR respectively.
+
+A vector value indicates that a format of end-of-line should be
+detected automatically. Nth element of the vector is the subsidiary
+coding system whose eol-type is N. */)
+ (coding_system)
+ Lisp_Object coding_system;
+{
+ Lisp_Object spec, eol_type;
+ int n;
+
+ if (NILP (coding_system))
+ coding_system = Qno_conversion;
+ if (! CODING_SYSTEM_P (coding_system))
+ return Qnil;
+ spec = CODING_SYSTEM_SPEC (coding_system);
+ eol_type = AREF (spec, 2);
+ if (VECTORP (eol_type))
+ return Fcopy_sequence (eol_type);
+ n = EQ (eol_type, Qunix) ? 0 : EQ (eol_type, Qdos) ? 1 : 2;
+ return make_number (n);
}
#endif /* emacs */
@@ -7668,20 +9276,11 @@ init_coding_once ()
{
int i;
- /* Emacs' internal format specific initialize routine. */
- for (i = 0; i <= 0x20; i++)
- emacs_code_class[i] = EMACS_control_code;
- emacs_code_class[0x0A] = EMACS_linefeed_code;
- emacs_code_class[0x0D] = EMACS_carriage_return_code;
- for (i = 0x21 ; i < 0x7F; i++)
- emacs_code_class[i] = EMACS_ascii_code;
- emacs_code_class[0x7F] = EMACS_control_code;
- for (i = 0x80; i < 0xFF; i++)
- emacs_code_class[i] = EMACS_invalid_code;
- emacs_code_class[LEADING_CODE_PRIVATE_11] = EMACS_leading_code_3;
- emacs_code_class[LEADING_CODE_PRIVATE_12] = EMACS_leading_code_3;
- emacs_code_class[LEADING_CODE_PRIVATE_21] = EMACS_leading_code_4;
- emacs_code_class[LEADING_CODE_PRIVATE_22] = EMACS_leading_code_4;
+ for (i = 0; i < coding_category_max; i++)
+ {
+ coding_categories[i].id = -1;
+ coding_priorities[i] = i;
+ }
/* ISO2022 specific initialize routine. */
for (i = 0; i < 0x20; i++)
@@ -7694,7 +9293,6 @@ init_coding_once ()
iso_code_class[i] = ISO_graphic_plane_1;
iso_code_class[0x20] = iso_code_class[0x7F] = ISO_0x20_or_0x7F;
iso_code_class[0xA0] = iso_code_class[0xFF] = ISO_0xA0_or_0xFF;
- iso_code_class[ISO_CODE_CR] = ISO_carriage_return;
iso_code_class[ISO_CODE_SO] = ISO_shift_out;
iso_code_class[ISO_CODE_SI] = ISO_shift_in;
iso_code_class[ISO_CODE_SS2_7] = ISO_single_shift_2_7;
@@ -7703,22 +9301,14 @@ init_coding_once ()
iso_code_class[ISO_CODE_SS3] = ISO_single_shift_3;
iso_code_class[ISO_CODE_CSI] = ISO_control_sequence_introducer;
- setup_coding_system (Qnil, &safe_terminal_coding);
- setup_coding_system (Qnil, &default_buffer_file_coding);
-
- bzero (coding_system_table, sizeof coding_system_table);
-
- bzero (ascii_skip_code, sizeof ascii_skip_code);
- for (i = 0; i < 128; i++)
- ascii_skip_code[i] = 1;
-
-#if defined (MSDOS) || defined (WINDOWSNT)
- system_eol_type = CODING_EOL_CRLF;
-#else
- system_eol_type = CODING_EOL_LF;
-#endif
-
- inhibit_pre_post_conversion = 0;
+ for (i = 0; i < 256; i++)
+ {
+ emacs_mule_bytes[i] = 1;
+ }
+ emacs_mule_bytes[EMACS_MULE_LEADING_CODE_PRIVATE_11] = 3;
+ emacs_mule_bytes[EMACS_MULE_LEADING_CODE_PRIVATE_12] = 3;
+ emacs_mule_bytes[EMACS_MULE_LEADING_CODE_PRIVATE_21] = 4;
+ emacs_mule_bytes[EMACS_MULE_LEADING_CODE_PRIVATE_22] = 4;
}
#ifdef emacs
@@ -7726,14 +9316,31 @@ init_coding_once ()
void
syms_of_coding ()
{
+ staticpro (&Vcoding_system_hash_table);
+ {
+ Lisp_Object args[2];
+ args[0] = QCtest;
+ args[1] = Qeq;
+ Vcoding_system_hash_table = Fmake_hash_table (2, args);
+ }
+
+ staticpro (&Vsjis_coding_system);
+ Vsjis_coding_system = Qnil;
+
+ staticpro (&Vbig5_coding_system);
+ Vbig5_coding_system = Qnil;
+
+ staticpro (&Vcode_conversion_reused_workbuf);
+ Vcode_conversion_reused_workbuf = Qnil;
+
staticpro (&Vcode_conversion_workbuf_name);
Vcode_conversion_workbuf_name = build_string (" *code-conversion-work*");
- Qtarget_idx = intern ("target-idx");
- staticpro (&Qtarget_idx);
+ reused_workbuf_in_use = 0;
- Qcoding_system_history = intern ("coding-system-history");
- staticpro (&Qcoding_system_history);
+ DEFSYM (Qcharset, "charset");
+ DEFSYM (Qtarget_idx, "target-idx");
+ DEFSYM (Qcoding_system_history, "coding-system-history");
Fset (Qcoding_system_history, Qnil);
/* Target FILENAME is the first argument. */
@@ -7741,123 +9348,131 @@ syms_of_coding ()
/* Target FILENAME is the third argument. */
Fput (Qwrite_region, Qtarget_idx, make_number (2));
- Qcall_process = intern ("call-process");
- staticpro (&Qcall_process);
+ DEFSYM (Qcall_process, "call-process");
/* Target PROGRAM is the first argument. */
Fput (Qcall_process, Qtarget_idx, make_number (0));
- Qcall_process_region = intern ("call-process-region");
- staticpro (&Qcall_process_region);
+ DEFSYM (Qcall_process_region, "call-process-region");
/* Target PROGRAM is the third argument. */
Fput (Qcall_process_region, Qtarget_idx, make_number (2));
- Qstart_process = intern ("start-process");
- staticpro (&Qstart_process);
+ DEFSYM (Qstart_process, "start-process");
/* Target PROGRAM is the third argument. */
Fput (Qstart_process, Qtarget_idx, make_number (2));
- Qopen_network_stream = intern ("open-network-stream");
- staticpro (&Qopen_network_stream);
+ DEFSYM (Qopen_network_stream, "open-network-stream");
/* Target SERVICE is the fourth argument. */
Fput (Qopen_network_stream, Qtarget_idx, make_number (3));
- Qcoding_system = intern ("coding-system");
- staticpro (&Qcoding_system);
-
- Qeol_type = intern ("eol-type");
- staticpro (&Qeol_type);
+ DEFSYM (Qcoding_system, "coding-system");
+ DEFSYM (Qcoding_aliases, "coding-aliases");
- Qbuffer_file_coding_system = intern ("buffer-file-coding-system");
- staticpro (&Qbuffer_file_coding_system);
+ DEFSYM (Qeol_type, "eol-type");
+ DEFSYM (Qunix, "unix");
+ DEFSYM (Qdos, "dos");
- Qpost_read_conversion = intern ("post-read-conversion");
- staticpro (&Qpost_read_conversion);
+ DEFSYM (Qbuffer_file_coding_system, "buffer-file-coding-system");
+ DEFSYM (Qpost_read_conversion, "post-read-conversion");
+ DEFSYM (Qpre_write_conversion, "pre-write-conversion");
+ DEFSYM (Qdefault_char, "default-char");
+ DEFSYM (Qundecided, "undecided");
+ DEFSYM (Qno_conversion, "no-conversion");
+ DEFSYM (Qraw_text, "raw-text");
- Qpre_write_conversion = intern ("pre-write-conversion");
- staticpro (&Qpre_write_conversion);
+ DEFSYM (Qiso_2022, "iso-2022");
- Qno_conversion = intern ("no-conversion");
- staticpro (&Qno_conversion);
+ DEFSYM (Qutf_8, "utf-8");
+ DEFSYM (Qutf_8_emacs, "utf-8-emacs");
- Qundecided = intern ("undecided");
- staticpro (&Qundecided);
+ DEFSYM (Qutf_16, "utf-16");
+ DEFSYM (Qbig, "big");
+ DEFSYM (Qlittle, "little");
- Qcoding_system_p = intern ("coding-system-p");
- staticpro (&Qcoding_system_p);
+ DEFSYM (Qshift_jis, "shift-jis");
+ DEFSYM (Qbig5, "big5");
- Qcoding_system_error = intern ("coding-system-error");
- staticpro (&Qcoding_system_error);
+ DEFSYM (Qcoding_system_p, "coding-system-p");
+ DEFSYM (Qcoding_system_error, "coding-system-error");
Fput (Qcoding_system_error, Qerror_conditions,
Fcons (Qcoding_system_error, Fcons (Qerror, Qnil)));
Fput (Qcoding_system_error, Qerror_message,
build_string ("Invalid coding system"));
- Qcoding_category = intern ("coding-category");
- staticpro (&Qcoding_category);
- Qcoding_category_index = intern ("coding-category-index");
- staticpro (&Qcoding_category_index);
-
- Vcoding_category_table
- = Fmake_vector (make_number (CODING_CATEGORY_IDX_MAX), Qnil);
- staticpro (&Vcoding_category_table);
- {
- int i;
- for (i = 0; i < CODING_CATEGORY_IDX_MAX; i++)
- {
- XVECTOR (Vcoding_category_table)->contents[i]
- = intern (coding_category_name[i]);
- Fput (XVECTOR (Vcoding_category_table)->contents[i],
- Qcoding_category_index, make_number (i));
- }
- }
-
- Vcoding_system_safe_chars = Fcons (Qnil, Qnil);
- staticpro (&Vcoding_system_safe_chars);
-
- Qtranslation_table = intern ("translation-table");
- staticpro (&Qtranslation_table);
- Fput (Qtranslation_table, Qchar_table_extra_slots, make_number (2));
-
- Qtranslation_table_id = intern ("translation-table-id");
- staticpro (&Qtranslation_table_id);
-
- Qtranslation_table_for_decode = intern ("translation-table-for-decode");
- staticpro (&Qtranslation_table_for_decode);
-
- Qtranslation_table_for_encode = intern ("translation-table-for-encode");
- staticpro (&Qtranslation_table_for_encode);
-
- Qsafe_chars = intern ("safe-chars");
- staticpro (&Qsafe_chars);
-
- Qchar_coding_system = intern ("char-coding-system");
- staticpro (&Qchar_coding_system);
-
/* Intern this now in case it isn't already done.
Setting this variable twice is harmless.
But don't staticpro it here--that is done in alloc.c. */
Qchar_table_extra_slots = intern ("char-table-extra-slots");
- Fput (Qsafe_chars, Qchar_table_extra_slots, make_number (0));
- Fput (Qchar_coding_system, Qchar_table_extra_slots, make_number (0));
-
- Qvalid_codes = intern ("valid-codes");
- staticpro (&Qvalid_codes);
- Qascii_incompatible = intern ("ascii-incompatible");
- staticpro (&Qascii_incompatible);
+ DEFSYM (Qtranslation_table, "translation-table");
+ Fput (Qtranslation_table, Qchar_table_extra_slots, make_number (2));
+ DEFSYM (Qtranslation_table_id, "translation-table-id");
+ DEFSYM (Qtranslation_table_for_decode, "translation-table-for-decode");
+ DEFSYM (Qtranslation_table_for_encode, "translation-table-for-encode");
- Qemacs_mule = intern ("emacs-mule");
- staticpro (&Qemacs_mule);
+ DEFSYM (Qvalid_codes, "valid-codes");
- Qraw_text = intern ("raw-text");
- staticpro (&Qraw_text);
+ DEFSYM (Qemacs_mule, "emacs-mule");
- Qutf_8 = intern ("utf-8");
- staticpro (&Qutf_8);
+ DEFSYM (QCcategory, ":category");
+ DEFSYM (QCmnemonic, ":mnemonic");
+ DEFSYM (QCdefalut_char, ":default-char");
+ DEFSYM (QCdecode_translation_table, ":decode-translation-table");
+ DEFSYM (QCencode_translation_table, ":encode-translation-table");
+ DEFSYM (QCpost_read_conversion, ":post-read-conversion");
+ DEFSYM (QCpre_write_conversion, ":pre-write-conversion");
+ DEFSYM (QCascii_compatible_p, ":ascii-compatible-p");
- Qcoding_system_define_form = intern ("coding-system-define-form");
- staticpro (&Qcoding_system_define_form);
+ Vcoding_category_table
+ = Fmake_vector (make_number (coding_category_max), Qnil);
+ staticpro (&Vcoding_category_table);
+ /* Followings are target of code detection. */
+ ASET (Vcoding_category_table, coding_category_iso_7,
+ intern ("coding-category-iso-7"));
+ ASET (Vcoding_category_table, coding_category_iso_7_tight,
+ intern ("coding-category-iso-7-tight"));
+ ASET (Vcoding_category_table, coding_category_iso_8_1,
+ intern ("coding-category-iso-8-1"));
+ ASET (Vcoding_category_table, coding_category_iso_8_2,
+ intern ("coding-category-iso-8-2"));
+ ASET (Vcoding_category_table, coding_category_iso_7_else,
+ intern ("coding-category-iso-7-else"));
+ ASET (Vcoding_category_table, coding_category_iso_8_else,
+ intern ("coding-category-iso-8-else"));
+ ASET (Vcoding_category_table, coding_category_utf_8,
+ intern ("coding-category-utf-8"));
+ ASET (Vcoding_category_table, coding_category_utf_16_be,
+ intern ("coding-category-utf-16-be"));
+ ASET (Vcoding_category_table, coding_category_utf_16_auto,
+ intern ("coding-category-utf-16-auto"));
+ ASET (Vcoding_category_table, coding_category_utf_16_le,
+ intern ("coding-category-utf-16-le"));
+ ASET (Vcoding_category_table, coding_category_utf_16_be_nosig,
+ intern ("coding-category-utf-16-be-nosig"));
+ ASET (Vcoding_category_table, coding_category_utf_16_le_nosig,
+ intern ("coding-category-utf-16-le-nosig"));
+ ASET (Vcoding_category_table, coding_category_charset,
+ intern ("coding-category-charset"));
+ ASET (Vcoding_category_table, coding_category_sjis,
+ intern ("coding-category-sjis"));
+ ASET (Vcoding_category_table, coding_category_big5,
+ intern ("coding-category-big5"));
+ ASET (Vcoding_category_table, coding_category_ccl,
+ intern ("coding-category-ccl"));
+ ASET (Vcoding_category_table, coding_category_emacs_mule,
+ intern ("coding-category-emacs-mule"));
+ /* Followings are NOT target of code detection. */
+ ASET (Vcoding_category_table, coding_category_raw_text,
+ intern ("coding-category-raw-text"));
+ ASET (Vcoding_category_table, coding_category_undecided,
+ intern ("coding-category-undecided"));
+
+ DEFSYM (Qinsufficient_source, "insufficient-source");
+ DEFSYM (Qinconsistent_eol, "inconsistent-eol");
+ DEFSYM (Qinvalid_source, "invalid-source");
+ DEFSYM (Qinterrupted, "interrupted");
+ DEFSYM (Qinsufficient_memory, "insufficient-memory");
+ DEFSYM (Qcoding_system_define_form, "coding-system-define-form");
defsubr (&Scoding_system_p);
defsubr (&Sread_coding_system);
@@ -7867,6 +9482,7 @@ syms_of_coding ()
defsubr (&Sdetect_coding_string);
defsubr (&Sfind_coding_systems_region_internal);
defsubr (&Sunencodable_char_position);
+ defsubr (&Scheck_coding_systems_region);
defsubr (&Sdecode_coding_region);
defsubr (&Sencode_coding_region);
defsubr (&Sdecode_coding_string);
@@ -7881,15 +9497,21 @@ syms_of_coding ()
defsubr (&Sset_keyboard_coding_system_internal);
defsubr (&Skeyboard_coding_system);
defsubr (&Sfind_operation_coding_system);
- defsubr (&Supdate_coding_systems_internal);
- defsubr (&Sset_coding_priority_internal);
+ defsubr (&Sset_coding_system_priority);
defsubr (&Sdefine_coding_system_internal);
+ defsubr (&Sdefine_coding_system_alias);
+ defsubr (&Scoding_system_put);
+ defsubr (&Scoding_system_base);
+ defsubr (&Scoding_system_plist);
+ defsubr (&Scoding_system_aliases);
+ defsubr (&Scoding_system_eol_type);
+ defsubr (&Scoding_system_priority_list);
DEFVAR_LISP ("coding-system-list", &Vcoding_system_list,
doc: /* List of coding systems.
Do not alter the value of this variable manually. This variable should be
-updated by the functions `make-coding-system' and
+updated by the functions `define-coding-system' and
`define-coding-system-alias'. */);
Vcoding_system_list = Qnil;
@@ -7916,7 +9538,7 @@ Don't modify this variable directly, but use `set-coding-priority'. */);
int i;
Vcoding_category_list = Qnil;
- for (i = CODING_CATEGORY_IDX_MAX - 1; i >= 0; i--)
+ for (i = coding_category_max - 1; i >= 0; i--)
Vcoding_category_list
= Fcons (XVECTOR (Vcoding_category_table)->contents[i],
Vcoding_category_list);
@@ -7946,25 +9568,44 @@ the value of `buffer-file-coding-system' is used. */);
Vcoding_system_for_write = Qnil;
DEFVAR_LISP ("last-coding-system-used", &Vlast_coding_system_used,
- doc: /* Coding system used in the latest file or process I/O.
-Also set by `encode-coding-region', `decode-coding-region',
-`encode-coding-string' and `decode-coding-string'. */);
+ doc: /*
+Coding system used in the latest file or process I/O. */);
Vlast_coding_system_used = Qnil;
+ DEFVAR_LISP ("last-code-conversion-error", &Vlast_code_conversion_error,
+ doc: /*
+Error status of the last code conversion.
+
+When an error was detected in the last code conversion, this variable
+is set to one of the following symbols.
+ `insufficient-source'
+ `inconsistent-eol'
+ `invalid-source'
+ `interrupted'
+ `insufficient-memory'
+When no error was detected, the value doesn't change. So, to check
+the error status of a code conversion by this variable, you must
+explicitly set this variable to nil before performing code
+conversion. */);
+ Vlast_code_conversion_error = Qnil;
+
DEFVAR_BOOL ("inhibit-eol-conversion", &inhibit_eol_conversion,
- doc: /* *Non-nil means always inhibit code conversion of end-of-line format.
+ doc: /*
+*Non-nil means always inhibit code conversion of end-of-line format.
See info node `Coding Systems' and info node `Text and Binary' concerning
such conversion. */);
inhibit_eol_conversion = 0;
DEFVAR_BOOL ("inherit-process-coding-system", &inherit_process_coding_system,
- doc: /* Non-nil means process buffer inherits coding system of process output.
+ doc: /*
+Non-nil means process buffer inherits coding system of process output.
Bind it to t if the process output is to be treated as if it were a file
read from some filesystem. */);
inherit_process_coding_system = 0;
DEFVAR_LISP ("file-coding-system-alist", &Vfile_coding_system_alist,
- doc: /* Alist to decide a coding system to use for a file I/O operation.
+ doc: /*
+Alist to decide a coding system to use for a file I/O operation.
The format is ((PATTERN . VAL) ...),
where PATTERN is a regular expression matching a file name,
VAL is a coding system, a cons of coding systems, or a function symbol.
@@ -7984,7 +9625,8 @@ and the variable `auto-coding-alist'. */);
Vfile_coding_system_alist = Qnil;
DEFVAR_LISP ("process-coding-system-alist", &Vprocess_coding_system_alist,
- doc: /* Alist to decide a coding system to use for a process I/O operation.
+ doc: /*
+Alist to decide a coding system to use for a process I/O operation.
The format is ((PATTERN . VAL) ...),
where PATTERN is a regular expression matching a program name,
VAL is a coding system, a cons of coding systems, or a function symbol.
@@ -7999,7 +9641,8 @@ See also the function `find-operation-coding-system'. */);
Vprocess_coding_system_alist = Qnil;
DEFVAR_LISP ("network-coding-system-alist", &Vnetwork_coding_system_alist,
- doc: /* Alist to decide a coding system to use for a network I/O operation.
+ doc: /*
+Alist to decide a coding system to use for a network I/O operation.
The format is ((PATTERN . VAL) ...),
where PATTERN is a regular expression matching a network service name
or is a port number to connect to,
@@ -8021,23 +9664,28 @@ Also used for decoding keyboard input on X Window system. */);
/* The eol mnemonics are reset in startup.el system-dependently. */
DEFVAR_LISP ("eol-mnemonic-unix", &eol_mnemonic_unix,
- doc: /* *String displayed in mode line for UNIX-like (LF) end-of-line format. */);
+ doc: /*
+*String displayed in mode line for UNIX-like (LF) end-of-line format. */);
eol_mnemonic_unix = build_string (":");
DEFVAR_LISP ("eol-mnemonic-dos", &eol_mnemonic_dos,
- doc: /* *String displayed in mode line for DOS-like (CRLF) end-of-line format. */);
+ doc: /*
+*String displayed in mode line for DOS-like (CRLF) end-of-line format. */);
eol_mnemonic_dos = build_string ("\\");
DEFVAR_LISP ("eol-mnemonic-mac", &eol_mnemonic_mac,
- doc: /* *String displayed in mode line for MAC-like (CR) end-of-line format. */);
+ doc: /*
+*String displayed in mode line for MAC-like (CR) end-of-line format. */);
eol_mnemonic_mac = build_string ("/");
DEFVAR_LISP ("eol-mnemonic-undecided", &eol_mnemonic_undecided,
- doc: /* *String displayed in mode line when end-of-line format is not yet determined. */);
+ doc: /*
+*String displayed in mode line when end-of-line format is not yet determined. */);
eol_mnemonic_undecided = build_string (":");
DEFVAR_LISP ("enable-character-translation", &Venable_character_translation,
- doc: /* *Non-nil enables character translation while encoding and decoding. */);
+ doc: /*
+*Non-nil enables character translation while encoding and decoding. */);
Venable_character_translation = Qt;
DEFVAR_LISP ("standard-translation-table-for-decode",
@@ -8050,11 +9698,12 @@ Also used for decoding keyboard input on X Window system. */);
doc: /* Table for translating characters while encoding. */);
Vstandard_translation_table_for_encode = Qnil;
- DEFVAR_LISP ("charset-revision-table", &Vcharset_revision_alist,
+ DEFVAR_LISP ("charset-revision-table", &Vcharset_revision_table,
doc: /* Alist of charsets vs revision numbers.
While encoding, if a charset (car part of an element) is found,
-designate it with the escape sequence identifying revision (cdr part of the element). */);
- Vcharset_revision_alist = Qnil;
+designate it with the escape sequence identifying revision (cdr part
+of the element). */);
+ Vcharset_revision_table = Qnil;
DEFVAR_LISP ("default-process-coding-system",
&Vdefault_process_coding_system,
@@ -8064,7 +9713,8 @@ the cdr part is used for encoding a text to be sent to a process. */);
Vdefault_process_coding_system = Qnil;
DEFVAR_LISP ("latin-extra-code-table", &Vlatin_extra_code_table,
- doc: /* Table of extra Latin codes in the range 128..159 (inclusive).
+ doc: /*
+Table of extra Latin codes in the range 128..159 (inclusive).
This is a vector of length 256.
If Nth element is non-nil, the existence of code N in a file
\(or output of subprocess) doesn't prevent it to be detected as
@@ -8076,7 +9726,8 @@ Only 128th through 159th elements has a meaning. */);
DEFVAR_LISP ("select-safe-coding-system-function",
&Vselect_safe_coding_system_function,
- doc: /* Function to call to select safe coding system for encoding a text.
+ doc: /*
+Function to call to select safe coding system for encoding a text.
If set, this function is called to force a user to select a proper
coding system which can encode the text in the case that a default
@@ -8096,7 +9747,8 @@ called even if `coding-system-for-write' is non-nil. The command
DEFVAR_BOOL ("inhibit-iso-escape-detection",
&inhibit_iso_escape_detection,
- doc: /* If non-nil, Emacs ignores ISO2022's escape sequence on code detection.
+ doc: /*
+If non-nil, Emacs ignores ISO2022's escape sequence on code detection.
By default, on reading a file, Emacs tries to detect how the text is
encoded. This code detection is sensitive to escape sequences. If
@@ -8126,6 +9778,68 @@ escape sequence (e.g `latin-1') on reading by \\[universal-coding-system-argumen
This is applied to the result of input methods, not their input. See also
`keyboard-translate-table'. */);
Vtranslation_table_for_input = Qnil;
+
+ {
+ Lisp_Object args[coding_arg_max];
+ Lisp_Object plist[16];
+ int i;
+
+ for (i = 0; i < coding_arg_max; i++)
+ args[i] = Qnil;
+
+ plist[0] = intern (":name");
+ plist[1] = args[coding_arg_name] = Qno_conversion;
+ plist[2] = intern (":mnemonic");
+ plist[3] = args[coding_arg_mnemonic] = make_number ('=');
+ plist[4] = intern (":coding-type");
+ plist[5] = args[coding_arg_coding_type] = Qraw_text;
+ plist[6] = intern (":ascii-compatible-p");
+ plist[7] = args[coding_arg_ascii_compatible_p] = Qt;
+ plist[8] = intern (":default-char");
+ plist[9] = args[coding_arg_default_char] = make_number (0);
+ plist[10] = intern (":for-unibyte");
+ plist[11] = args[coding_arg_for_unibyte] = Qt;
+ plist[12] = intern (":docstring");
+ plist[13] = build_string ("Do no conversion.\n\
+\n\
+When you visit a file with this coding, the file is read into a\n\
+unibyte buffer as is, thus each byte of a file is treated as a\n\
+character.");
+ plist[14] = intern (":eol-type");
+ plist[15] = args[coding_arg_eol_type] = Qunix;
+ args[coding_arg_plist] = Flist (16, plist);
+ Fdefine_coding_system_internal (coding_arg_max, args);
+
+ plist[1] = args[coding_arg_name] = Qundecided;
+ plist[3] = args[coding_arg_mnemonic] = make_number ('-');
+ plist[5] = args[coding_arg_coding_type] = Qundecided;
+ /* This is already set.
+ plist[7] = args[coding_arg_ascii_compatible_p] = Qt; */
+ plist[8] = intern (":charset-list");
+ plist[9] = args[coding_arg_charset_list] = Fcons (Qascii, Qnil);
+ plist[11] = args[coding_arg_for_unibyte] = Qnil;
+ plist[13] = build_string ("No conversion on encoding, automatic conversion on decoding.");
+ plist[15] = args[coding_arg_eol_type] = Qnil;
+ args[coding_arg_plist] = Flist (16, plist);
+ Fdefine_coding_system_internal (coding_arg_max, args);
+ }
+
+ setup_coding_system (Qno_conversion, &keyboard_coding);
+ setup_coding_system (Qundecided, &terminal_coding);
+ setup_coding_system (Qno_conversion, &safe_terminal_coding);
+
+ {
+ int i;
+
+ for (i = 0; i < coding_category_max; i++)
+ Fset (AREF (Vcoding_category_table, i), Qno_conversion);
+ }
+#if defined (MSDOS) || defined (WINDOWSNT)
+ system_eol_type = Qdos;
+#else
+ system_eol_type = Qunix;
+#endif
+ staticpro (&system_eol_type);
}
char *
diff --git a/src/coding.h b/src/coding.h
index a53a74ec16..134402f325 100644
--- a/src/coding.h
+++ b/src/coding.h
@@ -5,6 +5,9 @@
2005, 2006, 2007
National Institute of Advanced Industrial Science and Technology (AIST)
Registration Number H14PRO021
+ Copyright (C) 2003
+ National Institute of Advanced Industrial Science and Technology (AIST)
+ Registration Number H13PRO009
This file is part of GNU Emacs.
@@ -26,306 +29,253 @@ Boston, MA 02110-1301, USA. */
#ifndef EMACS_CODING_H
#define EMACS_CODING_H
-#include "ccl.h"
+/* Index to arguments of Fdefine_coding_system_internal. */
-/*** EMACS' INTERNAL FORMAT (emacs-mule) section ***/
+enum define_coding_system_arg_index
+ {
+ coding_arg_name,
+ coding_arg_mnemonic,
+ coding_arg_coding_type,
+ coding_arg_charset_list,
+ coding_arg_ascii_compatible_p,
+ coding_arg_decode_translation_table,
+ coding_arg_encode_translation_table,
+ coding_arg_post_read_conversion,
+ coding_arg_pre_write_conversion,
+ coding_arg_default_char,
+ coding_arg_for_unibyte,
+ coding_arg_plist,
+ coding_arg_eol_type,
+ coding_arg_max
+ };
-/* All code (1-byte) of Emacs' internal format is classified into one
- of the followings. See also `charset.h'. */
-enum emacs_code_class_type
+enum define_coding_iso2022_arg_index
{
- EMACS_control_code, /* Control codes in the range
- 0x00..0x1F and 0x7F except for the
- following two codes. */
- EMACS_linefeed_code, /* 0x0A (linefeed) to denote
- end-of-line. */
- EMACS_carriage_return_code, /* 0x0D (carriage-return) to be used
- in selective display mode. */
- EMACS_ascii_code, /* ASCII characters. */
- EMACS_leading_code_2, /* Base leading code of official
- TYPE9N character. */
- EMACS_leading_code_3, /* Base leading code of private TYPE9N
- or official TYPE9Nx9N character. */
- EMACS_leading_code_4, /* Base leading code of private
- TYPE9Nx9N character. */
- EMACS_invalid_code /* Invalid code, i.e. a base leading
- code not yet assigned to any
- charset, or a code of the range
- 0xA0..0xFF. */
+ coding_arg_iso2022_initial = coding_arg_max,
+ coding_arg_iso2022_reg_usage,
+ coding_arg_iso2022_request,
+ coding_arg_iso2022_flags,
+ coding_arg_iso2022_max
};
-extern enum emacs_code_class_type emacs_code_class[256];
-
-/*** ISO2022 section ***/
-
-/* Macros to define code of control characters for ISO2022's functions. */
- /* code */ /* function */
-#define ISO_CODE_LF 0x0A /* line-feed */
-#define ISO_CODE_CR 0x0D /* carriage-return */
-#define ISO_CODE_SO 0x0E /* shift-out */
-#define ISO_CODE_SI 0x0F /* shift-in */
-#define ISO_CODE_SS2_7 0x19 /* single-shift-2 for 7-bit code */
-#define ISO_CODE_ESC 0x1B /* escape */
-#define ISO_CODE_SS2 0x8E /* single-shift-2 */
-#define ISO_CODE_SS3 0x8F /* single-shift-3 */
-#define ISO_CODE_CSI 0x9B /* control-sequence-introduce */
-
-/* All code (1-byte) of ISO2022 is classified into one of the
- followings. */
-enum iso_code_class_type
+enum define_coding_utf16_arg_index
{
- ISO_control_0, /* Control codes in the range
- 0x00..0x1F and 0x7F, except for the
- following 5 codes. */
- ISO_carriage_return, /* ISO_CODE_CR (0x0D) */
- ISO_shift_out, /* ISO_CODE_SO (0x0E) */
- ISO_shift_in, /* ISO_CODE_SI (0x0F) */
- ISO_single_shift_2_7, /* ISO_CODE_SS2_7 (0x19) */
- ISO_escape, /* ISO_CODE_SO (0x1B) */
- ISO_control_1, /* Control codes in the range
- 0x80..0x9F, except for the
- following 3 codes. */
- ISO_single_shift_2, /* ISO_CODE_SS2 (0x8E) */
- ISO_single_shift_3, /* ISO_CODE_SS3 (0x8F) */
- ISO_control_sequence_introducer, /* ISO_CODE_CSI (0x9B) */
- ISO_0x20_or_0x7F, /* Codes of the values 0x20 or 0x7F. */
- ISO_graphic_plane_0, /* Graphic codes in the range 0x21..0x7E. */
- ISO_0xA0_or_0xFF, /* Codes of the values 0xA0 or 0xFF. */
- ISO_graphic_plane_1 /* Graphic codes in the range 0xA1..0xFE. */
+ coding_arg_utf16_bom = coding_arg_max,
+ coding_arg_utf16_endian,
+ coding_arg_utf16_max
};
-/** The macros CODING_FLAG_ISO_XXX defines a flag bit of the `flags'
- element in the structure `coding_system'. This information is used
- while encoding a text to ISO2022. **/
+enum define_coding_ccl_arg_index
+ {
+ coding_arg_ccl_decoder = coding_arg_max,
+ coding_arg_ccl_encoder,
+ coding_arg_ccl_valids,
+ coding_arg_ccl_max
+ };
-/* If set, produce short-form designation sequence (e.g. ESC $ A)
- instead of long-form sequence (e.g. ESC $ ( A). */
-#define CODING_FLAG_ISO_SHORT_FORM 0x0001
+/* Hash table for all coding systems. Keys are coding system symbols
+ and values are spec vectors of the corresponding coding system. A
+ spec vector has the form [ ATTRS ALIASES EOL-TYPE ]. ATTRS is a
+ vector of attribute of the coding system. ALIASES is a list of
+ aliases (symbols) of the coding system. EOL-TYPE is `unix', `dos',
+ `mac' or a vector of coding systems (symbols). */
-/* If set, reset graphic planes and registers at end-of-line to the
- initial state. */
-#define CODING_FLAG_ISO_RESET_AT_EOL 0x0002
+extern Lisp_Object Vcoding_system_hash_table;
-/* If set, reset graphic planes and registers before any control
- characters to the initial state. */
-#define CODING_FLAG_ISO_RESET_AT_CNTL 0x0004
-/* If set, encode by 7-bit environment. */
-#define CODING_FLAG_ISO_SEVEN_BITS 0x0008
+/* Enumeration of coding system type. */
-/* If set, use locking-shift function. */
-#define CODING_FLAG_ISO_LOCKING_SHIFT 0x0010
+enum coding_system_type
+ {
+ coding_type_charset,
+ coding_type_utf_8,
+ coding_type_utf_16,
+ coding_type_iso_2022,
+ coding_type_emacs_mule,
+ coding_type_sjis,
+ coding_type_ccl,
+ coding_type_raw_text,
+ coding_type_undecided,
+ coding_type_max
+ };
-/* If set, use single-shift function. Overwrite
- CODING_FLAG_ISO_LOCKING_SHIFT. */
-#define CODING_FLAG_ISO_SINGLE_SHIFT 0x0020
-/* If set, designate JISX0201-Roman instead of ASCII. */
-#define CODING_FLAG_ISO_USE_ROMAN 0x0040
+/* Enumeration of end-of-line format type. */
-/* If set, designate JISX0208-1978 instead of JISX0208-1983. */
-#define CODING_FLAG_ISO_USE_OLDJIS 0x0080
+enum end_of_line_type
+ {
+ eol_lf, /* Line-feed only, same as Emacs' internal
+ format. */
+ eol_crlf, /* Sequence of carriage-return and
+ line-feed. */
+ eol_cr, /* Carriage-return only. */
+ eol_any, /* Accept any of above. Produce line-feed
+ only. */
+ eol_undecided, /* This value is used to denote that the
+ eol-type is not yet undecided. */
+ eol_type_max
+ };
-/* If set, do not produce ISO6429's direction specifying sequence. */
-#define CODING_FLAG_ISO_NO_DIRECTION 0x0100
+/* Enumeration of index to an attribute vector of a coding system. */
-/* If set, assume designation states are reset at beginning of line on
- output. */
-#define CODING_FLAG_ISO_INIT_AT_BOL 0x0200
+enum coding_attr_index
+ {
+ coding_attr_base_name,
+ coding_attr_docstring,
+ coding_attr_mnemonic,
+ coding_attr_type,
+ coding_attr_charset_list,
+ coding_attr_ascii_compat,
+ coding_attr_decode_tbl,
+ coding_attr_encode_tbl,
+ coding_attr_trans_tbl,
+ coding_attr_post_read,
+ coding_attr_pre_write,
+ coding_attr_default_char,
+ coding_attr_for_unibyte,
+ coding_attr_plist,
+
+ coding_attr_category,
+ coding_attr_safe_charsets,
+
+ /* The followings are extra attributes for each type. */
+ coding_attr_charset_valids,
+
+ coding_attr_ccl_decoder,
+ coding_attr_ccl_encoder,
+ coding_attr_ccl_valids,
+
+ coding_attr_iso_initial,
+ coding_attr_iso_usage,
+ coding_attr_iso_request,
+ coding_attr_iso_flags,
+
+ coding_attr_utf_16_bom,
+ coding_attr_utf_16_endian,
+
+ coding_attr_emacs_mule_full,
+
+ coding_attr_last_index
+ };
-/* If set, designation sequence should be placed at beginning of line
- on output. */
-#define CODING_FLAG_ISO_DESIGNATE_AT_BOL 0x0400
-/* If set, do not encode unsafe characters on output. */
-#define CODING_FLAG_ISO_SAFE 0x0800
+/* Macros to access an element of an attribute vector. */
-/* If set, extra latin codes (128..159) are accepted as a valid code
- on input. */
-#define CODING_FLAG_ISO_LATIN_EXTRA 0x1000
+#define CODING_ATTR_BASE_NAME(attrs) AREF (attrs, coding_attr_base_name)
+#define CODING_ATTR_TYPE(attrs) AREF (attrs, coding_attr_type)
+#define CODING_ATTR_CHARSET_LIST(attrs) AREF (attrs, coding_attr_charset_list)
+#define CODING_ATTR_MNEMONIC(attrs) AREF (attrs, coding_attr_mnemonic)
+#define CODING_ATTR_DOCSTRING(attrs) AREF (attrs, coding_attr_docstring)
+#define CODING_ATTR_ASCII_COMPAT(attrs) AREF (attrs, coding_attr_ascii_compat)
+#define CODING_ATTR_DECODE_TBL(attrs) AREF (attrs, coding_attr_decode_tbl)
+#define CODING_ATTR_ENCODE_TBL(attrs) AREF (attrs, coding_attr_encode_tbl)
+#define CODING_ATTR_TRANS_TBL(attrs) AREF (attrs, coding_attr_trans_tbl)
+#define CODING_ATTR_POST_READ(attrs) AREF (attrs, coding_attr_post_read)
+#define CODING_ATTR_PRE_WRITE(attrs) AREF (attrs, coding_attr_pre_write)
+#define CODING_ATTR_DEFAULT_CHAR(attrs) AREF (attrs, coding_attr_default_char)
+#define CODING_ATTR_FOR_UNIBYTE(attrs) AREF (attrs, coding_attr_for_unibyte)
+#define CODING_ATTR_FLUSHING(attrs) AREF (attrs, coding_attr_flushing)
+#define CODING_ATTR_PLIST(attrs) AREF (attrs, coding_attr_plist)
+#define CODING_ATTR_CATEGORY(attrs) AREF (attrs, coding_attr_category)
+#define CODING_ATTR_SAFE_CHARSETS(attrs)AREF (attrs, coding_attr_safe_charsets)
-/* If set, use designation escape sequence. */
-#define CODING_FLAG_ISO_DESIGNATION 0x10000
-/* A character to be produced on output if encoding of the original
- character is inhibitted by CODING_MODE_INHIBIT_UNENCODABLE_CHAR.
- It must be an ASCII character. */
-#define CODING_REPLACEMENT_CHARACTER '?'
+/* Return the name of a coding system specified by ID. */
+#define CODING_ID_NAME(id) \
+ (HASH_KEY (XHASH_TABLE (Vcoding_system_hash_table), id))
-/* Structure of the field `spec.iso2022' in the structure `coding_system'. */
-struct iso2022_spec
-{
- /* The current graphic register invoked to each graphic plane. */
- int current_invocation[2];
+/* Return the attribute vector of a coding system specified by ID. */
- /* The current charset designated to each graphic register. */
- int current_designation[4];
+#define CODING_ID_ATTRS(id) \
+ (AREF (HASH_VALUE (XHASH_TABLE (Vcoding_system_hash_table), id), 0))
- /* A charset initially designated to each graphic register. */
- int initial_designation[4];
+/* Return the list of aliases of a coding system specified by ID. */
- /* If not -1, it is a graphic register specified in an invalid
- designation sequence. */
- int last_invalid_designation_register;
+#define CODING_ID_ALIASES(id) \
+ (AREF (HASH_VALUE (XHASH_TABLE (Vcoding_system_hash_table), id), 1))
- /* A graphic register to which each charset should be designated. */
- unsigned char requested_designation[MAX_CHARSET + 1];
+/* Return the eol-type of a coding system specified by ID. */
- /* A revision number to be specified for each charset on encoding.
- The value 255 means no revision number for the corresponding
- charset. */
- unsigned char charset_revision_number[MAX_CHARSET + 1];
+#define CODING_ID_EOL_TYPE(id) \
+ (AREF (HASH_VALUE (XHASH_TABLE (Vcoding_system_hash_table), id), 2))
- /* Set to 1 temporarily only when graphic register 2 or 3 is invoked
- by single-shift while encoding. */
- int single_shifting;
- /* Set to 1 temporarily only when processing at beginning of line. */
- int bol;
-};
+/* Return the spec vector of CODING_SYSTEM_SYMBOL. */
+
+#define CODING_SYSTEM_SPEC(coding_system_symbol) \
+ (Fgethash (coding_system_symbol, Vcoding_system_hash_table, Qnil))
+
+
+/* Return the ID of CODING_SYSTEM_SYMBOL. */
+
+#define CODING_SYSTEM_ID(coding_system_symbol) \
+ hash_lookup (XHASH_TABLE (Vcoding_system_hash_table), \
+ coding_system_symbol, NULL)
+
+/* Return 1 if CODING_SYSTEM_SYMBOL is a coding system. */
+
+#define CODING_SYSTEM_P(coding_system_symbol) \
+ (CODING_SYSTEM_ID (coding_system_symbol) >= 0 \
+ || (! NILP (coding_system_symbol) \
+ && ! NILP (Fcoding_system_p (coding_system_symbol))))
+
+/* Check if X is a coding system or not. */
+
+#define CHECK_CODING_SYSTEM(x) \
+ do { \
+ if (CODING_SYSTEM_ID (x) < 0 \
+ && NILP (Fcheck_coding_system (x))) \
+ wrong_type_argument (Qcoding_system_p, (x)); \
+ } while (0)
+
+
+/* Check if X is a coding system or not. If it is, set SEPC to the
+ spec vector of the coding system. */
+
+#define CHECK_CODING_SYSTEM_GET_SPEC(x, spec) \
+ do { \
+ spec = CODING_SYSTEM_SPEC (x); \
+ if (NILP (spec)) \
+ { \
+ Fcheck_coding_system (x); \
+ spec = CODING_SYSTEM_SPEC (x); \
+ } \
+ if (NILP (spec)) \
+ x = wrong_type_argument (Qcoding_system_p, (x)); \
+ } while (0)
+
+
+/* Check if X is a coding system or not. If it is, set ID to the
+ ID of the coding system. */
+
+#define CHECK_CODING_SYSTEM_GET_ID(x, id) \
+ do \
+ { \
+ id = CODING_SYSTEM_ID (x); \
+ if (id < 0) \
+ { \
+ Fcheck_coding_system (x); \
+ id = CODING_SYSTEM_ID (x); \
+ } \
+ if (id < 0) \
+ x = wrong_type_argument (Qcoding_system_p, (x)); \
+ } while (0)
-/* Macros to access each field in the structure `spec.iso2022'. */
-#define CODING_SPEC_ISO_INVOCATION(coding, plane) \
- (coding)->spec.iso2022.current_invocation[plane]
-#define CODING_SPEC_ISO_DESIGNATION(coding, reg) \
- (coding)->spec.iso2022.current_designation[reg]
-#define CODING_SPEC_ISO_INITIAL_DESIGNATION(coding, reg) \
- (coding)->spec.iso2022.initial_designation[reg]
-#define CODING_SPEC_ISO_REQUESTED_DESIGNATION(coding, charset) \
- (coding)->spec.iso2022.requested_designation[charset]
-#define CODING_SPEC_ISO_REVISION_NUMBER(coding, charset) \
- (coding)->spec.iso2022.charset_revision_number[charset]
-#define CODING_SPEC_ISO_SINGLE_SHIFTING(coding) \
- (coding)->spec.iso2022.single_shifting
-#define CODING_SPEC_ISO_BOL(coding) \
- (coding)->spec.iso2022.bol
-
-/* A value which may appear in
- coding->spec.iso2022.requested_designation indicating that the
- corresponding charset does not request any graphic register to be
- designated. */
-#define CODING_SPEC_ISO_NO_REQUESTED_DESIGNATION 4
-
-/* Return a charset which is currently designated to the graphic plane
- PLANE in the coding-system CODING. */
-#define CODING_SPEC_ISO_PLANE_CHARSET(coding, plane) \
- ((CODING_SPEC_ISO_INVOCATION (coding, plane) < 0) \
- ? -1 \
- : CODING_SPEC_ISO_DESIGNATION (coding, \
- CODING_SPEC_ISO_INVOCATION (coding, plane)))
-
-/*** BIG5 section ***/
-
-/* Macros to denote each type of BIG5 coding system. */
-#define CODING_FLAG_BIG5_HKU 0x00 /* BIG5-HKU is one of variants of
- BIG5 developed by Hong Kong
- University. */
-#define CODING_FLAG_BIG5_ETEN 0x01 /* BIG5_ETen is one of variants
- of BIG5 developed by the
- company ETen in Taiwan. */
/*** GENERAL section ***/
-/* Types of coding system. */
-enum coding_type
+/* Enumeration of result code of code conversion. */
+enum coding_result_code
{
- coding_type_no_conversion, /* A coding system which requires no
- conversion for reading and writing
- including end-of-line format. */
- coding_type_emacs_mule, /* A coding system used in Emacs'
- buffer and string. Requires no
- conversion for reading and writing
- except for end-of-line format. */
- coding_type_undecided, /* A coding system which requires
- automatic detection of a real
- coding system. */
- coding_type_sjis, /* SJIS coding system for Japanese. */
- coding_type_iso2022, /* Any coding system of ISO2022
- variants. */
- coding_type_big5, /* BIG5 coding system for Chinese. */
- coding_type_ccl, /* The coding system of which decoder
- and encoder are written in CCL. */
- coding_type_raw_text /* A coding system for a text
- containing random 8-bit code which
- does not require code conversion
- except for end-of-line format. */
+ CODING_RESULT_SUCCESS,
+ CODING_RESULT_INSUFFICIENT_SRC,
+ CODING_RESULT_INSUFFICIENT_DST,
+ CODING_RESULT_INCONSISTENT_EOL,
+ CODING_RESULT_INVALID_SRC,
+ CODING_RESULT_INTERRUPT,
+ CODING_RESULT_INSUFFICIENT_MEM
};
-/* Formats of end-of-line. */
-#define CODING_EOL_LF 0 /* Line-feed only, same as Emacs'
- internal format. */
-#define CODING_EOL_CRLF 1 /* Sequence of carriage-return and
- line-feed. */
-#define CODING_EOL_CR 2 /* Carriage-return only. */
-#define CODING_EOL_UNDECIDED 3 /* This value is used to denote the
- eol-type is not yet decided. */
-#define CODING_EOL_INCONSISTENT 4 /* This value is used to denote the
- eol-type is not consistent
- through the file. */
-
-/* 1 if composing. */
-#define COMPOSING_P(coding) ((int) coding->composing > (int) COMPOSITION_NO)
-
-#define COMPOSITION_DATA_SIZE 4080
-#define COMPOSITION_DATA_MAX_BUNCH_LENGTH (4 + MAX_COMPOSITION_COMPONENTS*2)
-
-/* Data structure to hold information about compositions of text that
- is being decoded or encode. ISO 2022 base code conversion routines
- handle special ESC sequences for composition specification. But,
- they can't get/put such information directly from/to a buffer in
- the deepest place. So, they store or retrieve the information
- through this structure.
-
- The encoder stores the information in this structure when it meets
- ESC sequences for composition while encoding codes, then, after all
- text codes are encoded, puts `composition' properties on the text
- by referring to the structure.
-
- The decoder at first stores the information of a text to be
- decoded, then, while decoding codes, generates ESC sequences for
- composition at proper places by referring to the structure. */
-
-struct composition_data
-{
- /* The character position of the first character to be encoded or
- decoded. START and END (see below) are relative to this
- position. */
- int char_offset;
-
- /* The composition data. These elements are repeated for each
- composition:
- LENGTH START END METHOD [ COMPONENT ... ]
- where,
- LENGTH is the number of elements for this composition.
-
- START and END are starting and ending character positions of
- the composition relative to `char_offset'.
-
- METHOD is one of `enum composing_status' specifying the way of
- composition.
-
- COMPONENT is a character or an encoded composition rule. */
- int data[COMPOSITION_DATA_SIZE];
-
- /* The number of elements in `data' currently used. */
- int used;
-
- /* Pointers to the previous and next structures. When `data' is
- filled up, another structure is allocated and linked in `next'.
- The new structure has backward link to this structure in `prev'.
- The number of chained structures depends on how many compositions
- the text being encoded or decoded contains. */
- struct composition_data *prev, *next;
-};
-
-/* Macros used for the member `result' of the struct
- coding_system. */
-#define CODING_FINISH_NORMAL 0
-#define CODING_FINISH_INSUFFICIENT_SRC 1
-#define CODING_FINISH_INSUFFICIENT_DST 2
-#define CODING_FINISH_INCONSISTENT_EOL 3
-#define CODING_FINISH_INSUFFICIENT_CMP 4
-#define CODING_FINISH_INTERRUPT 5
/* Macros used for the member `mode' of the struct coding_system. */
@@ -334,7 +284,7 @@ struct composition_data
#define CODING_MODE_INHIBIT_INCONSISTENT_EOL 0x01
/* If set, the decoding/encoding routines treat the current data as
- the last block of the whole text to be converted, and do
+ the last block of the whole text to be converted, and do the
appropriate finishing job. */
#define CODING_MODE_LAST_BLOCK 0x02
@@ -342,65 +292,106 @@ struct composition_data
enables selective display. */
#define CODING_MODE_SELECTIVE_DISPLAY 0x04
-/* If set, replace unencodabae characters by `?' on encoding. */
-#define CODING_MODE_INHIBIT_UNENCODABLE_CHAR 0x08
-
/* This flag is used by the decoding/encoding routines on the fly. If
set, it means that right-to-left text is being processed. */
-#define CODING_MODE_DIRECTION 0x10
+#define CODING_MODE_DIRECTION 0x08
-struct coding_system
+#define CODING_MODE_FIXED_DESTINATION 0x10
+
+/* If set, it means that the encoding routines produces some safe
+ ASCII characters (usually '?') for unsupported characters. */
+#define CODING_MODE_SAFE_ENCODING 0x20
+
+/* Structure of the field `spec.iso_2022' in the structure
+ `coding_system'. */
+struct iso_2022_spec
{
- /* Type of the coding system. */
- enum coding_type type;
+ /* Bit-wise-or of CODING_ISO_FLAG_XXX. */
+ unsigned flags;
- /* Type of end-of-line format (LF, CRLF, or CR) of the coding system. */
- int eol_type;
+ /* The current graphic register invoked to each graphic plane. */
+ int current_invocation[2];
- /* Flag bits of the coding system. The meaning of each bit is common
- to all types of coding systems. */
- unsigned int common_flags;
+ /* The current charset designated to each graphic register. The
+ value -1 means that not charset is designated, -2 means that
+ there was an invalid designation previously. */
+ int current_designation[4];
- /* Flag bits of the coding system. The meaning of each bit depends
- on the type of the coding system. */
- unsigned int flags;
+ /* Set to 1 temporarily only when graphic register 2 or 3 is invoked
+ by single-shift while encoding. */
+ int single_shifting;
- /* Mode bits of the coding system. See the comments of the macros
- CODING_MODE_XXX. */
- unsigned int mode;
+ /* Set to 1 temporarily only when processing at beginning of line. */
+ int bol;
+};
+
+struct ccl_spec;
+
+enum utf_16_bom_type
+ {
+ utf_16_detect_bom,
+ utf_16_without_bom,
+ utf_16_with_bom
+ };
+
+enum utf_16_endian_type
+ {
+ utf_16_big_endian,
+ utf_16_little_endian
+ };
+
+struct utf_16_spec
+{
+ enum utf_16_bom_type bom;
+ enum utf_16_endian_type endian;
+ int surrogate;
+};
- /* The current status of composition handling. */
- int composing;
+struct coding_detection_info
+{
+ /* Values of these members are bitwise-OR of CATEGORY_MASK_XXXs. */
+ /* Which categories are already checked. */
+ int checked;
+ /* Which categories are strongly found. */
+ int found;
+ /* Which categories are rejected. */
+ int rejected;
+};
- /* 1 if the next character is a composition rule. */
- int composition_rule_follows;
- /* Information of compositions are stored here on decoding and set
- in advance on encoding. */
- struct composition_data *cmp_data;
+struct coding_system
+{
+ /* ID number of the coding system. This is an index to
+ Vcoding_system_hash_table. This value is set by
+ setup_coding_system. At the early stage of building time, this
+ value is -1 in the array coding_categories to indicate that no
+ coding-system of that category is yet defined. */
+ int id;
- /* Index to cmp_data->data for the first element for the current
- composition. */
- int cmp_data_start;
+ /* Flag bits of the coding system. The meaning of each bit is common
+ to all types of coding systems. */
+ int common_flags;
- /* Index to cmp_data->data for the current element for the current
- composition. */
- int cmp_data_index;
+ /* Mode bits of the coding system. See the comments of the macros
+ CODING_MODE_XXX. */
+ unsigned int mode;
/* Detailed information specific to each type of coding system. */
- union spec
+ union
{
- struct iso2022_spec iso2022;
- struct ccl_spec ccl; /* Defined in ccl.h. */
+ struct iso_2022_spec iso_2022;
+ struct ccl_spec *ccl; /* Defined in ccl.h. */
+ struct utf_16_spec utf_16;
+ int emacs_mule_full_support;
} spec;
- /* Index number of coding category of the coding system. */
- int category_idx;
+ int max_charset_id;
+ char *safe_charsets;
- /* The following two members specify how characters 128..159 are
- represented in source and destination text respectively. 1 means
- they are represented by 2-byte sequence, 0 means they are
- represented by 1-byte as is (see the comment in charset.h). */
+ /* The following two members specify how binary 8-bit code 128..255
+ are represented in source and destination text respectively. 1
+ means they are represented by 2-byte sequence, 0 means they are
+ represented by 1-byte as is (see the comment in character.h). */
unsigned src_multibyte : 1;
unsigned dst_multibyte : 1;
@@ -408,173 +399,200 @@ struct coding_system
-1 in setup_coding_system, and updated by detect_coding. So,
when this is equal to the byte length of the text being
converted, we can skip the actual conversion process. */
- int heading_ascii;
+ int head_ascii;
/* The following members are set by encoding/decoding routine. */
- int produced, produced_char, consumed, consumed_char;
+ EMACS_INT produced, produced_char, consumed, consumed_char;
/* Number of error source data found in a decoding routine. */
int errors;
- /* Finish status of code conversion. It should be one of macros
- CODING_FINISH_XXXX. */
- int result;
+ /* Store the positions of error source data. */
+ EMACS_INT *error_positions;
- /* If nonzero, suppress error notification. */
- int suppress_error;
+ /* Finish status of code conversion. */
+ enum coding_result_code result;
- /* The following members are all Lisp symbols. We don't have to
- protect them from GC because the current garbage collection
- doesn't relocate Lisp symbols. But, when it is changed, we must
- find a way to protect them. */
+ EMACS_INT src_pos, src_pos_byte, src_chars, src_bytes;
+ Lisp_Object src_object;
+ const unsigned char *source;
- /* Backward pointer to the Lisp symbol of the coding system. */
- Lisp_Object symbol;
+ EMACS_INT dst_pos, dst_pos_byte, dst_bytes;
+ Lisp_Object dst_object;
+ unsigned char *destination;
- /* Lisp function (symbol) to be called after decoding to do
- additional conversion, or nil. */
- Lisp_Object post_read_conversion;
+ /* Set to 1 if the source of conversion is not in the member
+ `charbuf', but at `src_object'. */
+ int chars_at_source;
- /* Lisp function (symbol) to be called before encoding to do
- additional conversion, or nil. */
- Lisp_Object pre_write_conversion;
+ /* If an element is non-negative, it is a character code.
- /* Character translation tables to look up, or nil. */
- Lisp_Object translation_table_for_decode;
- Lisp_Object translation_table_for_encode;
-};
+ If it is in the range -128..-1, it is a 8-bit character code
+ minus 256.
+
+ If it is less than -128, it specifies the start of an annotation
+ chunk. The length of the chunk is -128 minus the value of the
+ element. The following elements are OFFSET, ANNOTATION-TYPE, and
+ a sequence of actual data for the annotation. OFFSET is a
+ character position offset from dst_pos or src_pos,
+ ANNOTATION-TYPE specfies the meaning of the annotation and how to
+ handle the following data.. */
+ int *charbuf;
+ int charbuf_size, charbuf_used;
+
+ /* Set to 1 if charbuf contains an annotation. */
+ int annotated;
+
+ unsigned char carryover[64];
+ int carryover_bytes;
+
+ int default_char;
-/* Mask bits for (struct coding_system *)->common_flags. */
-#define CODING_REQUIRE_FLUSHING_MASK 0x01
-#define CODING_REQUIRE_DECODING_MASK 0x02
-#define CODING_REQUIRE_ENCODING_MASK 0x04
-#define CODING_REQUIRE_DETECTION_MASK 0x08
-#define CODING_ASCII_INCOMPATIBLE_MASK 0x10
+ int (*detector) P_ ((struct coding_system *,
+ struct coding_detection_info *));
+ void (*decoder) P_ ((struct coding_system *));
+ int (*encoder) P_ ((struct coding_system *));
+};
-/* Return 1 if the coding system CODING requires specific code to be
+/* Meanings of bits in the member `common_flags' of the structure
+ coding_system. The lowest 8 bits are reserved for various kind of
+ annotations (currently two of them are used). */
+#define CODING_ANNOTATION_MASK 0x00FF
+#define CODING_ANNOTATE_COMPOSITION_MASK 0x0001
+#define CODING_ANNOTATE_DIRECTION_MASK 0x0002
+#define CODING_ANNOTATE_CHARSET_MASK 0x0003
+#define CODING_FOR_UNIBYTE_MASK 0x0100
+#define CODING_REQUIRE_FLUSHING_MASK 0x0200
+#define CODING_REQUIRE_DECODING_MASK 0x0400
+#define CODING_REQUIRE_ENCODING_MASK 0x0800
+#define CODING_REQUIRE_DETECTION_MASK 0x1000
+#define CODING_RESET_AT_BOL_MASK 0x2000
+
+/* Return 1 if the coding context CODING requires annotaion
+ handling. */
+#define CODING_REQUIRE_ANNOTATION(coding) \
+ ((coding)->common_flags & CODING_ANNOTATION_MASK)
+
+/* Return 1 if the coding context CODING prefers decoding into unibyte. */
+#define CODING_FOR_UNIBYTE(coding) \
+ ((coding)->common_flags & CODING_FOR_UNIBYTE_MASK)
+
+/* Return 1 if the coding context CODING requires specific code to be
attached at the tail of converted text. */
#define CODING_REQUIRE_FLUSHING(coding) \
((coding)->common_flags & CODING_REQUIRE_FLUSHING_MASK)
-/* Return 1 if the coding system CODING requires code conversion on
+/* Return 1 if the coding context CODING requires code conversion on
decoding. */
#define CODING_REQUIRE_DECODING(coding) \
((coding)->dst_multibyte \
|| (coding)->common_flags & CODING_REQUIRE_DECODING_MASK)
-/* Return 1 if the coding system CODING requires code conversion on
+
+/* Return 1 if the coding context CODING requires code conversion on
encoding.
The non-multibyte part of the condition is to support encoding of
unibyte strings/buffers generated by string-as-unibyte or
(set-buffer-multibyte nil) from multibyte strings/buffers. */
-#define CODING_REQUIRE_ENCODING(coding) \
- ((coding)->src_multibyte \
- || (coding)->common_flags & CODING_REQUIRE_ENCODING_MASK)
+#define CODING_REQUIRE_ENCODING(coding) \
+ ((coding)->src_multibyte \
+ || (coding)->common_flags & CODING_REQUIRE_ENCODING_MASK \
+ || (coding)->mode & CODING_MODE_SELECTIVE_DISPLAY)
-/* Return 1 if the coding system CODING requires some kind of code
+
+/* Return 1 if the coding context CODING requires some kind of code
detection. */
#define CODING_REQUIRE_DETECTION(coding) \
((coding)->common_flags & CODING_REQUIRE_DETECTION_MASK)
-/* Return 1 if the coding system CODING requires code conversion on
+/* Return 1 if the coding context CODING requires code conversion on
decoding or some kind of code detection. */
#define CODING_MAY_REQUIRE_DECODING(coding) \
(CODING_REQUIRE_DECODING (coding) \
|| CODING_REQUIRE_DETECTION (coding))
-/* Index for each coding category in `coding_category_table' */
-#define CODING_CATEGORY_IDX_EMACS_MULE 0
-#define CODING_CATEGORY_IDX_SJIS 1
-#define CODING_CATEGORY_IDX_ISO_7 2
-#define CODING_CATEGORY_IDX_ISO_7_TIGHT 3
-#define CODING_CATEGORY_IDX_ISO_8_1 4
-#define CODING_CATEGORY_IDX_ISO_8_2 5
-#define CODING_CATEGORY_IDX_ISO_7_ELSE 6
-#define CODING_CATEGORY_IDX_ISO_8_ELSE 7
-#define CODING_CATEGORY_IDX_CCL 8
-#define CODING_CATEGORY_IDX_BIG5 9
-#define CODING_CATEGORY_IDX_UTF_8 10
-#define CODING_CATEGORY_IDX_UTF_16_BE 11
-#define CODING_CATEGORY_IDX_UTF_16_LE 12
-#define CODING_CATEGORY_IDX_RAW_TEXT 13
-#define CODING_CATEGORY_IDX_BINARY 14
-#define CODING_CATEGORY_IDX_MAX 15
-
-/* Definitions of flag bits returned by the function
- detect_coding_mask (). */
-#define CODING_CATEGORY_MASK_EMACS_MULE (1 << CODING_CATEGORY_IDX_EMACS_MULE)
-#define CODING_CATEGORY_MASK_SJIS (1 << CODING_CATEGORY_IDX_SJIS)
-#define CODING_CATEGORY_MASK_ISO_7 (1 << CODING_CATEGORY_IDX_ISO_7)
-#define CODING_CATEGORY_MASK_ISO_7_TIGHT (1 << CODING_CATEGORY_IDX_ISO_7_TIGHT)
-#define CODING_CATEGORY_MASK_ISO_8_1 (1 << CODING_CATEGORY_IDX_ISO_8_1)
-#define CODING_CATEGORY_MASK_ISO_8_2 (1 << CODING_CATEGORY_IDX_ISO_8_2)
-#define CODING_CATEGORY_MASK_ISO_7_ELSE (1 << CODING_CATEGORY_IDX_ISO_7_ELSE)
-#define CODING_CATEGORY_MASK_ISO_8_ELSE (1 << CODING_CATEGORY_IDX_ISO_8_ELSE)
-#define CODING_CATEGORY_MASK_CCL (1 << CODING_CATEGORY_IDX_CCL)
-#define CODING_CATEGORY_MASK_BIG5 (1 << CODING_CATEGORY_IDX_BIG5)
-#define CODING_CATEGORY_MASK_UTF_8 (1 << CODING_CATEGORY_IDX_UTF_8)
-#define CODING_CATEGORY_MASK_UTF_16_BE (1 << CODING_CATEGORY_IDX_UTF_16_BE)
-#define CODING_CATEGORY_MASK_UTF_16_LE (1 << CODING_CATEGORY_IDX_UTF_16_LE)
-#define CODING_CATEGORY_MASK_RAW_TEXT (1 << CODING_CATEGORY_IDX_RAW_TEXT)
-#define CODING_CATEGORY_MASK_BINARY (1 << CODING_CATEGORY_IDX_BINARY)
-
-/* This value is returned if detect_coding_mask () find nothing other
- than ASCII characters. */
-#define CODING_CATEGORY_MASK_ANY \
- ( CODING_CATEGORY_MASK_EMACS_MULE \
- | CODING_CATEGORY_MASK_SJIS \
- | CODING_CATEGORY_MASK_ISO_7 \
- | CODING_CATEGORY_MASK_ISO_7_TIGHT \
- | CODING_CATEGORY_MASK_ISO_8_1 \
- | CODING_CATEGORY_MASK_ISO_8_2 \
- | CODING_CATEGORY_MASK_ISO_7_ELSE \
- | CODING_CATEGORY_MASK_ISO_8_ELSE \
- | CODING_CATEGORY_MASK_CCL \
- | CODING_CATEGORY_MASK_BIG5 \
- | CODING_CATEGORY_MASK_UTF_8 \
- | CODING_CATEGORY_MASK_UTF_16_BE \
- | CODING_CATEGORY_MASK_UTF_16_LE)
-
-#define CODING_CATEGORY_MASK_ISO_7BIT \
- (CODING_CATEGORY_MASK_ISO_7 | CODING_CATEGORY_MASK_ISO_7_TIGHT)
-
-#define CODING_CATEGORY_MASK_ISO_8BIT \
- (CODING_CATEGORY_MASK_ISO_8_1 | CODING_CATEGORY_MASK_ISO_8_2)
-
-#define CODING_CATEGORY_MASK_ISO_SHIFT \
- (CODING_CATEGORY_MASK_ISO_7_ELSE | CODING_CATEGORY_MASK_ISO_8_ELSE)
-
-#define CODING_CATEGORY_MASK_ISO \
- ( CODING_CATEGORY_MASK_ISO_7BIT \
- | CODING_CATEGORY_MASK_ISO_SHIFT \
- | CODING_CATEGORY_MASK_ISO_8BIT)
-
-#define CODING_CATEGORY_MASK_UTF_16_BE_LE \
- (CODING_CATEGORY_MASK_UTF_16_BE | CODING_CATEGORY_MASK_UTF_16_LE)
-
/* Macros to decode or encode a character of JISX0208 in SJIS. S1 and
S2 are the 1st and 2nd position-codes of JISX0208 in SJIS coding
system. C1 and C2 are the 1st and 2nd position codes of Emacs'
internal format. */
-#define DECODE_SJIS(s1, s2, c1, c2) \
- do { \
- if (s2 >= 0x9F) \
- c1 = s1 * 2 - (s1 >= 0xE0 ? 0x160 : 0xE0), \
- c2 = s2 - 0x7E; \
- else \
- c1 = s1 * 2 - ((s1 >= 0xE0) ? 0x161 : 0xE1), \
- c2 = s2 - ((s2 >= 0x7F) ? 0x20 : 0x1F); \
+#define SJIS_TO_JIS(code) \
+ do { \
+ int s1, s2, j1, j2; \
+ \
+ s1 = (code) >> 8, s2 = (code) & 0xFF; \
+ \
+ if (s2 >= 0x9F) \
+ (j1 = s1 * 2 - (s1 >= 0xE0 ? 0x160 : 0xE0), \
+ j2 = s2 - 0x7E); \
+ else \
+ (j1 = s1 * 2 - ((s1 >= 0xE0) ? 0x161 : 0xE1), \
+ j2 = s2 - ((s2 >= 0x7F) ? 0x20 : 0x1F)); \
+ (code) = (j1 << 8) | j2; \
+ } while (0)
+
+#define SJIS_TO_JIS2(code) \
+ do { \
+ int s1, s2, j1, j2; \
+ \
+ s1 = (code) >> 8, s2 = (code) & 0xFF; \
+ \
+ if (s2 >= 0x9F) \
+ { \
+ j1 = (s1 == 0xF0 ? 0x28 \
+ : s1 == 0xF1 ? 0x24 \
+ : s1 == 0xF2 ? 0x2C \
+ : s1 == 0xF3 ? 0x2E \
+ : 0x6E + (s1 - 0xF4) * 2); \
+ j2 = s2 - 0x7E; \
+ } \
+ else \
+ { \
+ j1 = (s1 <= 0xF2 ? 0x21 + (s1 - 0xF0) * 2 \
+ : s1 <= 0xF4 ? 0x2D + (s1 - 0xF3) * 2 \
+ : 0x6F + (s1 - 0xF5) * 2); \
+ j2 = s2 - ((s2 >= 0x7F ? 0x20 : 0x1F)); \
+ } \
+ (code) = (j1 << 8) | j2; \
+ } while (0)
+
+
+#define JIS_TO_SJIS(code) \
+ do { \
+ int s1, s2, j1, j2; \
+ \
+ j1 = (code) >> 8, j2 = (code) & 0xFF; \
+ if (j1 & 1) \
+ (s1 = j1 / 2 + ((j1 < 0x5F) ? 0x71 : 0xB1), \
+ s2 = j2 + ((j2 >= 0x60) ? 0x20 : 0x1F)); \
+ else \
+ (s1 = j1 / 2 + ((j1 < 0x5F) ? 0x70 : 0xB0), \
+ s2 = j2 + 0x7E); \
+ (code) = (s1 << 8) | s2; \
} while (0)
-#define ENCODE_SJIS(c1, c2, s1, s2) \
+#define JIS_TO_SJIS2(code) \
do { \
- if (c1 & 1) \
- s1 = c1 / 2 + ((c1 < 0x5F) ? 0x71 : 0xB1), \
- s2 = c2 + ((c2 >= 0x60) ? 0x20 : 0x1F); \
+ int s1, s2, j1, j2; \
+ \
+ j1 = (code) >> 8, j2 = (code) & 0xFF; \
+ if (j1 & 1) \
+ { \
+ s1 = (j1 <= 0x25 ? 0xF0 + (j1 - 0x21) / 2 \
+ : j1 <= 0x27 ? 0xF3 + (j1 - 0x2D) / 2 \
+ : 0xF5 + (j1 - 0x6F) / 2); \
+ s2 = j2 + ((j2 >= 0x60) ? 0x20 : 0x1F); \
+ } \
else \
- s1 = c1 / 2 + ((c1 < 0x5F) ? 0x70 : 0xB0), \
- s2 = c2 + 0x7E; \
+ { \
+ s1 = (j1 == 0x28 ? 0xF0 \
+ : j1 == 0x24 ? 0xF1 \
+ : j1 == 0x2C ? 0xF2 \
+ : j1 == 0x2E ? 0xF3 \
+ : 0xF4 + (j1 - 0x6E) / 2); \
+ s2 = j2 + 0x7E; \
+ } \
+ (code) = (s1 << 8) | s2; \
} while (0)
/* Encode the file name NAME using the specified coding system
@@ -588,6 +606,7 @@ struct coding_system
? code_convert_string_norecord (name, Vdefault_file_name_coding_system, 1) \
: name))
+
/* Decode the file name NAME using the specified coding system
for file names, if any. */
#define DECODE_FILE(name) \
@@ -599,6 +618,7 @@ struct coding_system
? code_convert_string_norecord (name, Vdefault_file_name_coding_system, 0) \
: name))
+
/* Encode the string STR using the specified coding system
for system functions, if any. */
#define ENCODE_SYSTEM(str) \
@@ -615,54 +635,83 @@ struct coding_system
? code_convert_string_norecord (str, Vlocale_coding_system, 0) \
: str)
+/* Used by the gtk menu code. Note that this encodes utf-8, not
+ utf-8-emacs, so it's not a no-op. */
#define ENCODE_UTF_8(str) code_convert_string_norecord (str, Qutf_8, 1)
/* Extern declarations. */
-extern int decode_coding P_ ((struct coding_system *, const unsigned char *,
- unsigned char *, int, int));
-extern int encode_coding P_ ((struct coding_system *, const unsigned char *,
- unsigned char *, int, int));
-extern void coding_save_composition P_ ((struct coding_system *, int, int,
- Lisp_Object));
-extern void coding_free_composition_data P_ ((struct coding_system *));
-extern void coding_adjust_composition_offset P_ ((struct coding_system *,
- int));
-extern void coding_allocate_composition_data P_ ((struct coding_system *,
- int));
-extern void coding_restore_composition P_ ((struct coding_system *,
- Lisp_Object));
-extern int code_convert_region P_ ((int, int, int, int, struct coding_system *,
- int, int));
-extern Lisp_Object run_pre_post_conversion_on_str P_ ((Lisp_Object,
- struct coding_system *,
- int));
-extern void run_pre_write_conversin_on_c_str P_ ((unsigned char **, int *,
- int, int,
- struct coding_system *));
-
+extern Lisp_Object code_conversion_save P_ ((int, int));
extern int decoding_buffer_size P_ ((struct coding_system *, int));
extern int encoding_buffer_size P_ ((struct coding_system *, int));
-extern void detect_coding P_ ((struct coding_system *, const unsigned char *,
- int));
-extern void detect_eol P_ ((struct coding_system *, const unsigned char *,
- int));
-extern int setup_coding_system P_ ((Lisp_Object, struct coding_system *));
-extern Lisp_Object code_convert_string P_ ((Lisp_Object,
- struct coding_system *, int, int));
-extern Lisp_Object code_convert_string1 P_ ((Lisp_Object, Lisp_Object,
- Lisp_Object, int));
+extern void setup_coding_system P_ ((Lisp_Object, struct coding_system *));
+extern Lisp_Object coding_charset_list P_ ((struct coding_system *));
+extern void detect_coding P_ ((struct coding_system *));
+extern Lisp_Object code_convert_region P_ ((Lisp_Object, Lisp_Object,
+ Lisp_Object, Lisp_Object,
+ int, int));
+extern Lisp_Object code_convert_string P_ ((Lisp_Object, Lisp_Object,
+ Lisp_Object, int, int, int));
extern Lisp_Object code_convert_string_norecord P_ ((Lisp_Object, Lisp_Object,
int));
-extern void setup_raw_text_coding_system P_ ((struct coding_system *));
-extern Lisp_Object encode_coding_string P_ ((Lisp_Object,
- struct coding_system *, int));
-extern Lisp_Object decode_coding_string P_ ((Lisp_Object,
- struct coding_system *, int));
+extern Lisp_Object raw_text_coding_system P_ ((Lisp_Object));
+extern Lisp_Object coding_inherit_eol_type P_ ((Lisp_Object, Lisp_Object));
+
+extern int decode_coding_gap P_ ((struct coding_system *,
+ EMACS_INT, EMACS_INT));
+extern int encode_coding_gap P_ ((struct coding_system *,
+ EMACS_INT, EMACS_INT));
+extern void decode_coding_object P_ ((struct coding_system *,
+ Lisp_Object, EMACS_INT, EMACS_INT,
+ EMACS_INT, EMACS_INT, Lisp_Object));
+extern void encode_coding_object P_ ((struct coding_system *,
+ Lisp_Object, EMACS_INT, EMACS_INT,
+ EMACS_INT, EMACS_INT, Lisp_Object));
+
+/* Macros for backward compatibility. */
+
+#define decode_coding_region(coding, from, to) \
+ decode_coding_object (coding, Fcurrent_buffer (), \
+ from, CHAR_TO_BYTE (from), \
+ to, CHAR_TO_BYTE (to), Fcurrent_buffer ())
+
+
+#define encode_coding_region(coding, from, to) \
+ encode_coding_object (coding, Fcurrent_buffer (), \
+ from, CHAR_TO_BYTE (from), \
+ to, CHAR_TO_BYTE (to), Fcurrent_buffer ())
+
+
+#define decode_coding_string(coding, string, nocopy) \
+ decode_coding_object (coding, string, 0, 0, XSTRING (string)->size, \
+ STRING_BYTES (XSTRING (string)), Qt)
+
+#define encode_coding_string(coding, string, nocopy) \
+ (encode_coding_object (coding, string, 0, 0, XSTRING (string)->size, \
+ STRING_BYTES (XSTRING (string)), Qt), \
+ (coding)->dst_object)
+
+
+#define decode_coding_c_string(coding, src, bytes, dst_object) \
+ do { \
+ (coding)->source = (src); \
+ (coding)->src_chars = (coding)->src_bytes = (bytes); \
+ decode_coding_object ((coding), Qnil, 0, 0, (bytes), (bytes), \
+ (dst_object)); \
+ } while (0)
+
+
+extern Lisp_Object preferred_coding_system P_ (());
+
+
+extern Lisp_Object Qutf_8, Qutf_8_emacs;
+
extern Lisp_Object Qcoding_system, Qeol_type, Qcoding_category_index;
-extern Lisp_Object Qraw_text, Qemacs_mule;
+extern Lisp_Object Qcoding_system_p;
+extern Lisp_Object Qraw_text, Qemacs_mule, Qno_conversion, Qundecided;
+extern Lisp_Object Qiso_2022;
extern Lisp_Object Qbuffer_file_coding_system;
-extern Lisp_Object Vcoding_category_list;
-extern Lisp_Object Qutf_8;
+
+extern Lisp_Object Qunix, Qdos, Qmac;
extern Lisp_Object Qtranslation_table;
extern Lisp_Object Qtranslation_table_id;
@@ -672,9 +721,6 @@ extern Lisp_Object eol_mnemonic_unix, eol_mnemonic_dos, eol_mnemonic_mac;
/* Mnemonic string to indicate type of end-of-line is not yet decided. */
extern Lisp_Object eol_mnemonic_undecided;
-/* Format of end-of-line decided by system. */
-extern int system_eol_type;
-
#ifdef emacs
extern Lisp_Object Qfile_coding_system;
extern Lisp_Object Qcall_process, Qcall_process_region;
@@ -696,17 +742,24 @@ extern Lisp_Object Vlocale_coding_system;
the subprocess output. */
extern int inherit_process_coding_system;
+/* Coding-system to be used for encoding terminal output. This
+ structure contains information of a coding-system specified by the
+ function `set-terminal-coding-system'. */
+extern struct coding_system terminal_coding;
+
/* Coding system to be used to encode text for terminal display when
terminal coding system is nil. */
extern struct coding_system safe_terminal_coding;
-/* Default coding system to be used to write a file. */
-extern struct coding_system default_buffer_file_coding;
+/* Coding-system of what is sent from terminal keyboard. This
+ structure contains information of a coding-system specified by the
+ function `set-keyboard-coding-system'. */
+extern struct coding_system keyboard_coding;
/* Default coding systems used for process I/O. */
extern Lisp_Object Vdefault_process_coding_system;
-/* Function to call to force a user to force select a proper coding
+/* Function to call to force a user to force select a propert coding
system. */
extern Lisp_Object Vselect_safe_coding_system_function;
@@ -726,6 +779,9 @@ extern Lisp_Object Vdefault_file_name_coding_system;
/* Error signaled when there's a problem with detecting coding system */
extern Lisp_Object Qcoding_system_error;
+extern char emacs_mule_bytes[256];
+extern int emacs_mule_string_char P_ ((unsigned char *));
+
#endif /* EMACS_CODING_H */
/* arch-tag: 2bc3b4fa-6870-4f64-8135-b962b2d290e4
diff --git a/src/composite.c b/src/composite.c
index 95c19d7456..8e6a8e3b88 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -4,6 +4,9 @@
Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
National Institute of Advanced Industrial Science and Technology (AIST)
Registration Number H14PRO021
+ Copyright (C) 2003, 2006
+ National Institute of Advanced Industrial Science and Technology (AIST)
+ Registration Number H13PRO009
This file is part of GNU Emacs.
@@ -25,7 +28,7 @@ Boston, MA 02110-1301, USA. */
#include <config.h>
#include "lisp.h"
#include "buffer.h"
-#include "charset.h"
+#include "character.h"
#include "intervals.h"
/* Emacs uses special text property `composition' to support character
@@ -147,19 +150,17 @@ Lisp_Object composition_hash_table;
/* Function to call to adjust composition. */
Lisp_Object Vcompose_chars_after_function;
-/* Char-table of patterns and functions to make a composition. */
-Lisp_Object Vcomposition_function_table;
-Lisp_Object Qcomposition_function_table;
+Lisp_Object Qauto_composed;
+Lisp_Object Vauto_composition_function;
+Lisp_Object Qauto_composition_function;
+
+EXFUN (Fremove_list_of_text_properties, 4);
/* Temporary variable used in macros COMPOSITION_XXX. */
Lisp_Object composition_temp;
-
-/* Return how many columns C will occupy on the screen. It always
- returns 1 for control characters and 8-bit characters because those
- are just ignored in a composition. */
-#define CHAR_WIDTH(c) \
- (SINGLE_BYTE_CHAR_P (c) ? 1 : CHARSET_WIDTH (CHAR_CHARSET (c)))
+extern int enable_font_backend;
+
/* Return COMPOSITION-ID of a composition at buffer position
CHARPOS/BYTEPOS and length NCHARS. The `composition' property of
the sequence is PROP. STRING, if non-nil, is a string that
@@ -274,6 +275,22 @@ get_composition_id (charpos, bytepos, nchars, prop, string)
/* Check if the contents of COMPONENTS are valid if COMPONENTS is a
vector or a list. It should be a sequence of:
char1 rule1 char2 rule2 char3 ... ruleN charN+1 */
+
+#ifdef USE_FONT_BACKEND
+ if (enable_font_backend
+ && VECTORP (components)
+ && ASIZE (components) >= 2
+ && VECTORP (AREF (components, 0)))
+ {
+ /* COMPONENTS is a glyph-string. */
+ int len = ASIZE (key);
+
+ for (i = 1; i < len; i++)
+ if (! VECTORP (AREF (key, i)))
+ goto invalid_composition;
+ }
+ else
+#endif /* USE_FONT_BACKEND */
if (VECTORP (components) || CONSP (components))
{
int len = XVECTOR (key)->size;
@@ -307,6 +324,12 @@ get_composition_id (charpos, bytepos, nchars, prop, string)
: ((INTEGERP (components) || STRINGP (components))
? COMPOSITION_WITH_ALTCHARS
: COMPOSITION_WITH_RULE_ALTCHARS));
+#ifdef USE_FONT_BACKEND
+ if (cmp->method == COMPOSITION_WITH_RULE_ALTCHARS
+ && VECTORP (components)
+ && ! INTEGERP (AREF (components, 0)))
+ cmp->method = COMPOSITION_WITH_GLYPH_STRING;
+#endif /* USE_FONT_BACKEND */
cmp->hash_index = hash_index;
glyph_len = (cmp->method == COMPOSITION_WITH_RULE_ALTCHARS
? (XVECTOR (key)->size + 1) / 2
@@ -315,6 +338,14 @@ get_composition_id (charpos, bytepos, nchars, prop, string)
cmp->offsets = (short *) xmalloc (sizeof (short) * glyph_len * 2);
cmp->font = NULL;
+#ifdef USE_FONT_BACKEND
+ if (cmp->method == COMPOSITION_WITH_GLYPH_STRING)
+ {
+ cmp->width = 1; /* Should be fixed later. */
+ cmp->glyph_len--;
+ }
+ else
+#endif /* USE_FONT_BACKEND */
/* Calculate the width of overall glyphs of the composition. */
if (cmp->method != COMPOSITION_WITH_RULE_ALTCHARS)
{
@@ -335,17 +366,17 @@ get_composition_id (charpos, bytepos, nchars, prop, string)
float leftmost = 0.0, rightmost;
ch = XINT (key_contents[0]);
- rightmost = CHAR_WIDTH (ch);
+ rightmost = ch != '\t' ? CHAR_WIDTH (ch) : 1;
for (i = 1; i < glyph_len; i += 2)
{
- int rule, gref, nref;
+ int rule, gref, nref, xoff, yoff;
int this_width;
float this_left;
rule = XINT (key_contents[i]);
ch = XINT (key_contents[i + 1]);
- this_width = CHAR_WIDTH (ch);
+ this_width = ch != '\t' ? CHAR_WIDTH (ch) : 1;
/* A composition rule is specified by an integer value
that encodes global and new reference points (GREF and
@@ -361,7 +392,7 @@ get_composition_id (charpos, bytepos, nchars, prop, string)
| |
6---7---8 -- descent
*/
- COMPOSITION_DECODE_RULE (rule, gref, nref);
+ COMPOSITION_DECODE_RULE (rule, gref, nref, xoff, yoff);
this_left = (leftmost
+ (gref % 3) * (rightmost - leftmost) / 2.0
- (nref % 3) * this_width / 2.0);
@@ -407,7 +438,8 @@ get_composition_id (charpos, bytepos, nchars, prop, string)
int
find_composition (pos, limit, start, end, prop, object)
- int pos, limit, *start, *end;
+ int pos, limit;
+ EMACS_INT *start, *end;
Lisp_Object *prop, object;
{
Lisp_Object val;
@@ -451,7 +483,7 @@ run_composition_function (from, to, prop)
Lisp_Object prop;
{
Lisp_Object func;
- int start, end;
+ EMACS_INT start, end;
func = COMPOSITION_MODIFICATION_FUNC (prop);
/* If an invalid composition precedes or follows, try to make them
@@ -466,24 +498,29 @@ run_composition_function (from, to, prop)
to = end;
if (!NILP (Ffboundp (func)))
call2 (func, make_number (from), make_number (to));
- else if (!NILP (Ffboundp (Vcompose_chars_after_function)))
- call3 (Vcompose_chars_after_function,
- make_number (from), make_number (to), Qnil);
}
/* Make invalid compositions adjacent to or inside FROM and TO valid.
CHECK_MASK is bitwise `or' of mask bits defined by macros
CHECK_XXX (see the comment in composite.h).
+ It also resets the text-property `auto-composed' to a proper region
+ so that automatic character composition works correctly later while
+ displaying the region.
+
This function is called when a buffer text is changed. If the
change is deletion, FROM == TO. Otherwise, FROM < TO. */
void
update_compositions (from, to, check_mask)
- int from, to, check_mask;
+ EMACS_INT from, to;
+ int check_mask;
{
Lisp_Object prop;
- int start, end;
+ EMACS_INT start, end;
+ /* The beginning and end of the region to set the property
+ `auto-composed' to nil. */
+ EMACS_INT min_pos = from, max_pos = to;
if (inhibit_modification_hooks)
return;
@@ -503,6 +540,9 @@ update_compositions (from, to, check_mask)
&& find_composition (from - 1, -1, &start, &end, &prop, Qnil)
&& COMPOSITION_VALID_P (start, end, prop))
{
+ min_pos = start;
+ if (end > to)
+ max_pos = end;
if (from < end)
Fput_text_property (make_number (from), make_number (end),
Qcomposition,
@@ -513,7 +553,11 @@ update_compositions (from, to, check_mask)
else if (from < ZV
&& find_composition (from, -1, &start, &from, &prop, Qnil)
&& COMPOSITION_VALID_P (start, from, prop))
- run_composition_function (start, from, prop);
+ {
+ if (from > to)
+ max_pos = from;
+ run_composition_function (start, from, prop);
+ }
}
if (check_mask & CHECK_INSIDE)
@@ -540,15 +584,33 @@ update_compositions (from, to, check_mask)
To avoid it, in such a case, we change the property of
the former to the copy of it. */
if (to < end)
- Fput_text_property (make_number (start), make_number (to),
- Qcomposition,
- Fcons (XCAR (prop), XCDR (prop)), Qnil);
+ {
+ Fput_text_property (make_number (start), make_number (to),
+ Qcomposition,
+ Fcons (XCAR (prop), XCDR (prop)), Qnil);
+ max_pos = end;
+ }
run_composition_function (start, end, prop);
}
else if (to < ZV
&& find_composition (to, -1, &start, &end, &prop, Qnil)
&& COMPOSITION_VALID_P (start, end, prop))
- run_composition_function (start, end, prop);
+ {
+ run_composition_function (start, end, prop);
+ max_pos = end;
+ }
+ }
+ if (min_pos < max_pos)
+ {
+ int count = SPECPDL_INDEX ();
+
+ specbind (Qinhibit_read_only, Qt);
+ specbind (Qinhibit_modification_hooks, Qt);
+ specbind (Qinhibit_point_motion_hooks, Qt);
+ Fremove_list_of_text_properties (make_number (min_pos),
+ make_number (max_pos),
+ Fcons (Qauto_composed, Qnil), Qnil);
+ unbind_to (count, Qnil);
}
}
@@ -595,7 +657,6 @@ compose_text (start, end, components, modification_func, string)
Fput_text_property (make_number (start), make_number (end),
Qcomposition, prop, string);
}
-
/* Emacs Lisp APIs. */
@@ -653,7 +714,7 @@ See `find-composition' for more detail. */)
Lisp_Object pos, limit, string, detail_p;
{
Lisp_Object prop, tail;
- int start, end;
+ EMACS_INT start, end;
int id;
CHECK_NUMBER_COERCE_MARKER (pos);
@@ -732,12 +793,12 @@ syms_of_composite ()
args[0] = QCtest;
args[1] = Qequal;
+ args[2] = QCweakness;
/* We used to make the hash table weak so that unreferenced
compostions can be garbage-collected. But, usually once
created compositions are repeatedly used in an Emacs session,
and thus it's not worth to save memory in such a way. So, we
make the table not weak. */
- args[2] = QCweakness;
args[3] = Qnil;
args[4] = QCsize;
args[5] = make_number (311);
@@ -763,29 +824,24 @@ valid.
The default value is the function `compose-chars-after'. */);
Vcompose_chars_after_function = intern ("compose-chars-after");
- Qcomposition_function_table = intern ("composition-function-table");
- staticpro (&Qcomposition_function_table);
-
- /* Intern this now in case it isn't already done.
- Setting this variable twice is harmless.
- But don't staticpro it here--that is done in alloc.c. */
- Qchar_table_extra_slots = intern ("char-table-extra-slots");
+ Qauto_composed = intern ("auto-composed");
+ staticpro (&Qauto_composed);
- Fput (Qcomposition_function_table, Qchar_table_extra_slots, make_number (0));
+ Qauto_composition_function = intern ("auto-composition-function");
+ staticpro (&Qauto_composition_function);
- DEFVAR_LISP ("composition-function-table", &Vcomposition_function_table,
- doc: /* Char table of patterns and functions to make a composition.
+ DEFVAR_LISP ("auto-composition-function", &Vauto_composition_function,
+ doc: /* Function to call to compose characters automatically.
+The function is called from the display routine with two arguments,
+POS and STRING.
-Each element is nil or an alist of PATTERNs vs FUNCs, where PATTERNs
-are regular expressions and FUNCs are functions. FUNC is responsible
-for composing text matching the corresponding PATTERN. FUNC is called
-with three arguments FROM, TO, and PATTERN. See the function
-`compose-chars-after' for more detail.
+If STRING is nil, the function must compose characters following POS
+in the current buffer.
-This table is looked up by the first character of a composition when
-the composition gets invalid after a change in a buffer. */);
- Vcomposition_function_table
- = Fmake_char_table (Qcomposition_function_table, Qnil);
+Otherwise, STRING is a string, and POS is an index to the string. In
+this case, the function must compose characters following POS in
+the string. */);
+ Vauto_composition_function = Qnil;
defsubr (&Scompose_region_internal);
defsubr (&Scompose_string_internal);
diff --git a/src/composite.h b/src/composite.h
index ba8f8c8410..5a426826bc 100644
--- a/src/composite.h
+++ b/src/composite.h
@@ -4,6 +4,9 @@
Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
National Institute of Advanced Industrial Science and Technology (AIST)
Registration Number H14PRO021
+ Copyright (C) 2003, 2006
+ National Institute of Advanced Industrial Science and Technology (AIST)
+ Registration Number H13PRO009
This file is part of GNU Emacs.
@@ -25,22 +28,24 @@ Boston, MA 02110-1301, USA. */
#ifndef EMACS_COMPOSITE_H
#define EMACS_COMPOSITE_H
-/* Methods to display a sequence of components a composition. */
+/* Methods to display a sequence of components of a composition. */
enum composition_method {
- /* The first two are actually not methods, but used in code
- conversion to specify the current composing status. */
- COMPOSITION_DISABLED, /* Never handle composition data */
- COMPOSITION_NO, /* Not processing composition data */
/* Compose relatively without alternate characters. */
COMPOSITION_RELATIVE,
- /* Compose by specified composition rule. This is not used in Emacs
- 21 but we need it to decode files saved in the older versions of
- Emacs. */
+ /* Compose by specified composition rules. This is not used in
+ Emacs 21 but we need it to decode files saved in the older
+ versions of Emacs. */
COMPOSITION_WITH_RULE,
/* Compose relatively with alternate characters. */
COMPOSITION_WITH_ALTCHARS,
- /* Compose by specified composition rule with alternate characters. */
- COMPOSITION_WITH_RULE_ALTCHARS
+ /* Compose by specified composition rules with alternate characters. */
+ COMPOSITION_WITH_RULE_ALTCHARS,
+#ifdef USE_FONT_BACKEND
+ /* Compose by specified lispy glyph-string. */
+ COMPOSITION_WITH_GLYPH_STRING,
+#endif /* USE_FONT_BACKEND */
+ /* This is not a method. */
+ COMPOSITION_NO
};
/* Maximum number of compoments a single composition can have. */
@@ -128,13 +133,19 @@ extern Lisp_Object composition_temp;
->contents[(n) * 2 - 1])
/* Decode encoded composition rule RULE_CODE into GREF (global
- reference point code) and NREF (new reference point code). Don't
- check RULE_CODE, always set GREF and NREF to valid values. */
-#define COMPOSITION_DECODE_RULE(rule_code, gref, nref) \
- do { \
- gref = (rule_code) / 12; \
- if (gref > 12) gref = 11; \
- nref = (rule_code) % 12; \
+ reference point code), NREF (new reference point code), XOFF
+ (horizontal offset) YOFF (vertical offset). Don't check RULE_CODE,
+ always set GREF and NREF to valid values. By side effect,
+ RULE_CODE is modified. */
+
+#define COMPOSITION_DECODE_RULE(rule_code, gref, nref, xoff, yoff) \
+ do { \
+ xoff = (rule_code) >> 16; \
+ yoff = ((rule_code) >> 8) & 0xFF; \
+ rule_code &= 0xFF; \
+ gref = (rule_code) / 12; \
+ if (gref > 12) gref = 11; \
+ nref = (rule_code) % 12; \
} while (0)
/* Return encoded composition rule for the pair of global reference
@@ -161,6 +172,8 @@ struct composition {
/* Width, ascent, and descent pixels of the composition. */
short pixel_width, ascent, descent;
+ short lbearing, rbearing;
+
/* How many columns the overall glyphs occupy on the screen. This
gives an approximate value for column calculation in
Fcurrent_column, and etc. */
@@ -200,11 +213,14 @@ extern int n_compositions;
extern Lisp_Object Qcomposition;
extern Lisp_Object composition_hash_table;
+extern Lisp_Object Qauto_composed;
+extern Lisp_Object Vauto_composition_function;
+extern Lisp_Object Qauto_composition_function;
extern int get_composition_id P_ ((int, int, int, Lisp_Object, Lisp_Object));
-extern int find_composition P_ ((int, int, int *, int *, Lisp_Object *,
+extern int find_composition P_ ((int, int, EMACS_INT *, EMACS_INT *, Lisp_Object *,
Lisp_Object));
-extern void update_compositions P_ ((int, int, int));
+extern void update_compositions P_ ((EMACS_INT, EMACS_INT, int));
extern void make_composition_value_copy P_ ((Lisp_Object));
extern void compose_region P_ ((int, int, Lisp_Object, Lisp_Object,
Lisp_Object));
diff --git a/src/config.in b/src/config.in
index ed3a6b8f27..f2636c5062 100644
--- a/src/config.in
+++ b/src/config.in
@@ -156,6 +156,9 @@ Boston, MA 02110-1301, USA. */
/* Define to 1 if you have the `fpathconf' function. */
#undef HAVE_FPATHCONF
+/* Define to 1 if you have freetype and fontconfig libraries. */
+#undef HAVE_FREETYPE
+
/* Define to 1 if you have the `frexp' function. */
#undef HAVE_FREXP
@@ -346,6 +349,9 @@ Boston, MA 02110-1301, USA. */
/* Define to 1 if you have the `ncurses' library (-lncurses). */
#undef HAVE_LIBNCURSES
+/* Define to 1 if you have libotf library. */
+#undef HAVE_LIBOTF
+
/* Define to 1 if you have the <libpng/png.h> header file. */
#undef HAVE_LIBPNG_PNG_H
@@ -723,6 +729,9 @@ Boston, MA 02110-1301, USA. */
/* Define to 1 if you have the Xft library. */
#undef HAVE_XFT
+/* Define to 1 if you have the Xft library. */
+#undef HAVE_XFT
+
/* Define to 1 if XIM is available */
#undef HAVE_XIM
@@ -847,6 +856,9 @@ Boston, MA 02110-1301, USA. */
/* Define to the unexec source file name. */
#undef UNEXEC_SRC
+/* Define to 1 if we should use font-backend. */
+#undef USE_FONT_BACKEND
+
/* Define to 1 if we should use toolkit scroll bars. */
#undef USE_TOOLKIT_SCROLL_BARS
@@ -929,13 +941,6 @@ Boston, MA 02110-1301, USA. */
#define HAVE_MOUSE
#endif
-/* Multi-tty support relies on MULTI_KBOARD. It seems safe to turn it
- on unconditionally. Note that src/s/darwin.h disables this at
- present. */
-#ifndef MULTI_KBOARD
-#define MULTI_KBOARD
-#endif
-
/* If we're using the Carbon API on Mac OS X, define a few more
variables as well. */
#ifdef HAVE_CARBON
diff --git a/src/data.c b/src/data.c
index dfc0c35705..b262f6e2b9 100644
--- a/src/data.c
+++ b/src/data.c
@@ -25,12 +25,11 @@ Boston, MA 02110-1301, USA. */
#include <stdio.h>
#include "lisp.h"
#include "puresize.h"
-#include "charset.h"
+#include "character.h"
#include "buffer.h"
#include "keyboard.h"
#include "frame.h"
#include "syssignal.h"
-#include "termhooks.h" /* For FRAME_KBOARD reference in y-or-n-p. */
#ifdef STDC_HEADERS
#include <float.h>
@@ -116,7 +115,7 @@ wrong_type_argument (predicate, value)
{
/* If VALUE is not even a valid Lisp object, abort here
where we can get a backtrace showing where it came from. */
- if ((unsigned int) XGCTYPE (value) >= Lisp_Type_Limit)
+ if ((unsigned int) XTYPE (value) >= Lisp_Type_Limit)
abort ();
xsignal2 (Qwrong_type_argument, predicate, value);
@@ -188,7 +187,7 @@ for example, (type-of 1) returns `integer'. */)
(object)
Lisp_Object object;
{
- switch (XGCTYPE (object))
+ switch (XTYPE (object))
{
case Lisp_Int:
return Qinteger;
@@ -215,25 +214,25 @@ for example, (type-of 1) returns `integer'. */)
abort ();
case Lisp_Vectorlike:
- if (GC_WINDOW_CONFIGURATIONP (object))
+ if (WINDOW_CONFIGURATIONP (object))
return Qwindow_configuration;
- if (GC_PROCESSP (object))
+ if (PROCESSP (object))
return Qprocess;
- if (GC_WINDOWP (object))
+ if (WINDOWP (object))
return Qwindow;
- if (GC_SUBRP (object))
+ if (SUBRP (object))
return Qsubr;
- if (GC_COMPILEDP (object))
+ if (COMPILEDP (object))
return Qcompiled_function;
- if (GC_BUFFERP (object))
+ if (BUFFERP (object))
return Qbuffer;
- if (GC_CHAR_TABLE_P (object))
+ if (CHAR_TABLE_P (object))
return Qchar_table;
- if (GC_BOOL_VECTOR_P (object))
+ if (BOOL_VECTOR_P (object))
return Qbool_vector;
- if (GC_FRAMEP (object))
+ if (FRAMEP (object))
return Qframe;
- if (GC_HASH_TABLE_P (object))
+ if (HASH_TABLE_P (object))
return Qhash_table;
return Qvector;
@@ -436,11 +435,11 @@ DEFUN ("byte-code-function-p", Fbyte_code_function_p, Sbyte_code_function_p,
}
DEFUN ("char-or-string-p", Fchar_or_string_p, Schar_or_string_p, 1, 1, 0,
- doc: /* Return t if OBJECT is a character (an integer) or a string. */)
+ doc: /* Return t if OBJECT is a character or a string. */)
(object)
register Lisp_Object object;
{
- if (INTEGERP (object) || STRINGP (object))
+ if (CHARACTERP (object) || STRINGP (object))
return Qt;
return Qnil;
}
@@ -770,11 +769,8 @@ Value, if non-nil, is a list \(interactive SPEC). */)
if (SUBRP (fun))
{
- char *spec = XSUBR (fun)->intspec;
- if (spec)
- return list2 (Qinteractive,
- (*spec != '(') ? build_string (spec) :
- Fcar (Fread_from_string (build_string (spec), Qnil, Qnil)));
+ if (XSUBR (fun)->prompt)
+ return list2 (Qinteractive, build_string (XSUBR (fun)->prompt));
}
else if (COMPILEDP (fun))
{
@@ -877,18 +873,7 @@ do_symval_forwarding (valcontents)
case Lisp_Misc_Kboard_Objfwd:
offset = XKBOARD_OBJFWD (valcontents)->offset;
- /* We used to simply use current_kboard here, but from Lisp
- code, it's value is often unexpected. It seems nicer to
- allow constructions like this to work as intuitively expected:
-
- (with-selected-frame frame
- (define-key local-function-map "\eOP" [f1]))
-
- On the other hand, this affects the semantics of
- last-command and real-last-command, and people may rely on
- that. I took a quick look at the Lisp codebase, and I
- don't think anything will break. --lorentey */
- return *(Lisp_Object *)(offset + (char *)FRAME_KBOARD (SELECTED_FRAME ()));
+ return *(Lisp_Object *)(offset + (char *)current_kboard);
}
return valcontents;
}
@@ -976,7 +961,7 @@ store_symval_forwarding (symbol, valcontents, newval, buf)
case Lisp_Misc_Kboard_Objfwd:
{
- char *base = (char *) FRAME_KBOARD (SELECTED_FRAME ());
+ char *base = (char *) current_kboard;
char *p = base + XKBOARD_OBJFWD (valcontents)->offset;
*(Lisp_Object *) p = newval;
}
@@ -1122,7 +1107,7 @@ find_symbol_value (symbol)
case Lisp_Misc_Kboard_Objfwd:
return *(Lisp_Object *)(XKBOARD_OBJFWD (valcontents)->offset
- + (char *)FRAME_KBOARD (SELECTED_FRAME ()));
+ + (char *)current_kboard);
}
}
@@ -1883,51 +1868,6 @@ If the current binding is global (the default), the value is nil. */)
return Qnil;
}
-
-/* This code is disabled now that we use the selected frame to return
- keyboard-local-values. */
-#if 0
-extern struct terminal *get_terminal P_ ((Lisp_Object display, int));
-
-DEFUN ("terminal-local-value", Fterminal_local_value, Sterminal_local_value, 2, 2, 0,
- doc: /* Return the terminal-local value of SYMBOL on TERMINAL.
-If SYMBOL is not a terminal-local variable, then return its normal
-value, like `symbol-value'.
-
-TERMINAL may be a terminal id, a frame, or nil (meaning the
-selected frame's terminal device). */)
- (symbol, terminal)
- Lisp_Object symbol;
- Lisp_Object terminal;
-{
- Lisp_Object result;
- struct terminal *t = get_terminal (terminal, 1);
- push_kboard (t->kboard);
- result = Fsymbol_value (symbol);
- pop_kboard ();
- return result;
-}
-
-DEFUN ("set-terminal-local-value", Fset_terminal_local_value, Sset_terminal_local_value, 3, 3, 0,
- doc: /* Set the terminal-local binding of SYMBOL on TERMINAL to VALUE.
-If VARIABLE is not a terminal-local variable, then set its normal
-binding, like `set'.
-
-TERMINAL may be a terminal id, a frame, or nil (meaning the
-selected frame's terminal device). */)
- (symbol, terminal, value)
- Lisp_Object symbol;
- Lisp_Object terminal;
- Lisp_Object value;
-{
- Lisp_Object result;
- struct terminal *t = get_terminal (terminal, 1);
- push_kboard (d->kboard);
- result = Fset (symbol, value);
- pop_kboard ();
- return result;
-}
-#endif
/* Find the function at the end of a chain of symbol function indirections. */
@@ -2032,96 +1972,8 @@ or a byte-code object. IDX starts at 0. */)
}
else if (CHAR_TABLE_P (array))
{
- Lisp_Object val;
-
- val = Qnil;
-
- if (idxval < 0)
- args_out_of_range (array, idx);
- if (idxval < CHAR_TABLE_ORDINARY_SLOTS)
- {
- if (! SINGLE_BYTE_CHAR_P (idxval))
- args_out_of_range (array, idx);
- /* For ASCII and 8-bit European characters, the element is
- stored in the top table. */
- val = XCHAR_TABLE (array)->contents[idxval];
- if (NILP (val))
- {
- int default_slot
- = (idxval < 0x80 ? CHAR_TABLE_DEFAULT_SLOT_ASCII
- : idxval < 0xA0 ? CHAR_TABLE_DEFAULT_SLOT_8_BIT_CONTROL
- : CHAR_TABLE_DEFAULT_SLOT_8_BIT_GRAPHIC);
- val = XCHAR_TABLE (array)->contents[default_slot];
- }
- if (NILP (val))
- val = XCHAR_TABLE (array)->defalt;
- while (NILP (val)) /* Follow parents until we find some value. */
- {
- array = XCHAR_TABLE (array)->parent;
- if (NILP (array))
- return Qnil;
- val = XCHAR_TABLE (array)->contents[idxval];
- if (NILP (val))
- val = XCHAR_TABLE (array)->defalt;
- }
- return val;
- }
- else
- {
- int code[4], i;
- Lisp_Object sub_table;
- Lisp_Object current_default;
-
- SPLIT_CHAR (idxval, code[0], code[1], code[2]);
- if (code[1] < 32) code[1] = -1;
- else if (code[2] < 32) code[2] = -1;
-
- /* Here, the possible range of CODE[0] (== charset ID) is
- 128..MAX_CHARSET. Since the top level char table contains
- data for multibyte characters after 256th element, we must
- increment CODE[0] by 128 to get a correct index. */
- code[0] += 128;
- code[3] = -1; /* anchor */
-
- try_parent_char_table:
- current_default = XCHAR_TABLE (array)->defalt;
- sub_table = array;
- for (i = 0; code[i] >= 0; i++)
- {
- val = XCHAR_TABLE (sub_table)->contents[code[i]];
- if (SUB_CHAR_TABLE_P (val))
- {
- sub_table = val;
- if (! NILP (XCHAR_TABLE (sub_table)->defalt))
- current_default = XCHAR_TABLE (sub_table)->defalt;
- }
- else
- {
- if (NILP (val))
- val = current_default;
- if (NILP (val))
- {
- array = XCHAR_TABLE (array)->parent;
- if (!NILP (array))
- goto try_parent_char_table;
- }
- return val;
- }
- }
- /* Reaching here means IDXVAL is a generic character in
- which each character or a group has independent value.
- Essentially it's nonsense to get a value for such a
- generic character, but for backward compatibility, we try
- the default value and parent. */
- val = current_default;
- if (NILP (val))
- {
- array = XCHAR_TABLE (array)->parent;
- if (!NILP (array))
- goto try_parent_char_table;
- }
- return val;
- }
+ CHECK_CHARACTER (idx);
+ return CHAR_TABLE_REF (array, idxval);
}
else
{
@@ -2177,45 +2029,8 @@ bool-vector. IDX starts at 0. */)
}
else if (CHAR_TABLE_P (array))
{
- if (idxval < 0)
- args_out_of_range (array, idx);
- if (idxval < CHAR_TABLE_ORDINARY_SLOTS)
- {
- if (! SINGLE_BYTE_CHAR_P (idxval))
- args_out_of_range (array, idx);
- XCHAR_TABLE (array)->contents[idxval] = newelt;
- }
- else
- {
- int code[4], i;
- Lisp_Object val;
-
- SPLIT_CHAR (idxval, code[0], code[1], code[2]);
- if (code[1] < 32) code[1] = -1;
- else if (code[2] < 32) code[2] = -1;
-
- /* See the comment of the corresponding part in Faref. */
- code[0] += 128;
- code[3] = -1; /* anchor */
- for (i = 0; code[i + 1] >= 0; i++)
- {
- val = XCHAR_TABLE (array)->contents[code[i]];
- if (SUB_CHAR_TABLE_P (val))
- array = val;
- else
- {
- Lisp_Object temp;
-
- /* VAL is a leaf. Create a sub char table with the
- initial value VAL and look into it. */
-
- temp = make_sub_char_table (val);
- XCHAR_TABLE (array)->contents[code[i]] = temp;
- array = temp;
- }
- }
- XCHAR_TABLE (array)->contents[code[i]] = newelt;
- }
+ CHECK_CHARACTER (idx);
+ CHAR_TABLE_SET (array, idxval, newelt);
}
else if (STRING_MULTIBYTE (array))
{
@@ -2224,7 +2039,7 @@ bool-vector. IDX starts at 0. */)
if (idxval < 0 || idxval >= SCHARS (array))
args_out_of_range (array, idx);
- CHECK_NUMBER (newelt);
+ CHECK_CHARACTER (newelt);
nbytes = SBYTES (array);
@@ -2259,38 +2074,9 @@ bool-vector. IDX starts at 0. */)
args_out_of_range (array, idx);
CHECK_NUMBER (newelt);
- if (XINT (newelt) < 0 || SINGLE_BYTE_CHAR_P (XINT (newelt)))
- SSET (array, idxval, XINT (newelt));
- else
- {
- /* We must relocate the string data while converting it to
- multibyte. */
- int idxval_byte, prev_bytes, new_bytes;
- unsigned char workbuf[MAX_MULTIBYTE_LENGTH], *p0 = workbuf, *p1;
- unsigned char *origstr = SDATA (array), *str;
- int nchars, nbytes;
- USE_SAFE_ALLOCA;
-
- nchars = SCHARS (array);
- nbytes = idxval_byte = count_size_as_multibyte (origstr, idxval);
- nbytes += count_size_as_multibyte (origstr + idxval,
- nchars - idxval);
- SAFE_ALLOCA (str, unsigned char *, nbytes);
- copy_text (SDATA (array), str, nchars, 0, 1);
- PARSE_MULTIBYTE_SEQ (str + idxval_byte, nbytes - idxval_byte,
- prev_bytes);
- new_bytes = CHAR_STRING (XINT (newelt), p0);
- allocate_string_data (XSTRING (array), nchars,
- nbytes + new_bytes - prev_bytes);
- bcopy (str, SDATA (array), idxval_byte);
- p1 = SDATA (array) + idxval_byte;
- while (new_bytes--)
- *p1++ = *p0++;
- bcopy (str + idxval_byte + prev_bytes, p1,
- nbytes - (idxval_byte + prev_bytes));
- SAFE_FREE ();
- clear_string_char_byte_cache ();
- }
+ if (XINT (newelt) >= 0 && ! SINGLE_BYTE_CHAR_P (XINT (newelt)))
+ args_out_of_range (array, newelt);
+ SSET (array, idxval, XINT (newelt));
}
return newelt;
@@ -3387,10 +3173,6 @@ syms_of_data ()
defsubr (&Slocal_variable_p);
defsubr (&Slocal_variable_if_set_p);
defsubr (&Svariable_binding_locus);
-#if 0 /* XXX Remove this. --lorentey */
- defsubr (&Sterminal_local_value);
- defsubr (&Sset_terminal_local_value);
-#endif
defsubr (&Saref);
defsubr (&Saset);
defsubr (&Snumber_to_string);
diff --git a/src/dired.c b/src/dired.c
index 1fb5387268..b362eec62b 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -96,6 +96,7 @@ extern struct direct *readdir ();
#include "systime.h"
#include "buffer.h"
#include "commands.h"
+#include "character.h"
#include "charset.h"
#include "coding.h"
#include "regex.h"
diff --git a/src/dispextern.h b/src/dispextern.h
index f4ce7f4347..6241b5aa2c 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -852,6 +852,10 @@ struct glyph_row
/* Continuation lines width at the start of the row. */
int continuation_lines_width;
+
+ /* Non-NULL means the current clipping area. This is temporarily
+ set while exposing a region. Coordinates are frame-relative. */
+ XRectangle *clip;
};
@@ -1029,8 +1033,13 @@ extern int fonts_changed_p;
extern struct glyph space_glyph;
+/* Frame being updated by update_window/update_frame. */
+
+extern struct frame *updating_frame;
+
/* Window being updated by update_window. This is non-null as long as
- update_window has not finished, and null otherwise. */
+ update_window has not finished, and null otherwise. It's role is
+ analogous to updating_frame. */
extern struct window *updated_window;
@@ -1215,6 +1224,14 @@ struct glyph_string
*clip_tail, not including their overhangs. */
struct glyph_string *clip_head, *clip_tail;
+#ifdef USE_FONT_BACKEND
+ /* The current clipping areas. */
+ NativeRectangle clip[2];
+
+ /* Number of clipping areas. */
+ int num_clips;
+#endif /* USE_FONT_BACKEND */
+
struct glyph_string *next, *prev;
};
@@ -1350,7 +1367,7 @@ struct glyph_string
DESCENT = FONT->descent
HEIGHT = FONT_HEIGHT (FONT)
F_DESCENT = (FRAME_FONT (F)->descent
- - F->terminal->output_data.x->baseline_offset)
+ - F->output_data.x->baseline_offset)
F_HEIGHT = FRAME_LINE_HEIGHT (F)
*/
@@ -1386,6 +1403,7 @@ enum lface_attribute_index
LFACE_FONT_INDEX,
LFACE_INHERIT_INDEX,
LFACE_AVGWIDTH_INDEX,
+ LFACE_FONTSET_INDEX,
LFACE_VECTOR_SIZE
};
@@ -1470,10 +1488,12 @@ struct face
reallocated. */
int font_info_id;
- /* Fontset ID if this face uses a fontset, or -1. This is only >= 0
- if the face was realized for a composition sequence.
- Otherwise, a specific font is loaded from the set of fonts
- specified by the fontset given by the family attribute of the face. */
+#ifdef USE_FONT_BACKEND
+ struct font_info *font_info;
+#endif /* USE_FONT_BACKEND */
+
+ /* Fontset ID if for this face's fontset. Non-ASCII faces derived
+ from the same ASCII face have the same fontset. */
int fontset;
/* Pixmap width and height. */
@@ -1505,13 +1525,6 @@ struct face
/* The hash value of this face. */
unsigned hash;
- /* The charset for which this face was realized if it was realized
- for use in multibyte text. If fontset >= 0, this is the charset
- of the first character of the composition sequence. A value of
- charset < 0 means the face was realized for use in unibyte text
- where the idea of Emacs charsets isn't applicable. */
- int charset;
-
/* Non-zero if text in this face should be underlined, overlined,
strike-through or have a box drawn around it. */
unsigned underline_p : 1;
@@ -1557,9 +1570,15 @@ struct face
/* Next and previous face in hash collision list of face cache. */
struct face *next, *prev;
- /* If this face is for ASCII characters, this points this face
- itself. Otherwise, this points a face for ASCII characters. */
+ /* If this face is an ASCII face, this points to this face itself.
+ Otherwise, this points to an ASCII face that has the same
+ attributes except the font. */
struct face *ascii_face;
+
+#ifdef USE_FONT_BACKEND
+ /* Extra member that a font-driver uses privately. */
+ void *extra;
+#endif /* USE_FONT_BACKEND */
};
@@ -1647,7 +1666,7 @@ struct face_cache
/* Non-zero if FACE is suitable for displaying character CHAR. */
#define FACE_SUITABLE_FOR_CHAR_P(FACE, CHAR) \
- (SINGLE_BYTE_CHAR_P (CHAR) \
+ (ASCII_CHAR_P (CHAR) \
? (FACE) == (FACE)->ascii_face \
: face_suitable_for_char_p ((FACE), (CHAR)))
@@ -1655,15 +1674,15 @@ struct face_cache
with id ID but is suitable for displaying character CHAR.
This macro is only meaningful for multibyte character CHAR. */
-#define FACE_FOR_CHAR(F, FACE, CHAR) \
- (SINGLE_BYTE_CHAR_P (CHAR) \
- ? (FACE)->ascii_face->id \
- : face_for_char ((F), (FACE), (CHAR)))
+#define FACE_FOR_CHAR(F, FACE, CHAR, POS, OBJECT) \
+ (ASCII_CHAR_P (CHAR) \
+ ? (FACE)->ascii_face->id \
+ : face_for_char ((F), (FACE), (CHAR), (POS), (OBJECT)))
#else /* not HAVE_WINDOW_SYSTEM */
#define FACE_SUITABLE_FOR_CHAR_P(FACE, CHAR) 1
-#define FACE_FOR_CHAR(F, FACE, CHAR) ((FACE)->id)
+#define FACE_FOR_CHAR(F, FACE, CHAR, POS, OBJECT) ((FACE)->id)
#endif /* not HAVE_WINDOW_SYSTEM */
@@ -1781,6 +1800,7 @@ enum display_element_type
enum prop_idx
{
+ AUTO_COMPOSED_PROP_IDX,
FONTIFIED_PROP_IDX,
FACE_PROP_IDX,
INVISIBLE_PROP_IDX,
@@ -2179,16 +2199,16 @@ struct it
/* Call produce_glyphs or produce_glyphs_hook, if set. Shortcut to
avoid the function call overhead. */
-#define PRODUCE_GLYPHS(IT) \
- do { \
- extern int inhibit_free_realized_faces; \
- if (FRAME_RIF ((IT)->f) != NULL) \
- FRAME_RIF ((IT)->f)->produce_glyphs ((IT)); \
- else \
- produce_glyphs ((IT)); \
- if ((IT)->glyph_row != NULL) \
- inhibit_free_realized_faces = 1; \
- } while (0)
+#define PRODUCE_GLYPHS(IT) \
+ do { \
+ extern int inhibit_free_realized_faces; \
+ if (rif != NULL) \
+ rif->produce_glyphs ((IT)); \
+ else \
+ produce_glyphs ((IT)); \
+ if ((IT)->glyph_row != NULL) \
+ inhibit_free_realized_faces = 1; \
+ } while (0)
/* Bit-flags indicating what operation move_it_to should perform. */
@@ -2322,7 +2342,9 @@ struct redisplay_interface
the two-byte form of C. Encoding is returned in *CHAR2B. If
TWO_BYTE_P is non-null, return non-zero there if font is two-byte. */
int (*encode_char) P_ ((int c, XChar2b *char2b,
- struct font_info *font_into, int *two_byte_p));
+ struct font_info *font_into,
+ struct charset *charset,
+ int *two_byte_p));
/* Compute left and right overhang of glyph string S.
A NULL pointer if platform does not support this. */
@@ -2362,6 +2384,10 @@ struct redisplay_interface
#endif /* HAVE_WINDOW_SYSTEM */
};
+/* The current interface for window-based redisplay. */
+
+extern struct redisplay_interface *rif;
+
/***********************************************************************
Images
@@ -2665,6 +2691,8 @@ void init_iterator_to_row_start P_ ((struct it *, struct window *,
struct glyph_row *));
int get_next_display_element P_ ((struct it *));
void set_iterator_to_next P_ ((struct it *, int));
+void produce_glyphs P_ ((struct it *));
+void produce_special_glyphs P_ ((struct it *, enum display_element_type));
void start_display P_ ((struct it *, struct window *, struct text_pos));
void move_it_to P_ ((struct it *, int, int, int, int, int));
void move_it_vertically P_ ((struct it *, int));
@@ -2762,11 +2790,11 @@ int update_window_fringes P_ ((struct window *, int));
void compute_fringe_widths P_ ((struct frame *, int));
#ifdef WINDOWS_NT
-void w32_init_fringe P_ ((struct redisplay_interface *));
+void w32_init_fringe P_ ((void));
void w32_reset_fringes P_ ((void));
#endif
#ifdef MAC_OS
-void mac_init_fringe P_ ((struct redisplay_interface *));
+void mac_init_fringe P_ ((void));
#endif
/* Defined in image.c */
@@ -2811,11 +2839,11 @@ int image_ascent P_ ((struct image *, struct face *, struct glyph_slice *));
/* Defined in sysdep.c */
-void get_tty_size P_ ((int, int *, int *));
+void get_frame_size P_ ((int *, int *));
void request_sigio P_ ((void));
void unrequest_sigio P_ ((void));
-int tabs_safe_p P_ ((int));
-void init_baud_rate P_ ((int));
+int tabs_safe_p P_ ((void));
+void init_baud_rate P_ ((void));
void init_sigio P_ ((int));
/* Defined in xfaces.c */
@@ -2831,15 +2859,17 @@ void clear_face_cache P_ ((int));
unsigned long load_color P_ ((struct frame *, struct face *, Lisp_Object,
enum lface_attribute_index));
void unload_color P_ ((struct frame *, unsigned long));
-int face_font_available_p P_ ((struct frame *, Lisp_Object));
+char *choose_face_font P_ ((struct frame *, Lisp_Object *, Lisp_Object,
+ int *));
int ascii_face_of_lisp_face P_ ((struct frame *, int));
void prepare_face_for_display P_ ((struct frame *, struct face *));
int xstricmp P_ ((const unsigned char *, const unsigned char *));
-int lookup_face P_ ((struct frame *, Lisp_Object *, int, struct face *));
-int lookup_named_face P_ ((struct frame *, Lisp_Object, int, int));
+int lookup_face P_ ((struct frame *, Lisp_Object *));
+int lookup_non_ascii_face P_ ((struct frame *, int, struct face *));
+int lookup_named_face P_ ((struct frame *, Lisp_Object, int));
int smaller_face P_ ((struct frame *, int, int));
int face_with_height P_ ((struct frame *, int, int));
-int lookup_derived_face P_ ((struct frame *, Lisp_Object, int, int, int));
+int lookup_derived_face P_ ((struct frame *, Lisp_Object, int, int));
void init_frame_faces P_ ((struct frame *));
void free_frame_faces P_ ((struct frame *));
void recompute_basic_faces P_ ((struct frame *));
@@ -2850,10 +2880,12 @@ int face_at_string_position P_ ((struct window *, Lisp_Object, int, int, int,
int merge_faces P_ ((struct frame *, Lisp_Object, int, int));
int compute_char_face P_ ((struct frame *, int, Lisp_Object));
void free_all_realized_faces P_ ((Lisp_Object));
+void free_realized_face P_ ((struct frame *, struct face *));
extern Lisp_Object Qforeground_color, Qbackground_color;
extern Lisp_Object Qframe_set_background_mode;
extern char unspecified_fg[], unspecified_bg[];
-void free_realized_multibyte_face P_ ((struct frame *, int));
+extern Lisp_Object split_font_name_into_vector P_ ((Lisp_Object));
+extern Lisp_Object build_font_name_from_vector P_ ((Lisp_Object));
/* Defined in xfns.c */
@@ -2954,6 +2986,8 @@ void clear_glyph_row P_ ((struct glyph_row *));
void prepare_desired_row P_ ((struct glyph_row *));
int line_hash_code P_ ((struct glyph_row *));
void set_window_update_flags P_ ((struct window *, int));
+void write_glyphs P_ ((struct glyph *, int));
+void insert_glyphs P_ ((struct glyph *, int));
void redraw_frame P_ ((struct frame *));
void redraw_garbaged_frames P_ ((void));
int scroll_cost P_ ((struct frame *, int, int, int));
@@ -2970,44 +3004,31 @@ void syms_of_display P_ ((void));
extern Lisp_Object Qredisplay_dont_pause;
GLYPH spec_glyph_lookup_face P_ ((struct window *, GLYPH));
-/* Defined in terminal.c */
+/* Defined in term.c */
-extern void ring_bell P_ ((struct frame *));
+extern void ring_bell P_ ((void));
+extern void set_terminal_modes P_ ((void));
+extern void reset_terminal_modes P_ ((void));
extern void update_begin P_ ((struct frame *));
extern void update_end P_ ((struct frame *));
-extern void set_terminal_window P_ ((struct frame *, int));
-extern void cursor_to P_ ((struct frame *, int, int));
-extern void raw_cursor_to P_ ((struct frame *, int, int));
-extern void clear_to_end P_ ((struct frame *));
-extern void clear_frame P_ ((struct frame *));
-extern void clear_end_of_line P_ ((struct frame *, int));
-extern void write_glyphs P_ ((struct frame *, struct glyph *, int));
-extern void insert_glyphs P_ ((struct frame *, struct glyph *, int));
-extern void delete_glyphs P_ ((struct frame *, int));
-extern void ins_del_lines P_ ((struct frame *, int, int));
-
-extern struct terminal *init_initial_terminal P_ ((void));
-
-
-/* Defined in term.c */
-
-extern void tty_set_terminal_modes P_ ((struct terminal *));
-extern void tty_reset_terminal_modes P_ ((struct terminal *));
-extern void tty_turn_off_insert P_ ((struct tty_display_info *));
-extern void tty_turn_off_highlight P_ ((struct tty_display_info *));
+extern void set_terminal_window P_ ((int));
+extern void set_scroll_region P_ ((int, int));
+extern void turn_off_insert P_ ((void));
+extern void turn_off_highlight P_ ((void));
+extern void background_highlight P_ ((void));
+extern void clear_frame P_ ((void));
+extern void clear_end_of_line P_ ((int));
+extern void clear_end_of_line_raw P_ ((int));
+extern void delete_glyphs P_ ((int));
+extern void ins_del_lines P_ ((int, int));
extern int string_cost P_ ((char *));
extern int per_line_cost P_ ((char *));
extern void calculate_costs P_ ((struct frame *));
-extern void produce_glyphs P_ ((struct it *));
-extern void produce_special_glyphs P_ ((struct it *, enum display_element_type));
-extern int tty_capable_p P_ ((struct tty_display_info *, unsigned, unsigned long, unsigned long));
extern void set_tty_color_mode P_ ((struct frame *, Lisp_Object));
-extern struct terminal *get_tty_terminal P_ ((Lisp_Object, int));
-extern struct terminal *get_named_tty P_ ((char *));
-EXFUN (Ftty_type, 1);
-extern void create_tty_output P_ ((struct frame *));
-extern struct terminal *init_tty P_ ((char *, char *, int));
-
+extern void tty_setup_colors P_ ((int));
+extern void term_init P_ ((char *));
+void cursor_to P_ ((int, int));
+extern int tty_capable_p P_ ((struct frame *, unsigned, unsigned long, unsigned long));
/* Defined in scroll.c */
diff --git a/src/dispnew.c b/src/dispnew.c
index 7a80a8a618..02d0663b56 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -32,14 +32,14 @@ Boston, MA 02110-1301, USA. */
#include "lisp.h"
#include "termchar.h"
#include "termopts.h"
+#include "termhooks.h"
/* cm.h must come after dispextern.h on Windows. */
#include "dispextern.h"
#include "cm.h"
#include "buffer.h"
-#include "charset.h"
+#include "character.h"
#include "keyboard.h"
#include "frame.h"
-#include "termhooks.h"
#include "window.h"
#include "commands.h"
#include "disptab.h"
@@ -238,9 +238,9 @@ int inverse_video;
EMACS_INT baud_rate;
/* Either nil or a symbol naming the window system under which Emacs
- creates the first frame. */
+ is running. */
-Lisp_Object Vinitial_window_system;
+Lisp_Object Vwindow_system;
/* Version number of X windows: 10, 11 or nil. */
@@ -282,6 +282,14 @@ Lisp_Object selected_frame;
struct frame *last_nonminibuf_frame;
+/* Stdio stream being used for copy of all output. */
+
+FILE *termscript;
+
+/* Structure for info on cursor positioning. */
+
+struct cm Wcm;
+
/* 1 means SIGWINCH happened when not safe. */
int delayed_size_change;
@@ -320,6 +328,11 @@ int glyph_pool_count;
static struct frame *frame_matrix_frame;
+/* Current interface for window-based redisplay. Set from init_xterm.
+ A null value means we are not using window-based redisplay. */
+
+struct redisplay_interface *rif;
+
/* Non-zero means that fonts have been loaded since the last glyph
matrix adjustments. Redisplay must stop, and glyph matrices must
be adjusted when this flag becomes non-zero during display. The
@@ -1410,7 +1423,7 @@ line_hash_code (row)
{
int c = glyph->u.ch;
int face_id = glyph->face_id;
- if (FRAME_MUST_WRITE_SPACES (SELECTED_FRAME ())) /* XXX Is SELECTED_FRAME OK here? */
+ if (must_write_spaces)
c -= SPACEGLYPH;
hash = (((hash << 4) + (hash >> 24)) & 0x0fffffff) + c;
hash = (((hash << 4) + (hash >> 24)) & 0x0fffffff) + face_id;
@@ -1442,7 +1455,7 @@ line_draw_cost (matrix, vpos)
int glyph_table_len = GLYPH_TABLE_LENGTH;
/* Ignore trailing and leading spaces if we can. */
- if (!FRAME_MUST_WRITE_SPACES (SELECTED_FRAME ())) /* XXX Is SELECTED_FRAME OK here? */
+ if (!must_write_spaces)
{
/* Skip from the end over trailing spaces. */
while (end > beg && CHAR_GLYPH_SPACE_P (*(end - 1)))
@@ -1658,10 +1671,8 @@ realloc_glyph_pool (pool, matrix_dim)
#if GLYPH_DEBUG
-/* Flush standard output. This is sometimes useful to call from the debugger.
- XXX Maybe this should be changed to flush the current terminal instead of
- stdout.
-*/
+/* Flush standard output. This is sometimes useful to call from
+ the debugger. */
void
flush_stdout ()
@@ -3382,15 +3393,12 @@ DEFUN ("redraw-frame", Fredraw_frame, Sredraw_frame, 1, 1, 0,
return Qnil;
update_begin (f);
-#ifdef MSDOS
if (FRAME_MSDOS_P (f))
- set_terminal_modes (FRAME_TERMINAL (f));
-#endif
- clear_frame (f);
+ set_terminal_modes ();
+ clear_frame ();
clear_current_matrices (f);
update_end (f);
- if (FRAME_TERMCAP_P (f))
- fflush (FRAME_TTY (f)->output);
+ fflush (stdout);
windows_or_buffers_changed++;
/* Mark all windows as inaccurate, so that every window will have
its redisplay done. */
@@ -3531,7 +3539,7 @@ direct_output_for_insert (g)
/* If we can't insert glyphs, we can use this method only
at the end of a line. */
- if (!FRAME_CHAR_INS_DEL_OK (f))
+ if (!char_ins_del_ok)
if (PT != ZV && FETCH_BYTE (PT_BYTE) != '\n')
return 0;
@@ -3681,24 +3689,24 @@ direct_output_for_insert (g)
updated_row = glyph_row;
updated_area = TEXT_AREA;
update_begin (f);
- if (FRAME_RIF (f))
+ if (rif)
{
- FRAME_RIF (f)->update_window_begin_hook (w);
+ rif->update_window_begin_hook (w);
if (glyphs == end - n
/* In front of a space added by append_space. */
|| (glyphs == end - n - 1
&& (end - n)->charpos <= 0))
- FRAME_RIF (f)->write_glyphs (glyphs, n);
+ rif->write_glyphs (glyphs, n);
else
- FRAME_RIF (f)->insert_glyphs (glyphs, n);
+ rif->insert_glyphs (glyphs, n);
}
else
{
if (glyphs == end - n)
- write_glyphs (f, glyphs, n);
+ write_glyphs (glyphs, n);
else
- insert_glyphs (f, glyphs, n);
+ insert_glyphs (glyphs, n);
}
w->cursor.hpos += n;
@@ -3711,8 +3719,8 @@ direct_output_for_insert (g)
a frame matrix is used, cursor_to expects frame coordinates,
and the X and Y parameters are not used. */
if (window_redisplay_p)
- FRAME_RIF (f)->cursor_to (w->cursor.vpos, w->cursor.hpos,
- w->cursor.y, w->cursor.x);
+ rif->cursor_to (w->cursor.vpos, w->cursor.hpos,
+ w->cursor.y, w->cursor.x);
else
{
int x, y;
@@ -3721,19 +3729,18 @@ direct_output_for_insert (g)
? XFASTINT (w->left_margin_cols)
: 0));
y = WINDOW_TO_FRAME_VPOS (w, w->cursor.vpos);
- cursor_to (f, y, x);
+ cursor_to (y, x);
}
#ifdef HAVE_WINDOW_SYSTEM
update_window_fringes (w, 0);
#endif
- if (FRAME_RIF (f))
- FRAME_RIF (f)->update_window_end_hook (w, 1, 0);
+ if (rif)
+ rif->update_window_end_hook (w, 1, 0);
update_end (f);
updated_row = NULL;
- if (FRAME_TERMCAP_P (f))
- fflush (FRAME_TTY (f)->output);
+ fflush (stdout);
TRACE ((stderr, "direct output for insert\n"));
mark_window_display_accurate (it.window, 1);
@@ -3811,8 +3818,8 @@ direct_output_forward_char (n)
&& w->cursor.hpos < w->desired_matrix->matrix_w);
if (FRAME_WINDOW_P (f))
- FRAME_RIF (f)->cursor_to (w->cursor.vpos, w->cursor.hpos,
- w->cursor.y, w->cursor.x);
+ rif->cursor_to (w->cursor.vpos, w->cursor.hpos,
+ w->cursor.y, w->cursor.x);
else
{
int x, y;
@@ -3821,11 +3828,10 @@ direct_output_forward_char (n)
? XFASTINT (w->left_margin_cols)
: 0));
y = WINDOW_TO_FRAME_VPOS (w, w->cursor.vpos);
- cursor_to (f, y, x);
+ cursor_to (y, x);
}
- if (FRAME_TERMCAP_P (f))
- fflush (FRAME_TTY (f)->output);
+ fflush (stdout);
redisplay_performed_directly_p = 1;
return 1;
}
@@ -3924,14 +3930,14 @@ update_frame (f, force_p, inhibit_hairy_id_p)
update_end (f);
/* This flush is a performance bottleneck under X,
- and it doesn't seem to be necessary anyway (in general).
+ and it doesn't seem to be necessary anyway (in general).
It is necessary when resizing the window with the mouse, or
- at least the fringes are not redrawn in a timely manner. ++kfs */
+ at least the fringes are not redrawn in a timely manner. ++kfs */
if (f->force_flush_display_p)
- {
- FRAME_RIF (f)->flush_display (f);
- f->force_flush_display_p = 0;
- }
+ {
+ rif->flush_display (f);
+ f->force_flush_display_p = 0;
+ }
}
else
{
@@ -3947,12 +3953,9 @@ update_frame (f, force_p, inhibit_hairy_id_p)
paused_p = update_frame_1 (f, force_p, inhibit_hairy_id_p);
update_end (f);
- if (FRAME_TERMCAP_P (f))
- {
- if (FRAME_TTY (f)->termscript)
- fflush (FRAME_TTY (f)->termscript);
- fflush (FRAME_TTY (f)->output);
- }
+ if (termscript)
+ fflush (termscript);
+ fflush (stdout);
/* Check window matrices for lost pointers. */
#if GLYPH_DEBUG
@@ -4057,8 +4060,7 @@ redraw_overlapped_rows (w, yb)
int yb;
{
int i;
- struct frame *f = XFRAME (WINDOW_FRAME (w));
-
+
/* If rows overlapping others have been changed, the rows being
overlapped have to be redrawn. This won't draw lines that have
already been drawn in update_window_line because overlapped_p in
@@ -4081,12 +4083,10 @@ redraw_overlapped_rows (w, yb)
{
updated_row = row;
updated_area = area;
- FRAME_RIF (f)->cursor_to (i, 0, row->y,
- area == TEXT_AREA ? row->x : 0);
+ rif->cursor_to (i, 0, row->y, area == TEXT_AREA ? row->x : 0);
if (row->used[area])
- FRAME_RIF (f)->write_glyphs (row->glyphs[area],
- row->used[area]);
- FRAME_RIF (f)->clear_end_of_line (-1);
+ rif->write_glyphs (row->glyphs[area], row->used[area]);
+ rif->clear_end_of_line (-1);
}
row->overlapped_p = 0;
@@ -4108,8 +4108,7 @@ redraw_overlapping_rows (w, yb)
{
int i, bottom_y;
struct glyph_row *row;
- struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w)));
-
+
for (i = 0; i < w->current_matrix->nrows; ++i)
{
row = w->current_matrix->rows + i;
@@ -4200,10 +4199,10 @@ update_window (w, force_p)
#endif
extern int input_pending;
extern Lisp_Object do_mouse_tracking;
- struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w)));
#if GLYPH_DEBUG
/* Check that W's frame doesn't have glyph matrices. */
xassert (FRAME_WINDOW_P (XFRAME (WINDOW_FRAME (w))));
+ xassert (updating_frame != NULL);
#endif
/* Check pending input the first time so that we can quickly return. */
@@ -4388,7 +4387,6 @@ update_marginal_area (w, area, vpos)
int area, vpos;
{
struct glyph_row *desired_row = MATRIX_ROW (w->desired_matrix, vpos);
- struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w)));
/* Let functions in xterm.c know what area subsequent X positions
will be relative to. */
@@ -4414,7 +4412,6 @@ update_text_area (w, vpos)
{
struct glyph_row *current_row = MATRIX_ROW (w->current_matrix, vpos);
struct glyph_row *desired_row = MATRIX_ROW (w->desired_matrix, vpos);
- struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w)));
int changed_p = 0;
/* Let functions in xterm.c know what area subsequent X positions
@@ -4650,7 +4647,6 @@ update_window_line (w, vpos, mouse_face_overwritten_p)
{
struct glyph_row *current_row = MATRIX_ROW (w->current_matrix, vpos);
struct glyph_row *desired_row = MATRIX_ROW (w->desired_matrix, vpos);
- struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w)));
int changed_p = 0;
/* Set the row being updated. This is important to let xterm.c
@@ -4719,7 +4715,6 @@ set_window_cursor_after_update (w)
struct window *w;
{
struct frame *f = XFRAME (w->frame);
- struct redisplay_interface *rif = FRAME_RIF (f);
int cx, cy, vpos, hpos;
/* Not intended for frame matrix updates. */
@@ -4943,7 +4938,6 @@ scrolling_window (w, header_line_p)
int i, j, first_old, first_new, last_old, last_new;
int nruns, nbytes, n, run_idx;
struct row_entry *entry;
- struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w)));
/* Skip over rows equal at the start. */
for (i = header_line_p ? 1 : 0; i < current_matrix->nrows - 1; ++i)
@@ -5268,7 +5262,7 @@ update_frame_1 (f, force_p, inhibit_id_p)
#endif
/* If we cannot insert/delete lines, it's no use trying it. */
- if (!FRAME_LINE_INS_DEL_OK (f))
+ if (!line_ins_del_ok)
inhibit_id_p = 1;
/* See if any of the desired lines are enabled; don't compute for
@@ -5296,18 +5290,18 @@ update_frame_1 (f, force_p, inhibit_id_p)
Also flush out if likely to have more than 1k buffered
otherwise. I'm told that some telnet connections get
really screwed by more than 1k output at once. */
- int outq = PENDING_OUTPUT_COUNT (FRAME_TTY (f)->output);
+ int outq = PENDING_OUTPUT_COUNT (stdout);
if (outq > 900
|| (outq > 20 && ((i - 1) % preempt_count == 0)))
{
- fflush (FRAME_TTY (f)->output);
+ fflush (stdout);
if (preempt_count == 1)
{
#ifdef EMACS_OUTQSIZE
if (EMACS_OUTQSIZE (0, &outq) < 0)
/* Probably not a tty. Ignore the error and reset
the outq count. */
- outq = PENDING_OUTPUT_COUNT (FRAME_TTY (f->output));
+ outq = PENDING_OUTPUT_COUNT (stdout);
#endif
outq *= 10;
if (baud_rate <= outq && baud_rate > 0)
@@ -5410,7 +5404,7 @@ update_frame_1 (f, force_p, inhibit_id_p)
}
}
- cursor_to (f, row, col);
+ cursor_to (row, col);
}
else
{
@@ -5432,7 +5426,7 @@ update_frame_1 (f, force_p, inhibit_id_p)
x += XFASTINT (w->left_margin_cols);
/* x = max (min (x, FRAME_TOTAL_COLS (f) - 1), 0); */
- cursor_to (f, y, x);
+ cursor_to (y, x);
}
}
}
@@ -5501,23 +5495,21 @@ scrolling (frame)
}
/* If changed lines are few, don't allow preemption, don't scroll. */
- if ((!FRAME_SCROLL_REGION_OK (frame)
- && changed_lines < baud_rate / 2400)
+ if ((!scroll_region_ok && changed_lines < baud_rate / 2400)
|| unchanged_at_bottom == FRAME_LINES (frame))
return 1;
window_size = (FRAME_LINES (frame) - unchanged_at_top
- unchanged_at_bottom);
- if (FRAME_SCROLL_REGION_OK (frame))
+ if (scroll_region_ok)
free_at_end_vpos -= unchanged_at_bottom;
- else if (FRAME_MEMORY_BELOW_FRAME (frame))
+ else if (memory_below_frame)
free_at_end_vpos = -1;
/* If large window, fast terminal and few lines in common between
current frame and desired frame, don't bother with i/d calc. */
- if (!FRAME_SCROLL_REGION_OK (frame)
- && window_size >= 18 && baud_rate > 2400
+ if (!scroll_region_ok && window_size >= 18 && baud_rate > 2400
&& (window_size >=
10 * scrolling_max_lines_saved (unchanged_at_top,
FRAME_LINES (frame) - unchanged_at_bottom,
@@ -5597,7 +5589,7 @@ update_frame_line (f, vpos)
struct glyph_row *current_row = MATRIX_ROW (current_matrix, vpos);
struct glyph_row *desired_row = MATRIX_ROW (desired_matrix, vpos);
int must_write_whole_line_p;
- int write_spaces_p = FRAME_MUST_WRITE_SPACES (f);
+ int write_spaces_p = must_write_spaces;
int colored_spaces_p = (FACE_FROM_ID (f, DEFAULT_FACE_ID)->background
!= FACE_TTY_DEFAULT_BG_COLOR);
@@ -5648,8 +5640,8 @@ update_frame_line (f, vpos)
/* Write the contents of the desired line. */
if (nlen)
{
- cursor_to (f, vpos, 0);
- write_glyphs (f, nbody, nlen);
+ cursor_to (vpos, 0);
+ write_glyphs (nbody, nlen);
}
/* Don't call clear_end_of_line if we already wrote the whole
@@ -5657,13 +5649,13 @@ update_frame_line (f, vpos)
case but in the line below. */
if (nlen < FRAME_TOTAL_COLS (f))
{
- cursor_to (f, vpos, nlen);
- clear_end_of_line (f, FRAME_TOTAL_COLS (f));
+ cursor_to (vpos, nlen);
+ clear_end_of_line (FRAME_TOTAL_COLS (f));
}
else
/* Make sure we are in the right row, otherwise cursor movement
with cmgoto might use `ch' in the wrong row. */
- cursor_to (f, vpos, 0);
+ cursor_to (vpos, 0);
make_current (desired_matrix, current_matrix, vpos);
return;
@@ -5676,7 +5668,7 @@ update_frame_line (f, vpos)
nlen--;
/* If there's no i/d char, quickly do the best we can without it. */
- if (!FRAME_CHAR_INS_DEL_OK (f))
+ if (!char_ins_del_ok)
{
int i, j;
@@ -5695,8 +5687,8 @@ update_frame_line (f, vpos)
++j;
/* Output this run of non-matching chars. */
- cursor_to (f, vpos, i);
- write_glyphs (f, nbody + i, j - i);
+ cursor_to (vpos, i);
+ write_glyphs (nbody + i, j - i);
i = j - 1;
/* Now find the next non-match. */
@@ -5706,8 +5698,8 @@ update_frame_line (f, vpos)
/* Clear the rest of the line, or the non-clear part of it. */
if (olen > nlen)
{
- cursor_to (f, vpos, nlen);
- clear_end_of_line (f, olen);
+ cursor_to (vpos, nlen);
+ clear_end_of_line (olen);
}
/* Make current row = desired row. */
@@ -5729,8 +5721,8 @@ update_frame_line (f, vpos)
if (nlen > nsp)
{
- cursor_to (f, vpos, nsp);
- write_glyphs (f, nbody + nsp, nlen - nsp);
+ cursor_to (vpos, nsp);
+ write_glyphs (nbody + nsp, nlen - nsp);
}
/* Exchange contents between current_frame and new_frame. */
@@ -5779,8 +5771,7 @@ update_frame_line (f, vpos)
tem = (nlen - nsp) - (olen - osp);
if (endmatch && tem
- && (!FRAME_CHAR_INS_DEL_OK (f)
- || endmatch <= char_ins_del_cost (f)[tem]))
+ && (!char_ins_del_ok || endmatch <= char_ins_del_cost (f)[tem]))
endmatch = 0;
/* nsp - osp is the distance to insert or delete.
@@ -5789,7 +5780,7 @@ update_frame_line (f, vpos)
Is it worth it? */
if (nsp != osp
- && (!FRAME_CHAR_INS_DEL_OK (f)
+ && (!char_ins_del_ok
|| begmatch + endmatch <= char_ins_del_cost (f)[nsp - osp]))
{
begmatch = 0;
@@ -5802,8 +5793,8 @@ update_frame_line (f, vpos)
if (osp > nsp)
{
- cursor_to (f, vpos, nsp);
- delete_glyphs (f, osp - nsp);
+ cursor_to (vpos, nsp);
+ delete_glyphs (osp - nsp);
}
else if (nsp > osp)
{
@@ -5812,12 +5803,12 @@ update_frame_line (f, vpos)
must delete first to avoid losing data in the insert */
if (endmatch && nlen < olen + nsp - osp)
{
- cursor_to (f, vpos, nlen - endmatch + osp - nsp);
- delete_glyphs (f, olen + nsp - osp - nlen);
+ cursor_to (vpos, nlen - endmatch + osp - nsp);
+ delete_glyphs (olen + nsp - osp - nlen);
olen = nlen - (nsp - osp);
}
- cursor_to (f, vpos, osp);
- insert_glyphs (f, 0, nsp - osp);
+ cursor_to (vpos, osp);
+ insert_glyphs (0, nsp - osp);
}
olen += nsp - osp;
@@ -5838,8 +5829,8 @@ update_frame_line (f, vpos)
unnecessary cursor movement. */
if (nlen - tem > 0)
{
- cursor_to (f, vpos, nsp + begmatch);
- write_glyphs (f, nbody + nsp + begmatch, nlen - tem);
+ cursor_to (vpos, nsp + begmatch);
+ write_glyphs (nbody + nsp + begmatch, nlen - tem);
}
}
else if (nlen > olen)
@@ -5854,27 +5845,27 @@ update_frame_line (f, vpos)
int out = olen - tem; /* Columns to be overwritten originally. */
int del;
- cursor_to (f, vpos, nsp + begmatch);
+ cursor_to (vpos, nsp + begmatch);
/* Calculate columns we can actually overwrite. */
while (CHAR_GLYPH_PADDING_P (nbody[nsp + begmatch + out]))
out--;
- write_glyphs (f, nbody + nsp + begmatch, out);
+ write_glyphs (nbody + nsp + begmatch, out);
/* If we left columns to be overwritten, we must delete them. */
del = olen - tem - out;
if (del > 0)
- delete_glyphs (f, del);
+ delete_glyphs (del);
/* At last, we insert columns not yet written out. */
- insert_glyphs (f, nbody + nsp + begmatch + out, nlen - olen + del);
+ insert_glyphs (nbody + nsp + begmatch + out, nlen - olen + del);
olen = nlen;
}
else if (olen > nlen)
{
- cursor_to (f, vpos, nsp + begmatch);
- write_glyphs (f, nbody + nsp + begmatch, nlen - tem);
- delete_glyphs (f, olen - nlen);
+ cursor_to (vpos, nsp + begmatch);
+ write_glyphs (nbody + nsp + begmatch, nlen - tem);
+ delete_glyphs (olen - nlen);
olen = nlen;
}
}
@@ -5883,8 +5874,8 @@ update_frame_line (f, vpos)
/* If any unerased characters remain after the new line, erase them. */
if (olen > nlen)
{
- cursor_to (f, vpos, nlen);
- clear_end_of_line (f, olen);
+ cursor_to (vpos, nlen);
+ clear_end_of_line (olen);
}
/* Exchange contents between current_frame and new_frame. */
@@ -6181,34 +6172,31 @@ window_change_signal (signalnum) /* If we don't have an argument, */
#endif
int old_errno = errno;
- struct tty_display_info *tty;
-
signal (SIGWINCH, window_change_signal);
SIGNAL_THREAD_CHECK (signalnum);
- /* The frame size change obviously applies to a single
- termcap-controlled terminal, but we can't decide which.
- Therefore, we resize the frames corresponding to each tty.
- */
- for (tty = tty_list; tty; tty = tty->next) {
+ get_frame_size (&width, &height);
- if (! tty->term_initted)
- continue;
+ /* The frame size change obviously applies to a termcap-controlled
+ frame. Find such a frame in the list, and assume it's the only
+ one (since the redisplay code always writes to stdout, not a
+ FILE * specified in the frame structure). Record the new size,
+ but don't reallocate the data structures now. Let that be done
+ later outside of the signal handler. */
- get_tty_size (fileno (tty->input), &width, &height);
-
- if (width > 5 && height > 2) {
- Lisp_Object tail, frame;
-
- FOR_EACH_FRAME (tail, frame)
- if (FRAME_TERMCAP_P (XFRAME (frame)) && FRAME_TTY (XFRAME (frame)) == tty)
- /* Record the new sizes, but don't reallocate the data
- structures now. Let that be done later outside of the
- signal handler. */
- change_frame_size (XFRAME (frame), height, width, 0, 1, 0);
- }
+ {
+ Lisp_Object tail, frame;
+
+ FOR_EACH_FRAME (tail, frame)
+ {
+ if (FRAME_TERMCAP_P (XFRAME (frame)))
+ {
+ change_frame_size (XFRAME (frame), height, width, 0, 1, 0);
+ break;
+ }
+ }
}
-
+
errno = old_errno;
}
#endif /* SIGWINCH */
@@ -6262,11 +6250,10 @@ change_frame_size (f, newheight, newwidth, pretend, delay, safe)
{
Lisp_Object tail, frame;
- if (FRAME_MSDOS_P (f))
+ if (! FRAME_WINDOW_P (f))
{
- /* On MS-DOS, all frames use the same screen, so a change in
- size affects all frames. Termcap now supports multiple
- ttys. */
+ /* When using termcap, or on MS-DOS, all frames use
+ the same screen, so a change in size affects all frames. */
FOR_EACH_FRAME (tail, frame)
if (! FRAME_WINDOW_P (XFRAME (frame)))
change_frame_size_1 (XFRAME (frame), newheight, newwidth,
@@ -6346,7 +6333,7 @@ change_frame_size_1 (f, newheight, newwidth, pretend, delay, safe)
newheight - FRAME_TOP_MARGIN (f), 0);
if (FRAME_TERMCAP_P (f) && !pretend)
- FrameRows (FRAME_TTY (f)) = newheight;
+ FrameRows = newheight;
}
if (new_frame_total_cols != FRAME_TOTAL_COLS (f))
@@ -6356,7 +6343,7 @@ change_frame_size_1 (f, newheight, newwidth, pretend, delay, safe)
set_window_width (FRAME_MINIBUF_WINDOW (f), new_frame_total_cols, 0);
if (FRAME_TERMCAP_P (f) && !pretend)
- FrameCols (FRAME_TTY (f)) = newwidth;
+ FrameCols = newwidth;
if (WINDOWP (f->tool_bar_window))
XSETFASTINT (XWINDOW (f->tool_bar_window)->total_cols, newwidth);
@@ -6406,26 +6393,19 @@ FILE = nil means just close any termscript file currently open. */)
(file)
Lisp_Object file;
{
- struct tty_display_info *tty;
-
- if (! FRAME_TERMCAP_P (SELECTED_FRAME ()))
- error ("Current frame is not on a tty device");
-
- tty = CURTTY ();
-
- if (tty->termscript != 0)
- {
- BLOCK_INPUT;
- fclose (tty->termscript);
- UNBLOCK_INPUT;
- }
- tty->termscript = 0;
+ if (termscript != 0)
+ {
+ BLOCK_INPUT;
+ fclose (termscript);
+ UNBLOCK_INPUT;
+ }
+ termscript = 0;
if (! NILP (file))
{
file = Fexpand_file_name (file, Qnil);
- tty->termscript = fopen (SDATA (file), "w");
- if (tty->termscript == 0)
+ termscript = fopen (SDATA (file), "w");
+ if (termscript == 0)
report_file_error ("Opening termscript", Fcons (file, Qnil));
}
return Qnil;
@@ -6433,36 +6413,23 @@ FILE = nil means just close any termscript file currently open. */)
DEFUN ("send-string-to-terminal", Fsend_string_to_terminal,
- Ssend_string_to_terminal, 1, 2, 0,
+ Ssend_string_to_terminal, 1, 1, 0,
doc: /* Send STRING to the terminal without alteration.
-Control characters in STRING will have terminal-dependent effects.
-
-Optional parameter TERMINAL specifies the tty terminal device to use.
-It may be a terminal id, a frame, or nil for the terminal used by the
-currently selected frame. */)
- (string, terminal)
+Control characters in STRING will have terminal-dependent effects. */)
+ (string)
Lisp_Object string;
- Lisp_Object terminal;
{
- struct terminal *t = get_tty_terminal (terminal, 1);
- struct tty_display_info *tty;
-
/* ??? Perhaps we should do something special for multibyte strings here. */
CHECK_STRING (string);
BLOCK_INPUT;
-
- if (!t)
- error ("Unknown terminal device");
-
- tty = t->display_info.tty;
-
- if (tty->termscript)
+ fwrite (SDATA (string), 1, SBYTES (string), stdout);
+ fflush (stdout);
+ if (termscript)
{
- fwrite (SDATA (string), 1, SBYTES (string), tty->termscript);
- fflush (tty->termscript);
+ fwrite (SDATA (string), 1, SBYTES (string),
+ termscript);
+ fflush (termscript);
}
- fwrite (SDATA (string), 1, SBYTES (string), tty->output);
- fflush (tty->output);
UNBLOCK_INPUT;
return Qnil;
}
@@ -6480,7 +6447,8 @@ terminate any keyboard macro currently executing. */)
if (noninteractive)
putchar (07);
else
- ring_bell (XFRAME (selected_frame));
+ ring_bell ();
+ fflush (stdout);
}
else
bitch_at_user ();
@@ -6496,7 +6464,8 @@ bitch_at_user ()
else if (!INTERACTIVE) /* Stop executing a keyboard macro. */
error ("Keyboard macro terminated by a command ringing the bell");
else
- ring_bell (XFRAME (selected_frame));
+ ring_bell ();
+ fflush (stdout);
}
@@ -6779,6 +6748,8 @@ pass nil for VARIABLE. */)
Initialization
***********************************************************************/
+char *terminal_type;
+
/* Initialization done when Emacs fork is started, before doing stty.
Determine terminal type and set terminal_driver. Then invoke its
decoding routine to set up variables in the terminal package. */
@@ -6786,8 +6757,6 @@ pass nil for VARIABLE. */)
void
init_display ()
{
- char *terminal_type;
-
#ifdef HAVE_X_WINDOWS
extern int display_arg;
#endif
@@ -6797,23 +6766,14 @@ init_display ()
SET_CHAR_GLYPH_FROM_GLYPH (space_glyph, ' ');
space_glyph.charpos = -1;
+ meta_key = 0;
inverse_video = 0;
cursor_in_echo_area = 0;
terminal_type = (char *) 0;
/* Now is the time to initialize this; it's used by init_sys_modes
during startup. */
- Vinitial_window_system = Qnil;
-
- /* SIGWINCH needs to be handled no matter what display we start
- with. Otherwise newly opened tty frames will not resize
- automatically. */
-#ifdef SIGWINCH
-#ifndef CANNOT_DUMP
- if (initialized)
-#endif /* CANNOT_DUMP */
- signal (SIGWINCH, window_change_signal);
-#endif /* SIGWINCH */
+ Vwindow_system = Qnil;
/* If the user wants to use a window system, we shouldn't bother
initializing the terminal. This is especially important when the
@@ -6849,7 +6809,7 @@ init_display ()
#endif
)
{
- Vinitial_window_system = intern ("x");
+ Vwindow_system = intern ("x");
#ifdef HAVE_X11
Vwindow_system_version = make_number (11);
#else
@@ -6869,7 +6829,7 @@ init_display ()
#ifdef HAVE_NTGUI
if (!inhibit_window_system)
{
- Vinitial_window_system = intern ("w32");
+ Vwindow_system = intern ("w32");
Vwindow_system_version = make_number (1);
adjust_frame_glyphs_initially ();
return;
@@ -6879,7 +6839,7 @@ init_display ()
#ifdef MAC_OS
if (!inhibit_window_system)
{
- Vinitial_window_system = intern ("mac");
+ Vwindow_system = intern ("mac");
Vwindow_system_version = make_number (1);
adjust_frame_glyphs_initially ();
return;
@@ -6931,38 +6891,8 @@ For types not defined in VMS, use define emacs_term \"TYPE\".\n\
}
#endif /* VMS */
- {
- struct terminal *t;
- struct frame *f = XFRAME (selected_frame);
-
- /* Open a display on the controlling tty. */
- t = init_tty (0, terminal_type, 1); /* Errors are fatal. */
-
- /* Convert the initial frame to use the new display. */
- if (f->output_method != output_initial)
- abort ();
- f->output_method = t->type;
- f->terminal = t;
-
- t->reference_count++;
- t->display_info.tty->top_frame = selected_frame;
- change_frame_size (XFRAME (selected_frame),
- FrameRows (t->display_info.tty),
- FrameCols (t->display_info.tty), 0, 0, 1);
-
- /* Delete the initial terminal. */
- if (--initial_terminal->reference_count == 0
- && initial_terminal->delete_terminal_hook)
- (*initial_terminal->delete_terminal_hook) (initial_terminal);
-
- /* Update frame parameters to reflect the new type. */
- Fmodify_frame_parameters (selected_frame, Fcons (Fcons (Qwindow_system, Qnil), Qnil));
- Fmodify_frame_parameters
- (selected_frame, Fcons (Fcons (Qtty_type,
- Ftty_type (selected_frame)), Qnil));
- Fmodify_frame_parameters (selected_frame, Fcons (Fcons (Qtty, Qnil), Qnil));
- }
-
+ term_init (terminal_type);
+
{
struct frame *sf = SELECTED_FRAME ();
int width = FRAME_TOTAL_COLS (sf);
@@ -6979,6 +6909,13 @@ For types not defined in VMS, use define emacs_term \"TYPE\".\n\
adjust_frame_glyphs_initially ();
calculate_costs (XFRAME (selected_frame));
+#ifdef SIGWINCH
+#ifndef CANNOT_DUMP
+ if (initialized)
+#endif /* CANNOT_DUMP */
+ signal (SIGWINCH, window_change_signal);
+#endif /* SIGWINCH */
+
/* Set up faces of the initial terminal frame of a dumped Emacs. */
if (initialized
&& !noninteractive
@@ -6989,7 +6926,7 @@ For types not defined in VMS, use define emacs_term \"TYPE\".\n\
and internal_terminal_init. */
&& (strcmp (terminal_type, "internal") != 0 || inhibit_window_system)
#endif
- && NILP (Vinitial_window_system))
+ && NILP (Vwindow_system))
{
/* For the initial frame, we don't have any way of knowing what
are the foreground and background colors of the terminal. */
@@ -7101,8 +7038,8 @@ A non-nil value is useful if the terminal can automatically preserve
Emacs's frame display when you reenter Emacs.
It is up to you to set this variable if your terminal can do that. */);
- DEFVAR_LISP ("initial-window-system", &Vinitial_window_system,
- doc: /* Name of the window system that Emacs uses for the first frame.
+ DEFVAR_LISP ("window-system", &Vwindow_system,
+ doc: /* Name of window system that Emacs is displaying through.
The value is a symbol--for instance, `x' for X windows.
The value is nil if Emacs is using a text-only terminal. */);
@@ -7145,7 +7082,7 @@ If nil, never pre-empt redisplay. */);
if (noninteractive)
#endif
{
- Vinitial_window_system = Qnil;
+ Vwindow_system = Qnil;
Vwindow_system_version = Qnil;
}
}
diff --git a/src/disptab.h b/src/disptab.h
index 19033dc993..3efb47d26a 100644
--- a/src/disptab.h
+++ b/src/disptab.h
@@ -36,8 +36,14 @@ Boston, MA 02110-1301, USA. */
extern Lisp_Object disp_char_vector P_ ((struct Lisp_Char_Table *, int));
-#define DISP_CHAR_VECTOR(dp, c) \
- (SINGLE_BYTE_CHAR_P(c) ? (dp)->contents[c] : disp_char_vector ((dp), (c)))
+#define DISP_CHAR_VECTOR(dp, c) \
+ (ASCII_CHAR_P(c) \
+ ? (NILP ((dp)->ascii) \
+ ? (dp)->defalt \
+ : (SUB_CHAR_TABLE_P ((dp)->ascii) \
+ ? XSUB_CHAR_TABLE ((dp)->ascii)->contents[c] \
+ : (dp)->ascii)) \
+ : disp_char_vector ((dp), (c)))
/* Defined in window.c. */
extern struct Lisp_Char_Table *window_display_table P_ ((struct window *));
diff --git a/src/doc.c b/src/doc.c
index 25f6625d40..70b78da596 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -41,7 +41,7 @@ Boston, MA 02110-1301, USA. */
#include "lisp.h"
#include "buffer.h"
#include "keyboard.h"
-#include "charset.h"
+#include "character.h"
#include "keymap.h"
#ifdef HAVE_INDEX
diff --git a/src/doprnt.c b/src/doprnt.c
index e9c97d60cc..d049ec2d06 100644
--- a/src/doprnt.c
+++ b/src/doprnt.c
@@ -47,7 +47,7 @@ Boston, MA 02110-1301, USA. */
/* Since we use the macro CHAR_HEAD_P, we have to include this, but
don't have to include others because CHAR_HEAD_P does not contains
another macro. */
-#include "charset.h"
+#include "character.h"
static int doprnt1 ();
diff --git a/src/dosfns.c b/src/dosfns.c
index 32d7a2c8d7..2d2d4e04e7 100644
--- a/src/dosfns.c
+++ b/src/dosfns.c
@@ -38,7 +38,7 @@ Boston, MA 02110-1301, USA. */
#include "dosfns.h"
#include "msdos.h"
#include "dispextern.h"
-#include "charset.h"
+#include "character.h"
#include "coding.h"
#include <dpmi.h>
#include <go32.h>
diff --git a/src/editfns.c b/src/editfns.c
index dac7eb83af..152c5b669d 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -52,7 +52,7 @@ Boston, MA 02110-1301, USA. */
#include "intervals.h"
#include "buffer.h"
-#include "charset.h"
+#include "character.h"
#include "coding.h"
#include "frame.h"
#include "window.h"
@@ -210,11 +210,9 @@ usage: (char-to-string CHAR) */)
int len;
unsigned char str[MAX_MULTIBYTE_LENGTH];
- CHECK_NUMBER (character);
+ CHECK_CHARACTER (character);
- len = (SINGLE_BYTE_CHAR_P (XFASTINT (character))
- ? (*str = (unsigned char)(XFASTINT (character)), 1)
- : char_to_string (XFASTINT (character), str));
+ len = CHAR_STRING (XFASTINT (character), str);
return make_string_from_bytes (str, 1, len);
}
@@ -2155,7 +2153,7 @@ general_insert_function (insert_func, insert_from_string_func,
for (argnum = 0; argnum < nargs; argnum++)
{
val = args[argnum];
- if (INTEGERP (val))
+ if (CHARACTERP (val))
{
unsigned char str[MAX_MULTIBYTE_LENGTH];
int len;
@@ -2164,7 +2162,7 @@ general_insert_function (insert_func, insert_from_string_func,
len = CHAR_STRING (XFASTINT (val), str);
else
{
- str[0] = (SINGLE_BYTE_CHAR_P (XINT (val))
+ str[0] = (ASCII_CHAR_P (XINT (val))
? XINT (val)
: multibyte_char_to_unibyte (XINT (val), Qnil));
len = 1;
@@ -2331,6 +2329,29 @@ from adjoining text, if those properties are sticky. */)
return Qnil;
}
+DEFUN ("insert-byte", Finsert_byte, Sinsert_byte, 2, 3, 0,
+ doc: /* Insert COUNT (second arg) copies of BYTE (first arg).
+Both arguments are required.
+BYTE is a number of the range 0..255.
+
+If BYTE is 128..255 and the current buffer is multibyte, the
+corresponding eight-bit character is inserted.
+
+Point, and before-insertion markers, are relocated as in the function `insert'.
+The optional third arg INHERIT, if non-nil, says to inherit text properties
+from adjoining text, if those properties are sticky. */)
+ (byte, count, inherit)
+ Lisp_Object byte, count, inherit;
+{
+ CHECK_NUMBER (byte);
+ if (XINT (byte) < 0 || XINT (byte) > 255)
+ args_out_of_range_3 (byte, make_number (0), make_number (255));
+ if (XINT (byte) >= 128
+ && ! NILP (current_buffer->enable_multibyte_characters))
+ XSETFASTINT (byte, BYTE8_TO_CHAR (XINT (byte)));
+ return Finsert_char (byte, count, inherit);
+}
+
/* Making strings from buffer contents. */
@@ -2892,12 +2913,73 @@ Both characters must have the same length of multi-byte form. */)
return Qnil;
}
+
+static Lisp_Object check_translation P_ ((int, int, int, Lisp_Object));
+
+/* Helper function for Ftranslate_region_internal.
+
+ Check if a character sequence at POS (POS_BYTE) matches an element
+ of VAL. VAL is a list (([FROM-CHAR ...] . TO) ...). If a matching
+ element is found, return it. Otherwise return Qnil. */
+
+static Lisp_Object
+check_translation (pos, pos_byte, end, val)
+ int pos, pos_byte, end;
+ Lisp_Object val;
+{
+ int buf_size = 16, buf_used = 0;
+ int *buf = alloca (sizeof (int) * buf_size);
+
+ for (; CONSP (val); val = XCDR (val))
+ {
+ Lisp_Object elt;
+ int len, i;
+
+ elt = XCAR (val);
+ if (! CONSP (elt))
+ continue;
+ elt = XCAR (elt);
+ if (! VECTORP (elt))
+ continue;
+ len = ASIZE (elt);
+ if (len <= end - pos)
+ {
+ for (i = 0; i < len; i++)
+ {
+ if (buf_used <= i)
+ {
+ unsigned char *p = BYTE_POS_ADDR (pos_byte);
+ int len;
+
+ if (buf_used == buf_size)
+ {
+ int *newbuf;
+
+ buf_size += 16;
+ newbuf = alloca (sizeof (int) * buf_size);
+ memcpy (newbuf, buf, sizeof (int) * buf_used);
+ buf = newbuf;
+ }
+ buf[buf_used++] = STRING_CHAR_AND_LENGTH (p, 0, len);
+ pos_byte += len;
+ }
+ if (XINT (AREF (elt, i)) != buf[i])
+ break;
+ }
+ if (i == len)
+ return XCAR (val);
+ }
+ }
+ return Qnil;
+}
+
+
DEFUN ("translate-region-internal", Ftranslate_region_internal,
Stranslate_region_internal, 3, 3, 0,
doc: /* Internal use only.
From START to END, translate characters according to TABLE.
-TABLE is a string; the Nth character in it is the mapping
-for the character with code N.
+TABLE is a string or a char-table; the Nth character in it is the
+mapping for the character with code N.
It returns the number of characters changed. */)
(start, end, table)
Lisp_Object start;
@@ -2911,10 +2993,13 @@ It returns the number of characters changed. */)
int pos, pos_byte, end_pos;
int multibyte = !NILP (current_buffer->enable_multibyte_characters);
int string_multibyte;
+ Lisp_Object val;
validate_region (&start, &end);
if (CHAR_TABLE_P (table))
{
+ if (! EQ (XCHAR_TABLE (table)->purpose, Qtranslation_table))
+ error ("Not a translation table");
size = MAX_CHAR;
tt = NULL;
}
@@ -2925,14 +3010,14 @@ It returns the number of characters changed. */)
if (! multibyte && (SCHARS (table) < SBYTES (table)))
table = string_make_unibyte (table);
string_multibyte = SCHARS (table) < SBYTES (table);
- size = SCHARS (table);
+ size = SBYTES (table);
tt = SDATA (table);
}
pos = XINT (start);
pos_byte = CHAR_TO_BYTE (pos);
end_pos = XINT (end);
- modify_region (current_buffer, pos, XINT (end), 0);
+ modify_region (current_buffer, pos, end_pos, 0);
cnt = 0;
for (; pos < end_pos; )
@@ -2941,6 +3026,7 @@ It returns the number of characters changed. */)
unsigned char *str, buf[MAX_MULTIBYTE_LENGTH];
int len, str_len;
int oc;
+ Lisp_Object val;
if (multibyte)
oc = STRING_CHAR_AND_LENGTH (p, MAX_MULTIBYTE_LENGTH, len);
@@ -2955,7 +3041,7 @@ It returns the number of characters changed. */)
if (string_multibyte)
{
str = tt + string_char_to_byte (table, oc);
- nc = STRING_CHAR_AND_LENGTH (str, MAX_MULTIBYTE_LENGTH,
+ nc = STRING_CHAR_AND_LENGTH (str, MAX_MULTIBYTE_LENGTH,
str_len);
}
else
@@ -2963,7 +3049,7 @@ It returns the number of characters changed. */)
nc = tt[oc];
if (! ASCII_BYTE_P (nc) && multibyte)
{
- str_len = CHAR_STRING (nc, buf);
+ str_len = BYTE8_STRING (nc, buf);
str = buf;
}
else
@@ -2975,28 +3061,34 @@ It returns the number of characters changed. */)
}
else
{
- Lisp_Object val;
int c;
nc = oc;
val = CHAR_TABLE_REF (table, oc);
- if (INTEGERP (val)
+ if (CHARACTERP (val)
&& (c = XINT (val), CHAR_VALID_P (c, 0)))
{
nc = c;
str_len = CHAR_STRING (nc, buf);
str = buf;
}
+ else if (VECTORP (val) || (CONSP (val)))
+ {
+ /* VAL is [TO_CHAR ...] or (([FROM-CHAR ...] . TO) ...)
+ where TO is TO-CHAR or [TO-CHAR ...]. */
+ nc = -1;
+ }
}
- if (nc != oc)
+ if (nc != oc && nc >= 0)
{
+ /* Simple one char to one char translation. */
if (len != str_len)
{
Lisp_Object string;
/* This is less efficient, because it moves the gap,
- but it should multibyte characters correctly. */
+ but it should handle multibyte characters correctly. */
string = make_multibyte_string (str, 1, str_len);
replace_range (pos, pos + 1, string, 1, 0, 1);
len = str_len;
@@ -3011,6 +3103,46 @@ It returns the number of characters changed. */)
}
++cnt;
}
+ else if (nc < 0)
+ {
+ Lisp_Object string;
+
+ if (CONSP (val))
+ {
+ val = check_translation (pos, pos_byte, end_pos, val);
+ if (NILP (val))
+ {
+ pos_byte += len;
+ pos++;
+ continue;
+ }
+ /* VAL is ([FROM-CHAR ...] . TO). */
+ len = ASIZE (XCAR (val));
+ val = XCDR (val);
+ }
+ else
+ len = 1;
+
+ if (VECTORP (val))
+ {
+ int i;
+
+ string = Fmake_string (make_number (ASIZE (val)),
+ AREF (val, 0));
+ for (i = 1; i < ASIZE (val); i++)
+ Faset (string, make_number (i), AREF (val, i));
+ }
+ else
+ {
+ string = Fmake_string (make_number (1), val);
+ }
+ replace_range (pos, pos + len, string, 1, 0, 1);
+ pos_byte += SBYTES (string);
+ pos += SCHARS (string);
+ cnt += SCHARS (string);
+ end_pos += SCHARS (string) - len;
+ continue;
+ }
}
pos_byte += len;
pos++;
@@ -3606,8 +3738,8 @@ usage: (format STRING &rest OBJECTS) */)
thissize = 30;
if (*format == 'c')
{
- if (! SINGLE_BYTE_CHAR_P (XINT (args[n]))
- /* Note: No one can remember why we have to treat
+ if (! ASCII_CHAR_P (XINT (args[n]))
+ /* Note: No one can remeber why we have to treat
the character 0 as a multibyte character here.
But, until it causes a real problem, let's
don't change it. */
@@ -4011,8 +4143,20 @@ Case is ignored if `case-fold-search' is non-nil in the current buffer. */)
/* Do these in separate statements,
then compare the variables.
because of the way DOWNCASE uses temp variables. */
- i1 = DOWNCASE (XFASTINT (c1));
- i2 = DOWNCASE (XFASTINT (c2));
+ i1 = XFASTINT (c1);
+ if (NILP (current_buffer->enable_multibyte_characters)
+ && ! ASCII_CHAR_P (i1))
+ {
+ MAKE_CHAR_MULTIBYTE (i1);
+ }
+ i2 = XFASTINT (c2);
+ if (NILP (current_buffer->enable_multibyte_characters)
+ && ! ASCII_CHAR_P (i2))
+ {
+ MAKE_CHAR_MULTIBYTE (i2);
+ }
+ i1 = DOWNCASE (i1);
+ i2 = DOWNCASE (i2);
return (i1 == i2 ? Qt : Qnil);
}
@@ -4507,6 +4651,7 @@ functions if all the text being accessed has this property. */);
defsubr (&Sinsert_and_inherit);
defsubr (&Sinsert_and_inherit_before_markers);
defsubr (&Sinsert_char);
+ defsubr (&Sinsert_byte);
defsubr (&Suser_login_name);
defsubr (&Suser_real_login_name);
diff --git a/src/emacs.c b/src/emacs.c
index 46d07b1993..dc3055f8b1 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -57,7 +57,6 @@ Boston, MA 02110-1301, USA. */
#include "blockinput.h"
#include "syssignal.h"
#include "process.h"
-#include "frame.h"
#include "termhooks.h"
#include "keyboard.h"
#include "keymap.h"
@@ -215,7 +214,7 @@ static unsigned long heap_bss_diff;
#ifdef HAVE_WINDOW_SYSTEM
-extern Lisp_Object Vinitial_window_system;
+extern Lisp_Object Vwindow_system;
#endif /* HAVE_WINDOW_SYSTEM */
extern Lisp_Object Vauto_save_list_file_name;
@@ -788,6 +787,9 @@ bug_reporting_address ()
return count >= 3 ? REPORT_EMACS_BUG_PRETEST_ADDRESS : REPORT_EMACS_BUG_ADDRESS;
}
+#ifdef USE_FONT_BACKEND
+extern int enable_font_backend;
+#endif /* USE_FONT_BACKEND */
/* ARGSUSED */
int
@@ -1282,6 +1284,7 @@ main (argc, argv
init_alloc_once ();
init_obarray ();
init_eval_once ();
+ init_character_once ();
init_charset_once ();
init_coding_once ();
init_syntax_once (); /* Create standard syntax table. */
@@ -1297,9 +1300,6 @@ main (argc, argv
faces, and the face implementation uses some symbols as
face names. */
syms_of_xfaces ();
- /* XXX syms_of_keyboard uses some symbols in keymap.c. It would
- be better to arrange things not to have this dependency. */
- syms_of_keymap ();
/* Call syms_of_keyboard before init_window_once because
keyboard sets up symbols that include some face names that
the X support will want to use. This can happen when
@@ -1403,12 +1403,15 @@ main (argc, argv
Lisp_Object buffer;
buffer = Fcdr (XCAR (tail));
- /* Verify that all buffers are empty now, as they
- ought to be. */
- if (BUF_Z (XBUFFER (buffer)) > BUF_BEG (XBUFFER (buffer)))
- abort ();
- /* It is safe to do this crudely in an empty buffer. */
- XBUFFER (buffer)->enable_multibyte_characters = Qnil;
+ /* Make a multibyte buffer unibyte. */
+ if (BUF_Z_BYTE (XBUFFER (buffer)) > BUF_Z (XBUFFER (buffer)))
+ {
+ struct buffer *current = current_buffer;
+
+ set_buffer_temp (XBUFFER (buffer));
+ Fset_buffer_multibyte (Qnil);
+ set_buffer_temp (current);
+ }
}
}
}
@@ -1416,6 +1419,16 @@ main (argc, argv
no_loadup
= argmatch (argv, argc, "-nl", "--no-loadup", 6, NULL, &skip_args);
+#ifdef USE_FONT_BACKEND
+ enable_font_backend = 1;
+ if (argmatch (argv, argc, "-enable-font-backend", "--enable-font-backend",
+ 4, NULL, &skip_args))
+ enable_font_backend = 1;
+ else if (argmatch (argv, argc,
+ "-disable-font-backend", "--disable-font-backend",
+ 4, NULL, &skip_args))
+ enable_font_backend = 0;
+#endif /* USE_FONT_BACKEND */
#ifdef HAVE_X_WINDOWS
/* Stupid kludge to catch command-line display spec. We can't
@@ -1497,10 +1510,10 @@ main (argc, argv
/* egetenv is a pretty low-level facility, which may get called in
many circumstances; it seems flimsy to put off initializing it
until calling init_callproc. */
- set_initial_environment ();
+ set_process_environment ();
/* AIX crashes are reported in system versions 3.2.3 and 3.2.4
- if this is not done. Do it after set_global_environment so that we
- don't pollute Vglobal_environment. */
+ if this is not done. Do it after set_process_environment so that we
+ don't pollute Vprocess_environment. */
/* Setting LANG here will defeat the startup locale processing... */
#ifdef AIX3_2
putenv ("LANG=C");
@@ -1537,6 +1550,7 @@ main (argc, argv
syms_of_data ();
#endif
syms_of_alloc ();
+ syms_of_chartab ();
syms_of_lread ();
syms_of_print ();
syms_of_eval ();
@@ -1555,6 +1569,7 @@ main (argc, argv
/* Called before init_window_once for Mac OS Classic. */
syms_of_ccl ();
#endif
+ syms_of_character ();
syms_of_charset ();
syms_of_cmds ();
#ifndef NO_DIR_LIBRARY
@@ -1571,7 +1586,7 @@ main (argc, argv
#endif /* CLASH_DETECTION */
syms_of_indent ();
syms_of_insdel ();
- /* syms_of_keymap (); */
+ syms_of_keymap ();
syms_of_macros ();
syms_of_marker ();
syms_of_minibuf ();
@@ -1582,7 +1597,6 @@ main (argc, argv
syms_of_frame ();
#endif
syms_of_syntax ();
- syms_of_terminal ();
syms_of_term ();
syms_of_undo ();
#ifdef HAVE_SOUND
@@ -1602,6 +1616,9 @@ main (argc, argv
syms_of_window ();
syms_of_xdisp ();
#ifdef HAVE_WINDOW_SYSTEM
+#ifdef USE_FONT_BACKEND
+ syms_of_font ();
+#endif /* USE_FONT_BACKEND */
syms_of_fringe ();
syms_of_image ();
#endif /* HAVE_WINDOW_SYSTEM */
@@ -1667,7 +1684,15 @@ main (argc, argv
#endif /* HAVE_NTGUI */
}
- init_process (); /* init_display uses add_keyboard_wait_descriptor. */
+ init_charset ();
+
+ if (!noninteractive)
+ {
+#ifdef VMS
+ init_vms_input ();/* init_display calls get_frame_size, that needs this. */
+#endif /* VMS */
+ init_display (); /* Determine terminal type. init_sys_modes uses results. */
+ }
#ifndef MAC_OS8
/* Called before init_window_once for Mac OS Classic. */
init_keyboard (); /* This too must precede init_sys_modes. */
@@ -1675,13 +1700,7 @@ main (argc, argv
#ifdef VMS
init_vmsproc (); /* And this too. */
#endif /* VMS */
- if (!noninteractive)
- {
-#ifdef VMS
- init_vms_input ();/* init_display calls get_tty_size, that needs this. */
-#endif /* VMS */
- init_display (); /* Determine terminal type. Calls init_sys_modes. */
- }
+ init_sys_modes (); /* Init system terminal modes (RAW or CBREAK, etc.). */
init_fns ();
init_xdisp ();
#ifdef HAVE_WINDOW_SYSTEM
@@ -1694,6 +1713,7 @@ main (argc, argv
#ifdef VMS
init_vmsfns ();
#endif /* VMS */
+ init_process ();
#ifdef HAVE_SOUND
init_sound ();
#endif
@@ -1813,6 +1833,8 @@ struct standard_args standard_args[] =
{ "-unibyte", "--unibyte", 81, 0 },
{ "-no-multibyte", "--no-multibyte", 80, 0 },
{ "-nl", "--no-loadup", 70, 0 },
+ { "-enable-font-backend", "--enable-font-backend", 65, 0 },
+ { "-disable-font-backend", "--disable-font-backend", 65, 0 },
/* -d must come last before the options handled in startup.el. */
{ "-d", "--display", 60, 1 },
{ "-display", 0, 60, 1 },
@@ -1822,6 +1844,7 @@ struct standard_args standard_args[] =
{ "-q", "--no-init-file", 50, 0 },
{ "-no-init-file", 0, 50, 0 },
{ "-no-site-file", "--no-site-file", 40, 0 },
+ { "-no-splash", "--no-splash", 40, 0 },
{ "-u", "--user", 30, 1 },
{ "-user", 0, 30, 1 },
{ "-debug-init", "--debug-init", 20, 0 },
@@ -1856,8 +1879,6 @@ struct standard_args standard_args[] =
{ "-hb", "--horizontal-scroll-bars", 5, 0 },
{ "-vb", "--vertical-scroll-bars", 5, 0 },
{ "-color", "--color", 5, 0},
- { "-no-splash", "--no-splash", 3, 0 },
- { "-no-desktop", "--no-desktop", 3, 0 },
/* These have the same priority as ordinary file name args,
so they are not reordered with respect to those. */
{ "-L", "--directory", 0, 1 },
@@ -2107,14 +2128,15 @@ shut_down_emacs (sig, no_x, stuff)
if (EMACS_GET_TTY_PGRP (0, &tpgrp) != -1
&& tpgrp == pgrp)
{
- reset_all_sys_modes ();
+ fflush (stdout);
+ reset_sys_modes ();
if (sig && sig != SIGTERM)
fprintf (stderr, "Fatal error (%d)", sig);
}
}
#else
fflush (stdout);
- reset_all_sys_modes ();
+ reset_sys_modes ();
#endif
stuff_buffered_input (stuff);
@@ -2136,9 +2158,9 @@ shut_down_emacs (sig, no_x, stuff)
#if 0 /* This triggers a bug in XCloseDisplay and is not needed. */
#ifdef HAVE_X_WINDOWS
/* It's not safe to call intern here. Maybe we are crashing. */
- if (!noninteractive && SYMBOLP (Vinitial_window_system)
- && SCHARS (SYMBOL_NAME (Vinitial_window_system)) == 1
- && SREF (SYMBOL_NAME (Vinitial_window_system), 0) == 'x'
+ if (!noninteractive && SYMBOLP (Vwindow_system)
+ && SCHARS (SYMBOL_NAME (Vwindow_system)) == 1
+ && SREF (SYMBOL_NAME (Vwindow_system), 0) == 'x'
&& ! no_x)
Fx_close_current_connection ();
#endif /* HAVE_X_WINDOWS */
diff --git a/src/eval.c b/src/eval.c
index 77abe5046d..20be847f27 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1280,12 +1280,8 @@ unwind_to_catch (catch, value)
#if HAVE_X_WINDOWS
/* If x_catch_errors was done, turn it off now.
(First we give unbind_to a chance to do that.) */
-#if 0 /* This would disable x_catch_errors after x_connection_closed.
- * The catch must remain in effect during that delicate
- * state. --lorentey */
x_fully_uncatch_errors ();
#endif
-#endif
byte_stack_list = catch->byte_stack;
gcprolist = catch->gcpro;
@@ -1355,15 +1351,14 @@ if CONDITION-NAME is one of the error's condition names.
If an error happens, the first applicable handler is run.
The car of a handler may be a list of condition names
-instead of a single condition name. Then it handles all of them.
+instead of a single condition name.
-When a handler handles an error, control returns to the `condition-case'
-and it executes the handler's BODY...
-with VAR bound to (SIGNALED-CONDITIONS . SIGNAL-DATA) from the error.
-(If VAR is nil, the handler can't access that information.)
-Then the value of the last BODY form is returned from the `condition-case'
-expression.
+When a handler handles an error,
+control returns to the condition-case and the handler BODY... is executed
+with VAR bound to (SIGNALED-CONDITIONS . SIGNAL-DATA).
+VAR may be nil; then you do not get access to the signal information.
+The value of the last BODY form is returned from the condition-case.
See also the function `signal' for more info.
usage: (condition-case VAR BODYFORM &rest HANDLERS) */)
(args)
@@ -2073,7 +2068,7 @@ then strings and vectors are not accepted. */)
/* Emacs primitives are interactive if their DEFUN specifies an
interactive spec. */
if (SUBRP (fun))
- return XSUBR (fun)->intspec ? Qt : if_prop;
+ return XSUBR (fun)->prompt ? Qt : if_prop;
/* Bytecode objects are interactive if they are long enough to
have an element whose index is COMPILED_INTERACTIVE, which is
@@ -2197,7 +2192,7 @@ do_autoload (fundef, funname)
/* Value saved here is to be restored into Vautoload_queue. */
record_unwind_protect (un_autoload, Vautoload_queue);
Vautoload_queue = Qt;
- Fload (Fcar (Fcdr (fundef)), Qnil, Qt, Qnil, Qt);
+ Fload (Fcar (Fcdr (fundef)), Qnil, noninteractive ? Qt : Qnil, Qnil, Qt);
/* Save the old autoloads, in case we ever do an unload. */
queue = Vautoload_queue;
diff --git a/src/fileio.c b/src/fileio.c
index 29d12a0b0c..58c3e75111 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -74,12 +74,10 @@ extern int errno;
#include "lisp.h"
#include "intervals.h"
#include "buffer.h"
-#include "charset.h"
+#include "character.h"
#include "coding.h"
#include "window.h"
#include "blockinput.h"
-#include "frame.h"
-#include "dispextern.h"
#ifdef WINDOWSNT
#define NOMINMAX 1
@@ -273,9 +271,12 @@ report_file_error (string, data)
{
Lisp_Object errstring;
int errorno = errno;
+ char *str;
synchronize_system_messages_locale ();
- errstring = code_convert_string_norecord (build_string (strerror (errorno)),
+ str = strerror (errorno);
+ errstring = code_convert_string_norecord (make_unibyte_string (str,
+ strlen (str)),
Vlocale_coding_system, 0);
while (1)
@@ -313,6 +314,7 @@ restore_point_unwind (location)
Fset_marker (location, Qnil, Qnil);
return Qnil;
}
+
Lisp_Object Qexpand_file_name;
Lisp_Object Qsubstitute_in_file_name;
@@ -2293,7 +2295,8 @@ duplicates what `expand-file-name' does. */)
convert what we substitute into multibyte. */
while (*o)
{
- int c = unibyte_char_to_multibyte (*o++);
+ int c = *o++;
+ c = unibyte_char_to_multibyte (c);
x += CHAR_STRING (c, x);
}
}
@@ -3435,9 +3438,7 @@ Return nil, if file does not exist or is not accessible. */)
return make_number (st.st_mode & 07777);
}
-DEFUN ("set-file-modes", Fset_file_modes, Sset_file_modes, 2, 2,
- "(let ((file (read-file-name \"File: \"))) \
- (list file (read-file-modes nil file)))",
+DEFUN ("set-file-modes", Fset_file_modes, Sset_file_modes, 2, 2, 0,
doc: /* Set mode bits of file named FILENAME to MODE (an integer).
Only the 12 low bits of MODE are used. */)
(filename, mode)
@@ -3732,7 +3733,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
unsigned char buffer[1 << 14];
int replace_handled = 0;
int set_coding_system = 0;
- int coding_system_decided = 0;
+ Lisp_Object coding_system;
int read_quit = 0;
Lisp_Object old_Vdeactivate_mark = Vdeactivate_mark;
int we_locked_file = 0;
@@ -3753,6 +3754,10 @@ variable `last-coding-system-used' to the coding system actually used. */)
CHECK_STRING (filename);
filename = Fexpand_file_name (filename, Qnil);
+ /* The value Qnil means that the coding system is not yet
+ decided. */
+ coding_system = Qnil;
+
/* If the file name has special constructs in it,
call the corresponding file handler. */
handler = Ffind_file_name_handler (filename, Qinsert_file_contents);
@@ -3876,27 +3881,18 @@ variable `last-coding-system-used' to the coding system actually used. */)
if (EQ (Vcoding_system_for_read, Qauto_save_coding))
{
- /* We use emacs-mule for auto saving... */
- setup_coding_system (Qemacs_mule, &coding);
- /* ... but with the special flag to indicate to read in a
- multibyte sequence for eight-bit-control char as is. */
- coding.flags = 1;
- coding.src_multibyte = 0;
- coding.dst_multibyte
- = !NILP (current_buffer->enable_multibyte_characters);
- coding.eol_type = CODING_EOL_LF;
- coding_system_decided = 1;
+ coding_system = coding_inherit_eol_type (Qutf_8_emacs, Qunix);
+ setup_coding_system (coding_system, &coding);
+ /* Ensure we set Vlast_coding_system_used. */
+ set_coding_system = 1;
}
else if (BEG < Z)
{
/* Decide the coding system to use for reading the file now
because we can't use an optimized method for handling
`coding:' tag if the current buffer is not empty. */
- Lisp_Object val;
- val = Qnil;
-
if (!NILP (Vcoding_system_for_read))
- val = Vcoding_system_for_read;
+ coding_system = Vcoding_system_for_read;
else
{
/* Don't try looking inside a file for a coding system
@@ -3952,8 +3948,8 @@ variable `last-coding-system-used' to the coding system actually used. */)
insert_1_both (read_buf, nread, nread, 0, 0, 0);
TEMP_SET_PT_BOTH (BEG, BEG_BYTE);
- val = call2 (Vset_auto_coding_function,
- filename, make_number (nread));
+ coding_system = call2 (Vset_auto_coding_function,
+ filename, make_number (nread));
set_buffer_internal (prev);
/* Discard the unwind protect for recovering the
@@ -3967,34 +3963,33 @@ variable `last-coding-system-used' to the coding system actually used. */)
}
}
- if (NILP (val))
+ if (NILP (coding_system))
{
/* If we have not yet decided a coding system, check
file-coding-system-alist. */
- Lisp_Object args[6], coding_systems;
+ Lisp_Object args[6];
args[0] = Qinsert_file_contents, args[1] = orig_filename;
args[2] = visit, args[3] = beg, args[4] = end, args[5] = replace;
- coding_systems = Ffind_operation_coding_system (6, args);
- if (CONSP (coding_systems))
- val = XCAR (coding_systems);
+ coding_system = Ffind_operation_coding_system (6, args);
+ if (CONSP (coding_system))
+ coding_system = XCAR (coding_system);
}
}
- setup_coding_system (Fcheck_coding_system (val), &coding);
- /* Ensure we set Vlast_coding_system_used. */
- set_coding_system = 1;
+ if (NILP (coding_system))
+ coding_system = Qundecided;
+ else
+ CHECK_CODING_SYSTEM (coding_system);
- if (NILP (current_buffer->enable_multibyte_characters)
- && ! NILP (val))
+ if (NILP (current_buffer->enable_multibyte_characters))
/* We must suppress all character code conversion except for
end-of-line conversion. */
- setup_raw_text_coding_system (&coding);
+ coding_system = raw_text_coding_system (coding_system);
- coding.src_multibyte = 0;
- coding.dst_multibyte
- = !NILP (current_buffer->enable_multibyte_characters);
- coding_system_decided = 1;
+ setup_coding_system (coding_system, &coding);
+ /* Ensure we set Vlast_coding_system_used. */
+ set_coding_system = 1;
}
/* If requested, replace the accessible part of the buffer
@@ -4013,7 +4008,8 @@ variable `last-coding-system-used' to the coding system actually used. */)
and let the following if-statement handle the replace job. */
if (!NILP (replace)
&& BEGV < ZV
- && !(coding.common_flags & CODING_REQUIRE_DECODING_MASK))
+ && (NILP (coding_system)
+ || ! CODING_REQUIRE_DECODING (&coding)))
{
/* same_at_start and same_at_end count bytes,
because file access counts bytes
@@ -4048,21 +4044,15 @@ variable `last-coding-system-used' to the coding system actually used. */)
else if (nread == 0)
break;
- if (coding.type == coding_type_undecided)
- detect_coding (&coding, buffer, nread);
- if (coding.common_flags & CODING_REQUIRE_DECODING_MASK)
- /* We found that the file should be decoded somehow.
- Let's give up here. */
+ if (CODING_REQUIRE_DETECTION (&coding))
{
- giveup_match_end = 1;
- break;
+ coding_system = detect_coding_system (buffer, nread, nread, 1, 0,
+ coding_system);
+ setup_coding_system (coding_system, &coding);
}
- if (coding.eol_type == CODING_EOL_UNDECIDED)
- detect_eol (&coding, buffer, nread);
- if (coding.eol_type != CODING_EOL_UNDECIDED
- && coding.eol_type != CODING_EOL_LF)
- /* We found that the format of eol should be decoded.
+ if (CODING_REQUIRE_DECODING (&coding))
+ /* We found that the file should be decoded somehow.
Let's give up here. */
{
giveup_match_end = 1;
@@ -4207,124 +4197,108 @@ variable `last-coding-system-used' to the coding system actually used. */)
{
int same_at_start = BEGV_BYTE;
int same_at_end = ZV_BYTE;
+ int same_at_start_charpos;
+ int inserted_chars;
int overlap;
int bufpos;
- /* Make sure that the gap is large enough. */
- int bufsize = 2 * st.st_size;
- unsigned char *conversion_buffer = (unsigned char *) xmalloc (bufsize);
+ unsigned char *decoded;
int temp;
+ int this_count = SPECPDL_INDEX ();
+ int multibyte = ! NILP (current_buffer->enable_multibyte_characters);
+ Lisp_Object conversion_buffer;
+
+ conversion_buffer = code_conversion_save (1, multibyte);
/* First read the whole file, performing code conversion into
CONVERSION_BUFFER. */
if (lseek (fd, XINT (beg), 0) < 0)
- {
- xfree (conversion_buffer);
- report_file_error ("Setting file position",
- Fcons (orig_filename, Qnil));
- }
+ report_file_error ("Setting file position",
+ Fcons (orig_filename, Qnil));
total = st.st_size; /* Total bytes in the file. */
how_much = 0; /* Bytes read from file so far. */
inserted = 0; /* Bytes put into CONVERSION_BUFFER so far. */
unprocessed = 0; /* Bytes not processed in previous loop. */
+ GCPRO1 (conversion_buffer);
while (how_much < total)
{
+ /* We read one bunch by one (READ_BUF_SIZE bytes) to allow
+ quitting while reading a huge while. */
/* try is reserved in some compilers (Microsoft C) */
int trytry = min (total - how_much, READ_BUF_SIZE - unprocessed);
- unsigned char *destination = read_buf + unprocessed;
int this;
/* Allow quitting out of the actual I/O. */
immediate_quit = 1;
QUIT;
- this = emacs_read (fd, destination, trytry);
+ this = emacs_read (fd, read_buf + unprocessed, trytry);
immediate_quit = 0;
- if (this < 0 || this + unprocessed == 0)
+ if (this <= 0)
{
- how_much = this;
+ if (this < 0)
+ how_much = this;
break;
}
how_much += this;
- if (CODING_MAY_REQUIRE_DECODING (&coding))
- {
- int require, result;
-
- this += unprocessed;
-
- /* If we are using more space than estimated,
- make CONVERSION_BUFFER bigger. */
- require = decoding_buffer_size (&coding, this);
- if (inserted + require + 2 * (total - how_much) > bufsize)
- {
- bufsize = inserted + require + 2 * (total - how_much);
- conversion_buffer = (unsigned char *) xrealloc (conversion_buffer, bufsize);
- }
-
- /* Convert this batch with results in CONVERSION_BUFFER. */
- if (how_much >= total) /* This is the last block. */
- coding.mode |= CODING_MODE_LAST_BLOCK;
- if (coding.composing != COMPOSITION_DISABLED)
- coding_allocate_composition_data (&coding, BEGV);
- result = decode_coding (&coding, read_buf,
- conversion_buffer + inserted,
- this, bufsize - inserted);
-
- /* Save for next iteration whatever we didn't convert. */
- unprocessed = this - coding.consumed;
- bcopy (read_buf + coding.consumed, read_buf, unprocessed);
- if (!NILP (current_buffer->enable_multibyte_characters))
- this = coding.produced;
- else
- this = str_as_unibyte (conversion_buffer + inserted,
- coding.produced);
- }
-
- inserted += this;
+ BUF_SET_PT (XBUFFER (conversion_buffer),
+ BUF_Z (XBUFFER (conversion_buffer)));
+ decode_coding_c_string (&coding, read_buf, unprocessed + this,
+ conversion_buffer);
+ unprocessed = coding.carryover_bytes;
+ if (coding.carryover_bytes > 0)
+ bcopy (coding.carryover, read_buf, unprocessed);
}
+ UNGCPRO;
+ emacs_close (fd);
- /* At this point, INSERTED is how many characters (i.e. bytes)
- are present in CONVERSION_BUFFER.
- HOW_MUCH should equal TOTAL,
- or should be <= 0 if we couldn't read the file. */
+ /* At this point, HOW_MUCH should equal TOTAL, or should be <= 0
+ if we couldn't read the file. */
if (how_much < 0)
+ error ("IO error reading %s: %s",
+ SDATA (orig_filename), emacs_strerror (errno));
+
+ if (unprocessed > 0)
{
- xfree (conversion_buffer);
- coding_free_composition_data (&coding);
- error ("IO error reading %s: %s",
- SDATA (orig_filename), emacs_strerror (errno));
+ coding.mode |= CODING_MODE_LAST_BLOCK;
+ decode_coding_c_string (&coding, read_buf, unprocessed,
+ conversion_buffer);
+ coding.mode &= ~CODING_MODE_LAST_BLOCK;
}
- /* Compare the beginning of the converted file
- with the buffer text. */
+ decoded = BUF_BEG_ADDR (XBUFFER (conversion_buffer));
+ inserted = (BUF_Z_BYTE (XBUFFER (conversion_buffer))
+ - BUF_BEG_BYTE (XBUFFER (conversion_buffer)));
+
+ /* Compare the beginning of the converted string with the buffer
+ text. */
bufpos = 0;
while (bufpos < inserted && same_at_start < same_at_end
- && FETCH_BYTE (same_at_start) == conversion_buffer[bufpos])
+ && FETCH_BYTE (same_at_start) == decoded[bufpos])
same_at_start++, bufpos++;
- /* If the file matches the buffer completely,
+ /* If the file matches the head of buffer completely,
there's no need to replace anything. */
if (bufpos == inserted)
{
- xfree (conversion_buffer);
- coding_free_composition_data (&coding);
- emacs_close (fd);
specpdl_ptr--;
/* Truncate the buffer to the size of the file. */
del_range_byte (same_at_start, same_at_end, 0);
inserted = 0;
+
+ unbind_to (this_count, Qnil);
goto handled;
}
- /* Extend the start of non-matching text area to multibyte
- character boundary. */
+ /* Extend the start of non-matching text area to the previous
+ multibyte character boundary. */
if (! NILP (current_buffer->enable_multibyte_characters))
while (same_at_start > BEGV_BYTE
&& ! CHAR_HEAD_P (FETCH_BYTE (same_at_start)))
@@ -4337,11 +4311,11 @@ variable `last-coding-system-used' to the coding system actually used. */)
/* Compare with same_at_start to avoid counting some buffer text
as matching both at the file's beginning and at the end. */
while (bufpos > 0 && same_at_end > same_at_start
- && FETCH_BYTE (same_at_end - 1) == conversion_buffer[bufpos - 1])
+ && FETCH_BYTE (same_at_end - 1) == decoded[bufpos - 1])
same_at_end--, bufpos--;
- /* Extend the end of non-matching text area to multibyte
- character boundary. */
+ /* Extend the end of non-matching text area to the next
+ multibyte character boundary. */
if (! NILP (current_buffer->enable_multibyte_characters))
while (same_at_end < ZV_BYTE
&& ! CHAR_HEAD_P (FETCH_BYTE (same_at_end)))
@@ -4359,7 +4333,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
/* Replace the chars that we need to replace,
and update INSERTED to equal the number of bytes
- we are taking from the file. */
+ we are taking from the decoded string. */
inserted -= (ZV_BYTE - same_at_end) + (same_at_start - BEGV_BYTE);
if (same_at_end != same_at_start)
@@ -4374,20 +4348,25 @@ variable `last-coding-system-used' to the coding system actually used. */)
}
/* Insert from the file at the proper position. */
SET_PT_BOTH (temp, same_at_start);
- insert_1 (conversion_buffer + same_at_start - BEGV_BYTE, inserted,
- 0, 0, 0);
- if (coding.cmp_data && coding.cmp_data->used)
- coding_restore_composition (&coding, Fcurrent_buffer ());
- coding_free_composition_data (&coding);
-
+ same_at_start_charpos
+ = buf_bytepos_to_charpos (XBUFFER (conversion_buffer),
+ same_at_start);
+ inserted_chars
+ = (buf_bytepos_to_charpos (XBUFFER (conversion_buffer),
+ same_at_start + inserted)
+ - same_at_start_charpos);
+ /* This binding is to avoid ask-user-about-supersession-threat
+ being called in insert_from_buffer (via in
+ prepare_to_modify_buffer). */
+ specbind (intern ("buffer-file-name"), Qnil);
+ insert_from_buffer (XBUFFER (conversion_buffer),
+ same_at_start_charpos, inserted_chars, 0);
/* Set `inserted' to the number of inserted characters. */
inserted = PT - temp;
/* Set point before the inserted characters. */
SET_PT_BOTH (temp, same_at_start);
- xfree (conversion_buffer);
- emacs_close (fd);
- specpdl_ptr--;
+ unbind_to (this_count, Qnil);
goto handled;
}
@@ -4440,7 +4419,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
inserted = 0;
/* Here, we don't do code conversion in the loop. It is done by
- code_convert_region after all data are read into the buffer. */
+ decode_coding_gap after all data are read into the buffer. */
{
int gap_size = GAP_SIZE;
@@ -4545,26 +4524,23 @@ variable `last-coding-system-used' to the coding system actually used. */)
notfound:
- if (! coding_system_decided)
+ if (NILP (coding_system))
{
/* The coding system is not yet decided. Decide it by an
optimized method for handling `coding:' tag.
Note that we can get here only if the buffer was empty
before the insertion. */
- Lisp_Object val;
- val = Qnil;
if (!NILP (Vcoding_system_for_read))
- val = Vcoding_system_for_read;
+ coding_system = Vcoding_system_for_read;
else
{
/* Since we are sure that the current buffer was empty
before the insertion, we can toggle
enable-multibyte-characters directly here without taking
- care of marker adjustment and byte combining problem. By
- this way, we can run Lisp program safely before decoding
- the inserted text. */
+ care of marker adjustment. By this way, we can run Lisp
+ program safely before decoding the inserted text. */
Lisp_Object unwind_data;
int count = SPECPDL_INDEX ();
@@ -4577,72 +4553,69 @@ variable `last-coding-system-used' to the coding system actually used. */)
if (inserted > 0 && ! NILP (Vset_auto_coding_function))
{
- val = call2 (Vset_auto_coding_function,
- filename, make_number (inserted));
+ coding_system = call2 (Vset_auto_coding_function,
+ filename, make_number (inserted));
}
- if (NILP (val))
+ if (NILP (coding_system))
{
/* If the coding system is not yet decided, check
file-coding-system-alist. */
- Lisp_Object args[6], coding_systems;
+ Lisp_Object args[6];
args[0] = Qinsert_file_contents, args[1] = orig_filename;
args[2] = visit, args[3] = beg, args[4] = end, args[5] = Qnil;
- coding_systems = Ffind_operation_coding_system (6, args);
- if (CONSP (coding_systems))
- val = XCAR (coding_systems);
+ coding_system = Ffind_operation_coding_system (6, args);
+ if (CONSP (coding_system))
+ coding_system = XCAR (coding_system);
}
unbind_to (count, Qnil);
inserted = Z_BYTE - BEG_BYTE;
}
- /* The following kludgy code is to avoid some compiler bug.
- We can't simply do
- setup_coding_system (val, &coding);
- on some system. */
- {
- struct coding_system temp_coding;
- setup_coding_system (Fcheck_coding_system (val), &temp_coding);
- bcopy (&temp_coding, &coding, sizeof coding);
- }
- /* Ensure we set Vlast_coding_system_used. */
- set_coding_system = 1;
+ if (NILP (coding_system))
+ coding_system = Qundecided;
+ else
+ CHECK_CODING_SYSTEM (coding_system);
- if (NILP (current_buffer->enable_multibyte_characters)
- && ! NILP (val))
+ if (NILP (current_buffer->enable_multibyte_characters))
/* We must suppress all character code conversion except for
end-of-line conversion. */
- setup_raw_text_coding_system (&coding);
- coding.src_multibyte = 0;
- coding.dst_multibyte
- = !NILP (current_buffer->enable_multibyte_characters);
+ coding_system = raw_text_coding_system (coding_system);
+ setup_coding_system (coding_system, &coding);
+ /* Ensure we set Vlast_coding_system_used. */
+ set_coding_system = 1;
}
- if (!NILP (visit)
- /* Can't do this if part of the buffer might be preserved. */
- && NILP (replace)
- && (coding.type == coding_type_no_conversion
- || coding.type == coding_type_raw_text))
+ if (!NILP (visit))
{
- /* Visiting a file with these coding system makes the buffer
- unibyte. */
- current_buffer->enable_multibyte_characters = Qnil;
- coding.dst_multibyte = 0;
+ /* When we visit a file by raw-text, we change the buffer to
+ unibyte. */
+ if (CODING_FOR_UNIBYTE (&coding)
+ /* Can't do this if part of the buffer might be preserved. */
+ && NILP (replace))
+ /* Visiting a file with these coding system makes the buffer
+ unibyte. */
+ current_buffer->enable_multibyte_characters = Qnil;
}
- if (inserted > 0 || coding.type == coding_type_ccl)
+ coding.dst_multibyte = ! NILP (current_buffer->enable_multibyte_characters);
+ if (CODING_MAY_REQUIRE_DECODING (&coding)
+ && (inserted > 0 || CODING_REQUIRE_FLUSHING (&coding)))
{
- if (CODING_MAY_REQUIRE_DECODING (&coding))
- {
- code_convert_region (PT, PT_BYTE, PT + inserted, PT_BYTE + inserted,
- &coding, 0, 0);
- inserted = coding.produced_char;
- }
- else
- adjust_after_insert (PT, PT_BYTE, PT + inserted, PT_BYTE + inserted,
- inserted);
+ move_gap_both (PT, PT_BYTE);
+ GAP_SIZE += inserted;
+ ZV_BYTE -= inserted;
+ Z_BYTE -= inserted;
+ ZV -= inserted;
+ Z -= inserted;
+ decode_coding_gap (&coding, inserted, inserted);
+ inserted = coding.produced_char;
+ coding_system = CODING_ID_NAME (coding.id);
}
+ else if (inserted > 0)
+ adjust_after_insert (PT, PT_BYTE, PT + inserted, PT_BYTE + inserted,
+ inserted);
/* Now INSERTED is measured in characters. */
@@ -4650,8 +4623,8 @@ variable `last-coding-system-used' to the coding system actually used. */)
/* Use the conversion type to determine buffer-file-type
(find-buffer-file-type is now used to help determine the
conversion). */
- if ((coding.eol_type == CODING_EOL_UNDECIDED
- || coding.eol_type == CODING_EOL_LF)
+ if ((VECTORP (CODING_ID_EOL_TYPE (coding.id))
+ || EQ (CODING_ID_EOL_TYPE (coding.id), Qunix))
&& ! CODING_REQUIRE_DECODING (&coding))
current_buffer->buffer_file_type = Qt;
else
@@ -4691,7 +4664,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
}
if (set_coding_system)
- Vlast_coding_system_used = coding.symbol;
+ Vlast_coding_system_used = coding_system;
if (! NILP (Ffboundp (Qafter_insert_file_set_coding)))
{
@@ -4852,8 +4825,6 @@ variable `last-coding-system-used' to the coding system actually used. */)
}
static Lisp_Object build_annotations P_ ((Lisp_Object, Lisp_Object));
-static Lisp_Object build_annotations_2 P_ ((Lisp_Object, Lisp_Object,
- Lisp_Object, Lisp_Object));
/* If build_annotations switched buffers, switch back to BUF.
Kill the temporary buffer that was selected in the meantime.
@@ -4878,26 +4849,21 @@ build_annotations_unwind (buf)
/* Decide the coding-system to encode the data with. */
-void
+static Lisp_Object
choose_write_coding_system (start, end, filename,
append, visit, lockname, coding)
Lisp_Object start, end, filename, append, visit, lockname;
struct coding_system *coding;
{
Lisp_Object val;
+ Lisp_Object eol_parent = Qnil;
if (auto_saving
&& NILP (Fstring_equal (current_buffer->filename,
current_buffer->auto_save_file_name)))
{
- /* We use emacs-mule for auto saving... */
- setup_coding_system (Qemacs_mule, coding);
- /* ... but with the special flag to indicate not to strip off
- leading code of eight-bit-control chars. */
- coding->flags = 1;
- /* We force LF for end-of-line because that is faster. */
- coding->eol_type = CODING_EOL_LF;
- goto done_setup_coding;
+ val = Qutf_8_emacs;
+ eol_parent = Qunix;
}
else if (!NILP (Vcoding_system_for_write))
{
@@ -4945,8 +4911,7 @@ choose_write_coding_system (start, end, filename,
val = XCDR (coding_systems);
}
- if (NILP (val)
- && !NILP (current_buffer->buffer_file_coding_system))
+ if (NILP (val))
{
/* If we still have not decided a coding system, use the
default value of buffer-file-coding-system. */
@@ -4954,45 +4919,42 @@ choose_write_coding_system (start, end, filename,
using_default_coding = 1;
}
+ if (! NILP (val) && ! force_raw_text)
+ {
+ Lisp_Object spec, attrs;
+
+ CHECK_CODING_SYSTEM_GET_SPEC (val, spec);
+ attrs = AREF (spec, 0);
+ if (EQ (CODING_ATTR_TYPE (attrs), Qraw_text))
+ force_raw_text = 1;
+ }
+
if (!force_raw_text
&& !NILP (Ffboundp (Vselect_safe_coding_system_function)))
/* Confirm that VAL can surely encode the current region. */
val = call5 (Vselect_safe_coding_system_function,
start, end, val, Qnil, filename);
- setup_coding_system (Fcheck_coding_system (val), coding);
- if (coding->eol_type == CODING_EOL_UNDECIDED
- && !using_default_coding)
- {
- if (! EQ (default_buffer_file_coding.symbol,
- buffer_defaults.buffer_file_coding_system))
- setup_coding_system (buffer_defaults.buffer_file_coding_system,
- &default_buffer_file_coding);
- if (default_buffer_file_coding.eol_type != CODING_EOL_UNDECIDED)
- {
- Lisp_Object subsidiaries;
-
- coding->eol_type = default_buffer_file_coding.eol_type;
- subsidiaries = Fget (coding->symbol, Qeol_type);
- if (VECTORP (subsidiaries)
- && XVECTOR (subsidiaries)->size == 3)
- coding->symbol
- = XVECTOR (subsidiaries)->contents[coding->eol_type];
- }
- }
+ /* If the decided coding-system doesn't specify end-of-line
+ format, we use that of
+ `default-buffer-file-coding-system'. */
+ if (! using_default_coding
+ && ! NILP (buffer_defaults.buffer_file_coding_system))
+ val = (coding_inherit_eol_type
+ (val, buffer_defaults.buffer_file_coding_system));
+ /* If we decide not to encode text, use `raw-text' or one of its
+ subsidiaries. */
if (force_raw_text)
- setup_raw_text_coding_system (coding);
- goto done_setup_coding;
+ val = raw_text_coding_system (val);
}
- setup_coding_system (Fcheck_coding_system (val), coding);
+ val = coding_inherit_eol_type (val, eol_parent);
+ setup_coding_system (val, coding);
- done_setup_coding:
- if (coding->eol_type == CODING_EOL_UNDECIDED)
- coding->eol_type = system_eol_type;
if (!STRINGP (start) && !NILP (current_buffer->selective_display))
coding->mode |= CODING_MODE_SELECTIVE_DISPLAY;
+ return val;
}
DEFUN ("write-region", Fwrite_region, Swrite_region, 3, 7,
@@ -5037,7 +4999,6 @@ This does code conversion according to the value of
int save_errno = 0;
const unsigned char *fn;
struct stat st;
- int tem;
int count = SPECPDL_INDEX ();
int count1;
#ifdef VMS
@@ -5137,21 +5098,9 @@ This does code conversion according to the value of
We used to make this choice before calling build_annotations, but that
leads to problems when a write-annotate-function takes care of
unsavable chars (as was the case with X-Symbol). */
- choose_write_coding_system (start, end, filename,
- append, visit, lockname, &coding);
- Vlast_coding_system_used = coding.symbol;
-
- given_buffer = current_buffer;
- if (! STRINGP (start))
- {
- annotations = build_annotations_2 (start, end,
- coding.pre_write_conversion, annotations);
- if (current_buffer != given_buffer)
- {
- XSETFASTINT (start, BEGV);
- XSETFASTINT (end, ZV);
- }
- }
+ Vlast_coding_system_used
+ = choose_write_coding_system (start, end, filename,
+ append, visit, lockname, &coding);
#ifdef CLASH_DETECTION
if (!auto_saving)
@@ -5289,6 +5238,9 @@ This does code conversion according to the value of
if (GPT > BEG && GPT_ADDR[-1] != '\n')
move_gap (find_next_newline (GPT, 1));
#else
+#if 0
+ /* The new encoding routine doesn't require the following. */
+
/* Whether VMS or not, we must move the gap to the next of newline
when we must put designation sequences at beginning of line. */
if (INTEGERP (start)
@@ -5302,6 +5254,7 @@ This does code conversion according to the value of
SET_PT_BOTH (opoint, opoint_byte);
}
#endif
+#endif
failure = 0;
immediate_quit = 1;
@@ -5314,23 +5267,10 @@ This does code conversion according to the value of
}
else if (XINT (start) != XINT (end))
{
- tem = CHAR_TO_BYTE (XINT (start));
-
- if (XINT (start) < GPT)
- {
- failure = 0 > a_write (desc, Qnil, XINT (start),
- min (GPT, XINT (end)) - XINT (start),
- &annotations, &coding);
- save_errno = errno;
- }
-
- if (XINT (end) > GPT && !failure)
- {
- tem = max (XINT (start), GPT);
- failure = 0 > a_write (desc, Qnil, tem , XINT (end) - tem,
- &annotations, &coding);
- save_errno = errno;
- }
+ failure = 0 > a_write (desc, Qnil,
+ XINT (start), XINT (end) - XINT (start),
+ &annotations, &coding);
+ save_errno = errno;
}
else
{
@@ -5346,7 +5286,7 @@ This does code conversion according to the value of
{
/* We have to flush out a data. */
coding.mode |= CODING_MODE_LAST_BLOCK;
- failure = 0 > e_write (desc, Qnil, 0, 0, &coding);
+ failure = 0 > e_write (desc, Qnil, 1, 1, &coding);
save_errno = errno;
}
@@ -5359,10 +5299,8 @@ This does code conversion according to the value of
it, and that means the fsync here is not crucial for autosave files. */
if (!auto_saving && !write_region_inhibit_fsync && fsync (desc) < 0)
{
- /* If fsync fails with EINTR, don't treat that as serious. Also
- ignore EINVAL which happens when fsync is not supported on this
- file. */
- if (errno != EINTR && errno != EINVAL)
+ /* If fsync fails with EINTR, don't treat that as serious. */
+ if (errno != EINTR)
failure = 1, save_errno = errno;
}
#endif
@@ -5545,30 +5483,6 @@ build_annotations (start, end)
return annotations;
}
-static Lisp_Object
-build_annotations_2 (start, end, pre_write_conversion, annotations)
- Lisp_Object start, end, pre_write_conversion, annotations;
-{
- struct gcpro gcpro1;
- Lisp_Object res;
-
- GCPRO1 (annotations);
- /* At last, do the same for the function PRE_WRITE_CONVERSION
- implied by the current coding-system. */
- if (!NILP (pre_write_conversion))
- {
- struct buffer *given_buffer = current_buffer;
- Vwrite_region_annotations_so_far = annotations;
- res = call2 (pre_write_conversion, start, end);
- Flength (res);
- annotations = (current_buffer != given_buffer
- ? res
- : merge (annotations, res, Qcar_less_than_car));
- }
-
- UNGCPRO;
- return annotations;
-}
/* Write to descriptor DESC the NCHARS chars starting at POS of STRING.
If STRING is nil, POS is the character position in the current buffer.
@@ -5624,9 +5538,6 @@ a_write (desc, string, pos, nchars, annot, coding)
return 0;
}
-#ifndef WRITE_BUF_SIZE
-#define WRITE_BUF_SIZE (16 * 1024)
-#endif
/* Write text in the range START and END into descriptor DESC,
encoding them with coding system CODING. If STRING is nil, START
@@ -5640,78 +5551,77 @@ e_write (desc, string, start, end, coding)
int start, end;
struct coding_system *coding;
{
- register char *addr;
- register int nbytes;
- char buf[WRITE_BUF_SIZE];
- int return_val = 0;
-
- if (start >= end)
- coding->composing = COMPOSITION_DISABLED;
- if (coding->composing != COMPOSITION_DISABLED)
- coding_save_composition (coding, start, end, string);
-
if (STRINGP (string))
{
- addr = SDATA (string);
- nbytes = SBYTES (string);
- coding->src_multibyte = STRING_MULTIBYTE (string);
- }
- else if (start < end)
- {
- /* It is assured that the gap is not in the range START and END-1. */
- addr = CHAR_POS_ADDR (start);
- nbytes = CHAR_TO_BYTE (end) - CHAR_TO_BYTE (start);
- coding->src_multibyte
- = !NILP (current_buffer->enable_multibyte_characters);
- }
- else
- {
- addr = "";
- nbytes = 0;
- coding->src_multibyte = 1;
+ start = 0;
+ end = SCHARS (string);
}
/* We used to have a code for handling selective display here. But,
now it is handled within encode_coding. */
- while (1)
- {
- int result;
- result = encode_coding (coding, addr, buf, nbytes, WRITE_BUF_SIZE);
- if (coding->produced > 0)
+ while (start < end)
+ {
+ if (STRINGP (string))
{
- coding->produced -= emacs_write (desc, buf, coding->produced);
- if (coding->produced)
+ coding->src_multibyte = SCHARS (string) < SBYTES (string);
+ if (CODING_REQUIRE_ENCODING (coding))
{
- return_val = -1;
- break;
+ encode_coding_object (coding, string,
+ start, string_char_to_byte (string, start),
+ end, string_char_to_byte (string, end), Qt);
+ }
+ else
+ {
+ coding->dst_object = string;
+ coding->consumed_char = SCHARS (string);
+ coding->produced = SBYTES (string);
}
}
- nbytes -= coding->consumed;
- addr += coding->consumed;
- if (result == CODING_FINISH_INSUFFICIENT_SRC
- && nbytes > 0)
+ else
{
- /* The source text ends by an incomplete multibyte form.
- There's no way other than write it out as is. */
- nbytes -= emacs_write (desc, addr, nbytes);
- if (nbytes)
+ int start_byte = CHAR_TO_BYTE (start);
+ int end_byte = CHAR_TO_BYTE (end);
+
+ coding->src_multibyte = (end - start) < (end_byte - start_byte);
+ if (CODING_REQUIRE_ENCODING (coding))
{
- return_val = -1;
- break;
+ encode_coding_object (coding, Fcurrent_buffer (),
+ start, start_byte, end, end_byte, Qt);
+ }
+ else
+ {
+ coding->dst_object = Qnil;
+ coding->dst_pos_byte = start_byte;
+ if (start >= GPT || end <= GPT)
+ {
+ coding->consumed_char = end - start;
+ coding->produced = end_byte - start_byte;
+ }
+ else
+ {
+ coding->consumed_char = GPT - start;
+ coding->produced = GPT_BYTE - start_byte;
+ }
}
}
- if (nbytes <= 0)
- break;
+
+ if (coding->produced > 0)
+ {
+ coding->produced -=
+ emacs_write (desc,
+ STRINGP (coding->dst_object)
+ ? SDATA (coding->dst_object)
+ : BYTE_POS_ADDR (coding->dst_pos_byte),
+ coding->produced);
+
+ if (coding->produced)
+ return -1;
+ }
start += coding->consumed_char;
- if (coding->cmp_data)
- coding_adjust_composition_offset (coding, start);
}
- if (coding->cmp_data)
- coding_free_composition_data (coding);
-
- return return_val;
+ return 0;
}
DEFUN ("verify-visited-file-modtime", Fverify_visited_file_modtime,
@@ -5831,7 +5741,7 @@ auto_save_error (error)
char *msgbuf;
USE_SAFE_ALLOCA;
- ring_bell (XFRAME (selected_frame));
+ ring_bell ();
args[0] = build_string ("Auto-saving %s: %s");
args[1] = current_buffer->name;
@@ -6012,7 +5922,7 @@ A non-nil CURRENT-ONLY argument means save only current buffer. */)
couldn't handle some ange-ftp'd file. */
for (do_handled_files = 0; do_handled_files < 2; do_handled_files++)
- for (tail = Vbuffer_alist; GC_CONSP (tail); tail = XCDR (tail))
+ for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail))
{
buf = XCDR (XCAR (tail));
b = XBUFFER (buf);
@@ -6288,9 +6198,9 @@ DEFUN ("read-file-name-internal", Fread_file_name_internal, Sread_file_name_inte
{
Lisp_Object tem = XCAR (all);
int len;
- if (STRINGP (tem)
- && (len = SBYTES (tem), len > 0)
- && IS_DIRECTORY_SEP (SREF (tem, len-1)))
+ if (STRINGP (tem) &&
+ (len = SBYTES (tem), len > 0) &&
+ IS_DIRECTORY_SEP (SREF (tem, len-1)))
comp = Fcons (tem, comp);
}
}
@@ -6393,7 +6303,7 @@ and `read-file-name-function'. */)
/* If dir starts with user's homedir, change that to ~. */
homedir = (char *) egetenv ("HOME");
#ifdef DOS_NT
- /* homedir can be NULL in temacs, since Vglobal_environment is not
+ /* homedir can be NULL in temacs, since Vprocess_environment is not
yet set up. We shouldn't crash in that case. */
if (homedir != 0)
{
diff --git a/src/filelock.c b/src/filelock.c
index 4c211bf994..b479a80286 100644
--- a/src/filelock.c
+++ b/src/filelock.c
@@ -53,7 +53,7 @@ extern int errno;
#include "lisp.h"
#include "buffer.h"
-#include "charset.h"
+#include "character.h"
#include "coding.h"
#include "systime.h"
@@ -666,7 +666,7 @@ unlock_all_files ()
register Lisp_Object tail;
register struct buffer *b;
- for (tail = Vbuffer_alist; GC_CONSP (tail); tail = XCDR (tail))
+ for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail))
{
b = XBUFFER (XCDR (XCAR (tail)));
if (STRINGP (b->file_truename) && BUF_SAVE_MODIFF (b) < BUF_MODIFF (b))
diff --git a/src/floatfns.c b/src/floatfns.c
index a20f7981bf..6ad9b95686 100644
--- a/src/floatfns.c
+++ b/src/floatfns.c
@@ -454,7 +454,7 @@ DEFUN ("expt", Fexpt, Sexpt, 2, 2, 0,
(arg1, arg2)
register Lisp_Object arg1, arg2;
{
- double f1, f2, f3;
+ double f1, f2;
CHECK_NUMBER_OR_FLOAT (arg1);
CHECK_NUMBER_OR_FLOAT (arg2);
@@ -500,11 +500,8 @@ DEFUN ("expt", Fexpt, Sexpt, 2, 2, 0,
else if ((f1 == 0.0 && f2 < 0.0) || (f1 < 0 && f2 != floor(f2)))
domain_error2 ("expt", arg1, arg2);
#endif
- IN_FLOAT2 (f3 = pow (f1, f2), "expt", arg1, arg2);
- /* Check for overflow in the result. */
- if (f1 != 0.0 && f3 == 0.0)
- range_error ("expt", arg1);
- return make_float (f3);
+ IN_FLOAT2 (f1 = pow (f1, f2), "expt", arg1, arg2);
+ return make_float (f1);
}
DEFUN ("log", Flog, Slog, 1, 2, 0,
diff --git a/src/fns.c b/src/fns.c
index f881ed53f8..67f3a38055 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -39,7 +39,7 @@ Boston, MA 02110-1301, USA. */
#include "lisp.h"
#include "commands.h"
-#include "charset.h"
+#include "character.h"
#include "coding.h"
#include "buffer.h"
#include "keyboard.h"
@@ -151,8 +151,6 @@ To get the number of bytes, use `string-bytes'. */)
XSETFASTINT (val, SCHARS (sequence));
else if (VECTORP (sequence))
XSETFASTINT (val, ASIZE (sequence));
- else if (SUB_CHAR_TABLE_P (sequence))
- XSETFASTINT (val, SUB_CHAR_TABLE_ORDINARY_SLOTS);
else if (CHAR_TABLE_P (sequence))
XSETFASTINT (val, MAX_CHAR);
else if (BOOL_VECTOR_P (sequence))
@@ -217,7 +215,7 @@ which is at least the number of distinct elements. */)
DEFUN ("string-bytes", Fstring_bytes, Sstring_bytes, 1, 1, 0,
doc: /* Return the number of bytes in STRING.
-If STRING is a multibyte string, this is greater than the length of STRING. */)
+If STRING is multibyte, this may be greater than the length of STRING. */)
(string)
Lisp_Object string;
{
@@ -464,28 +462,6 @@ usage: (vconcat &rest SEQUENCES) */)
return concat (nargs, args, Lisp_Vectorlike, 0);
}
-/* Return a copy of a sub char table ARG. The elements except for a
- nested sub char table are not copied. */
-static Lisp_Object
-copy_sub_char_table (arg)
- Lisp_Object arg;
-{
- Lisp_Object copy = make_sub_char_table (Qnil);
- int i;
-
- XCHAR_TABLE (copy)->defalt = XCHAR_TABLE (arg)->defalt;
- /* Copy all the contents. */
- bcopy (XCHAR_TABLE (arg)->contents, XCHAR_TABLE (copy)->contents,
- SUB_CHAR_TABLE_ORDINARY_SLOTS * sizeof (Lisp_Object));
- /* Recursively copy any sub char-tables in the ordinary slots. */
- for (i = 32; i < SUB_CHAR_TABLE_ORDINARY_SLOTS; i++)
- if (SUB_CHAR_TABLE_P (XCHAR_TABLE (arg)->contents[i]))
- XCHAR_TABLE (copy)->contents[i]
- = copy_sub_char_table (XCHAR_TABLE (copy)->contents[i]);
-
- return copy;
-}
-
DEFUN ("copy-sequence", Fcopy_sequence, Scopy_sequence, 1, 1, 0,
doc: /* Return a copy of a list, vector, string or char-table.
@@ -498,24 +474,7 @@ with the original. */)
if (CHAR_TABLE_P (arg))
{
- int i;
- Lisp_Object copy;
-
- copy = Fmake_char_table (XCHAR_TABLE (arg)->purpose, Qnil);
- /* Copy all the slots, including the extra ones. */
- bcopy (XVECTOR (arg)->contents, XVECTOR (copy)->contents,
- ((XCHAR_TABLE (arg)->size & PSEUDOVECTOR_SIZE_MASK)
- * sizeof (Lisp_Object)));
-
- /* Recursively copy any sub char tables in the ordinary slots
- for multibyte characters. */
- for (i = CHAR_TABLE_SINGLE_BYTE_SLOTS;
- i < CHAR_TABLE_ORDINARY_SLOTS; i++)
- if (SUB_CHAR_TABLE_P (XCHAR_TABLE (arg)->contents[i]))
- XCHAR_TABLE (copy)->contents[i]
- = copy_sub_char_table (XCHAR_TABLE (copy)->contents[i]);
-
- return copy;
+ return copy_char_table (arg);
}
if (BOOL_VECTOR_P (arg))
@@ -618,10 +577,10 @@ concat (nargs, args, target_type, last_special)
for (i = 0; i < len; i++)
{
ch = AREF (this, i);
- CHECK_NUMBER (ch);
+ CHECK_CHARACTER (ch);
this_len_byte = CHAR_BYTES (XINT (ch));
result_len_byte += this_len_byte;
- if (!SINGLE_BYTE_CHAR_P (XINT (ch)))
+ if (! ASCII_CHAR_P (XINT (ch)) && ! CHAR_BYTE8_P (XINT (ch)))
some_multibyte = 1;
}
else if (BOOL_VECTOR_P (this) && XBOOL_VECTOR (this)->size > 0)
@@ -630,10 +589,10 @@ concat (nargs, args, target_type, last_special)
for (; CONSP (this); this = XCDR (this))
{
ch = XCAR (this);
- CHECK_NUMBER (ch);
+ CHECK_CHARACTER (ch);
this_len_byte = CHAR_BYTES (XINT (ch));
result_len_byte += this_len_byte;
- if (!SINGLE_BYTE_CHAR_P (XINT (ch)))
+ if (! ASCII_CHAR_P (XINT (ch)) && ! CHAR_BYTE8_P (XINT (ch)))
some_multibyte = 1;
}
else if (STRINGP (this))
@@ -749,9 +708,7 @@ concat (nargs, args, target_type, last_special)
{
XSETFASTINT (elt, SREF (this, thisindex)); thisindex++;
if (some_multibyte
- && (XINT (elt) >= 0240
- || (XINT (elt) >= 0200
- && ! NILP (Vnonascii_translation_table)))
+ && XINT (elt) >= 0200
&& XINT (elt) < 0400)
{
c = unibyte_char_to_multibyte (XINT (elt));
@@ -784,28 +741,12 @@ concat (nargs, args, target_type, last_special)
else
{
CHECK_NUMBER (elt);
- if (SINGLE_BYTE_CHAR_P (XINT (elt)))
- {
- if (some_multibyte)
- toindex_byte
- += CHAR_STRING (XINT (elt),
- SDATA (val) + toindex_byte);
- else
- SSET (val, toindex_byte++, XINT (elt));
- toindex++;
- }
+ if (some_multibyte)
+ toindex_byte += CHAR_STRING (XINT (elt),
+ SDATA (val) + toindex_byte);
else
- /* If we have any multibyte characters,
- we already decided to make a multibyte string. */
- {
- int c = XINT (elt);
- /* P exists as a variable
- to avoid a bug on the Masscomp C compiler. */
- unsigned char *p = SDATA (val) + toindex_byte;
-
- toindex_byte += CHAR_STRING (c, p);
- toindex++;
- }
+ SSET (val, toindex_byte++, XINT (elt));
+ toindex++;
}
}
}
@@ -855,7 +796,7 @@ string_char_to_byte (string, char_index)
Lisp_Object string;
int char_index;
{
- int i, i_byte;
+ int i_byte;
int best_below, best_below_byte;
int best_above, best_above_byte;
@@ -881,40 +822,30 @@ string_char_to_byte (string, char_index)
if (char_index - best_below < best_above - char_index)
{
+ unsigned char *p = SDATA (string) + best_below_byte;
+
while (best_below < char_index)
{
- int c;
- FETCH_STRING_CHAR_ADVANCE_NO_CHECK (c, string,
- best_below, best_below_byte);
+ p += BYTES_BY_CHAR_HEAD (*p);
+ best_below++;
}
- i = best_below;
- i_byte = best_below_byte;
+ i_byte = p - SDATA (string);
}
else
{
+ unsigned char *p = SDATA (string) + best_above_byte;
+
while (best_above > char_index)
{
- unsigned char *pend = SDATA (string) + best_above_byte;
- unsigned char *pbeg = pend - best_above_byte;
- unsigned char *p = pend - 1;
- int bytes;
-
- while (p > pbeg && !CHAR_HEAD_P (*p)) p--;
- PARSE_MULTIBYTE_SEQ (p, pend - p, bytes);
- if (bytes == pend - p)
- best_above_byte -= bytes;
- else if (bytes > pend - p)
- best_above_byte -= (pend - p);
- else
- best_above_byte--;
+ p--;
+ while (!CHAR_HEAD_P (*p)) p--;
best_above--;
}
- i = best_above;
- i_byte = best_above_byte;
+ i_byte = p - SDATA (string);
}
string_char_byte_cache_bytepos = i_byte;
- string_char_byte_cache_charpos = i;
+ string_char_byte_cache_charpos = char_index;
string_char_byte_cache_string = string;
return i_byte;
@@ -953,36 +884,30 @@ string_byte_to_char (string, byte_index)
if (byte_index - best_below_byte < best_above_byte - byte_index)
{
- while (best_below_byte < byte_index)
+ unsigned char *p = SDATA (string) + best_below_byte;
+ unsigned char *pend = SDATA (string) + byte_index;
+
+ while (p < pend)
{
- int c;
- FETCH_STRING_CHAR_ADVANCE_NO_CHECK (c, string,
- best_below, best_below_byte);
+ p += BYTES_BY_CHAR_HEAD (*p);
+ best_below++;
}
i = best_below;
- i_byte = best_below_byte;
+ i_byte = p - SDATA (string);
}
else
{
- while (best_above_byte > byte_index)
+ unsigned char *p = SDATA (string) + best_above_byte;
+ unsigned char *pbeg = SDATA (string) + byte_index;
+
+ while (p > pbeg)
{
- unsigned char *pend = SDATA (string) + best_above_byte;
- unsigned char *pbeg = pend - best_above_byte;
- unsigned char *p = pend - 1;
- int bytes;
-
- while (p > pbeg && !CHAR_HEAD_P (*p)) p--;
- PARSE_MULTIBYTE_SEQ (p, pend - p, bytes);
- if (bytes == pend - p)
- best_above_byte -= bytes;
- else if (bytes > pend - p)
- best_above_byte -= (pend - p);
- else
- best_above_byte--;
+ p--;
+ while (!CHAR_HEAD_P (*p)) p--;
best_above--;
}
i = best_above;
- i_byte = best_above_byte;
+ i_byte = p - SDATA (string);
}
string_char_byte_cache_bytepos = i_byte;
@@ -992,9 +917,7 @@ string_byte_to_char (string, byte_index)
return i;
}
-/* Convert STRING to a multibyte string.
- Single-byte characters 0240 through 0377 are converted
- by adding nonascii_insert_offset to each. */
+/* Convert STRING to a multibyte string. */
Lisp_Object
string_make_multibyte (string)
@@ -1026,10 +949,9 @@ string_make_multibyte (string)
}
-/* Convert STRING to a multibyte string without changing each
- character codes. Thus, characters 0200 trough 0237 are converted
- to eight-bit-control characters, and characters 0240 through 0377
- are converted eight-bit-graphic characters. */
+/* Convert STRING (if unibyte) to a multibyte string without changing
+ the number of characters. Characters 0200 trough 0237 are
+ converted to eight-bit characters. */
Lisp_Object
string_to_multibyte (string)
@@ -1044,8 +966,8 @@ string_to_multibyte (string)
return string;
nbytes = parse_str_to_multibyte (SDATA (string), SBYTES (string));
- /* If all the chars are ASCII or eight-bit-graphic, they won't need
- any more bytes once converted. */
+ /* If all the chars are ASCII, they won't need any more bytes once
+ converted. */
if (nbytes == SBYTES (string))
return make_multibyte_string (SDATA (string), nbytes, nbytes);
@@ -1126,8 +1048,7 @@ DEFUN ("string-as-unibyte", Fstring_as_unibyte, Sstring_as_unibyte,
If STRING is unibyte, the result is STRING itself.
Otherwise it is a newly created string, with no text properties.
If STRING is multibyte and contains a character of charset
-`eight-bit-control' or `eight-bit-graphic', it is converted to the
-corresponding single byte. */)
+`eight-bit', it is converted to the corresponding single byte. */)
(string)
Lisp_Object string;
{
@@ -1151,20 +1072,16 @@ DEFUN ("string-as-multibyte", Fstring_as_multibyte, Sstring_as_multibyte,
doc: /* Return a multibyte string with the same individual bytes as STRING.
If STRING is multibyte, the result is STRING itself.
Otherwise it is a newly created string, with no text properties.
+
If STRING is unibyte and contains an individual 8-bit byte (i.e. not
-part of a multibyte form), it is converted to the corresponding
-multibyte character of charset `eight-bit-control' or `eight-bit-graphic'.
+part of a correct utf-8 sequence), it is converted to the corresponding
+multibyte character of charset `eight-bit'.
+See also `string-to-multibyte'.
+
Beware, this often doesn't really do what you think it does.
-It is similar to (decode-coding-string STRING 'emacs-mule-unix).
+It is similar to (decode-coding-string STRING 'utf-8-emacs).
If you're not sure, whether to use `string-as-multibyte' or
-`string-to-multibyte', use `string-to-multibyte'. Beware:
- (aref (string-as-multibyte "\\201") 0) -> 129 (aka ?\\201)
- (aref (string-as-multibyte "\\300") 0) -> 192 (aka ?\\300)
- (aref (string-as-multibyte "\\300\\201") 0) -> 192 (aka ?\\300)
- (aref (string-as-multibyte "\\300\\201") 1) -> 129 (aka ?\\201)
-but
- (aref (string-as-multibyte "\\201\\300") 0) -> 2240
- (aref (string-as-multibyte "\\201\\300") 1) -> <error> */)
+`string-to-multibyte', use `string-to-multibyte'. */)
(string)
Lisp_Object string;
{
@@ -1195,11 +1112,13 @@ DEFUN ("string-to-multibyte", Fstring_to_multibyte, Sstring_to_multibyte,
doc: /* Return a multibyte string with the same individual chars as STRING.
If STRING is multibyte, the result is STRING itself.
Otherwise it is a newly created string, with no text properties.
-Characters 0200 through 0237 are converted to eight-bit-control
-characters of the same character code. Characters 0240 through 0377
-are converted to eight-bit-graphic characters of the same character
-codes.
-This is similar to (decode-coding-string STRING 'binary) */)
+
+If STRING is unibyte and contains an 8-bit byte, it is converted to
+the corresponding multibyte character of charset `eight-bit'.
+
+This differs from `string-as-multibyte' by converting each byte of a correct
+utf-8 sequence to an eight-bit character, not just bytes that don't form a
+correct sequence. */)
(string)
Lisp_Object string;
{
@@ -1599,6 +1518,22 @@ The value is actually the first element of LIST whose car equals KEY. */)
return CAR (list);
}
+/* Like Fassoc but never report an error and do not allow quits.
+ Use only on lists known never to be circular. */
+
+Lisp_Object
+assoc_no_quit (key, list)
+ Lisp_Object key, list;
+{
+ while (CONSP (list)
+ && (!CONSP (XCAR (list))
+ || (!EQ (XCAR (XCAR (list)), key)
+ && NILP (Fequal (XCAR (XCAR (list)), key)))))
+ list = XCDR (list);
+
+ return CONSP (list) ? XCAR (list) : Qnil;
+}
+
DEFUN ("rassq", Frassq, Srassq, 2, 2, 0,
doc: /* Return non-nil if KEY is `eq' to the cdr of an element of LIST.
The value is actually the first element of LIST whose cdr is KEY. */)
@@ -2060,7 +1995,7 @@ The PLIST is modified by side effects. */)
prev = tail;
QUIT;
}
- newcell = Fcons (prop, Fcons (val, NILP (prev) ? plist : XCDR (XCDR (prev))));
+ newcell = Fcons (prop, Fcons (val, Qnil));
if (NILP (prev))
return newcell;
else
@@ -2270,7 +2205,8 @@ internal_equal (o1, o2, depth, props)
functions are sensible to compare, so eliminate the others now. */
if (size & PSEUDOVECTOR_FLAG)
{
- if (!(size & (PVEC_COMPILED | PVEC_CHAR_TABLE)))
+ if (!(size & (PVEC_COMPILED
+ | PVEC_CHAR_TABLE | PVEC_SUB_CHAR_TABLE)))
return 0;
size &= PSEUDOVECTOR_SIZE_MASK;
}
@@ -2325,11 +2261,11 @@ ARRAY is a vector, string, char-table, or bool-vector. */)
}
else if (CHAR_TABLE_P (array))
{
- register Lisp_Object *p = XCHAR_TABLE (array)->contents;
- size = CHAR_TABLE_ORDINARY_SLOTS;
- for (index = 0; index < size; index++)
- p[index] = item;
- XCHAR_TABLE (array)->defalt = Qnil;
+ int i;
+
+ for (i = 0; i < (1 << CHARTAB_SIZE_BITS_0); i++)
+ XCHAR_TABLE (array)->contents[i] = item;
+ XCHAR_TABLE (array)->defalt = item;
}
else if (STRINGP (array))
{
@@ -2399,581 +2335,6 @@ This makes STRING unibyte and may change its length. */)
return Qnil;
}
-DEFUN ("char-table-subtype", Fchar_table_subtype, Schar_table_subtype,
- 1, 1, 0,
- doc: /* Return the subtype of char-table CHAR-TABLE. The value is a symbol. */)
- (char_table)
- Lisp_Object char_table;
-{
- CHECK_CHAR_TABLE (char_table);
-
- return XCHAR_TABLE (char_table)->purpose;
-}
-
-DEFUN ("char-table-parent", Fchar_table_parent, Schar_table_parent,
- 1, 1, 0,
- doc: /* Return the parent char-table of CHAR-TABLE.
-The value is either nil or another char-table.
-If CHAR-TABLE holds nil for a given character,
-then the actual applicable value is inherited from the parent char-table
-\(or from its parents, if necessary). */)
- (char_table)
- Lisp_Object char_table;
-{
- CHECK_CHAR_TABLE (char_table);
-
- return XCHAR_TABLE (char_table)->parent;
-}
-
-DEFUN ("set-char-table-parent", Fset_char_table_parent, Sset_char_table_parent,
- 2, 2, 0,
- doc: /* Set the parent char-table of CHAR-TABLE to PARENT.
-Return PARENT. PARENT must be either nil or another char-table. */)
- (char_table, parent)
- Lisp_Object char_table, parent;
-{
- Lisp_Object temp;
-
- CHECK_CHAR_TABLE (char_table);
-
- if (!NILP (parent))
- {
- CHECK_CHAR_TABLE (parent);
-
- for (temp = parent; !NILP (temp); temp = XCHAR_TABLE (temp)->parent)
- if (EQ (temp, char_table))
- error ("Attempt to make a chartable be its own parent");
- }
-
- XCHAR_TABLE (char_table)->parent = parent;
-
- return parent;
-}
-
-DEFUN ("char-table-extra-slot", Fchar_table_extra_slot, Schar_table_extra_slot,
- 2, 2, 0,
- doc: /* Return the value of CHAR-TABLE's extra-slot number N. */)
- (char_table, n)
- Lisp_Object char_table, n;
-{
- CHECK_CHAR_TABLE (char_table);
- CHECK_NUMBER (n);
- if (XINT (n) < 0
- || XINT (n) >= CHAR_TABLE_EXTRA_SLOTS (XCHAR_TABLE (char_table)))
- args_out_of_range (char_table, n);
-
- return XCHAR_TABLE (char_table)->extras[XINT (n)];
-}
-
-DEFUN ("set-char-table-extra-slot", Fset_char_table_extra_slot,
- Sset_char_table_extra_slot,
- 3, 3, 0,
- doc: /* Set CHAR-TABLE's extra-slot number N to VALUE. */)
- (char_table, n, value)
- Lisp_Object char_table, n, value;
-{
- CHECK_CHAR_TABLE (char_table);
- CHECK_NUMBER (n);
- if (XINT (n) < 0
- || XINT (n) >= CHAR_TABLE_EXTRA_SLOTS (XCHAR_TABLE (char_table)))
- args_out_of_range (char_table, n);
-
- return XCHAR_TABLE (char_table)->extras[XINT (n)] = value;
-}
-
-static Lisp_Object
-char_table_range (table, from, to, defalt)
- Lisp_Object table;
- int from, to;
- Lisp_Object defalt;
-{
- Lisp_Object val;
-
- if (! NILP (XCHAR_TABLE (table)->defalt))
- defalt = XCHAR_TABLE (table)->defalt;
- val = XCHAR_TABLE (table)->contents[from];
- if (SUB_CHAR_TABLE_P (val))
- val = char_table_range (val, 32, 127, defalt);
- else if (NILP (val))
- val = defalt;
- for (from++; from <= to; from++)
- {
- Lisp_Object this_val;
-
- this_val = XCHAR_TABLE (table)->contents[from];
- if (SUB_CHAR_TABLE_P (this_val))
- this_val = char_table_range (this_val, 32, 127, defalt);
- else if (NILP (this_val))
- this_val = defalt;
- if (! EQ (val, this_val))
- error ("Characters in the range have inconsistent values");
- }
- return val;
-}
-
-
-DEFUN ("char-table-range", Fchar_table_range, Schar_table_range,
- 2, 2, 0,
- doc: /* Return the value in CHAR-TABLE for a range of characters RANGE.
-RANGE should be nil (for the default value),
-a vector which identifies a character set or a row of a character set,
-a character set name, or a character code.
-If the characters in the specified range have different values,
-an error is signaled.
-
-Note that this function doesn't check the parent of CHAR-TABLE. */)
- (char_table, range)
- Lisp_Object char_table, range;
-{
- int charset_id, c1 = 0, c2 = 0;
- int size;
- Lisp_Object ch, val, current_default;
-
- CHECK_CHAR_TABLE (char_table);
-
- if (EQ (range, Qnil))
- return XCHAR_TABLE (char_table)->defalt;
- if (INTEGERP (range))
- {
- int c = XINT (range);
- if (! CHAR_VALID_P (c, 0))
- error ("Invalid character code: %d", c);
- ch = range;
- SPLIT_CHAR (c, charset_id, c1, c2);
- }
- else if (SYMBOLP (range))
- {
- Lisp_Object charset_info;
-
- charset_info = Fget (range, Qcharset);
- CHECK_VECTOR (charset_info);
- charset_id = XINT (AREF (charset_info, 0));
- ch = Fmake_char_internal (make_number (charset_id),
- make_number (0), make_number (0));
- }
- else if (VECTORP (range))
- {
- size = ASIZE (range);
- if (size == 0)
- args_out_of_range (range, make_number (0));
- CHECK_NUMBER (AREF (range, 0));
- charset_id = XINT (AREF (range, 0));
- if (size > 1)
- {
- CHECK_NUMBER (AREF (range, 1));
- c1 = XINT (AREF (range, 1));
- if (size > 2)
- {
- CHECK_NUMBER (AREF (range, 2));
- c2 = XINT (AREF (range, 2));
- }
- }
-
- /* This checks if charset_id, c0, and c1 are all valid or not. */
- ch = Fmake_char_internal (make_number (charset_id),
- make_number (c1), make_number (c2));
- }
- else
- error ("Invalid RANGE argument to `char-table-range'");
-
- if (c1 > 0 && (CHARSET_DIMENSION (charset_id) == 1 || c2 > 0))
- {
- /* Fully specified character. */
- Lisp_Object parent = XCHAR_TABLE (char_table)->parent;
-
- XCHAR_TABLE (char_table)->parent = Qnil;
- val = Faref (char_table, ch);
- XCHAR_TABLE (char_table)->parent = parent;
- return val;
- }
-
- current_default = XCHAR_TABLE (char_table)->defalt;
- if (charset_id == CHARSET_ASCII
- || charset_id == CHARSET_8_BIT_CONTROL
- || charset_id == CHARSET_8_BIT_GRAPHIC)
- {
- int from, to, defalt;
-
- if (charset_id == CHARSET_ASCII)
- from = 0, to = 127, defalt = CHAR_TABLE_DEFAULT_SLOT_ASCII;
- else if (charset_id == CHARSET_8_BIT_CONTROL)
- from = 128, to = 159, defalt = CHAR_TABLE_DEFAULT_SLOT_8_BIT_CONTROL;
- else
- from = 160, to = 255, defalt = CHAR_TABLE_DEFAULT_SLOT_8_BIT_GRAPHIC;
- if (! NILP (XCHAR_TABLE (char_table)->contents[defalt]))
- current_default = XCHAR_TABLE (char_table)->contents[defalt];
- return char_table_range (char_table, from, to, current_default);
- }
-
- val = XCHAR_TABLE (char_table)->contents[128 + charset_id];
- if (! SUB_CHAR_TABLE_P (val))
- return (NILP (val) ? current_default : val);
- if (! NILP (XCHAR_TABLE (val)->defalt))
- current_default = XCHAR_TABLE (val)->defalt;
- if (c1 == 0)
- return char_table_range (val, 32, 127, current_default);
- val = XCHAR_TABLE (val)->contents[c1];
- if (! SUB_CHAR_TABLE_P (val))
- return (NILP (val) ? current_default : val);
- if (! NILP (XCHAR_TABLE (val)->defalt))
- current_default = XCHAR_TABLE (val)->defalt;
- return char_table_range (val, 32, 127, current_default);
-}
-
-DEFUN ("set-char-table-range", Fset_char_table_range, Sset_char_table_range,
- 3, 3, 0,
- doc: /* Set the value in CHAR-TABLE for a range of characters RANGE to VALUE.
-RANGE should be t (for all characters), nil (for the default value),
-a character set, a vector which identifies a character set, a row of a
-character set, or a character code. Return VALUE. */)
- (char_table, range, value)
- Lisp_Object char_table, range, value;
-{
- int i;
-
- CHECK_CHAR_TABLE (char_table);
-
- if (EQ (range, Qt))
- for (i = 0; i < CHAR_TABLE_ORDINARY_SLOTS; i++)
- {
- /* Don't set these special slots used for default values of
- ascii, eight-bit-control, and eight-bit-graphic. */
- if (i != CHAR_TABLE_DEFAULT_SLOT_ASCII
- && i != CHAR_TABLE_DEFAULT_SLOT_8_BIT_CONTROL
- && i != CHAR_TABLE_DEFAULT_SLOT_8_BIT_GRAPHIC)
- XCHAR_TABLE (char_table)->contents[i] = value;
- }
- else if (EQ (range, Qnil))
- XCHAR_TABLE (char_table)->defalt = value;
- else if (SYMBOLP (range))
- {
- Lisp_Object charset_info;
- int charset_id;
-
- charset_info = Fget (range, Qcharset);
- if (! VECTORP (charset_info)
- || ! NATNUMP (AREF (charset_info, 0))
- || (charset_id = XINT (AREF (charset_info, 0)),
- ! CHARSET_DEFINED_P (charset_id)))
- error ("Invalid charset: %s", SDATA (SYMBOL_NAME (range)));
-
- if (charset_id == CHARSET_ASCII)
- for (i = 0; i < 128; i++)
- XCHAR_TABLE (char_table)->contents[i] = value;
- else if (charset_id == CHARSET_8_BIT_CONTROL)
- for (i = 128; i < 160; i++)
- XCHAR_TABLE (char_table)->contents[i] = value;
- else if (charset_id == CHARSET_8_BIT_GRAPHIC)
- for (i = 160; i < 256; i++)
- XCHAR_TABLE (char_table)->contents[i] = value;
- else
- XCHAR_TABLE (char_table)->contents[charset_id + 128] = value;
- }
- else if (INTEGERP (range))
- Faset (char_table, range, value);
- else if (VECTORP (range))
- {
- int size = ASIZE (range);
- Lisp_Object *val = XVECTOR (range)->contents;
- Lisp_Object ch = Fmake_char_internal (size <= 0 ? Qnil : val[0],
- size <= 1 ? Qnil : val[1],
- size <= 2 ? Qnil : val[2]);
- Faset (char_table, ch, value);
- }
- else
- error ("Invalid RANGE argument to `set-char-table-range'");
-
- return value;
-}
-
-DEFUN ("set-char-table-default", Fset_char_table_default,
- Sset_char_table_default, 3, 3, 0,
- doc: /* Set the default value in CHAR-TABLE for generic character CH to VALUE.
-The generic character specifies the group of characters.
-If CH is a normal character, set the default value for a group of
-characters to which CH belongs.
-See also the documentation of `make-char'. */)
- (char_table, ch, value)
- Lisp_Object char_table, ch, value;
-{
- int c, charset, code1, code2;
- Lisp_Object temp;
-
- CHECK_CHAR_TABLE (char_table);
- CHECK_NUMBER (ch);
-
- c = XINT (ch);
- SPLIT_CHAR (c, charset, code1, code2);
-
- /* Since we may want to set the default value for a character set
- not yet defined, we check only if the character set is in the
- valid range or not, instead of it is already defined or not. */
- if (! CHARSET_VALID_P (charset))
- invalid_character (c);
-
- if (SINGLE_BYTE_CHAR_P (c))
- {
- /* We use special slots for the default values of single byte
- characters. */
- int default_slot
- = (c < 0x80 ? CHAR_TABLE_DEFAULT_SLOT_ASCII
- : c < 0xA0 ? CHAR_TABLE_DEFAULT_SLOT_8_BIT_CONTROL
- : CHAR_TABLE_DEFAULT_SLOT_8_BIT_GRAPHIC);
-
- return (XCHAR_TABLE (char_table)->contents[default_slot] = value);
- }
-
- /* Even if C is not a generic char, we had better behave as if a
- generic char is specified. */
- if (!CHARSET_DEFINED_P (charset) || CHARSET_DIMENSION (charset) == 1)
- code1 = 0;
- temp = XCHAR_TABLE (char_table)->contents[charset + 128];
- if (! SUB_CHAR_TABLE_P (temp))
- {
- temp = make_sub_char_table (temp);
- XCHAR_TABLE (char_table)->contents[charset + 128] = temp;
- }
- if (!code1)
- {
- XCHAR_TABLE (temp)->defalt = value;
- return value;
- }
- char_table = temp;
- temp = XCHAR_TABLE (char_table)->contents[code1];
- if (SUB_CHAR_TABLE_P (temp))
- XCHAR_TABLE (temp)->defalt = value;
- else
- XCHAR_TABLE (char_table)->contents[code1] = value;
- return value;
-}
-
-/* Look up the element in TABLE at index CH,
- and return it as an integer.
- If the element is nil, return CH itself.
- (Actually we do that for any non-integer.) */
-
-int
-char_table_translate (table, ch)
- Lisp_Object table;
- int ch;
-{
- Lisp_Object value;
- value = Faref (table, make_number (ch));
- if (! INTEGERP (value))
- return ch;
- return XINT (value);
-}
-
-static void
-optimize_sub_char_table (table, chars)
- Lisp_Object *table;
- int chars;
-{
- Lisp_Object elt;
- int from, to;
-
- if (chars == 94)
- from = 33, to = 127;
- else
- from = 32, to = 128;
-
- if (!SUB_CHAR_TABLE_P (*table)
- || ! NILP (XCHAR_TABLE (*table)->defalt))
- return;
- elt = XCHAR_TABLE (*table)->contents[from++];
- for (; from < to; from++)
- if (NILP (Fequal (elt, XCHAR_TABLE (*table)->contents[from])))
- return;
- *table = elt;
-}
-
-DEFUN ("optimize-char-table", Foptimize_char_table, Soptimize_char_table,
- 1, 1, 0, doc: /* Optimize char table TABLE. */)
- (table)
- Lisp_Object table;
-{
- Lisp_Object elt;
- int dim, chars;
- int i, j;
-
- CHECK_CHAR_TABLE (table);
-
- for (i = CHAR_TABLE_SINGLE_BYTE_SLOTS; i < CHAR_TABLE_ORDINARY_SLOTS; i++)
- {
- elt = XCHAR_TABLE (table)->contents[i];
- if (!SUB_CHAR_TABLE_P (elt))
- continue;
- dim = CHARSET_DIMENSION (i - 128);
- chars = CHARSET_CHARS (i - 128);
- if (dim == 2)
- for (j = 32; j < SUB_CHAR_TABLE_ORDINARY_SLOTS; j++)
- optimize_sub_char_table (XCHAR_TABLE (elt)->contents + j, chars);
- optimize_sub_char_table (XCHAR_TABLE (table)->contents + i, chars);
- }
- return Qnil;
-}
-
-
-/* Map C_FUNCTION or FUNCTION over SUBTABLE, calling it for each
- character or group of characters that share a value.
- DEPTH is the current depth in the originally specified
- chartable, and INDICES contains the vector indices
- for the levels our callers have descended.
-
- ARG is passed to C_FUNCTION when that is called. */
-
-void
-map_char_table (c_function, function, table, subtable, arg, depth, indices)
- void (*c_function) P_ ((Lisp_Object, Lisp_Object, Lisp_Object));
- Lisp_Object function, table, subtable, arg;
- int depth, *indices;
-{
- int i, to;
- struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
-
- GCPRO4 (arg, table, subtable, function);
-
- if (depth == 0)
- {
- /* At first, handle ASCII and 8-bit European characters. */
- for (i = 0; i < CHAR_TABLE_SINGLE_BYTE_SLOTS; i++)
- {
- Lisp_Object elt= XCHAR_TABLE (subtable)->contents[i];
- if (NILP (elt))
- elt = XCHAR_TABLE (subtable)->defalt;
- if (NILP (elt))
- elt = Faref (subtable, make_number (i));
- if (c_function)
- (*c_function) (arg, make_number (i), elt);
- else
- call2 (function, make_number (i), elt);
- }
-#if 0 /* If the char table has entries for higher characters,
- we should report them. */
- if (NILP (current_buffer->enable_multibyte_characters))
- {
- UNGCPRO;
- return;
- }
-#endif
- to = CHAR_TABLE_ORDINARY_SLOTS;
- }
- else
- {
- int charset = indices[0] - 128;
-
- i = 32;
- to = SUB_CHAR_TABLE_ORDINARY_SLOTS;
- if (CHARSET_CHARS (charset) == 94)
- i++, to--;
- }
-
- for (; i < to; i++)
- {
- Lisp_Object elt;
- int charset;
-
- elt = XCHAR_TABLE (subtable)->contents[i];
- indices[depth] = i;
- charset = indices[0] - 128;
- if (depth == 0
- && (!CHARSET_DEFINED_P (charset)
- || charset == CHARSET_8_BIT_CONTROL
- || charset == CHARSET_8_BIT_GRAPHIC))
- continue;
-
- if (SUB_CHAR_TABLE_P (elt))
- {
- if (depth >= 3)
- error ("Too deep char table");
- map_char_table (c_function, function, table, elt, arg, depth + 1, indices);
- }
- else
- {
- int c1, c2, c;
-
- c1 = depth >= 1 ? indices[1] : 0;
- c2 = depth >= 2 ? indices[2] : 0;
- c = MAKE_CHAR (charset, c1, c2);
-
- if (NILP (elt))
- elt = XCHAR_TABLE (subtable)->defalt;
- if (NILP (elt))
- elt = Faref (table, make_number (c));
-
- if (c_function)
- (*c_function) (arg, make_number (c), elt);
- else
- call2 (function, make_number (c), elt);
- }
- }
- UNGCPRO;
-}
-
-static void void_call2 P_ ((Lisp_Object a, Lisp_Object b, Lisp_Object c));
-static void
-void_call2 (a, b, c)
- Lisp_Object a, b, c;
-{
- call2 (a, b, c);
-}
-
-DEFUN ("map-char-table", Fmap_char_table, Smap_char_table,
- 2, 2, 0,
- doc: /* Call FUNCTION for each (normal and generic) characters in CHAR-TABLE.
-FUNCTION is called with two arguments--a key and a value.
-The key is always a possible IDX argument to `aref'. */)
- (function, char_table)
- Lisp_Object function, char_table;
-{
- /* The depth of char table is at most 3. */
- int indices[3];
-
- CHECK_CHAR_TABLE (char_table);
-
- /* When Lisp_Object is represented as a union, `call2' cannot directly
- be passed to map_char_table because it returns a Lisp_Object rather
- than returning nothing.
- Casting leads to crashes on some architectures. --Stef */
- map_char_table (void_call2, Qnil, char_table, char_table, function, 0, indices);
- return Qnil;
-}
-
-/* Return a value for character C in char-table TABLE. Store the
- actual index for that value in *IDX. Ignore the default value of
- TABLE. */
-
-Lisp_Object
-char_table_ref_and_index (table, c, idx)
- Lisp_Object table;
- int c, *idx;
-{
- int charset, c1, c2;
- Lisp_Object elt;
-
- if (SINGLE_BYTE_CHAR_P (c))
- {
- *idx = c;
- return XCHAR_TABLE (table)->contents[c];
- }
- SPLIT_CHAR (c, charset, c1, c2);
- elt = XCHAR_TABLE (table)->contents[charset + 128];
- *idx = MAKE_CHAR (charset, 0, 0);
- if (!SUB_CHAR_TABLE_P (elt))
- return elt;
- if (c1 < 32 || NILP (XCHAR_TABLE (elt)->contents[c1]))
- return XCHAR_TABLE (elt)->defalt;
- elt = XCHAR_TABLE (elt)->contents[c1];
- *idx = MAKE_CHAR (charset, c1, 0);
- if (!SUB_CHAR_TABLE_P (elt))
- return elt;
- if (c2 < 32 || NILP (XCHAR_TABLE (elt)->contents[c2]))
- return XCHAR_TABLE (elt)->defalt;
- *idx = c;
- return XCHAR_TABLE (elt)->contents[c2];
-}
-
-
/* ARGSUSED */
Lisp_Object
nconc2 (s1, s2)
@@ -3132,6 +2493,8 @@ SEQUENCE may be a list, a vector, a bool-vector, or a string. */)
USE_SAFE_ALLOCA;
len = Flength (sequence);
+ if (CHAR_TABLE_P (sequence))
+ wrong_type_argument (Qlistp, sequence);
leni = XINT (len);
nargs = leni + leni - 1;
if (nargs < 0) return empty_unibyte_string;
@@ -3168,6 +2531,8 @@ SEQUENCE may be a list, a vector, a bool-vector, or a string. */)
USE_SAFE_ALLOCA;
len = Flength (sequence);
+ if (CHAR_TABLE_P (sequence))
+ wrong_type_argument (Qlistp, sequence);
leni = XFASTINT (len);
SAFE_ALLOCA_LISP (args, leni);
@@ -3190,6 +2555,8 @@ SEQUENCE may be a list, a vector, a bool-vector, or a string. */)
register int leni;
leni = XFASTINT (Flength (sequence));
+ if (CHAR_TABLE_P (sequence))
+ wrong_type_argument (Qlistp, sequence);
mapcar1 (leni, 0, function, sequence);
return sequence;
@@ -3236,8 +2603,7 @@ is nil and `use-dialog-box' is non-nil. */)
{
#ifdef HAVE_MENUS
- if (FRAME_WINDOW_P (SELECTED_FRAME ())
- && (NILP (last_nonmenu_event) || CONSP (last_nonmenu_event))
+ if ((NILP (last_nonmenu_event) || CONSP (last_nonmenu_event))
&& use_dialog_box
&& have_menus_p ())
{
@@ -3276,7 +2642,6 @@ is nil and `use-dialog-box' is non-nil. */)
Fraise_frame (mini_frame);
}
- temporarily_switch_to_single_kboard (SELECTED_FRAME ());
obj = read_filtered_event (1, 0, 0, 0, Qnil);
cursor_in_echo_area = 0;
/* If we need to quit, quit with cursor_in_echo_area = 0. */
@@ -3369,8 +2734,7 @@ is nil, and `use-dialog-box' is non-nil. */)
CHECK_STRING (prompt);
#ifdef HAVE_MENUS
- if (FRAME_WINDOW_P (SELECTED_FRAME ())
- && (NILP (last_nonmenu_event) || CONSP (last_nonmenu_event))
+ if ((NILP (last_nonmenu_event) || CONSP (last_nonmenu_event))
&& use_dialog_box
&& have_menus_p ())
{
@@ -3986,7 +3350,9 @@ base64_encode_1 (from, to, length, line_break, multibyte)
if (multibyte)
{
c = STRING_CHAR_AND_LENGTH (from + i, length - i, bytes);
- if (c >= 256)
+ if (CHAR_BYTE8_P (c))
+ c = CHAR_TO_BYTE8 (c);
+ else if (c >= 256)
return -1;
i += bytes;
}
@@ -4024,7 +3390,9 @@ base64_encode_1 (from, to, length, line_break, multibyte)
if (multibyte)
{
c = STRING_CHAR_AND_LENGTH (from + i, length - i, bytes);
- if (c >= 256)
+ if (CHAR_BYTE8_P (c))
+ c = CHAR_TO_BYTE8 (c);
+ else if (c >= 256)
return -1;
i += bytes;
}
@@ -4046,7 +3414,9 @@ base64_encode_1 (from, to, length, line_break, multibyte)
if (multibyte)
{
c = STRING_CHAR_AND_LENGTH (from + i, length - i, bytes);
- if (c >= 256)
+ if (CHAR_BYTE8_P (c))
+ c = CHAR_TO_BYTE8 (c);
+ else if (c >= 256)
return -1;
i += bytes;
}
@@ -4196,8 +3566,8 @@ base64_decode_1 (from, to, length, multibyte, nchars_return)
value |= base64_char_to_value[c] << 12;
c = (unsigned char) (value >> 16);
- if (multibyte)
- e += CHAR_STRING (c, e);
+ if (multibyte && c >= 128)
+ e += BYTE8_STRING (c, e);
else
*e++ = c;
nchars++;
@@ -4220,8 +3590,8 @@ base64_decode_1 (from, to, length, multibyte, nchars_return)
value |= base64_char_to_value[c] << 6;
c = (unsigned char) (0xff & value >> 8);
- if (multibyte)
- e += CHAR_STRING (c, e);
+ if (multibyte && c >= 128)
+ e += BYTE8_STRING (c, e);
else
*e++ = c;
nchars++;
@@ -4238,8 +3608,8 @@ base64_decode_1 (from, to, length, multibyte, nchars_return)
value |= base64_char_to_value[c];
c = (unsigned char) (0xff & value);
- if (multibyte)
- e += CHAR_STRING (c, e);
+ if (multibyte && c >= 128)
+ e += BYTE8_STRING (c, e);
else
*e++ = c;
nchars++;
@@ -4461,7 +3831,7 @@ hashfn_eq (h, key)
struct Lisp_Hash_Table *h;
Lisp_Object key;
{
- unsigned hash = XUINT (key) ^ XGCTYPE (key);
+ unsigned hash = XUINT (key) ^ XTYPE (key);
xassert ((hash & ~INTMASK) == 0);
return hash;
}
@@ -4480,7 +3850,7 @@ hashfn_eql (h, key)
if (FLOATP (key))
hash = sxhash (key, 0);
else
- hash = XUINT (key) ^ XGCTYPE (key);
+ hash = XUINT (key) ^ XTYPE (key);
xassert ((hash & ~INTMASK) == 0);
return hash;
}
@@ -4598,7 +3968,7 @@ make_hash_table (test, size, rehash_size, rehash_threshold, weak,
h->weak = weak;
h->rehash_threshold = rehash_threshold;
h->rehash_size = rehash_size;
- h->count = 0;
+ h->count = make_number (0);
h->key_and_value = Fmake_vector (make_number (2 * sz), Qnil);
h->hash = Fmake_vector (size, Qnil);
h->next = Fmake_vector (size, Qnil);
@@ -4778,7 +4148,7 @@ hash_put (h, key, value, hash)
/* Increment count after resizing because resizing may fail. */
maybe_resize_hash_table (h);
- h->count++;
+ h->count = make_number (XFASTINT (h->count) + 1);
/* Store key/value in the key_and_value vector. */
i = XFASTINT (h->next_free);
@@ -4834,8 +4204,8 @@ hash_remove (h, key)
HASH_KEY (h, i) = HASH_VALUE (h, i) = HASH_HASH (h, i) = Qnil;
HASH_NEXT (h, i) = h->next_free;
h->next_free = make_number (i);
- h->count--;
- xassert (h->count >= 0);
+ h->count = make_number (XFASTINT (h->count) - 1);
+ xassert (XINT (h->count) >= 0);
break;
}
else
@@ -4853,7 +4223,7 @@ void
hash_clear (h)
struct Lisp_Hash_Table *h;
{
- if (h->count > 0)
+ if (XFASTINT (h->count) > 0)
{
int i, size = HASH_TABLE_SIZE (h);
@@ -4869,7 +4239,7 @@ hash_clear (h)
AREF (h->index, i) = Qnil;
h->next_free = make_number (0);
- h->count = 0;
+ h->count = make_number (0);
}
}
@@ -4901,7 +4271,7 @@ sweep_weak_table (h, remove_entries_p)
/* Follow collision chain, removing entries that
don't survive this garbage collection. */
prev = Qnil;
- for (idx = HASH_INDEX (h, bucket); !GC_NILP (idx); idx = next)
+ for (idx = HASH_INDEX (h, bucket); !NILP (idx); idx = next)
{
int i = XFASTINT (idx);
int key_known_to_survive_p = survives_gc_p (HASH_KEY (h, i));
@@ -4926,7 +4296,7 @@ sweep_weak_table (h, remove_entries_p)
if (remove_p)
{
/* Take out of collision chain. */
- if (GC_NILP (prev))
+ if (NILP (prev))
HASH_INDEX (h, bucket) = next;
else
HASH_NEXT (h, XFASTINT (prev)) = next;
@@ -4939,7 +4309,7 @@ sweep_weak_table (h, remove_entries_p)
HASH_KEY (h, i) = HASH_VALUE (h, i) = Qnil;
HASH_HASH (h, i) = Qnil;
- h->count--;
+ h->count = make_number (XFASTINT (h->count) - 1);
}
else
{
@@ -4972,7 +4342,7 @@ sweep_weak_table (h, remove_entries_p)
/* Remove elements from weak hash tables that don't survive the
current garbage collection. Remove weak tables that don't survive
- from weak_hash_tables. Called from gc_sweep. */
+ from Vweak_hash_tables. Called from gc_sweep. */
void
sweep_weak_hash_tables ()
@@ -5005,7 +4375,7 @@ sweep_weak_hash_tables ()
if (h->size & ARRAY_MARK_FLAG)
{
/* TABLE is marked as used. Sweep its contents. */
- if (h->count > 0)
+ if (XFASTINT (h->count) > 0)
sweep_weak_table (h, 1);
/* Add table to the list of used weak hash tables. */
@@ -5340,7 +4710,7 @@ DEFUN ("hash-table-count", Fhash_table_count, Shash_table_count, 1, 1, 0,
(table)
Lisp_Object table;
{
- return make_number (check_hash_table (table)->count);
+ return check_hash_table (table)->count;
}
@@ -5507,7 +4877,6 @@ including negative integers. */)
************************************************************************/
#include "md5.h"
-#include "coding.h"
DEFUN ("md5", Fmd5, Smd5, 1, 5, 0,
doc: /* Return MD5 message digest of OBJECT, a buffer or string.
@@ -5558,7 +4927,7 @@ guesswork fails. Normally, an error is signaled in such case. */)
if (STRING_MULTIBYTE (object))
/* use default, we can't guess correct value */
- coding_system = SYMBOL_VALUE (XCAR (Vcoding_category_list));
+ coding_system = preferred_coding_system ();
else
coding_system = Qraw_text;
}
@@ -5574,7 +4943,7 @@ guesswork fails. Normally, an error is signaled in such case. */)
}
if (STRING_MULTIBYTE (object))
- object = code_convert_string1 (object, coding_system, Qnil, 1);
+ object = code_convert_string (object, coding_system, Qnil, 1, 0, 1);
size = SCHARS (object);
size_byte = SBYTES (object);
@@ -5716,7 +5085,7 @@ guesswork fails. Normally, an error is signaled in such case. */)
specpdl_ptr--;
if (STRING_MULTIBYTE (object))
- object = code_convert_string1 (object, coding_system, Qnil, 1);
+ object = code_convert_string (object, coding_system, Qnil, 1, 0, 0);
}
md5_buffer (SDATA (object) + start_byte,
@@ -5879,16 +5248,6 @@ used if both `use-dialog-box' and this variable are non-nil. */);
defsubr (&Sequal_including_properties);
defsubr (&Sfillarray);
defsubr (&Sclear_string);
- defsubr (&Schar_table_subtype);
- defsubr (&Schar_table_parent);
- defsubr (&Sset_char_table_parent);
- defsubr (&Schar_table_extra_slot);
- defsubr (&Sset_char_table_extra_slot);
- defsubr (&Schar_table_range);
- defsubr (&Sset_char_table_range);
- defsubr (&Sset_char_table_default);
- defsubr (&Soptimize_char_table);
- defsubr (&Smap_char_table);
defsubr (&Snconc);
defsubr (&Smapcar);
defsubr (&Smapc);
diff --git a/src/font.c b/src/font.c
new file mode 100644
index 0000000000..b35e462ae6
--- /dev/null
+++ b/src/font.c
@@ -0,0 +1,3858 @@
+/* font.c -- "Font" primitives.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006
+ National Institute of Advanced Industrial Science and Technology (AIST)
+ Registration Number H13PRO009
+
+This file is part of GNU Emacs.
+
+GNU Emacs is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Emacs is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Emacs; see the file COPYING. If not, write to
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+#include <config.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <ctype.h>
+
+#include "lisp.h"
+#include "buffer.h"
+#include "frame.h"
+#include "window.h"
+#include "dispextern.h"
+#include "charset.h"
+#include "character.h"
+#include "composite.h"
+#include "fontset.h"
+#include "font.h"
+
+#ifndef FONT_DEBUG
+#define FONT_DEBUG
+#endif
+
+#ifdef FONT_DEBUG
+#undef xassert
+#define xassert(X) do {if (!(X)) abort ();} while (0)
+#else
+#define xassert(X) (void) 0
+#endif
+
+int enable_font_backend;
+
+Lisp_Object Qfontp;
+
+Lisp_Object Qopentype;
+
+/* Important character set symbols. */
+Lisp_Object Qiso8859_1, Qiso10646_1, Qunicode_bmp, Qunicode_sip;
+
+/* Like CHECK_FONT_SPEC but also validate properties of the font-spec,
+ and set X to the validated result. */
+
+#define CHECK_VALIDATE_FONT_SPEC(x) \
+ do { \
+ if (! FONT_SPEC_P (x)) x = wrong_type_argument (Qfont, x); \
+ x = font_prop_validate (x); \
+ } while (0)
+
+/* Number of pt per inch (from the TeXbook). */
+#define PT_PER_INCH 72.27
+
+/* Return a pixel size (integer) corresponding to POINT size (double)
+ on resolution DPI. */
+#define POINT_TO_PIXEL(POINT, DPI) ((POINT) * (DPI) / PT_PER_INCH + 0.5)
+
+/* Return a point size (double) corresponding to POINT size (integer)
+ on resolution DPI. */
+#define PIXEL_TO_POINT(PIXEL, DPI) ((PIXEL) * PT_PER_INCH * 10 / (DPI) + 0.5)
+
+/* Special string of zero length. It is used to specify a NULL name
+ in a font properties (e.g. adstyle). We don't use the symbol of
+ NULL name because it's confusing (Lisp printer prints nothing for
+ it). */
+Lisp_Object null_string;
+
+/* Special vector of zero length. This is repeatedly used by (struct
+ font_driver *)->list when a specified font is not found. */
+Lisp_Object null_vector;
+
+/* Vector of 3 elements. Each element is an alist for one of font
+ style properties (weight, slant, width). The alist contains a
+ mapping between symbolic property values (e.g. `medium' for weight)
+ and numeric property values (e.g. 100). So, it looks like this:
+ [((thin . 0) ... (heavy . 210))
+ ((ro . 0) ... (ot . 210))
+ ((ultracondensed . 50) ... (wide . 200))] */
+static Lisp_Object font_style_table;
+
+/* Alist of font family vs the corresponding aliases.
+ Each element has this form:
+ (FAMILY ALIAS1 ALIAS2 ...) */
+
+static Lisp_Object font_family_alist;
+
+/* Symbols representing keys of normal font properties. */
+extern Lisp_Object QCtype, QCfamily, QCweight, QCslant, QCwidth, QCsize, QCname;
+Lisp_Object QCfoundry, QCadstyle, QCregistry, QCextra;
+/* Symbols representing keys of font extra info. */
+Lisp_Object QCspacing, QCdpi, QCscalable, QCotf, QClanguage, QCscript;
+/* Symbols representing values of font spacing property. */
+Lisp_Object Qc, Qm, Qp, Qd;
+
+/* List of all font drivers. All font-backends (XXXfont.c) call
+ add_font_driver in syms_of_XXXfont to register the font-driver
+ here. */
+static struct font_driver_list *font_driver_list;
+
+static int font_pixel_size P_ ((FRAME_PTR f, Lisp_Object));
+static Lisp_Object prop_name_to_numeric P_ ((enum font_property_index,
+ Lisp_Object));
+static Lisp_Object prop_numeric_to_name P_ ((enum font_property_index, int));
+static Lisp_Object font_open_entity P_ ((FRAME_PTR, Lisp_Object, int));
+static void build_font_family_alist P_ ((void));
+
+/* Number of registered font drivers. */
+static int num_font_drivers;
+
+/* Return a pixel size of font-spec SPEC on frame F. */
+
+static int
+font_pixel_size (f, spec)
+ FRAME_PTR f;
+ Lisp_Object spec;
+{
+ Lisp_Object size = AREF (spec, FONT_SIZE_INDEX);
+ double point_size;
+ int pixel_size, dpi;
+ Lisp_Object extra, val;
+
+ if (INTEGERP (size))
+ return XINT (size);
+ if (NILP (size))
+ return 0;
+ point_size = XFLOAT_DATA (size);
+ extra = AREF (spec, FONT_EXTRA_INDEX);
+ val = assq_no_quit (QCdpi, extra);
+ if (CONSP (val))
+ {
+ if (INTEGERP (XCDR (val)))
+ dpi = XINT (XCDR (val));
+ else
+ dpi = XFLOAT_DATA (XCDR (val)) + 0.5;
+ }
+ else
+ dpi = f->resy;
+ pixel_size = POINT_TO_PIXEL (point_size, dpi);
+ return pixel_size;
+}
+
+/* Return a numeric value corresponding to PROP's NAME (symbol). If
+ NAME is not registered in font_style_table, return Qnil. PROP must
+ be one of FONT_{WEIGHT|SLANT|SWIDTH}_INDEX. */
+
+static Lisp_Object
+prop_name_to_numeric (prop, name)
+ enum font_property_index prop;
+ Lisp_Object name;
+{
+ int table_index = prop - FONT_WEIGHT_INDEX;
+ Lisp_Object val;
+
+ val = assq_no_quit (name, AREF (font_style_table, table_index));
+ return (NILP (val) ? Qnil : XCDR (val));
+}
+
+
+/* Return a name (symbol) corresponding to PROP's NUMERIC value. If
+ no name is registered for NUMERIC in font_style_table, return a
+ symbol of integer name (e.g. `123'). PROP must be one of
+ FONT_{WEIGHT|SLANT|SWIDTH}_INDEX. */
+
+static Lisp_Object
+prop_numeric_to_name (prop, numeric)
+ enum font_property_index prop;
+ int numeric;
+{
+ int table_index = prop - FONT_WEIGHT_INDEX;
+ Lisp_Object table = AREF (font_style_table, table_index);
+ char buf[10];
+
+ while (! NILP (table))
+ {
+ if (XINT (XCDR (XCAR (table))) >= numeric)
+ {
+ if (XINT (XCDR (XCAR (table))) == numeric)
+ return XCAR (XCAR (table));
+ else
+ break;
+ }
+ table = XCDR (table);
+ }
+ sprintf (buf, "%d", numeric);
+ return intern (buf);
+}
+
+
+/* Return a symbol whose name is STR (length LEN). If STR contains
+ uppercase letters, downcase them in advance. */
+
+Lisp_Object
+intern_downcase (str, len)
+ char *str;
+ int len;
+{
+ char *buf;
+ int i;
+
+ for (i = 0; i < len; i++)
+ if (isupper (str[i]))
+ break;
+ if (i == len)
+ return Fintern (make_unibyte_string (str, len), Qnil);
+ buf = alloca (len);
+ if (! buf)
+ return Fintern (null_string, Qnil);
+ bcopy (str, buf, len);
+ for (; i < len; i++)
+ if (isascii (buf[i]))
+ buf[i] = tolower (buf[i]);
+ return Fintern (make_unibyte_string (buf, len), Qnil);
+}
+
+extern Lisp_Object Vface_alternative_font_family_alist;
+
+static void
+build_font_family_alist ()
+{
+ Lisp_Object alist = Vface_alternative_font_family_alist;
+
+ for (; CONSP (alist); alist = XCDR (alist))
+ {
+ Lisp_Object tail, elt;
+
+ for (tail = XCAR (alist), elt = Qnil ; CONSP (tail); tail = XCDR (tail))
+ elt = nconc2 (elt, Fcons (Fintern (XCAR (tail), Qnil), Qnil));
+ font_family_alist = Fcons (elt, font_family_alist);
+ }
+}
+
+
+/* Font property validater. */
+
+static Lisp_Object font_prop_validate_symbol P_ ((enum font_property_index,
+ Lisp_Object, Lisp_Object));
+static Lisp_Object font_prop_validate_style P_ ((enum font_property_index,
+ Lisp_Object, Lisp_Object));
+static Lisp_Object font_prop_validate_non_neg P_ ((enum font_property_index,
+ Lisp_Object, Lisp_Object));
+static Lisp_Object font_prop_validate_spacing P_ ((enum font_property_index,
+ Lisp_Object, Lisp_Object));
+static int get_font_prop_index P_ ((Lisp_Object, int));
+static Lisp_Object font_prop_validate P_ ((Lisp_Object));
+
+static Lisp_Object
+font_prop_validate_symbol (prop_index, prop, val)
+ enum font_property_index prop_index;
+ Lisp_Object prop, val;
+{
+ if (EQ (prop, QCotf))
+ return (SYMBOLP (val) ? val : Qerror);
+ if (STRINGP (val))
+ val = (SCHARS (val) == 0 ? null_string
+ : intern_downcase ((char *) SDATA (val), SBYTES (val)));
+ else if (SYMBOLP (val))
+ {
+ if (SCHARS (SYMBOL_NAME (val)) == 0)
+ val = null_string;
+ }
+ else
+ val = Qerror;
+ return val;
+}
+
+static Lisp_Object
+font_prop_validate_style (prop_index, prop, val)
+ enum font_property_index prop_index;
+ Lisp_Object prop, val;
+{
+ if (! INTEGERP (val))
+ {
+ if (STRINGP (val))
+ val = intern_downcase ((char *) SDATA (val), SBYTES (val));
+ if (! SYMBOLP (val))
+ val = Qerror;
+ else
+ {
+ val = prop_name_to_numeric (prop_index, val);
+ if (NILP (val))
+ val = Qerror;
+ }
+ }
+ return val;
+}
+
+static Lisp_Object
+font_prop_validate_non_neg (prop_index, prop, val)
+ enum font_property_index prop_index;
+ Lisp_Object prop, val;
+{
+ return (NATNUMP (val) || (FLOATP (val) && XFLOAT_DATA (val) >= 0)
+ ? val : Qerror);
+}
+
+static Lisp_Object
+font_prop_validate_spacing (prop_index, prop, val)
+ enum font_property_index prop_index;
+ Lisp_Object prop, val;
+{
+ if (NILP (val) || (NATNUMP (val) && XINT (val) <= FONT_SPACING_CHARCELL))
+ return val;
+ if (EQ (val, Qc))
+ return make_number (FONT_SPACING_CHARCELL);
+ if (EQ (val, Qm))
+ return make_number (FONT_SPACING_MONO);
+ if (EQ (val, Qp))
+ return make_number (FONT_SPACING_PROPORTIONAL);
+ return Qerror;
+}
+
+/* Structure of known font property keys and validater of the
+ values. */
+struct
+{
+ /* Pointer to the key symbol. */
+ Lisp_Object *key;
+ /* Function to validate the value VAL, or NULL if any value is ok. */
+ Lisp_Object (*validater) P_ ((enum font_property_index prop_index,
+ Lisp_Object prop, Lisp_Object val));
+} font_property_table[] =
+ { { &QCtype, font_prop_validate_symbol },
+ { &QCfoundry, font_prop_validate_symbol },
+ { &QCfamily, font_prop_validate_symbol },
+ { &QCadstyle, font_prop_validate_symbol },
+ { &QCregistry, font_prop_validate_symbol },
+ { &QCweight, font_prop_validate_style },
+ { &QCslant, font_prop_validate_style },
+ { &QCwidth, font_prop_validate_style },
+ { &QCsize, font_prop_validate_non_neg },
+ { &QClanguage, font_prop_validate_symbol },
+ { &QCscript, font_prop_validate_symbol },
+ { &QCdpi, font_prop_validate_non_neg },
+ { &QCspacing, font_prop_validate_spacing },
+ { &QCscalable, NULL },
+ { &QCotf, font_prop_validate_symbol }
+ };
+
+#define FONT_PROPERTY_TABLE_SIZE \
+ ((sizeof font_property_table) / (sizeof *font_property_table))
+
+static int
+get_font_prop_index (key, from)
+ Lisp_Object key;
+ int from;
+{
+ for (; from < FONT_PROPERTY_TABLE_SIZE; from++)
+ if (EQ (key, *font_property_table[from].key))
+ return from;
+ return -1;
+}
+
+static Lisp_Object
+font_prop_validate (spec)
+ Lisp_Object spec;
+{
+ int i;
+ Lisp_Object prop, val, extra;
+
+ for (i = FONT_TYPE_INDEX; i < FONT_EXTRA_INDEX; i++)
+ {
+ if (! NILP (AREF (spec, i)))
+ {
+ prop = *font_property_table[i].key;
+ val = (font_property_table[i].validater) (i, prop, AREF (spec, i));
+ if (EQ (val, Qerror))
+ Fsignal (Qfont, list2 (build_string ("invalid font property"),
+ Fcons (prop, AREF (spec, i))));
+ ASET (spec, i, val);
+ }
+ }
+ for (extra = AREF (spec, FONT_EXTRA_INDEX);
+ CONSP (extra); extra = XCDR (extra))
+ {
+ Lisp_Object elt = XCAR (extra);
+
+ prop = XCAR (elt);
+ i = get_font_prop_index (prop, FONT_EXTRA_INDEX);
+ if (i >= 0
+ && font_property_table[i].validater)
+ {
+ val = (font_property_table[i].validater) (i, prop, XCDR (elt));
+ if (EQ (val, Qerror))
+ Fsignal (Qfont, list2 (build_string ("invalid font property"),
+ elt));
+ XSETCDR (elt, val);
+ }
+ }
+ return spec;
+}
+
+Lisp_Object
+font_put_extra (font, prop, val)
+ Lisp_Object font, prop, val;
+{
+ Lisp_Object extra = AREF (font, FONT_EXTRA_INDEX);
+ Lisp_Object slot = (NILP (extra) ? Qnil : assq_no_quit (prop, extra));
+
+ if (NILP (slot))
+ {
+ extra = Fcons (Fcons (prop, val), extra);
+ ASET (font, FONT_EXTRA_INDEX, extra);
+ return val;
+ }
+ XSETCDR (slot, val);
+ return val;
+}
+
+
+/* Font name parser and unparser */
+
+static Lisp_Object intern_font_field P_ ((char *, int));
+static int parse_matrix P_ ((char *));
+static int font_expand_wildcards P_ ((Lisp_Object *, int));
+static int font_parse_name P_ ((char *, Lisp_Object));
+
+/* An enumerator for each field of an XLFD font name. */
+enum xlfd_field_index
+{
+ XLFD_FOUNDRY_INDEX,
+ XLFD_FAMILY_INDEX,
+ XLFD_WEIGHT_INDEX,
+ XLFD_SLANT_INDEX,
+ XLFD_SWIDTH_INDEX,
+ XLFD_ADSTYLE_INDEX,
+ XLFD_PIXEL_INDEX,
+ XLFD_POINT_INDEX,
+ XLFD_RESX_INDEX,
+ XLFD_RESY_INDEX,
+ XLFD_SPACING_INDEX,
+ XLFD_AVGWIDTH_INDEX,
+ XLFD_REGISTRY_INDEX,
+ XLFD_ENCODING_INDEX,
+ XLFD_LAST_INDEX
+};
+
+/* An enumerator for mask bit corresponding to each XLFD field. */
+enum xlfd_field_mask
+{
+ XLFD_FOUNDRY_MASK = 0x0001,
+ XLFD_FAMILY_MASK = 0x0002,
+ XLFD_WEIGHT_MASK = 0x0004,
+ XLFD_SLANT_MASK = 0x0008,
+ XLFD_SWIDTH_MASK = 0x0010,
+ XLFD_ADSTYLE_MASK = 0x0020,
+ XLFD_PIXEL_MASK = 0x0040,
+ XLFD_POINT_MASK = 0x0080,
+ XLFD_RESX_MASK = 0x0100,
+ XLFD_RESY_MASK = 0x0200,
+ XLFD_SPACING_MASK = 0x0400,
+ XLFD_AVGWIDTH_MASK = 0x0800,
+ XLFD_REGISTRY_MASK = 0x1000,
+ XLFD_ENCODING_MASK = 0x2000
+};
+
+
+/* Return a Lispy value of a XLFD font field at STR and LEN bytes.
+ If LEN is zero, it returns `null_string'.
+ If STR is "*", it returns nil.
+ If all characters in STR are digits, it returns an integer.
+ Otherwise, it returns a symbol interned from downcased STR. */
+
+static Lisp_Object
+intern_font_field (str, len)
+ char *str;
+ int len;
+{
+ int i;
+
+ if (len == 0)
+ return null_string;
+ if (*str == '*' && len == 1)
+ return Qnil;
+ if (isdigit (*str))
+ {
+ for (i = 1; i < len; i++)
+ if (! isdigit (str[i]))
+ break;
+ if (i == len)
+ return make_number (atoi (str));
+ }
+ return intern_downcase (str, len);
+}
+
+/* Parse P pointing the pixel/point size field of the form
+ `[A B C D]' which specifies a transformation matrix:
+
+ A B 0
+ C D 0
+ 0 0 1
+
+ by which all glyphs of the font are transformed. The spec says
+ that scalar value N for the pixel/point size is equivalent to:
+ A = N * resx/resy, B = C = 0, D = N.
+
+ Return the scalar value N if the form is valid. Otherwise return
+ -1. */
+
+static int
+parse_matrix (p)
+ char *p;
+{
+ double matrix[4];
+ char *end;
+ int i;
+
+ for (i = 0, p++; i < 4 && *p && *p != ']'; i++)
+ {
+ if (*p == '~')
+ matrix[i] = - strtod (p + 1, &end);
+ else
+ matrix[i] = strtod (p, &end);
+ p = end;
+ }
+ return (i == 4 ? (int) matrix[3] : -1);
+}
+
+/* Expand a wildcard field in FIELD (the first N fields are filled) to
+ multiple fields to fill in all 14 XLFD fields while restring a
+ field position by its contents. */
+
+static int
+font_expand_wildcards (field, n)
+ Lisp_Object field[XLFD_LAST_INDEX];
+ int n;
+{
+ /* Copy of FIELD. */
+ Lisp_Object tmp[XLFD_LAST_INDEX];
+ /* Array of information about where this element can go. Nth
+ element is for Nth element of FIELD. */
+ struct {
+ /* Minimum possible field. */
+ int from;
+ /* Maxinum possible field. */
+ int to;
+ /* Bit mask of possible field. Nth bit corresponds to Nth field. */
+ int mask;
+ } range[XLFD_LAST_INDEX];
+ int i, j;
+ int range_from, range_to;
+ unsigned range_mask;
+
+#define XLFD_SYMBOL_MASK (XLFD_FOUNDRY_MASK | XLFD_FAMILY_MASK \
+ | XLFD_ADSTYLE_MASK | XLFD_REGISTRY_MASK)
+#define XLFD_NULL_MASK (XLFD_FOUNDRY_MASK | XLFD_ADSTYLE_MASK)
+#define XLFD_LARGENUM_MASK (XLFD_POINT_MASK | XLFD_RESX_MASK | XLFD_RESY_MASK \
+ | XLFD_AVGWIDTH_MASK)
+#define XLFD_REGENC_MASK (XLFD_REGISTRY_MASK | XLFD_ENCODING_MASK)
+
+ /* Initialize RANGE_MASK for FIELD[0] which can be 0th to (14 - N)th
+ field. The value is shifted to left one bit by one in the
+ following loop. */
+ for (i = 0, range_mask = 0; i <= 14 - n; i++)
+ range_mask = (range_mask << 1) | 1;
+
+ /* The triplet RANGE_FROM, RANGE_TO, and RANGE_MASK is a
+ position-based retriction for FIELD[I]. */
+ for (i = 0, range_from = 0, range_to = 14 - n; i < n;
+ i++, range_from++, range_to++, range_mask <<= 1)
+ {
+ Lisp_Object val = field[i];
+
+ tmp[i] = val;
+ if (NILP (val))
+ {
+ /* Wildcard. */
+ range[i].from = range_from;
+ range[i].to = range_to;
+ range[i].mask = range_mask;
+ }
+ else
+ {
+ /* The triplet FROM, TO, and MASK is a value-based
+ retriction for FIELD[I]. */
+ int from, to;
+ unsigned mask;
+
+ if (INTEGERP (val))
+ {
+ int numeric = XINT (val);
+
+ if (i + 1 == n)
+ from = to = XLFD_ENCODING_INDEX,
+ mask = XLFD_ENCODING_MASK;
+ else if (numeric == 0)
+ from = XLFD_PIXEL_INDEX, to = XLFD_AVGWIDTH_INDEX,
+ mask = XLFD_PIXEL_MASK | XLFD_LARGENUM_MASK;
+ else if (numeric <= 48)
+ from = to = XLFD_PIXEL_INDEX,
+ mask = XLFD_PIXEL_MASK;
+ else
+ from = XLFD_POINT_INDEX, to = XLFD_AVGWIDTH_INDEX,
+ mask = XLFD_LARGENUM_MASK;
+ }
+ else if (EQ (val, null_string))
+ from = XLFD_FOUNDRY_INDEX, to = XLFD_ADSTYLE_INDEX,
+ mask = XLFD_NULL_MASK;
+ else if (i == 0)
+ from = to = XLFD_FOUNDRY_INDEX, mask = XLFD_FOUNDRY_MASK;
+ else if (i + 1 == n)
+ {
+ Lisp_Object name = SYMBOL_NAME (val);
+
+ if (SDATA (name)[SBYTES (name) - 1] == '*')
+ from = XLFD_REGISTRY_INDEX, to = XLFD_ENCODING_INDEX,
+ mask = XLFD_REGENC_MASK;
+ else
+ from = to = XLFD_ENCODING_INDEX,
+ mask = XLFD_ENCODING_MASK;
+ }
+ else if (range_from <= XLFD_WEIGHT_INDEX
+ && range_to >= XLFD_WEIGHT_INDEX
+ && !NILP (prop_name_to_numeric (FONT_WEIGHT_INDEX, val)))
+ from = to = XLFD_WEIGHT_INDEX, mask = XLFD_WEIGHT_MASK;
+ else if (range_from <= XLFD_SLANT_INDEX
+ && range_to >= XLFD_SLANT_INDEX
+ && !NILP (prop_name_to_numeric (FONT_SLANT_INDEX, val)))
+ from = to = XLFD_SLANT_INDEX, mask = XLFD_SLANT_MASK;
+ else if (range_from <= XLFD_SWIDTH_INDEX
+ && range_to >= XLFD_SWIDTH_INDEX
+ && !NILP (prop_name_to_numeric (FONT_WIDTH_INDEX, val)))
+ from = to = XLFD_SWIDTH_INDEX, mask = XLFD_SWIDTH_MASK;
+ else
+ {
+ if (EQ (val, Qc) || EQ (val, Qm) || EQ (val, Qp) || EQ (val, Qd))
+ from = to = XLFD_SPACING_INDEX, mask = XLFD_SPACING_MASK;
+ else
+ from = XLFD_FOUNDRY_INDEX, to = XLFD_ENCODING_INDEX,
+ mask = XLFD_SYMBOL_MASK;
+ }
+
+ /* Merge position-based and value-based restrictions. */
+ mask &= range_mask;
+ while (from < range_from)
+ mask &= ~(1 << from++);
+ while (from < 14 && ! (mask & (1 << from)))
+ from++;
+ while (to > range_to)
+ mask &= ~(1 << to--);
+ while (to >= 0 && ! (mask & (1 << to)))
+ to--;
+ if (from > to)
+ return -1;
+ range[i].from = from;
+ range[i].to = to;
+ range[i].mask = mask;
+
+ if (from > range_from || to < range_to)
+ {
+ /* The range is narrowed by value-based restrictions.
+ Reflect it to the other fields. */
+
+ /* Following fields should be after FROM. */
+ range_from = from;
+ /* Preceding fields should be before TO. */
+ for (j = i - 1, from--, to--; j >= 0; j--, from--, to--)
+ {
+ /* Check FROM for non-wildcard field. */
+ if (! NILP (tmp[j]) && range[j].from < from)
+ {
+ while (range[j].from < from)
+ range[j].mask &= ~(1 << range[j].from++);
+ while (from < 14 && ! (range[j].mask & (1 << from)))
+ from++;
+ range[j].from = from;
+ }
+ else
+ from = range[j].from;
+ if (range[j].to > to)
+ {
+ while (range[j].to > to)
+ range[j].mask &= ~(1 << range[j].to--);
+ while (to >= 0 && ! (range[j].mask & (1 << to)))
+ to--;
+ range[j].to = to;
+ }
+ else
+ to = range[j].to;
+ if (from > to)
+ return -1;
+ }
+ }
+ }
+ }
+
+ /* Decide all fileds from restrictions in RANGE. */
+ for (i = j = 0; i < n ; i++)
+ {
+ if (j < range[i].from)
+ {
+ if (i == 0 || ! NILP (tmp[i - 1]))
+ /* None of TMP[X] corresponds to Jth field. */
+ return -1;
+ for (; j < range[i].from; j++)
+ field[j] = Qnil;
+ }
+ field[j++] = tmp[i];
+ }
+ if (! NILP (tmp[n - 1]) && j < XLFD_REGISTRY_INDEX)
+ return -1;
+ for (; j < XLFD_LAST_INDEX; j++)
+ field[j] = Qnil;
+ if (INTEGERP (field[XLFD_ENCODING_INDEX]))
+ field[XLFD_ENCODING_INDEX]
+ = Fintern (Fnumber_to_string (field[XLFD_ENCODING_INDEX]), Qnil);
+ return 0;
+}
+
+/* Parse NAME (null terminated) as XLFD and store information in FONT
+ (font-spec or font-entity). Size property of FONT is set as
+ follows:
+ specified XLFD fields FONT property
+ --------------------- -------------
+ PIXEL_SIZE PIXEL_SIZE (Lisp integer)
+ POINT_SIZE and RESY calculated pixel size (Lisp integer)
+ POINT_SIZE POINT_SIZE/10 (Lisp float)
+
+ If NAME is successfully parsed, return 0. Otherwise return -1.
+
+ FONT is usually a font-spec, but when this function is called from
+ X font backend driver, it is a font-entity. In that case, NAME is
+ a fully specified XLFD, and we set FONT_EXTRA_INDEX of FONT to a
+ symbol RESX-RESY-SPACING-AVGWIDTH.
+*/
+
+int
+font_parse_xlfd (name, font)
+ char *name;
+ Lisp_Object font;
+{
+ int len = strlen (name);
+ int i, j;
+ Lisp_Object dpi, spacing;
+ int avgwidth;
+ char *f[XLFD_LAST_INDEX + 1];
+ Lisp_Object val;
+ char *p;
+
+ if (len > 255)
+ /* Maximum XLFD name length is 255. */
+ return -1;
+ /* Accept "*-.." as a fully specified XLFD. */
+ if (name[0] == '*' && name[1] == '-')
+ i = 1, f[XLFD_FOUNDRY_INDEX] = name;
+ else
+ i = 0;
+ for (p = name + i; *p; p++)
+ if (*p == '-' && i < XLFD_LAST_INDEX)
+ f[i++] = p + 1;
+ f[i] = p;
+
+ dpi = spacing = Qnil;
+ avgwidth = -1;
+
+ if (i == XLFD_LAST_INDEX)
+ {
+ int pixel_size;
+
+ /* Fully specified XLFD. */
+ for (i = 0, j = FONT_FOUNDRY_INDEX; i < XLFD_WEIGHT_INDEX; i++, j++)
+ {
+ val = intern_font_field (f[i], f[i + 1] - 1 - f[i]);
+ if (! NILP (val))
+ ASET (font, j, val);
+ }
+ for (j = FONT_WEIGHT_INDEX; i < XLFD_ADSTYLE_INDEX; i++, j++)
+ {
+ val = intern_font_field (f[i], f[i + 1] - 1 - f[i]);
+ if (! NILP (val))
+ {
+ Lisp_Object numeric = prop_name_to_numeric (j, val);
+
+ if (INTEGERP (numeric))
+ val = numeric;
+ ASET (font, j, val);
+ }
+ }
+ val = intern_font_field (f[i], f[i + 1] - 1 - f[i]);
+ if (! NILP (val))
+ ASET (font, FONT_ADSTYLE_INDEX, val);
+ i = XLFD_REGISTRY_INDEX;
+ val = intern_font_field (f[i], f[i + 2] - f[i]);
+ if (! NILP (val))
+ ASET (font, FONT_REGISTRY_INDEX, val);
+
+ p = f[XLFD_PIXEL_INDEX];
+ if (*p == '[' && (pixel_size = parse_matrix (p)) >= 0)
+ ASET (font, FONT_SIZE_INDEX, make_number (pixel_size));
+ else
+ {
+ i = XLFD_PIXEL_INDEX;
+ val = intern_font_field (f[i], f[i + 1] - 1 - f[i]);
+ if (! NILP (val))
+ ASET (font, FONT_SIZE_INDEX, val);
+ else
+ {
+ double point_size = -1;
+
+ xassert (FONT_SPEC_P (font));
+ p = f[XLFD_POINT_INDEX];
+ if (*p == '[')
+ point_size = parse_matrix (p);
+ else if (isdigit (*p))
+ point_size = atoi (p), point_size /= 10;
+ if (point_size >= 0)
+ ASET (font, FONT_SIZE_INDEX, make_float (point_size));
+ else
+ {
+ i = XLFD_PIXEL_INDEX;
+ val = intern_font_field (f[i], f[i + 1] - 1 - f[i]);
+ if (! NILP (val))
+ ASET (font, FONT_SIZE_INDEX, val);
+ }
+ }
+ }
+
+ /* Parse RESX, RESY, SPACING, and AVGWIDTH. */
+ if (FONT_ENTITY_P (font))
+ {
+ i = XLFD_RESX_INDEX;
+ ASET (font, FONT_EXTRA_INDEX,
+ intern_font_field (f[i], f[XLFD_REGISTRY_INDEX] - 1 - f[i]));
+ return 0;
+ }
+
+ /* Here we just setup DPI, SPACING, and AVGWIDTH. They are set
+ in FONT_EXTRA_INDEX later. */
+ i = XLFD_RESX_INDEX;
+ dpi = intern_font_field (f[i], f[i + 1] - 1 - f[i]);
+ i = XLFD_SPACING_INDEX;
+ spacing = intern_font_field (f[i], f[i + 1] - 1 - f[i]);
+ p = f[XLFD_AVGWIDTH_INDEX];
+ if (*p == '~')
+ p++;
+ if (isdigit (*p))
+ avgwidth = atoi (p);
+ }
+ else
+ {
+ int wild_card_found = 0;
+ Lisp_Object prop[XLFD_LAST_INDEX];
+
+ for (j = 0; j < i; j++)
+ {
+ if (*f[j] == '*')
+ {
+ if (f[j][1] && f[j][1] != '-')
+ return -1;
+ prop[j] = Qnil;
+ wild_card_found = 1;
+ }
+ else if (isdigit (*f[j]))
+ {
+ for (p = f[j] + 1; isdigit (*p); p++);
+ if (*p && *p != '-')
+ prop[j] = intern_downcase (f[j], p - f[j]);
+ else
+ prop[j] = make_number (atoi (f[j]));
+ }
+ else if (j + 1 < i)
+ prop[j] = intern_font_field (f[j], f[j + 1] - 1 - f[j]);
+ else
+ prop[j] = intern_font_field (f[j], f[i] - f[j]);
+ }
+ if (! wild_card_found)
+ return -1;
+ if (font_expand_wildcards (prop, i) < 0)
+ return -1;
+
+ for (i = 0, j = FONT_FOUNDRY_INDEX; i < XLFD_WEIGHT_INDEX; i++, j++)
+ if (! NILP (prop[i]))
+ ASET (font, j, prop[i]);
+ for (j = FONT_WEIGHT_INDEX; i < XLFD_ADSTYLE_INDEX; i++, j++)
+ if (! NILP (prop[i]))
+ ASET (font, j, prop[i]);
+ if (! NILP (prop[XLFD_ADSTYLE_INDEX]))
+ ASET (font, FONT_ADSTYLE_INDEX, prop[XLFD_ADSTYLE_INDEX]);
+ val = prop[XLFD_REGISTRY_INDEX];
+ if (NILP (val))
+ {
+ val = prop[XLFD_ENCODING_INDEX];
+ if (! NILP (val))
+ val = Fintern (concat2 (build_string ("*-"), SYMBOL_NAME (val)),
+ Qnil);
+ }
+ else if (NILP (prop[XLFD_ENCODING_INDEX]))
+ val = Fintern (concat2 (SYMBOL_NAME (val), build_string ("-*")),
+ Qnil);
+ else
+ val = Fintern (concat3 (SYMBOL_NAME (val), build_string ("-"),
+ SYMBOL_NAME (prop[XLFD_ENCODING_INDEX])),
+ Qnil);
+ if (! NILP (val))
+ ASET (font, FONT_REGISTRY_INDEX, val);
+
+ if (INTEGERP (prop[XLFD_PIXEL_INDEX]))
+ ASET (font, FONT_SIZE_INDEX, prop[XLFD_PIXEL_INDEX]);
+ else if (INTEGERP (prop[XLFD_POINT_INDEX]))
+ {
+ double point_size = XINT (prop[XLFD_POINT_INDEX]);
+
+ ASET (font, FONT_SIZE_INDEX, make_float (point_size / 10));
+ }
+
+ dpi = prop[XLFD_RESX_INDEX];
+ spacing = prop[XLFD_SPACING_INDEX];
+ if (INTEGERP (prop[XLFD_AVGWIDTH_INDEX]))
+ avgwidth = XINT (prop[XLFD_AVGWIDTH_INDEX]);
+ }
+
+ if (! NILP (dpi))
+ font_put_extra (font, QCdpi, dpi);
+ if (! NILP (spacing))
+ font_put_extra (font, QCspacing, spacing);
+ if (avgwidth >= 0)
+ font_put_extra (font, QCscalable, avgwidth == 0 ? Qt : Qnil);
+
+ return 0;
+}
+
+/* Store XLFD name of FONT (font-spec or font-entity) in NAME (NBYTES
+ length), and return the name length. If FONT_SIZE_INDEX of FONT is
+ 0, use PIXEL_SIZE instead. */
+
+int
+font_unparse_xlfd (font, pixel_size, name, nbytes)
+ Lisp_Object font;
+ int pixel_size;
+ char *name;
+ int nbytes;
+{
+ char *f[XLFD_REGISTRY_INDEX + 1];
+ Lisp_Object val;
+ int i, j, len = 0;
+
+ xassert (FONTP (font));
+
+ for (i = FONT_FOUNDRY_INDEX, j = XLFD_FOUNDRY_INDEX; i <= FONT_REGISTRY_INDEX;
+ i++, j++)
+ {
+ if (i == FONT_ADSTYLE_INDEX)
+ j = XLFD_ADSTYLE_INDEX;
+ else if (i == FONT_REGISTRY_INDEX)
+ j = XLFD_REGISTRY_INDEX;
+ val = AREF (font, i);
+ if (NILP (val))
+ {
+ if (j == XLFD_REGISTRY_INDEX)
+ f[j] = "*-*", len += 4;
+ else
+ f[j] = "*", len += 2;
+ }
+ else
+ {
+ if (SYMBOLP (val))
+ val = SYMBOL_NAME (val);
+ if (j == XLFD_REGISTRY_INDEX
+ && ! strchr ((char *) SDATA (val), '-'))
+ {
+ /* Change "jisx0208*" and "jisx0208" to "jisx0208*-*". */
+ if (SDATA (val)[SBYTES (val) - 1] == '*')
+ {
+ f[j] = alloca (SBYTES (val) + 3);
+ sprintf (f[j], "%s-*", SDATA (val));
+ len += SBYTES (val) + 3;
+ }
+ else
+ {
+ f[j] = alloca (SBYTES (val) + 4);
+ sprintf (f[j], "%s*-*", SDATA (val));
+ len += SBYTES (val) + 4;
+ }
+ }
+ else
+ f[j] = (char *) SDATA (val), len += SBYTES (val) + 1;
+ }
+ }
+
+ for (i = FONT_WEIGHT_INDEX, j = XLFD_WEIGHT_INDEX; i <= FONT_WIDTH_INDEX;
+ i++, j++)
+ {
+ val = AREF (font, i);
+ if (NILP (val))
+ f[j] = "*", len += 2;
+ else
+ {
+ if (INTEGERP (val))
+ val = prop_numeric_to_name (i, XINT (val));
+ if (SYMBOLP (val))
+ val = SYMBOL_NAME (val);
+ xassert (STRINGP (val));
+ f[j] = (char *) SDATA (val), len += SBYTES (val) + 1;
+ }
+ }
+
+ val = AREF (font, FONT_SIZE_INDEX);
+ xassert (NUMBERP (val) || NILP (val));
+ if (INTEGERP (val))
+ {
+ f[XLFD_PIXEL_INDEX] = alloca (22);
+ i = XINT (val);
+ if (i > 0)
+ len += sprintf (f[XLFD_PIXEL_INDEX], "%d-*", i) + 1;
+ else /* i == 0 */
+ len += sprintf (f[XLFD_PIXEL_INDEX], "%d-*", pixel_size) + 1;
+ }
+ else if (FLOATP (val))
+ {
+ f[XLFD_PIXEL_INDEX] = alloca (12);
+ i = XFLOAT_DATA (val) * 10;
+ len += sprintf (f[XLFD_PIXEL_INDEX], "*-%d", i) + 1;
+ }
+ else
+ f[XLFD_PIXEL_INDEX] = "*-*", len += 4;
+
+ val = AREF (font, FONT_EXTRA_INDEX);
+
+ if (FONT_ENTITY_P (font)
+ && EQ (AREF (font, FONT_TYPE_INDEX), Qx))
+ {
+ /* Setup names for RESX-RESY-SPACING-AVWIDTH. */
+ if (SYMBOLP (val) && ! NILP (val))
+ {
+ val = SYMBOL_NAME (val);
+ f[XLFD_RESX_INDEX] = (char *) SDATA (val), len += SBYTES (val) + 1;
+ }
+ else
+ f[XLFD_RESX_INDEX] = "*-*-*-*", len += 6;
+ }
+ else
+ {
+ Lisp_Object dpi = assq_no_quit (QCdpi, val);
+ Lisp_Object spacing = assq_no_quit (QCspacing, val);
+ Lisp_Object scalable = assq_no_quit (QCscalable, val);
+
+ if (CONSP (dpi) || CONSP (spacing) || CONSP (scalable))
+ {
+ char *str = alloca (24);
+ int this_len;
+
+ if (CONSP (dpi) && INTEGERP (XCDR (dpi)))
+ this_len = sprintf (str, "%d-%d",
+ XINT (XCDR (dpi)), XINT (XCDR (dpi)));
+ else
+ this_len = sprintf (str, "*-*");
+ if (CONSP (spacing) && ! NILP (XCDR (spacing)))
+ {
+ val = XCDR (spacing);
+ if (INTEGERP (val))
+ {
+ if (XINT (val) < FONT_SPACING_MONO)
+ val = Qp;
+ else if (XINT (val) < FONT_SPACING_CHARCELL)
+ val = Qm;
+ else
+ val = Qc;
+ }
+ xassert (SYMBOLP (val));
+ this_len += sprintf (str + this_len, "-%c",
+ SDATA (SYMBOL_NAME (val))[0]);
+ }
+ else
+ this_len += sprintf (str + this_len, "-*");
+ if (CONSP (scalable) && ! NILP (XCDR (spacing)))
+ this_len += sprintf (str + this_len, "-0");
+ else
+ this_len += sprintf (str + this_len, "-*");
+ f[XLFD_RESX_INDEX] = str;
+ len += this_len;
+ }
+ else
+ f[XLFD_RESX_INDEX] = "*-*-*-*", len += 8;
+ }
+
+ len++; /* for terminating '\0'. */
+ if (len >= nbytes)
+ return -1;
+ return sprintf (name, "-%s-%s-%s-%s-%s-%s-%s-%s-%s",
+ f[XLFD_FOUNDRY_INDEX], f[XLFD_FAMILY_INDEX],
+ f[XLFD_WEIGHT_INDEX], f[XLFD_SLANT_INDEX],
+ f[XLFD_SWIDTH_INDEX],
+ f[XLFD_ADSTYLE_INDEX], f[XLFD_PIXEL_INDEX],
+ f[XLFD_RESX_INDEX], f[XLFD_REGISTRY_INDEX]);
+}
+
+/* Parse NAME (null terminated) as Fonconfig's name format and store
+ information in FONT (font-spec or font-entity). If NAME is
+ successfully parsed, return 0. Otherwise return -1. */
+
+int
+font_parse_fcname (name, font)
+ char *name;
+ Lisp_Object font;
+{
+ char *p0, *p1;
+ int len = strlen (name);
+ char *copy;
+
+ if (len == 0)
+ return -1;
+ /* It is assured that (name[0] && name[0] != '-'). */
+ if (name[0] == ':')
+ p0 = name;
+ else
+ {
+ Lisp_Object family;
+ double point_size;
+
+ for (p0 = name + 1; *p0 && (*p0 != '-' && *p0 != ':'); p0++)
+ if (*p0 == '\\' && p0[1])
+ p0++;
+ family = intern_font_field (name, p0 - name);
+ if (*p0 == '-')
+ {
+ if (! isdigit (p0[1]))
+ return -1;
+ point_size = strtod (p0 + 1, &p1);
+ if (*p1 && *p1 != ':')
+ return -1;
+ ASET (font, FONT_SIZE_INDEX, make_float (point_size));
+ p0 = p1;
+ }
+ ASET (font, FONT_FAMILY_INDEX, family);
+ }
+
+ len -= p0 - name;
+ copy = alloca (len + 1);
+ if (! copy)
+ return -1;
+ name = copy;
+
+ /* Now parse ":KEY=VAL" patterns. Store known keys and values in
+ extra, copy unknown ones to COPY. */
+ while (*p0)
+ {
+ Lisp_Object key, val;
+ int prop;
+
+ for (p1 = p0 + 1; *p1 && *p1 != '=' && *p1 != ':'; p1++);
+ if (*p1 != '=')
+ {
+ /* Must be an enumerated value. */
+ val = intern_font_field (p0 + 1, p1 - p0 - 1);
+ if (memcmp (p0 + 1, "light", 5) == 0
+ || memcmp (p0 + 1, "medium", 6) == 0
+ || memcmp (p0 + 1, "demibold", 8) == 0
+ || memcmp (p0 + 1, "bold", 4) == 0
+ || memcmp (p0 + 1, "black", 5) == 0)
+ {
+ ASET (font, FONT_WEIGHT_INDEX, val);
+ }
+ else if (memcmp (p0 + 1, "roman", 5) == 0
+ || memcmp (p0 + 1, "italic", 6) == 0
+ || memcmp (p0 + 1, "oblique", 7) == 0)
+ {
+ ASET (font, FONT_SLANT_INDEX, val);
+ }
+ else if (memcmp (p0 + 1, "charcell", 8) == 0
+ || memcmp (p0 + 1, "mono", 4) == 0
+ || memcmp (p0 + 1, "proportional", 12) == 0)
+ {
+ font_put_extra (font, QCspacing,
+ (p0[1] == 'c' ? Qc : p0[1] == 'm' ? Qm : Qp));
+ }
+ else
+ {
+ /* unknown key */
+ bcopy (p0, copy, p1 - p0);
+ copy += p1 - p0;
+ }
+ }
+ else
+ {
+ if (memcmp (p0 + 1, "pixelsize=", 10) == 0)
+ prop = FONT_SIZE_INDEX;
+ else
+ {
+ key = intern_font_field (p0, p1 - p0);
+ prop = get_font_prop_index (key, 0);
+ }
+ p0 = p1 + 1;
+ for (p1 = p0; *p1 && *p1 != ':'; p1++);
+ val = intern_font_field (p0, p1 - p0);
+ if (! NILP (val))
+ {
+ if (prop >= 0 && prop < FONT_EXTRA_INDEX)
+ {
+ ASET (font, prop, val);
+ }
+ else
+ font_put_extra (font, key, val);
+ }
+ }
+ p0 = p1;
+ }
+
+ return 0;
+}
+
+/* Store fontconfig's font name of FONT (font-spec or font-entity) in
+ NAME (NBYTES length), and return the name length. If
+ FONT_SIZE_INDEX of FONT is 0, use PIXEL_SIZE instead. */
+
+int
+font_unparse_fcname (font, pixel_size, name, nbytes)
+ Lisp_Object font;
+ int pixel_size;
+ char *name;
+ int nbytes;
+{
+ Lisp_Object val;
+ int point_size;
+ int dpi, spacing, scalable;
+ int i, len = 1;
+ char *p;
+ Lisp_Object styles[3];
+ char *style_names[3] = { "weight", "slant", "width" };
+
+ val = AREF (font, FONT_FAMILY_INDEX);
+ if (SYMBOLP (val) && ! NILP (val))
+ len += SBYTES (SYMBOL_NAME (val));
+
+ val = AREF (font, FONT_SIZE_INDEX);
+ if (INTEGERP (val))
+ {
+ if (XINT (val) != 0)
+ pixel_size = XINT (val);
+ point_size = -1;
+ len += 21; /* for ":pixelsize=NUM" */
+ }
+ else if (FLOATP (val))
+ {
+ pixel_size = -1;
+ point_size = (int) XFLOAT_DATA (val);
+ len += 11; /* for "-NUM" */
+ }
+
+ val = AREF (font, FONT_FOUNDRY_INDEX);
+ if (SYMBOLP (val) && ! NILP (val))
+ /* ":foundry=NAME" */
+ len += 9 + SBYTES (SYMBOL_NAME (val));
+
+ for (i = FONT_WEIGHT_INDEX; i <= FONT_WIDTH_INDEX; i++)
+ {
+ val = AREF (font, i);
+ if (INTEGERP (val))
+ {
+ val = prop_numeric_to_name (i, XINT (val));
+ len += (strlen (style_names[i - FONT_WEIGHT_INDEX])
+ + 2 + SBYTES (SYMBOL_NAME (val))); /* :xxx=NAME */
+ }
+ styles[i - FONT_WEIGHT_INDEX] = val;
+ }
+
+ val = AREF (font, FONT_EXTRA_INDEX);
+ if (FONT_ENTITY_P (font)
+ && EQ (AREF (font, FONT_TYPE_INDEX), Qx))
+ {
+ char *p;
+
+ /* VAL is a symbol of name `RESX-RESY-SPACING-AVWIDTH'. */
+ p = (char *) SDATA (SYMBOL_NAME (val));
+ dpi = atoi (p);
+ for (p++; *p != '-'; p++); /* skip RESX */
+ for (p++; *p != '-'; p++); /* skip RESY */
+ spacing = (*p == 'c' ? FONT_SPACING_CHARCELL
+ : *p == 'm' ? FONT_SPACING_MONO
+ : FONT_SPACING_PROPORTIONAL);
+ for (p++; *p != '-'; p++); /* skip SPACING */
+ scalable = (atoi (p) == 0);
+ /* The longest pattern is ":dpi=NUM:scalable=False:spacing=100" */
+ len += 42;
+ }
+ else
+ {
+ Lisp_Object elt;
+
+ dpi = spacing = scalable = -1;
+ elt = assq_no_quit (QCdpi, val);
+ if (CONSP (elt))
+ dpi = XINT (XCDR (elt)), len += 15; /* for ":dpi=NUM" */
+ elt = assq_no_quit (QCspacing, val);
+ if (CONSP (elt))
+ spacing = XINT (XCDR (elt)), len += 12; /* for ":spacing=100" */
+ elt = assq_no_quit (QCscalable, val);
+ if (CONSP (elt))
+ scalable = ! NILP (XCDR (elt)), len += 15; /* for ":scalable=False" */
+ }
+
+ if (len > nbytes)
+ return -1;
+ p = name;
+ if (! NILP (AREF (font, FONT_FAMILY_INDEX)))
+ p += sprintf(p, "%s",
+ SDATA (SYMBOL_NAME (AREF (font, FONT_FAMILY_INDEX))));
+ if (point_size > 0)
+ {
+ if (p == name)
+ p += sprintf (p, "%d", point_size);
+ else
+ p += sprintf (p, "-%d", point_size);
+ }
+ else if (pixel_size > 0)
+ p += sprintf (p, ":pixelsize=%d", pixel_size);
+ if (SYMBOLP (AREF (font, FONT_FOUNDRY_INDEX))
+ && ! NILP (AREF (font, FONT_FOUNDRY_INDEX)))
+ p += sprintf (p, ":foundry=%s",
+ SDATA (SYMBOL_NAME (AREF (font, FONT_FOUNDRY_INDEX))));
+ for (i = 0; i < 3; i++)
+ if (SYMBOLP (styles[i]) && ! NILP (styles [i]))
+ p += sprintf (p, ":%s=%s", style_names[i],
+ SDATA (SYMBOL_NAME (styles [i])));
+ if (dpi >= 0)
+ p += sprintf (p, ":dpi=%d", dpi);
+ if (spacing >= 0)
+ p += sprintf (p, ":spacing=%d", spacing);
+ if (scalable > 0)
+ p += sprintf (p, ":scalable=True");
+ else if (scalable == 0)
+ p += sprintf (p, ":scalable=False");
+ return (p - name);
+}
+
+/* Parse NAME (null terminated) and store information in FONT
+ (font-spec or font-entity). If NAME is successfully parsed, return
+ 0. Otherwise return -1.
+
+ If NAME is XLFD and FONT is a font-entity, store
+ RESX-RESY-SPACING-AVWIDTH information as a symbol in
+ FONT_EXTRA_INDEX. */
+
+static int
+font_parse_name (name, font)
+ char *name;
+ Lisp_Object font;
+{
+ if (name[0] == '-' || index (name, '*'))
+ return font_parse_xlfd (name, font);
+ return font_parse_fcname (name, font);
+}
+
+void
+font_merge_old_spec (name, family, registry, spec)
+ Lisp_Object name, family, registry, spec;
+{
+ if (STRINGP (name))
+ {
+ if (font_parse_xlfd ((char *) SDATA (name), spec) < 0)
+ {
+ Lisp_Object extra = Fcons (Fcons (QCname, name), Qnil);
+
+ ASET (spec, FONT_EXTRA_INDEX, extra);
+ }
+ }
+ else
+ {
+ if (! NILP (family))
+ {
+ int len;
+ char *p0, *p1;
+
+ xassert (STRINGP (family));
+ len = SBYTES (family);
+ p0 = (char *) SDATA (family);
+ p1 = index (p0, '-');
+ if (p1)
+ {
+ if ((*p0 != '*' || p1 - p0 > 1)
+ && NILP (AREF (spec, FONT_FOUNDRY_INDEX)))
+ ASET (spec, FONT_FOUNDRY_INDEX,
+ intern_downcase (p0, p1 - p0));
+ if (NILP (AREF (spec, FONT_FAMILY_INDEX)))
+ ASET (spec, FONT_FAMILY_INDEX,
+ intern_downcase (p1 + 1, len - (p1 + 1 - p0)));
+ }
+ else if (NILP (AREF (spec, FONT_FAMILY_INDEX)))
+ ASET (spec, FONT_FAMILY_INDEX, intern_downcase (p0, len));
+ }
+ if (! NILP (registry)
+ && NILP (AREF (spec, FONT_REGISTRY_INDEX)))
+ ASET (spec, FONT_REGISTRY_INDEX,
+ intern_downcase ((char *) SDATA (registry), SBYTES (registry)));
+ }
+}
+
+static Lisp_Object
+font_lispy_object (font)
+ struct font *font;
+{
+ Lisp_Object objlist = AREF (font->entity, FONT_OBJLIST_INDEX);
+
+ for (; ! NILP (objlist); objlist = XCDR (objlist))
+ {
+ struct Lisp_Save_Value *p = XSAVE_VALUE (XCAR (objlist));
+
+ if (font == (struct font *) p->pointer)
+ break;
+ }
+ xassert (! NILP (objlist));
+ return XCAR (objlist);
+}
+
+#define LGSTRING_HEADER_SIZE 6
+#define LGSTRING_GLYPH_SIZE 8
+
+static int
+check_gstring (gstring)
+ Lisp_Object gstring;
+{
+ Lisp_Object val;
+ int i, j;
+
+ CHECK_VECTOR (gstring);
+ val = AREF (gstring, 0);
+ CHECK_VECTOR (val);
+ if (ASIZE (val) < LGSTRING_HEADER_SIZE)
+ goto err;
+ CHECK_FONT_OBJECT (LGSTRING_FONT (gstring));
+ if (! NILP (LGSTRING_LBEARING (gstring)))
+ CHECK_NUMBER (LGSTRING_LBEARING (gstring));
+ if (! NILP (LGSTRING_RBEARING (gstring)))
+ CHECK_NUMBER (LGSTRING_RBEARING (gstring));
+ if (! NILP (LGSTRING_WIDTH (gstring)))
+ CHECK_NATNUM (LGSTRING_WIDTH (gstring));
+ if (! NILP (LGSTRING_ASCENT (gstring)))
+ CHECK_NUMBER (LGSTRING_ASCENT (gstring));
+ if (! NILP (LGSTRING_DESCENT (gstring)))
+ CHECK_NUMBER (LGSTRING_DESCENT(gstring));
+
+ for (i = 0; i < LGSTRING_LENGTH (gstring); i++)
+ {
+ val = LGSTRING_GLYPH (gstring, i);
+ CHECK_VECTOR (val);
+ if (ASIZE (val) < LGSTRING_GLYPH_SIZE)
+ goto err;
+ if (NILP (LGLYPH_CHAR (val)))
+ break;
+ CHECK_NATNUM (LGLYPH_FROM (val));
+ CHECK_NATNUM (LGLYPH_TO (val));
+ CHECK_CHARACTER (LGLYPH_CHAR (val));
+ if (! NILP (LGLYPH_CODE (val)))
+ CHECK_NATNUM (LGLYPH_CODE (val));
+ if (! NILP (LGLYPH_WIDTH (val)))
+ CHECK_NATNUM (LGLYPH_WIDTH (val));
+ if (! NILP (LGLYPH_ADJUSTMENT (val)))
+ {
+ val = LGLYPH_ADJUSTMENT (val);
+ CHECK_VECTOR (val);
+ if (ASIZE (val) < 3)
+ goto err;
+ for (j = 0; j < 3; j++)
+ CHECK_NUMBER (AREF (val, j));
+ }
+ }
+ return i;
+ err:
+ error ("Invalid glyph-string format");
+ return -1;
+}
+
+
+/* OTF handler */
+
+static void
+check_otf_features (otf_features)
+ Lisp_Object otf_features;
+{
+ Lisp_Object val, elt;
+
+ CHECK_CONS (otf_features);
+ CHECK_SYMBOL (XCAR (otf_features));
+ otf_features = XCDR (otf_features);
+ CHECK_CONS (otf_features);
+ CHECK_SYMBOL (XCAR (otf_features));
+ otf_features = XCDR (otf_features);
+ for (val = Fcar (otf_features); ! NILP (val); val = Fcdr (val))
+ {
+ CHECK_SYMBOL (Fcar (val));
+ if (SBYTES (SYMBOL_NAME (XCAR (val))) > 4)
+ error ("Invalid OTF GSUB feature: %s", SYMBOL_NAME (XCAR (val)));
+ }
+ otf_features = XCDR (otf_features);
+ for (val = Fcar (otf_features); ! NILP (val); val = Fcdr (val))
+ {
+ CHECK_SYMBOL (Fcar (val));
+ if (SBYTES (SYMBOL_NAME (XCAR (val))) > 4)
+ error ("Invalid OTF GPOS feature: %s", SYMBOL_NAME (XCAR (val)));
+ }
+}
+
+#ifdef HAVE_LIBOTF
+#include <otf.h>
+
+Lisp_Object otf_list;
+
+static Lisp_Object
+otf_tag_symbol (tag)
+ OTF_Tag tag;
+{
+ char name[5];
+
+ OTF_tag_name (tag, name);
+ return Fintern (make_unibyte_string (name, 4), Qnil);
+}
+
+static OTF *
+otf_open (entity, file)
+ Lisp_Object entity;
+ char *file;
+{
+ Lisp_Object val = Fassoc (entity, otf_list);
+ OTF *otf;
+
+ if (! NILP (val))
+ otf = XSAVE_VALUE (XCDR (val))->pointer;
+ else
+ {
+ otf = file ? OTF_open (file) : NULL;
+ val = make_save_value (otf, 0);
+ otf_list = Fcons (Fcons (entity, val), otf_list);
+ }
+ return otf;
+}
+
+
+/* Return a list describing which scripts/languages FONT supports by
+ which GSUB/GPOS features of OpenType tables. See the comment of
+ (sturct font_driver).otf_capability. */
+
+Lisp_Object
+font_otf_capability (font)
+ struct font *font;
+{
+ OTF *otf;
+ Lisp_Object capability = Fcons (Qnil, Qnil);
+ int i;
+
+ otf = otf_open (font->entity, font->file_name);
+ if (! otf)
+ return Qnil;
+ for (i = 0; i < 2; i++)
+ {
+ OTF_GSUB_GPOS *gsub_gpos;
+ Lisp_Object script_list = Qnil;
+ int j;
+
+ if (OTF_get_features (otf, i == 0) < 0)
+ continue;
+ gsub_gpos = i == 0 ? otf->gsub : otf->gpos;
+ for (j = gsub_gpos->ScriptList.ScriptCount - 1; j >= 0; j--)
+ {
+ OTF_Script *script = gsub_gpos->ScriptList.Script + j;
+ Lisp_Object langsys_list = Qnil;
+ Lisp_Object script_tag = otf_tag_symbol (script->ScriptTag);
+ int k;
+
+ for (k = script->LangSysCount; k >= 0; k--)
+ {
+ OTF_LangSys *langsys;
+ Lisp_Object feature_list = Qnil;
+ Lisp_Object langsys_tag;
+ int l;
+
+ if (k == script->LangSysCount)
+ {
+ langsys = &script->DefaultLangSys;
+ langsys_tag = Qnil;
+ }
+ else
+ {
+ langsys = script->LangSys + k;
+ langsys_tag
+ = otf_tag_symbol (script->LangSysRecord[k].LangSysTag);
+ }
+ for (l = langsys->FeatureCount - 1; l >= 0; l--)
+ {
+ OTF_Feature *feature
+ = gsub_gpos->FeatureList.Feature + langsys->FeatureIndex[l];
+ Lisp_Object feature_tag
+ = otf_tag_symbol (feature->FeatureTag);
+
+ feature_list = Fcons (feature_tag, feature_list);
+ }
+ langsys_list = Fcons (Fcons (langsys_tag, feature_list),
+ langsys_list);
+ }
+ script_list = Fcons (Fcons (script_tag, langsys_list),
+ script_list);
+ }
+
+ if (i == 0)
+ XSETCAR (capability, script_list);
+ else
+ XSETCDR (capability, script_list);
+ }
+
+ return capability;
+}
+
+/* Parse OTF features in SPEC and write a proper features spec string
+ in FEATURES for the call of OTF_drive_gsub/gpos (of libotf). It is
+ assured that the sufficient memory has already allocated for
+ FEATURES. */
+
+static void
+generate_otf_features (spec, features)
+ Lisp_Object spec;
+ char *features;
+{
+ Lisp_Object val;
+ char *p, *pend;
+ int asterisk;
+
+ p = features;
+ *p = '\0';
+ for (asterisk = 0; CONSP (spec); spec = XCDR (spec))
+ {
+ val = XCAR (spec);
+ CHECK_SYMBOL (val);
+ if (p > features)
+ *p++ = ',';
+ if (SREF (SYMBOL_NAME (val), 0) == '*')
+ {
+ asterisk = 1;
+ *p++ = '*';
+ }
+ else if (! asterisk)
+ {
+ val = SYMBOL_NAME (val);
+ p += sprintf (p, "%s", SDATA (val));
+ }
+ else
+ {
+ val = SYMBOL_NAME (val);
+ p += sprintf (p, "~%s", SDATA (val));
+ }
+ }
+ if (CONSP (spec))
+ error ("OTF spec too long");
+}
+
+#define DEVICE_DELTA(table, size) \
+ (((size) >= (table).StartSize && (size) <= (table).EndSize) \
+ ? (table).DeltaValue[(size) - (table).StartSize] \
+ : 0)
+
+void
+adjust_anchor (struct font *font, OTF_Anchor *anchor,
+ unsigned code, int size, int *x, int *y)
+{
+ if (anchor->AnchorFormat == 2 && font->driver->anchor_point)
+ {
+ int x0, y0;
+
+ if (font->driver->anchor_point (font, code, anchor->f.f1.AnchorPoint,
+ &x0, &y0) >= 0)
+ *x = x0, *y = y0;
+ }
+ else if (anchor->AnchorFormat == 3)
+ {
+ if (anchor->f.f2.XDeviceTable.offset)
+ *x += DEVICE_DELTA (anchor->f.f2.XDeviceTable, size);
+ if (anchor->f.f2.YDeviceTable.offset)
+ *y += DEVICE_DELTA (anchor->f.f2.YDeviceTable, size);
+ }
+}
+
+Lisp_Object
+font_otf_DeviceTable (device_table)
+ OTF_DeviceTable *device_table;
+{
+ int len = device_table->StartSize - device_table->EndSize + 1;
+
+ return Fcons (make_number (len),
+ make_unibyte_string (device_table->DeltaValue, len));
+}
+
+Lisp_Object
+font_otf_ValueRecord (value_format, value_record)
+ int value_format;
+ OTF_ValueRecord *value_record;
+{
+ Lisp_Object val = Fmake_vector (make_number (8), Qnil);
+
+ if (value_format & OTF_XPlacement)
+ ASET (val, 0, value_record->XPlacement);
+ if (value_format & OTF_YPlacement)
+ ASET (val, 1, value_record->YPlacement);
+ if (value_format & OTF_XAdvance)
+ ASET (val, 2, value_record->XAdvance);
+ if (value_format & OTF_YAdvance)
+ ASET (val, 3, value_record->YAdvance);
+ if (value_format & OTF_XPlaDevice)
+ ASET (val, 4, font_otf_DeviceTable (&value_record->XPlaDevice));
+ if (value_format & OTF_YPlaDevice)
+ ASET (val, 4, font_otf_DeviceTable (&value_record->YPlaDevice));
+ if (value_format & OTF_XAdvDevice)
+ ASET (val, 4, font_otf_DeviceTable (&value_record->XAdvDevice));
+ if (value_format & OTF_YAdvDevice)
+ ASET (val, 4, font_otf_DeviceTable (&value_record->YAdvDevice));
+ return val;
+}
+
+Lisp_Object
+font_otf_Anchor (anchor)
+ OTF_Anchor *anchor;
+{
+ Lisp_Object val;
+
+ val = Fmake_vector (make_number (anchor->AnchorFormat + 1), Qnil);
+ ASET (val, 0, make_number (anchor->XCoordinate));
+ ASET (val, 1, make_number (anchor->YCoordinate));
+ if (anchor->AnchorFormat == 2)
+ ASET (val, 2, make_number (anchor->f.f1.AnchorPoint));
+ else
+ {
+ ASET (val, 3, font_otf_DeviceTable (&anchor->f.f2.XDeviceTable));
+ ASET (val, 4, font_otf_DeviceTable (&anchor->f.f2.YDeviceTable));
+ }
+ return val;
+}
+
+#define REPLACEMENT_CHARACTER 0xFFFD
+
+/* Drive FONT's OpenType FEATURES. See the comment of (sturct
+ font_driver).drive_otf. */
+
+int
+font_drive_otf (font, otf_features, gstring_in, from, to, gstring_out, idx,
+ alternate_subst)
+ struct font *font;
+ Lisp_Object otf_features;
+ Lisp_Object gstring_in;
+ int from, to;
+ Lisp_Object gstring_out;
+ int idx, alternate_subst;
+{
+ Lisp_Object val;
+ int len;
+ int i;
+ OTF *otf;
+ OTF_GlyphString otf_gstring;
+ OTF_Glyph *g;
+ char *script, *langsys = NULL, *gsub_features = NULL, *gpos_features = NULL;
+ int need_cmap;
+
+ val = XCAR (otf_features);
+ script = SDATA (SYMBOL_NAME (val));
+ otf_features = XCDR (otf_features);
+ val = XCAR (otf_features);
+ langsys = NILP (val) ? NULL : SDATA (SYMBOL_NAME (val));
+ otf_features = XCDR (otf_features);
+ val = XCAR (otf_features);
+ if (! NILP (val))
+ {
+ gsub_features = alloca (XINT (Flength (val)) * 6);
+ generate_otf_features (val, &script, &langsys, gsub_features);
+ }
+ otf_features = XCDR (otf_features);
+ val = XCAR (otf_features);
+ if (! NILP (val))
+ {
+ gpos_features = alloca (XINT (Flength (val)) * 6);
+ generate_otf_features (val, &script, &langsys, gpos_features);
+ }
+
+ otf = otf_open (font->entity, font->file_name);
+ if (! otf)
+ return 0;
+ if (OTF_get_table (otf, "head") < 0)
+ return 0;
+ if (OTF_get_table (otf, "cmap") < 0)
+ return 0;
+ if ((! gsub_features || OTF_check_table (otf, "GSUB") < 0)
+ && (! gpos_features || OTF_check_table (otf, "GPOS") < 0))
+ return 0;
+
+ len = to - from;
+ otf_gstring.size = otf_gstring.used = len;
+ otf_gstring.glyphs = (OTF_Glyph *) malloc (sizeof (OTF_Glyph) * len);
+ memset (otf_gstring.glyphs, 0, sizeof (OTF_Glyph) * len);
+ for (i = 0, need_cmap = 0; i < len; i++)
+ {
+ Lisp_Object g = LGSTRING_GLYPH (gstring_in, from + i);
+
+ otf_gstring.glyphs[i].c = XINT (LGLYPH_CHAR (g));
+ if (otf_gstring.glyphs[i].c == REPLACEMENT_CHARACTER)
+ otf_gstring.glyphs[i].c = 0;
+ if (NILP (LGLYPH_CODE (g)))
+ {
+ otf_gstring.glyphs[i].glyph_id = 0;
+ need_cmap = 1;
+ }
+ else
+ otf_gstring.glyphs[i].glyph_id = XINT (LGLYPH_CODE (g));
+ }
+ if (need_cmap)
+ OTF_drive_cmap (otf, &otf_gstring);
+ OTF_drive_gdef (otf, &otf_gstring);
+
+ if (gsub_features)
+ {
+ if ((alternate_subst
+ ? OTF_drive_gsub_alternate (otf, &otf_gstring, script, langsys,
+ gsub_features)
+ : OTF_drive_gsub (otf, &otf_gstring, script, langsys,
+ gsub_features)) < 0)
+ {
+ free (otf_gstring.glyphs);
+ return 0;
+ }
+ if (ASIZE (gstring_out) < idx + otf_gstring.used)
+ {
+ free (otf_gstring.glyphs);
+ return -1;
+ }
+ for (i = 0, g = otf_gstring.glyphs; i < otf_gstring.used;)
+ {
+ int i0 = g->f.index.from, i1 = g->f.index.to;
+ Lisp_Object glyph = LGSTRING_GLYPH (gstring_in, from + i0);
+ Lisp_Object min_idx = AREF (glyph, 0);
+ Lisp_Object max_idx = AREF (glyph, 1);
+
+ if (i0 < i1)
+ {
+ int min_idx_i = XINT (min_idx), max_idx_i = XINT (max_idx);
+
+ for (i0++; i0 <= i1; i0++)
+ {
+ glyph = LGSTRING_GLYPH (gstring_in, from + i0);
+ if (min_idx_i > XINT (AREF (glyph, 0)))
+ min_idx_i = XINT (AREF (glyph, 0));
+ if (max_idx_i < XINT (AREF (glyph, 1)))
+ max_idx_i = XINT (AREF (glyph, 1));
+ }
+ min_idx = make_number (min_idx_i);
+ max_idx = make_number (max_idx_i);
+ i0 = g->f.index.from;
+ }
+ for (; i < otf_gstring.used && g->f.index.from == i0; i++, g++)
+ {
+ glyph = LGSTRING_GLYPH (gstring_out, idx + i);
+ ASET (glyph, 0, min_idx);
+ ASET (glyph, 1, max_idx);
+ if (g->c > 0)
+ LGLYPH_SET_CHAR (glyph, make_number (g->c));
+ else
+ LGLYPH_SET_CHAR (glyph, make_number (REPLACEMENT_CHARACTER));
+ LGLYPH_SET_CODE (glyph, make_number (g->glyph_id));
+ }
+ }
+ }
+
+ if (gpos_features)
+ {
+ Lisp_Object glyph;
+ int u = otf->head->unitsPerEm;
+ int size = font->pixel_size;
+ Lisp_Object base = Qnil, mark = Qnil;
+
+ if (OTF_drive_gpos (otf, &otf_gstring, script, langsys,
+ gpos_features) < 0)
+ {
+ free (otf_gstring.glyphs);
+ return 0;
+ }
+ for (i = 0, g = otf_gstring.glyphs; i < otf_gstring.used; i++, g++)
+ {
+ Lisp_Object prev;
+ int xoff = 0, yoff = 0, width_adjust = 0;
+
+ if (! g->glyph_id)
+ continue;
+
+ switch (g->positioning_type)
+ {
+ case 0:
+ break;
+ case 1: case 2:
+ {
+ int format = g->f.f1.format;
+
+ if (format & OTF_XPlacement)
+ xoff = g->f.f1.value->XPlacement * size / u;
+ if (format & OTF_XPlaDevice)
+ xoff += DEVICE_DELTA (g->f.f1.value->XPlaDevice, size);
+ if (format & OTF_YPlacement)
+ yoff = - (g->f.f1.value->YPlacement * size / u);
+ if (format & OTF_YPlaDevice)
+ yoff -= DEVICE_DELTA (g->f.f1.value->YPlaDevice, size);
+ if (format & OTF_XAdvance)
+ width_adjust += g->f.f1.value->XAdvance * size / u;
+ if (format & OTF_XAdvDevice)
+ width_adjust += DEVICE_DELTA (g->f.f1.value->XAdvDevice, size);
+ }
+ break;
+ case 3:
+ /* Not yet supported. */
+ break;
+ case 4: case 5:
+ if (NILP (base))
+ break;
+ prev = base;
+ goto label_adjust_anchor;
+ default: /* i.e. case 6 */
+ if (NILP (mark))
+ break;
+ prev = mark;
+
+ label_adjust_anchor:
+ {
+ int base_x, base_y, mark_x, mark_y, width;
+ unsigned code;
+
+ base_x = g->f.f4.base_anchor->XCoordinate * size / u;
+ base_y = g->f.f4.base_anchor->YCoordinate * size / u;
+ mark_x = g->f.f4.mark_anchor->XCoordinate * size / u;
+ mark_y = g->f.f4.mark_anchor->YCoordinate * size / u;
+
+ code = XINT (LGLYPH_CODE (prev));
+ if (g->f.f4.base_anchor->AnchorFormat != 1)
+ adjust_anchor (font, g->f.f4.base_anchor,
+ code, size, &base_x, &base_y);
+ if (g->f.f4.mark_anchor->AnchorFormat != 1)
+ adjust_anchor (font, g->f.f4.mark_anchor,
+ code, size, &mark_x, &mark_y);
+
+ if (NILP (LGLYPH_WIDTH (prev)))
+ {
+ width = font->driver->text_extents (font, &code, 1, NULL);
+ LGLYPH_SET_WIDTH (prev, make_number (width));
+ }
+ else
+ width = XINT (LGLYPH_WIDTH (prev));
+ xoff = XINT (LGLYPH_XOFF (prev)) + (base_x - width) - mark_x;
+ yoff = XINT (LGLYPH_YOFF (prev)) + mark_y - base_y;
+ }
+ }
+ if (xoff || yoff || width_adjust)
+ {
+ Lisp_Object adjustment = Fmake_vector (make_number (3), Qnil);
+
+ ASET (adjustment, 0, make_number (xoff));
+ ASET (adjustment, 1, make_number (yoff));
+ ASET (adjustment, 2, make_number (width_adjust));
+ LGLYPH_SET_ADJUSTMENT (glyph, adjustment);
+ }
+ if (g->GlyphClass == OTF_GlyphClass0)
+ base = mark = glyph;
+ else if (g->GlyphClass == OTF_GlyphClassMark)
+ mark = glyph;
+ else
+ base = glyph;
+ }
+ }
+
+ free (otf_gstring.glyphs);
+ return i;
+}
+
+#endif /* HAVE_LIBOTF */
+
+
+/* G-string (glyph string) handler */
+
+/* G-string is a vector of the form [HEADER GLYPH ...].
+ See the docstring of `font-make-gstring' for more detail. */
+
+struct font *
+font_prepare_composition (cmp)
+ struct composition *cmp;
+{
+ Lisp_Object gstring
+ = AREF (XHASH_TABLE (composition_hash_table)->key_and_value,
+ cmp->hash_index * 2);
+ struct font *font = XSAVE_VALUE (LGSTRING_FONT (gstring))->pointer;
+ int len = LGSTRING_LENGTH (gstring);
+ int i;
+
+ cmp->font = font;
+ cmp->lbearing = cmp->rbearing = cmp->pixel_width = 0;
+ cmp->ascent = font->ascent;
+ cmp->descent = font->descent;
+
+ for (i = 0; i < len; i++)
+ {
+ Lisp_Object g = LGSTRING_GLYPH (gstring, i);
+ unsigned code;
+ struct font_metrics metrics;
+
+ if (NILP (LGLYPH_FROM (g)))
+ break;
+ code = XINT (LGLYPH_CODE (g));
+ font->driver->text_extents (font, &code, 1, &metrics);
+ LGLYPH_SET_WIDTH (g, make_number (metrics.width));
+ metrics.lbearing += LGLYPH_XOFF (g);
+ metrics.rbearing += LGLYPH_XOFF (g);
+ metrics.ascent += LGLYPH_YOFF (g);
+ metrics.descent += LGLYPH_YOFF (g);
+
+ if (cmp->lbearing > cmp->pixel_width + metrics.lbearing)
+ cmp->lbearing = cmp->pixel_width + metrics.lbearing;
+ if (cmp->rbearing < cmp->pixel_width + metrics.rbearing)
+ cmp->rbearing = cmp->pixel_width + metrics.rbearing;
+ if (cmp->ascent < metrics.ascent)
+ cmp->ascent = metrics.ascent;
+ if (cmp->descent < metrics.descent)
+ cmp->descent = metrics.descent;
+ cmp->pixel_width += metrics.width + LGLYPH_WADJUST (g);
+ }
+ cmp->glyph_len = i;
+ LGSTRING_SET_LBEARING (gstring, make_number (cmp->lbearing));
+ LGSTRING_SET_RBEARING (gstring, make_number (cmp->rbearing));
+ LGSTRING_SET_WIDTH (gstring, make_number (cmp->pixel_width));
+ LGSTRING_SET_ASCENT (gstring, make_number (cmp->ascent));
+ LGSTRING_SET_DESCENT (gstring, make_number (cmp->descent));
+
+ return font;
+}
+
+int
+font_gstring_produce (old, from, to, new, idx, code, n)
+ Lisp_Object old;
+ int from, to;
+ Lisp_Object new;
+ int idx;
+ unsigned *code;
+ int n;
+{
+ Lisp_Object min_idx, max_idx;
+ int i;
+
+ if (idx + n > ASIZE (new))
+ return -1;
+ if (from == to)
+ {
+ if (from == 0)
+ {
+ min_idx = make_number (0);
+ max_idx = make_number (1);
+ }
+ else
+ {
+ min_idx = AREF (AREF (old, from - 1), 0);
+ max_idx = AREF (AREF (old, from - 1), 1);
+ }
+ }
+ else if (from + 1 == to)
+ {
+ min_idx = AREF (AREF (old, from), 0);
+ max_idx = AREF (AREF (old, from), 1);
+ }
+ else
+ {
+ int min_idx_i = XINT (AREF (AREF (old, from), 0));
+ int max_idx_i = XINT (AREF (AREF (old, from), 1));
+
+ for (i = from + 1; i < to; i++)
+ {
+ if (min_idx_i > XINT (AREF (AREF (old, i), 0)))
+ min_idx_i = XINT (AREF (AREF (old, i), 0));
+ if (max_idx_i < XINT (AREF (AREF (old, i), 1)))
+ max_idx_i = XINT (AREF (AREF (old, i), 1));
+ }
+ min_idx = make_number (min_idx_i);
+ max_idx = make_number (max_idx_i);
+ }
+
+ for (i = 0; i < n; i++)
+ {
+ ASET (AREF (new, idx + i), 0, min_idx);
+ ASET (AREF (new, idx + i), 1, max_idx);
+ ASET (AREF (new, idx + i), 2, make_number (code[i]));
+ }
+
+ return 0;
+}
+
+/* Font sorting */
+
+static unsigned font_score P_ ((Lisp_Object, Lisp_Object *));
+static int font_compare P_ ((const void *, const void *));
+static Lisp_Object font_sort_entites P_ ((Lisp_Object, Lisp_Object,
+ Lisp_Object, Lisp_Object));
+
+/* We sort fonts by scoring each of them against a specified
+ font-spec. The score value is 32 bit (`unsigned'), and the smaller
+ the value is, the closer the font is to the font-spec.
+
+ Each 1-bit in the highest 4 bits of the score is used for atomic
+ properties FOUNDRY, FAMILY, ADSTYLE, and REGISTRY.
+
+ Each 7-bit in the lowest 28 bits are used for numeric properties
+ WEIGHT, SLANT, WIDTH, and SIZE. */
+
+/* How many bits to shift to store the difference value of each font
+ property in a score. */
+static int sort_shift_bits[FONT_SIZE_INDEX + 1];
+
+/* Score font-entity ENTITY against properties of font-spec SPEC_PROP.
+ The return value indicates how different ENTITY is compared with
+ SPEC_PROP. */
+
+static unsigned
+font_score (entity, spec_prop)
+ Lisp_Object entity, *spec_prop;
+{
+ unsigned score = 0;
+ int i;
+ /* Score four atomic fields. Maximum difference is 1. */
+ for (i = FONT_FOUNDRY_INDEX; i <= FONT_REGISTRY_INDEX; i++)
+ if (! NILP (spec_prop[i])
+ && ! EQ (spec_prop[i], AREF (entity, i)))
+ score |= 1 << sort_shift_bits[i];
+
+ /* Score four numeric fields. Maximum difference is 127. */
+ for (i = FONT_WEIGHT_INDEX; i <= FONT_SIZE_INDEX; i++)
+ {
+ Lisp_Object entity_val = AREF (entity, i);
+
+ if (! NILP (spec_prop[i]) && ! EQ (spec_prop[i], entity_val))
+ {
+ if (! INTEGERP (entity_val))
+ score |= 127 << sort_shift_bits[i];
+ else
+ {
+ int diff = XINT (entity_val) - XINT (spec_prop[i]);
+
+ if (diff < 0)
+ diff = - diff;
+ if (i == FONT_SIZE_INDEX)
+ {
+ if (XINT (entity_val) > 0
+ && diff > FONT_PIXEL_SIZE_QUANTUM)
+ score |= min (diff, 127) << sort_shift_bits[i];
+ }
+ else
+ score |= min (diff, 127) << sort_shift_bits[i];
+ }
+ }
+ }
+
+ return score;
+}
+
+
+/* The comparison function for qsort. */
+
+static int
+font_compare (d1, d2)
+ const void *d1, *d2;
+{
+ return (*(unsigned *) d1 < *(unsigned *) d2
+ ? -1 : *(unsigned *) d1 > *(unsigned *) d2);
+}
+
+
+/* The structure for elements being sorted by qsort. */
+struct font_sort_data
+{
+ unsigned score;
+ Lisp_Object entity;
+};
+
+
+/* Sort font-entities in vector VEC by closeness to font-spec PREFER.
+ If PREFER specifies a point-size, calculate the corresponding
+ pixel-size from QCdpi property of PREFER or from the Y-resolution
+ of FRAME before sorting. If SPEC is not nil, it is a font-spec to
+ get the font-entities in VEC. */
+
+static Lisp_Object
+font_sort_entites (vec, prefer, frame, spec)
+ Lisp_Object vec, prefer, frame, spec;
+{
+ Lisp_Object prefer_prop[FONT_SPEC_MAX];
+ int len, i;
+ struct font_sort_data *data;
+ USE_SAFE_ALLOCA;
+
+ len = ASIZE (vec);
+ if (len <= 1)
+ return vec;
+
+ for (i = FONT_FOUNDRY_INDEX; i <= FONT_SIZE_INDEX; i++)
+ prefer_prop[i] = AREF (prefer, i);
+
+ if (! NILP (spec))
+ {
+ /* As it is assured that all fonts in VEC match with SPEC, we
+ should ignore properties specified in SPEC. So, set the
+ corresponding properties in PREFER_PROP to nil. */
+ for (i = FONT_WEIGHT_INDEX; i <= FONT_SIZE_INDEX; i++)
+ if (! NILP (AREF (spec, i)))
+ prefer_prop[i++] = Qnil;
+ }
+
+ if (FLOATP (prefer_prop[FONT_SIZE_INDEX]))
+ prefer_prop[FONT_SIZE_INDEX]
+ = make_number (font_pixel_size (XFRAME (frame), prefer));
+
+ /* Scoring and sorting. */
+ SAFE_ALLOCA (data, struct font_sort_data *, (sizeof *data) * len);
+ for (i = 0; i < len; i++)
+ {
+ data[i].entity = AREF (vec, i);
+ data[i].score = font_score (data[i].entity, prefer_prop);
+ }
+ qsort (data, len, sizeof *data, font_compare);
+ for (i = 0; i < len; i++)
+ ASET (vec, i, data[i].entity);
+ SAFE_FREE ();
+
+ return vec;
+}
+
+
+/* API of Font Service Layer. */
+
+void
+font_update_sort_order (order)
+ int *order;
+{
+ int i, shift_bits = 21;
+
+ for (i = 0; i < 4; i++, shift_bits -= 7)
+ {
+ int xlfd_idx = order[i];
+
+ if (xlfd_idx == XLFD_WEIGHT_INDEX)
+ sort_shift_bits[FONT_WEIGHT_INDEX] = shift_bits;
+ else if (xlfd_idx == XLFD_SLANT_INDEX)
+ sort_shift_bits[FONT_SLANT_INDEX] = shift_bits;
+ else if (xlfd_idx == XLFD_SWIDTH_INDEX)
+ sort_shift_bits[FONT_WIDTH_INDEX] = shift_bits;
+ else
+ sort_shift_bits[FONT_SIZE_INDEX] = shift_bits;
+ }
+}
+
+Lisp_Object
+font_symbolic_weight (font)
+ Lisp_Object font;
+{
+ Lisp_Object weight = AREF (font, FONT_WEIGHT_INDEX);
+
+ if (INTEGERP (weight))
+ weight = prop_numeric_to_name (FONT_WEIGHT_INDEX, XINT (weight));
+ return weight;
+}
+
+Lisp_Object
+font_symbolic_slant (font)
+ Lisp_Object font;
+{
+ Lisp_Object slant = AREF (font, FONT_SLANT_INDEX);
+
+ if (INTEGERP (slant))
+ slant = prop_numeric_to_name (FONT_SLANT_INDEX, XINT (slant));
+ return slant;
+}
+
+Lisp_Object
+font_symbolic_width (font)
+ Lisp_Object font;
+{
+ Lisp_Object width = AREF (font, FONT_WIDTH_INDEX);
+
+ if (INTEGERP (width))
+ width = prop_numeric_to_name (FONT_WIDTH_INDEX, XINT (width));
+ return width;
+}
+
+int
+font_match_p (spec, entity)
+ Lisp_Object spec, entity;
+{
+ int i;
+
+ for (i = FONT_FOUNDRY_INDEX; i < FONT_SIZE_INDEX; i++)
+ if (! NILP (AREF (spec, i))
+ && ! EQ (AREF (spec, i), AREF (entity, i)))
+ return 0;
+ if (INTEGERP (AREF (spec, FONT_SIZE_INDEX))
+ && XINT (AREF (entity, FONT_SIZE_INDEX)) > 0
+ && (XINT (AREF (spec, FONT_SIZE_INDEX))
+ != XINT (AREF (entity, FONT_SIZE_INDEX))))
+ return 0;
+ return 1;
+}
+
+Lisp_Object
+font_find_object (font)
+ struct font *font;
+{
+ Lisp_Object tail, elt;
+
+ for (tail = AREF (font->entity, FONT_OBJLIST_INDEX); CONSP (tail);
+ tail = XCDR (tail))
+ {
+ elt = XCAR (tail);
+ if (font == XSAVE_VALUE (elt)->pointer
+ && XSAVE_VALUE (elt)->integer > 0)
+ return elt;
+ }
+ abort ();
+ return Qnil;
+}
+
+static Lisp_Object scratch_font_spec, scratch_font_prefer;
+
+/* Return a vector of font-entities matching with SPEC on frame F. */
+
+static Lisp_Object
+font_list_entities (frame, spec)
+ Lisp_Object frame, spec;
+{
+ FRAME_PTR f = XFRAME (frame);
+ struct font_driver_list *driver_list = f->font_driver_list;
+ Lisp_Object ftype, family, size, alternate_familes;
+ Lisp_Object *vec = alloca (sizeof (Lisp_Object) * num_font_drivers);
+ int i;
+
+ if (! vec)
+ return null_vector;
+
+ family = AREF (spec, FONT_FAMILY_INDEX);
+ if (NILP (family))
+ alternate_familes = Qnil;
+ else
+ {
+ if (NILP (font_family_alist)
+ && !NILP (Vface_alternative_font_family_alist))
+ build_font_family_alist ();
+ alternate_familes = assq_no_quit (family, font_family_alist);
+ if (! NILP (alternate_familes))
+ alternate_familes = XCDR (alternate_familes);
+ }
+ size = AREF (spec, FONT_SIZE_INDEX);
+ if (FLOATP (size))
+ ASET (spec, FONT_SIZE_INDEX, make_number (font_pixel_size (f, spec)));
+
+ xassert (ASIZE (spec) == FONT_SPEC_MAX);
+ ftype = AREF (spec, FONT_TYPE_INDEX);
+
+ for (i = 0; driver_list; driver_list = driver_list->next)
+ if (driver_list->on
+ && (NILP (ftype) || EQ (driver_list->driver->type, ftype)))
+ {
+ Lisp_Object cache = driver_list->driver->get_cache (frame);
+ Lisp_Object tail = alternate_familes;
+ Lisp_Object val;
+
+ xassert (CONSP (cache));
+ ASET (spec, FONT_TYPE_INDEX, driver_list->driver->type);
+ ASET (spec, FONT_FAMILY_INDEX, family);
+
+ while (1)
+ {
+ val = assoc_no_quit (spec, XCDR (cache));
+ if (CONSP (val))
+ val = XCDR (val);
+ else
+ {
+ val = driver_list->driver->list (frame, spec);
+ if (VECTORP (val))
+ XSETCDR (cache, Fcons (Fcons (Fcopy_sequence (spec), val),
+ XCDR (cache)));
+ }
+ if (VECTORP (val) && ASIZE (val) > 0)
+ {
+ vec[i++] = val;
+ break;
+ }
+ if (NILP (tail))
+ break;
+ ASET (spec, FONT_FAMILY_INDEX, XCAR (tail));
+ tail = XCDR (tail);
+ }
+ }
+ ASET (spec, FONT_TYPE_INDEX, ftype);
+ ASET (spec, FONT_FAMILY_INDEX, family);
+ ASET (spec, FONT_SIZE_INDEX, size);
+ return (i > 0 ? Fvconcat (i, vec) : null_vector);
+}
+
+static Lisp_Object
+font_matching_entity (frame, spec)
+ Lisp_Object frame, spec;
+{
+ FRAME_PTR f = XFRAME (frame);
+ struct font_driver_list *driver_list = f->font_driver_list;
+ Lisp_Object ftype, size, entity;
+
+ ftype = AREF (spec, FONT_TYPE_INDEX);
+ size = AREF (spec, FONT_SIZE_INDEX);
+ if (FLOATP (size))
+ ASET (spec, FONT_SIZE_INDEX, make_number (font_pixel_size (f, spec)));
+ entity = Qnil;
+ for (; driver_list; driver_list = driver_list->next)
+ if (driver_list->on
+ && (NILP (ftype) || EQ (driver_list->driver->type, ftype)))
+ {
+ Lisp_Object cache = driver_list->driver->get_cache (frame);
+ Lisp_Object key;
+
+ xassert (CONSP (cache));
+ ASET (spec, FONT_TYPE_INDEX, driver_list->driver->type);
+ key = Fcons (spec, Qnil);
+ entity = assoc_no_quit (key, XCDR (cache));
+ if (CONSP (entity))
+ entity = XCDR (entity);
+ else
+ {
+ entity = driver_list->driver->match (frame, spec);
+ if (! NILP (entity))
+ {
+ XSETCAR (key, Fcopy_sequence (spec));
+ XSETCDR (cache, Fcons (Fcons (key, entity), XCDR (cache)));
+ }
+ }
+ if (! NILP (entity))
+ break;
+ }
+ ASET (spec, FONT_TYPE_INDEX, ftype);
+ ASET (spec, FONT_SIZE_INDEX, size);
+ return entity;
+}
+
+static int num_fonts;
+
+static Lisp_Object
+font_open_entity (f, entity, pixel_size)
+ FRAME_PTR f;
+ Lisp_Object entity;
+ int pixel_size;
+{
+ struct font_driver_list *driver_list;
+ Lisp_Object objlist, size, val;
+ struct font *font;
+
+ size = AREF (entity, FONT_SIZE_INDEX);
+ xassert (NATNUMP (size));
+ if (XINT (size) != 0)
+ pixel_size = XINT (size);
+
+ for (objlist = AREF (entity, FONT_OBJLIST_INDEX); CONSP (objlist);
+ objlist = XCDR (objlist))
+ {
+ font = XSAVE_VALUE (XCAR (objlist))->pointer;
+ if (font->pixel_size == pixel_size)
+ {
+ XSAVE_VALUE (XCAR (objlist))->integer++;
+ return XCAR (objlist);
+ }
+ }
+
+ xassert (FONT_ENTITY_P (entity));
+ val = AREF (entity, FONT_TYPE_INDEX);
+ for (driver_list = f->font_driver_list;
+ driver_list && ! EQ (driver_list->driver->type, val);
+ driver_list = driver_list->next);
+ if (! driver_list)
+ return Qnil;
+
+ font = driver_list->driver->open (f, entity, pixel_size);
+ if (! font)
+ return Qnil;
+ font->scalable = XINT (size) == 0;
+
+ val = make_save_value (font, 1);
+ ASET (entity, FONT_OBJLIST_INDEX,
+ Fcons (val, AREF (entity, FONT_OBJLIST_INDEX)));
+ num_fonts++;
+ return val;
+}
+
+void
+font_close_object (f, font_object)
+ FRAME_PTR f;
+ Lisp_Object font_object;
+{
+ struct font *font = XSAVE_VALUE (font_object)->pointer;
+ Lisp_Object objlist;
+ Lisp_Object tail, prev = Qnil;
+
+ XSAVE_VALUE (font_object)->integer--;
+ xassert (XSAVE_VALUE (font_object)->integer >= 0);
+ if (XSAVE_VALUE (font_object)->integer > 0)
+ return;
+
+ objlist = AREF (font->entity, FONT_OBJLIST_INDEX);
+ for (prev = Qnil, tail = objlist; CONSP (tail);
+ prev = tail, tail = XCDR (tail))
+ if (EQ (font_object, XCAR (tail)))
+ {
+ if (font->driver->close)
+ font->driver->close (f, font);
+ XSAVE_VALUE (font_object)->pointer = NULL;
+ if (NILP (prev))
+ ASET (font->entity, FONT_OBJLIST_INDEX, XCDR (objlist));
+ else
+ XSETCDR (prev, XCDR (objlist));
+ return;
+ }
+ abort ();
+}
+
+int
+font_has_char (f, font, c)
+ FRAME_PTR f;
+ Lisp_Object font;
+ int c;
+{
+ struct font *fontp;
+
+ if (FONT_ENTITY_P (font))
+ {
+ Lisp_Object type = AREF (font, FONT_TYPE_INDEX);
+ struct font_driver_list *driver_list;
+
+ for (driver_list = f->font_driver_list;
+ driver_list && ! EQ (driver_list->driver->type, type);
+ driver_list = driver_list->next);
+ if (! driver_list)
+ return 0;
+ if (! driver_list->driver->has_char)
+ return -1;
+ return driver_list->driver->has_char (font, c);
+ }
+
+ xassert (FONT_OBJECT_P (font));
+ fontp = XSAVE_VALUE (font)->pointer;
+
+ if (fontp->driver->has_char)
+ {
+ int result = fontp->driver->has_char (fontp->entity, c);
+
+ if (result >= 0)
+ return result;
+ }
+ return (fontp->driver->encode_char (fontp, c) != FONT_INVALID_CODE);
+}
+
+unsigned
+font_encode_char (font_object, c)
+ Lisp_Object font_object;
+ int c;
+{
+ struct font *font = XSAVE_VALUE (font_object)->pointer;
+
+ return font->driver->encode_char (font, c);
+}
+
+Lisp_Object
+font_get_name (font_object)
+ Lisp_Object font_object;
+{
+ struct font *font = XSAVE_VALUE (font_object)->pointer;
+ char *name = (font->font.full_name ? font->font.full_name
+ : font->font.name ? font->font.name
+ : NULL);
+
+ return (name ? make_unibyte_string (name, strlen (name)) : null_string);
+}
+
+Lisp_Object
+font_get_spec (font_object)
+ Lisp_Object font_object;
+{
+ struct font *font = XSAVE_VALUE (font_object)->pointer;
+ Lisp_Object spec = Ffont_spec (0, NULL);
+ int i;
+
+ for (i = 0; i < FONT_SIZE_INDEX; i++)
+ ASET (spec, i, AREF (font->entity, i));
+ ASET (spec, FONT_SIZE_INDEX, make_number (font->pixel_size));
+ return spec;
+}
+
+Lisp_Object
+font_get_frame (font)
+ Lisp_Object font;
+{
+ if (FONT_OBJECT_P (font))
+ font = ((struct font *) XSAVE_VALUE (font)->pointer)->entity;
+ xassert (FONT_ENTITY_P (font));
+ return AREF (font, FONT_FRAME_INDEX);
+}
+
+/* Find a font entity best matching with LFACE. If SPEC is non-nil,
+ the font must exactly match with it. */
+
+Lisp_Object
+font_find_for_lface (f, lface, spec)
+ FRAME_PTR f;
+ Lisp_Object *lface;
+ Lisp_Object spec;
+{
+ Lisp_Object frame, entities;
+ int i;
+
+ XSETFRAME (frame, f);
+
+ if (NILP (spec))
+ {
+ for (i = 0; i < FONT_SPEC_MAX; i++)
+ ASET (scratch_font_spec, i, Qnil);
+ ASET (scratch_font_spec, FONT_REGISTRY_INDEX, Qiso8859_1);
+
+ if (! NILP (lface[LFACE_FAMILY_INDEX]))
+ font_merge_old_spec (Qnil, lface[LFACE_FAMILY_INDEX], Qnil,
+ scratch_font_spec);
+ entities = font_list_entities (frame, scratch_font_spec);
+ while (ASIZE (entities) == 0)
+ {
+ /* Try without FOUNDRY or FAMILY. */
+ if (! NILP (AREF (scratch_font_spec, FONT_FOUNDRY_INDEX)))
+ {
+ ASET (scratch_font_spec, FONT_FOUNDRY_INDEX, Qnil);
+ entities = font_list_entities (frame, scratch_font_spec);
+ }
+ else if (! NILP (AREF (scratch_font_spec, FONT_FAMILY_INDEX)))
+ {
+ ASET (scratch_font_spec, FONT_FAMILY_INDEX, Qnil);
+ entities = font_list_entities (frame, scratch_font_spec);
+ }
+ else
+ break;
+ }
+ }
+ else
+ {
+ for (i = 0; i < FONT_SPEC_MAX; i++)
+ ASET (scratch_font_spec, i, AREF (spec, i));
+ if (NILP (AREF (spec, FONT_REGISTRY_INDEX)))
+ ASET (scratch_font_spec, FONT_REGISTRY_INDEX, Qiso8859_1);
+ entities = font_list_entities (frame, scratch_font_spec);
+ }
+
+ if (ASIZE (entities) == 0)
+ return Qnil;
+ if (ASIZE (entities) > 1)
+ {
+ /* Sort fonts by properties specified in LFACE. */
+ Lisp_Object prefer = scratch_font_prefer;
+ double pt;
+
+ if (! NILP (lface[LFACE_FAMILY_INDEX]))
+ font_merge_old_spec (Qnil, lface[LFACE_FAMILY_INDEX], Qnil, prefer);
+ ASET (prefer, FONT_WEIGHT_INDEX,
+ font_prop_validate_style (FONT_WEIGHT_INDEX, QCweight,
+ lface[LFACE_WEIGHT_INDEX]));
+ ASET (prefer, FONT_SLANT_INDEX,
+ font_prop_validate_style (FONT_SLANT_INDEX, QCslant,
+ lface[LFACE_SLANT_INDEX]));
+ ASET (prefer, FONT_WIDTH_INDEX,
+ font_prop_validate_style (FONT_WIDTH_INDEX, QCwidth,
+ lface[LFACE_SWIDTH_INDEX]));
+ pt = XINT (lface[LFACE_HEIGHT_INDEX]);
+ ASET (prefer, FONT_SIZE_INDEX, make_float (pt / 10));
+
+ font_sort_entites (entities, prefer, frame, spec);
+ }
+
+ return AREF (entities, 0);
+}
+
+Lisp_Object
+font_open_for_lface (f, entity, lface, spec)
+ FRAME_PTR f;
+ Lisp_Object entity;
+ Lisp_Object *lface;
+ Lisp_Object spec;
+{
+ int size;
+
+ if (FONT_SPEC_P (spec) && INTEGERP (AREF (spec, FONT_SIZE_INDEX)))
+ size = XINT (AREF (spec, FONT_SIZE_INDEX));
+ else
+ {
+ double pt = XINT (lface[LFACE_HEIGHT_INDEX]);
+
+ pt /= 10;
+ size = POINT_TO_PIXEL (pt, f->resy);
+ }
+ return font_open_entity (f, entity, size);
+}
+
+void
+font_load_for_face (f, face)
+ FRAME_PTR f;
+ struct face *face;
+{
+ Lisp_Object font_object = face->lface[LFACE_FONT_INDEX];
+
+ if (NILP (font_object))
+ {
+ Lisp_Object entity = font_find_for_lface (f, face->lface, Qnil);
+
+ if (! NILP (entity))
+ font_object = font_open_for_lface (f, entity, face->lface, Qnil);
+ }
+
+ if (! NILP (font_object))
+ {
+ struct font *font = XSAVE_VALUE (font_object)->pointer;
+
+ face->font = font->font.font;
+ face->font_info = (struct font_info *) font;
+ face->font_info_id = 0;
+ face->font_name = font->font.full_name;
+ }
+ else
+ {
+ face->font = NULL;
+ face->font_info = NULL;
+ face->font_info_id = -1;
+ face->font_name = NULL;
+ add_to_log ("Unable to load font for a face%s", null_string, Qnil);
+ }
+}
+
+void
+font_prepare_for_face (f, face)
+ FRAME_PTR f;
+ struct face *face;
+{
+ struct font *font = (struct font *) face->font_info;
+
+ if (font->driver->prepare_face)
+ font->driver->prepare_face (f, face);
+}
+
+void
+font_done_for_face (f, face)
+ FRAME_PTR f;
+ struct face *face;
+{
+ struct font *font = (struct font *) face->font_info;
+
+ if (font->driver->done_face)
+ font->driver->done_face (f, face);
+ face->extra = NULL;
+}
+
+Lisp_Object
+font_open_by_name (f, name)
+ FRAME_PTR f;
+ char *name;
+{
+ Lisp_Object args[2];
+ Lisp_Object spec, prefer, size, entity, entity_list;
+ Lisp_Object frame;
+ int i;
+ int pixel_size;
+
+ XSETFRAME (frame, f);
+
+ args[0] = QCname;
+ args[1] = make_unibyte_string (name, strlen (name));
+ spec = Ffont_spec (2, args);
+ prefer = scratch_font_prefer;
+ for (i = FONT_WEIGHT_INDEX; i < FONT_SIZE_INDEX; i++)
+ if (NILP (AREF (spec, i)))
+ ASET (prefer, i, make_number (100));
+ size = AREF (spec, FONT_SIZE_INDEX);
+ if (NILP (size))
+ pixel_size = 0;
+ else if (INTEGERP (size))
+ pixel_size = XINT (size);
+ else /* FLOATP (size) */
+ {
+ double pt = XFLOAT_DATA (size);
+
+ pixel_size = POINT_TO_PIXEL (pt, f->resy);
+ size = make_number (pixel_size);
+ ASET (spec, FONT_SIZE_INDEX, size);
+ }
+ if (pixel_size == 0)
+ {
+ pixel_size = POINT_TO_PIXEL (12.0, f->resy);
+ size = make_number (pixel_size);
+ }
+ ASET (prefer, FONT_SIZE_INDEX, size);
+ if (NILP (AREF (spec, FONT_REGISTRY_INDEX)))
+ ASET (spec, FONT_REGISTRY_INDEX, Qiso8859_1);
+
+ entity_list = Flist_fonts (spec, frame, make_number (1), prefer);
+ if (NILP (entity_list))
+ entity = font_matching_entity (frame, spec);
+ else
+ entity = XCAR (entity_list);
+ return (NILP (entity)
+ ? Qnil
+ : font_open_entity (f, entity, pixel_size));
+}
+
+
+/* Register font-driver DRIVER. This function is used in two ways.
+
+ The first is with frame F non-NULL. In this case, make DRIVER
+ available (but not yet activated) on F. All frame creaters
+ (e.g. Fx_create_frame) must call this function at least once with
+ an available font-driver.
+
+ The second is with frame F NULL. In this case, DRIVER is globally
+ registered in the variable `font_driver_list'. All font-driver
+ implementations must call this function in its syms_of_XXXX
+ (e.g. syms_of_xfont). */
+
+void
+register_font_driver (driver, f)
+ struct font_driver *driver;
+ FRAME_PTR f;
+{
+ struct font_driver_list *root = f ? f->font_driver_list : font_driver_list;
+ struct font_driver_list *prev, *list;
+
+ if (f && ! driver->draw)
+ error ("Unsable font driver for a frame: %s",
+ SDATA (SYMBOL_NAME (driver->type)));
+
+ for (prev = NULL, list = root; list; prev = list, list = list->next)
+ if (EQ (list->driver->type, driver->type))
+ error ("Duplicated font driver: %s", SDATA (SYMBOL_NAME (driver->type)));
+
+ list = malloc (sizeof (struct font_driver_list));
+ list->on = 0;
+ list->driver = driver;
+ list->next = NULL;
+ if (prev)
+ prev->next = list;
+ else if (f)
+ f->font_driver_list = list;
+ else
+ font_driver_list = list;
+ num_font_drivers++;
+}
+
+/* Free font-driver list on frame F. It doesn't free font-drivers
+ themselves. */
+
+void
+free_font_driver_list (f)
+ FRAME_PTR f;
+{
+ while (f->font_driver_list)
+ {
+ struct font_driver_list *next = f->font_driver_list->next;
+
+ free (f->font_driver_list);
+ f->font_driver_list = next;
+ }
+}
+
+/* Make the frame F use font backends listed in NEW_BACKENDS (list of
+ symbols). If NEW_BACKENDS is nil, make F use all available font
+ drivers. If no backend is available, dont't alter
+ f->font_driver_list.
+
+ A caller must free all realized faces and clear all font caches if
+ any in advance. The return value is a list of font backends
+ actually made used for on F. */
+
+Lisp_Object
+font_update_drivers (f, new_drivers)
+ FRAME_PTR f;
+ Lisp_Object new_drivers;
+{
+ Lisp_Object active_drivers = Qnil;
+ struct font_driver_list *list;
+
+ /* At first check which font backends are available. */
+ for (list = f->font_driver_list; list; list = list->next)
+ if (NILP (new_drivers)
+ || ! NILP (Fmemq (list->driver->type, new_drivers)))
+ {
+ list->on = 2;
+ active_drivers = nconc2 (active_drivers,
+ Fcons (list->driver->type, Qnil));
+ }
+ /* If at least one backend is available, update all list->on. */
+ if (! NILP (active_drivers))
+ for (list = f->font_driver_list; list; list = list->next)
+ list->on = (list->on == 2);
+
+ return active_drivers;
+}
+
+
+Lisp_Object
+font_at (c, pos, face, w, object)
+ int c;
+ EMACS_INT pos;
+ struct face *face;
+ struct window *w;
+ Lisp_Object object;
+{
+ FRAME_PTR f;
+ int face_id;
+ int dummy;
+
+ f = XFRAME (w->frame);
+ if (! FRAME_WINDOW_P (f))
+ return Qnil;
+ if (! face)
+ {
+ if (STRINGP (object))
+ face_id = face_at_string_position (w, object, pos, 0, -1, -1, &dummy,
+ DEFAULT_FACE_ID, 0);
+ else
+ face_id = face_at_buffer_position (w, pos, -1, -1, &dummy,
+ pos + 100, 0);
+ face = FACE_FROM_ID (f, face_id);
+ }
+ face_id = FACE_FOR_CHAR (f, face, c, pos, object);
+ face = FACE_FROM_ID (f, face_id);
+ if (! face->font_info)
+ return Qnil;
+ return font_lispy_object ((struct font *) face->font_info);
+}
+
+
+/* Lisp API */
+
+DEFUN ("fontp", Ffontp, Sfontp, 1, 1, 0,
+ doc: /* Return t if OBJECT is a font-spec or font-entity. */)
+ (object)
+ Lisp_Object object;
+{
+ return (FONTP (object) ? Qt : Qnil);
+}
+
+DEFUN ("font-spec", Ffont_spec, Sfont_spec, 0, MANY, 0,
+ doc: /* Return a newly created font-spec with specified arguments as properties.
+usage: (font-spec &rest properties) */)
+ (nargs, args)
+ int nargs;
+ Lisp_Object *args;
+{
+ Lisp_Object spec = Fmake_vector (make_number (FONT_SPEC_MAX), Qnil);
+ int i;
+
+ for (i = 0; i < nargs; i += 2)
+ {
+ enum font_property_index prop;
+ Lisp_Object key = args[i], val = args[i + 1];
+
+ prop = get_font_prop_index (key, 0);
+ if (prop < FONT_EXTRA_INDEX)
+ ASET (spec, prop, val);
+ else
+ {
+ if (EQ (key, QCname))
+ {
+ CHECK_STRING (val);
+ font_parse_name ((char *) SDATA (val), spec);
+ }
+ font_put_extra (spec, key, val);
+ }
+ }
+ CHECK_VALIDATE_FONT_SPEC (spec);
+ return spec;
+}
+
+
+DEFUN ("font-get", Ffont_get, Sfont_get, 2, 2, 0,
+ doc: /* Return the value of FONT's PROP property.
+FONT is a font-spec, a font-entity, or a font-object. */)
+ (font, prop)
+ Lisp_Object font, prop;
+{
+ enum font_property_index idx;
+
+ if (FONT_OBJECT_P (font))
+ {
+ struct font *fontp = XSAVE_VALUE (font)->pointer;
+
+ if (EQ (prop, QCotf))
+ {
+ if (fontp->driver->otf_capability)
+ return fontp->driver->otf_capability (fontp);
+ else
+ return Qnil;
+ }
+ font = fontp->entity;
+ }
+ else
+ CHECK_FONT (font);
+ idx = get_font_prop_index (prop, 0);
+ if (idx < FONT_EXTRA_INDEX)
+ return AREF (font, idx);
+ if (FONT_ENTITY_P (font))
+ return Qnil;
+ return Fcdr (Fassoc (AREF (font, FONT_EXTRA_INDEX), prop));
+}
+
+
+DEFUN ("font-put", Ffont_put, Sfont_put, 3, 3, 0,
+ doc: /* Set one property of FONT-SPEC: give property PROP value VALUE. */)
+ (font_spec, prop, val)
+ Lisp_Object font_spec, prop, val;
+{
+ enum font_property_index idx;
+ Lisp_Object extra, slot;
+
+ CHECK_FONT_SPEC (font_spec);
+ idx = get_font_prop_index (prop, 0);
+ if (idx < FONT_EXTRA_INDEX)
+ return ASET (font_spec, idx, val);
+ extra = AREF (font_spec, FONT_EXTRA_INDEX);
+ slot = Fassoc (extra, prop);
+ if (NILP (slot))
+ extra = Fcons (Fcons (prop, val), extra);
+ else
+ Fsetcdr (slot, val);
+ return val;
+}
+
+DEFUN ("list-fonts", Flist_fonts, Slist_fonts, 1, 4, 0,
+ doc: /* List available fonts matching FONT-SPEC on the current frame.
+Optional 2nd argument FRAME specifies the target frame.
+Optional 3rd argument NUM, if non-nil, limits the number of returned fonts.
+Optional 4th argument PREFER, if non-nil, is a font-spec
+to which closeness fonts are sorted. */)
+ (font_spec, frame, num, prefer)
+ Lisp_Object font_spec, frame, num, prefer;
+{
+ Lisp_Object vec, list, tail;
+ int n = 0, i, len;
+
+ if (NILP (frame))
+ frame = selected_frame;
+ CHECK_LIVE_FRAME (frame);
+ CHECK_VALIDATE_FONT_SPEC (font_spec);
+ if (! NILP (num))
+ {
+ CHECK_NUMBER (num);
+ n = XINT (num);
+ if (n <= 0)
+ return Qnil;
+ }
+ if (! NILP (prefer))
+ CHECK_FONT (prefer);
+
+ vec = font_list_entities (frame, font_spec);
+ len = ASIZE (vec);
+ if (len == 0)
+ return Qnil;
+ if (len == 1)
+ return Fcons (AREF (vec, 0), Qnil);
+
+ if (! NILP (prefer))
+ vec = font_sort_entites (vec, prefer, frame, font_spec);
+
+ list = tail = Fcons (AREF (vec, 0), Qnil);
+ if (n == 0 || n > len)
+ n = len;
+ for (i = 1; i < n; i++)
+ {
+ Lisp_Object val = Fcons (AREF (vec, i), Qnil);
+
+ XSETCDR (tail, val);
+ tail = val;
+ }
+ return list;
+}
+
+DEFUN ("list-families", Flist_families, Slist_families, 0, 1, 0,
+ doc: /* List available font families on the current frame.
+Optional 2nd argument FRAME specifies the target frame. */)
+ (frame)
+ Lisp_Object frame;
+{
+ FRAME_PTR f;
+ struct font_driver_list *driver_list;
+ Lisp_Object list;
+
+ if (NILP (frame))
+ frame = selected_frame;
+ CHECK_LIVE_FRAME (frame);
+ f = XFRAME (frame);
+ list = Qnil;
+ for (driver_list = f->font_driver_list; driver_list;
+ driver_list = driver_list->next)
+ if (driver_list->driver->list_family)
+ {
+ Lisp_Object val = driver_list->driver->list_family (frame);
+
+ if (NILP (list))
+ list = val;
+ else
+ {
+ Lisp_Object tail = list;
+
+ for (; CONSP (val); val = XCDR (val))
+ if (NILP (Fmemq (XCAR (val), tail)))
+ list = Fcons (XCAR (val), list);
+ }
+ }
+ return list;
+}
+
+DEFUN ("find-font", Ffind_font, Sfind_font, 1, 2, 0,
+ doc: /* Return a font-entity matching with FONT-SPEC on the current frame.
+Optional 2nd argument FRAME, if non-nil, specifies the target frame. */)
+ (font_spec, frame)
+ Lisp_Object font_spec, frame;
+{
+ Lisp_Object val = Flist_fonts (font_spec, frame, make_number (1), Qnil);
+
+ if (CONSP (val))
+ val = XCAR (val);
+ return val;
+}
+
+DEFUN ("font-xlfd-name", Ffont_xlfd_name, Sfont_xlfd_name, 1, 1, 0,
+ doc: /* Return XLFD name of FONT.
+FONT is a font-spec, font-entity, or font-object.
+If the name is too long for XLFD (maximum 255 chars), return nil. */)
+ (font)
+ Lisp_Object font;
+{
+ char name[256];
+ int pixel_size = 0;
+
+ if (FONT_SPEC_P (font))
+ CHECK_VALIDATE_FONT_SPEC (font);
+ else if (FONT_ENTITY_P (font))
+ CHECK_FONT (font);
+ else
+ {
+ struct font *fontp;
+
+ CHECK_FONT_GET_OBJECT (font, fontp);
+ font = fontp->entity;
+ pixel_size = fontp->pixel_size;
+ }
+
+ if (font_unparse_xlfd (font, pixel_size, name, 256) < 0)
+ return Qnil;
+ return build_string (name);
+}
+
+DEFUN ("clear-font-cache", Fclear_font_cache, Sclear_font_cache, 0, 0, 0,
+ doc: /* Clear font cache. */)
+ ()
+{
+ Lisp_Object list, frame;
+
+ FOR_EACH_FRAME (list, frame)
+ {
+ FRAME_PTR f = XFRAME (frame);
+ struct font_driver_list *driver_list = f->font_driver_list;
+
+ for (; driver_list; driver_list = driver_list->next)
+ if (driver_list->on)
+ {
+ Lisp_Object cache = driver_list->driver->get_cache (frame);
+ Lisp_Object tail, elt;
+
+ for (tail = XCDR (cache); CONSP (tail); tail = XCDR (tail))
+ {
+ elt = XCAR (tail);
+ if (CONSP (elt) && FONT_SPEC_P (XCAR (elt)))
+ {
+ Lisp_Object vec = XCDR (elt);
+ int i;
+
+ for (i = 0; i < ASIZE (vec); i++)
+ {
+ Lisp_Object entity = AREF (vec, i);
+
+ if (EQ (driver_list->driver->type,
+ AREF (entity, FONT_TYPE_INDEX)))
+ {
+ Lisp_Object objlist
+ = AREF (entity, FONT_OBJLIST_INDEX);
+
+ for (; CONSP (objlist); objlist = XCDR (objlist))
+ {
+ Lisp_Object val = XCAR (objlist);
+ struct Lisp_Save_Value *p = XSAVE_VALUE (val);
+ struct font *font = p->pointer;
+
+ xassert (font && (driver_list->driver
+ == font->driver));
+ driver_list->driver->close (f, font);
+ p->pointer = NULL;
+ p->integer = 0;
+ }
+ if (driver_list->driver->free_entity)
+ driver_list->driver->free_entity (entity);
+ }
+ }
+ }
+ }
+ XSETCDR (cache, Qnil);
+ }
+ }
+
+ return Qnil;
+}
+
+DEFUN ("internal-set-font-style-table", Finternal_set_font_style_table,
+ Sinternal_set_font_style_table, 2, 2, 0,
+ doc: /* Set font style table for PROP to TABLE.
+PROP must be `:weight', `:slant', or `:width'.
+TABLE must be an alist of symbols vs the corresponding numeric values
+sorted by numeric values. */)
+ (prop, table)
+ Lisp_Object prop, table;
+{
+ int table_index;
+ int numeric;
+ Lisp_Object tail, val;
+
+ CHECK_SYMBOL (prop);
+ table_index = (EQ (prop, QCweight) ? 0
+ : EQ (prop, QCslant) ? 1
+ : EQ (prop, QCwidth) ? 2
+ : 3);
+ if (table_index >= ASIZE (font_style_table))
+ error ("Invalid font style property: %s", SDATA (SYMBOL_NAME (prop)));
+ table = Fcopy_sequence (table);
+ numeric = -1;
+ for (tail = table; ! NILP (tail); tail = Fcdr (tail))
+ {
+ prop = Fcar (Fcar (tail));
+ val = Fcdr (Fcar (tail));
+ CHECK_SYMBOL (prop);
+ CHECK_NATNUM (val);
+ if (numeric > XINT (val))
+ error ("Numeric values not sorted for %s", SDATA (SYMBOL_NAME (prop)));
+ numeric = XINT (val);
+ XSETCAR (tail, Fcons (prop, val));
+ }
+ ASET (font_style_table, table_index, table);
+ return Qnil;
+}
+
+DEFUN ("font-make-gstring", Ffont_make_gstring, Sfont_make_gstring, 2, 2, 0,
+ doc: /* Return a newly created g-string for FONT-OBJECT with NUM glyphs.
+FONT-OBJECT may be nil if it is not yet known.
+
+G-string is sequence of glyphs of a specific font,
+and is a vector of this form:
+ [ HEADER GLYPH ... ]
+HEADER is a vector of this form:
+ [FONT-OBJECT LBEARING RBEARING WIDTH ASCENT DESCENT]
+where
+ FONT-OBJECT is a font-object for all glyphs in the g-string,
+ LBEARING thry DESCENT is the metrics (in pixels) of the whole G-string.
+GLYPH is a vector of this form:
+ [ FROM-IDX TO-IDX C CODE WIDTH [ [X-OFF Y-OFF WADJUST] | nil] ]
+where
+ FROM-IDX and TO-IDX are used internally and should not be touched.
+ C is the character of the glyph.
+ CODE is the glyph-code of C in FONT-OBJECT.
+ X-OFF and Y-OFF are offests to the base position for the glyph.
+ WIDTH is the normal width of the glyph.
+ WADJUST is the adjustment to the normal width of the glyph. */)
+ (font_object, num)
+ Lisp_Object font_object, num;
+{
+ Lisp_Object gstring, g;
+ int len;
+ int i;
+
+ if (! NILP (font_object))
+ CHECK_FONT_OBJECT (font_object);
+ CHECK_NATNUM (num);
+
+ len = XINT (num) + 1;
+ gstring = Fmake_vector (make_number (len), Qnil);
+ g = Fmake_vector (make_number (6), Qnil);
+ ASET (g, 0, font_object);
+ ASET (gstring, 0, g);
+ for (i = 1; i < len; i++)
+ ASET (gstring, i, Fmake_vector (make_number (8), Qnil));
+ return gstring;
+}
+
+DEFUN ("font-fill-gstring", Ffont_fill_gstring, Sfont_fill_gstring, 4, 5, 0,
+ doc: /* Fillin glyph-string GSTRING by characters for FONT-OBJECT.
+START and END specifies the region to extract characters.
+If optional 3rd argument OBJECT is non-nil, it is a buffer or a string from
+where to extract characters.
+FONT-OBJECT may be nil if GSTRING already already contains one. */)
+ (gstring, font_object, start, end, object)
+ Lisp_Object gstring, font_object, start, end, object;
+{
+ int len, i, c;
+ unsigned code;
+ struct font *font;
+
+ CHECK_VECTOR (gstring);
+ if (NILP (font_object))
+ font_object = LGSTRING_FONT (gstring);
+ CHECK_FONT_GET_OBJECT (font_object, font);
+
+ if (STRINGP (object))
+ {
+ const unsigned char *p;
+
+ CHECK_NATNUM (start);
+ CHECK_NATNUM (end);
+ if (XINT (start) > XINT (end)
+ || XINT (end) > ASIZE (object)
+ || XINT (end) - XINT (start) > LGSTRING_LENGTH (gstring))
+ args_out_of_range (start, end);
+
+ len = XINT (end) - XINT (start);
+ p = SDATA (object) + string_char_to_byte (object, XINT (start));
+ for (i = 0; i < len; i++)
+ {
+ Lisp_Object g = LGSTRING_GLYPH (gstring, i);
+
+ c = STRING_CHAR_ADVANCE (p);
+ code = font->driver->encode_char (font, c);
+ if (code > MOST_POSITIVE_FIXNUM)
+ error ("Glyph code 0x%X is too large", code);
+ LGLYPH_SET_FROM (g, make_number (i));
+ LGLYPH_SET_TO (g, make_number (i + 1));
+ LGLYPH_SET_CHAR (g, make_number (c));
+ LGLYPH_SET_CODE (g, make_number (code));
+ }
+ }
+ else
+ {
+ int pos, pos_byte;
+
+ if (! NILP (object))
+ Fset_buffer (object);
+ validate_region (&start, &end);
+ if (XINT (end) - XINT (start) > LGSTRING_LENGTH (gstring))
+ args_out_of_range (start, end);
+ len = XINT (end) - XINT (start);
+ pos = XINT (start);
+ pos_byte = CHAR_TO_BYTE (pos);
+ for (i = 0; i < len; i++)
+ {
+ Lisp_Object g = LGSTRING_GLYPH (gstring, i);
+
+ FETCH_CHAR_ADVANCE (c, pos, pos_byte);
+ code = font->driver->encode_char (font, c);
+ if (code > MOST_POSITIVE_FIXNUM)
+ error ("Glyph code 0x%X is too large", code);
+ LGLYPH_SET_FROM (g, make_number (i));
+ LGLYPH_SET_TO (g, make_number (i + 1));
+ LGLYPH_SET_CHAR (g, make_number (c));
+ LGLYPH_SET_CODE (g, make_number (code));
+ }
+ }
+ for (i = LGSTRING_LENGTH (gstring) - 1; i >= len; i--)
+ {
+ Lisp_Object g = LGSTRING_GLYPH (gstring, i);
+
+ LGLYPH_SET_FROM (g, Qnil);
+ }
+ return Qnil;
+}
+
+DEFUN ("font-drive-otf", Ffont_drive_otf, Sfont_drive_otf, 6, 6, 0,
+ doc: /* Apply OpenType features on glyph-string GSTRING-IN.
+OTF-SPEC specifies which featuress to apply in this format:
+ (SCRIPT LANGSYS GSUB GPOS)
+where
+ SCRIPT is a symbol specifying a script tag of OpenType,
+ LANGSYS is a symbol specifying a langsys tag of OpenType,
+ GSUB and GPOS, if non-nil, are lists of symbols specifying feature tags.
+
+If LANGYS is nil, the default langsys is selected.
+
+The features are applied in the order appeared in the list. The
+symbol `*' means to apply all available features not appeared in this
+list, and the remaining features are ignored. For instance, (vatu
+pstf * haln) is to apply vatu and pstf in this order, then to apply
+all available features other than vatu, pstf, and haln.
+
+The features are applied to the glyphs in the range FROM and TO of
+the glyph-string GSTRING-IN.
+
+If some of a feature is actually applicable, the resulting glyphs are
+produced in the glyph-string GSTRING-OUT from the index INDEX. In
+this case, the value is the number of produced glyphs.
+
+If no feature is applicable, no glyph is produced in GSTRING-OUT, and
+the value is 0.
+
+If GSTRING-OUT is too short to hold produced glyphs, no glyphs is
+produced in GSTRING-OUT, and the value is nil.
+
+See the documentation of `font-make-gstring' for the format of
+glyph-string. */)
+ (otf_features, gstring_in, from, to, gstring_out, index)
+ Lisp_Object otf_features, gstring_in, from, to, gstring_out, index;
+{
+ Lisp_Object font_object = LGSTRING_FONT (gstring_in);
+ Lisp_Object val;
+ struct font *font;
+ int len, num;
+
+ check_otf_features (otf_features);
+ CHECK_FONT_GET_OBJECT (font_object, font);
+ if (! font->driver->otf_drive)
+ error ("Font backend %s can't drive OpenType GSUB table",
+ SDATA (SYMBOL_NAME (font->driver->type)));
+ CHECK_CONS (otf_features);
+ CHECK_SYMBOL (XCAR (otf_features));
+ val = XCDR (otf_features);
+ CHECK_SYMBOL (XCAR (val));
+ val = XCDR (otf_features);
+ if (! NILP (val))
+ CHECK_CONS (val);
+ len = check_gstring (gstring_in);
+ CHECK_VECTOR (gstring_out);
+ CHECK_NATNUM (from);
+ CHECK_NATNUM (to);
+ CHECK_NATNUM (index);
+
+ if (XINT (from) >= XINT (to) || XINT (to) > len)
+ args_out_of_range_3 (from, to, make_number (len));
+ if (XINT (index) >= ASIZE (gstring_out))
+ args_out_of_range (index, make_number (ASIZE (gstring_out)));
+ num = font->driver->otf_drive (font, otf_features,
+ gstring_in, XINT (from), XINT (to),
+ gstring_out, XINT (index), 0);
+ if (num < 0)
+ return Qnil;
+ return make_number (num);
+}
+
+DEFUN ("font-otf-alternates", Ffont_otf_alternates, Sfont_otf_alternates,
+ 3, 3, 0,
+ doc: /* Return a list of alternate glyphs of CHARACTER in FONT-OBJECT.
+FEATURE-SPEC specifies which features of the font FONT-OBJECT to apply
+in this format:
+ (SCRIPT LANGSYS FEATURE ...)
+See the documentation of `font-otf-gsub' for more detail.
+
+The value is a list of cons cells of the format (GLYPH-ID . CHARACTER),
+where GLYPH-ID is a glyph index of the font, and CHARACTER is a
+character code corresponding to the glyph or nil if there's no
+corresponding character. */)
+ (font_object, character, otf_features)
+ Lisp_Object font_object, character, otf_features;
+{
+ struct font *font;
+ Lisp_Object gstring_in, gstring_out, g;
+ Lisp_Object alternates;
+ int i, num;
+
+ CHECK_FONT_GET_OBJECT (font_object, font);
+ if (! font->driver->otf_drive)
+ error ("Font backend %s can't drive OpenType GSUB table",
+ SDATA (SYMBOL_NAME (font->driver->type)));
+ CHECK_CHARACTER (character);
+ CHECK_CONS (otf_features);
+
+ gstring_in = Ffont_make_gstring (font_object, make_number (1));
+ g = LGSTRING_GLYPH (gstring_in, 0);
+ LGLYPH_SET_CHAR (g, character);
+ gstring_out = Ffont_make_gstring (font_object, make_number (10));
+ while ((num = font->driver->otf_drive (font, otf_features, gstring_in, 0, 1,
+ gstring_out, 0, 1)) < 0)
+ gstring_out = Ffont_make_gstring (font_object,
+ make_number (ASIZE (gstring_out) * 2));
+ alternates = Qnil;
+ for (i = 0; i < num; i++)
+ {
+ Lisp_Object g = LGSTRING_GLYPH (gstring_out, i);
+ int c = XINT (LGLYPH_CHAR (g));
+ unsigned code = XUINT (LGLYPH_CODE (g));
+
+ alternates = Fcons (Fcons (make_number (code),
+ c > 0 ? make_number (c) : Qnil),
+ alternates);
+ }
+ return Fnreverse (alternates);
+}
+
+
+#ifdef FONT_DEBUG
+
+DEFUN ("open-font", Fopen_font, Sopen_font, 1, 3, 0,
+ doc: /* Open FONT-ENTITY. */)
+ (font_entity, size, frame)
+ Lisp_Object font_entity;
+ Lisp_Object size;
+ Lisp_Object frame;
+{
+ int isize;
+
+ CHECK_FONT_ENTITY (font_entity);
+ if (NILP (size))
+ size = AREF (font_entity, FONT_SIZE_INDEX);
+ CHECK_NUMBER (size);
+ if (NILP (frame))
+ frame = selected_frame;
+ CHECK_LIVE_FRAME (frame);
+
+ isize = XINT (size);
+ if (isize < 0)
+ isize = POINT_TO_PIXEL (- isize, XFRAME (frame)->resy);
+
+ return font_open_entity (XFRAME (frame), font_entity, isize);
+}
+
+DEFUN ("close-font", Fclose_font, Sclose_font, 1, 2, 0,
+ doc: /* Close FONT-OBJECT. */)
+ (font_object, frame)
+ Lisp_Object font_object, frame;
+{
+ CHECK_FONT_OBJECT (font_object);
+ if (NILP (frame))
+ frame = selected_frame;
+ CHECK_LIVE_FRAME (frame);
+ font_close_object (XFRAME (frame), font_object);
+ return Qnil;
+}
+
+DEFUN ("query-font", Fquery_font, Squery_font, 1, 1, 0,
+ doc: /* Return information about FONT-OBJECT.
+The value is a vector:
+ [ NAME FILENAME PIXEL-SIZE SIZE ASCENT DESCENT SPACE-WIDTH AVERAGE-WIDTH
+ CAPABILITY ]
+
+NAME is a string of the font name (or nil if the font backend doesn't
+provide a name).
+
+FILENAME is a string of the font file (or nil if the font backend
+doesn't provide a file name).
+
+PIXEL-SIZE is a pixel size by which the font is opened.
+
+SIZE is a maximum advance width of the font in pixel.
+
+ASCENT, DESCENT, SPACE-WIDTH, AVERAGE-WIDTH are metrics of the font in
+pixel.
+
+CAPABILITY is a list whose first element is a symbol representing the
+font format \(x, opentype, truetype, type1, pcf, or bdf) and the
+remaining elements describes a detail of the font capability.
+
+If the font is OpenType font, the form of the list is
+ \(opentype GSUB GPOS)
+where GSUB shows which "GSUB" features the font supports, and GPOS
+shows which "GPOS" features the font supports. Both GSUB and GPOS are
+lists of the format:
+ \((SCRIPT (LANGSYS FEATURE ...) ...) ...)
+
+If the font is not OpenType font, currently the length of the form is
+one.
+
+SCRIPT is a symbol representing OpenType script tag.
+
+LANGSYS is a symbol representing OpenType langsys tag, or nil
+representing the default langsys.
+
+FEATURE is a symbol representing OpenType feature tag.
+
+If the font is not OpenType font, OTF-CAPABILITY is nil. */)
+ (font_object)
+ Lisp_Object font_object;
+{
+ struct font *font;
+ Lisp_Object val;
+
+ CHECK_FONT_GET_OBJECT (font_object, font);
+
+ val = Fmake_vector (make_number (9), Qnil);
+ if (font->font.full_name)
+ ASET (val, 0, make_unibyte_string (font->font.full_name,
+ strlen (font->font.full_name)));
+ if (font->file_name)
+ ASET (val, 1, make_unibyte_string (font->file_name,
+ strlen (font->file_name)));
+ ASET (val, 2, make_number (font->pixel_size));
+ ASET (val, 3, make_number (font->font.size));
+ ASET (val, 4, make_number (font->ascent));
+ ASET (val, 5, make_number (font->descent));
+ ASET (val, 6, make_number (font->font.space_width));
+ ASET (val, 7, make_number (font->font.average_width));
+ if (font->driver->otf_capability)
+ ASET (val, 8, Fcons (Qopentype, font->driver->otf_capability (font)));
+ else
+ ASET (val, 8, Fcons (font->format, Qnil));
+ return val;
+}
+
+DEFUN ("get-font-glyphs", Fget_font_glyphs, Sget_font_glyphs, 2, 2, 0,
+ doc: /* Return a vector of glyphs of FONT-OBJECT for drawing STRING.
+Each element is a vector [GLYPH-CODE LBEARING RBEARING WIDTH ASCENT DESCENT]. */)
+ (font_object, string)
+ Lisp_Object font_object, string;
+{
+ struct font *font;
+ int i, len;
+ Lisp_Object vec;
+
+ CHECK_FONT_GET_OBJECT (font_object, font);
+ CHECK_STRING (string);
+ len = SCHARS (string);
+ vec = Fmake_vector (make_number (len), Qnil);
+ for (i = 0; i < len; i++)
+ {
+ Lisp_Object ch = Faref (string, make_number (i));
+ Lisp_Object val;
+ int c = XINT (ch);
+ unsigned code;
+ struct font_metrics metrics;
+
+ code = font->driver->encode_char (font, c);
+ if (code == FONT_INVALID_CODE)
+ continue;
+ val = Fmake_vector (make_number (6), Qnil);
+ if (code <= MOST_POSITIVE_FIXNUM)
+ ASET (val, 0, make_number (code));
+ else
+ ASET (val, 0, Fcons (make_number (code >> 16),
+ make_number (code & 0xFFFF)));
+ font->driver->text_extents (font, &code, 1, &metrics);
+ ASET (val, 1, make_number (metrics.lbearing));
+ ASET (val, 2, make_number (metrics.rbearing));
+ ASET (val, 3, make_number (metrics.width));
+ ASET (val, 4, make_number (metrics.ascent));
+ ASET (val, 5, make_number (metrics.descent));
+ ASET (vec, i, val);
+ }
+ return vec;
+}
+
+DEFUN ("font-match-p", Ffont_match_p, Sfont_match_p, 2, 2, 0,
+ doc: /* Return t iff font-spec SPEC matches with FONT.
+FONT is a font-spec, font-entity, or font-object. */)
+ (spec, font)
+ Lisp_Object spec, font;
+{
+ CHECK_FONT_SPEC (spec);
+ if (FONT_OBJECT_P (font))
+ font = ((struct font *) XSAVE_VALUE (font)->pointer)->entity;
+ else if (! FONT_ENTITY_P (font))
+ CHECK_FONT_SPEC (font);
+
+ return (font_match_p (spec, font) ? Qt : Qnil);
+}
+
+DEFUN ("font-at", Ffont_at, Sfont_at, 1, 2, 0,
+ doc: /* Return a font-object for displaying a character at POSISTION.
+Optional second arg WINDOW, if non-nil, is a window displaying
+the current buffer. It defaults to the currently selected window. */)
+ (position, window)
+ Lisp_Object position, window;
+{
+ struct window *w;
+ EMACS_INT pos, pos_byte;
+ int c;
+
+ CHECK_NUMBER_COERCE_MARKER (position);
+ pos = XINT (position);
+ if (pos < BEGV || pos >= ZV)
+ args_out_of_range_3 (position, make_number (BEGV), make_number (ZV));
+ pos_byte = CHAR_TO_BYTE (pos);
+ c = FETCH_CHAR (pos_byte);
+ if (NILP (window))
+ window = selected_window;
+ CHECK_LIVE_WINDOW (window);
+ w = XWINDOW (selected_window);
+
+ return font_at (c, pos, NULL, w, Qnil);
+}
+
+#if 0
+DEFUN ("draw-string", Fdraw_string, Sdraw_string, 2, 2, 0,
+ doc: /* Draw STRING by FONT-OBJECT on the top left corner of the current frame.
+The value is a number of glyphs drawn.
+Type C-l to recover what previously shown. */)
+ (font_object, string)
+ Lisp_Object font_object, string;
+{
+ Lisp_Object frame = selected_frame;
+ FRAME_PTR f = XFRAME (frame);
+ struct font *font;
+ struct face *face;
+ int i, len, width;
+ unsigned *code;
+
+ CHECK_FONT_GET_OBJECT (font_object, font);
+ CHECK_STRING (string);
+ len = SCHARS (string);
+ code = alloca (sizeof (unsigned) * len);
+ for (i = 0; i < len; i++)
+ {
+ Lisp_Object ch = Faref (string, make_number (i));
+ Lisp_Object val;
+ int c = XINT (ch);
+
+ code[i] = font->driver->encode_char (font, c);
+ if (code[i] == FONT_INVALID_CODE)
+ break;
+ }
+ face = FACE_FROM_ID (f, DEFAULT_FACE_ID);
+ face->fontp = font;
+ if (font->driver->prepare_face)
+ font->driver->prepare_face (f, face);
+ width = font->driver->text_extents (font, code, i, NULL);
+ len = font->driver->draw_text (f, face, 0, font->ascent, code, i, width);
+ if (font->driver->done_face)
+ font->driver->done_face (f, face);
+ face->fontp = NULL;
+ return make_number (len);
+}
+#endif
+
+#endif /* FONT_DEBUG */
+
+
+extern void syms_of_ftfont P_ (());
+extern void syms_of_xfont P_ (());
+extern void syms_of_xftfont P_ (());
+extern void syms_of_ftxfont P_ (());
+extern void syms_of_bdffont P_ (());
+extern void syms_of_w32font P_ (());
+extern void syms_of_atmfont P_ (());
+
+void
+syms_of_font ()
+{
+ sort_shift_bits[FONT_SLANT_INDEX] = 0;
+ sort_shift_bits[FONT_WEIGHT_INDEX] = 7;
+ sort_shift_bits[FONT_SIZE_INDEX] = 14;
+ sort_shift_bits[FONT_WIDTH_INDEX] = 21;
+ sort_shift_bits[FONT_ADSTYLE_INDEX] = 28;
+ sort_shift_bits[FONT_FOUNDRY_INDEX] = 29;
+ sort_shift_bits[FONT_FAMILY_INDEX] = 30;
+ sort_shift_bits[FONT_REGISTRY_INDEX] = 31;
+ /* Note that sort_shift_bits[FONT_TYPE_INDEX] is never used. */
+
+ staticpro (&font_style_table);
+ font_style_table = Fmake_vector (make_number (3), Qnil);
+
+ staticpro (&font_family_alist);
+ font_family_alist = Qnil;
+
+ DEFSYM (Qfontp, "fontp");
+ DEFSYM (Qopentype, "opentype");
+
+ DEFSYM (Qiso8859_1, "iso8859-1");
+ DEFSYM (Qiso10646_1, "iso10646-1");
+ DEFSYM (Qunicode_bmp, "unicode-bmp");
+ DEFSYM (Qunicode_sip, "unicode-sip");
+
+ DEFSYM (QCotf, ":otf");
+ DEFSYM (QClanguage, ":language");
+ DEFSYM (QCscript, ":script");
+
+ DEFSYM (QCfoundry, ":foundry");
+ DEFSYM (QCadstyle, ":adstyle");
+ DEFSYM (QCregistry, ":registry");
+ DEFSYM (QCspacing, ":spacing");
+ DEFSYM (QCdpi, ":dpi");
+ DEFSYM (QCscalable, ":scalable");
+ DEFSYM (QCextra, ":extra");
+
+ DEFSYM (Qc, "c");
+ DEFSYM (Qm, "m");
+ DEFSYM (Qp, "p");
+ DEFSYM (Qd, "d");
+
+ staticpro (&null_string);
+ null_string = build_string ("");
+ staticpro (&null_vector);
+ null_vector = Fmake_vector (make_number (0), Qnil);
+
+ staticpro (&scratch_font_spec);
+ scratch_font_spec = Ffont_spec (0, NULL);
+ staticpro (&scratch_font_prefer);
+ scratch_font_prefer = Ffont_spec (0, NULL);
+
+#ifdef HAVE_LIBOTF
+ staticpro (&otf_list);
+ otf_list = Qnil;
+#endif
+
+ defsubr (&Sfontp);
+ defsubr (&Sfont_spec);
+ defsubr (&Sfont_get);
+ defsubr (&Sfont_put);
+ defsubr (&Slist_fonts);
+ defsubr (&Slist_families);
+ defsubr (&Sfind_font);
+ defsubr (&Sfont_xlfd_name);
+ defsubr (&Sclear_font_cache);
+ defsubr (&Sinternal_set_font_style_table);
+ defsubr (&Sfont_make_gstring);
+ defsubr (&Sfont_fill_gstring);
+ defsubr (&Sfont_drive_otf);
+ defsubr (&Sfont_otf_alternates);
+
+#ifdef FONT_DEBUG
+ defsubr (&Sopen_font);
+ defsubr (&Sclose_font);
+ defsubr (&Squery_font);
+ defsubr (&Sget_font_glyphs);
+ defsubr (&Sfont_match_p);
+ defsubr (&Sfont_at);
+#if 0
+ defsubr (&Sdraw_string);
+#endif
+#endif /* FONT_DEBUG */
+
+#ifdef HAVE_FREETYPE
+ syms_of_ftfont ();
+#ifdef HAVE_X_WINDOWS
+ syms_of_xfont ();
+ syms_of_ftxfont ();
+#ifdef HAVE_XFT
+ syms_of_xftfont ();
+#endif /* HAVE_XFT */
+#endif /* HAVE_X_WINDOWS */
+#else /* not HAVE_FREETYPE */
+#ifdef HAVE_X_WINDOWS
+ syms_of_xfont ();
+#endif /* HAVE_X_WINDOWS */
+#endif /* not HAVE_FREETYPE */
+#ifdef HAVE_BDFFONT
+ syms_of_bdffont ();
+#endif /* HAVE_BDFFONT */
+#ifdef WINDOWSNT
+ syms_of_w32font ();
+#endif /* WINDOWSNT */
+#ifdef MAC_OS
+ syms_of_atmfont ();
+#endif /* MAC_OS */
+}
+
+/* arch-tag: 74c9475d-5976-4c93-a327-942ae3072846
+ (do not change this comment) */
diff --git a/src/font.h b/src/font.h
new file mode 100644
index 0000000000..bc15dc779f
--- /dev/null
+++ b/src/font.h
@@ -0,0 +1,509 @@
+/* font.h -- Interface definition for font handling.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006
+ National Institute of Advanced Industrial Science and Technology (AIST)
+ Registration Number H13PRO009
+
+This file is part of GNU Emacs.
+
+GNU Emacs is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Emacs is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Emacs; see the file COPYING. If not, write to
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+#ifndef EMACS_FONT_H
+#define EMACS_FONT_H
+
+#include "ccl.h"
+
+/* We have three types of Lisp objects related to font.
+
+ FONT-SPEC
+
+ Vector (length FONT_SPEC_MAX) of font properties. Some
+ properties can be left unspecified (i.e. nil). Emacs asks
+ font-drivers to find a font by FONT-SPEC. A fontset entry
+ specifies requisite properties whereas a face specifies just
+ preferable properties. This object is fully modifiable by
+ Lisp.
+
+ FONT-ENTITY
+
+ Vector (length FONT_ENTITY_MAX) of fully specified font
+ properties that a font-driver returns upon a request of
+ FONT-SPEC.
+
+ Note: Only the method `list' of a font-driver can create this
+ object, and should never be modified by Lisp. In that sense,
+ it may be cleaner to implement it as a Lisp object of a new
+ type (e.g. struct Lisp_Font).
+
+ FONT-OBJECT
+
+ Lisp object of type Lisp_Misc_Save_Value encapsulating a
+ pointer to "struct font". This corresponds to an opened font.
+
+ Note: The note for FONT-ENTITY also applies to this.
+*/
+
+
+struct font_driver;
+struct font;
+
+/* An enumerator for each font property. This is used as an index to
+ the vector of FONT-SPEC and FONT-ENTITY.
+
+ Note: The order is important and should not be changed. */
+
+enum font_property_index
+ {
+ /* FONT-TYPE is a symbol indicating a font backend; currently `x',
+ `xft', `ftx', `freetype' are available. For windows, we need
+ `bdf' and `windows'. For Mac OS X, we need `atm'. */
+ FONT_TYPE_INDEX,
+
+ /* FONT-FOUNDRY is a foundry name (symbol). */
+ FONT_FOUNDRY_INDEX,
+
+ /* FONT-FAMILY is a family name (symbol). */
+ FONT_FAMILY_INDEX,
+
+ /* FONT-ADSTYLE is an additional style name (symbol). */
+ FONT_ADSTYLE_INDEX,
+
+ /* FONT-REGISTRY is a combination of a charset-registry and
+ charset0encoding name (symbol). */
+ FONT_REGISTRY_INDEX,
+
+ /* FONT-WEIGHT is a numeric value of weight (e.g. medium, bold) of
+ the font. The value is what defined by FC_WEIGHT_* in
+ fontconfig. */
+ FONT_WEIGHT_INDEX,
+
+ /* FONT-SLANT is a numeric value of slant (e.g. r, i, o) of the
+ font. The value is what defined by FC_SLANT_* in
+ fontconfig plus 100. */
+ FONT_SLANT_INDEX,
+
+ /* FONT-WIDTH is a numeric value of setwidth (e.g. normal,
+ condensed) of the font. The value is what defined by
+ FC_WIDTH_* in fontconfig. */
+ FONT_WIDTH_INDEX,
+
+ /* FONT-SIZE is a size of the font. If integer, it is a pixel
+ size. For a font-spec, the value can be float specifying a
+ point size. For a font-entity, the value can be zero meaning
+ that the font is scalable. */
+ FONT_SIZE_INDEX,
+
+ /* In a font-spec, the value is an alist of extra information of a
+ font such as name, OpenType features, and language coverage.
+ In a font-entity, the value is an extra infomation for
+ identifying a font (font-driver dependent). */
+ FONT_EXTRA_INDEX, /* alist alist */
+
+ /* This value is the length of font-spec vector. */
+ FONT_SPEC_MAX,
+
+ /* The followings are used only for a font-entity. */
+
+ /* Frame on which the font is found. The value is nil if the font
+ can be opend on any frame. */
+ FONT_FRAME_INDEX = FONT_SPEC_MAX,
+
+ /* List of font-objects opened from the font-entity. */
+ FONT_OBJLIST_INDEX,
+
+ /* This value is the length of font-entity vector. */
+ FONT_ENTITY_MAX
+ };
+
+extern Lisp_Object QCspacing, QCdpi, QCscalable, QCotf, QClanguage, QCscript;
+
+/* Important character set symbols. */
+extern Lisp_Object Qiso8859_1, Qiso10646_1, Qunicode_bmp, Qunicode_sip;
+
+extern Lisp_Object null_string;
+extern Lisp_Object null_vector;
+
+/* Structure for an opened font. We can safely cast this structure to
+ "struct font_info". */
+
+struct font
+{
+ struct font_info font;
+
+ /* From which font-entity the font is opened. */
+ Lisp_Object entity;
+
+ /* By which pixel size the font is opened. */
+ int pixel_size;
+
+ /* Font-driver for the font. */
+ struct font_driver *driver;
+
+ /* Symbol of font font; x, ttf, pcf, etc, */
+ Lisp_Object format;
+
+ /* File name of the font, or NULL if the font is not associated with
+ a file. */
+ char *file_name;
+
+ /* Charset to encode a character code into a glyph code of the font.
+ -1 means that the font doesn't require this information to encode
+ a character. */
+ int encoding_charset;
+
+ /* Charset to check if a character code is supported by the font.
+ -1 means that the contents of the font must be looked up to
+ determine it. */
+ int repertory_charset;
+
+ /* Minimum glyph width (in pixels). */
+ int min_width;
+
+ /* Ascent and descent of the font (in pixels). */
+ int ascent, descent;
+
+ /* 1 iff the font is scalable. */
+ int scalable;
+
+ /* There will be more to this structure, but they are private to a
+ font-driver. */
+};
+
+enum font_spacing
+ {
+ FONT_SPACING_PROPORTIONAL = 0,
+ FONT_SPACING_DUAL = 90,
+ FONT_SPACING_MONO = 100,
+ FONT_SPACING_CHARCELL = 110
+ };
+
+struct font_metrics
+{
+ short lbearing, rbearing, width, ascent, descent;
+};
+
+struct font_bitmap
+{
+ int rows;
+ int width;
+ int pitch;
+ unsigned char *buffer;
+ int left;
+ int top;
+ int advance;
+ void *extra;
+};
+
+/* Predicates to check various font-related objects. */
+
+#define FONTP(x) \
+ (VECTORP (x) && (ASIZE (x) == FONT_SPEC_MAX || ASIZE (x) == FONT_ENTITY_MAX))
+#define FONT_SPEC_P(x) \
+ (VECTORP (x) && ASIZE (x) == FONT_SPEC_MAX)
+#define FONT_ENTITY_P(x) \
+ (VECTORP (x) && ASIZE (x) == FONT_ENTITY_MAX)
+#define FONT_OBJECT_P(x) \
+ (XTYPE (x) == Lisp_Misc && XMISCTYPE (x) == Lisp_Misc_Save_Value)
+
+
+/* Check macros for various font-related objects. */
+
+#define CHECK_FONT(x) \
+ do { if (! FONTP (x)) x = wrong_type_argument (Qfont, x); } while (0)
+#define CHECK_FONT_SPEC(x) \
+ do { if (! FONT_SPEC_P (x)) x = wrong_type_argument (Qfont, x); } while (0)
+#define CHECK_FONT_ENTITY(x) \
+ do { if (! FONT_ENTITY_P (x)) x = wrong_type_argument (Qfont, x); } while (0)
+#define CHECK_FONT_OBJECT(x) \
+ do { if (! FONT_OBJECT_P (x)) x = wrong_type_argument (Qfont, x); } while (0)
+
+#define CHECK_FONT_GET_OBJECT(x, font) \
+ do { \
+ if (! FONT_OBJECT_P (x)) x = wrong_type_argument (Qfont, x); \
+ if (! XSAVE_VALUE (x)->pointer) error ("Font already closed"); \
+ font = XSAVE_VALUE (x)->pointer; \
+ } while (0)
+
+/* Ignore the difference of font pixel sizes less than or equal to
+ this value. */
+#define FONT_PIXEL_SIZE_QUANTUM 1
+
+struct face;
+struct composition;
+
+/* Macros for lispy glyph-string. */
+#define LGSTRING_FONT(lgs) AREF (AREF ((lgs), 0), 0)
+#define LGSTRING_LBEARING(lgs) AREF (AREF ((lgs), 0), 1)
+#define LGSTRING_RBEARING(lgs) AREF (AREF ((lgs), 0), 2)
+#define LGSTRING_WIDTH(lgs) AREF (AREF ((lgs), 0), 3)
+#define LGSTRING_ASCENT(lgs) AREF (AREF ((lgs), 0), 4)
+#define LGSTRING_DESCENT(lgs) AREF (AREF ((lgs), 0), 5)
+#define LGSTRING_SET_FONT(lgs, val) ASET (AREF ((lgs), 0), 0, (val))
+#define LGSTRING_SET_LBEARING(lgs, val) ASET (AREF ((lgs), 0), 1, (val))
+#define LGSTRING_SET_RBEARING(lgs, val) ASET (AREF ((lgs), 0), 2, (val))
+#define LGSTRING_SET_WIDTH(lgs, val) ASET (AREF ((lgs), 0), 3, (val))
+#define LGSTRING_SET_ASCENT(lgs, val) ASET (AREF ((lgs), 0), 4, (val))
+#define LGSTRING_SET_DESCENT(lgs, val) ASET (AREF ((lgs), 0), 5, (val))
+
+#define LGSTRING_LENGTH(lgs) (ASIZE ((lgs)) - 1)
+#define LGSTRING_GLYPH(lgs, idx) AREF ((lgs), (idx) + 1)
+
+#define LGLYPH_FROM(g) AREF ((g), 0)
+#define LGLYPH_TO(g) AREF ((g), 1)
+#define LGLYPH_CHAR(g) AREF ((g), 2)
+#define LGLYPH_CODE(g) AREF ((g), 3)
+#define LGLYPH_WIDTH(g) AREF ((g), 4)
+#define LGLYPH_ADJUSTMENT(g) AREF ((g), 5)
+#define LGLYPH_SET_FROM(g, val) ASET ((g), 0, (val))
+#define LGLYPH_SET_TO(g, val) ASET ((g), 1, (val))
+#define LGLYPH_SET_CHAR(g, val) ASET ((g), 2, (val))
+#define LGLYPH_SET_CODE(g, val) ASET ((g), 3, (val))
+#define LGLYPH_SET_WIDTH(g, val) ASET ((g), 4, (val))
+#define LGLYPH_SET_ADJUSTMENT(g, val) ASET ((g), 5, (val))
+
+#define LGLYPH_XOFF(g) (VECTORP (LGLYPH_ADJUSTMENT (g)) \
+ ? XINT (AREF (LGLYPH_ADJUSTMENT (g), 0)) : 0)
+#define LGLYPH_YOFF(g) (VECTORP (LGLYPH_ADJUSTMENT (g)) \
+ ? XINT (AREF (LGLYPH_ADJUSTMENT (g), 1)) : 0)
+#define LGLYPH_WADJUST(g) (VECTORP (LGLYPH_ADJUSTMENT (g)) \
+ ? XINT (AREF (LGLYPH_ADJUSTMENT (g), 2)) : 0)
+
+#define FONT_INVALID_CODE 0xFFFFFFFF
+
+/* Font driver. Members specified as "optional" can be NULL. */
+
+struct font_driver
+{
+ /* Symbol indicating the type of the font-driver. */
+ Lisp_Object type;
+
+ /* Return a cache of font-entities on FRAME. The cache must be a
+ cons whose cdr part is the actual cache area. */
+ Lisp_Object (*get_cache) P_ ((Lisp_Object frame));
+
+ /* List fonts exactly matching with FONT_SPEC on FRAME. The value
+ is a vector of font-entities. This is the sole API that
+ allocates font-entities. */
+ Lisp_Object (*list) P_ ((Lisp_Object frame, Lisp_Object font_spec));
+
+ /* Return a font entity most closely maching with FONT_SPEC on
+ FRAME. The closeness is detemined by the font backend, thus
+ `face-font-selection-order' is ignored here. */
+ Lisp_Object (*match) P_ ((Lisp_Object frame, Lisp_Object font_spec));
+
+ /* Optional.
+ List available families. The value is a list of family names
+ (symbols). */
+ Lisp_Object (*list_family) P_ ((Lisp_Object frame));
+
+ /* Optional (if FONT_EXTRA_INDEX is not Lisp_Save_Value).
+ Free FONT_EXTRA_INDEX field of FONT_ENTITY. */
+ void (*free_entity) P_ ((Lisp_Object font_entity));
+
+ /* Open a font specified by FONT_ENTITY on frame F. If the font is
+ scalable, open it with PIXEL_SIZE. */
+ struct font *(*open) P_ ((FRAME_PTR f, Lisp_Object font_entity,
+ int pixel_size));
+
+ /* Close FONT on frame F. */
+ void (*close) P_ ((FRAME_PTR f, struct font *font));
+
+ /* Optional (if FACE->extra is not used).
+ Prepare FACE for displaying characters by FONT on frame F by
+ storing some data in FACE->extra. If successful, return 0.
+ Otherwise, return -1. */
+ int (*prepare_face) P_ ((FRAME_PTR f, struct face *face));
+
+ /* Optional.
+ Done FACE for displaying characters by FACE->font on frame F. */
+ void (*done_face) P_ ((FRAME_PTR f, struct face *face));
+
+ /* Optional.
+ If FONT_ENTITY has a glyph for character C (Unicode code point),
+ return 1. If not, return 0. If a font must be opened to check
+ it, return -1. */
+ int (*has_char) P_ ((Lisp_Object entity, int c));
+
+ /* Return a glyph code of FONT for characer C (Unicode code point).
+ If FONT doesn't have such a glyph, return FONT_INVALID_CODE. */
+ unsigned (*encode_char) P_ ((struct font *font, int c));
+
+ /* Computate the total metrics of the NGLYPHS glyphs specified by
+ the font FONT and the sequence of glyph codes CODE, and store the
+ result in METRICS. */
+ int (*text_extents) P_ ((struct font *font,
+ unsigned *code, int nglyphs,
+ struct font_metrics *metrics));
+
+ /* Optional.
+ Draw glyphs between FROM and TO of S->char2b at (X Y) pixel
+ position of frame F with S->FACE and S->GC. If WITH_BACKGROUND
+ is nonzero, fill the background in advance. It is assured that
+ WITH_BACKGROUND is zero when (FROM > 0 || TO < S->nchars). */
+ int (*draw) P_ ((struct glyph_string *s, int from, int to,
+ int x, int y, int with_background));
+
+ /* Optional.
+ Store bitmap data for glyph-code CODE of FONT in BITMAP. It is
+ intended that this method is callled from the other font-driver
+ for actual drawing. */
+ int (*get_bitmap) P_ ((struct font *font, unsigned code,
+ struct font_bitmap *bitmap,
+ int bits_per_pixel));
+
+ /* Optional.
+ Free bitmap data in BITMAP. */
+ void (*free_bitmap) P_ ((struct font *font, struct font_bitmap *bitmap));
+
+ /* Optional.
+ Return an outline data for glyph-code CODE of FONT. The format
+ of the outline data depends on the font-driver. */
+ void *(*get_outline) P_ ((struct font *font, unsigned code));
+
+ /* Optional.
+ Free OUTLINE (that is obtained by the above method). */
+ void (*free_outline) P_ ((struct font *font, void *outline));
+
+ /* Optional.
+ Get coordinates of the INDEXth anchor point of the glyph whose
+ code is CODE. Store the coordinates in *X and *Y. Return 0 if
+ the operations was successfull. Otherwise return -1. */
+ int (*anchor_point) P_ ((struct font *font, unsigned code, int index,
+ int *x, int *y));
+
+ /* Optional.
+ Return a list describing which scripts/languages FONT
+ supports by which GSUB/GPOS features of OpenType tables. */
+ Lisp_Object (*otf_capability) P_ ((struct font *font));
+
+ /* Optional.
+ Apply FONT's OTF-FEATURES to the glyph string.
+
+ FEATURES specifies which OTF features to apply in this format:
+ (SCRIPT LANGSYS GSUB-FEATURE GPOS-FEATURE)
+ See the documentation of `font-drive-otf' for the detail.
+
+ This method applies the specified features to the codes in the
+ elements of GSTRING-IN (between FROMth and TOth). The output
+ codes are stored in GSTRING-OUT at the IDXth element and the
+ following elements.
+
+ Return the number of output codes. If none of the features are
+ applicable to the input data, return 0. If GSTRING-OUT is too
+ short, return -1. */
+ int (*otf_drive) P_ ((struct font *font, Lisp_Object features,
+ Lisp_Object gstring_in, int from, int to,
+ Lisp_Object gstring_out, int idx, int alternate_subst));
+};
+
+
+struct font_driver_list
+{
+ /* 1 iff this driver is currently used. */
+ int on;
+ struct font_driver *driver;
+ struct font_driver_list *next;
+};
+
+extern int enable_font_backend;
+
+EXFUN (Ffont_spec, MANY);
+EXFUN (Flist_fonts, 4);
+EXFUN (Fclear_font_cache, 0);
+EXFUN (Ffont_xlfd_name, 1);
+
+extern Lisp_Object font_symbolic_weight P_ ((Lisp_Object font));
+extern Lisp_Object font_symbolic_slant P_ ((Lisp_Object font));
+extern Lisp_Object font_symbolic_width P_ ((Lisp_Object font));
+
+extern int font_match_p P_ ((Lisp_Object spec, Lisp_Object entity));
+
+extern Lisp_Object font_find_object P_ ((struct font *font));
+extern Lisp_Object font_get_name P_ ((Lisp_Object font_object));
+extern Lisp_Object font_get_spec P_ ((Lisp_Object font_object));
+extern Lisp_Object font_get_frame P_ ((Lisp_Object font_object));
+extern int font_has_char P_ ((FRAME_PTR, Lisp_Object, int));
+extern unsigned font_encode_char P_ ((Lisp_Object, int));
+
+extern int font_set_lface_from_name P_ ((FRAME_PTR f,
+ Lisp_Object lface,
+ Lisp_Object fontname,
+ int force_p, int may_fail_p));
+extern Lisp_Object font_find_for_lface P_ ((FRAME_PTR f, Lisp_Object *lface,
+ Lisp_Object spec));
+extern Lisp_Object font_open_for_lface P_ ((FRAME_PTR f, Lisp_Object entity,
+ Lisp_Object *lface,
+ Lisp_Object spec));
+extern void font_load_for_face P_ ((FRAME_PTR f, struct face *face));
+extern void font_prepare_for_face P_ ((FRAME_PTR f, struct face *face));
+extern Lisp_Object font_open_by_name P_ ((FRAME_PTR f, char *name));
+extern void font_close_object (FRAME_PTR f, Lisp_Object font_object);
+
+extern Lisp_Object intern_downcase P_ ((char *str, int len));
+extern void font_update_sort_order P_ ((int *order));
+
+extern void font_merge_old_spec P_ ((Lisp_Object name, Lisp_Object family,
+ Lisp_Object registry, Lisp_Object spec));
+
+
+extern int font_parse_xlfd P_ ((char *name, Lisp_Object font));
+extern int font_unparse_xlfd P_ ((Lisp_Object font, int pixel_size,
+ char *name, int bytes));
+extern int font_parse_fcname P_ ((char *name, Lisp_Object font));
+extern int font_unparse_fcname P_ ((Lisp_Object font, int pixel_size,
+ char *name, int bytes));
+extern void register_font_driver P_ ((struct font_driver *driver, FRAME_PTR f));
+extern void free_font_driver_list P_ ((FRAME_PTR f));
+extern Lisp_Object font_update_drivers P_ ((FRAME_PTR f, Lisp_Object list));
+extern Lisp_Object font_at P_ ((int c, EMACS_INT pos, struct face *face,
+ struct window *w, Lisp_Object object));
+
+extern struct font *font_prepare_composition P_ ((struct composition *cmp));
+
+extern Lisp_Object font_put_extra P_ ((Lisp_Object font, Lisp_Object prop,
+ Lisp_Object val));
+
+#ifdef HAVE_LIBOTF
+/* This can be used as `otf_capability' method of a font-driver. */
+extern Lisp_Object font_otf_capability P_ ((struct font *font));
+/* This can be used as `otf_drive' method of a font-driver. */
+extern int font_drive_otf P_ ((struct font *font, Lisp_Object otf_features,
+ Lisp_Object gstring_in, int from, int to,
+ Lisp_Object gstring_out, int idx,
+ int alternate_subst));
+#endif /* HAVE_LIBOTF */
+
+#ifdef HAVE_FREETYPE
+extern struct font_driver ftfont_driver;
+#endif /* HAVE_FREETYPE */
+#ifdef HAVE_X_WINDOWS
+extern struct font_driver xfont_driver;
+extern struct font_driver ftxfont_driver;
+#ifdef HAVE_XFT
+extern struct font_driver xftfont_driver;
+#endif /* HAVE_XFT */
+#endif /* HAVE_X_WINDOWS */
+#ifdef WINDOWSNT
+extern struct font_driver w32font_driver;
+#endif /* WINDOWSNT */
+#ifdef MAC_OS
+extern struct font_driver atmfont_driver;
+#endif /* MAC_OS */
+
+#endif /* not EMACS_FONT_H */
+
+/* arch-tag: 3b7260c3-5bec-4d6b-a0db-95c1b431b1a2
+ (do not change this comment) */
diff --git a/src/fontset.c b/src/fontset.c
index 1d6e73517b..47a682cc97 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -5,7 +5,10 @@
2005, 2006, 2007
National Institute of Advanced Industrial Science and Technology (AIST)
Registration Number H14PRO021
-
+ Copyright (C) 2003, 2006
+ National Institute of Advanced Industrial Science and Technology (AIST)
+ Registration Number H13PRO009
+
This file is part of GNU Emacs.
GNU Emacs is free software; you can redistribute it and/or modify
@@ -32,12 +35,15 @@ Boston, MA 02110-1301, USA. */
#endif
#include "lisp.h"
+#include "blockinput.h"
#include "buffer.h"
+#include "character.h"
#include "charset.h"
#include "ccl.h"
#include "keyboard.h"
#include "frame.h"
#include "dispextern.h"
+#include "intervals.h"
#include "fontset.h"
#include "window.h"
#ifdef HAVE_X_WINDOWS
@@ -49,73 +55,136 @@ Boston, MA 02110-1301, USA. */
#ifdef MAC_OS
#include "macterm.h"
#endif
-#include "termhooks.h"
-#ifdef FONTSET_DEBUG
+#ifdef USE_FONT_BACKEND
+#include "font.h"
+#endif /* USE_FONT_BACKEND */
+
#undef xassert
+#ifdef FONTSET_DEBUG
#define xassert(X) do {if (!(X)) abort ();} while (0)
#undef INLINE
#define INLINE
-#endif
+#else /* not FONTSET_DEBUG */
+#define xassert(X) (void) 0
+#endif /* not FONTSET_DEBUG */
+EXFUN (Fclear_face_cache, 1);
/* FONTSET
A fontset is a collection of font related information to give
- similar appearance (style, size, etc) of characters. There are two
- kinds of fontsets; base and realized. A base fontset is created by
- new-fontset from Emacs Lisp explicitly. A realized fontset is
- created implicitly when a face is realized for ASCII characters. A
- face is also realized for multibyte characters based on an ASCII
- face. All of the multibyte faces based on the same ASCII face
- share the same realized fontset.
+ similar appearance (style, etc) of characters. A fontset has two
+ roles. One is to use for the frame parameter `font' as if it is an
+ ASCII font. In that case, Emacs uses the font specified for
+ `ascii' script for the frame's default font.
+
+ Another role, the more important one, is to provide information
+ about which font to use for each non-ASCII character.
+
+ There are two kinds of fontsets; base and realized. A base fontset
+ is created by `new-fontset' from Emacs Lisp explicitly. A realized
+ fontset is created implicitly when a face is realized for ASCII
+ characters. A face is also realized for non-ASCII characters based
+ on an ASCII face. All of non-ASCII faces based on the same ASCII
+ face share the same realized fontset.
+
+ A fontset object is implemented by a char-table whose default value
+ and parent are always nil.
+
+ An element of a base fontset is a vector of FONT-DEFs which itself
+ is a vector [ FONT-SPEC ENCODING REPERTORY ].
+
+ FONT-SPEC is:
+ [ FAMILY WEIGHT SLANT SWIDTH ADSTYLE REGISTRY ]
+ or
+ FONT-NAME
+ where FAMILY, WEIGHT, SLANT, SWIDTH, ADSTYLE, REGISTRY, and
+ FONT-NAME are strings.
+
+ Note: Currently WEIGHT through ADSTYLE are ignored.
+
+ ENCODING is a charset ID that can convert characters to glyph codes
+ of the corresponding font.
+
+ REPERTORY is a charset ID, a char-table, or nil. If REPERTORY is a
+ charset ID, the repertory of the charset exactly matches with that
+ of the font. If REPERTORY is a char-table, all characters who have
+ a non-nil value in the table are supported. If REPERTORY is nil,
+ we consult with the font itself to get the repertory.
+
+ ENCODING and REPERTORY are extracted from the variable
+ Vfont_encoding_alist by using a font name generated from FONT-SPEC
+ (if it is a vector) or FONT-NAME as a matching target.
+
+
+ An element of a realized fontset is nil or t, or has this form:
+
+ [CHARSET-ORDERED-LIST-TICK PREFERRED-CHARSET-ID
+ PREFERRED-RFONT-DEF RFONT-DEF0 RFONT-DEF1 ...].
+
+ RFONT-DEFn (i.e. Realized FONT-DEF) has this form:
+
+ [ FACE-ID FONT-INDEX FONT-DEF OPENED-FONT-NAME ]
- A fontset object is implemented by a char-table.
+ RFONT-DEFn is automatically reordered by the current charset
+ priority list.
- An element of a base fontset is:
- (INDEX . FONTNAME) or
- (INDEX . (FOUNDRY . REGISTRY ))
- FONTNAME is a font name pattern for the corresponding character.
- FOUNDRY and REGISTRY are respectively foundry and registry fields of
- a font name for the corresponding character. INDEX specifies for
- which character (or generic character) the element is defined. It
- may be different from an index to access this element. For
- instance, if a fontset defines some font for all characters of
- charset `japanese-jisx0208', INDEX is the generic character of this
- charset. REGISTRY is the
+ The value nil means that we have not yet generated the above vector
+ from the base of the fontset.
- An element of a realized fontset is FACE-ID which is a face to use
- for displaying the corresponding character.
+ The value t means that no font is available for the corresponding
+ range of characters.
- All single byte characters (ASCII and 8bit-unibyte) share the same
- element in a fontset. The element is stored in the first element
- of the fontset.
- To access or set each element, use macros FONTSET_REF and
- FONTSET_SET respectively for efficiency.
+ A fontset has 9 extra slots.
- A fontset has 3 extra slots.
+ The 1st slot: the ID number of the fontset
- The 1st slot is an ID number of the fontset.
+ The 2nd slot:
+ base: the name of the fontset
+ realized: nil
- The 2nd slot is a name of the fontset. This is nil for a realized
- face.
+ The 3rd slot:
+ base: nil
+ realized: the base fontset
- The 3rd slot is a frame that the fontset belongs to. This is nil
- for a default face.
+ The 4th slot:
+ base: nil
+ realized: the frame that the fontset belongs to
- A parent of a base fontset is nil. A parent of a realized fontset
- is a base fontset.
+ The 5th slot:
+ base: the font name for ASCII characters
+ realized: nil
- All fontsets are recorded in Vfontset_table.
+ The 6th slot:
+ base: nil
+ realized: the ID number of a face to use for characters that
+ has no font in a realized fontset.
+
+ The 7th slot:
+ base: nil
+ realized: Alist of font index vs the corresponding repertory
+ char-table.
+
+ The 8th slot:
+ base: nil
+ realized: If the base is not the default fontset, a fontset
+ realized from the default fontset, else nil.
+
+ The 9th slot:
+ base: Same as element value (but for fallback fonts).
+ realized: Likewise.
+
+ All fontsets are recorded in the vector Vfontset_table.
DEFAULT FONTSET
- There's a special fontset named `default fontset' which defines a
- default fontname pattern. When a base fontset doesn't specify a
- font for a specific character, the corresponding value in the
- default fontset is used. The format is the same as a base fontset.
+ There's a special base fontset named `default fontset' which
+ defines the default font specifications. When a base fontset
+ doesn't specify a font for a specific character, the corresponding
+ value in the default fontset is used.
The parent of a realized fontset created for such a face that has
no fontset is the default fontset.
@@ -123,16 +192,19 @@ Boston, MA 02110-1301, USA. */
These structures are hidden from the other codes than this file.
The other codes handle fontsets only by their ID numbers. They
- usually use variable name `fontset' for IDs. But, in this file, we
- always use variable name `id' for IDs, and name `fontset' for the
- actual fontset objects.
+ usually use the variable name `fontset' for IDs. But, in this
+ file, we always use varialbe name `id' for IDs, and name `fontset'
+ for an actual fontset object, i.e., char-table.
*/
/********** VARIABLES and FUNCTION PROTOTYPES **********/
extern Lisp_Object Qfont;
-Lisp_Object Qfontset;
+static Lisp_Object Qfontset;
+static Lisp_Object Qfontset_info;
+static Lisp_Object Qprepend, Qappend;
+static Lisp_Object Qlatin;
/* Vector containing all fontsets. */
static Lisp_Object Vfontset_table;
@@ -142,19 +214,16 @@ static Lisp_Object Vfontset_table;
static int next_fontset_id;
/* The default fontset. This gives default FAMILY and REGISTRY of
- font for each characters. */
+ font for each character. */
static Lisp_Object Vdefault_fontset;
-/* Alist of font specifications. It override the font specification
- in the default fontset. */
-static Lisp_Object Voverriding_fontspec_alist;
-
Lisp_Object Vfont_encoding_alist;
Lisp_Object Vuse_default_ascent;
Lisp_Object Vignore_relative_composition;
Lisp_Object Valternate_fontname_alist;
Lisp_Object Vfontset_alias_alist;
Lisp_Object Vvertical_centering_font_regexp;
+Lisp_Object Votf_script_alist;
/* The following six are declarations of callback functions depending
on window system. See the comments in src/fontset.h for more
@@ -187,19 +256,38 @@ void (*set_frame_fontset_func) P_ ((FRAME_PTR f, Lisp_Object arg,
This function set the member `encoder' of the structure. */
void (*find_ccl_program_func) P_ ((struct font_info *));
+Lisp_Object (*get_font_repertory_func) P_ ((struct frame *,
+ struct font_info *));
+
/* Check if any window system is used now. */
void (*check_window_system_func) P_ ((void));
/* Prototype declarations for static functions. */
-static Lisp_Object fontset_ref P_ ((Lisp_Object, int));
-static Lisp_Object lookup_overriding_fontspec P_ ((Lisp_Object, int));
-static void fontset_set P_ ((Lisp_Object, int, Lisp_Object));
+static Lisp_Object fontset_add P_ ((Lisp_Object, Lisp_Object, Lisp_Object,
+ Lisp_Object));
+static Lisp_Object fontset_font P_ ((Lisp_Object, int, struct face *, int));
static Lisp_Object make_fontset P_ ((Lisp_Object, Lisp_Object, Lisp_Object));
-static int fontset_id_valid_p P_ ((int));
static Lisp_Object fontset_pattern_regexp P_ ((Lisp_Object));
-static Lisp_Object font_family_registry P_ ((Lisp_Object, int));
-static Lisp_Object regularize_fontname P_ ((Lisp_Object));
+static void accumulate_script_ranges P_ ((Lisp_Object, Lisp_Object,
+ Lisp_Object));
+Lisp_Object find_font_encoding P_ ((Lisp_Object));
+
+static void set_fontset_font P_ ((Lisp_Object, Lisp_Object));
+
+#ifdef FONTSET_DEBUG
+
+/* Return 1 if ID is a valid fontset id, else return 0. */
+
+static int
+fontset_id_valid_p (id)
+ int id;
+{
+ return (id >= 0 && id < ASIZE (Vfontset_table) - 1);
+}
+
+#endif
+
/********** MACROS AND FUNCTIONS TO HANDLE FONTSET **********/
@@ -209,170 +297,549 @@ static Lisp_Object regularize_fontname P_ ((Lisp_Object));
/* Macros to access special values of FONTSET. */
#define FONTSET_ID(fontset) XCHAR_TABLE (fontset)->extras[0]
+
+/* Macros to access special values of (base) FONTSET. */
#define FONTSET_NAME(fontset) XCHAR_TABLE (fontset)->extras[1]
-#define FONTSET_FRAME(fontset) XCHAR_TABLE (fontset)->extras[2]
-#define FONTSET_ASCII(fontset) XCHAR_TABLE (fontset)->contents[0]
-#define FONTSET_BASE(fontset) XCHAR_TABLE (fontset)->parent
+#define FONTSET_ASCII(fontset) XCHAR_TABLE (fontset)->extras[4]
+
+/* Macros to access special values of (realized) FONTSET. */
+#define FONTSET_BASE(fontset) XCHAR_TABLE (fontset)->extras[2]
+#define FONTSET_FRAME(fontset) XCHAR_TABLE (fontset)->extras[3]
+#define FONTSET_NOFONT_FACE(fontset) XCHAR_TABLE (fontset)->extras[5]
+#define FONTSET_REPERTORY(fontset) XCHAR_TABLE (fontset)->extras[6]
+#define FONTSET_DEFAULT(fontset) XCHAR_TABLE (fontset)->extras[7]
-#define BASE_FONTSET_P(fontset) NILP (FONTSET_BASE(fontset))
+/* For both base and realized fontset. */
+#define FONTSET_FALLBACK(fontset) XCHAR_TABLE (fontset)->extras[8]
+#define BASE_FONTSET_P(fontset) (NILP (FONTSET_BASE (fontset)))
-/* Return the element of FONTSET (char-table) at index C (character). */
-#define FONTSET_REF(fontset, c) fontset_ref (fontset, c)
+/* Return the element of FONTSET for the character C. If FONTSET is a
+ base fontset other then the default fontset and FONTSET doesn't
+ contain information for C, return the information in the default
+ fontset. */
+
+#define FONTSET_REF(fontset, c) \
+ (EQ (fontset, Vdefault_fontset) \
+ ? CHAR_TABLE_REF (fontset, c) \
+ : fontset_ref ((fontset), (c)))
static Lisp_Object
fontset_ref (fontset, c)
Lisp_Object fontset;
int c;
{
- int charset, c1, c2;
- Lisp_Object elt, defalt;
-
- if (SINGLE_BYTE_CHAR_P (c))
- return FONTSET_ASCII (fontset);
-
- SPLIT_CHAR (c, charset, c1, c2);
- elt = XCHAR_TABLE (fontset)->contents[charset + 128];
- if (!SUB_CHAR_TABLE_P (elt))
- return elt;
- defalt = XCHAR_TABLE (elt)->defalt;
- if (c1 < 32
- || (elt = XCHAR_TABLE (elt)->contents[c1],
- NILP (elt)))
- return defalt;
- if (!SUB_CHAR_TABLE_P (elt))
- return elt;
- defalt = XCHAR_TABLE (elt)->defalt;
- if (c2 < 32
- || (elt = XCHAR_TABLE (elt)->contents[c2],
- NILP (elt)))
- return defalt;
+ Lisp_Object elt;
+
+ elt = CHAR_TABLE_REF (fontset, c);
+ if (NILP (elt) && ! EQ (fontset, Vdefault_fontset)
+ /* Don't check Vdefault_fontset for a realized fontset. */
+ && NILP (FONTSET_BASE (fontset)))
+ elt = CHAR_TABLE_REF (Vdefault_fontset, c);
return elt;
}
+/* Return the element of FONTSET for the character C, set FROM and TO
+ to the range of characters around C that have the same value as C.
+ If FONTSET is a base fontset other then the default fontset and
+ FONTSET doesn't contain information for C, return the information
+ in the default fontset. */
+
+#define FONTSET_REF_AND_RANGE(fontset, c, form, to) \
+ (EQ (fontset, Vdefault_fontset) \
+ ? char_table_ref_and_range (fontset, c, &from, &to) \
+ : fontset_ref_and_range (fontset, c, &from, &to))
+
static Lisp_Object
-lookup_overriding_fontspec (frame, c)
- Lisp_Object frame;
+fontset_ref_and_range (fontset, c, from, to)
+ Lisp_Object fontset;
int c;
+ int *from, *to;
{
- Lisp_Object tail;
+ Lisp_Object elt;
- for (tail = Voverriding_fontspec_alist; CONSP (tail); tail = XCDR (tail))
+ elt = char_table_ref_and_range (fontset, c, from, to);
+ if (NILP (elt) && ! EQ (fontset, Vdefault_fontset)
+ /* Don't check Vdefault_fontset for a realized fontset. */
+ && NILP (FONTSET_BASE (fontset)))
{
- Lisp_Object val, target, elt;
-
- val = XCAR (tail);
- target = XCAR (val);
- val = XCDR (val);
- /* Now VAL is (NO-FRAME-LIST OK-FRAME-LIST CHAR FONTNAME). */
- if (NILP (Fmemq (frame, XCAR (val)))
- && (CHAR_TABLE_P (target)
- ? ! NILP (CHAR_TABLE_REF (target, c))
- : XINT (target) == CHAR_CHARSET (c)))
- {
- val = XCDR (val);
- elt = XCDR (val);
- if (NILP (Fmemq (frame, XCAR (val))))
- {
- if (! face_font_available_p (XFRAME (frame), XCDR (elt)))
- {
- val = XCDR (XCAR (tail));
- XSETCAR (val, Fcons (frame, XCAR (val)));
- continue;
- }
- XSETCAR (val, Fcons (frame, XCAR (val)));
- }
- if (NILP (XCAR (elt)))
- XSETCAR (elt, make_number (c));
- return elt;
- }
+ int from1, to1;
+
+ elt = char_table_ref_and_range (Vdefault_fontset, c, &from1, &to1);
+ if (*from < from1)
+ *from = from1;
+ if (*to > to1)
+ *to = to1;
}
- return Qnil;
+ return elt;
}
-#define FONTSET_REF_VIA_BASE(fontset, c) fontset_ref_via_base (fontset, &c)
+
+/* Set elements of FONTSET for characters in RANGE to the value ELT.
+ RANGE is a cons (FROM . TO), where FROM and TO are character codes
+ specifying a range. */
+
+#define FONTSET_SET(fontset, range, elt) \
+ Fset_char_table_range ((fontset), (range), (elt))
+
+
+/* Modify the elements of FONTSET for characters in RANGE by replacing
+ with ELT or adding ELT. RANGE is a cons (FROM . TO), where FROM
+ and TO are character codes specifying a range. If ADD is nil,
+ replace with ELT, if ADD is `prepend', prepend ELT, otherwise,
+ append ELT. */
+
+#define FONTSET_ADD(fontset, range, elt, add) \
+ (NILP (add) \
+ ? (NILP (range) \
+ ? (FONTSET_FALLBACK (fontset) = Fmake_vector (make_number (1), (elt))) \
+ : Fset_char_table_range ((fontset), (range), \
+ Fmake_vector (make_number (1), (elt)))) \
+ : fontset_add ((fontset), (range), (elt), (add)))
static Lisp_Object
-fontset_ref_via_base (fontset, c)
- Lisp_Object fontset;
- int *c;
+fontset_add (fontset, range, elt, add)
+ Lisp_Object fontset, range, elt, add;
{
- int charset, c1, c2;
- Lisp_Object elt;
+ Lisp_Object args[2];
+ int idx = (EQ (add, Qappend) ? 0 : 1);
- if (SINGLE_BYTE_CHAR_P (*c))
- return FONTSET_ASCII (fontset);
-
- elt = Qnil;
- if (! EQ (FONTSET_BASE (fontset), Vdefault_fontset))
- elt = FONTSET_REF (FONTSET_BASE (fontset), *c);
- if (NILP (elt))
- elt = lookup_overriding_fontspec (FONTSET_FRAME (fontset), *c);
- if (NILP (elt))
- elt = FONTSET_REF (Vdefault_fontset, *c);
- if (NILP (elt))
- return Qnil;
+ args[1 - idx] = Fmake_vector (make_number (1), elt);
- *c = XINT (XCAR (elt));
- SPLIT_CHAR (*c, charset, c1, c2);
- elt = XCHAR_TABLE (fontset)->contents[charset + 128];
- if (c1 < 32)
- return (SUB_CHAR_TABLE_P (elt) ? XCHAR_TABLE (elt)->defalt : elt);
- if (!SUB_CHAR_TABLE_P (elt))
- return Qnil;
- elt = XCHAR_TABLE (elt)->contents[c1];
- if (c2 < 32)
- return (SUB_CHAR_TABLE_P (elt) ? XCHAR_TABLE (elt)->defalt : elt);
- if (!SUB_CHAR_TABLE_P (elt))
- return Qnil;
- elt = XCHAR_TABLE (elt)->contents[c2];
- return elt;
+ if (CONSP (range))
+ {
+ int from = XINT (XCAR (range));
+ int to = XINT (XCDR (range));
+ int from1, to1;
+
+ do {
+ args[idx] = char_table_ref_and_range (fontset, from, &from1, &to1);
+ if (to < to1)
+ to1 = to;
+ char_table_set_range (fontset, from, to1,
+ NILP (args[idx]) ? args[1 - idx]
+ : Fvconcat (2, args));
+ from = to1 + 1;
+ } while (from < to);
+ }
+ else
+ {
+ args[idx] = FONTSET_FALLBACK (fontset);
+ FONTSET_FALLBACK (fontset)
+ = NILP (args[idx]) ? args[1 - idx] : Fvconcat (2, args);
+ }
+ return Qnil;
}
-/* Store into the element of FONTSET at index C the value NEWELT. */
-#define FONTSET_SET(fontset, c, newelt) fontset_set(fontset, c, newelt)
+/* Update FONTSET_ELEMENT which has this form:
+ [CHARSET-ORDERED-LIST-TICK PREFERRED-CHARSET-ID PREFERRED-RFONT-DEF
+ RFONT-DEF0 RFONT-DEF1 ...].
+ Reorder RFONT-DEFs according to the current order of charset
+ (Vcharset_ordered_list), and update CHARSET-ORDERED-LIST-TICK to
+ the latest value. */
static void
-fontset_set (fontset, c, newelt)
+reorder_font_vector (fontset_element)
+ Lisp_Object fontset_element;
+{
+ Lisp_Object list, *new_vec;
+ Lisp_Object font_def;
+ int size;
+ int *charset_id_table;
+ int i, idx;
+
+ ASET (fontset_element, 0, make_number (charset_ordered_list_tick));
+ size = ASIZE (fontset_element) - 3;
+ if (size <= 1)
+ /* No need to reorder VEC. */
+ return;
+ charset_id_table = (int *) alloca (sizeof (int) * size);
+ new_vec = (Lisp_Object *) alloca (sizeof (Lisp_Object) * size);
+
+ /* At first, extract ENCODING (a chaset ID) from each FONT-DEF.
+ FONT-DEF has this form:
+ [FACE-ID FONT-INDEX [ FONT-SPEC ENCODING REPERTORY ]] */
+ for (i = 0; i < size; i++)
+ {
+ font_def = AREF (fontset_element, i + 3);
+ if (VECTORP (AREF (font_def, 2))
+ && INTEGERP (AREF (AREF (font_def, 2), 1)))
+ charset_id_table[i] = XINT (AREF (AREF (font_def, 2), 1));
+ else
+ charset_id_table[i] = -1;
+ }
+
+ /* Then, store FONT-DEFs in NEW_VEC in the correct order. */
+ for (idx = 0, list = Vcharset_ordered_list;
+ idx < size && CONSP (list); list = XCDR (list))
+ {
+ for (i = 0; i < size; i++)
+ if (charset_id_table[i] == XINT (XCAR (list)))
+ new_vec[idx++] = AREF (fontset_element, i + 3);
+ }
+ for (i = 0; i < size; i++)
+ if (charset_id_table[i] < 0)
+ new_vec[idx++] = AREF (fontset_element, i + 3);
+
+ /* At last, update FONT-DEFs. */
+ for (i = 0; i < size; i++)
+ ASET (fontset_element, i + 3, new_vec[i]);
+}
+
+
+/* Load a font matching the font related attributes in FACE->lface and
+ font pattern in FONT_DEF of FONTSET, and return an index of the
+ font. FONT_DEF has this form:
+ [ FONT-SPEC ENCODING REPERTORY ]
+ If REPERTORY is nil, generate a char-table representing the font
+ repertory by looking into the font itself. */
+
+static int
+load_font_get_repertory (f, face, font_def, fontset)
+ FRAME_PTR f;
+ struct face *face;
+ Lisp_Object font_def;
+ Lisp_Object fontset;
+{
+ char *font_name;
+ struct font_info *font_info;
+ int charset;
+
+ font_name = choose_face_font (f, face->lface, AREF (font_def, 0), NULL);
+ charset = XINT (AREF (font_def, 1));
+ if (! (font_info = fs_load_font (f, font_name, charset)))
+ return -1;
+
+ if (NILP (AREF (font_def, 2))
+ && NILP (Fassq (make_number (font_info->font_idx),
+ FONTSET_REPERTORY (fontset))))
+ {
+ /* We must look into the font to get the correct repertory as a
+ char-table. */
+ Lisp_Object repertory;
+
+ repertory = (*get_font_repertory_func) (f, font_info);
+ FONTSET_REPERTORY (fontset)
+ = Fcons (Fcons (make_number (font_info->font_idx), repertory),
+ FONTSET_REPERTORY (fontset));
+ }
+
+ return font_info->font_idx;
+}
+
+static Lisp_Object fontset_find_font P_ ((Lisp_Object, int, struct face *,
+ int, int));
+
+/* Return RFONT-DEF (vector) in the realized fontset FONTSET for the
+ character C. If the corresponding font is not yet opened, open it
+ (if FACE is not NULL) or return Qnil (if FACE is NULL).
+ If no proper font is found for C, return Qnil.
+ ID is a charset-id that must be preferred, or -1 meaning no
+ preference.
+ If FALLBACK if nonzero, search only fallback fonts. */
+
+static Lisp_Object
+fontset_find_font (fontset, c, face, id, fallback)
Lisp_Object fontset;
int c;
- Lisp_Object newelt;
+ struct face *face;
+ int id, fallback;
{
- int charset, code[3];
- Lisp_Object *elt;
- int i;
+ Lisp_Object base_fontset, elt, vec, font_def;
+ int i, from, to;
+ int font_idx;
+ FRAME_PTR f = XFRAME (FONTSET_FRAME (fontset));
+
+ base_fontset = FONTSET_BASE (fontset);
+ if (! fallback)
+ vec = CHAR_TABLE_REF (fontset, c);
+ else
+ vec = FONTSET_FALLBACK (fontset);
+ if (NILP (vec))
+ {
+ /* We have not yet decided a font for C. */
+ Lisp_Object range;
- if (SINGLE_BYTE_CHAR_P (c))
+ if (! face)
+ return Qnil;
+ if (! fallback)
+ elt = FONTSET_REF_AND_RANGE (base_fontset, c, from, to);
+ else
+ elt = FONTSET_FALLBACK (base_fontset);
+ range = Fcons (make_number (from), make_number (to));
+ if (NILP (elt))
+ {
+ /* Qt means we have no font for characters of this range. */
+ vec = Qt;
+ }
+ else
+ {
+ /* Build a vector [ -1 -1 nil NEW-ELT0 NEW-ELT1 NEW-ELT2 ... ],
+ where the first -1 is to force reordering of NEW-ELTn,
+ NEW-ELTn is [nil nil AREF (elt, n) nil]. */
+#ifdef USE_FONT_BACKEND
+ if (! fallback
+ && enable_font_backend
+ && EQ (base_fontset, Vdefault_fontset))
+ /* Extra one element is for an automatically added
+ font-def specifying only a script. */
+ vec = Fmake_vector (make_number (ASIZE (elt) + 4), Qnil);
+ else
+#endif /* not USE_FONT_BACKEND */
+ vec = Fmake_vector (make_number (ASIZE (elt) + 3), Qnil);
+ ASET (vec, 0, make_number (-1));
+ ASET (vec, 1, make_number (-1));
+ for (i = 0; i < ASIZE (elt); i++)
+ {
+ Lisp_Object tmp;
+
+ tmp = Fmake_vector (make_number (5), Qnil);
+ ASET (tmp, 2, AREF (elt, i));
+ ASET (vec, 3 + i, tmp);
+ }
+#ifdef USE_FONT_BACKEND
+ if (! fallback
+ && enable_font_backend
+ && EQ (base_fontset, Vdefault_fontset))
+ {
+ Lisp_Object script, font_spec;
+
+ script = CHAR_TABLE_REF (Vchar_script_table, c);
+ if (NILP (script))
+ script = intern ("latin");
+ font_spec = Ffont_spec (0, NULL);
+ ASET (font_spec, FONT_REGISTRY_INDEX, Qiso10646_1);
+ ASET (font_spec, FONT_EXTRA_INDEX,
+ Fcons (Fcons (QCscript, script), Qnil));
+ font_def = Fmake_vector (make_number (3), Qnil);
+ ASET (font_def, 0, font_spec);
+ elt = Fmake_vector (make_number (5), Qnil);
+ ASET (elt, 2, font_def);
+ ASET (vec, 3 + i, elt);
+ }
+#endif /* USE_FONT_BACKEND */
+
+ /* Then store it in the fontset. */
+ if (! fallback)
+ FONTSET_SET (fontset, range, vec);
+ else
+ FONTSET_FALLBACK (fontset) = vec;
+ }
+ }
+ if (EQ (vec, Qt))
+ return Qnil;
+
+ if (XINT (AREF (vec, 0)) != charset_ordered_list_tick)
+ /* The priority of charsets is changed after we selected a face
+ for C last time. */
+ reorder_font_vector (vec);
+
+ if (id < 0)
+ i = 3;
+ else if (id == XFASTINT (AREF (vec, 1)))
+ i = 2;
+ else
{
- FONTSET_ASCII (fontset) = newelt;
- return;
+ ASET (vec, 1, make_number (id));
+ for (i = 3; i < ASIZE (vec); i++)
+ if (id == XFASTINT (AREF (AREF (AREF (vec, i), 2), 1)))
+ break;
+ if (i < ASIZE (vec))
+ {
+ ASET (vec, 2, AREF (vec, i));
+ i = 2;
+ }
+ else
+ {
+ ASET (vec, 2, Qnil);
+ i = 3;
+ }
}
- SPLIT_CHAR (c, charset, code[0], code[1]);
- code[2] = 0; /* anchor */
- elt = &XCHAR_TABLE (fontset)->contents[charset + 128];
- for (i = 0; code[i] > 0; i++)
+ /* Find the first available font in the vector of RFONT-DEF. */
+ for (; i < ASIZE (vec); i++)
{
- if (!SUB_CHAR_TABLE_P (*elt))
+ elt = AREF (vec, i);
+ if (NILP (elt))
+ continue;
+ /* ELT == [ FACE-ID FONT-INDEX FONT-DEF OPENED-FONT-NAME ] */
+ if (INTEGERP (AREF (elt, 1)) && XINT (AREF (elt, 1)) < 0)
+ /* We couldn't open this font last time. */
+ continue;
+
+ if (!face && NILP (AREF (elt, 1)))
+ /* We have not yet opened the font. */
+ return Qnil;
+
+ font_def = AREF (elt, 2);
+ /* FONT_DEF == [ FONT-SPEC ENCODING REPERTORY ] */
+
+#ifdef USE_FONT_BACKEND
+ if (enable_font_backend)
+ {
+ /* ELT == [ FACE-ID FONT-INDEX FONT-DEF FONT-ENTITY FONT-OBJECT ] */
+ Lisp_Object font_entity = AREF (elt, 3);
+ Lisp_Object font_object = AREF (elt, 4);
+ Lisp_Object font_spec = AREF (font_def, 0);
+ int has_char;
+
+ if (NILP (font_entity))
+ {
+ if (! FONT_SPEC_P (font_spec))
+ {
+ /* FONT_SPEC is FONT-NAME or (FAMILY . REGISTRY). */
+ font_spec = Ffont_spec (0, NULL);
+ if (STRINGP (AREF (font_def, 0)))
+ font_merge_old_spec (AREF (font_def, 0), Qnil, Qnil,
+ font_spec);
+ else
+ {
+ Lisp_Object family = AREF (AREF (font_def, 0), 0);
+ Lisp_Object registry = AREF (AREF (font_def, 0), 5);;
+
+ font_merge_old_spec (Qnil, family, registry, font_spec);
+ }
+ ASET (font_def, 0, font_spec);
+ }
+ font_entity = font_find_for_lface (f, face->lface, font_spec);
+ ASET (elt, 3, font_entity);
+ if (NILP (font_entity))
+ {
+ ASET (elt, 1, make_number (-1));
+ continue;
+ }
+ font_object = Qnil;
+ }
+ has_char = font_has_char (f, font_entity, c);
+ if (has_char == 0)
+ continue;
+ if (NILP (font_object))
+ {
+ font_object = font_open_for_lface (f, font_entity,
+ face->lface, font_spec);
+ ASET (elt, 4, font_object);
+ if (NILP (font_object))
+ {
+ ASET (elt, 1, make_number (-1));
+ continue;
+ }
+ }
+ ASET (elt, 1, make_number (0));
+ ASET (elt, 4, font_object);
+ if (has_char < 0
+ && font_encode_char (font_object, c) == FONT_INVALID_CODE)
+ continue;
+ }
+ else
+#endif /* USE_FONT_BACKEND */
+
+ if (INTEGERP (AREF (font_def, 2)))
+ {
+ /* The repertory is specified by charset ID. */
+ struct charset *charset
+ = CHARSET_FROM_ID (XINT (AREF (font_def, 2)));
+
+ if (! CHAR_CHARSET_P (c, charset))
+ /* This font can't display C. */
+ continue;
+ }
+ else if (CHAR_TABLE_P (AREF (font_def, 2)))
+ {
+ /* The repertory is specified by a char table. */
+ if (NILP (CHAR_TABLE_REF (AREF (font_def, 2), c)))
+ /* This font can't display C. */
+ continue;
+ }
+ else
{
- Lisp_Object val = *elt;
- *elt = make_sub_char_table (Qnil);
- XCHAR_TABLE (*elt)->defalt = val;
+ Lisp_Object slot;
+
+ if (! INTEGERP (AREF (elt, 1)))
+ {
+ /* We have not yet opened a font matching this spec.
+ Open the best matching font now and register the
+ repertory. */
+ struct font_info *font_info;
+
+ font_idx = load_font_get_repertory (f, face, font_def, fontset);
+ ASET (elt, 1, make_number (font_idx));
+ if (font_idx < 0)
+ /* This means that we couldn't find a font matching
+ FONT_DEF. */
+ continue;
+ font_info = (*get_font_info_func) (f, font_idx);
+ ASET (elt, 3, build_string (font_info->full_name));
+ }
+
+ slot = Fassq (AREF (elt, 1), FONTSET_REPERTORY (fontset));
+ xassert (CONSP (slot));
+ if (NILP (CHAR_TABLE_REF (XCDR (slot), c)))
+ /* This font can't display C. */
+ continue;
}
- elt = &XCHAR_TABLE (*elt)->contents[code[i]];
+
+ /* Now we have decided to use this font spec to display C. */
+ if (! INTEGERP (AREF (elt, 1)))
+ {
+ /* But not yet opened the best matching font. */
+ struct font_info *font_info;
+
+ font_idx = load_font_get_repertory (f, face, font_def, fontset);
+ ASET (elt, 1, make_number (font_idx));
+ if (font_idx < 0)
+ /* Can't open it. Try the other one. */
+ continue;
+ font_info = (*get_font_info_func) (f, font_idx);
+ ASET (elt, 3, build_string (font_info->full_name));
+ }
+
+ /* Now we have the opened font. */
+ return elt;
}
- if (SUB_CHAR_TABLE_P (*elt))
- XCHAR_TABLE (*elt)->defalt = newelt;
- else
- *elt = newelt;
+ return Qnil;
}
+static Lisp_Object
+fontset_font (fontset, c, face, id)
+ Lisp_Object fontset;
+ int c;
+ struct face *face;
+ int id;
+{
+ Lisp_Object rfont_def;
+ Lisp_Object base_fontset;
+
+ /* Try a font-group for C. */
+ rfont_def = fontset_find_font (fontset, c, face, id, 0);
+ if (! NILP (rfont_def))
+ return rfont_def;
+ base_fontset = FONTSET_BASE (fontset);
+ /* Try a font-group for C of the default fontset. */
+ if (! EQ (base_fontset, Vdefault_fontset))
+ {
+ if (NILP (FONTSET_DEFAULT (fontset)))
+ FONTSET_DEFAULT (fontset)
+ = make_fontset (FONTSET_FRAME (fontset), Qnil, Vdefault_fontset);
+ rfont_def = fontset_find_font (FONTSET_DEFAULT (fontset), c, face, id, 0);
+ }
+ if (! NILP (rfont_def))
+ return rfont_def;
+ /* Try a fallback font-group. */
+ rfont_def = fontset_find_font (fontset, c, face, id, 1);
+ if (! NILP (rfont_def))
+ return rfont_def;
+ /* Try a fallback font-group of the default fontset . */
+ if (! EQ (base_fontset, Vdefault_fontset))
+ rfont_def = fontset_find_font (FONTSET_DEFAULT (fontset), c, face, id, 1);
+ return rfont_def;
+}
+
/* Return a newly created fontset with NAME. If BASE is nil, make a
- base fontset. Otherwise make a realized fontset whose parent is
+ base fontset. Otherwise make a realized fontset whose base is
BASE. */
static Lisp_Object
@@ -392,10 +859,11 @@ make_fontset (frame, name, base)
if (id + 1 == size)
{
+ /* We must grow Vfontset_table. */
Lisp_Object tem;
int i;
- tem = Fmake_vector (make_number (size + 8), Qnil);
+ tem = Fmake_vector (make_number (size + 32), Qnil);
for (i = 0; i < size; i++)
AREF (tem, i) = AREF (Vfontset_table, i);
Vfontset_table = tem;
@@ -404,98 +872,100 @@ make_fontset (frame, name, base)
fontset = Fmake_char_table (Qfontset, Qnil);
FONTSET_ID (fontset) = make_number (id);
- FONTSET_NAME (fontset) = name;
- FONTSET_FRAME (fontset) = frame;
- FONTSET_BASE (fontset) = base;
+ if (NILP (base))
+ {
+ FONTSET_NAME (fontset) = name;
+ }
+ else
+ {
+ FONTSET_NAME (fontset) = Qnil;
+ FONTSET_FRAME (fontset) = frame;
+ FONTSET_BASE (fontset) = base;
+ }
- AREF (Vfontset_table, id) = fontset;
+ ASET (Vfontset_table, id, fontset);
next_fontset_id = id + 1;
return fontset;
}
-/* Return 1 if ID is a valid fontset id, else return 0. */
-
-static INLINE int
-fontset_id_valid_p (id)
- int id;
-{
- return (id >= 0 && id < ASIZE (Vfontset_table) - 1);
-}
-
-
-/* Extract `family' and `registry' string from FONTNAME and a cons of
- them. Actually, `family' may also contain `foundry', `registry'
- may also contain `encoding' of FONTNAME. But, if FONTNAME doesn't
- conform to XLFD nor explicitely specifies the other fields
- (i.e. not using wildcard `*'), return FONTNAME. If FORCE is
- nonzero, specifications of the other fields are ignored, and return
- a cons as far as FONTNAME conform to XLFD. */
-
-static Lisp_Object
-font_family_registry (fontname, force)
+/* Set the ASCII font of the default fontset to FONTNAME if that is
+ not yet set. */
+void
+set_default_ascii_font (fontname)
Lisp_Object fontname;
- int force;
{
- Lisp_Object family, registry;
- const char *p = SDATA (fontname);
- const char *sep[15];
- int i = 0;
-
- while (*p && i < 15)
- if (*p++ == '-')
- {
- if (!force && i >= 2 && i <= 11 && *p != '*' && p[1] != '-')
- return fontname;
- sep[i++] = p;
- }
- if (i != 14)
- return fontname;
+ if (! STRINGP (FONTSET_ASCII (Vdefault_fontset)))
+ {
+ int id = fs_query_fontset (fontname, 2);
- family = make_unibyte_string (sep[0], sep[2] - 1 - sep[0]);
- registry = make_unibyte_string (sep[12], p - sep[12]);
- return Fcons (family, registry);
+ if (id >= 0)
+ fontname = FONTSET_ASCII (FONTSET_FROM_ID (id));
+ FONTSET_ASCII (Vdefault_fontset)= fontname;
+ }
}
-/********** INTERFACES TO xfaces.c and dispextern.h **********/
+/********** INTERFACES TO xfaces.c, xfns.c, and dispextern.h **********/
-/* Return name of the fontset with ID. */
+/* Return the name of the fontset who has ID. */
Lisp_Object
fontset_name (id)
int id;
{
Lisp_Object fontset;
+
fontset = FONTSET_FROM_ID (id);
return FONTSET_NAME (fontset);
}
-/* Return ASCII font name of the fontset with ID. */
+/* Return the ASCII font name of the fontset who has ID. */
Lisp_Object
fontset_ascii (id)
int id;
{
Lisp_Object fontset, elt;
+
fontset= FONTSET_FROM_ID (id);
elt = FONTSET_ASCII (fontset);
- return XCDR (elt);
+#ifdef USE_FONT_BACKEND
+ if (CONSP (elt))
+ elt = XCAR (elt);
+#endif /* USE_FONT_BACKEND */
+ /* It is assured that ELT is always a string (i.e. fontname
+ pattern). */
+ return elt;
}
-/* Free fontset of FACE. Called from free_realized_face. */
+/* Free fontset of FACE defined on frame F. Called from
+ free_realized_face. */
void
free_face_fontset (f, face)
FRAME_PTR f;
struct face *face;
{
- if (fontset_id_valid_p (face->fontset))
+ Lisp_Object fontset;
+
+ fontset = AREF (Vfontset_table, face->fontset);
+ xassert (!NILP (fontset) && ! BASE_FONTSET_P (fontset));
+ xassert (f == XFRAME (FONTSET_FRAME (fontset)));
+ ASET (Vfontset_table, face->fontset, Qnil);
+ if (face->fontset < next_fontset_id)
+ next_fontset_id = face->fontset;
+ if (! NILP (FONTSET_DEFAULT (fontset)))
{
- AREF (Vfontset_table, face->fontset) = Qnil;
- if (face->fontset < next_fontset_id)
+ int id = XINT (FONTSET_ID (FONTSET_DEFAULT (fontset)));
+
+ fontset = AREF (Vfontset_table, id);
+ xassert (!NILP (fontset) && ! BASE_FONTSET_P (fontset));
+ xassert (f == XFRAME (FONTSET_FRAME (fontset)));
+ ASET (Vfontset_table, id, Qnil);
+ if (id < next_fontset_id)
next_fontset_id = face->fontset;
}
}
@@ -503,57 +973,85 @@ free_face_fontset (f, face)
/* Return 1 if FACE is suitable for displaying character C.
Otherwise return 0. Called from the macro FACE_SUITABLE_FOR_CHAR_P
- when C is not a single byte character.. */
+ when C is not an ASCII character. */
int
face_suitable_for_char_p (face, c)
struct face *face;
int c;
{
- Lisp_Object fontset, elt;
-
- if (SINGLE_BYTE_CHAR_P (c))
- return (face == face->ascii_face);
+ Lisp_Object fontset, rfont_def;
- xassert (fontset_id_valid_p (face->fontset));
fontset = FONTSET_FROM_ID (face->fontset);
- xassert (!BASE_FONTSET_P (fontset));
-
- elt = FONTSET_REF_VIA_BASE (fontset, c);
- return (!NILP (elt) && face->id == XFASTINT (elt));
+ rfont_def = fontset_font (fontset, c, NULL, -1);
+ return (VECTORP (rfont_def)
+ && INTEGERP (AREF (rfont_def, 0))
+ && face->id == XINT (AREF (rfont_def, 0)));
}
/* Return ID of face suitable for displaying character C on frame F.
- The selection of face is done based on the fontset of FACE. FACE
- should already have been realized for ASCII characters. Called
- from the macro FACE_FOR_CHAR when C is not a single byte character. */
+ FACE must be reazlied for ASCII characters in advance. Called from
+ the macro FACE_FOR_CHAR. */
int
-face_for_char (f, face, c)
+face_for_char (f, face, c, pos, object)
FRAME_PTR f;
struct face *face;
- int c;
+ int c, pos;
+ Lisp_Object object;
{
- Lisp_Object fontset, elt;
+ Lisp_Object fontset, charset, rfont_def;
int face_id;
+ int id;
+
+ if (ASCII_CHAR_P (c))
+ return face->ascii_face->id;
xassert (fontset_id_valid_p (face->fontset));
fontset = FONTSET_FROM_ID (face->fontset);
xassert (!BASE_FONTSET_P (fontset));
+ if (pos < 0)
+ id = -1;
+ else
+ {
+ charset = Fget_char_property (make_number (pos), Qcharset, object);
+ if (NILP (charset))
+ id = -1;
+ else if (CHARSETP (charset))
+ id = XINT (CHARSET_SYMBOL_ID (charset));
+ }
+ rfont_def = fontset_font (fontset, c, face, id);
+ if (VECTORP (rfont_def))
+ {
+#ifdef USE_FONT_BACKEND
+ if (enable_font_backend
+ && NILP (AREF (rfont_def, 0)))
+ {
+ struct font *font = XSAVE_VALUE (AREF (rfont_def, 4))->pointer;
- elt = FONTSET_REF_VIA_BASE (fontset, c);
- if (!NILP (elt))
- return XINT (elt);
+ face_id = face_for_font (f, font, face);
+ ASET (rfont_def, 0, make_number (face_id));
+ }
+ else
+#endif /* USE_FONT_BACKEND */
+ if (NILP (AREF (rfont_def, 0)))
+ {
+ /* We have not yet made a realized face that uses this font. */
+ int font_idx = XINT (AREF (rfont_def, 1));
- /* No face is recorded for C in the fontset of FACE. Make a new
- realized face for C that has the same fontset. */
- face_id = lookup_face (f, face->lface, c, face);
+ face_id = lookup_non_ascii_face (f, font_idx, face);
+ ASET (rfont_def, 0, make_number (face_id));
+ }
+ return XINT (AREF (rfont_def, 0));
+ }
- /* Record the face ID in FONTSET at the same index as the
- information in the base fontset. */
- FONTSET_SET (fontset, c, make_number (face_id));
- return face_id;
+ if (NILP (FONTSET_NOFONT_FACE (fontset)))
+ {
+ face_id = lookup_non_ascii_face (f, -1, face);
+ FONTSET_NOFONT_FACE (fontset) = make_number (face_id);
+ }
+ return XINT (FONTSET_NOFONT_FACE (fontset));
}
@@ -563,9 +1061,10 @@ face_for_char (f, face, c)
Called from realize_x_face. */
int
-make_fontset_for_ascii_face (f, base_fontset_id)
+make_fontset_for_ascii_face (f, base_fontset_id, face)
FRAME_PTR f;
int base_fontset_id;
+ struct face *face;
{
Lisp_Object base_fontset, fontset, frame;
@@ -576,69 +1075,49 @@ make_fontset_for_ascii_face (f, base_fontset_id)
if (!BASE_FONTSET_P (base_fontset))
base_fontset = FONTSET_BASE (base_fontset);
xassert (BASE_FONTSET_P (base_fontset));
+ if (! BASE_FONTSET_P (base_fontset))
+ abort ();
}
else
base_fontset = Vdefault_fontset;
fontset = make_fontset (frame, Qnil, base_fontset);
- return XINT (FONTSET_ID (fontset));
-}
-
-
-/* Return the font name pattern for C that is recorded in the fontset
- with ID. If a font name pattern is specified (instead of a cons of
- family and registry), check if a font can be opened by that pattern
- to get the fullname. If a font is opened, return that name.
- Otherwise, return nil. If ID is -1, or the fontset doesn't contain
- information about C, get the registry and encoding of C from the
- default fontset. Called from choose_face_font. */
+ {
+ Lisp_Object elt, rfont_def, val;
-Lisp_Object
-fontset_font_pattern (f, id, c)
- FRAME_PTR f;
- int id, c;
-{
- Lisp_Object fontset, elt;
- struct font_info *fontp;
+ elt = FONTSET_REF (base_fontset, 0);
+ xassert (VECTORP (elt) && ASIZE (elt) > 0);
+#ifdef USE_FONT_BACKEND
+ rfont_def = Fmake_vector (make_number (5), Qnil);
+ if (enable_font_backend && face->font_info)
+ {
+ struct font *font = (struct font *) face->font_info;
- elt = Qnil;
- if (fontset_id_valid_p (id))
+ ASET (rfont_def, 3, font->entity);
+ ASET (rfont_def, 4, font_find_object (font));
+ }
+ else
+#endif /* USE_FONT_BACKEND */
{
- fontset = FONTSET_FROM_ID (id);
- xassert (!BASE_FONTSET_P (fontset));
- fontset = FONTSET_BASE (fontset);
- if (! EQ (fontset, Vdefault_fontset))
- elt = FONTSET_REF (fontset, c);
+ rfont_def = Fmake_vector (make_number (4), Qnil);
+ ASET (rfont_def, 3, build_string (face->font_name));
}
- if (NILP (elt))
- {
- Lisp_Object frame;
-
- XSETFRAME (frame, f);
- elt = lookup_overriding_fontspec (frame, c);
- }
- if (NILP (elt))
- elt = FONTSET_REF (Vdefault_fontset, c);
-
- if (!CONSP (elt))
- return Qnil;
- if (CONSP (XCDR (elt)))
- return XCDR (elt);
-
- /* The fontset specifies only a font name pattern (not cons of
- family and registry). If a font can be opened by that pattern,
- return the name of opened font. Otherwise return nil. The
- exception is a font for single byte characters. In that case, we
- return a cons of FAMILY and REGISTRY extracted from the opened
- font name. */
- elt = XCDR (elt);
- xassert (STRINGP (elt));
- fontp = FS_LOAD_FONT (f, c, SDATA (elt), -1);
- if (!fontp)
- return Qnil;
-
- return font_family_registry (build_string (fontp->full_name),
- SINGLE_BYTE_CHAR_P (c));
+ ASET (rfont_def, 1, make_number (face->font_info_id));
+ ASET (rfont_def, 2, AREF (elt, 0));
+ elt = Fmake_vector (make_number (4), Qnil);
+ ASET (elt, 0, make_number (charset_ordered_list_tick));
+ ASET (elt, 1, make_number (charset_ascii));
+ ASET (elt, 2, rfont_def);
+ ASET (elt, 3, rfont_def);
+
+ val = Fcons (Qlatin, Qnil);
+ map_char_table (accumulate_script_ranges, Qnil, Vchar_script_table, val);
+ for (val = XCDR (val); CONSP (val); val = XCDR (val))
+ char_table_set_range (fontset, XINT (XCAR (XCAR (val))),
+ XINT (XCDR (XCAR (val))), elt);
+ FONTSET_FALLBACK (fontset) = elt;
+ }
+ return XINT (FONTSET_ID (fontset));
}
@@ -646,125 +1125,57 @@ fontset_font_pattern (f, id, c)
#pragma optimize("", off)
#endif
-/* Load a font named FONTNAME to display character C on frame F.
- Return a pointer to the struct font_info of the loaded font. If
- loading fails, return NULL. If FACE is non-zero and a fontset is
- assigned to it, record FACE->id in the fontset for C. If FONTNAME
- is NULL, the name is taken from the fontset of FACE or what
- specified by ID. */
+/* Load a font named FONTNAME on frame F. Return a pointer to the
+ struct font_info of the loaded font. If loading fails, return
+ NULL. CHARSET is an ID of charset to encode characters for this
+ font. If it is -1, find one from Vfont_encoding_alist. */
struct font_info *
-fs_load_font (f, c, fontname, id, face)
+fs_load_font (f, fontname, charset)
FRAME_PTR f;
- int c;
char *fontname;
- int id;
- struct face *face;
+ int charset;
{
- Lisp_Object fontset;
- Lisp_Object list, elt, fullname;
- int size = 0;
struct font_info *fontp;
- int charset = CHAR_CHARSET (c);
-
- if (face)
- id = face->fontset;
- if (id < 0)
- fontset = Qnil;
- else
- fontset = FONTSET_FROM_ID (id);
-
- if (!NILP (fontset)
- && !BASE_FONTSET_P (fontset))
- {
- elt = FONTSET_REF_VIA_BASE (fontset, c);
- if (!NILP (elt))
- {
- /* A suitable face for C is already recorded, which means
- that a proper font is already loaded. */
- int face_id = XINT (elt);
-
- xassert (face_id == face->id);
- face = FACE_FROM_ID (f, face_id);
- return (*get_font_info_func) (f, face->font_info_id);
- }
-
- if (!fontname && charset == CHARSET_ASCII)
- {
- elt = FONTSET_ASCII (fontset);
- fontname = SDATA (XCDR (elt));
- }
- }
+ Lisp_Object fullname;
if (!fontname)
/* No way to get fontname. */
- return 0;
-
- fontp = (*load_font_func) (f, fontname, size);
- if (!fontp)
- return 0;
+ return NULL;
- /* Fill in members (charset, vertical_centering, encoding, etc) of
- font_info structure that are not set by (*load_font_func). */
- fontp->charset = charset;
+ fontp = (*load_font_func) (f, fontname, 0);
+ if (! fontp || fontp->charset >= 0)
+ return fontp;
+ fontname = fontp->full_name;
fullname = build_string (fontp->full_name);
- fontp->vertical_centering
- = (STRINGP (Vvertical_centering_font_regexp)
- && (fast_string_match_ignore_case
- (Vvertical_centering_font_regexp, fullname) >= 0));
- if (fontp->encoding[1] != FONT_ENCODING_NOT_DECIDED)
+ if (charset < 0)
{
- /* The font itself tells which code points to be used. Use this
- encoding for all other charsets. */
- int i;
-
- fontp->encoding[0] = fontp->encoding[1];
- for (i = MIN_CHARSET_OFFICIAL_DIMENSION1; i <= MAX_CHARSET; i++)
- fontp->encoding[i] = fontp->encoding[1];
+ Lisp_Object charset_symbol;
+
+ charset_symbol = find_font_encoding (fullname);
+ if (CONSP (charset_symbol))
+ charset_symbol = XCAR (charset_symbol);
+ if (NILP (charset_symbol))
+ charset_symbol = Qascii;
+ charset = XINT (CHARSET_SYMBOL_ID (charset_symbol));
}
- else
- {
- /* The font itself doesn't have information about encoding. */
- int i;
+ fontp->charset = charset;
+ fontp->vertical_centering = 0;
+ fontp->font_encoder = NULL;
- /* By default, encoding of ASCII chars is 0 (i.e. 0x00..0x7F),
- others is 1 (i.e. 0x80..0xFF). */
- fontp->encoding[0] = 0;
- for (i = MIN_CHARSET_OFFICIAL_DIMENSION1; i <= MAX_CHARSET; i++)
- fontp->encoding[i] = 1;
- /* Then override them by a specification in Vfont_encoding_alist. */
- for (list = Vfont_encoding_alist; CONSP (list); list = XCDR (list))
- {
- elt = XCAR (list);
- if (CONSP (elt)
- && STRINGP (XCAR (elt)) && CONSP (XCDR (elt))
- && (fast_string_match_ignore_case (XCAR (elt), fullname) >= 0))
- {
- Lisp_Object tmp;
+ if (charset != charset_ascii)
+ {
+ fontp->vertical_centering
+ = (STRINGP (Vvertical_centering_font_regexp)
+ && (fast_string_match_ignore_case
+ (Vvertical_centering_font_regexp, fullname) >= 0));
- for (tmp = XCDR (elt); CONSP (tmp); tmp = XCDR (tmp))
- if (CONSP (XCAR (tmp))
- && ((i = get_charset_id (XCAR (XCAR (tmp))))
- >= 0)
- && INTEGERP (XCDR (XCAR (tmp)))
- && XFASTINT (XCDR (XCAR (tmp))) < 4)
- fontp->encoding[i]
- = XFASTINT (XCDR (XCAR (tmp)));
- }
- }
+ if (find_ccl_program_func)
+ (*find_ccl_program_func) (fontp);
}
- if (! fontp->font_encoder && find_ccl_program_func)
- (*find_ccl_program_func) (fontp);
-
- /* If we loaded a font for a face that has fontset, record the face
- ID in the fontset for C. */
- if (face
- && !NILP (fontset)
- && !BASE_FONTSET_P (fontset))
- FONTSET_SET (fontset, c, make_number (face->id));
return fontp;
}
@@ -772,24 +1183,34 @@ fs_load_font (f, c, fontname, id, face)
#pragma optimize("", on)
#endif
-/* Set the ASCII font of the default fontset to FONTNAME if that is
- not yet set. */
-void
-set_default_ascii_font (fontname)
+
+/* Return ENCODING or a cons of ENCODING and REPERTORY of the font
+ FONTNAME. ENCODING is a charset symbol that specifies the encoding
+ of the font. REPERTORY is a charset symbol or nil. */
+
+
+Lisp_Object
+find_font_encoding (fontname)
Lisp_Object fontname;
{
- if (! CONSP (FONTSET_ASCII (Vdefault_fontset)))
- {
- int id = fs_query_fontset (fontname, 2);
+ Lisp_Object tail, elt;
- if (id >= 0)
- fontname = XCDR (FONTSET_ASCII (FONTSET_FROM_ID (id)));
- FONTSET_ASCII (Vdefault_fontset)
- = Fcons (make_number (0), fontname);
+ for (tail = Vfont_encoding_alist; CONSP (tail); tail = XCDR (tail))
+ {
+ elt = XCAR (tail);
+ if (CONSP (elt)
+ && STRINGP (XCAR (elt))
+ && fast_string_match_ignore_case (XCAR (elt), fontname) >= 0
+ && (SYMBOLP (XCDR (elt))
+ ? CHARSETP (XCDR (elt))
+ : CONSP (XCDR (elt)) && CHARSETP (XCAR (XCDR (elt)))))
+ return (XCDR (elt));
}
+ /* We don't know the encoding of this font. Let's assume `ascii'. */
+ return Qascii;
}
-
+
/* Cache data used by fontset_pattern_regexp. The car part is a
pattern string containing at least one wild card, the cdr part is
the corresponding regular expression. */
@@ -878,6 +1299,8 @@ fs_query_fontset (name, name_pattern)
if (name_pattern != 1)
{
tem = Frassoc (name, Vfontset_alias_alist);
+ if (NILP (tem))
+ tem = Fassoc (name, Vfontset_alias_alist);
if (CONSP (tem) && STRINGP (XCAR (tem)))
name = XCAR (tem);
else if (name_pattern == 0)
@@ -937,9 +1360,7 @@ If REGEXPP is non-nil, PATTERN is a regular expression. */)
return FONTSET_NAME (fontset);
}
-/* Return a list of base fontset names matching PATTERN on frame F.
- If SIZE is not 0, it is the size (maximum bound width) of fontsets
- to be listed. */
+/* Return a list of base fontset names matching PATTERN on frame F. */
Lisp_Object
list_fontsets (f, pattern, size)
@@ -966,111 +1387,73 @@ list_fontsets (f, pattern, size)
continue;
name = FONTSET_NAME (fontset);
- if (!NILP (regexp)
+ if (STRINGP (regexp)
? (fast_string_match (regexp, name) < 0)
: strcmp (SDATA (pattern), SDATA (name)))
continue;
- if (size)
- {
- struct font_info *fontp;
- fontp = FS_LOAD_FONT (f, 0, NULL, id);
- if (!fontp || size != fontp->size)
- continue;
- }
val = Fcons (Fcopy_sequence (FONTSET_NAME (fontset)), val);
}
return val;
}
-DEFUN ("new-fontset", Fnew_fontset, Snew_fontset, 2, 2, 0,
- doc: /* Create a new fontset NAME that contains font information in FONTLIST.
-FONTLIST is an alist of charsets vs corresponding font name patterns. */)
- (name, fontlist)
- Lisp_Object name, fontlist;
-{
- Lisp_Object fontset, elements, ascii_font;
- Lisp_Object tem, tail, elt;
- int id;
- (*check_window_system_func) ();
+/* Free all realized fontsets whose base fontset is BASE. */
- CHECK_STRING (name);
- CHECK_LIST (fontlist);
+static void
+free_realized_fontsets (base)
+ Lisp_Object base;
+{
+ int id;
- name = Fdowncase (name);
- id = fs_query_fontset (name, 2);
- if (id >= 0)
+#if 0
+ /* For the moment, this doesn't work because free_realized_face
+ doesn't remove FACE from a cache. Until we find a solution, we
+ suppress this code, and simply use Fclear_face_cache even though
+ that is not efficient. */
+ BLOCK_INPUT;
+ for (id = 0; id < ASIZE (Vfontset_table); id++)
{
- fontset = FONTSET_FROM_ID (id);
- tem = FONTSET_NAME (fontset);
- error ("Fontset `%s' matches the existing fontset `%s'",
- SDATA (name), SDATA (tem));
- }
+ Lisp_Object this = AREF (Vfontset_table, id);
- /* Check the validity of FONTLIST while creating a template for
- fontset elements. */
- elements = ascii_font = Qnil;
- for (tail = fontlist; CONSP (tail); tail = XCDR (tail))
- {
- int c, charset;
+ if (EQ (FONTSET_BASE (this), base))
+ {
+ Lisp_Object tail;
- tem = XCAR (tail);
- if (!CONSP (tem)
- || (charset = get_charset_id (XCAR (tem))) < 0
- || (!STRINGP (XCDR (tem)) && !CONSP (XCDR (tem))))
- error ("Elements of fontlist must be a cons of charset and font name pattern");
+ for (tail = FONTSET_FACE_ALIST (this); CONSP (tail);
+ tail = XCDR (tail))
+ {
+ FRAME_PTR f = XFRAME (FONTSET_FRAME (this));
+ int face_id = XINT (XCDR (XCAR (tail)));
+ struct face *face = FACE_FROM_ID (f, face_id);
- tem = XCDR (tem);
- if (STRINGP (tem))
- tem = Fdowncase (tem);
- else
- tem = Fcons (Fdowncase (Fcar (tem)), Fdowncase (Fcdr (tem)));
- if (charset == CHARSET_ASCII)
- ascii_font = tem;
- else
- {
- c = MAKE_CHAR (charset, 0, 0);
- elements = Fcons (Fcons (make_number (c), tem), elements);
+ /* Face THIS itself is also freed by the following call. */
+ free_realized_face (f, face);
+ }
}
}
-
- if (NILP (ascii_font))
- error ("No ASCII font in the fontlist");
-
- fontset = make_fontset (Qnil, name, Qnil);
- FONTSET_ASCII (fontset) = Fcons (make_number (0), ascii_font);
- for (; CONSP (elements); elements = XCDR (elements))
+ UNBLOCK_INPUT;
+#else /* not 0 */
+ /* But, we don't have to call Fclear_face_cache if no fontset has
+ been realized from BASE. */
+ for (id = 0; id < ASIZE (Vfontset_table); id++)
{
- elt = XCAR (elements);
- tem = XCDR (elt);
- if (STRINGP (tem))
- tem = font_family_registry (tem, 0);
- tem = Fcons (XCAR (elt), tem);
- FONTSET_SET (fontset, XINT (XCAR (elt)), tem);
- }
+ Lisp_Object this = AREF (Vfontset_table, id);
- return Qnil;
-}
-
-
-/* Clear all elements of FONTSET for multibyte characters. */
-
-static void
-clear_fontset_elements (fontset)
- Lisp_Object fontset;
-{
- int i;
-
- for (i = CHAR_TABLE_SINGLE_BYTE_SLOTS; i < CHAR_TABLE_ORDINARY_SLOTS; i++)
- XCHAR_TABLE (fontset)->contents[i] = Qnil;
+ if (EQ (FONTSET_BASE (this), base))
+ {
+ Fclear_face_cache (Qt);
+ break;
+ }
+ }
+#endif /* not 0 */
}
/* Check validity of NAME as a fontset name and return the
corresponding fontset. If not valid, signal an error.
- If NAME is nil, return Vdefault_fontset. */
+ If NAME is t, return Vdefault_fontset. */
static Lisp_Object
check_fontset_name (name)
@@ -1078,7 +1461,7 @@ check_fontset_name (name)
{
int id;
- if (EQ (name, Qnil))
+ if (EQ (name, Qt))
return Vdefault_fontset;
CHECK_STRING (name);
@@ -1092,125 +1475,490 @@ check_fontset_name (name)
return FONTSET_FROM_ID (id);
}
-/* Downcase FONTNAME or car and cdr of FONTNAME. If FONTNAME is a
- string, maybe change FONTNAME to (FAMILY . REGISTRY). */
+static void
+accumulate_script_ranges (arg, range, val)
+ Lisp_Object arg, range, val;
+{
+ if (EQ (XCAR (arg), val))
+ {
+ if (CONSP (range))
+ XSETCDR (arg, Fcons (Fcons (XCAR (range), XCDR (range)), XCDR (arg)));
+ else
+ XSETCDR (arg, Fcons (Fcons (range, range), XCDR (arg)));
+ }
+}
+
-static Lisp_Object
-regularize_fontname (Lisp_Object fontname)
+/* Return an ASCII font name generated from fontset name NAME and
+ ASCII font specification ASCII_SPEC. NAME is a string conforming
+ to XLFD. ASCII_SPEC is a vector:
+ [FAMILY WEIGHT SLANT SWIDTH ADSTYLE REGISTRY]. */
+
+static INLINE Lisp_Object
+generate_ascii_font_name (name, ascii_spec)
+ Lisp_Object name, ascii_spec;
+{
+ Lisp_Object vec;
+ int i;
+
+ vec = split_font_name_into_vector (name);
+ for (i = FONT_SPEC_FAMILY_INDEX; i <= FONT_SPEC_ADSTYLE_INDEX; i++)
+ if (! NILP (AREF (ascii_spec, i)))
+ ASET (vec, 1 + i, AREF (ascii_spec, i));
+ if (! NILP (AREF (ascii_spec, FONT_SPEC_REGISTRY_INDEX)))
+ ASET (vec, 12, AREF (ascii_spec, FONT_SPEC_REGISTRY_INDEX));
+ return build_font_name_from_vector (vec);
+}
+
+/* Variables referred in set_fontset_font. They are set before
+ map_charset_chars is called in Fset_fontset_font. */
+static Lisp_Object font_def_arg, add_arg;
+static int from_arg, to_arg;
+
+/* Callback function for map_charset_chars in Fset_fontset_font. In
+ FONTSET, set font_def_arg in a fashion specified by add_arg for
+ characters in RANGE while ignoring the range between from_arg and
+ to_arg. */
+
+static void
+set_fontset_font (fontset, range)
+ Lisp_Object fontset, range;
+{
+ if (from_arg < to_arg)
+ {
+ int from = XINT (XCAR (range)), to = XINT (XCDR (range));
+
+ if (from < from_arg)
+ {
+ if (to > to_arg)
+ {
+ Lisp_Object range2;
+
+ range2 = Fcons (make_number (to_arg), XCDR (range));
+ FONTSET_ADD (fontset, range, font_def_arg, add_arg);
+ to = to_arg;
+ }
+ if (to > from_arg)
+ range = Fcons (XCAR (range), make_number (from_arg));
+ }
+ else if (to <= to_arg)
+ return;
+ else
+ {
+ if (from < to_arg)
+ range = Fcons (make_number (to_arg), XCDR (range));
+ }
+ }
+ FONTSET_ADD (fontset, range, font_def_arg, add_arg);
+}
+
+
+DEFUN ("set-fontset-font", Fset_fontset_font, Sset_fontset_font, 3, 5, 0,
+ doc: /*
+Modify fontset NAME to use FONT-SPEC for TARGET characters.
+
+TARGET may be a cons; (FROM . TO), where FROM and TO are characters.
+In that case, use FONT-SPEC for all characters in the range FROM and
+TO (inclusive).
+
+TARGET may be a script name symbol. In that case, use FONT-SPEC for
+all characters that belong to the script.
+
+TARGET may be a charset. In that case, use FONT-SPEC for all
+characters in the charset.
+
+TARGET may be nil. In that case, use FONT-SPEC for any characters for
+that no FONT-SPEC is specified.
+
+FONT-SPEC may one of these:
+ * A cons (FAMILY . REGISTRY), where FAMILY is a font family name and
+ REGISTRY is a font registry name. FAMILY may contains foundry
+ name, and REGISTRY may contains encoding name.
+ * A font name string.
+
+Optional 4th argument FRAME, if non-nil, is a frame. This argument is
+kept for backward compatibility and has no meaning.
+
+Optional 5th argument ADD, if non-nil, specifies how to add FONT-SPEC
+to the font specifications for TARGET previously set. If it is
+`prepend', FONT-SPEC is prepended. If it is `append', FONT-SPEC is
+appended. By default, FONT-SPEC overrides the previous settings. */)
+ (name, target, font_spec, frame, add)
+ Lisp_Object name, target, font_spec, frame, add;
{
- Lisp_Object family, registry;
+ Lisp_Object fontset;
+ Lisp_Object font_def, registry, family;
+ Lisp_Object encoding, repertory;
+ Lisp_Object range_list;
+ struct charset *charset = NULL;
- if (STRINGP (fontname))
- return font_family_registry (Fdowncase (fontname), 0);
+ fontset = check_fontset_name (name);
- CHECK_CONS (fontname);
- family = XCAR (fontname);
- registry = XCDR (fontname);
- if (!NILP (family))
+ /* The arg FRAME is kept for backward compatibility. We only check
+ the validity. */
+ if (!NILP (frame))
+ CHECK_LIVE_FRAME (frame);
+
+ if (VECTORP (font_spec))
{
- CHECK_STRING (family);
- family = Fdowncase (family);
+ /* FONT_SPEC should have this form:
+ [ FAMILY WEIGHT SLANT WIDTH ADSTYLE REGISTRY ]
+ This is a feature not yet documented because WEIGHT thru
+ ADSTYLE are ignored for the moment. */
+ int j;
+
+ if (ASIZE (font_spec) != FONT_SPEC_MAX_INDEX)
+ args_out_of_range (make_number (FONT_SPEC_MAX_INDEX),
+ make_number (ASIZE (font_spec)));
+
+ font_spec = Fcopy_sequence (font_spec);
+ for (j = 0; j < FONT_SPEC_MAX_INDEX - 1; j++)
+ if (! NILP (AREF (font_spec, j)))
+ {
+ CHECK_STRING (AREF (font_spec, j));
+ ASET (font_spec, j, Fdowncase (AREF (font_spec, j)));
+ }
+ family = AREF (font_spec, FONT_SPEC_FAMILY_INDEX);
+ /* REGISTRY should not be omitted. */
+ CHECK_STRING (AREF (font_spec, FONT_SPEC_REGISTRY_INDEX));
+ registry = AREF (font_spec, FONT_SPEC_REGISTRY_INDEX);
}
- if (!NILP (registry))
+ else if (CONSP (font_spec))
{
+ family = XCAR (font_spec);
+ registry = XCDR (font_spec);
+
+ if (! NILP (family))
+ {
+ CHECK_STRING (family);
+ family = Fdowncase (family);
+ }
CHECK_STRING (registry);
registry = Fdowncase (registry);
+ font_spec = Fmake_vector (make_number (FONT_SPEC_MAX_INDEX), Qnil);
+ ASET (font_spec, FONT_SPEC_FAMILY_INDEX, family);
+ ASET (font_spec, FONT_SPEC_REGISTRY_INDEX, registry);
}
- return Fcons (family, registry);
+ else
+ {
+ CHECK_STRING (font_spec);
+ font_spec = Fdowncase (font_spec);
+ }
+
+ if (STRINGP (font_spec))
+ encoding = find_font_encoding (font_spec);
+ else
+ encoding = find_font_encoding (concat2 (family, registry));
+ if (NILP (encoding))
+ encoding = Qascii;
+
+ if (SYMBOLP (encoding))
+ {
+ CHECK_CHARSET (encoding);
+ encoding = repertory = CHARSET_SYMBOL_ID (encoding);
+ }
+ else
+ {
+ repertory = XCDR (encoding);
+ encoding = XCAR (encoding);
+ CHECK_CHARSET (encoding);
+ encoding = CHARSET_SYMBOL_ID (encoding);
+ if (! NILP (repertory) && SYMBOLP (repertory))
+ {
+ CHECK_CHARSET (repertory);
+ repertory = CHARSET_SYMBOL_ID (repertory);
+ }
+ }
+ font_def = Fmake_vector (make_number (3), font_spec);
+ ASET (font_def, 1, encoding);
+ ASET (font_def, 2, repertory);
+
+ if (CHARACTERP (target))
+ range_list = Fcons (Fcons (target, target), Qnil);
+ else if (CONSP (target))
+ {
+ Lisp_Object from, to;
+
+ from = Fcar (target);
+ to = Fcdr (target);
+ CHECK_CHARACTER (from);
+ CHECK_CHARACTER (to);
+ range_list = Fcons (target, Qnil);
+ }
+ else if (SYMBOLP (target) && !NILP (target))
+ {
+ Lisp_Object script_list;
+ Lisp_Object val;
+
+ range_list = Qnil;
+ script_list = XCHAR_TABLE (Vchar_script_table)->extras[0];
+ if (! NILP (Fmemq (target, script_list)))
+ {
+ val = Fcons (target, Qnil);
+ map_char_table (accumulate_script_ranges, Qnil, Vchar_script_table,
+ val);
+ range_list = XCDR (val);
+ if (EQ (target, Qlatin))
+ {
+ if (VECTORP (font_spec))
+ val = generate_ascii_font_name (FONTSET_NAME (fontset),
+ font_spec);
+ else
+ val = font_spec;
+ FONTSET_ASCII (fontset) = val;
+ }
+ }
+ if (CHARSETP (target))
+ {
+ if (EQ (target, Qascii))
+ {
+ if (VECTORP (font_spec))
+ font_spec = generate_ascii_font_name (FONTSET_NAME (fontset),
+ font_spec);
+ FONTSET_ASCII (fontset) = font_spec;
+ range_list = Fcons (Fcons (make_number (0), make_number (127)),
+ Qnil);
+ }
+ else
+ {
+ CHECK_CHARSET_GET_CHARSET (target, charset);
+ }
+ }
+ else if (NILP (range_list))
+ error ("Invalid script or charset name: %s",
+ SDATA (SYMBOL_NAME (target)));
+ }
+ else if (NILP (target))
+ range_list = Fcons (Qnil, Qnil);
+ else
+ error ("Invalid target for setting a font");
+
+
+ if (charset)
+ {
+ font_def_arg = font_def;
+ add_arg = add;
+ if (NILP (range_list))
+ from_arg = to_arg = 0;
+ else
+ from_arg = XINT (XCAR (XCAR (range_list))),
+ to_arg = XINT (XCDR (XCAR (range_list)));
+
+ map_charset_chars (set_fontset_font, Qnil, fontset, charset,
+ CHARSET_MIN_CODE (charset),
+ CHARSET_MAX_CODE (charset));
+ }
+ for (; CONSP (range_list); range_list = XCDR (range_list))
+ FONTSET_ADD (fontset, XCAR (range_list), font_def, add);
+
+ /* Free all realized fontsets whose base is FONTSET. This way, the
+ specified character(s) are surely redisplayed by a correct
+ font. */
+ free_realized_fontsets (fontset);
+
+ return Qnil;
}
-DEFUN ("set-fontset-font", Fset_fontset_font, Sset_fontset_font, 3, 4, 0,
- doc: /* Modify fontset NAME to use FONTNAME for CHARACTER.
-If NAME is nil, modify the default fontset.
-CHARACTER may be a cons; (FROM . TO), where FROM and TO are
-non-generic characters. In that case, use FONTNAME
-for all characters in the range FROM and TO (inclusive).
-CHARACTER may be a charset. In that case, use FONTNAME
-for all character in the charsets.
+DEFUN ("new-fontset", Fnew_fontset, Snew_fontset, 2, 2, 0,
+ doc: /* Create a new fontset NAME from font information in FONTLIST.
-FONTNAME may be a cons; (FAMILY . REGISTRY), where FAMILY is a family
-name of a font, REGISTRY is a registry name of a font. */)
- (name, character, fontname, frame)
- Lisp_Object name, character, fontname, frame;
+FONTLIST is an alist of scripts vs the corresponding font specification list.
+Each element of FONTLIST has the form (SCRIPT FONT-SPEC ...), where a
+character of SCRIPT is displayed by a font that matches one of
+FONT-SPEC.
+
+SCRIPT is a symbol that appears in the first extra slot of the
+char-table `char-script-table'.
+
+FONT-SPEC is a vector, a cons, or a string. See the documentation of
+`set-fontset-font' for the meaning. */)
+ (name, fontlist)
+ Lisp_Object name, fontlist;
{
- Lisp_Object fontset, elt;
- Lisp_Object realized;
- int from, to;
+ Lisp_Object fontset;
+ Lisp_Object val;
int id;
- fontset = check_fontset_name (name);
+ CHECK_STRING (name);
+ CHECK_LIST (fontlist);
+
+ id = fs_query_fontset (name, 0);
+ if (id < 0)
+ {
+ name = Fdowncase (name);
+ val = split_font_name_into_vector (name);
+ if (NILP (val) || NILP (AREF (val, 12)) || NILP (AREF (val, 13)))
+ error ("Fontset name must be in XLFD format");
+ if (strcmp (SDATA (AREF (val, 12)), "fontset"))
+ error ("Registry field of fontset name must be \"fontset\"");
+ Vfontset_alias_alist
+ = Fcons (Fcons (name,
+ concat2 (concat2 (AREF (val, 12), build_string ("-")),
+ AREF (val, 13))),
+ Vfontset_alias_alist);
+ ASET (val, 12, build_string ("iso8859-1"));
+ fontset = make_fontset (Qnil, name, Qnil);
+ FONTSET_ASCII (fontset) = build_font_name_from_vector (val);
+ }
+ else
+ {
+ fontset = FONTSET_FROM_ID (id);;
+ free_realized_fontsets (fontset);
+ Fset_char_table_range (fontset, Qt, Qnil);
+ }
- if (CONSP (character))
+ for (; ! NILP (fontlist); fontlist = Fcdr (fontlist))
{
- /* CH should be (FROM . TO) where FROM and TO are non-generic
- characters. */
- CHECK_NUMBER_CAR (character);
- CHECK_NUMBER_CDR (character);
- from = XINT (XCAR (character));
- to = XINT (XCDR (character));
- if (!char_valid_p (from, 0) || !char_valid_p (to, 0))
- error ("Character range should be by non-generic characters");
- if (!NILP (name)
- && (SINGLE_BYTE_CHAR_P (from) || SINGLE_BYTE_CHAR_P (to)))
- error ("Can't change font for a single byte character");
+ Lisp_Object elt, script;
+
+ elt = Fcar (fontlist);
+ script = Fcar (elt);
+ elt = Fcdr (elt);
+ if (CONSP (elt) && (NILP (XCDR (elt)) || CONSP (XCDR (elt))))
+ for (; CONSP (elt); elt = XCDR (elt))
+ Fset_fontset_font (name, script, XCAR (elt), Qnil, Qappend);
+ else
+ Fset_fontset_font (name, script, elt, Qnil, Qappend);
}
- else if (SYMBOLP (character))
+ return name;
+}
+
+
+/* Alist of automatically created fontsets. Each element is a cons
+ (FONTNAME . FONTSET-ID). */
+static Lisp_Object auto_fontset_alist;
+
+int
+new_fontset_from_font_name (Lisp_Object fontname)
+{
+ Lisp_Object val;
+ Lisp_Object name;
+ Lisp_Object vec;
+ int id;
+
+ fontname = Fdowncase (fontname);
+ val = Fassoc (fontname, auto_fontset_alist);
+ if (CONSP (val))
+ return XINT (XCDR (val));
+
+ vec = split_font_name_into_vector (fontname);
+ if ( NILP (vec))
+ vec = Fmake_vector (make_number (14), build_string (""));
+ ASET (vec, 12, build_string ("fontset"));
+ if (NILP (auto_fontset_alist))
{
- elt = Fget (character, Qcharset);
- if (!VECTORP (elt) || ASIZE (elt) < 1 || !NATNUMP (AREF (elt, 0)))
- error ("Invalid charset: %s", SDATA (SYMBOL_NAME (character)));
- from = MAKE_CHAR (XINT (AREF (elt, 0)), 0, 0);
- to = from;
+ ASET (vec, 13, build_string ("startup"));
+ name = build_font_name_from_vector (vec);
}
else
{
- CHECK_NUMBER (character);
- from = XINT (character);
- to = from;
+ char temp[20];
+ int len = XINT (Flength (auto_fontset_alist));
+
+ sprintf (temp, "auto%d", len);
+ ASET (vec, 13, build_string (temp));
+ name = build_font_name_from_vector (vec);
}
- if (!char_valid_p (from, 1))
- invalid_character (from);
- if (SINGLE_BYTE_CHAR_P (from))
- error ("Can't change font for a single byte character");
- if (from < to)
+ name = Fnew_fontset (name, list2 (list2 (Qascii, fontname),
+ list2 (Fcons (make_number (0),
+ make_number (MAX_CHAR)),
+ fontname)));
+ id = fs_query_fontset (name, 0);
+ auto_fontset_alist
+ = Fcons (Fcons (fontname, make_number (id)), auto_fontset_alist);
+ return id;
+}
+
+#ifdef USE_FONT_BACKEND
+int
+new_fontset_from_font (font_object)
+ Lisp_Object font_object;
+{
+ Lisp_Object font_name = font_get_name (font_object);
+ Lisp_Object font_spec = font_get_spec (font_object);
+ Lisp_Object fontset_spec, short_name, name, fontset;
+
+ if (NILP (auto_fontset_alist))
+ short_name = build_string ("fontset-startup");
+ else
{
- if (!char_valid_p (to, 1))
- invalid_character (to);
- if (SINGLE_BYTE_CHAR_P (to))
- error ("Can't change font for a single byte character");
+ char temp[32];
+ int len = XINT (Flength (auto_fontset_alist));
+
+ sprintf (temp, "fontset-auto%d", len);
+ short_name = build_string (temp);
}
+ fontset_spec = Fcopy_sequence (font_spec);
+ ASET (fontset_spec, FONT_REGISTRY_INDEX, short_name);
+ name = Ffont_xlfd_name (fontset_spec);
+ if (NILP (name))
+ {
+ int i;
- /* The arg FRAME is kept for backward compatibility. We only check
- the validity. */
- if (!NILP (frame))
- CHECK_LIVE_FRAME (frame);
+ for (i = 0; i < FONT_SIZE_INDEX; i++)
+ if ((i != FONT_FAMILY_INDEX) && (i != FONT_REGISTRY_INDEX))
+ ASET (fontset_spec, i, Qnil);
+ name = Ffont_xlfd_name (fontset_spec);
+ if (NILP (name))
+ abort ();
+ }
+ fontset = make_fontset (Qnil, name, Qnil);
+ FONTSET_ASCII (fontset) = font_name;
+ font_spec = Fcons (SYMBOL_NAME (AREF (font_spec, FONT_FAMILY_INDEX)),
+ SYMBOL_NAME (AREF (font_spec, FONT_REGISTRY_INDEX)));
+ Fset_fontset_font (name, Qlatin, font_spec, Qnil, Qnil);
+ Fset_fontset_font (name, Qnil, font_spec, Qnil, Qnil);
+ return XINT (FONTSET_ID (fontset));
+}
- elt = Fcons (make_number (from), regularize_fontname (fontname));
- for (; from <= to; from++)
- FONTSET_SET (fontset, from, elt);
- Foptimize_char_table (fontset);
+struct font *
+fontset_ascii_font (f, id)
+ FRAME_PTR f;
+ int id;
+{
+ Lisp_Object fontset = FONTSET_FROM_ID (id);
+ Lisp_Object ascii_slot = FONTSET_ASCII (fontset);
+ Lisp_Object val, font_object;
- /* If there's a realized fontset REALIZED whose parent is FONTSET,
- clear all the elements of REALIZED and free all multibyte faces
- whose fontset is REALIZED. This way, the specified character(s)
- are surely redisplayed by a correct font. */
- for (id = 0; id < ASIZE (Vfontset_table); id++)
+ if (CONSP (ascii_slot))
{
- realized = AREF (Vfontset_table, id);
- if (!NILP (realized)
- && !BASE_FONTSET_P (realized)
- && EQ (FONTSET_BASE (realized), fontset))
+ Lisp_Object ascii_font_name = XCAR (ascii_slot);
+
+ font_object = Qnil;
+ for (val = XCDR (ascii_slot); ! NILP (val); val = XCDR (val))
{
- FRAME_PTR f = XFRAME (FONTSET_FRAME (realized));
- clear_fontset_elements (realized);
- free_realized_multibyte_face (f, id);
+ Lisp_Object frame = font_get_frame (XCAR (val));
+
+ if (NILP (frame) || XFRAME (frame) == f)
+ {
+ font_object = XCAR (val);
+ if (XSAVE_VALUE (font_object)->integer == 0)
+ {
+ font_object = font_open_by_name (f, SDATA (ascii_font_name));
+ XSETCAR (val, font_object);
+ }
+ break;
+ }
+ }
+ if (NILP (font_object))
+ {
+ font_object = font_open_by_name (f, SDATA (ascii_font_name));
+ XSETCDR (ascii_slot, Fcons (font_object, XCDR (ascii_slot)));
}
}
-
- return Qnil;
+ else
+ {
+ font_object = font_open_by_name (f, SDATA (ascii_slot));
+ FONTSET_ASCII (fontset) = Fcons (ascii_slot, Fcons (font_object, Qnil));
+ }
+ if (NILP (font_object))
+ return NULL;
+ return XSAVE_VALUE (font_object)->pointer;
}
+#endif /* USE_FONT_BACKEND */
+
DEFUN ("font-info", Ffont_info, Sfont_info, 1, 2, 0,
doc: /* Return information about a font named NAME on frame FRAME.
If FRAME is omitted or nil, use the selected frame.
@@ -1231,6 +1979,7 @@ If the named font is not yet loaded, return nil. */)
FRAME_PTR f;
struct font_info *fontp;
Lisp_Object info;
+ Lisp_Object font_object;
(*check_window_system_func) ();
@@ -1244,6 +1993,17 @@ If the named font is not yet loaded, return nil. */)
if (!query_font_func)
error ("Font query function is not supported");
+#ifdef USE_FONT_BACKEND
+ if (enable_font_backend)
+ {
+ font_object = font_open_by_name (f, SDATA (name));
+ if (NILP (font_object))
+ fontp = NULL;
+ else
+ fontp = (struct font_info *) XSAVE_VALUE (font_object)->pointer;
+ }
+ else
+#endif /* USE_FONT_BACKEND */
fontp = (*query_font_func) (f, SDATA (name));
if (!fontp)
return Qnil;
@@ -1258,6 +2018,10 @@ If the named font is not yet loaded, return nil. */)
XVECTOR (info)->contents[5] = make_number (fontp->relative_compose);
XVECTOR (info)->contents[6] = make_number (fontp->default_ascent);
+#ifdef USE_FONT_BACKEND
+ if (! NILP (font_object))
+ font_close_object (f, font_object);
+#endif /* USE_FONT_BACKEND */
return info;
}
@@ -1296,20 +2060,24 @@ DEFUN ("internal-char-font", Finternal_char_font, Sinternal_char_font, 1, 2, 0,
{
int pos, pos_byte, dummy;
int face_id;
- int c, code;
+ int c;
struct frame *f;
struct face *face;
+ Lisp_Object charset, rfont_def;
+ int cs_id;
if (NILP (position))
{
- CHECK_NATNUM (ch);
+ CHECK_CHARACTER (ch);
c = XINT (ch);
f = XFRAME (selected_frame);
face_id = DEFAULT_FACE_ID;
+ pos = -1;
+ cs_id = -1;
}
else
{
- Lisp_Object window;
+ Lisp_Object window, charset;
struct window *w;
CHECK_NUMBER_COERCE_MARKER (position);
@@ -1330,231 +2098,254 @@ DEFUN ("internal-char-font", Finternal_char_font, Sinternal_char_font, 1, 2, 0,
w = XWINDOW (window);
f = XFRAME (w->frame);
face_id = face_at_buffer_position (w, pos, -1, -1, &dummy, pos + 100, 0);
+ charset = Fget_char_property (position, Qcharset, Qnil);
+ if (CHARSETP (charset))
+ cs_id = XINT (CHARSET_SYMBOL_ID (charset));
+ else
+ cs_id = -1;
}
if (! CHAR_VALID_P (c, 0))
return Qnil;
- face_id = FACE_FOR_CHAR (f, FACE_FROM_ID (f, face_id), c);
+ face_id = FACE_FOR_CHAR (f, FACE_FROM_ID (f, face_id), c, pos, Qnil);
face = FACE_FROM_ID (f, face_id);
- if (! face->font || ! face->font_name)
- return Qnil;
-
- {
- struct font_info *fontp = (*get_font_info_func) (f, face->font_info_id);
- XChar2b char2b;
- int c1, c2, charset;
-
- SPLIT_CHAR (c, charset, c1, c2);
- if (c2 > 0)
- STORE_XCHAR2B (&char2b, c1, c2);
- else
- STORE_XCHAR2B (&char2b, 0, c1);
- FRAME_RIF (f)->encode_char (c, &char2b, fontp, NULL);
- code = (XCHAR2B_BYTE1 (&char2b) << 8) | XCHAR2B_BYTE2 (&char2b);
- }
- return Fcons (build_string (face->font_name), make_number (code));
+ rfont_def = fontset_font (FONTSET_FROM_ID (face->fontset), c, face, cs_id);
+#ifdef USE_FONT_BACKEND
+ if (enable_font_backend)
+ {
+ if (VECTORP (rfont_def) && ! NILP (AREF (rfont_def, 4)))
+ {
+ Lisp_Object font_object = AREF (rfont_def, 4);
+ struct font *font = XSAVE_VALUE (font_object)->pointer;
+ unsigned code = font->driver->encode_char (font, c);
+ Lisp_Object fontname = font_get_name (font_object);
+
+ if (code == FONT_INVALID_CODE)
+ return Fcons (fontname, Qnil);
+ if (code <= MOST_POSITIVE_FIXNUM)
+ return Fcons (fontname, make_number (code));
+ return Fcons (fontname, Fcons (make_number (code >> 16),
+ make_number (code & 0xFFFF)));
+ }
+ return Qnil;
+ }
+#endif /* USE_FONT_BACKEND */
+ if (VECTORP (rfont_def) && STRINGP (AREF (rfont_def, 3)))
+ {
+ Lisp_Object font_def;
+ struct font_info *fontp;
+ struct charset *charset;
+ XChar2b char2b;
+ int code;
+
+ font_def = AREF (rfont_def, 2);
+ charset = CHARSET_FROM_ID (XINT (AREF (font_def, 1)));
+ code = ENCODE_CHAR (charset, c);
+ if (code == CHARSET_INVALID_CODE (charset))
+ return (Fcons (AREF (rfont_def, 3), Qnil));
+ STORE_XCHAR2B (&char2b, ((code >> 8) & 0xFF), (code & 0xFF));
+ fontp = (*get_font_info_func) (f, XINT (AREF (rfont_def, 1)));
+ rif->encode_char (c, &char2b, fontp, charset, NULL);
+ code = (XCHAR2B_BYTE1 (&char2b) << 8) | XCHAR2B_BYTE2 (&char2b);
+ return (Fcons (AREF (rfont_def, 3), make_number (code)));
+ }
+ return Qnil;
}
-/* Called from Ffontset_info via map_char_table on each leaf of
- fontset. ARG is a copy of the default fontset. The current leaf
- is indexed by CHARACTER and has value ELT. This function override
- the copy by ELT if ELT is not nil. */
-
-static void
-override_font_info (fontset, character, elt)
- Lisp_Object fontset, character, elt;
-{
- if (! NILP (elt))
- Faset (fontset, character, elt);
-}
+DEFUN ("fontset-info", Ffontset_info, Sfontset_info, 1, 2, 0,
+ doc: /* Return information about a fontset FONTSET on frame FRAME.
+The value is a char-table of which elements has this form.
-/* Called from Ffontset_info via map_char_table on each leaf of
- fontset. ARG is a list (LAST FONT-INFO ...), where LAST is `(last
- ARG)' and FONT-INFOs have this form:
- (CHAR FONT-SPEC) or ((FROM . TO) FONT-SPEC)
- The current leaf is indexed by CHARACTER and has value ELT. This
- function add the information of the current leaf to ARG by
- appending a new element or modifying the last element. */
+ ((FONT-PATTERN OPENED-FONT ...) ...)
-static void
-accumulate_font_info (arg, character, elt)
- Lisp_Object arg, character, elt;
-{
- Lisp_Object last, last_char, last_elt;
+FONT-PATTERN is a vector:
- if (!CONSP (elt) && !SINGLE_BYTE_CHAR_P (XINT (character)))
- elt = FONTSET_REF (Vdefault_fontset, XINT (character));
- if (!CONSP (elt))
- return;
- last = XCAR (arg);
- last_char = XCAR (XCAR (last));
- last_elt = XCAR (XCDR (XCAR (last)));
- elt = XCDR (elt);
- if (!NILP (Fequal (elt, last_elt)))
- {
- int this_charset = CHAR_CHARSET (XINT (character));
+ [ FAMILY WEIGHT SLANT SWIDTH ADSTYLE REGISTRY ]
- if (CONSP (last_char)) /* LAST_CHAR == (FROM . TO) */
- {
- if (this_charset == CHAR_CHARSET (XINT (XCAR (last_char))))
- {
- XSETCDR (last_char, character);
- return;
- }
- }
- else if (XINT (last_char) == XINT (character))
- return;
- else if (this_charset == CHAR_CHARSET (XINT (last_char)))
- {
- XSETCAR (XCAR (last), Fcons (last_char, character));
- return;
- }
- }
- XSETCDR (last, Fcons (Fcons (character, Fcons (elt, Qnil)), Qnil));
- XSETCAR (arg, XCDR (last));
-}
+or a string of font name pattern.
+OPENED-FONT is a name of a font actually opened.
-DEFUN ("fontset-info", Ffontset_info, Sfontset_info, 1, 2, 0,
- doc: /* Return information about a fontset named NAME on frame FRAME.
-If NAME is nil, return information about the default fontset.
-The value is a vector:
- [ SIZE HEIGHT ((CHARSET-OR-RANGE FONT-SPEC OPENED ...) ...) ],
-where,
- SIZE is the maximum bound width of ASCII font in the fontset,
- HEIGHT is the maximum bound height of ASCII font in the fontset,
- CHARSET-OR-RANGE is a charset, a character (may be a generic character)
- or a cons of two characters specifying the range of characters.
- FONT-SPEC is a fontname pattern string or a cons (FAMILY . REGISTRY),
- where FAMILY is a `FAMILY' field of a XLFD font name,
- REGISTRY is a `CHARSET_REGISTRY' field of a XLFD font name.
- FAMILY may contain a `FOUNDRY' field at the head.
- REGISTRY may contain a `CHARSET_ENCODING' field at the tail.
- OPENEDs are names of fonts actually opened.
-If the ASCII font is not yet opened, SIZE and HEIGHT are 0.
-If FRAME is omitted, it defaults to the currently selected frame. */)
- (name, frame)
- Lisp_Object name, frame;
+The char-table has one extra slot. The value is a char-table
+containing the information about the derived fonts from the default
+fontset. The format is the same as abobe. */)
+ (fontset, frame)
+ Lisp_Object fontset, frame;
{
- Lisp_Object fontset;
FRAME_PTR f;
- int indices[3];
- Lisp_Object val, tail, elt;
- Lisp_Object *realized;
- struct font_info *fontp = NULL;
- int n_realized = 0;
- int i;
+ Lisp_Object *realized[2], fontsets[2], tables[2];
+ Lisp_Object val, elt;
+ int c, i, j, k;
(*check_window_system_func) ();
- fontset = check_fontset_name (name);
+ fontset = check_fontset_name (fontset);
if (NILP (frame))
frame = selected_frame;
CHECK_LIVE_FRAME (frame);
f = XFRAME (frame);
- /* Recode realized fontsets whose base is FONTSET in the table
- `realized'. */
- realized = (Lisp_Object *) alloca (sizeof (Lisp_Object)
- * ASIZE (Vfontset_table));
- for (i = 0; i < ASIZE (Vfontset_table); i++)
+ /* Recode fontsets realized on FRAME from the base fontset FONTSET
+ in the table `realized'. */
+ realized[0] = (Lisp_Object *) alloca (sizeof (Lisp_Object)
+ * ASIZE (Vfontset_table));
+ for (i = j = 0; i < ASIZE (Vfontset_table); i++)
{
elt = FONTSET_FROM_ID (i);
if (!NILP (elt)
- && EQ (FONTSET_BASE (elt), fontset))
- realized[n_realized++] = elt;
+ && EQ (FONTSET_BASE (elt), fontset)
+ && EQ (FONTSET_FRAME (elt), frame))
+ realized[0][j++] = elt;
}
+ realized[0][j] = Qnil;
- if (! EQ (fontset, Vdefault_fontset))
+ realized[1] = (Lisp_Object *) alloca (sizeof (Lisp_Object)
+ * ASIZE (Vfontset_table));
+ for (i = j = 0; ! NILP (realized[0][i]); i++)
{
- /* Merge FONTSET onto the default fontset. */
- val = Fcopy_sequence (Vdefault_fontset);
- map_char_table (override_font_info, Qnil, fontset, fontset, val, 0, indices);
- fontset = val;
+ elt = FONTSET_DEFAULT (realized[0][i]);
+ if (! NILP (elt))
+ realized[1][j++] = elt;
}
+ realized[1][j] = Qnil;
+
+ tables[0] = Fmake_char_table (Qfontset_info, Qnil);
+ tables[1] = Fmake_char_table (Qnil, Qnil);
+ XCHAR_TABLE (tables[0])->extras[0] = tables[1];
+ fontsets[0] = fontset;
+ fontsets[1] = Vdefault_fontset;
- /* Accumulate information of the fontset in VAL. The format is
- (LAST FONT-INFO FONT-INFO ...), where FONT-INFO is (CHAR-OR-RANGE
- FONT-SPEC). See the comment for accumulate_font_info for the
- detail. */
- val = Fcons (Fcons (make_number (0),
- Fcons (XCDR (FONTSET_ASCII (fontset)), Qnil)),
- Qnil);
- val = Fcons (val, val);
- map_char_table (accumulate_font_info, Qnil, fontset, fontset, val, 0, indices);
- val = XCDR (val);
-
- /* For each FONT-INFO, if CHAR_OR_RANGE (car part) is a generic
- character for a charset, replace it with the charset symbol. If
- fonts are opened for FONT-SPEC, append the names of the fonts to
- FONT-SPEC. */
- for (tail = val; CONSP (tail); tail = XCDR (tail))
+ /* Accumulate information of the fontset in TABLE. The format of
+ each element is ((FONT-SPEC OPENED-FONT ...) ...). */
+ for (k = 0; k <= 1; k++)
{
- int c;
- elt = XCAR (tail);
- if (INTEGERP (XCAR (elt)))
+ for (c = 0; c <= MAX_CHAR; )
{
- int charset, c1, c2;
- c = XINT (XCAR (elt));
- SPLIT_CHAR (c, charset, c1, c2);
- if (c1 == 0)
- XSETCAR (elt, CHARSET_SYMBOL (charset));
- }
- else
- c = XINT (XCAR (XCAR (elt)));
- for (i = 0; i < n_realized; i++)
- {
- Lisp_Object face_id, font;
- struct face *face;
+ int from, to;
- face_id = FONTSET_REF_VIA_BASE (realized[i], c);
- if (INTEGERP (face_id))
+ if (c <= MAX_5_BYTE_CHAR)
+ {
+ val = char_table_ref_and_range (fontsets[k], c, &from, &to);
+ if (to > MAX_5_BYTE_CHAR)
+ to = MAX_5_BYTE_CHAR;
+ }
+ else
{
- face = FACE_FROM_ID (f, XINT (face_id));
- if (face && face->font && face->font_name)
+ val = FONTSET_FALLBACK (fontsets[k]);
+ to = MAX_CHAR;
+ }
+ if (VECTORP (val))
+ {
+ Lisp_Object alist;
+
+ /* At first, set ALIST to ((FONT-SPEC) ...). */
+ for (alist = Qnil, i = 0; i < ASIZE (val); i++)
+ alist = Fcons (Fcons (AREF (AREF (val, i), 0), Qnil), alist);
+ alist = Fnreverse (alist);
+
+ /* Then store opend font names to cdr of each elements. */
+ for (i = 0; ! NILP (realized[k][i]); i++)
{
- font = build_string (face->font_name);
- if (NILP (Fmember (font, XCDR (XCDR (elt)))))
- XSETCDR (XCDR (elt), Fcons (font, XCDR (XCDR (elt))));
+ if (c <= MAX_5_BYTE_CHAR)
+ val = FONTSET_REF (realized[k][i], c);
+ else
+ val = FONTSET_FALLBACK (realized[k][i]);
+ if (! VECTORP (val))
+ continue;
+ /* VAL is [int int ?
+ [FACE-ID FONT-INDEX FONT-DEF FONT-NAME] ...].
+ If a font of an element is already opened,
+ FONT-NAME is the name of a opened font. */
+ for (j = 3; j < ASIZE (val); j++)
+ if (STRINGP (AREF (AREF (val, j), 3)))
+ {
+ Lisp_Object font_idx;
+
+ font_idx = AREF (AREF (val, j), 1);
+ elt = Fassq (AREF (AREF (AREF (val, j), 2), 0), alist);
+ if (CONSP (elt)
+ && NILP (Fmemq (font_idx, XCDR(elt))))
+ nconc2 (elt, Fcons (font_idx, Qnil));
+ }
}
+ for (val = alist; CONSP (val); val = XCDR (val))
+ for (elt = XCDR (XCAR (val)); CONSP (elt); elt = XCDR (elt))
+ {
+ struct font_info *font_info
+ = (*get_font_info_func) (f, XINT (XCAR (elt)));
+ XSETCAR (elt, build_string (font_info->full_name));
+ }
+
+ /* Store ALIST in TBL for characters C..TO. */
+ if (c <= MAX_5_BYTE_CHAR)
+ char_table_set_range (tables[k], c, to, alist);
+ else
+ XCHAR_TABLE (tables[k])->defalt = alist;
}
+ c = to + 1;
}
}
- elt = Fcdr (Fcdr (Fassq (CHARSET_SYMBOL (CHARSET_ASCII), val)));
- if (CONSP (elt))
- {
- elt = XCAR (elt);
- fontp = (*query_font_func) (f, SDATA (elt));
- }
- val = Fmake_vector (make_number (3), val);
- AREF (val, 0) = fontp ? make_number (fontp->size) : make_number (0);
- AREF (val, 1) = fontp ? make_number (fontp->height) : make_number (0);
- return val;
+ return tables[0];
}
-DEFUN ("fontset-font", Ffontset_font, Sfontset_font, 2, 2, 0,
+
+DEFUN ("fontset-font", Ffontset_font, Sfontset_font, 2, 3, 0,
doc: /* Return a font name pattern for character CH in fontset NAME.
-If NAME is nil, find a font name pattern in the default fontset. */)
- (name, ch)
- Lisp_Object name, ch;
+If NAME is t, find a pattern in the default fontset.
+
+The value has the form (FAMILY . REGISTRY), where FAMILY is a font
+family name and REGISTRY is a font registry name. This is actually
+the first font name pattern for CH in the fontset or in the default
+fontset.
+
+If the 2nd optional arg ALL is non-nil, return a list of all font name
+patterns. */)
+ (name, ch, all)
+ Lisp_Object name, ch, all;
{
int c;
- Lisp_Object fontset, elt;
+ Lisp_Object fontset, elt, list, repertory, val;
+ int i, j;
fontset = check_fontset_name (name);
- CHECK_NUMBER (ch);
+ CHECK_CHARACTER (ch);
c = XINT (ch);
- if (!char_valid_p (c, 1))
- invalid_character (c);
-
- elt = FONTSET_REF (fontset, c);
- if (CONSP (elt))
- elt = XCDR (elt);
+ list = Qnil;
+ while (1)
+ {
+ for (i = 0, elt = FONTSET_REF (fontset, c); i < 2;
+ i++, elt = FONTSET_FALLBACK (fontset))
+ if (VECTORP (elt))
+ for (j = 0; j < ASIZE (elt); j++)
+ {
+ val = AREF (elt, j);
+ repertory = AREF (val, 1);
+ if (INTEGERP (repertory))
+ {
+ struct charset *charset = CHARSET_FROM_ID (XINT (repertory));
- return elt;
+ if (! CHAR_CHARSET_P (c, charset))
+ continue;
+ }
+ else if (CHAR_TABLE_P (repertory))
+ {
+ if (NILP (CHAR_TABLE_REF (repertory, c)))
+ continue;
+ }
+ val = AREF (val, 0);
+ val = Fcons (AREF (val, 0), AREF (val, 5));
+ if (NILP (all))
+ return val;
+ list = Fcons (val, list);
+ }
+ if (EQ (fontset, Vdefault_fontset))
+ break;
+ fontset = Vdefault_fontset;
+ }
+ return (Fnreverse (list));
}
DEFUN ("fontset-list", Ffontset_list, Sfontset_list, 0, 0, 0,
@@ -1576,62 +2367,58 @@ DEFUN ("fontset-list", Ffontset_list, Sfontset_list, 0, 0, 0,
return list;
}
-DEFUN ("set-overriding-fontspec-internal", Fset_overriding_fontspec_internal,
- Sset_overriding_fontspec_internal, 1, 1, 0,
- doc: /* Internal use only.
-
-FONTLIST is an alist of TARGET vs FONTNAME, where TARGET is a charset
-or a char-table, FONTNAME have the same meanings as in
-`set-fontset-font'.
-
-It overrides the font specifications for each TARGET in the default
-fontset by the corresponding FONTNAME.
-If TARGET is a charset, targets are all characters in the charset. If
-TARGET is a char-table, targets are characters whose value is non-nil
-in the table.
+#ifdef FONTSET_DEBUG
-It is intended that this function is called only from
-`set-language-environment'. */)
- (fontlist)
- Lisp_Object fontlist;
+Lisp_Object
+dump_fontset (fontset)
+ Lisp_Object fontset;
{
- Lisp_Object tail;
+ Lisp_Object vec;
+
+ vec = Fmake_vector (make_number (3), Qnil);
+ ASET (vec, 0, FONTSET_ID (fontset));
- fontlist = Fcopy_sequence (fontlist);
- /* Now FONTLIST is ((TARGET . FONTNAME) ...). Reform it to ((TARGET
- nil nil nil FONTSPEC) ...), where TARGET is a charset-id or a
- char-table. */
- for (tail = fontlist; CONSP (tail); tail = XCDR (tail))
+ if (BASE_FONTSET_P (fontset))
{
- Lisp_Object elt, target;
+ ASET (vec, 1, FONTSET_NAME (fontset));
+ }
+ else
+ {
+ Lisp_Object frame;
- elt = XCAR (tail);
- target = Fcar (elt);
- elt = Fcons (Qnil, regularize_fontname (Fcdr (elt)));
- if (! CHAR_TABLE_P (target))
+ frame = FONTSET_FRAME (fontset);
+ if (FRAMEP (frame))
{
- int charset, c;
-
- CHECK_SYMBOL (target);
- charset = get_charset_id (target);
- if (charset < 0)
- error ("Invalid charset %s", SDATA (SYMBOL_NAME (target)));
- target = make_number (charset);
- c = MAKE_CHAR (charset, 0, 0);
- XSETCAR (elt, make_number (c));
+ FRAME_PTR f = XFRAME (frame);
+
+ if (FRAME_LIVE_P (f))
+ ASET (vec, 1,
+ Fcons (FONTSET_NAME (FONTSET_BASE (fontset)), f->name));
+ else
+ ASET (vec, 1,
+ Fcons (FONTSET_NAME (FONTSET_BASE (fontset)), Qnil));
}
- elt = Fcons (target, Fcons (Qnil, Fcons (Qnil, elt)));
- XSETCAR (tail, elt);
+ if (!NILP (FONTSET_DEFAULT (fontset)))
+ ASET (vec, 2, FONTSET_ID (FONTSET_DEFAULT (fontset)));
}
- if (! NILP (Fequal (fontlist, Voverriding_fontspec_alist)))
- return Qnil;
- Voverriding_fontspec_alist = fontlist;
- clear_face_cache (0);
- ++windows_or_buffers_changed;
- return Qnil;
+ return vec;
}
+DEFUN ("fontset-list-all", Ffontset_list_all, Sfontset_list_all, 0, 0, 0,
+ doc: /* Return a brief summary of all fontsets for debug use. */)
+ ()
+{
+ Lisp_Object val;
+ int i;
+
+ for (i = 0, val = Qnil; i < ASIZE (Vfontset_table); i++)
+ if (! NILP (AREF (Vfontset_table, i)))
+ val = Fcons (dump_fontset (AREF (Vfontset_table, i)), val);
+ return (Fnreverse (val));
+}
+#endif /* FONTSET_DEBUG */
+
void
syms_of_fontset ()
{
@@ -1639,9 +2426,14 @@ syms_of_fontset ()
/* Window system initializer should have set proper functions. */
abort ();
- Qfontset = intern ("fontset");
- staticpro (&Qfontset);
- Fput (Qfontset, Qchar_table_extra_slots, make_number (3));
+ DEFSYM (Qfontset, "fontset");
+ Fput (Qfontset, Qchar_table_extra_slots, make_number (9));
+ DEFSYM (Qfontset_info, "fontset-info");
+ Fput (Qfontset_info, Qchar_table_extra_slots, make_number (1));
+
+ DEFSYM (Qprepend, "prepend");
+ DEFSYM (Qappend, "append");
+ DEFSYM (Qlatin, "latin");
Vcached_fontset_data = Qnil;
staticpro (&Vcached_fontset_data);
@@ -1657,32 +2449,31 @@ syms_of_fontset ()
AREF (Vfontset_table, 0) = Vdefault_fontset;
next_fontset_id = 1;
- Voverriding_fontspec_alist = Qnil;
- staticpro (&Voverriding_fontspec_alist);
+ auto_fontset_alist = Qnil;
+ staticpro (&auto_fontset_alist);
DEFVAR_LISP ("font-encoding-alist", &Vfont_encoding_alist,
- doc: /* Alist of fontname patterns vs corresponding encoding info.
-Each element looks like (REGEXP . ENCODING-INFO),
- where ENCODING-INFO is an alist of CHARSET vs ENCODING.
-ENCODING is one of the following integer values:
- 0: code points 0x20..0x7F or 0x2020..0x7F7F are used,
- 1: code points 0xA0..0xFF or 0xA0A0..0xFFFF are used,
- 2: code points 0x20A0..0x7FFF are used,
- 3: code points 0xA020..0xFF7F are used. */);
+ doc: /*
+Alist of fontname patterns vs the corresponding encoding and repertory info.
+Each element looks like (REGEXP . (ENCODING . REPERTORY)),
+where ENCODING is a charset or a char-table,
+and REPERTORY is a charset, a char-table, or nil.
+
+ENCODING is for converting a character to a glyph code of the font.
+If ENCODING is a charset, encoding a character by the charset gives
+the corresponding glyph code. If ENCODING is a char-table, looking up
+the table by a character gives the corresponding glyph code.
+
+REPERTORY specifies a repertory of characters supported by the font.
+If REPERTORY is a charset, all characters beloging to the charset are
+supported. If REPERTORY is a char-table, all characters who have a
+non-nil value in the table are supported. It REPERTORY is nil, Emacs
+gets the repertory information by an opened font and ENCODING. */);
Vfont_encoding_alist = Qnil;
- Vfont_encoding_alist
- = Fcons (Fcons (build_string ("JISX0201"),
- Fcons (Fcons (intern ("latin-jisx0201"), make_number (0)),
- Qnil)),
- Vfont_encoding_alist);
- Vfont_encoding_alist
- = Fcons (Fcons (build_string ("ISO8859-1"),
- Fcons (Fcons (intern ("ascii"), make_number (0)),
- Qnil)),
- Vfont_encoding_alist);
DEFVAR_LISP ("use-default-ascent", &Vuse_default_ascent,
- doc: /* Char table of characters whose ascent values should be ignored.
+ doc: /*
+Char table of characters whose ascent values should be ignored.
If an entry for a character is non-nil, the ascent value of the glyph
is assumed to be what specified by _MULE_DEFAULT_ASCENT property of a font.
@@ -1691,7 +2482,8 @@ such a character is displayed on screen. */);
Vuse_default_ascent = Qnil;
DEFVAR_LISP ("ignore-relative-composition", &Vignore_relative_composition,
- doc: /* Char table of characters which is not composed relatively.
+ doc: /*
+Char table of characters which is not composed relatively.
If an entry for a character is non-nil, a composition sequence
which contains that character is displayed so that
the glyph of that character is put without considering
@@ -1717,6 +2509,10 @@ When a character is displayed with such fonts, the character is displayed
at the vertical center of lines. */);
Vvertical_centering_font_regexp = Qnil;
+ DEFVAR_LISP ("otf-script-alist", &Votf_script_alist,
+ doc: /* Alist of OpenType script tags vs the corresponding script names. */);
+ Votf_script_alist = Qnil;
+
defsubr (&Squery_fontset);
defsubr (&Snew_fontset);
defsubr (&Sset_fontset_font);
@@ -1725,7 +2521,9 @@ at the vertical center of lines. */);
defsubr (&Sfontset_info);
defsubr (&Sfontset_font);
defsubr (&Sfontset_list);
- defsubr (&Sset_overriding_fontspec_internal);
+#ifdef FONTSET_DEBUG
+ defsubr (&Sfontset_list_all);
+#endif
}
/* arch-tag: ea861585-2f5f-4e5b-9849-d04a9c3a3537
diff --git a/src/fontset.h b/src/fontset.h
index c8bd1e36ea..353f01b27b 100644
--- a/src/fontset.h
+++ b/src/fontset.h
@@ -5,6 +5,9 @@
2005, 2006, 2007
National Institute of Advanced Industrial Science and Technology (AIST)
Registration Number H14PRO021
+ Copyright (C) 2003, 2006
+ National Institute of Advanced Industrial Science and Technology (AIST)
+ Registration Number H13PRO009
This file is part of GNU Emacs.
@@ -44,7 +47,8 @@ struct font_info
/* Full name of the font given by a window system. */
char *full_name;
- /* Charset of characters displayed by the font. */
+ /* Charset to encode a character code into a glyph code of the
+ font. */
int charset;
#ifdef WINDOWSNT
@@ -71,25 +75,15 @@ struct font_info
of lines. */
int vertical_centering;
- /* Encodings of the font indexed by CHARSET. The value is one of
+ /* Encoding type of the font. The value is one of
0, 1, 2, or 3:
0: code points 0x20..0x7F or 0x2020..0x7F7F are used
1: code points 0xA0..0xFF or 0xA0A0..0xFFFF are used
2: code points 0x20A0..0x7FFF are used
3: code points 0xA020..0xFF7F are used
- For instance, ASCII and Latin-1 characters may use the same font
- but different code points (ASCII uses 0x20..0x7F and Latin-1 uses
- 0xA0..0xFF).
-
- If the value can't be decided from information of the font, we
- consult `font-encoding-alist' to get of the corresponding charset
- whose default value is defined in lisp/fontset.el. Since there's
- no charset whose id is 1, we use encoding[1] to store the
- encoding information decided by the font itself.
-
If the member `font_encoder' is not NULL, this member is ignored.
*/
- unsigned char encoding[MAX_CHARSET + 1];
+ unsigned char encoding_type;
/* The baseline position of a font is normally `ascent' value of the
font. However, there exists many fonts which don't set `ascent'
@@ -149,6 +143,17 @@ struct font_info
to be used. */
#define FONT_ENCODING_NOT_DECIDED 255
+enum FONT_SPEC_INDEX
+ {
+ FONT_SPEC_FAMILY_INDEX,
+ FONT_SPEC_WEIGHT_INDEX,
+ FONT_SPEC_SLANT_INDEX,
+ FONT_SPEC_SWIDTH_INDEX,
+ FONT_SPEC_ADSTYLE_INDEX,
+ FONT_SPEC_REGISTRY_INDEX,
+ FONT_SPEC_MAX_INDEX
+ };
+
/* Forward declaration for prototypes. */
struct frame;
@@ -188,43 +193,41 @@ extern void (*set_frame_fontset_func) P_ ((struct frame *f, Lisp_Object arg,
This function set the memer `encoder' of the structure. */
extern void (*find_ccl_program_func) P_ ((struct font_info *));
+extern Lisp_Object (*get_font_repertory_func) P_ ((struct frame *,
+ struct font_info *));
+
/* Check if any window system is used now. */
extern void (*check_window_system_func) P_ ((void));
struct face;
extern void free_face_fontset P_ ((FRAME_PTR, struct face *));
-extern Lisp_Object fontset_font_pattern P_ ((FRAME_PTR, int, int));
+extern Lisp_Object fontset_font_pattern P_ ((FRAME_PTR, struct face *, int));
extern int face_suitable_for_char_p P_ ((struct face *, int));
-extern int face_for_char P_ ((FRAME_PTR, struct face *, int));
-extern int make_fontset_for_ascii_face P_ ((FRAME_PTR, int));
+extern int face_for_char P_ ((FRAME_PTR, struct face *, int,
+ int, Lisp_Object));
+extern int make_fontset_for_ascii_face P_ ((FRAME_PTR, int, struct face *));
+extern int new_fontset_from_font_name P_ ((Lisp_Object));
extern void set_default_ascii_font P_ ((Lisp_Object));
-extern struct font_info *fs_load_font P_ ((struct frame *, int, char *, int,
- struct face *));
+extern struct font_info *fs_load_font P_ ((struct frame *, char *, int));
extern int fs_query_fontset P_ ((Lisp_Object, int));
EXFUN (Fquery_fontset, 2);
extern Lisp_Object list_fontsets P_ ((struct frame *, Lisp_Object, int));
-extern Lisp_Object Qfontset;
extern Lisp_Object Vuse_default_ascent;
extern Lisp_Object Vignore_relative_composition;
extern Lisp_Object Valternate_fontname_alist;
extern Lisp_Object Vfontset_alias_alist;
extern Lisp_Object Vvertical_centering_font_regexp;
+extern Lisp_Object Votf_script_alist;
-/* Load a font named FONTNAME for displaying character C. All fonts
- for frame F is stored in a table pointed by FONT_TABLE. Return a
- pointer to the struct font_info of the loaded font. If loading
- fails, return 0; If FONTNAME is NULL, the name is taken from the
- information of FONTSET. If FONTSET is given, try to load a font
- whose size matches that of FONTSET, and, the font index is stored
- in the table for FONTSET. */
+/* Load a font named FONTNAME on frame F. All fonts for frame F is
+ stored in a table pointed by FONT_TABLE. Return a pointer to the
+ struct font_info of the loaded font. If loading fails, return
+ NULL. */
-#define FS_LOAD_FONT(f, c, fontname, fontset) \
- fs_load_font (f, c, fontname, fontset, NULL)
+#define FS_LOAD_FONT(f, fontname) fs_load_font (f, fontname, -1)
-#define FS_LOAD_FACE_FONT(f, c, fontname, face) \
- fs_load_font (f, c, fontname, -1, face)
/* Return an immutable id for font_info FONT_INFO on frame F. The
reason for this macro is hat one cannot hold pointers to font_info
@@ -242,10 +245,26 @@ extern Lisp_Object Vvertical_centering_font_regexp;
? (FRAME_X_DISPLAY_INFO ((F))->font_table + (ID)) \
: 0)
+#ifdef USE_FONT_BACKEND
+#define FONT_INFO_FROM_FACE(F, FACE) \
+ (enable_font_backend ? (FACE)->font_info \
+ : FONT_INFO_FROM_ID ((F), (FACE)->font_info_id))
+#else /* not USE_FONT_BACKEND */
+#define FONT_INFO_FROM_FACE(F, FACE) \
+ FONT_INFO_FROM_ID ((F), (FACE)->font_info_id)
+#endif /* not USE_FONT_BACKEND */
+
extern Lisp_Object fontset_name P_ ((int));
extern Lisp_Object fontset_ascii P_ ((int));
extern int fontset_height P_ ((int));
+#ifdef USE_FONT_BACKEND
+struct font;
+extern int face_for_font P_ ((struct frame *, struct font *, struct face *));
+extern int new_fontset_from_font P_ ((Lisp_Object));
+extern struct font *fontset_ascii_font P_ ((FRAME_PTR, int));
+#endif /* USE_FONT_BACKEND */
+
#endif /* EMACS_FONTSET_H */
/* arch-tag: c27cef7b-3cab-488a-8398-7a4daa96bb77
diff --git a/src/frame.c b/src/frame.c
index 3709b00dfd..7f89adb66d 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -23,7 +23,7 @@ Boston, MA 02110-1301, USA. */
#include <stdio.h>
#include "lisp.h"
-#include "charset.h"
+#include "character.h"
#ifdef HAVE_X_WINDOWS
#include "xterm.h"
#endif
@@ -42,7 +42,6 @@ Boston, MA 02110-1301, USA. */
#include "fontset.h"
#endif
#include "blockinput.h"
-#include "termchar.h"
#include "termhooks.h"
#include "dispextern.h"
#include "window.h"
@@ -54,6 +53,10 @@ Boston, MA 02110-1301, USA. */
#ifdef HAVE_WINDOW_SYSTEM
+#ifdef USE_FONT_BACKEND
+#include "font.h"
+#endif /* USE_FONT_BACKEND */
+
/* The name we're using in resource queries. Most often "emacs". */
Lisp_Object Vx_resource_name;
@@ -75,8 +78,6 @@ Lisp_Object Qbackground_mode;
Lisp_Object Qx_frame_parameter;
Lisp_Object Qx_resource_name;
-Lisp_Object Qterminal;
-Lisp_Object Qterminal_live_p;
/* Frame parameters (set or reported). */
@@ -106,30 +107,29 @@ Lisp_Object Qtitle, Qname;
Lisp_Object Qunsplittable;
Lisp_Object Qmenu_bar_lines, Qtool_bar_lines;
Lisp_Object Qleft_fringe, Qright_fringe;
-Lisp_Object Qbuffer_predicate, Qbuffer_list, Qburied_buffer_list;
+Lisp_Object Qbuffer_predicate, Qbuffer_list;
Lisp_Object Qtty_color_mode;
-Lisp_Object Qtty, Qtty_type;
-Lisp_Object Qwindow_system;
-Lisp_Object Qenvironment;
Lisp_Object Qfullscreen, Qfullwidth, Qfullheight, Qfullboth;
+#ifdef USE_FONT_BACKEND
+Lisp_Object Qfont_backend;
+#endif /* USE_FONT_BACKEND */
Lisp_Object Qinhibit_face_set_after_frame_default;
Lisp_Object Qface_set_after_frame_default;
+
Lisp_Object Vterminal_frame;
Lisp_Object Vdefault_frame_alist;
Lisp_Object Vdefault_frame_scroll_bars;
Lisp_Object Vmouse_position_function;
Lisp_Object Vmouse_highlight;
Lisp_Object Vdelete_frame_functions;
-
-int focus_follows_mouse;
static void
set_menu_bar_lines_1 (window, n)
- Lisp_Object window;
- int n;
+ Lisp_Object window;
+ int n;
{
struct window *w = XWINDOW (window);
@@ -187,6 +187,8 @@ set_menu_bar_lines (f, value, oldval)
Lisp_Object Vemacs_iconified;
Lisp_Object Vframe_list;
+struct x_output tty_display;
+
extern Lisp_Object Vminibuffer_list;
extern Lisp_Object get_minibuffer ();
extern Lisp_Object Fhandle_switch_frame ();
@@ -208,7 +210,6 @@ See also `frame-live-p'. */)
return Qnil;
switch (XFRAME (object)->output_method)
{
- case output_initial: /* The initial frame is like a termcap frame. */
case output_termcap:
return Qt;
case output_x_window:
@@ -227,7 +228,7 @@ See also `frame-live-p'. */)
DEFUN ("frame-live-p", Fframe_live_p, Sframe_live_p, 1, 1, 0,
doc: /* Return non-nil if OBJECT is a frame which has not been deleted.
Value is nil if OBJECT is not a live frame. If object is a live
-frame, the return value indicates what sort of terminal device it is
+frame, the return value indicates what sort of output device it is
displayed on. See the documentation of `framep' for possible
return values. */)
(object)
@@ -239,30 +240,6 @@ return values. */)
: Qnil);
}
-DEFUN ("window-system", Fwindow_system, Swindow_system, 0, 1, 0,
- doc: /* The name of the window system that FRAME is displaying through.
-The value is a symbol---for instance, 'x' for X windows.
-The value is nil if Emacs is using a text-only terminal.
-
-FRAME defaults to the currently selected frame. */)
- (frame)
- Lisp_Object frame;
-{
- Lisp_Object type;
- if (NILP (frame))
- frame = selected_frame;
-
- type = Fframep (frame);
-
- if (NILP (type))
- wrong_type_argument (Qframep, frame);
-
- if (EQ (type, Qt))
- return Qnil;
- else
- return type;
-}
-
struct frame *
make_frame (mini_p)
int mini_p;
@@ -306,7 +283,9 @@ make_frame (mini_p)
f->menu_bar_items_used = 0;
f->buffer_predicate = Qnil;
f->buffer_list = Qnil;
- f->buried_buffer_list = Qnil;
+#ifdef MULTI_KBOARD
+ f->kboard = initial_kboard;
+#endif
f->namebuf = 0;
f->title = Qnil;
f->menu_bar_window = Qnil;
@@ -327,6 +306,9 @@ make_frame (mini_p)
#endif
f->size_hint_flags = 0;
f->win_gravity = 0;
+#ifdef USE_FONT_BACKEND
+ f->font_driver_list = NULL;
+#endif /* USE_FONT_BACKEND */
root_window = make_window ();
if (mini_p)
@@ -426,8 +408,8 @@ make_frame_without_minibuffer (mini_window, kb, display)
#ifdef MULTI_KBOARD
if (!NILP (mini_window)
- && FRAME_KBOARD (XFRAME (XWINDOW (mini_window)->frame)) != kb)
- error ("Frame and minibuffer must be on the same terminal");
+ && XFRAME (XWINDOW (mini_window)->frame)->kboard != kb)
+ error ("Frame and minibuffer must be on the same display");
#endif
/* Make a frame containing just a root window. */
@@ -503,19 +485,18 @@ make_minibuffer_frame ()
}
#endif /* HAVE_WINDOW_SYSTEM */
-/* Construct a frame that refers to a terminal. */
+/* Construct a frame that refers to the terminal (stdin and stdout). */
-static int tty_frame_count;
+static int terminal_frame_count;
struct frame *
-make_initial_frame (void)
+make_terminal_frame ()
{
- struct frame *f;
- struct terminal *terminal;
+ register struct frame *f;
Lisp_Object frame;
+ char name[20];
#ifdef MULTI_KBOARD
- /* Create the initial keyboard. */
if (!initial_kboard)
{
initial_kboard = (KBOARD *) xmalloc (sizeof (KBOARD));
@@ -529,51 +510,13 @@ make_initial_frame (void)
if (! (NILP (Vframe_list) || CONSP (Vframe_list)))
Vframe_list = Qnil;
- terminal = init_initial_terminal ();
-
- f = make_frame (1);
- XSETFRAME (frame, f);
-
- Vframe_list = Fcons (frame, Vframe_list);
-
- tty_frame_count = 1;
- f->name = build_string ("F1");
-
- f->visible = 1;
- f->async_visible = 1;
-
- f->output_method = terminal->type;
- f->terminal = terminal;
- f->terminal->reference_count++;
- f->output_data.nothing = 0;
-
- FRAME_FOREGROUND_PIXEL (f) = FACE_TTY_DEFAULT_FG_COLOR;
- FRAME_BACKGROUND_PIXEL (f) = FACE_TTY_DEFAULT_BG_COLOR;
-
- FRAME_CAN_HAVE_SCROLL_BARS (f) = 0;
- FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_none;
-
- return f;
-}
-
-
-struct frame *
-make_terminal_frame (struct terminal *terminal)
-{
- register struct frame *f;
- Lisp_Object frame;
- char name[20];
-
- if (!terminal->name)
- error ("Terminal is not live, can't create new frames on it");
-
f = make_frame (1);
XSETFRAME (frame, f);
Vframe_list = Fcons (frame, Vframe_list);
- tty_frame_count++;
- sprintf (name, "F%d", tty_frame_count);
+ terminal_frame_count++;
+ sprintf (name, "F%d", terminal_frame_count);
f->name = build_string (name);
f->visible = 1; /* FRAME_SET_VISIBLE wd set frame_garbaged. */
@@ -593,44 +536,30 @@ make_terminal_frame (struct terminal *terminal)
for the black color. Other frames all inherit their pixels
from what's already in the_only_x_display. */
if ((!FRAMEP (selected_frame) || !FRAME_LIVE_P (XFRAME (selected_frame)))
- && FRAME_BACKGROUND_PIXEL (f) == 0
- && FRAME_FOREGROUND_PIXEL (f) == 0)
+ && f->output_data.x->background_pixel == 0
+ && f->output_data.x->foreground_pixel == 0)
{
- FRAME_BACKGROUND_PIXEL (f) = FACE_TTY_DEFAULT_BG_COLOR;
- FRAME_FOREGROUND_PIXEL (f) = FACE_TTY_DEFAULT_FG_COLOR;
+ f->output_data.x->background_pixel = FACE_TTY_DEFAULT_BG_COLOR;
+ f->output_data.x->foreground_pixel = FACE_TTY_DEFAULT_FG_COLOR;
}
}
else
f->output_method = output_termcap;
#else
+#ifdef WINDOWSNT
+ f->output_method = output_termcap;
+ f->output_data.x = &tty_display;
+#else
#ifdef MAC_OS8
make_mac_terminal_frame (f);
#else
- {
- f->output_method = output_termcap;
- f->terminal = terminal;
- f->terminal->reference_count++;
- create_tty_output (f);
-
- FRAME_FOREGROUND_PIXEL (f) = FACE_TTY_DEFAULT_FG_COLOR;
- FRAME_BACKGROUND_PIXEL (f) = FACE_TTY_DEFAULT_BG_COLOR;
-
- FRAME_CAN_HAVE_SCROLL_BARS (f) = 0;
- FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_none;
-
- /* Set the top frame to the newly created frame. */
- if (FRAMEP (FRAME_TTY (f)->top_frame)
- && FRAME_LIVE_P (XFRAME (FRAME_TTY (f)->top_frame)))
- XFRAME (FRAME_TTY (f)->top_frame)->async_visible = 2; /* obscured */
-
- FRAME_TTY (f)->top_frame = frame;
- }
-
+ f->output_data.x = &tty_display;
#ifdef CANNOT_DUMP
FRAME_FOREGROUND_PIXEL(f) = FACE_TTY_DEFAULT_FG_COLOR;
FRAME_BACKGROUND_PIXEL(f) = FACE_TTY_DEFAULT_BG_COLOR;
#endif
#endif /* MAC_OS8 */
+#endif /* WINDOWSNT */
#endif /* MSDOS */
if (!noninteractive)
@@ -639,55 +568,18 @@ make_terminal_frame (struct terminal *terminal)
return f;
}
-/* Get a suitable value for frame parameter PARAMETER for a newly
- created frame, based on (1) the user-supplied frame parameter
- alist SUPPLIED_PARMS, (2) CURRENT_VALUE, and finally, if all else
- fails, (3) Vdefault_frame_alist. */
-
-static Lisp_Object
-get_future_frame_param (Lisp_Object parameter,
- Lisp_Object supplied_parms,
- char *current_value)
-{
- Lisp_Object result;
-
- result = Fassq (parameter, supplied_parms);
- if (NILP (result))
- result = Fassq (parameter, XFRAME (selected_frame)->param_alist);
- if (NILP (result) && current_value != NULL)
- result = build_string (current_value);
- if (NILP (result))
- result = Fassq (parameter, Vdefault_frame_alist);
- if (!NILP (result) && !STRINGP (result))
- result = XCDR (result);
- if (NILP (result) || !STRINGP (result))
- result = Qnil;
-
- return result;
-}
-
DEFUN ("make-terminal-frame", Fmake_terminal_frame, Smake_terminal_frame,
1, 1, 0,
- doc: /* Create an additional terminal frame, possibly on another terminal.
+ doc: /* Create an additional terminal frame.
+You can create multiple frames on a text-only terminal in this way.
+Only the selected terminal frame is actually displayed.
This function takes one argument, an alist specifying frame parameters.
-
-You can create multiple frames on a single text-only terminal, but
-only one of them (the selected terminal frame) is actually displayed.
-
-In practice, generally you don't need to specify any parameters,
-except when you want to create a new frame on another terminal.
-In that case, the `tty' parameter specifies the device file to open,
-and the `tty-type' parameter specifies the terminal type. Example:
-
- (make-terminal-frame '((tty . "/dev/pts/5") (tty-type . "xterm")))
-
-Note that changing the size of one terminal frame automatically
-affects all frames on the same terminal device. */)
+In practice, generally you don't need to specify any parameters.
+Note that changing the size of one terminal frame automatically affects all. */)
(parms)
Lisp_Object parms;
{
struct frame *f;
- struct terminal *t = NULL;
Lisp_Object frame, tem;
struct frame *sf = SELECTED_FRAME ();
@@ -697,84 +589,25 @@ affects all frames on the same terminal device. */)
abort ();
#else /* not MSDOS */
-#if 0 /* #ifdef MAC_OS */
- /* This can happen for multi-tty when using both terminal frames and
- Carbon frames. */
+#ifdef MAC_OS
if (sf->output_method != output_mac)
error ("Not running on a Macintosh screen; cannot make a new Macintosh frame");
#else
-#if 0 /* This should work now! */
if (sf->output_method != output_termcap)
error ("Not using an ASCII terminal now; cannot make a new ASCII frame");
#endif
-#endif
#endif /* not MSDOS */
-
- {
- Lisp_Object terminal;
-
- terminal = Fassq (Qterminal, parms);
- if (!NILP (terminal))
- {
- terminal = XCDR (terminal);
- t = get_terminal (terminal, 1);
- }
- }
-
- if (!t)
- {
- char *name = 0, *type = 0;
- Lisp_Object tty, tty_type;
-
- tty = get_future_frame_param
- (Qtty, parms, (FRAME_TERMCAP_P (XFRAME (selected_frame))
- ? FRAME_TTY (XFRAME (selected_frame))->name
- : NULL));
- if (!NILP (tty))
- {
- name = (char *) alloca (SBYTES (tty) + 1);
- strncpy (name, SDATA (tty), SBYTES (tty));
- name[SBYTES (tty)] = 0;
- }
-
- tty_type = get_future_frame_param
- (Qtty_type, parms, (FRAME_TERMCAP_P (XFRAME (selected_frame))
- ? FRAME_TTY (XFRAME (selected_frame))->type
- : NULL));
- if (!NILP (tty_type))
- {
- type = (char *) alloca (SBYTES (tty_type) + 1);
- strncpy (type, SDATA (tty_type), SBYTES (tty_type));
- type[SBYTES (tty_type)] = 0;
- }
-
- t = init_tty (name, type, 0); /* Errors are not fatal. */
- }
- f = make_terminal_frame (t);
+ f = make_terminal_frame ();
- {
- int width, height;
- get_tty_size (fileno (FRAME_TTY (f)->input), &width, &height);
- change_frame_size (f, height, width, 0, 0, 0);
- }
-
+ change_frame_size (f, FRAME_LINES (sf),
+ FRAME_COLS (sf), 0, 0, 0);
adjust_glyphs (f);
calculate_costs (f);
XSETFRAME (frame, f);
Fmodify_frame_parameters (frame, Vdefault_frame_alist);
Fmodify_frame_parameters (frame, parms);
- Fmodify_frame_parameters (frame, Fcons (Fcons (Qwindow_system, Qnil), Qnil));
- Fmodify_frame_parameters (frame, Fcons (Fcons (Qtty_type,
- build_string (t->display_info.tty->type)),
- Qnil));
- if (t->display_info.tty->name != NULL)
- Fmodify_frame_parameters (frame, Fcons (Fcons (Qtty,
- build_string (t->display_info.tty->name)),
- Qnil));
- else
- Fmodify_frame_parameters (frame, Fcons (Fcons (Qtty, Qnil), Qnil));
-
+
/* Make the frame face alist be frame-specific, so that each
frame could change its face definitions independently. */
f->face_alist = Fcopy_alist (sf->face_alist);
@@ -797,7 +630,7 @@ affects all frames on the same terminal device. */)
frame's focus to FRAME instead.
FOR_DELETION non-zero means that the selected frame is being
- deleted, which includes the possibility that the frame's terminal
+ deleted, which includes the possibility that the frame's display
is dead. */
Lisp_Object
@@ -872,15 +705,6 @@ do_switch_frame (frame, track, for_deletion)
if (!for_deletion && FRAME_HAS_MINIBUF_P (sf))
resize_mini_window (XWINDOW (FRAME_MINIBUF_WINDOW (sf)), 1);
- if (FRAME_TERMCAP_P (XFRAME (selected_frame))
- && FRAME_TERMCAP_P (XFRAME (frame))
- && FRAME_TTY (XFRAME (selected_frame)) == FRAME_TTY (XFRAME (frame)))
- {
- XFRAME (selected_frame)->async_visible = 2; /* obscured */
- XFRAME (frame)->async_visible = 1;
- FRAME_TTY (XFRAME (frame))->top_frame = frame;
- }
-
selected_frame = frame;
if (! FRAME_MINIBUF_ONLY_P (XFRAME (selected_frame)))
last_nonminibuf_frame = XFRAME (selected_frame);
@@ -1064,7 +888,6 @@ If FRAME is the selected frame, this makes WINDOW the selected window. */)
return XFRAME (frame)->selected_window = window;
}
-
DEFUN ("frame-list", Fframe_list, Sframe_list,
0, 0, 0,
@@ -1112,10 +935,7 @@ next_frame (frame, minibuf)
f = XCAR (tail);
if (passed
- && ((!FRAME_TERMCAP_P (XFRAME (f)) && !FRAME_TERMCAP_P (XFRAME (frame))
- && FRAME_KBOARD (XFRAME (f)) == FRAME_KBOARD (XFRAME (frame)))
- || (FRAME_TERMCAP_P (XFRAME (f)) && FRAME_TERMCAP_P (XFRAME (frame))
- && FRAME_TTY (XFRAME (f)) == FRAME_TTY (XFRAME (frame)))))
+ && FRAME_KBOARD (XFRAME (f)) == FRAME_KBOARD (XFRAME (frame)))
{
/* Decide whether this frame is eligible to be returned. */
@@ -1192,10 +1012,7 @@ prev_frame (frame, minibuf)
if (EQ (frame, f) && !NILP (prev))
return prev;
- if ((!FRAME_TERMCAP_P (XFRAME (f)) && !FRAME_TERMCAP_P (XFRAME (frame))
- && FRAME_KBOARD (XFRAME (f)) == FRAME_KBOARD (XFRAME (frame)))
- || (FRAME_TERMCAP_P (XFRAME (f)) && FRAME_TERMCAP_P (XFRAME (frame))
- && FRAME_TTY (XFRAME (f)) == FRAME_TTY (XFRAME (frame))))
+ if (FRAME_KBOARD (XFRAME (f)) == FRAME_KBOARD (XFRAME (frame)))
{
/* Decide whether this frame is eligible to be returned,
according to minibuf. */
@@ -1329,14 +1146,6 @@ other_visible_frames (f)
return 1;
}
-/* Error handler for `delete-frame-functions'. */
-static Lisp_Object
-delete_frame_handler (Lisp_Object arg)
-{
- add_to_log ("Error during `delete-frame': %s", arg, Qnil);
- return Qnil;
-}
-
DEFUN ("delete-frame", Fdelete_frame, Sdelete_frame, 0, 2, "",
doc: /* Delete FRAME, permanently eliminating it from use.
If omitted, FRAME defaults to the selected frame.
@@ -1352,8 +1161,6 @@ The functions are run with one arg, the frame to be deleted. */)
{
struct frame *f;
struct frame *sf = SELECTED_FRAME ();
- struct kboard *kb;
-
int minibuffer_selected;
if (EQ (frame, Qnil))
@@ -1412,22 +1219,11 @@ The functions are run with one arg, the frame to be deleted. */)
&& NILP (Fframe_parameter (frame, intern ("tooltip"))))
{
Lisp_Object args[2];
- struct gcpro gcpro1, gcpro2;
-
- /* Don't let a rogue function in `delete-frame-functions'
- prevent the frame deletion. */
- GCPRO2 (args[0], args[1]);
args[0] = intern ("delete-frame-functions");
args[1] = frame;
- internal_condition_case_2 (Frun_hook_with_args, 2, args,
- Qt, delete_frame_handler);
- UNGCPRO;
+ Frun_hook_with_args (2, args);
}
- /* The hook may sometimes (indirectly) cause the frame to be deleted. */
- if (! FRAME_LIVE_P (f))
- return Qnil;
-
minibuffer_selected = EQ (minibuf_window, selected_window);
/* Don't let the frame remain selected. */
@@ -1443,7 +1239,7 @@ The functions are run with one arg, the frame to be deleted. */)
{
FOR_EACH_FRAME (tail, frame1)
{
- if (! EQ (frame, frame1) && FRAME_LIVE_P (XFRAME (frame1)))
+ if (! EQ (frame, frame1))
break;
}
}
@@ -1469,24 +1265,6 @@ The functions are run with one arg, the frame to be deleted. */)
if (EQ (f->minibuffer_window, echo_area_window))
echo_area_window = sf->minibuffer_window;
- /* Don't allow other frames to refer to a deleted frame in their
- 'environment parameter. */
- {
- Lisp_Object tail, frame1;
- Lisp_Object env = get_frame_param (XFRAME (frame), Qenvironment);
- FOR_EACH_FRAME (tail, frame1)
- {
- if (EQ (frame, frame1) || !FRAME_LIVE_P (XFRAME (frame1)))
- continue;
- if (EQ (frame, get_frame_param (XFRAME (frame1), Qenvironment)))
- {
- store_frame_param (XFRAME (frame1), Qenvironment, env);
- if (!FRAMEP (env))
- env = frame1;
- }
- }
- }
-
/* Clear any X selections for this frame. */
#ifdef HAVE_X_WINDOWS
if (FRAME_X_P (f))
@@ -1527,36 +1305,18 @@ The functions are run with one arg, the frame to be deleted. */)
xfree (FRAME_MESSAGE_BUF (f));
/* Since some events are handled at the interrupt level, we may get
- an event for f at any time; if we zero out the frame's terminal
+ an event for f at any time; if we zero out the frame's display
now, then we may trip up the event-handling code. Instead, we'll
- promise that the terminal of the frame must be valid until we
- have called the window-system-dependent frame destruction
- routine. */
-
- if (FRAME_TERMINAL (f)->delete_frame_hook)
- (*FRAME_TERMINAL (f)->delete_frame_hook) (f);
+ promise that the display of the frame must be valid until we have
+ called the window-system-dependent frame destruction routine. */
- {
- struct terminal *terminal = FRAME_TERMINAL (f);
- f->output_data.nothing = 0;
- f->terminal = 0; /* Now the frame is dead. */
-
- /* If needed, delete the terminal that this frame was on.
- (This must be done after the frame is killed.) */
- terminal->reference_count--;
- if (terminal->reference_count == 0)
- {
- kb = NULL;
- if (terminal->delete_terminal_hook)
- (*terminal->delete_terminal_hook) (terminal);
- else
- delete_terminal (terminal);
- }
-#ifdef MULTI_KBOARD
- else
- kb = terminal->kboard;
+ /* I think this should be done with a hook. */
+#ifdef HAVE_WINDOW_SYSTEM
+ if (FRAME_WINDOW_P (f))
+ x_destroy_window (f);
#endif
- }
+
+ f->output_data.nothing = 0;
/* If we've deleted the last_nonminibuf_frame, then try to find
another one. */
@@ -1581,39 +1341,38 @@ The functions are run with one arg, the frame to be deleted. */)
/* If there's no other frame on the same kboard, get out of
single-kboard state if we're in it for this kboard. */
- if (kb != NULL)
- {
- Lisp_Object frames;
- /* Some frame we found on the same kboard, or nil if there are none. */
- Lisp_Object frame_on_same_kboard;
+ {
+ Lisp_Object frames;
+ /* Some frame we found on the same kboard, or nil if there are none. */
+ Lisp_Object frame_on_same_kboard;
- frame_on_same_kboard = Qnil;
+ frame_on_same_kboard = Qnil;
- for (frames = Vframe_list;
- CONSP (frames);
- frames = XCDR (frames))
- {
- Lisp_Object this;
- struct frame *f1;
+ for (frames = Vframe_list;
+ CONSP (frames);
+ frames = XCDR (frames))
+ {
+ Lisp_Object this;
+ struct frame *f1;
- this = XCAR (frames);
- if (!FRAMEP (this))
- abort ();
- f1 = XFRAME (this);
+ this = XCAR (frames);
+ if (!FRAMEP (this))
+ abort ();
+ f1 = XFRAME (this);
- if (kb == FRAME_KBOARD (f1))
- frame_on_same_kboard = this;
- }
+ if (FRAME_KBOARD (f) == FRAME_KBOARD (f1))
+ frame_on_same_kboard = this;
+ }
- if (NILP (frame_on_same_kboard))
- not_single_kboard_state (kb);
- }
+ if (NILP (frame_on_same_kboard))
+ not_single_kboard_state (FRAME_KBOARD (f));
+ }
/* If we've deleted this keyboard's default_minibuffer_frame, try to
find another one. Prefer minibuffer-only frames, but also notice
frames with other windows. */
- if (kb != NULL && EQ (frame, kb->Vdefault_minibuffer_frame))
+ if (EQ (frame, FRAME_KBOARD (f)->Vdefault_minibuffer_frame))
{
Lisp_Object frames;
@@ -1639,7 +1398,7 @@ The functions are run with one arg, the frame to be deleted. */)
/* Consider only frames on the same kboard
and only those with minibuffers. */
- if (kb == FRAME_KBOARD (f1)
+ if (FRAME_KBOARD (f) == FRAME_KBOARD (f1)
&& FRAME_HAS_MINIBUF_P (f1))
{
frame_with_minibuf = this;
@@ -1647,7 +1406,7 @@ The functions are run with one arg, the frame to be deleted. */)
break;
}
- if (kb == FRAME_KBOARD (f1))
+ if (FRAME_KBOARD (f) == FRAME_KBOARD (f1))
frame_on_same_kboard = this;
}
@@ -1662,11 +1421,11 @@ The functions are run with one arg, the frame to be deleted. */)
if (NILP (frame_with_minibuf))
abort ();
- kb->Vdefault_minibuffer_frame = frame_with_minibuf;
+ FRAME_KBOARD (f)->Vdefault_minibuffer_frame = frame_with_minibuf;
}
else
/* No frames left on this kboard--say no minibuffer either. */
- kb->Vdefault_minibuffer_frame = Qnil;
+ FRAME_KBOARD (f)->Vdefault_minibuffer_frame = Qnil;
}
/* Cause frame titles to update--necessary if we now have just one frame. */
@@ -1703,11 +1462,11 @@ and returns whatever that function returns. */)
#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
/* It's okay for the hook to refrain from storing anything. */
- if (FRAME_TERMINAL (f)->mouse_position_hook)
- (*FRAME_TERMINAL (f)->mouse_position_hook) (&f, -1,
- &lispy_dummy, &party_dummy,
- &x, &y,
- &long_dummy);
+ if (mouse_position_hook)
+ (*mouse_position_hook) (&f, -1,
+ &lispy_dummy, &party_dummy,
+ &x, &y,
+ &long_dummy);
if (! NILP (x))
{
col = XINT (x);
@@ -1747,11 +1506,11 @@ and nil for X and Y. */)
#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
/* It's okay for the hook to refrain from storing anything. */
- if (FRAME_TERMINAL (f)->mouse_position_hook)
- (*FRAME_TERMINAL (f)->mouse_position_hook) (&f, -1,
- &lispy_dummy, &party_dummy,
- &x, &y,
- &long_dummy);
+ if (mouse_position_hook)
+ (*mouse_position_hook) (&f, -1,
+ &lispy_dummy, &party_dummy,
+ &x, &y,
+ &long_dummy);
#endif
XSETFRAME (lispy_dummy, f);
return Fcons (lispy_dummy, Fcons (x, y));
@@ -2038,19 +1797,16 @@ doesn't support multiple overlapping frames, this function does nothing. */)
(frame)
Lisp_Object frame;
{
- struct frame *f;
if (NILP (frame))
frame = selected_frame;
CHECK_LIVE_FRAME (frame);
- f = XFRAME (frame);
-
/* Do like the documentation says. */
Fmake_frame_visible (frame);
- if (FRAME_TERMINAL (f)->frame_raise_lower_hook)
- (*FRAME_TERMINAL (f)->frame_raise_lower_hook) (f, 1);
+ if (frame_raise_lower_hook)
+ (*frame_raise_lower_hook) (XFRAME (frame), 1);
return Qnil;
}
@@ -2064,17 +1820,13 @@ doesn't support multiple overlapping frames, this function does nothing. */)
(frame)
Lisp_Object frame;
{
- struct frame *f;
-
if (NILP (frame))
frame = selected_frame;
CHECK_LIVE_FRAME (frame);
- f = XFRAME (frame);
-
- if (FRAME_TERMINAL (f)->frame_raise_lower_hook)
- (*FRAME_TERMINAL (f)->frame_raise_lower_hook) (f, 0);
+ if (frame_raise_lower_hook)
+ (*frame_raise_lower_hook) (XFRAME (frame), 0);
return Qnil;
}
@@ -2108,8 +1860,6 @@ The redirection lasts until `redirect-frame-focus' is called to change it. */)
(frame, focus_frame)
Lisp_Object frame, focus_frame;
{
- struct frame *f;
-
/* Note that we don't check for a live frame here. It's reasonable
to redirect the focus of a frame you're about to delete, if you
know what other frame should receive those keystrokes. */
@@ -2118,12 +1868,10 @@ The redirection lasts until `redirect-frame-focus' is called to change it. */)
if (! NILP (focus_frame))
CHECK_LIVE_FRAME (focus_frame);
- f = XFRAME (frame);
-
- f->focus_frame = focus_frame;
+ XFRAME (frame)->focus_frame = focus_frame;
- if (FRAME_TERMINAL (f)->frame_rehighlight_hook)
- (*FRAME_TERMINAL (f)->frame_rehighlight_hook) (f);
+ if (frame_rehighlight_hook)
+ (*frame_rehighlight_hook) (XFRAME (frame));
return Qnil;
}
@@ -2185,7 +1933,7 @@ set_frame_buffer_list (frame, list)
XFRAME (frame)->buffer_list = list;
}
-/* Discard BUFFER from the buffer-list and buried-buffer-list of each frame. */
+/* Discard BUFFER from the buffer-list of each frame. */
void
frames_discard_buffer (buffer)
@@ -2197,8 +1945,6 @@ frames_discard_buffer (buffer)
{
XFRAME (frame)->buffer_list
= Fdelq (buffer, XFRAME (frame)->buffer_list);
- XFRAME (frame)->buried_buffer_list
- = Fdelq (buffer, XFRAME (frame)->buried_buffer_list);
}
}
@@ -2222,7 +1968,7 @@ store_in_alist (alistptr, prop, val)
static int
frame_name_fnn_p (str, len)
char *str;
- int len;
+ EMACS_INT len;
{
if (len > 1 && str[0] == 'F')
{
@@ -2257,8 +2003,8 @@ set_term_frame_name (f, name)
SBYTES (f->name)))
return;
- tty_frame_count++;
- sprintf (namebuf, "F%d", tty_frame_count);
+ terminal_frame_count++;
+ sprintf (namebuf, "F%d", terminal_frame_count);
name = build_string (namebuf);
}
else
@@ -2286,18 +2032,13 @@ store_frame_param (f, prop, val)
{
register Lisp_Object old_alist_elt;
- /* The buffer-list parameters are stored in a special place and not
- in the alist. */
+ /* The buffer-alist parameter is stored in a special place and is
+ not in the alist. */
if (EQ (prop, Qbuffer_list))
{
f->buffer_list = val;
return;
}
- if (EQ (prop, Qburied_buffer_list))
- {
- f->buried_buffer_list = val;
- return;
- }
/* If PROP is a symbol which is supposed to have frame-local values,
and it is set up based on this frame, switch to the global
@@ -2310,7 +2051,6 @@ store_frame_param (f, prop, val)
if ((BUFFER_LOCAL_VALUEP (valcontents)
|| SOME_BUFFER_LOCAL_VALUEP (valcontents))
&& XBUFFER_LOCAL_VALUE (valcontents)->check_frame
- && XBUFFER_LOCAL_VALUE (valcontents)->found_for_frame
&& XFRAME (XBUFFER_LOCAL_VALUE (valcontents)->frame) == f)
swap_in_global_binding (prop);
}
@@ -2393,7 +2133,7 @@ If FRAME is omitted, return information on the currently selected frame. */)
unspecified and reversed, take the frame's background pixel
for foreground and vice versa. */
elt = Fassq (Qforeground_color, alist);
- if (CONSP (elt) && STRINGP (XCDR (elt)))
+ if (!NILP (elt) && CONSP (elt) && STRINGP (XCDR (elt)))
{
if (strncmp (SDATA (XCDR (elt)),
unspecified_bg,
@@ -2407,7 +2147,7 @@ If FRAME is omitted, return information on the currently selected frame. */)
else
store_in_alist (&alist, Qforeground_color, tty_color_name (f, fg));
elt = Fassq (Qbackground_color, alist);
- if (CONSP (elt) && STRINGP (XCDR (elt)))
+ if (!NILP (elt) && CONSP (elt) && STRINGP (XCDR (elt)))
{
if (strncmp (SDATA (XCDR (elt)),
unspecified_fg,
@@ -2438,7 +2178,6 @@ If FRAME is omitted, return information on the currently selected frame. */)
: FRAME_MINIBUF_WINDOW (f)));
store_in_alist (&alist, Qunsplittable, (FRAME_NO_SPLIT_P (f) ? Qt : Qnil));
store_in_alist (&alist, Qbuffer_list, frame_buffer_list (frame));
- store_in_alist (&alist, Qburied_buffer_list, XFRAME (frame)->buried_buffer_list);
/* I think this should be done with a hook. */
#ifdef HAVE_WINDOW_SYSTEM
@@ -2606,45 +2345,9 @@ enabled such bindings for that variable with `make-variable-frame-local'. */)
call1 (Qframe_set_background_mode, frame);
}
}
- return Qnil;
-}
-
-DEFUN ("frame-with-environment", Fframe_with_environment, Sframe_with_environment, 0, 1, 0,
- doc: /* Return the frame that has the environment variable list for FRAME.
-The frame-local environment variable list is normally shared between
-frames that were created in the same Emacsclient session. The
-environment list is stored in a single frame's 'environment parameter;
-the other frames' 'environment parameter is set to this frame. This
-function follows the chain of 'environment references to reach the
-frame that stores the actual local environment list, and returns that
-frame. */)
- (frame)
- Lisp_Object frame;
-{
- Lisp_Object hare, tortoise;
-
- if (NILP (frame))
- frame = selected_frame;
- CHECK_FRAME (frame);
-
- hare = tortoise = get_frame_param (XFRAME (frame), Qenvironment);
- while (!NILP (hare) && FRAMEP (hare))
- {
- frame = hare;
- hare = get_frame_param (XFRAME (hare), Qenvironment);
- if (NILP (hare) || !FRAMEP (hare))
- break;
- frame = hare;
- hare = get_frame_param (XFRAME (hare), Qenvironment);
- tortoise = get_frame_param (XFRAME (tortoise), Qenvironment);
- if (EQ (hare, tortoise))
- error ("Cyclic frame-local environment indirection");
- }
-
- return frame;
+ return Qnil;
}
-
DEFUN ("frame-char-height", Fframe_char_height, Sframe_char_height,
0, 1, 0,
@@ -2901,6 +2604,9 @@ static struct frame_parm_table frame_parms[] =
{"right-fringe", &Qright_fringe},
{"wait-for-wm", &Qwait_for_wm},
{"fullscreen", &Qfullscreen},
+#ifdef USE_FONT_BACKEND
+ {"font-backend", &Qfont_backend}
+#endif /* USE_FONT_BACKEND */
};
#ifdef HAVE_WINDOW_SYSTEM
@@ -3061,8 +2767,9 @@ x_set_frame_parameters (f, alist)
if (NATNUMP (param_index)
&& (XFASTINT (param_index)
< sizeof (frame_parms)/sizeof (frame_parms[0]))
- && FRAME_RIF (f)->frame_parm_handlers[XINT (param_index)])
- (*(FRAME_RIF (f)->frame_parm_handlers[XINT (param_index)])) (f, val, old_value);
+ && rif->frame_parm_handlers[XINT (param_index)])
+ (*(rif->frame_parm_handlers[XINT (param_index)])) (f, val, old_value);
+
unbind_to (count, Qnil);
}
}
@@ -3076,9 +2783,9 @@ x_set_frame_parameters (f, alist)
prop = parms[i];
val = values[i];
- if (EQ (prop, Qwidth) && NATNUMP (val))
+ if (EQ (prop, Qwidth) && NUMBERP (val))
width = XFASTINT (val);
- else if (EQ (prop, Qheight) && NATNUMP (val))
+ else if (EQ (prop, Qheight) && NUMBERP (val))
height = XFASTINT (val);
else if (EQ (prop, Qtop))
top = val;
@@ -3106,8 +2813,8 @@ x_set_frame_parameters (f, alist)
if (NATNUMP (param_index)
&& (XFASTINT (param_index)
< sizeof (frame_parms)/sizeof (frame_parms[0]))
- && FRAME_RIF (f)->frame_parm_handlers[XINT (param_index)])
- (*(FRAME_RIF (f)->frame_parm_handlers[XINT (param_index)])) (f, val, old_value);
+ && rif->frame_parm_handlers[XINT (param_index)])
+ (*(rif->frame_parm_handlers[XINT (param_index)])) (f, val, old_value);
}
}
@@ -3345,8 +3052,8 @@ x_set_fullscreen (f, new_value, old_value)
else if (EQ (new_value, Qfullheight))
f->want_fullscreen = FULLSCREEN_HEIGHT;
- if (FRAME_TERMINAL (f)->fullscreen_hook != NULL)
- FRAME_TERMINAL (f)->fullscreen_hook (f);
+ if (fullscreen_hook != NULL)
+ fullscreen_hook (f);
}
@@ -3395,9 +3102,9 @@ x_set_screen_gamma (f, new_value, old_value)
if (NATNUMP (index)
&& (XFASTINT (index)
< sizeof (frame_parms)/sizeof (frame_parms[0]))
- && FRAME_RIF (f)->frame_parm_handlers[XFASTINT (index)])
- (*FRAME_RIF (f)->frame_parm_handlers[XFASTINT (index)])
- (f, bgcolor, Qnil);
+ && rif->frame_parm_handlers[XFASTINT (index)])
+ (*(rif->frame_parm_handlers[XFASTINT (index)]))
+ (f, bgcolor, Qnil);
}
Fclear_face_cache (Qnil);
@@ -3414,20 +3121,60 @@ x_set_font (f, arg, oldval)
Lisp_Object frame;
int old_fontset = FRAME_FONTSET(f);
+#ifdef USE_FONT_BACKEND
+ if (enable_font_backend)
+ {
+ int fontset = -1;
+ Lisp_Object font_object;
+
+ /* ARG is a fontset name, a font name, or a font object.
+ In the last case, this function never fail. */
+ if (STRINGP (arg))
+ {
+ fontset = fs_query_fontset (arg, 0);
+ if (fontset < 0)
+ font_object = font_open_by_name (f, SDATA (arg));
+ else if (fontset > 0)
+ {
+ Lisp_Object ascii_font = fontset_ascii (fontset);
+
+ font_object = font_open_by_name (f, SDATA (ascii_font));
+ }
+ }
+ else
+ font_object = arg;
+
+ if (fontset < 0 && ! NILP (font_object))
+ fontset = new_fontset_from_font (font_object);
+
+ if (fontset == 0)
+ /* Refuse the default fontset. */
+ result = Qt;
+ else if (NILP (font_object))
+ result = Qnil;
+ else
+ result = x_new_fontset2 (f, fontset, font_object);
+ }
+ else
+ {
+#endif /* USE_FONT_BACKEND */
CHECK_STRING (arg);
fontset_name = Fquery_fontset (arg, Qnil);
BLOCK_INPUT;
result = (STRINGP (fontset_name)
- ? x_new_fontset (f, SDATA (fontset_name))
- : x_new_font (f, SDATA (arg)));
+ ? x_new_fontset (f, fontset_name)
+ : x_new_fontset (f, arg));
UNBLOCK_INPUT;
+#ifdef USE_FONT_BACKEND
+ }
+#endif
if (EQ (result, Qnil))
error ("Font `%s' is not defined", SDATA (arg));
else if (EQ (result, Qt))
- error ("The characters of the given font have varying widths");
+ error ("The default fontset can't be used for a frame font");
else if (STRINGP (result))
{
set_default_ascii_font (result);
@@ -3438,7 +3185,9 @@ x_set_font (f, arg, oldval)
if (old_fontset == FRAME_FONTSET (f))
return;
}
- else if (!NILP (Fequal (result, oldval)))
+ store_frame_param (f, Qfont, result);
+
+ if (!NILP (Fequal (result, oldval)))
return;
/* Recalculate toolbar height. */
@@ -3446,7 +3195,6 @@ x_set_font (f, arg, oldval)
/* Ensure we redraw it. */
clear_current_matrices (f);
- store_frame_param (f, Qfont, result);
recompute_basic_faces (f);
}
else
@@ -3467,6 +3215,60 @@ x_set_font (f, arg, oldval)
}
+#ifdef USE_FONT_BACKEND
+void
+x_set_font_backend (f, new_value, old_value)
+ struct frame *f;
+ Lisp_Object new_value, old_value;
+{
+ if (! NILP (new_value)
+ && !CONSP (new_value))
+ {
+ char *p0, *p1;
+
+ CHECK_STRING (new_value);
+ p0 = p1 = SDATA (new_value);
+ new_value = Qnil;
+ while (*p0)
+ {
+ while (*p1 && *p1 != ',') p1++;
+ if (p0 < p1)
+ new_value = Fcons (Fintern (make_string (p0, p1 - p0), Qnil),
+ new_value);
+ if (*p1)
+ p1++;
+ p0 = p1;
+ }
+ new_value = Fnreverse (new_value);
+ }
+
+ if (! NILP (old_value) && ! NILP (Fequal (old_value, new_value)))
+ return;
+
+ if (FRAME_FONT_OBJECT (f))
+ {
+ free_all_realized_faces (Qnil);
+ Fclear_font_cache ();
+ }
+
+ new_value = font_update_drivers (f, new_value);
+ if (NILP (new_value))
+ error ("No font backend available");
+ store_frame_param (f, Qfont_backend, new_value);
+
+ if (FRAME_FONT_OBJECT (f))
+ {
+ Lisp_Object frame;
+
+ XSETFRAME (frame, f);
+ x_set_font (f, Fframe_parameter (frame, Qfont), Qnil);
+ ++face_change_count;
+ ++windows_or_buffers_changed;
+ }
+}
+#endif /* USE_FONT_BACKEND */
+
+
void
x_set_fringe_width (f, new_value, old_value)
struct frame *f;
@@ -4333,22 +4135,12 @@ syms_of_frame ()
staticpro (&Qbuffer_predicate);
Qbuffer_list = intern ("buffer-list");
staticpro (&Qbuffer_list);
- Qburied_buffer_list = intern ("buried-buffer-list");
- staticpro (&Qburied_buffer_list);
Qdisplay_type = intern ("display-type");
staticpro (&Qdisplay_type);
Qbackground_mode = intern ("background-mode");
staticpro (&Qbackground_mode);
Qtty_color_mode = intern ("tty-color-mode");
staticpro (&Qtty_color_mode);
- Qtty = intern ("tty");
- staticpro (&Qtty);
- Qtty_type = intern ("tty-type");
- staticpro (&Qtty_type);
- Qwindow_system = intern ("window-system");
- staticpro (&Qwindow_system);
- Qenvironment = intern ("environment");
- staticpro (&Qenvironment);
Qface_set_after_frame_default = intern ("face-set-after-frame-default");
staticpro (&Qface_set_after_frame_default);
@@ -4369,11 +4161,6 @@ syms_of_frame ()
Qx_frame_parameter = intern ("x-frame-parameter");
staticpro (&Qx_frame_parameter);
- Qterminal = intern ("terminal");
- staticpro (&Qterminal);
- Qterminal_live_p = intern ("terminal-live-p");
- staticpro (&Qterminal_live_p);
-
{
int i;
@@ -4422,7 +4209,6 @@ These may be set in your init file, like this:
These override values given in window system configuration data,
including X Windows' defaults database.
For values specific to the first Emacs frame, see `initial-frame-alist'.
-For window-system specific values, see `window-system-default-frame-alist'.
For values specific to the separate minibuffer frame, see
`minibuffer-frame-alist'.
The `menu-bar-lines' element of the list controls whether new frames
@@ -4444,7 +4230,7 @@ Setting this variable does not affect existing frames, only new ones. */);
#endif
DEFVAR_LISP ("terminal-frame", &Vterminal_frame,
- doc: /* The initial frame-object, which represents Emacs's stdout. */);
+ doc: /* The initial frame-object, which represents Emacs's stdout. */);
DEFVAR_LISP ("emacs-iconified", &Vemacs_iconified,
doc: /* Non-nil if all of Emacs is iconified and frame updates are not needed. */);
@@ -4469,14 +4255,7 @@ when the mouse is over clickable text. */);
DEFVAR_LISP ("delete-frame-functions", &Vdelete_frame_functions,
doc: /* Functions to be run before deleting a frame.
The functions are run with one arg, the frame to be deleted.
-See `delete-frame'.
-
-Note that functions in this list may be called twice on the same
-frame. In the second invocation, the frame is already deleted, and
-the function should do nothing. (You can use `frame-live-p' to check
-for this.) This wrinkle happens when an earlier function in
-`delete-frame-functions' (indirectly) calls delete-frame
-recursively. */);
+See `delete-frame'. */);
Vdelete_frame_functions = Qnil;
DEFVAR_KBOARD ("default-minibuffer-frame", Vdefault_minibuffer_frame,
@@ -4494,27 +4273,11 @@ displayed.
This variable is local to the current terminal and cannot be buffer-local. */);
- DEFVAR_BOOL ("focus-follows-mouse", &focus_follows_mouse,
- doc: /* Non-nil if window system changes focus when you move the mouse.
-You should set this variable to tell Emacs how your window manager
-handles focus, since there is no way in general for Emacs to find out
-automatically. */);
-#ifdef HAVE_WINDOW_SYSTEM
-#if defined(HAVE_NTGUI) || defined(MAC_OS)
- focus_follows_mouse = 0;
-#else
- focus_follows_mouse = 1;
-#endif
-#else
- focus_follows_mouse = 0;
-#endif
-
staticpro (&Vframe_list);
defsubr (&Sactive_minibuffer_window);
defsubr (&Sframep);
defsubr (&Sframe_live_p);
- defsubr (&Swindow_system);
defsubr (&Smake_terminal_frame);
defsubr (&Shandle_switch_frame);
defsubr (&Sselect_frame);
@@ -4548,7 +4311,6 @@ automatically. */);
defsubr (&Sframe_parameters);
defsubr (&Sframe_parameter);
defsubr (&Smodify_frame_parameters);
- defsubr (&Sframe_with_environment);
defsubr (&Sframe_char_height);
defsubr (&Sframe_char_width);
defsubr (&Sframe_pixel_height);
diff --git a/src/frame.h b/src/frame.h
index 7c058d569a..245b4aa3eb 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -29,7 +29,9 @@ Boston, MA 02110-1301, USA. */
/* Miscellanea. */
-/* Nonzero means there is at least one garbaged frame. */
+/* Nonzero means don't assume anything about current contents of
+ actual terminal frame */
+
extern int frame_garbaged;
/* Nonzero means FRAME_MESSAGE_BUF (selected_frame) is being used by
@@ -37,17 +39,11 @@ extern int frame_garbaged;
extern int message_buf_print;
-/* Nonzero means window system changes focus when moving the
- mouse. */
-
-extern int focus_follows_mouse;
-
/* The structure representing a frame. */
enum output_method
{
- output_initial,
output_termcap,
output_x_window,
output_msdos_raw,
@@ -72,17 +68,42 @@ enum text_cursor_kinds
HBAR_CURSOR
};
-#define FRAME_FOREGROUND_PIXEL(f) ((f)->foreground_pixel)
-#define FRAME_BACKGROUND_PIXEL(f) ((f)->background_pixel)
+#if !defined(MSDOS) && !defined(WINDOWSNT) && !defined(MAC_OS)
+
+#if !defined(HAVE_X_WINDOWS)
+
+#define PIX_TYPE unsigned long
+
+/* A (mostly empty) x_output structure definition for building Emacs
+ on Unix and GNU/Linux without X support. */
+struct x_output
+{
+ PIX_TYPE background_pixel;
+ PIX_TYPE foreground_pixel;
+};
+
+#endif /* ! HAVE_X_WINDOWS */
+
+
+#define FRAME_FOREGROUND_PIXEL(f) ((f)->output_data.x->foreground_pixel)
+#define FRAME_BACKGROUND_PIXEL(f) ((f)->output_data.x->background_pixel)
-struct terminal;
+/* A structure describing a termcap frame display. */
+extern struct x_output tty_display;
+
+#endif /* ! MSDOS && ! WINDOWSNT && ! MAC_OS */
+
+#ifdef USE_FONT_BACKEND
+struct font_driver_list;
+#endif /* USE_FONT_BACKEND */
struct frame
{
- EMACS_UINT size;
+ EMACS_INT size;
struct Lisp_Vector *next;
/* All Lisp_Object components must come first.
+ Only EMACS_INT values can be intermixed with them.
That ensures they are all aligned normally. */
/* Name of this frame: a Lisp string. It is used for looking up resources,
@@ -136,7 +157,7 @@ struct frame
Actually, we don't specify exactly what is stored here at all; the
scroll bar implementation code can use it to store anything it likes.
This field is marked by the garbage collector. It is here
- instead of in the `device' structure so that the garbage
+ instead of in the `display' structure so that the garbage
collector doesn't need to look inside the window-system-dependent
structure. */
Lisp_Object scroll_bars;
@@ -156,6 +177,8 @@ struct frame
For the format of the data, see extensive comments in xmenu.c.
Only the X toolkit version uses this. */
Lisp_Object menu_bar_vector;
+ /* Number of elements in the vector that have meaningful data. */
+ EMACS_INT menu_bar_items_used;
/* Predicate for selecting buffers for other-buffer. */
Lisp_Object buffer_predicate;
@@ -163,10 +186,6 @@ struct frame
/* List of buffers viewed in this frame, for other-buffer. */
Lisp_Object buffer_list;
- /* List of buffers that were viewed, then buried in this frame. The
- most recently buried buffer is first. For last-buffer. */
- Lisp_Object buried_buffer_list;
-
/* A dummy window used to display menu bars under X when no X
toolkit support is available. */
Lisp_Object menu_bar_window;
@@ -180,14 +199,11 @@ struct frame
/* Desired and current contents displayed in tool_bar_window. */
Lisp_Object desired_tool_bar_string, current_tool_bar_string;
- /* Beyond here, there should be no more Lisp_Object components. */
+ /* beyond here, there should be no more Lisp_Object components. */
/* Cache of realized faces. */
struct face_cache *face_cache;
- /* Number of elements in `menu_bar_vector' that have meaningful data. */
- EMACS_INT menu_bar_items_used;
-
/* A buffer to hold the frame's name. We can't use the Lisp
string's pointer (`name', above) because it might get relocated. */
char *namebuf;
@@ -244,6 +260,9 @@ struct frame
/* Size of the frame window in pixels. */
int pixel_height, pixel_width;
+ /* Dots per inch of the screen the frame is on. */
+ double resx, resy;
+
/* These many pixels are the difference between the outer window (i.e. the
left and top of the window manager decoration) and FRAME_X_WINDOW. */
int x_pixels_diff, y_pixels_diff;
@@ -271,28 +290,29 @@ struct frame
/* Canonical Y unit. Height of a line, in pixels. */
int line_height;
- /* The output method says how the contents of this frame are
- displayed. It could be using termcap, or using an X window.
- This must be the same as the terminal->type. */
+ /* The output method says how the contents of this frame
+ are displayed. It could be using termcap, or using an X window. */
enum output_method output_method;
- /* The terminal device that this frame uses. If this is NULL, then
- the frame has been deleted. */
- struct terminal *terminal;
-
- /* Device-dependent, frame-local auxiliary data used for displaying
- the contents. When the frame is deleted, this data is deleted as
- well. */
+ /* A structure of auxiliary data used for displaying the contents.
+ struct x_output is used for X window frames;
+ it is defined in xterm.h.
+ struct w32_output is used for W32 window frames;
+ it is defined in w32term.h. */
union output_data
{
- struct tty_output *tty; /* termchar.h */
- struct x_output *x; /* xterm.h */
- struct w32_output *w32; /* w32term.h */
- struct mac_output *mac; /* macterm.h */
+ struct x_output *x;
+ struct w32_output *w32;
+ struct mac_output *mac;
EMACS_INT nothing;
}
output_data;
+#ifdef USE_FONT_BACKEND
+ /* List of font-drivers available on the frame. */
+ struct font_driver_list *font_driver_list;
+#endif /* USE_FONT_BACKEND */
+
/* Total width of fringes reserved for drawing truncation bitmaps,
continuation bitmaps and alike. The width is in canonical char
units of the frame. This must currently be the case because window
@@ -303,6 +323,13 @@ struct frame
/* The extra width (in pixels) currently allotted for fringes. */
int left_fringe_width, right_fringe_width;
+#ifdef MULTI_KBOARD
+ /* A pointer to the kboard structure associated with this frame.
+ For termcap frames, this points to initial_kboard. For X frames,
+ it will be the same as display.x->display_info->kboard. */
+ struct kboard *kboard;
+#endif
+
/* See FULLSCREEN_ enum below */
int want_fullscreen;
@@ -326,13 +353,13 @@ struct frame
frame becomes visible again, it must be marked as garbaged. The
FRAME_SAMPLE_VISIBILITY macro takes care of this.
- On ttys and on Windows NT/9X, to avoid wasting effort updating
- visible frames that are actually completely obscured by other
- windows on the display, we bend the meaning of visible slightly:
- if greater than 1, then the frame is obscured - we still consider
- it to be "visible" as seen from lisp, but we don't bother
- updating it. We must take care to garbage the frame when it
- ceaces to be obscured though.
+ On Windows NT/9X, to avoid wasting effort updating visible frames
+ that are actually completely obscured by other windows on the
+ display, we bend the meaning of visible slightly: if greater than
+ 1, then the frame is obscured - we still consider it to be
+ "visible" as seen from lisp, but we don't bother updating it. We
+ must take care to garbage the frame when it ceaces to be obscured
+ though. Note that these semantics are only used on NT/9X.
iconified is nonzero if the frame is currently iconified.
@@ -426,7 +453,7 @@ struct frame
/* The baud rate that was used to calculate costs for this frame. */
int cost_calculation_baud_rate;
- /* Nonzero if the mouse has moved on this display device
+ /* Nonzero if the mouse has moved on this display
since the last time we checked. */
char mouse_moved;
@@ -446,10 +473,6 @@ struct frame
update_frame, usually after resizing the frame. */
unsigned force_flush_display_p : 1;
- /* All display backends seem to need these two pixel values. */
- unsigned long background_pixel;
- unsigned long foreground_pixel;
-
/* Set to non-zero if the default face for the frame has been
realized. Reset to zero whenever the default face changes.
Used to see the difference between a font change and face change. */
@@ -468,21 +491,20 @@ struct frame
};
#ifdef MULTI_KBOARD
-#define FRAME_KBOARD(f) ((f)->terminal->kboard)
+#define FRAME_KBOARD(f) ((f)->kboard)
#else
#define FRAME_KBOARD(f) (&the_only_kboard)
#endif
typedef struct frame *FRAME_PTR;
-#define XFRAME(p) (eassert (GC_FRAMEP(p)),(struct frame *) XPNTR (p))
+#define XFRAME(p) (eassert (FRAMEP(p)),(struct frame *) XPNTR (p))
#define XSETFRAME(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_FRAME))
/* Given a window, return its frame as a Lisp_Object. */
#define WINDOW_FRAME(w) (w)->frame
/* Test a frame for particular kinds of display methods. */
-#define FRAME_INITIAL_P(f) ((f)->output_method == output_initial)
#define FRAME_TERMCAP_P(f) ((f)->output_method == output_termcap)
#define FRAME_X_P(f) ((f)->output_method == output_x_window)
#define FRAME_W32_P(f) ((f)->output_method == output_w32)
@@ -506,7 +528,7 @@ typedef struct frame *FRAME_PTR;
#endif
/* Nonzero if frame F is still alive (not deleted). */
-#define FRAME_LIVE_P(f) ((f)->terminal != 0)
+#define FRAME_LIVE_P(f) ((f)->output_data.nothing != 0)
/* Nonzero if frame F is a minibuffer-only frame. */
#define FRAME_MINIBUF_ONLY_P(f) \
@@ -746,10 +768,7 @@ typedef struct frame *FRAME_PTR;
Also, if a frame used to be invisible, but has just become visible,
it must be marked as garbaged, since redisplay hasn't been keeping
- up its contents.
-
- Note that a tty frame is visible if and only if it is the topmost
- frame. */
+ up its contents. */
#define FRAME_SAMPLE_VISIBILITY(f) \
(((f)->async_visible && (f)->visible != (f)->async_visible) ? \
@@ -782,14 +801,10 @@ typedef struct frame *FRAME_PTR;
extern Lisp_Object Qframep, Qframe_live_p;
-extern Lisp_Object Qtty, Qtty_type;
-extern Lisp_Object Qterminal, Qterminal_live_p;
-extern Lisp_Object Qenvironment;
extern struct frame *last_nonminibuf_frame;
-extern struct frame *make_initial_frame P_ ((void));
-extern struct frame *make_terminal_frame P_ ((struct terminal *));
+extern struct frame *make_terminal_frame P_ ((void));
extern struct frame *make_frame P_ ((int));
#ifdef HAVE_WINDOW_SYSTEM
extern struct frame *make_minibuffer_frame P_ ((void));
@@ -989,7 +1004,7 @@ extern Lisp_Object selected_frame;
extern Lisp_Object Qauto_raise, Qauto_lower;
extern Lisp_Object Qborder_color, Qborder_width;
-extern Lisp_Object Qbuffer_predicate, Qbuffer_list, Qburied_buffer_list;
+extern Lisp_Object Qbuffer_predicate, Qbuffer_list;
extern Lisp_Object Qcursor_color, Qcursor_type;
extern Lisp_Object Qfont;
extern Lisp_Object Qbackground_color, Qforeground_color;
@@ -1006,6 +1021,7 @@ extern Lisp_Object Qscreen_gamma;
extern Lisp_Object Qline_spacing;
extern Lisp_Object Qwait_for_wm;
extern Lisp_Object Qfullscreen;
+extern Lisp_Object Qfont_backend;
extern Lisp_Object Qleft_fringe, Qright_fringe;
extern Lisp_Object Qheight, Qwidth;
@@ -1021,8 +1037,6 @@ extern Lisp_Object Qx_resource_name;
extern Lisp_Object Qleft, Qright, Qtop, Qbox;
extern Lisp_Object Qdisplay;
-extern Lisp_Object Qwindow_system;
-
#ifdef HAVE_WINDOW_SYSTEM
/* The class of this X application. */
@@ -1035,7 +1049,7 @@ enum
FULLSCREEN_WIDTH = 1,
FULLSCREEN_HEIGHT = 2,
FULLSCREEN_BOTH = 3,
- FULLSCREEN_WAIT = 4
+ FULLSCREEN_WAIT = 4,
};
@@ -1046,8 +1060,10 @@ extern void x_set_offset P_ ((struct frame *, int, int, int));
extern void x_wm_set_icon_position P_ ((struct frame *, int, int));
extern Lisp_Object x_new_font P_ ((struct frame *, char *));
-extern Lisp_Object x_new_fontset P_ ((struct frame *, char *));
-
+extern Lisp_Object x_new_fontset P_ ((struct frame *, Lisp_Object));
+#ifdef USE_FONT_BACKEND
+extern Lisp_Object x_new_fontset2 P_ ((struct frame *, int, Lisp_Object));
+#endif /* USE_FONT_BACKEND */
/* These are in frame.c */
@@ -1067,6 +1083,7 @@ extern void x_set_fullscreen P_ ((struct frame *, Lisp_Object, Lisp_Object));
extern void x_set_line_spacing P_ ((struct frame *, Lisp_Object, Lisp_Object));
extern void x_set_screen_gamma P_ ((struct frame *, Lisp_Object, Lisp_Object));
extern void x_set_font P_ ((struct frame *, Lisp_Object, Lisp_Object));
+extern void x_set_font_backend P_ ((struct frame *, Lisp_Object, Lisp_Object));
extern void x_set_fringe_width P_ ((struct frame *, Lisp_Object, Lisp_Object));
extern void x_set_border_width P_ ((struct frame *, Lisp_Object, Lisp_Object));
extern void x_set_internal_border_width P_ ((struct frame *, Lisp_Object,
diff --git a/src/fringe.c b/src/fringe.c
index 70e14f51f5..9f1089f71c 100644
--- a/src/fringe.c
+++ b/src/fringe.c
@@ -29,7 +29,6 @@ Boston, MA 02110-1301, USA. */
#include "dispextern.h"
#include "buffer.h"
#include "blockinput.h"
-#include "termhooks.h"
#ifdef HAVE_WINDOW_SYSTEM
@@ -586,7 +585,7 @@ draw_fringe_bitmap_1 (w, row, left_p, overlay, which)
Lisp_Object face;
if ((face = fringe_faces[which], NILP (face))
- || (face_id = lookup_derived_face (f, face, 'A', FRINGE_FACE_ID, 0),
+ || (face_id = lookup_derived_face (f, face, FRINGE_FACE_ID, 0),
face_id < 0))
face_id = FRINGE_FACE_ID;
}
@@ -687,7 +686,7 @@ draw_fringe_bitmap_1 (w, row, left_p, overlay, which)
break;
}
- FRAME_RIF (f)->draw_fringe_bitmap (w, row, &p);
+ rif->draw_fringe_bitmap (w, row, &p);
}
static int
@@ -1279,8 +1278,6 @@ destroy_fringe_bitmap (n)
fbp = &fringe_bitmaps[n];
if (*fbp && (*fbp)->dynamic)
{
- /* XXX Is SELECTED_FRAME OK here? */
- struct redisplay_interface *rif = FRAME_RIF (SELECTED_FRAME ());
if (rif && rif->destroy_fringe_bitmap)
rif->destroy_fringe_bitmap (n);
xfree (*fbp);
@@ -1330,14 +1327,6 @@ If BITMAP overrides a standard fringe bitmap, the original bitmap is restored.
On W32 and MAC (little endian), there's no need to do this.
*/
-#if defined (HAVE_X_WINDOWS)
-static unsigned char swap_nibble[16] = {
- 0x0, 0x8, 0x4, 0xc, /* 0000 1000 0100 1100 */
- 0x2, 0xa, 0x6, 0xe, /* 0010 1010 0110 1110 */
- 0x1, 0x9, 0x5, 0xd, /* 0001 1001 0101 1101 */
- 0x3, 0xb, 0x7, 0xf}; /* 0011 1011 0111 1111 */
-#endif /* HAVE_X_WINDOWS */
-
void
init_fringe_bitmap (which, fb, once_p)
int which;
@@ -1347,6 +1336,11 @@ init_fringe_bitmap (which, fb, once_p)
if (once_p || fb->dynamic)
{
#if defined (HAVE_X_WINDOWS)
+ static unsigned char swap_nibble[16]
+ = { 0x0, 0x8, 0x4, 0xc, /* 0000 1000 0100 1100 */
+ 0x2, 0xa, 0x6, 0xe, /* 0010 1010 0110 1110 */
+ 0x1, 0x9, 0x5, 0xd, /* 0001 1001 0101 1101 */
+ 0x3, 0xb, 0x7, 0xf }; /* 0011 1011 0111 1111 */
unsigned short *bits = fb->bits;
int j;
@@ -1389,9 +1383,6 @@ init_fringe_bitmap (which, fb, once_p)
if (!once_p)
{
- /* XXX Is SELECTED_FRAME OK here? */
- struct redisplay_interface *rif = FRAME_RIF (SELECTED_FRAME ());
-
destroy_fringe_bitmap (which);
if (rif && rif->define_fringe_bitmap)
@@ -1563,7 +1554,7 @@ If FACE is nil, reset face to default fringe face. */)
if (!NILP (face))
{
face_id = lookup_derived_face (SELECTED_FRAME (), face,
- 'A', FRINGE_FACE_ID, 1);
+ FRINGE_FACE_ID, 1);
if (face_id < 0)
error ("No such face");
}
@@ -1702,11 +1693,10 @@ init_fringe ()
void
#ifdef HAVE_NTGUI
-w32_init_fringe (rif)
+w32_init_fringe ()
#else /* MAC_OS */
-mac_init_fringe (rif)
+mac_init_fringe ()
#endif
- struct redisplay_interface *rif;
{
int bt;
@@ -1727,7 +1717,6 @@ w32_reset_fringes ()
{
/* Destroy row bitmaps. */
int bt;
- struct redisplay_interface *rif = FRAME_RIF (SELECTED_FRAME ());
if (!rif)
return;
diff --git a/src/ftfont.c b/src/ftfont.c
new file mode 100644
index 0000000000..7edf7f142b
--- /dev/null
+++ b/src/ftfont.c
@@ -0,0 +1,1008 @@
+/* ftfont.c -- FreeType font driver.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006
+ National Institute of Advanced Industrial Science and Technology (AIST)
+ Registration Number H13PRO009
+
+This file is part of GNU Emacs.
+
+GNU Emacs is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Emacs is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Emacs; see the file COPYING. If not, write to
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+#include <config.h>
+#include <stdio.h>
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+#include FT_SIZES_H
+#include <fontconfig/fontconfig.h>
+#include <fontconfig/fcfreetype.h>
+
+#include "lisp.h"
+#include "dispextern.h"
+#include "frame.h"
+#include "blockinput.h"
+#include "character.h"
+#include "charset.h"
+#include "coding.h"
+#include "fontset.h"
+#include "font.h"
+
+/* Symbolic type of this font-driver. */
+Lisp_Object Qfreetype;
+
+/* Fontconfig's generic families and their aliases. */
+static Lisp_Object Qmonospace, Qsans_serif, Qserif, Qmono, Qsans, Qsans__serif;
+
+/* Flag to tell if FcInit is areadly called or not. */
+static int fc_initialized;
+
+/* Handle to a FreeType library instance. */
+static FT_Library ft_library;
+
+/* Cache for FreeType fonts. */
+static Lisp_Object freetype_font_cache;
+
+/* Fontconfig's charset used for finding fonts of registry
+ "iso8859-1". */
+static FcCharSet *cs_iso8859_1;
+
+/* The actual structure for FreeType font that can be casted to struct
+ font. */
+
+struct ftfont_info
+{
+ struct font font;
+ FT_Size ft_size;
+};
+
+static int ftfont_build_basic_charsets P_ ((void));
+static Lisp_Object ftfont_pattern_entity P_ ((FcPattern *,
+ Lisp_Object, Lisp_Object));
+static Lisp_Object ftfont_list_generic_family P_ ((Lisp_Object, Lisp_Object,
+ Lisp_Object));
+Lisp_Object ftfont_font_format P_ ((FcPattern *));
+
+#define SYMBOL_FcChar8(SYM) (FcChar8 *) SDATA (SYMBOL_NAME (SYM))
+
+static int
+ftfont_build_basic_charsets ()
+{
+ FcChar32 c;
+
+ cs_iso8859_1 = FcCharSetCreate ();
+ if (! cs_iso8859_1)
+ return -1;
+ for (c = ' '; c < 127; c++)
+ if (! FcCharSetAddChar (cs_iso8859_1, c))
+ return -1;
+#if 0
+ /* This part is currently disabled. Should be fixed later. */
+ for (c = 192; c < 256; c++)
+ if (! FcCharSetAddChar (cs_iso8859_1, c))
+ return -1;
+#endif
+ return 0;
+}
+
+static Lisp_Object
+ftfont_pattern_entity (p, frame, registry)
+ FcPattern *p;
+ Lisp_Object frame, registry;
+{
+ Lisp_Object entity;
+ FcChar8 *file, *fontformat;
+ FcCharSet *charset;
+ char *str;
+ int numeric;
+ double dbl;
+
+ if (FcPatternGetString (p, FC_FILE, 0, &file) != FcResultMatch)
+ return Qnil;
+ if (FcPatternGetCharSet (p, FC_CHARSET, 0, &charset) != FcResultMatch)
+ charset = NULL;
+#ifdef FC_FONTFORMAT
+ if (FcPatternGetString (p, FC_FONTFORMAT, 0, &fontformat) != FcResultMatch)
+#endif /* FC_FONTFORMAT */
+ fontformat = NULL;
+
+ entity = Fmake_vector (make_number (FONT_ENTITY_MAX), null_string);
+
+ ASET (entity, FONT_TYPE_INDEX, Qfreetype);
+ ASET (entity, FONT_REGISTRY_INDEX, registry);
+ ASET (entity, FONT_FRAME_INDEX, frame);
+ ASET (entity, FONT_OBJLIST_INDEX, Qnil);
+
+ if (FcPatternGetString (p, FC_FOUNDRY, 0, (FcChar8 **) &str) == FcResultMatch)
+ ASET (entity, FONT_FOUNDRY_INDEX, intern_downcase (str, strlen (str)));
+ if (FcPatternGetString (p, FC_FAMILY, 0, (FcChar8 **) &str) == FcResultMatch)
+ ASET (entity, FONT_FAMILY_INDEX, intern_downcase (str, strlen (str)));
+ if (FcPatternGetInteger (p, FC_WEIGHT, 0, &numeric) == FcResultMatch)
+ {
+ if (numeric == FC_WEIGHT_REGULAR)
+ numeric = 100;
+ ASET (entity, FONT_WEIGHT_INDEX, make_number (numeric));
+ }
+ if (FcPatternGetInteger (p, FC_SLANT, 0, &numeric) == FcResultMatch)
+ ASET (entity, FONT_SLANT_INDEX, make_number (numeric + 100));
+ if (FcPatternGetInteger (p, FC_WIDTH, 0, &numeric) == FcResultMatch)
+ ASET (entity, FONT_WIDTH_INDEX, make_number (numeric));
+ if (FcPatternGetDouble (p, FC_PIXEL_SIZE, 0, &dbl) == FcResultMatch)
+ ASET (entity, FONT_SIZE_INDEX, make_number (dbl));
+ else
+ ASET (entity, FONT_SIZE_INDEX, make_number (0));
+
+ if (FcPatternGetInteger (p, FC_SPACING, 0, &numeric) != FcResultMatch)
+ numeric = -1;
+ file = FcStrCopy (file);
+ if (! file)
+ return Qnil;
+
+ p = FcPatternCreate ();
+ if (! p)
+ return Qnil;
+
+ if (FcPatternAddString (p, FC_FILE, file) == FcFalse
+ || (charset
+ && FcPatternAddCharSet (p, FC_CHARSET, charset) == FcFalse)
+#ifdef FC_FONTFORMAT
+ || (fontformat
+ && FcPatternAddString (p, FC_FONTFORMAT, fontformat) == FcFalse)
+#endif /* FC_FONTFORMAT */
+ || (numeric >= 0
+ && FcPatternAddInteger (p, FC_SPACING, numeric) == FcFalse))
+ {
+ FcPatternDestroy (p);
+ return Qnil;
+ }
+ ASET (entity, FONT_EXTRA_INDEX, make_save_value (p, 0));
+ return entity;
+}
+
+static Lisp_Object ftfont_generic_family_list;
+
+static Lisp_Object
+ftfont_list_generic_family (spec, frame, registry)
+ Lisp_Object spec, frame, registry;
+{
+ Lisp_Object family = AREF (spec, FONT_FAMILY_INDEX);
+ Lisp_Object slot, list, val;
+
+ if (EQ (family, Qmono))
+ family = Qmonospace;
+ else if (EQ (family, Qsans) || EQ (family, Qsans__serif))
+ family = Qsans_serif;
+ slot = assq_no_quit (family, ftfont_generic_family_list);
+ if (! CONSP (slot))
+ return null_vector;
+ list = XCDR (slot);
+ if (EQ (list, Qt))
+ {
+ /* Not yet listed. */
+ FcObjectSet *objset = NULL;
+ FcPattern *pattern = NULL, *pat = NULL;
+ FcFontSet *fontset = NULL;
+ FcChar8 *fam;
+ int i, j;
+
+ objset = FcObjectSetBuild (FC_FOUNDRY, FC_FAMILY, FC_WEIGHT, FC_SLANT,
+ FC_WIDTH, FC_PIXEL_SIZE, FC_SPACING,
+ FC_CHARSET, FC_FILE,
+#ifdef FC_FONTFORMAT
+ FC_FONTFORMAT,
+#endif /* FC_FONTFORMAT */
+ NULL);
+ if (! objset)
+ goto err;
+ pattern = FcPatternBuild (NULL, FC_FAMILY, FcTypeString,
+ SYMBOL_FcChar8 (family), (char *) 0);
+ if (! pattern)
+ goto err;
+ pat = FcPatternCreate ();
+ if (! pat)
+ goto err;
+ FcConfigSubstitute (NULL, pattern, FcMatchPattern);
+ for (i = 0, val = Qnil;
+ FcPatternGetString (pattern, FC_FAMILY, i, &fam) == FcResultMatch;
+ i++)
+ {
+ if (strcmp ((char *) fam, (char *) SYMBOL_FcChar8 (family)) == 0)
+ continue;
+ if (! FcPatternAddString (pat, FC_FAMILY, fam))
+ goto err;
+ fontset = FcFontList (NULL, pat, objset);
+ if (! fontset)
+ goto err;
+ /* Here we build the list in reverse order so that the last
+ loop in this function build a list in the correct
+ order. */
+ for (j = 0; j < fontset->nfont; j++)
+ {
+ Lisp_Object entity;
+
+ entity = ftfont_pattern_entity (fontset->fonts[j],
+ frame, registry);
+ if (! NILP (entity))
+ val = Fcons (entity, val);
+ }
+ FcFontSetDestroy (fontset);
+ fontset = NULL;
+ FcPatternDel (pat, FC_FAMILY);
+ }
+ list = val;
+ XSETCDR (slot, list);
+ err:
+ if (pat) FcPatternDestroy (pat);
+ if (pattern) FcPatternDestroy (pattern);
+ if (fontset) FcFontSetDestroy (fontset);
+ if (objset) FcObjectSetDestroy (objset);
+ if (EQ (list, Qt))
+ return Qnil;
+ }
+ ASET (spec, FONT_FAMILY_INDEX, Qnil);
+ for (val = Qnil; CONSP (list); list = XCDR (list))
+ if (font_match_p (spec, XCAR (list)))
+ val = Fcons (XCAR (list), val);
+ ASET (spec, FONT_FAMILY_INDEX, family);
+ return Fvconcat (1, &val);
+}
+
+
+static Lisp_Object ftfont_get_cache P_ ((Lisp_Object));
+static Lisp_Object ftfont_list P_ ((Lisp_Object, Lisp_Object));
+static Lisp_Object ftfont_match P_ ((Lisp_Object, Lisp_Object));
+static Lisp_Object ftfont_list_family P_ ((Lisp_Object));
+static void ftfont_free_entity P_ ((Lisp_Object));
+static struct font *ftfont_open P_ ((FRAME_PTR, Lisp_Object, int));
+static void ftfont_close P_ ((FRAME_PTR, struct font *));
+static int ftfont_has_char P_ ((Lisp_Object, int));
+static unsigned ftfont_encode_char P_ ((struct font *, int));
+static int ftfont_text_extents P_ ((struct font *, unsigned *, int,
+ struct font_metrics *));
+static int ftfont_get_bitmap P_ ((struct font *, unsigned,
+ struct font_bitmap *, int));
+static int ftfont_anchor_point P_ ((struct font *, unsigned, int,
+ int *, int *));
+
+struct font_driver ftfont_driver =
+ {
+ 0, /* Qfreetype */
+ ftfont_get_cache,
+ ftfont_list,
+ ftfont_match,
+ ftfont_list_family,
+ ftfont_free_entity,
+ ftfont_open,
+ ftfont_close,
+ /* We can't draw a text without device dependent functions. */
+ NULL,
+ NULL,
+ ftfont_has_char,
+ ftfont_encode_char,
+ ftfont_text_extents,
+ /* We can't draw a text without device dependent functions. */
+ NULL,
+ ftfont_get_bitmap,
+ NULL,
+ NULL,
+ NULL,
+ ftfont_anchor_point,
+#ifdef HAVE_LIBOTF
+ font_otf_capability,
+ font_drive_otf,
+#else
+ NULL,
+ NULL,
+ NULL
+#endif /* HAVE_LIBOTF */
+ };
+
+extern Lisp_Object QCname;
+
+static Lisp_Object
+ftfont_get_cache (frame)
+ Lisp_Object frame;
+{
+ return freetype_font_cache;
+}
+
+static Lisp_Object
+ftfont_list (frame, spec)
+ Lisp_Object frame, spec;
+{
+ Lisp_Object val, tmp, extra;
+ int i;
+ FcPattern *pattern = NULL;
+ FcCharSet *charset = NULL;
+ FcLangSet *langset = NULL;
+ FcFontSet *fontset = NULL;
+ FcObjectSet *objset = NULL;
+ Lisp_Object script;
+ Lisp_Object registry = Qunicode_bmp;
+ int weight = 0;
+ double dpi = -1;
+ int spacing = -1;
+ int scalable = -1;
+ char otf_script[15]; /* For "otlayout\:XXXX" */
+
+ val = null_vector;
+
+ if (! fc_initialized)
+ {
+ FcInit ();
+ fc_initialized = 1;
+ }
+
+ if (! NILP (AREF (spec, FONT_ADSTYLE_INDEX))
+ && ! EQ (AREF (spec, FONT_ADSTYLE_INDEX), null_string))
+ return val;
+ if (! NILP (AREF (spec, FONT_SLANT_INDEX))
+ && XINT (AREF (spec, FONT_SLANT_INDEX)) < 100)
+ /* Fontconfig doesn't support reverse-italic/obligue. */
+ return val;
+
+ if (! NILP (AREF (spec, FONT_REGISTRY_INDEX)))
+ {
+ registry = AREF (spec, FONT_REGISTRY_INDEX);
+ if (EQ (registry, Qiso8859_1))
+ {
+ if (! cs_iso8859_1
+ && ftfont_build_basic_charsets () < 0)
+ return Qnil;
+ charset = cs_iso8859_1;
+ }
+ else if (! EQ (registry, Qiso10646_1)
+ && ! EQ (registry, Qunicode_bmp)
+ && ! EQ (registry, Qunicode_sip))
+ return val;
+ }
+
+ otf_script[0] = '\0';
+ script = Qnil;
+ for (extra = AREF (spec, FONT_EXTRA_INDEX);
+ CONSP (extra); extra = XCDR (extra))
+ {
+ Lisp_Object key, val;
+
+ tmp = XCAR (extra);
+ key = XCAR (tmp), val = XCDR (tmp);
+ if (EQ (key, QCotf))
+ {
+ script = assq_no_quit (val, Votf_script_alist);
+ if (CONSP (script) && SYMBOLP (XCDR (script)))
+ script = XCDR (script);
+ tmp = SYMBOL_NAME (val);
+ sprintf (otf_script, "otlayout:%s", (char *) SDATA (tmp));
+ }
+ else if (EQ (key, QClanguage))
+ {
+ langset = FcLangSetCreate ();
+ if (! langset)
+ goto err;
+ if (SYMBOLP (val))
+ {
+ if (! FcLangSetAdd (langset, SYMBOL_FcChar8 (val)))
+ goto err;
+ }
+ else
+ for (; CONSP (val); val = XCDR (val))
+ if (SYMBOLP (XCAR (val))
+ && ! FcLangSetAdd (langset, SYMBOL_FcChar8 (XCAR (val))))
+ goto err;
+ }
+ else if (EQ (key, QCscript))
+ script = val;
+ else if (EQ (key, QCdpi))
+ dpi = XINT (val);
+ else if (EQ (key, QCspacing))
+ spacing = XINT (val);
+ else if (EQ (key, QCscalable))
+ scalable = ! NILP (val);
+ }
+
+ if (! NILP (script) && ! charset)
+ {
+ Lisp_Object chars = assq_no_quit (script, Vscript_representative_chars);
+
+ if (CONSP (chars))
+ {
+ charset = FcCharSetCreate ();
+ if (! charset)
+ goto err;
+ for (chars = XCDR (chars); CONSP (chars); chars = XCDR (chars))
+ if (CHARACTERP (XCAR (chars))
+ && ! FcCharSetAddChar (charset, XUINT (XCAR (chars))))
+ goto err;
+ }
+ }
+
+ pattern = FcPatternCreate ();
+ if (! pattern)
+ goto err;
+ tmp = AREF (spec, FONT_FOUNDRY_INDEX);
+ if (SYMBOLP (tmp) && ! NILP (tmp)
+ && ! FcPatternAddString (pattern, FC_FOUNDRY, SYMBOL_FcChar8 (tmp)))
+ goto err;
+ tmp = AREF (spec, FONT_FAMILY_INDEX);
+ if (SYMBOLP (tmp) && ! NILP (tmp)
+ && ! FcPatternAddString (pattern, FC_FAMILY, SYMBOL_FcChar8 (tmp)))
+ goto err;
+ /* Emacs conventionally doesn't distinguish normal, regular, and
+ medium weight, but fontconfig does. So, we can't restrict font
+ listing by weight. We check it after getting a list. */
+ tmp = AREF (spec, FONT_WEIGHT_INDEX);
+ if (INTEGERP (tmp))
+ weight = XINT (tmp);
+ tmp = AREF (spec, FONT_SLANT_INDEX);
+ if (INTEGERP (tmp)
+ && ! FcPatternAddInteger (pattern, FC_SLANT, XINT (tmp) - 100))
+ goto err;
+ tmp = AREF (spec, FONT_WIDTH_INDEX);
+ if (INTEGERP (tmp)
+ && ! FcPatternAddInteger (pattern, FC_WIDTH, XINT (tmp)))
+ goto err;
+
+ if (charset
+ && ! FcPatternAddCharSet (pattern, FC_CHARSET, charset))
+ goto err;
+ if (langset
+ && ! FcPatternAddLangSet (pattern, FC_LANG, langset))
+ goto err;
+ if (dpi >= 0
+ && ! FcPatternAddDouble (pattern, FC_DPI, dpi))
+ goto err;
+ if (spacing >= 0
+ && ! FcPatternAddInteger (pattern, FC_SPACING, spacing))
+ goto err;
+ if (scalable >= 0
+ && ! FcPatternAddBool (pattern, FC_SCALABLE, scalable ? FcTrue : FcFalse))
+ goto err;
+
+ objset = FcObjectSetBuild (FC_FOUNDRY, FC_FAMILY, FC_WEIGHT, FC_SLANT,
+ FC_WIDTH, FC_PIXEL_SIZE, FC_SPACING,
+ FC_CHARSET, FC_FILE,
+#ifdef FC_FONTFORMAT
+ FC_FONTFORMAT,
+#endif /* FC_FONTFORMAT */
+ NULL);
+ if (! objset)
+ goto err;
+ if (otf_script[0])
+ {
+#ifndef FC_CAPABILITY
+ goto finish;
+#else /* not FC_CAPABILITY */
+ if (! FcObjectSetAdd (objset, FC_CAPABILITY))
+ goto err;
+#endif /* not FC_CAPABILITY */
+ }
+
+ fontset = FcFontList (NULL, pattern, objset);
+ if (! fontset)
+ goto err;
+
+ if (fontset->nfont > 0)
+ {
+ double pixel_size;
+
+ if (NILP (AREF (spec, FONT_SIZE_INDEX)))
+ pixel_size = 0;
+ else
+ pixel_size = XINT (AREF (spec, FONT_SIZE_INDEX));
+
+ for (i = 0, val = Qnil; i < fontset->nfont; i++)
+ {
+ Lisp_Object entity;
+
+ if (pixel_size > 0)
+ {
+ double this;
+
+ if (FcPatternGetDouble (fontset->fonts[i], FC_PIXEL_SIZE, 0,
+ &this) == FcResultMatch
+ && ((this < pixel_size - FONT_PIXEL_SIZE_QUANTUM)
+ || (this > pixel_size + FONT_PIXEL_SIZE_QUANTUM)))
+ continue;
+ }
+ if (weight > 0)
+ {
+ int this;
+
+ if (FcPatternGetInteger (fontset->fonts[i], FC_WEIGHT, 0,
+ &this) != FcResultMatch
+ || (this != weight
+ && (weight != 100
+ || this < FC_WEIGHT_REGULAR
+ || this > FC_WEIGHT_MEDIUM)))
+ continue;
+ }
+#ifdef FC_CAPABILITY
+ if (otf_script[0])
+ {
+ FcChar8 *this;
+
+ if (FcPatternGetString (fontset->fonts[i], FC_CAPABILITY, 0,
+ &this) != FcResultMatch
+ || ! strstr ((char *) this, otf_script))
+ continue;
+ }
+#endif /* FC_CAPABILITY */
+ entity = ftfont_pattern_entity (fontset->fonts[i], frame, registry);
+ if (! NILP (entity))
+ val = Fcons (entity, val);
+ }
+ val = Fvconcat (1, &val);
+ }
+ else if (! NILP (AREF (spec, FONT_FAMILY_INDEX)))
+ val = ftfont_list_generic_family (spec, frame, registry);
+ goto finish;
+
+ err:
+ /* We come here because of unexpected error in fontconfig API call
+ (usually insufficient memory). */
+ val = Qnil;
+
+ finish:
+ if (charset && charset != cs_iso8859_1) FcCharSetDestroy (charset);
+ if (objset) FcObjectSetDestroy (objset);
+ if (fontset) FcFontSetDestroy (fontset);
+ if (langset) FcLangSetDestroy (langset);
+ if (pattern) FcPatternDestroy (pattern);
+
+ return val;
+}
+
+static Lisp_Object
+ftfont_match (frame, spec)
+ Lisp_Object frame, spec;
+{
+ Lisp_Object extra, val, entity;
+ FcPattern *pattern = NULL, *match = NULL;
+ FcResult result;
+
+ if (! fc_initialized)
+ {
+ FcInit ();
+ fc_initialized = 1;
+ }
+
+ extra = AREF (spec, FONT_EXTRA_INDEX);
+ val = assq_no_quit (QCname, extra);
+ if (! CONSP (val) || ! STRINGP (XCDR (val)))
+ return Qnil;
+
+ entity = Qnil;
+ pattern = FcNameParse (SDATA (XCDR (val)));
+ if (pattern)
+ {
+ if (FcConfigSubstitute (NULL, pattern, FcMatchPattern) == FcTrue)
+ {
+ FcDefaultSubstitute (pattern);
+ match = FcFontMatch (NULL, pattern, &result);
+ if (match)
+ {
+ entity = ftfont_pattern_entity (match, frame, Qunicode_bmp);
+ FcPatternDestroy (match);
+ }
+ }
+ FcPatternDestroy (pattern);
+ }
+
+ return entity;
+}
+
+static Lisp_Object
+ftfont_list_family (frame)
+ Lisp_Object frame;
+{
+ Lisp_Object list;
+ FcPattern *pattern = NULL;
+ FcFontSet *fontset = NULL;
+ FcObjectSet *objset = NULL;
+ int i;
+
+ if (! fc_initialized)
+ {
+ FcInit ();
+ fc_initialized = 1;
+ }
+
+ pattern = FcPatternCreate ();
+ if (! pattern)
+ goto finish;
+ objset = FcObjectSetBuild (FC_FAMILY, NULL);
+ if (! objset)
+ goto finish;
+ fontset = FcFontList (NULL, pattern, objset);
+ if (! fontset)
+ goto finish;
+
+ list = Qnil;
+ for (i = 0; i < fontset->nfont; i++)
+ {
+ FcPattern *pat = fontset->fonts[i];
+ FcChar8 *str;
+
+ if (FcPatternGetString (pat, FC_FAMILY, 0, &str) == FcResultMatch)
+ list = Fcons (intern_downcase ((char *) str, strlen ((char *) str)),
+ list);
+ }
+
+ finish:
+ if (objset) FcObjectSetDestroy (objset);
+ if (fontset) FcFontSetDestroy (fontset);
+ if (pattern) FcPatternDestroy (pattern);
+
+ return list;
+}
+
+
+static void
+ftfont_free_entity (entity)
+ Lisp_Object entity;
+{
+ Lisp_Object val = AREF (entity, FONT_EXTRA_INDEX);
+ FcPattern *pattern = XSAVE_VALUE (val)->pointer;
+
+ FcPatternDestroy (pattern);
+}
+
+static struct font *
+ftfont_open (f, entity, pixel_size)
+ FRAME_PTR f;
+ Lisp_Object entity;
+ int pixel_size;
+{
+ struct ftfont_info *ftfont_info;
+ struct font *font;
+ FT_Face ft_face;
+ FT_Size ft_size;
+ FT_UInt size;
+ Lisp_Object val;
+ FcPattern *pattern;
+ FcChar8 *file;
+ int spacing;
+ char *name;
+ int len;
+
+ val = AREF (entity, FONT_EXTRA_INDEX);
+ if (XTYPE (val) != Lisp_Misc
+ || XMISCTYPE (val) != Lisp_Misc_Save_Value)
+ return NULL;
+ pattern = XSAVE_VALUE (val)->pointer;
+ if (XSAVE_VALUE (val)->integer == 0)
+ {
+ /* We have not yet created FT_Face for this font. */
+ if (! ft_library
+ && FT_Init_FreeType (&ft_library) != 0)
+ return NULL;
+ if (FcPatternGetString (pattern, FC_FILE, 0, &file) != FcResultMatch)
+ return NULL;
+ if (FT_New_Face (ft_library, (char *) file, 0, &ft_face) != 0)
+ return NULL;
+ FcPatternAddFTFace (pattern, FC_FT_FACE, ft_face);
+ ft_size = ft_face->size;
+ }
+ else
+ {
+ if (FcPatternGetFTFace (pattern, FC_FT_FACE, 0, &ft_face)
+ != FcResultMatch)
+ return NULL;
+ if (FT_New_Size (ft_face, &ft_size) != 0)
+ return NULL;
+ if (FT_Activate_Size (ft_size) != 0)
+ {
+ FT_Done_Size (ft_size);
+ return NULL;
+ }
+ }
+
+ size = XINT (AREF (entity, FONT_SIZE_INDEX));
+ if (size == 0)
+ size = pixel_size;
+ if (FT_Set_Pixel_Sizes (ft_face, size, size) != 0)
+ {
+ if (XSAVE_VALUE (val)->integer == 0)
+ FT_Done_Face (ft_face);
+ return NULL;
+ }
+
+ ftfont_info = malloc (sizeof (struct ftfont_info));
+ if (! ftfont_info)
+ return NULL;
+ ftfont_info->ft_size = ft_size;
+
+ font = (struct font *) ftfont_info;
+ font->format = ftfont_font_format (pattern);
+ font->entity = entity;
+ font->pixel_size = size;
+ font->driver = &ftfont_driver;
+ len = 96;
+ name = malloc (len);
+ while (name && font_unparse_fcname (entity, pixel_size, name, len) < 0)
+ {
+ char *new = realloc (name, len += 32);
+
+ if (! new)
+ free (name);
+ name = new;
+ }
+ font->font.full_name = font->font.name = name;
+ font->file_name = (char *) file;
+ font->font.size = ft_face->size->metrics.max_advance >> 6;
+ if (font->font.size <= 0)
+ font->font.size = size;
+ font->font.charset = font->encoding_charset = font->repertory_charset = -1;
+ font->ascent = ft_face->size->metrics.ascender >> 6;
+ font->descent = - ft_face->size->metrics.descender >> 6;
+ font->font.height = font->ascent + font->descent;
+ if (FcPatternGetInteger (pattern, FC_SPACING, 0, &spacing) != FcResultMatch)
+ spacing = FC_PROPORTIONAL;
+ if (spacing != FC_PROPORTIONAL)
+ font->font.average_width = font->font.space_width = font->font.size;
+ else
+ {
+ int i;
+
+ for (i = 32; i < 127; i++)
+ {
+ if (FT_Load_Char (ft_face, i, FT_LOAD_DEFAULT) != 0)
+ break;
+ if (i == 32)
+ font->font.space_width = ft_face->glyph->metrics.horiAdvance >> 6;
+ font->font.average_width += ft_face->glyph->metrics.horiAdvance >> 6;
+ }
+ if (i == 127)
+ {
+ /* The font contains all ASCII printable characters. */
+ font->font.average_width /= 95;
+ }
+ else
+ {
+ if (i == 32)
+ font->font.space_width = font->font.size;
+ font->font.average_width = font->font.size;
+ }
+ }
+
+ /* Unfortunately FreeType doesn't provide a way to get minimum char
+ width. So, we use space_width instead. */
+ font->min_width = font->font.space_width;
+
+ font->font.baseline_offset = 0;
+ font->font.relative_compose = 0;
+ font->font.default_ascent = 0;
+ font->font.vertical_centering = 0;
+
+ (XSAVE_VALUE (val)->integer)++;
+
+ return font;
+}
+
+static void
+ftfont_close (f, font)
+ FRAME_PTR f;
+ struct font *font;
+{
+ struct ftfont_info *ftfont_info = (struct ftfont_info *) font;
+ Lisp_Object entity = font->entity;
+ Lisp_Object val = AREF (entity, FONT_EXTRA_INDEX);
+
+ (XSAVE_VALUE (val)->integer)--;
+ if (XSAVE_VALUE (val)->integer == 0)
+ FT_Done_Face (ftfont_info->ft_size->face);
+ else
+ FT_Done_Size (ftfont_info->ft_size);
+
+ free (font);
+}
+
+static int
+ftfont_has_char (entity, c)
+ Lisp_Object entity;
+ int c;
+{
+ Lisp_Object val;
+ FcPattern *pattern;
+ FcCharSet *charset;
+
+ val = AREF (entity, FONT_EXTRA_INDEX);
+ pattern = XSAVE_VALUE (val)->pointer;
+ if (FcPatternGetCharSet (pattern, FC_CHARSET, 0, &charset) != FcResultMatch)
+ return -1;
+ return (FcCharSetHasChar (charset, (FcChar32) c) == FcTrue);
+}
+
+static unsigned
+ftfont_encode_char (font, c)
+ struct font *font;
+ int c;
+{
+ struct ftfont_info *ftfont_info = (struct ftfont_info *) font;
+ FT_Face ft_face = ftfont_info->ft_size->face;
+ FT_ULong charcode = c;
+ FT_UInt code = FT_Get_Char_Index (ft_face, charcode);
+
+ return (code > 0 ? code : 0xFFFFFFFF);
+}
+
+static int
+ftfont_text_extents (font, code, nglyphs, metrics)
+ struct font *font;
+ unsigned *code;
+ int nglyphs;
+ struct font_metrics *metrics;
+{
+ struct ftfont_info *ftfont_info = (struct ftfont_info *) font;
+ FT_Face ft_face = ftfont_info->ft_size->face;
+ int width = 0;
+ int i;
+
+ if (ftfont_info->ft_size != ft_face->size)
+ FT_Activate_Size (ftfont_info->ft_size);
+ if (metrics)
+ bzero (metrics, sizeof (struct font_metrics));
+ for (i = 0; i < nglyphs; i++)
+ {
+ if (FT_Load_Glyph (ft_face, code[i], FT_LOAD_DEFAULT) == 0)
+ {
+ FT_Glyph_Metrics *m = &ft_face->glyph->metrics;
+
+ if (metrics)
+ {
+ if (metrics->lbearing > width + (m->horiBearingX >> 6))
+ metrics->lbearing = width + (m->horiBearingX >> 6);
+ if (metrics->rbearing
+ < width + ((m->horiBearingX + m->width) >> 6))
+ metrics->rbearing
+ = width + ((m->horiBearingX + m->width) >> 6);
+ if (metrics->ascent < (m->horiBearingY >> 6))
+ metrics->ascent = m->horiBearingY >> 6;
+ if (metrics->descent > ((m->horiBearingY + m->height) >> 6))
+ metrics->descent = (m->horiBearingY + m->height) >> 6;
+ }
+ width += m->horiAdvance >> 6;
+ }
+ else
+ {
+ width += font->font.space_width;
+ }
+ }
+ if (metrics)
+ metrics->width = width;
+
+ return width;
+}
+
+static int
+ftfont_get_bitmap (font, code, bitmap, bits_per_pixel)
+ struct font *font;
+ unsigned code;
+ struct font_bitmap *bitmap;
+ int bits_per_pixel;
+{
+ struct ftfont_info *ftfont_info = (struct ftfont_info *) font;
+ FT_Face ft_face = ftfont_info->ft_size->face;
+ FT_Int32 load_flags = FT_LOAD_RENDER;
+
+ if (ftfont_info->ft_size != ft_face->size)
+ FT_Activate_Size (ftfont_info->ft_size);
+ if (bits_per_pixel == 1)
+ {
+#ifdef FT_LOAD_TARGET_MONO
+ load_flags |= FT_LOAD_TARGET_MONO;
+#else
+ load_flags |= FT_LOAD_MONOCHROME;
+#endif
+ }
+ else if (bits_per_pixel != 8)
+ /* We don't support such a rendering. */
+ return -1;
+
+ if (FT_Load_Glyph (ft_face, code, load_flags) != 0)
+ return -1;
+ bitmap->rows = ft_face->glyph->bitmap.rows;
+ bitmap->width = ft_face->glyph->bitmap.width;
+ bitmap->pitch = ft_face->glyph->bitmap.pitch;
+ bitmap->buffer = ft_face->glyph->bitmap.buffer;
+ bitmap->left = ft_face->glyph->bitmap_left;
+ bitmap->top = ft_face->glyph->bitmap_top;
+ bitmap->advance = ft_face->glyph->metrics.horiAdvance >> 6;
+ bitmap->extra = NULL;
+
+ return 0;
+}
+
+static int
+ftfont_anchor_point (font, code, index, x, y)
+ struct font *font;
+ unsigned code;
+ int index;
+ int *x, *y;
+{
+ struct ftfont_info *ftfont_info = (struct ftfont_info *) font;
+ FT_Face ft_face = ftfont_info->ft_size->face;
+
+ if (ftfont_info->ft_size != ft_face->size)
+ FT_Activate_Size (ftfont_info->ft_size);
+ if (FT_Load_Glyph (ft_face, code, FT_LOAD_DEFAULT) != 0)
+ return -1;
+ if (ft_face->glyph->format != FT_GLYPH_FORMAT_OUTLINE)
+ return -1;
+ if (index >= ft_face->glyph->outline.n_points)
+ return -1;
+ *x = ft_face->glyph->outline.points[index].x;
+ *y = ft_face->glyph->outline.points[index].y;
+ return 0;
+}
+
+Lisp_Object
+ftfont_font_format (FcPattern *pattern)
+{
+ FcChar8 *str;
+
+#ifdef FC_FONTFORMAT
+ if (FcPatternGetString (pattern, FC_FONTFORMAT, 0, &str) != FcResultMatch)
+ return Qnil;
+ if (strcmp ((char *) str, "TrueType") == 0)
+ return intern ("truetype");
+ if (strcmp ((char *) str, "Type 1") == 0)
+ return intern ("type1");
+ if (strcmp ((char *) str, "PCF") == 0)
+ return intern ("pcf");
+ if (strcmp ((char *) str, "BDF") == 0)
+ return intern ("bdf");
+#else /* not FC_FONTFORMAT */
+ if (FcPatternGetString (pattern, FC_FILE, 0, &str) != FcResultMatch)
+ return Qnil;
+ if (strcasestr ((char *) str, ".ttf") == 0)
+ return intern ("truetype");
+ if (strcasestr ((char *) str, "pfb") == 0)
+ return intern ("type1");
+ if (strcasestr ((char *) str, "pcf") == 0)
+ return intern ("pcf");
+ if (strcasestr ((char *) str, "bdf") == 0)
+ return intern ("bdf");
+#endif /* not FC_FONTFORMAT */
+ return intern ("unknown");
+}
+
+
+void
+syms_of_ftfont ()
+{
+ DEFSYM (Qfreetype, "freetype");
+ DEFSYM (Qmonospace, "monospace");
+ DEFSYM (Qsans_serif, "sans-serif");
+ DEFSYM (Qserif, "serif");
+ DEFSYM (Qmono, "mono");
+ DEFSYM (Qsans, "sans");
+ DEFSYM (Qsans__serif, "sans serif");
+
+ staticpro (&freetype_font_cache);
+ freetype_font_cache = Fcons (Qt, Qnil);
+
+ staticpro (&ftfont_generic_family_list);
+ ftfont_generic_family_list
+ = Fcons (Fcons (Qmonospace, Qt),
+ Fcons (Fcons (Qsans_serif, Qt),
+ Fcons (Fcons (Qsans, Qt), Qnil)));
+
+ ftfont_driver.type = Qfreetype;
+ register_font_driver (&ftfont_driver, NULL);
+}
+
+/* arch-tag: 7cfa432c-33a6-4988-83d2-a82ed8604aca
+ (do not change this comment) */
diff --git a/src/ftxfont.c b/src/ftxfont.c
new file mode 100644
index 0000000000..831b75c4d4
--- /dev/null
+++ b/src/ftxfont.c
@@ -0,0 +1,437 @@
+/* ftxfont.c -- FreeType font driver on X (without using XFT).
+ Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006
+ National Institute of Advanced Industrial Science and Technology (AIST)
+ Registration Number H13PRO009
+
+This file is part of GNU Emacs.
+
+GNU Emacs is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Emacs is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Emacs; see the file COPYING. If not, write to
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+#include <config.h>
+#include <stdio.h>
+#include <X11/Xlib.h>
+
+#include "lisp.h"
+#include "dispextern.h"
+#include "xterm.h"
+#include "frame.h"
+#include "blockinput.h"
+#include "character.h"
+#include "charset.h"
+#include "fontset.h"
+#include "font.h"
+
+/* FTX font driver. */
+
+static Lisp_Object Qftx;
+
+/* Prototypes for helper function. */
+static int ftxfont_create_gcs P_ ((FRAME_PTR, GC *,
+ unsigned long, unsigned long));
+static int ftxfont_draw_bitmap P_ ((FRAME_PTR, GC *, struct font *, unsigned,
+ int, int, XPoint *, int, int *n));
+static void ftxfont_draw_backgrond P_ ((FRAME_PTR, struct font *, GC,
+ int, int, int));
+static Font ftxfont_default_fid P_ ((FRAME_PTR));
+
+/* Create 6 GCs for antialiasing by interpolating colors FOREGROUND
+ and BACKGROUND. GCS[0] is closest to BACKGROUND, and GCS[5] is
+ closest to FOREGROUND. */
+
+static int
+ftxfont_create_gcs (f, gcs, foreground, background)
+ FRAME_PTR f;
+ GC *gcs;
+ unsigned long foreground, background;
+{
+ XColor colors[3];
+ XGCValues xgcv;
+ int i;
+
+ colors[0].pixel = foreground;
+ colors[1].pixel = background;
+
+ BLOCK_INPUT;
+ XQueryColors (FRAME_X_DISPLAY (f), FRAME_X_COLORMAP (f), colors, 2);
+ for (i = 1; i < 7; i++)
+ {
+ colors[2].red = (colors[0].red * i + colors[1].red * (8 - i)) / 8;
+ colors[2].green = (colors[0].green * i + colors[1].green * (8 - i)) / 8;
+ colors[2].blue = (colors[0].blue * i + colors[1].blue * (8 - i)) / 8;
+ if (! x_alloc_nearest_color (f, FRAME_X_COLORMAP (f), &colors[2]))
+ break;
+ xgcv.foreground = colors[2].pixel;
+ gcs[i - 1] = XCreateGC (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
+ GCForeground, &xgcv);
+ }
+ UNBLOCK_INPUT;
+
+ if (i < 7)
+ {
+ BLOCK_INPUT;
+ for (i--; i >= 0; i--)
+ XFreeGC (FRAME_X_DISPLAY (f), gcs[i]);
+ UNBLOCK_INPUT;
+ return -1;
+ }
+ return 0;
+}
+
+static int
+ftxfont_draw_bitmap (f, gc, font, code, x, y, p, size, n)
+ FRAME_PTR f;
+ GC *gc;
+ struct font *font;
+ unsigned code;
+ int x, y;
+ XPoint *p;
+ int size, *n;
+{
+ struct font_bitmap bitmap;
+ unsigned char *b;
+ int i, j;
+
+ if (ftfont_driver.get_bitmap (font, code, &bitmap, size > 0x100 ? 1 : 8) < 0)
+ return 0;
+ for (i = 0, b = bitmap.buffer; i < bitmap.rows;
+ i++, b += bitmap.pitch)
+ {
+ if (size > 0x100)
+ {
+ for (j = 0; j < bitmap.width; j++)
+ if (b[j / 8] & (1 << (7 - (j % 8))))
+ {
+ p[n[0]].x = x + bitmap.left + j;
+ p[n[0]].y = y - bitmap.top + i;
+ if (++n[0] == 0x400)
+ {
+ XDrawPoints (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
+ gc[0], p, size, CoordModeOrigin);
+ n[0] = 0;
+ }
+ }
+ }
+ else
+ {
+ for (j = 0; j < bitmap.width; j++)
+ {
+ int idx = (b[j] >> 5) - 1;
+
+ if (idx >= 0)
+ {
+ XPoint *pp = p + size * idx;
+
+ pp[n[idx]].x = x + bitmap.left + j;
+ pp[n[idx]].y = y - bitmap.top + i;
+ if (++(n[idx]) == 0x100)
+ {
+ XDrawPoints (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
+ gc[idx], pp, size, CoordModeOrigin);
+ n[idx] = 0;
+ }
+ }
+ }
+ }
+ }
+
+ if (ftfont_driver.free_bitmap)
+ ftfont_driver.free_bitmap (font, &bitmap);
+
+ return bitmap.advance;
+}
+
+static void
+ftxfont_draw_backgrond (f, font, gc, x, y, width)
+ FRAME_PTR f;
+ struct font *font;
+ GC gc;
+ int x, y, width;
+{
+ XGCValues xgcv;
+
+ XGetGCValues (FRAME_X_DISPLAY (f), gc,
+ GCForeground | GCBackground, &xgcv);
+ XSetForeground (FRAME_X_DISPLAY (f), gc, xgcv.background);
+ XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc,
+ x, y - font->ascent, width, y + font->descent);
+ XSetForeground (FRAME_X_DISPLAY (f), gc, xgcv.foreground);
+}
+
+/* Return the default Font ID on frame F. */
+
+static Font
+ftxfont_default_fid (f)
+ FRAME_PTR f;
+{
+ static int fid_known;
+ static Font fid;
+
+ if (! fid_known)
+ {
+ fid = XLoadFont (FRAME_X_DISPLAY (f), "fixed");
+ if (! fid)
+ {
+ fid = XLoadFont (FRAME_X_DISPLAY (f), "*");
+ if (! fid)
+ abort ();
+ }
+ fid_known = 1;
+ }
+ return fid;
+}
+
+/* Prototypes for font-driver methods. */
+static Lisp_Object ftxfont_list P_ ((Lisp_Object, Lisp_Object));
+static Lisp_Object ftxfont_match P_ ((Lisp_Object, Lisp_Object));
+static struct font *ftxfont_open P_ ((FRAME_PTR, Lisp_Object, int));
+static void ftxfont_close P_ ((FRAME_PTR, struct font *));
+static int ftxfont_prepare_face (FRAME_PTR, struct face *);
+static void ftxfont_done_face (FRAME_PTR, struct face *);
+
+static int ftxfont_draw P_ ((struct glyph_string *, int, int, int, int, int));
+
+struct font_driver ftxfont_driver;
+
+static Lisp_Object
+ftxfont_list (frame, spec)
+ Lisp_Object frame;
+ Lisp_Object spec;
+{
+ Lisp_Object val = ftfont_driver.list (frame, spec);
+
+ if (! NILP (val))
+ {
+ int i;
+
+ for (i = 0; i < ASIZE (val); i++)
+ ASET (AREF (val, i), FONT_TYPE_INDEX, Qftx);
+ }
+ return val;
+}
+
+static Lisp_Object
+ftxfont_match (frame, spec)
+ Lisp_Object frame;
+ Lisp_Object spec;
+{
+ Lisp_Object entity = ftfont_driver.match (frame, spec);
+
+ if (VECTORP (entity))
+ ASET (entity, FONT_TYPE_INDEX, Qftx);
+ return entity;
+}
+
+static struct font *
+ftxfont_open (f, entity, pixel_size)
+ FRAME_PTR f;
+ Lisp_Object entity;
+ int pixel_size;
+{
+ Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
+ struct font *font;
+ XFontStruct *xfont = malloc (sizeof (XFontStruct));
+
+ if (! xfont)
+ return NULL;
+ font = ftfont_driver.open (f, entity, pixel_size);
+ if (! font)
+ {
+ free (xfont);
+ return NULL;
+ }
+
+ xfont->fid = ftxfont_default_fid (f);
+ xfont->ascent = font->ascent;
+ xfont->descent = font->descent;
+ xfont->max_bounds.width = font->font.size;
+ xfont->min_bounds.width = font->min_width;
+ font->font.font = xfont;
+ font->driver = &ftxfont_driver;
+
+ dpyinfo->n_fonts++;
+
+ /* Set global flag fonts_changed_p to non-zero if the font loaded
+ has a character with a smaller width than any other character
+ before, or if the font loaded has a smaller height than any other
+ font loaded before. If this happens, it will make a glyph matrix
+ reallocation necessary. */
+ if (dpyinfo->n_fonts == 1)
+ {
+ dpyinfo->smallest_font_height = font->font.height;
+ dpyinfo->smallest_char_width = font->min_width;
+ fonts_changed_p = 1;
+ }
+ else
+ {
+ if (dpyinfo->smallest_font_height > font->font.height)
+ dpyinfo->smallest_font_height = font->font.height, fonts_changed_p |= 1;
+ if (dpyinfo->smallest_char_width > font->min_width)
+ dpyinfo->smallest_char_width = font->min_width, fonts_changed_p |= 1;
+ }
+
+ return font;
+}
+
+static void
+ftxfont_close (f, font)
+ FRAME_PTR f;
+ struct font *font;
+{
+ ftfont_driver.close (f, font);
+ FRAME_X_DISPLAY_INFO (f)->n_fonts--;
+}
+
+static int
+ftxfont_prepare_face (f, face)
+ FRAME_PTR f;
+ struct face *face;
+{
+ struct font *font = (struct font *) face->font_info;
+ GC gcs[6];
+ int i;
+
+ face->extra = NULL;
+
+ if (! font->scalable)
+ return 0;
+
+ if (ftxfont_create_gcs (f, gcs, face->foreground, face->background) < 0)
+ /* Give up antialiasing. */
+ return 0;
+
+ face->extra = malloc (sizeof (GC) * 7);
+ if (! face->extra)
+ return -1;
+ for (i = 0; i < 6; i++)
+ ((GC *) face->extra)[i] = gcs[i];
+ ((GC *) face->extra)[i] = face->gc;
+ return 0;
+}
+
+static void
+ftxfont_done_face (f, face)
+ FRAME_PTR f;
+ struct face *face;
+{
+ if (face->extra)
+ {
+ int i;
+
+ BLOCK_INPUT;
+ for (i = 0; i < 6; i++)
+ XFreeGC (FRAME_X_DISPLAY (f), ((GC *) face->extra)[i]);
+ UNBLOCK_INPUT;
+ free (face->extra);
+ face->extra = NULL;
+ }
+}
+
+static int
+ftxfont_draw (s, from, to, x, y, with_background)
+ struct glyph_string *s;
+ int from, to, x, y, with_background;
+{
+ FRAME_PTR f = s->f;
+ struct face *face = s->face;
+ struct font *font = (struct font *) face->font_info;
+ XPoint p[0x700];
+ int n[7];
+ unsigned *code;
+ int len = to - from;
+ int i;
+ GC *gcs;
+
+ n[0] = n[1] = n[2] = n[3] = n[4] = n[5] = n[6] = 0;
+
+ BLOCK_INPUT;
+
+ if (with_background)
+ ftxfont_draw_backgrond (f, font, s->gc, x, y, s->width);
+ code = alloca (sizeof (unsigned) * len);
+ for (i = 0; i < len; i++)
+ code[i] = ((XCHAR2B_BYTE1 (s->char2b + from + i) << 8)
+ | XCHAR2B_BYTE2 (s->char2b + from + i));
+
+ gcs = face->extra;
+ if (gcs && face->gc != s->gc)
+ {
+ /* We are drawing for cursor or for mouse highlighting, and
+ can't use the prepared GCs. */
+ XGCValues xgcv;
+ unsigned long mask = GCForeground | GCBackground;
+
+ gcs = alloca (sizeof (GC) * 7);
+ XGetGCValues (FRAME_X_DISPLAY (f), s->gc, mask, &xgcv);
+ if (ftxfont_create_gcs (f, gcs, xgcv.foreground, xgcv.background) < 0)
+ gcs = NULL;
+ gcs[6] = s->gc;
+ }
+
+ if (! gcs)
+ {
+ /* We are drawing with a bitmap font which doesn't use
+ antialiasing. */
+ for (i = 0; i < len; i++)
+ x += ftxfont_draw_bitmap (f, &s->gc, font, code[i], x, y,
+ p, 0x700, n);
+ if (n[0] > 0)
+ XDrawPoints (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
+ s->gc, p, n[0], CoordModeOrigin);
+ }
+ else
+ {
+ /* We are drawing with a scalable font which use
+ antialiasing. */
+ for (i = 0; i < len; i++)
+ x += ftxfont_draw_bitmap (f, gcs, font, code[i], x, y,
+ p, 0x100, n);
+ for (i = 0; i < 7; i++)
+ if (n[i] > 0)
+ XDrawPoints (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
+ gcs[i], p + 0x100 * i, n[i], CoordModeOrigin);
+ if (face->gc != s->gc)
+ for (i = 0; i < 6; i++)
+ XFreeGC (FRAME_X_DISPLAY (f), gcs[i]);
+ }
+
+ UNBLOCK_INPUT;
+
+ return len;
+}
+
+
+
+void
+syms_of_ftxfont ()
+{
+ DEFSYM (Qftx, "ftx");
+
+ ftxfont_driver = ftfont_driver;
+ ftxfont_driver.type = Qftx;
+ ftxfont_driver.list = ftxfont_list;
+ ftxfont_driver.match = ftxfont_match;
+ ftxfont_driver.open = ftxfont_open;
+ ftxfont_driver.close = ftxfont_close;
+ ftxfont_driver.prepare_face = ftxfont_prepare_face;
+ ftxfont_driver.done_face = ftxfont_done_face;
+ ftxfont_driver.draw = ftxfont_draw;
+
+ register_font_driver (&ftxfont_driver, NULL);
+}
+
+/* arch-tag: 59bd3469-5330-413f-b29d-1aa36492abe8
+ (do not change this comment) */
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 81ef09b7ec..9fb011de91 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -51,13 +51,6 @@ Boston, MA 02110-1301, USA. */
#ifdef HAVE_GTK_MULTIDISPLAY
-/* Gtk does not work well without any display open. Emacs may close
- all its displays. In that case, keep a display around just for
- the purpose of having one. */
-
-static GdkDisplay *gdpy_def;
-
-
/* Return the GdkDisplay that corresponds to the X display DPY. */
static GdkDisplay *
@@ -154,15 +147,9 @@ xg_display_close (Display *dpy)
break;
}
- if (new_dpy)
- gdpy_new = gdk_x11_lookup_xdisplay (new_dpy);
- else
- {
- if (!gdpy_def)
- gdpy_def = gdk_display_open (gdk_display_get_name (gdpy));
- gdpy_new = gdpy_def;
- }
+ if (! new_dpy) return; /* Emacs will exit anyway. */
+ gdpy_new = gdk_x11_lookup_xdisplay (new_dpy);
gdk_display_manager_set_default_display (gdk_display_manager_get (),
gdpy_new);
}
@@ -349,8 +336,6 @@ xg_get_image_for_pixmap (f, img, widget, old_widget)
GdkPixmap *gpix;
GdkPixmap *gmask;
GdkDisplay *gdpy;
- GdkColormap *cmap;
- GdkPixbuf *icon_buf;
/* If we have a file, let GTK do all the image handling.
This seems to be the only way to make insensitive and activated icons
@@ -381,24 +366,32 @@ xg_get_image_for_pixmap (f, img, widget, old_widget)
gpix = gdk_pixmap_foreign_new_for_display (gdpy, img->pixmap);
gmask = img->mask ? gdk_pixmap_foreign_new_for_display (gdpy, img->mask) : 0;
- /* This is a workaround to make icons look good on pseudo color
- displays. Apparently GTK expects the images to have an alpha
- channel. If they don't, insensitive and activated icons will
- look bad. This workaround does not work on monochrome displays,
- and is strictly not needed on true color/static color displays (i.e.
- 16 bits and higher). But we do it anyway so we get a pixbuf that is
- not associated with the img->pixmap. The img->pixmap may be removed
- by clearing the image cache and then the tool bar redraw fails, since
- Gtk+ assumes the pixmap is always there. */
- cmap = gtk_widget_get_colormap (widget);
- icon_buf = xg_get_pixbuf_from_pix_and_mask (gpix, gmask, cmap);
-
- if (! old_widget)
- old_widget = GTK_IMAGE (gtk_image_new_from_pixbuf (icon_buf));
+ if (x_screen_planes (f) > 8 || x_screen_planes (f) == 1)
+ {
+ if (! old_widget)
+ old_widget = GTK_IMAGE (gtk_image_new_from_pixmap (gpix, gmask));
+ else
+ gtk_image_set_from_pixmap (old_widget, gpix, gmask);
+ }
else
- gtk_image_set_from_pixbuf (old_widget, icon_buf);
+ {
+
+ /* This is a workaround to make icons look good on pseudo color
+ displays. Apparently GTK expects the images to have an alpha
+ channel. If they don't, insensitive and activated icons will
+ look bad. This workaround does not work on monochrome displays,
+ and is not needed on true color/static color displays (i.e.
+ 16 bits and higher). */
+ GdkColormap *cmap = gtk_widget_get_colormap (widget);
+ GdkPixbuf *icon_buf = xg_get_pixbuf_from_pix_and_mask (gpix, gmask, cmap);
+
+ if (! old_widget)
+ old_widget = GTK_IMAGE (gtk_image_new_from_pixbuf (icon_buf));
+ else
+ gtk_image_set_from_pixbuf (old_widget, icon_buf);
- g_object_unref (G_OBJECT (icon_buf));
+ g_object_unref (G_OBJECT (icon_buf));
+ }
g_object_unref (G_OBJECT (gpix));
if (gmask) g_object_unref (G_OBJECT (gmask));
@@ -881,7 +874,7 @@ xg_create_frame_widgets (f)
/* Since GTK clears its window by filling with the background color,
we must keep X and GTK background in sync. */
- xg_pix_to_gcolor (wfixed, FRAME_BACKGROUND_PIXEL (f), &bg);
+ xg_pix_to_gcolor (wfixed, f->output_data.x->background_pixel, &bg);
gtk_widget_modify_bg (wfixed, GTK_STATE_NORMAL, &bg);
/* Also, do not let any background pixmap to be set, this looks very
@@ -1419,8 +1412,8 @@ xg_get_file_with_chooser (f, prompt, default_filename,
{
Lisp_Object file;
struct gcpro gcpro1;
- char *utf8_filename;
GCPRO1 (file);
+ char *utf8_filename;
file = build_string (default_filename);
@@ -1787,19 +1780,19 @@ menu_destroy_callback (w, client_data)
UNGRAB_P is TRUE if this is an ungrab, FALSE if it is a grab.
CLIENT_DATA is NULL (not used). */
-/* Keep track of total number of grabs. */
-static int menu_grab_callback_cnt;
-
static void
menu_grab_callback (GtkWidget *widget,
gboolean ungrab_p,
gpointer client_data)
{
- if (ungrab_p) menu_grab_callback_cnt--;
- else menu_grab_callback_cnt++;
+ /* Keep track of total number of grabs. */
+ static int cnt;
+
+ if (ungrab_p) cnt--;
+ else cnt++;
- if (menu_grab_callback_cnt > 0 && ! xg_timer) xg_start_timer ();
- else if (menu_grab_callback_cnt == 0 && xg_timer) xg_stop_timer ();
+ if (cnt > 0 && ! xg_timer) xg_start_timer ();
+ else if (cnt == 0 && xg_timer) xg_stop_timer ();
}
/* Make a GTK widget that contains both UTF8_LABEL and UTF8_KEY (both
@@ -1897,24 +1890,6 @@ make_menu_item (utf8_label, utf8_key, item, group)
/* Return non-zero if LABEL specifies a separator (GTK only has one
separator type) */
-static char* separator_names[] = {
- "space",
- "no-line",
- "single-line",
- "double-line",
- "single-dashed-line",
- "double-dashed-line",
- "shadow-etched-in",
- "shadow-etched-out",
- "shadow-etched-in-dash",
- "shadow-etched-out-dash",
- "shadow-double-etched-in",
- "shadow-double-etched-out",
- "shadow-double-etched-in-dash",
- "shadow-double-etched-out-dash",
- 0,
-};
-
static int
xg_separator_p (char *label)
{
@@ -1923,6 +1898,24 @@ xg_separator_p (char *label)
&& strncmp (label, "--", 2) == 0
&& label[2] != '-')
{
+ static char* separator_names[] = {
+ "space",
+ "no-line",
+ "single-line",
+ "double-line",
+ "single-dashed-line",
+ "double-dashed-line",
+ "shadow-etched-in",
+ "shadow-etched-out",
+ "shadow-etched-in-dash",
+ "shadow-etched-out-dash",
+ "shadow-double-etched-in",
+ "shadow-double-etched-out",
+ "shadow-double-etched-in-dash",
+ "shadow-double-etched-out-dash",
+ 0,
+ };
+
int i;
label += 2;
@@ -2050,7 +2043,7 @@ xg_create_one_menuitem (item, f, select_cb, highlight_cb, cl_data, group)
return w;
}
-/* Callback called when keyboard traversal (started by x-menu-bar-open) ends.
+/* Callback called when keyboard traversal (started by menu-bar-open) ends.
WMENU is the menu for which traversal has been done. DATA points to the
frame for WMENU. We must release grabs, some bad interaction between GTK
and Emacs makes the menus keep the grabs. */
@@ -3353,10 +3346,6 @@ xg_set_toolkit_scroll_bar_thumb (bar, portion, position, whole)
the GtkImage with a new image. */
#define XG_TOOL_BAR_STOCK_NAME "emacs-tool-bar-stock-name"
-/* As above, but this is used for named theme widgets, as opposed to
- stock items. */
-#define XG_TOOL_BAR_ICON_NAME "emacs-tool-bar-icon-name"
-
/* Callback function invoked when a tool bar item is pressed.
W is the button widget in the tool bar that got pressed,
CLIENT_DATA is an integer that is the index of the button in the
@@ -3646,6 +3635,25 @@ xg_tool_bar_item_expose_callback (w, event, client_data)
#define PROP(IDX) AREF (f->tool_bar_items, i * TOOL_BAR_ITEM_NSLOTS + (IDX))
+/* This callback is called when a tool bar shall be redrawn.
+ We need to update the images in case the image cache
+ has deleted the pixmaps used in the tool bar.
+ W is the GtkToolbar to be redrawn.
+ EVENT is the expose event for W.
+ CLIENT_DATA is pointing to the frame for this tool bar.
+
+ Returns FALSE to tell GTK to keep processing this event. */
+
+static gboolean
+xg_tool_bar_expose_callback (w, event, client_data)
+ GtkWidget *w;
+ GdkEventExpose *event;
+ gpointer client_data;
+{
+ FRAME_PTR f = (FRAME_PTR) client_data;
+ SET_FRAME_GARBAGED (f);
+ return FALSE;
+}
/* Create a tool bar for frame F. */
@@ -3687,6 +3695,10 @@ xg_create_tool_bar (f)
G_CALLBACK (xg_tool_bar_detach_callback), f);
g_signal_connect (G_OBJECT (x->handlebox_widget), "child-attached",
G_CALLBACK (xg_tool_bar_attach_callback), f);
+ g_signal_connect (G_OBJECT (x->toolbar_widget),
+ "expose-event",
+ G_CALLBACK (xg_tool_bar_expose_callback),
+ f);
gtk_widget_show_all (x->handlebox_widget);
@@ -3797,9 +3809,8 @@ update_frame_tool_bar (f)
Lisp_Object stock;
GtkStockItem stock_item;
char *stock_name = NULL;
- char *icon_name = NULL;
Lisp_Object rtl;
- GtkWidget *wbutton = NULL;
+ GtkWidget *wbutton;
GtkWidget *weventbox;
Lisp_Object func = intern ("x-gtk-map-stock");
@@ -3823,33 +3834,13 @@ update_frame_tool_bar (f)
if (EQ (Qt, Ffboundp (func)))
stock = call1 (func, file_for_image (image));
- if (! NILP (stock) && STRINGP (stock))
+ if (! NILP (stock) && STRINGP (stock)
+ && gtk_stock_lookup (SSDATA (stock), &stock_item))
{
stock_name = SSDATA (stock);
- if (stock_name[0] == 'n' && stock_name[1] == ':')
- {
- GdkScreen *screen = gtk_widget_get_screen (GTK_WIDGET (wtoolbar));
- GtkIconTheme *icon_theme = gtk_icon_theme_get_for_screen (screen);
-
- icon_name = stock_name + 2;
- stock_name = NULL;
- stock = Qnil;
-
- if (! gtk_icon_theme_has_icon (icon_theme, icon_name))
- icon_name = NULL;
- else
- icon_size = gtk_toolbar_get_icon_size (wtoolbar);
- }
- else if (gtk_stock_lookup (SSDATA (stock), &stock_item))
- icon_size = gtk_toolbar_get_icon_size (wtoolbar);
- else
- {
- stock = Qnil;
- stock_name = NULL;
- }
+ icon_size = gtk_toolbar_get_icon_size (wtoolbar);
}
-
- if (stock_name == NULL && icon_name == NULL)
+ else
{
/* No stock image, or stock item not known. Try regular image. */
@@ -3914,13 +3905,6 @@ update_frame_tool_bar (f)
(gpointer) xstrdup (stock_name),
(GDestroyNotify) xfree);
}
- else if (icon_name)
- {
- w = gtk_image_new_from_icon_name (icon_name, icon_size);
- g_object_set_data_full (G_OBJECT (w), XG_TOOL_BAR_ICON_NAME,
- (gpointer) xstrdup (icon_name),
- (GDestroyNotify) xfree);
- }
else
{
w = xg_get_image_for_pixmap (f, img, x->widget, NULL);
@@ -3996,8 +3980,6 @@ update_frame_tool_bar (f)
XG_TOOL_BAR_IMAGE_DATA);
gpointer old_stock_name = g_object_get_data (G_OBJECT (wimage),
XG_TOOL_BAR_STOCK_NAME);
- gpointer old_icon_name = g_object_get_data (G_OBJECT (wimage),
- XG_TOOL_BAR_ICON_NAME);
if (stock_name &&
(! old_stock_name || strcmp (old_stock_name, stock_name) != 0))
{
@@ -4008,20 +3990,6 @@ update_frame_tool_bar (f)
(GDestroyNotify) xfree);
g_object_set_data (G_OBJECT (wimage), XG_TOOL_BAR_IMAGE_DATA,
NULL);
- g_object_set_data (G_OBJECT (wimage), XG_TOOL_BAR_ICON_NAME, NULL);
- }
- else if (icon_name &&
- (! old_icon_name || strcmp (old_icon_name, icon_name) != 0))
- {
- gtk_image_set_from_icon_name (GTK_IMAGE (wimage),
- icon_name, icon_size);
- g_object_set_data_full (G_OBJECT (wimage), XG_TOOL_BAR_ICON_NAME,
- (gpointer) xstrdup (icon_name),
- (GDestroyNotify) xfree);
- g_object_set_data (G_OBJECT (wimage), XG_TOOL_BAR_IMAGE_DATA,
- NULL);
- g_object_set_data (G_OBJECT (wimage), XG_TOOL_BAR_STOCK_NAME,
- NULL);
}
else if (img && old_img != img->pixmap)
{
@@ -4031,7 +3999,6 @@ update_frame_tool_bar (f)
g_object_set_data (G_OBJECT (wimage), XG_TOOL_BAR_STOCK_NAME,
NULL);
- g_object_set_data (G_OBJECT (wimage), XG_TOOL_BAR_ICON_NAME, NULL);
}
gtk_misc_set_padding (GTK_MISC (wimage), hmargin, vmargin);
@@ -4104,8 +4071,6 @@ xg_initialize ()
we keep it permanently linked in. */
XftInit (0);
#endif
-
- gdpy_def = NULL;
xg_ignore_gtk_scrollbar = 0;
xg_detached_menus = 0;
xg_menu_cb_list.prev = xg_menu_cb_list.next =
diff --git a/src/image.c b/src/image.c
index 16826c425f..54c01cf36b 100644
--- a/src/image.c
+++ b/src/image.c
@@ -532,7 +532,7 @@ x_create_bitmap_from_file (f, file)
/* Free bitmap B. */
static void
-free_bitmap_record (dpyinfo, bm)
+Free_Bitmap_Record (dpyinfo, bm)
Display_Info *dpyinfo;
Bitmap_Record *bm;
{
@@ -574,7 +574,7 @@ x_destroy_bitmap (f, id)
if (--bm->refcount == 0)
{
BLOCK_INPUT;
- free_bitmap_record (dpyinfo, bm);
+ Free_Bitmap_Record (dpyinfo, bm);
UNBLOCK_INPUT;
}
}
@@ -591,7 +591,7 @@ x_destroy_all_bitmaps (dpyinfo)
for (i = 0; i < dpyinfo->bitmaps_last; i++, bm++)
if (bm->refcount > 0)
- free_bitmap_record (dpyinfo, bm);
+ Free_Bitmap_Record (dpyinfo, bm);
dpyinfo->bitmaps_last = 0;
}
@@ -1710,9 +1710,9 @@ free_image_cache (f)
/* Clear image cache of frame F. FORCE_P non-zero means free all
images. FORCE_P zero means clear only images that haven't been
displayed for some time. Should be called from time to time to
- reduce the number of loaded images. If image-cache-eviction-delay
- is non-nil, this frees images in the cache which weren't displayed
- for at least that many seconds. */
+ reduce the number of loaded images. If image-eviction-seconds is
+ non-nil, this frees images in the cache which weren't displayed for
+ at least that many seconds. */
void
clear_image_cache (f, force_p)
@@ -1905,7 +1905,6 @@ lookup_image (f, spec)
struct frame *f;
Lisp_Object spec;
{
- struct image_cache *c;
struct image *img;
unsigned hash;
struct gcpro gcpro1;
@@ -1916,8 +1915,6 @@ lookup_image (f, spec)
xassert (FRAME_WINDOW_P (f));
xassert (valid_image_p (spec));
- c = FRAME_X_IMAGE_CACHE (f);
-
GCPRO1 (spec);
/* Look up SPEC in the hash table of the image cache. */
@@ -2377,7 +2374,7 @@ x_find_image_file (file)
Vx_bitmap_file_path);
GCPRO2 (file_found, search_path);
- /* Try to find FILE in data-directory/images, then x-bitmap-file-path. */
+ /* Try to find FILE in data-directory, then x-bitmap-file-path. */
fd = openp (search_path, file, Qnil, &file_found, Qnil);
if (fd == -1)
@@ -2886,7 +2883,7 @@ enum xbm_token
3. a vector of strings or bool-vectors, one for each line of the
bitmap.
- 4. a string containing an in-memory XBM file. WIDTH and HEIGHT
+ 4. A string containing an in-memory XBM file. WIDTH and HEIGHT
may not be specified in this case because they are defined in the
XBM file.
@@ -4283,7 +4280,7 @@ xpm_scan (s, end, beg, len)
return XPM_TK_EOF;
}
-/* Functions for color table lookup in XPM data. A key is a string
+/* Functions for color table lookup in XPM data. A Key is a string
specifying the color of each pixel in XPM data. A value is either
an integer that specifies a pixel color, Qt that specifies
transparency, or Qnil for the unspecified color. If the length of
@@ -6346,7 +6343,7 @@ png_load (f, img)
simple transparency, we prefer a clipping mask. */
if (!transparent_p)
{
- /* png_color_16 *image_bg; */
+ png_color_16 *image_bg;
Lisp_Object specified_bg
= image_spec_value (img->spec, QCbackground, NULL);
@@ -6777,19 +6774,18 @@ our_common_term_source (cinfo)
whenever more data is needed. We read the whole image in one step,
so this only adds a fake end of input marker at the end. */
-static JOCTET our_memory_buffer[2];
-
static boolean
our_memory_fill_input_buffer (cinfo)
j_decompress_ptr cinfo;
{
/* Insert a fake EOI marker. */
struct jpeg_source_mgr *src = cinfo->src;
+ static JOCTET buffer[2];
- our_memory_buffer[0] = (JOCTET) 0xFF;
- our_memory_buffer[1] = (JOCTET) JPEG_EOI;
+ buffer[0] = (JOCTET) 0xFF;
+ buffer[1] = (JOCTET) JPEG_EOI;
- src->next_input_byte = our_memory_buffer;
+ src->next_input_byte = buffer;
src->bytes_in_buffer = 2;
return 1;
}
@@ -7759,9 +7755,6 @@ gif_read_from_memory (file, buf, len)
/* Load GIF image IMG for use on frame F. Value is non-zero if
successful. */
-static int interlace_start[] = {0, 4, 2, 1};
-static int interlace_increment[] = {8, 8, 4, 2};
-
static int
gif_load (f, img)
struct frame *f;
@@ -7890,14 +7883,13 @@ gif_load (f, img)
init_color_table ();
bzero (pixel_colors, sizeof pixel_colors);
- if (gif_color_map)
- for (i = 0; i < gif_color_map->ColorCount; ++i)
- {
- int r = gif_color_map->Colors[i].Red << 8;
- int g = gif_color_map->Colors[i].Green << 8;
- int b = gif_color_map->Colors[i].Blue << 8;
- pixel_colors[i] = lookup_rgb_color (f, r, g, b);
- }
+ for (i = 0; i < gif_color_map->ColorCount; ++i)
+ {
+ int r = gif_color_map->Colors[i].Red << 8;
+ int g = gif_color_map->Colors[i].Green << 8;
+ int b = gif_color_map->Colors[i].Blue << 8;
+ pixel_colors[i] = lookup_rgb_color (f, r, g, b);
+ }
#ifdef COLOR_TABLE_SUPPORT
img->colors = colors_in_color_table (&img->ncolors);
@@ -7932,6 +7924,8 @@ gif_load (f, img)
if (gif->SavedImages[ino].ImageDesc.Interlace)
{
+ static int interlace_start[] = {0, 4, 2, 1};
+ static int interlace_increment[] = {8, 8, 4, 2};
int pass;
int row = interlace_start[0];
@@ -8442,16 +8436,16 @@ svg_load (f, img)
return success_p;
}
-/* svg_load_image is a helper function for svg_load, which does the
- actual loading given contents and size, apart from frame and image
- structures, passed from svg_load.
+/* svg_load_image is a helper function for svg_load, which does the actual
+ loading given contents and size, apart from frame and image
+ structures, passed from svg_load.
- Uses librsvg to do most of the image processing.
+ Uses librsvg to do most of the image processing.
- Returns non-zero when successful. */
+ Returns non-zero when sucessful. */
static int
svg_load_image (f, img, contents, size)
- /* Pointer to emacs frame structure. */
+ /* Pointer to emacs frame sturcture. */
struct frame *f;
/* Pointer to emacs image structure. */
struct image *img;
@@ -8561,8 +8555,8 @@ svg_load_image (f, img, contents, size)
/* This loop handles opacity values, since Emacs assumes
non-transparent images. Each pixel must be "flattened" by
- calculating the resulting color, given the transparency of the
- pixel, and the image background color. */
+ calculating he resulting color, given the transparency of the
+ pixel, and the image background color. */
for (y = 0; y < height; ++y)
{
for (x = 0; x < width; ++x)
@@ -9045,7 +9039,7 @@ syms_of_image ()
defining the supported image types. */
DEFVAR_LISP ("image-types", &Vimage_types,
doc: /* List of potentially supported image types.
-Each element of the list is a symbol for an image type, like 'jpeg or 'png.
+Each element of the list is a symbol for a image type, like 'jpeg or 'png.
To check whether it is really supported, use `image-type-available-p'. */);
Vimage_types = Qnil;
diff --git a/src/indent.c b/src/indent.c
index 16ae54c134..95afa03148 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -20,11 +20,9 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
#include <config.h>
-#include <stdio.h>
-
#include "lisp.h"
#include "buffer.h"
-#include "charset.h"
+#include "character.h"
#include "category.h"
#include "indent.h"
#include "keyboard.h"
@@ -53,7 +51,7 @@ double last_known_column;
/* Value of point when current_column was called. */
-EMACS_INT last_known_column_point;
+int last_known_column_point;
/* Value of MODIFF when current_column was called. */
@@ -65,7 +63,7 @@ static double position_indentation P_ ((int));
/* Cache of beginning of line found by the last call of
current_column. */
-static EMACS_INT current_column_bol_cache;
+int current_column_bol_cache;
/* Get the display table to use for the current buffer. */
@@ -214,17 +212,16 @@ width_run_cache_on_off ()
characters immediately following, then *NEXT_BOUNDARY_P
will equal the return value. */
-EMACS_INT
+int
skip_invisible (pos, next_boundary_p, to, window)
- EMACS_INT pos;
- EMACS_INT *next_boundary_p;
- EMACS_INT to;
+ int pos;
+ int *next_boundary_p;
+ int to;
Lisp_Object window;
{
Lisp_Object prop, position, overlay_limit, proplimit;
Lisp_Object buffer, tmp;
- EMACS_INT end;
- int inv_p;
+ int end, inv_p;
XSETFASTINT (position, pos);
XSETBUFFER (buffer, current_buffer);
@@ -291,7 +288,7 @@ check_composition (pos, pos_byte, point, len, len_byte, width)
int *len, *len_byte, *width;
{
Lisp_Object prop;
- int start, end;
+ EMACS_INT start, end;
int id;
if (! find_composition (pos, -1, &start, &end, &prop, Qnil)
@@ -327,7 +324,7 @@ check_composition (pos, pos_byte, point, len, len_byte, width)
if (dp != 0 && VECTORP (DISP_CHAR_VECTOR (dp, c))) \
width = XVECTOR (DISP_CHAR_VECTOR (dp, c))->size; \
else \
- width = WIDTH_BY_CHAR_HEAD (*p); \
+ width = CHAR_WIDTH (c); \
if (width > 1) \
wide_column = width; \
} \
@@ -511,16 +508,16 @@ current_column ()
static double
current_column_1 ()
{
- register EMACS_INT tab_width = XINT (current_buffer->tab_width);
+ register int tab_width = XINT (current_buffer->tab_width);
register int ctl_arrow = !NILP (current_buffer->ctl_arrow);
register struct Lisp_Char_Table *dp = buffer_display_table ();
int multibyte = !NILP (current_buffer->enable_multibyte_characters);
/* Start the scan at the beginning of this line with column number 0. */
- register EMACS_INT col = 0;
- EMACS_INT scan, scan_byte;
- EMACS_INT next_boundary;
- EMACS_INT opoint = PT, opoint_byte = PT_BYTE;
+ register int col = 0;
+ int scan, scan_byte;
+ int next_boundary;
+ int opoint = PT, opoint_byte = PT_BYTE;
scan_newline (PT, PT_BYTE, BEGV, BEGV_BYTE, -1, 1);
current_column_bol_cache = PT;
@@ -809,13 +806,13 @@ static double
position_indentation (pos_byte)
register int pos_byte;
{
- register EMACS_INT column = 0;
- register EMACS_INT tab_width = XINT (current_buffer->tab_width);
+ register int column = 0;
+ register int tab_width = XINT (current_buffer->tab_width);
register unsigned char *p;
register unsigned char *stop;
unsigned char *start;
- EMACS_INT next_boundary_byte = pos_byte;
- EMACS_INT ceiling = next_boundary_byte;
+ int next_boundary_byte = pos_byte;
+ int ceiling = next_boundary_byte;
if (tab_width <= 0 || tab_width > 1000) tab_width = 8;
@@ -830,7 +827,7 @@ position_indentation (pos_byte)
{
while (p == stop)
{
- EMACS_INT stop_pos_byte;
+ int stop_pos_byte;
/* If we have updated P, set POS_BYTE to match.
The first time we enter the loop, POS_BYTE is already right. */
@@ -841,8 +838,8 @@ position_indentation (pos_byte)
return column;
if (pos_byte == next_boundary_byte)
{
- EMACS_INT next_boundary;
- EMACS_INT pos = BYTE_TO_CHAR (pos_byte);
+ int next_boundary;
+ int pos = BYTE_TO_CHAR (pos_byte);
pos = skip_invisible (pos, &next_boundary, ZV, Qnil);
pos_byte = CHAR_TO_BYTE (pos);
next_boundary_byte = CHAR_TO_BYTE (next_boundary);
@@ -933,19 +930,19 @@ The return value is the current column. */)
(column, force)
Lisp_Object column, force;
{
- register EMACS_INT pos;
- register EMACS_INT col = current_column ();
- register EMACS_INT goal;
- register EMACS_INT end;
+ register int pos;
+ register int col = current_column ();
+ register int goal;
+ register int end;
register int tab_width = XINT (current_buffer->tab_width);
register int ctl_arrow = !NILP (current_buffer->ctl_arrow);
register struct Lisp_Char_Table *dp = buffer_display_table ();
register int multibyte = !NILP (current_buffer->enable_multibyte_characters);
Lisp_Object val;
- EMACS_INT prev_col = 0;
+ int prev_col = 0;
int c = 0;
- EMACS_INT next_boundary, pos_byte;
+ int next_boundary, pos_byte;
if (tab_width <= 0 || tab_width > 1000) tab_width = 8;
CHECK_NATNUM (column);
@@ -971,7 +968,7 @@ The return value is the current column. */)
{
while (pos == next_boundary)
{
- EMACS_INT prev = pos;
+ int prev = pos;
pos = skip_invisible (pos, &next_boundary, end, Qnil);
if (pos != prev)
pos_byte = CHAR_TO_BYTE (pos);
@@ -1091,7 +1088,7 @@ The return value is the current column. */)
and scan through it again. */
if (!NILP (force) && col > goal && c == '\t' && prev_col < goal)
{
- EMACS_INT goal_pt, goal_pt_byte;
+ int goal_pt, goal_pt_byte;
/* Insert spaces in front of the tab to reach GOAL. Do this
first so that a marker at the end of the tab gets
@@ -1191,19 +1188,19 @@ struct position val_compute_motion;
struct position *
compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width, hscroll, tab_offset, win)
- EMACS_INT from, fromvpos, fromhpos, to, tovpos, tohpos;
+ int from, fromvpos, fromhpos, to, tovpos, tohpos;
int did_motion;
- EMACS_INT width;
- EMACS_INT hscroll, tab_offset;
+ register int width;
+ int hscroll, tab_offset;
struct window *win;
{
- register EMACS_INT hpos = fromhpos;
- register EMACS_INT vpos = fromvpos;
+ register int hpos = fromhpos;
+ register int vpos = fromvpos;
- register EMACS_INT pos;
- EMACS_INT pos_byte;
+ register int pos;
+ int pos_byte;
register int c = 0;
- register EMACS_INT tab_width = XFASTINT (current_buffer->tab_width);
+ register int tab_width = XFASTINT (current_buffer->tab_width);
register int ctl_arrow = !NILP (current_buffer->ctl_arrow);
register struct Lisp_Char_Table *dp = window_display_table (win);
int selective
@@ -1215,33 +1212,33 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width,
? XVECTOR (DISP_INVIS_VECTOR (dp))->size : 0);
/* The next location where the `invisible' property changes, or an
overlay starts or ends. */
- EMACS_INT next_boundary = from;
+ int next_boundary = from;
/* For computing runs of characters with similar widths.
Invariant: width_run_width is zero, or all the characters
from width_run_start to width_run_end have a fixed width of
width_run_width. */
- EMACS_INT width_run_start = from;
- EMACS_INT width_run_end = from;
- EMACS_INT width_run_width = 0;
+ int width_run_start = from;
+ int width_run_end = from;
+ int width_run_width = 0;
Lisp_Object *width_table;
Lisp_Object buffer;
/* The next buffer pos where we should consult the width run cache. */
- EMACS_INT next_width_run = from;
+ int next_width_run = from;
Lisp_Object window;
int multibyte = !NILP (current_buffer->enable_multibyte_characters);
/* If previous char scanned was a wide character,
this is the column where it ended. Otherwise, this is 0. */
- EMACS_INT wide_column_end_hpos = 0;
- EMACS_INT prev_pos; /* Previous buffer position. */
- EMACS_INT prev_pos_byte; /* Previous buffer position. */
- EMACS_INT prev_hpos = 0;
- EMACS_INT prev_vpos = 0;
- EMACS_INT contin_hpos; /* HPOS of last column of continued line. */
- EMACS_INT prev_tab_offset; /* Previous tab offset. */
- EMACS_INT continuation_glyph_width;
+ int wide_column_end_hpos = 0;
+ int prev_pos; /* Previous buffer position. */
+ int prev_pos_byte; /* Previous buffer position. */
+ int prev_hpos = 0;
+ int prev_vpos = 0;
+ int contin_hpos; /* HPOS of last column of continued line. */
+ int prev_tab_offset; /* Previous tab offset. */
+ int continuation_glyph_width;
XSETBUFFER (buffer, current_buffer);
XSETWINDOW (window, win);
@@ -1287,8 +1284,8 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width,
{
while (pos == next_boundary)
{
- EMACS_INT pos_here = pos;
- EMACS_INT newpos;
+ int pos_here = pos;
+ int newpos;
/* Don't skip invisible if we are already at the margin. */
if (vpos > tovpos || (vpos == tovpos && hpos >= tohpos))
@@ -1886,23 +1883,23 @@ struct position val_vmotion;
struct position *
vmotion (from, vtarget, w)
- register EMACS_INT from, vtarget;
+ register int from, vtarget;
struct window *w;
{
- EMACS_INT hscroll = XINT (w->hscroll);
+ int hscroll = XINT (w->hscroll);
struct position pos;
/* vpos is cumulative vertical position, changed as from is changed */
register int vpos = 0;
- EMACS_INT prevline;
- register EMACS_INT first;
- EMACS_INT from_byte;
- EMACS_INT lmargin = hscroll > 0 ? 1 - hscroll : 0;
+ int prevline;
+ register int first;
+ int from_byte;
+ int lmargin = hscroll > 0 ? 1 - hscroll : 0;
int selective
= (INTEGERP (current_buffer->selective_display)
? XINT (current_buffer->selective_display)
: !NILP (current_buffer->selective_display) ? -1 : 0);
Lisp_Object window;
- EMACS_INT start_hpos = 0;
+ int start_hpos = 0;
int did_motion;
/* This is the object we use for fetching character properties. */
Lisp_Object text_prop_object;
diff --git a/src/indent.h b/src/indent.h
index 95cf23aaef..2e87376960 100644
--- a/src/indent.h
+++ b/src/indent.h
@@ -39,31 +39,25 @@ Boston, MA 02110-1301, USA. */
struct position
{
- EMACS_INT bufpos;
- EMACS_INT bytepos;
- EMACS_INT hpos;
- EMACS_INT vpos;
- EMACS_INT prevhpos;
- EMACS_INT contin;
+ int bufpos;
+ int bytepos;
+ int hpos;
+ int vpos;
+ int prevhpos;
+ int contin;
/* Number of characters we have already handled
from the before and after strings at this position. */
- EMACS_INT ovstring_chars_done;
- EMACS_INT tab_offset;
+ int ovstring_chars_done;
+ int tab_offset;
};
-struct position *compute_motion P_ ((EMACS_INT from, EMACS_INT fromvpos,
- EMACS_INT fromhpos, int did_motion,
- EMACS_INT to, EMACS_INT tovpos,
- EMACS_INT tohpos,
- EMACS_INT width, EMACS_INT hscroll,
- EMACS_INT tab_offset, struct window *));
-struct position *vmotion P_ ((EMACS_INT from, EMACS_INT vtarget,
- struct window *));
-EMACS_INT skip_invisible P_ ((EMACS_INT pos, EMACS_INT *next_boundary_p,
- EMACS_INT to, Lisp_Object window));
+struct position *compute_motion P_ ((int, int, int, int, int, int, int,
+ int, int, int, struct window *));
+struct position *vmotion P_ ((int, int, struct window *));
+int skip_invisible P_ ((int, int *, int, Lisp_Object));
/* Value of point when current_column was called */
-extern EMACS_INT last_known_column_point;
+extern int last_known_column_point;
/* Functions for dealing with the column cache. */
diff --git a/src/insdel.c b/src/insdel.c
index 5cde53864b..059a3c47d1 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -24,7 +24,7 @@ Boston, MA 02110-1301, USA. */
#include "lisp.h"
#include "intervals.h"
#include "buffer.h"
-#include "charset.h"
+#include "character.h"
#include "window.h"
#include "blockinput.h"
#include "region-cache.h"
@@ -415,8 +415,13 @@ adjust_markers_for_insert (from, from_byte, to, to_byte, before_markers)
for (m = BUF_MARKERS (current_buffer); m; m = m->next)
{
- eassert (m->bytepos >= m->charpos
- && m->bytepos - m->charpos <= Z_BYTE - Z);
+ /* In a single-byte buffer, a marker's two positions must be
+ equal. */
+ if (Z == Z_BYTE)
+ {
+ if (m->charpos != m->bytepos)
+ abort ();
+ }
if (m->bytepos == from_byte)
{
@@ -463,7 +468,9 @@ adjust_point (nchars, nbytes)
BUF_PT_BYTE (current_buffer) += nbytes;
/* In a single-byte buffer, the two positions must be equal. */
- eassert (PT_BYTE >= PT && PT_BYTE - PT <= ZV_BYTE - ZV);
+ if (ZV == ZV_BYTE
+ && PT != PT_BYTE)
+ abort ();
}
/* Adjust markers for a replacement of a text at FROM (FROM_BYTE) of
@@ -652,22 +659,11 @@ copy_text (from_addr, to_addr, nbytes,
int bytes_left = nbytes;
Lisp_Object tbl = Qnil;
- /* We set the variable tbl to the reverse table of
- Vnonascii_translation_table in advance. */
- if (CHAR_TABLE_P (Vnonascii_translation_table))
- {
- tbl = Fchar_table_extra_slot (Vnonascii_translation_table,
- make_number (0));
- if (!CHAR_TABLE_P (tbl))
- tbl = Qnil;
- }
-
- /* Convert multibyte to single byte. */
while (bytes_left > 0)
{
int thislen, c;
c = STRING_CHAR_AND_LENGTH (from_addr, bytes_left, thislen);
- if (!SINGLE_BYTE_CHAR_P (c))
+ if (!ASCII_CHAR_P (c))
c = multibyte_char_to_unibyte (c, tbl);
*to_addr++ = c;
from_addr += thislen;
@@ -1173,6 +1169,50 @@ insert_from_string_1 (string, pos, pos_byte, nchars, nbytes,
current_buffer, inherit);
adjust_point (nchars, outgoing_nbytes);
+
+ CHECK_MARKERS ();
+}
+
+/* Insert a sequence of NCHARS chars which occupy NBYTES bytes
+ starting at GPT_ADDR. */
+
+void
+insert_from_gap (nchars, nbytes)
+ register int nchars, nbytes;
+{
+ if (NILP (current_buffer->enable_multibyte_characters))
+ nchars = nbytes;
+
+ record_insert (GPT, nchars);
+ MODIFF++;
+
+ GAP_SIZE -= nbytes;
+ GPT += nchars;
+ ZV += nchars;
+ Z += nchars;
+ GPT_BYTE += nbytes;
+ ZV_BYTE += nbytes;
+ Z_BYTE += nbytes;
+ if (GAP_SIZE > 0) *(GPT_ADDR) = 0; /* Put an anchor. */
+
+ if (GPT_BYTE < GPT)
+ abort ();
+
+ adjust_overlays_for_insert (GPT - nchars, nchars);
+ adjust_markers_for_insert (GPT - nchars, GPT_BYTE - nbytes,
+ GPT, GPT_BYTE, 0);
+
+ if (BUF_INTERVALS (current_buffer) != 0)
+ {
+ offset_intervals (current_buffer, GPT - nchars, nchars);
+ graft_intervals_into_buffer (NULL_INTERVAL, GPT - nchars, nchars,
+ current_buffer, 0);
+ }
+
+ if (GPT - nchars < PT)
+ adjust_point (nchars, nbytes);
+
+ CHECK_MARKERS ();
}
/* Insert text from BUF, NCHARS characters starting at CHARPOS, into the
diff --git a/src/intervals.c b/src/intervals.c
index a695976b8b..74269c7d40 100644
--- a/src/intervals.c
+++ b/src/intervals.c
@@ -2316,7 +2316,7 @@ int
get_property_and_range (pos, prop, val, start, end, object)
int pos;
Lisp_Object prop, *val;
- int *start, *end;
+ EMACS_INT *start, *end;
Lisp_Object object;
{
INTERVAL i, prev, next;
diff --git a/src/intervals.h b/src/intervals.h
index 3b746ec40e..d15470521d 100644
--- a/src/intervals.h
+++ b/src/intervals.h
@@ -300,7 +300,7 @@ extern Lisp_Object textget P_ ((Lisp_Object, Lisp_Object));
extern Lisp_Object lookup_char_property P_ ((Lisp_Object, Lisp_Object, int));
extern void move_if_not_intangible P_ ((int));
extern int get_property_and_range P_ ((int, Lisp_Object, Lisp_Object *,
- int *, int *, Lisp_Object));
+ EMACS_INT *, EMACS_INT *, Lisp_Object));
extern Lisp_Object get_local_map P_ ((int, struct buffer *, Lisp_Object));
extern INTERVAL update_interval P_ ((INTERVAL, int));
extern void set_intervals_multibyte P_ ((int));
diff --git a/src/keyboard.c b/src/keyboard.c
index 5824042e66..d202fc4fc9 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -23,17 +23,17 @@ Boston, MA 02110-1301, USA. */
#include <config.h>
#include <signal.h>
#include <stdio.h>
-#include "lisp.h"
#include "termchar.h"
#include "termopts.h"
-#include "frame.h"
+#include "lisp.h"
#include "termhooks.h"
#include "macros.h"
#include "keyboard.h"
+#include "frame.h"
#include "window.h"
#include "commands.h"
#include "buffer.h"
-#include "charset.h"
+#include "character.h"
#include "disptab.h"
#include "dispextern.h"
#include "syntax.h"
@@ -59,6 +59,7 @@ Boston, MA 02110-1301, USA. */
#endif /* not MSDOS */
#include "syssignal.h"
+#include "systty.h"
#include <sys/types.h>
#ifdef HAVE_UNISTD_H
@@ -96,6 +97,9 @@ volatile int interrupt_input_blocked;
int interrupt_input_pending;
+/* File descriptor to use for input. */
+extern int input_fd;
+
#ifdef HAVE_WINDOW_SYSTEM
/* Make all keyboard buffers much bigger when using X windows. */
#ifdef MAC_OS8
@@ -108,6 +112,8 @@ int interrupt_input_pending;
#define KBD_BUFFER_SIZE 4096
#endif /* No X-windows */
+#define abs(x) ((x) >= 0 ? (x) : -(x))
+
/* Following definition copied from eval.c */
struct backtrace
@@ -419,6 +425,16 @@ Lisp_Object Vecho_keystrokes;
/* Form to evaluate (if non-nil) when Emacs is started. */
Lisp_Object Vtop_level;
+/* User-supplied table to translate input characters. */
+Lisp_Object Vkeyboard_translate_table;
+
+/* Keymap mapping ASCII function key sequences onto their preferred forms. */
+extern Lisp_Object Vfunction_key_map;
+
+/* Another keymap that maps key sequences into key sequences.
+ This one takes precedence over ordinary definitions. */
+extern Lisp_Object Vkey_translation_map;
+
/* If non-nil, this implements the current input method. */
Lisp_Object Vinput_method_function;
Lisp_Object Qinput_method_function;
@@ -442,12 +458,6 @@ Lisp_Object Qpre_command_hook, Vpre_command_hook;
Lisp_Object Qpost_command_hook, Vpost_command_hook;
Lisp_Object Qcommand_hook_internal, Vcommand_hook_internal;
-/* Parent keymap of terminal-local function-key-map instances. */
-Lisp_Object Vfunction_key_map;
-
-/* Keymap of key translations that can override keymaps. */
-Lisp_Object Vkey_translation_map;
-
/* List of deferred actions to be performed at a later time.
The precise format isn't relevant here; we just check whether it is nil. */
Lisp_Object Vdeferred_action_list;
@@ -465,6 +475,11 @@ FILE *dribble;
/* Nonzero if input is available. */
int input_pending;
+/* 1 if should obey 0200 bit in input chars as "Meta", 2 if should
+ keep 0200 bit in input chars. 0 to ignore the 0200 bit. */
+
+int meta_key;
+
extern char *pending_malloc_warning;
/* Circular buffer for pre-read keyboard input. */
@@ -594,6 +609,9 @@ int interrupt_input;
/* Nonzero while interrupts are temporarily deferred during redisplay. */
int interrupts_deferred;
+/* Nonzero means use ^S/^Q for flow control. */
+int flow_control;
+
/* Allow m- file to inhibit use of FIONREAD. */
#ifdef BROKEN_FIONREAD
#undef FIONREAD
@@ -676,11 +694,8 @@ static void save_getcjmp ();
static void restore_getcjmp P_ ((jmp_buf));
static Lisp_Object apply_modifiers P_ ((int, Lisp_Object));
static void clear_event P_ ((struct input_event *));
-#ifdef MULTI_KBOARD
-static Lisp_Object restore_kboard_configuration P_ ((Lisp_Object));
-#endif
+static void any_kboard_state P_ ((void));
static SIGTYPE interrupt_signal P_ ((int signalnum));
-static void handle_interrupt P_ ((void));
static void timer_start_idle P_ ((void));
static void timer_stop_idle P_ ((void));
static void timer_resume_idle P_ ((void));
@@ -1046,20 +1061,24 @@ This function is called by the editor initialization to begin editing. */)
like it is done in the splash screen display, we have to
make sure that we restore single_kboard as command_loop_1
would have done if it were left normally. */
- if (command_loop_level > 0)
- temporarily_switch_to_single_kboard (SELECTED_FRAME ());
- record_unwind_protect (recursive_edit_unwind, buffer);
+ record_unwind_protect (recursive_edit_unwind,
+ Fcons (buffer, single_kboard ? Qt : Qnil));
recursive_edit_1 ();
return unbind_to (count, Qnil);
}
Lisp_Object
-recursive_edit_unwind (buffer)
- Lisp_Object buffer;
+recursive_edit_unwind (info)
+ Lisp_Object info;
{
- if (BUFFERP (buffer))
- Fset_buffer (buffer);
+ if (BUFFERP (XCAR (info)))
+ Fset_buffer (XCAR (info));
+
+ if (NILP (XCDR (info)))
+ any_kboard_state ();
+ else
+ single_kboard_state ();
command_loop_level--;
update_mode_lines = 1;
@@ -1067,8 +1086,6 @@ recursive_edit_unwind (buffer)
}
-#if 0 /* These two functions are now replaced with
- temporarily_switch_to_single_kboard. */
static void
any_kboard_state ()
{
@@ -1099,7 +1116,6 @@ single_kboard_state ()
single_kboard = 1;
#endif
}
-#endif
/* If we're in single_kboard state for kboard KBOARD,
get out of it. */
@@ -1127,8 +1143,8 @@ struct kboard_stack
static struct kboard_stack *kboard_stack;
void
-push_kboard (k)
- struct kboard *k;
+push_frame_kboard (f)
+ FRAME_PTR f;
{
#ifdef MULTI_KBOARD
struct kboard_stack *p
@@ -1138,110 +1154,20 @@ push_kboard (k)
p->kboard = current_kboard;
kboard_stack = p;
- current_kboard = k;
+ current_kboard = FRAME_KBOARD (f);
#endif
}
void
-pop_kboard ()
+pop_frame_kboard ()
{
#ifdef MULTI_KBOARD
- struct terminal *t;
struct kboard_stack *p = kboard_stack;
- int found = 0;
- for (t = terminal_list; t; t = t->next_terminal)
- {
- if (t->kboard == p->kboard)
- {
- current_kboard = p->kboard;
- found = 1;
- break;
- }
- }
- if (!found)
- {
- /* The terminal we remembered has been deleted. */
- current_kboard = FRAME_KBOARD (SELECTED_FRAME ());
- single_kboard = 0;
- }
+ current_kboard = p->kboard;
kboard_stack = p->next;
xfree (p);
#endif
}
-
-/* Switch to single_kboard mode, making current_kboard the only KBOARD
- from which further input is accepted. If F is non-nil, set its
- KBOARD as the current keyboard.
-
- This function uses record_unwind_protect to return to the previous
- state later.
-
- If Emacs is already in single_kboard mode, and F's keyboard is
- locked, then this function will throw an errow. */
-
-void
-temporarily_switch_to_single_kboard (f)
- struct frame *f;
-{
-#ifdef MULTI_KBOARD
- int was_locked = single_kboard;
- if (was_locked)
- {
- if (f != NULL && FRAME_KBOARD (f) != current_kboard)
- /* We can not switch keyboards while in single_kboard mode.
- In rare cases, Lisp code may call `recursive-edit' (or
- `read-minibuffer' or `y-or-n-p') after it switched to a
- locked frame. For example, this is likely to happen
- when server.el connects to a new terminal while Emacs is in
- single_kboard mode. It is best to throw an error instead
- of presenting the user with a frozen screen. */
- error ("Terminal %d is locked, cannot read from it",
- FRAME_TERMINAL (f)->id);
- else
- /* This call is unnecessary, but helps
- `restore_kboard_configuration' discover if somebody changed
- `current_kboard' behind our back. */
- push_kboard (current_kboard);
- }
- else if (f != NULL)
- current_kboard = FRAME_KBOARD (f);
- single_kboard = 1;
- record_unwind_protect (restore_kboard_configuration,
- (was_locked ? Qt : Qnil));
-#endif
-}
-
-#if 0 /* This function is not needed anymore. */
-void
-record_single_kboard_state ()
-{
- if (single_kboard)
- push_kboard (current_kboard);
- record_unwind_protect (restore_kboard_configuration,
- (single_kboard ? Qt : Qnil));
-}
-#endif
-
-#ifdef MULTI_KBOARD
-static Lisp_Object
-restore_kboard_configuration (was_locked)
- Lisp_Object was_locked;
-{
- if (NILP (was_locked))
- single_kboard = 0;
- else
- {
- struct kboard *prev = current_kboard;
- single_kboard = 1;
- pop_kboard ();
- /* The pop should not change the kboard. */
- if (single_kboard && current_kboard != prev)
- abort ();
- }
- return Qnil;
-}
-#endif
-
/* Handle errors that are not handled at inner levels
by printing an error message and returning to the editor command loop. */
@@ -1289,12 +1215,10 @@ cmd_error (data)
Vquit_flag = Qnil;
Vinhibit_quit = Qnil;
-#if 0 /* This shouldn't be necessary anymore. --lorentey */
#ifdef MULTI_KBOARD
if (command_loop_level == 0 && minibuf_level == 0)
any_kboard_state ();
#endif
-#endif
return make_number (0);
}
@@ -1330,7 +1254,11 @@ cmd_error_internal (data, context)
/* If the window system or terminal frame hasn't been initialized
yet, or we're not interactive, write the message to stderr and exit. */
else if (!sf->glyphs_initialized_p
- || FRAME_INITIAL_P (sf)
+ /* This is the case of the frame dumped with Emacs, when we're
+ running under a window system. */
+ || (!NILP (Vwindow_system)
+ && !inhibit_window_system
+ && FRAME_TERMCAP_P (sf))
|| noninteractive)
{
print_error_message (data, Qexternal_debugging_output,
@@ -1373,12 +1301,10 @@ command_loop ()
while (1)
{
internal_catch (Qtop_level, top_level_1, Qnil);
-#if 0 /* This shouldn't be necessary anymore. --lorentey */
- /* Reset single_kboard in case top-level set it while
- evaluating an -f option, or we are stuck there for some
- other reason. */
- any_kboard_state ();
-#endif
+ /* Reset single_kboard in case top-level set it while
+ evaluating an -f option, or we are stuck there for some
+ other reason. */
+ any_kboard_state ();
internal_catch (Qtop_level, command_loop_2, Qnil);
executing_kbd_macro = Qnil;
@@ -1573,12 +1499,10 @@ command_loop_1 ()
int no_direct;
int prev_modiff = 0;
struct buffer *prev_buffer = NULL;
-#if 0 /* This shouldn't be necessary anymore. --lorentey */
#ifdef MULTI_KBOARD
int was_locked = single_kboard;
#endif
-#endif
- int already_adjusted = 0;
+ int already_adjusted;
current_kboard->Vprefix_arg = Qnil;
current_kboard->Vlast_prefix_arg = Qnil;
@@ -1612,8 +1536,6 @@ command_loop_1 ()
/* Do this after running Vpost_command_hook, for consistency. */
current_kboard->Vlast_command = Vthis_command;
current_kboard->Vreal_last_command = real_this_command;
- if (!CONSP (last_command_char))
- current_kboard->Vlast_repeatable_command = real_this_command;
while (1)
{
@@ -1665,6 +1587,11 @@ command_loop_1 ()
}
}
+#ifdef C_ALLOCA
+ alloca (0); /* Cause a garbage collection now */
+ /* Since we can free the most stuff here. */
+#endif /* C_ALLOCA */
+
#if 0
/* Select the frame that the last event came from. Usually,
switch-frame events will take care of this, but if some lisp
@@ -1824,7 +1751,7 @@ command_loop_1 ()
: (lose >= 0x20 && lose < 0x7f))
/* To extract the case of continuation on
wide-column characters. */
- && (WIDTH_BY_CHAR_HEAD (FETCH_BYTE (PT_BYTE)) == 1)
+ && ASCII_BYTE_P (lose)
&& (XFASTINT (XWINDOW (selected_window)->last_modified)
>= MODIFF)
&& (XFASTINT (XWINDOW (selected_window)->last_overlay_modified)
@@ -1881,7 +1808,7 @@ command_loop_1 ()
{
unsigned int c
= translate_char (Vtranslation_table_for_input,
- XFASTINT (last_command_char), 0, 0, 0);
+ XFASTINT (last_command_char));
int value;
if (NILP (Vexecuting_kbd_macro)
&& !EQ (minibuf_window, selected_window))
@@ -1989,8 +1916,6 @@ command_loop_1 ()
{
current_kboard->Vlast_command = Vthis_command;
current_kboard->Vreal_last_command = real_this_command;
- if (!CONSP (last_command_char))
- current_kboard->Vlast_repeatable_command = real_this_command;
cancel_echoing ();
this_command_key_count = 0;
this_command_key_count_reset = 0;
@@ -2036,11 +1961,10 @@ command_loop_1 ()
if (!NILP (current_kboard->defining_kbd_macro)
&& NILP (current_kboard->Vprefix_arg))
finalize_kbd_macro_chars ();
-#if 0 /* This shouldn't be necessary anymore. --lorentey */
+
#ifdef MULTI_KBOARD
if (!was_locked)
- any_kboard_state ();
-#endif
+ any_kboard_state ();
#endif
}
}
@@ -2060,7 +1984,7 @@ adjust_point_for_property (last_pt, modified)
int last_pt;
int modified;
{
- int beg, end;
+ EMACS_INT beg, end;
Lisp_Object val, overlay, tmp;
int check_composition = 1, check_display = 1, check_invisible = 1;
int orig_pt = PT;
@@ -2279,10 +2203,7 @@ void
start_polling ()
{
#ifdef POLL_FOR_INPUT
- /* XXX This condition was (read_socket_hook && !interrupt_input),
- but read_socket_hook is not global anymore. Let's pretend that
- it's always set. */
- if (!interrupt_input)
+ if (read_socket_hook && !interrupt_input)
{
/* Turn alarm handling on unconditionally. It might have
been turned off in process.c. */
@@ -2316,10 +2237,7 @@ int
input_polling_used ()
{
#ifdef POLL_FOR_INPUT
- /* XXX This condition was (read_socket_hook && !interrupt_input),
- but read_socket_hook is not global anymore. Let's pretend that
- it's always set. */
- return !interrupt_input;
+ return read_socket_hook && !interrupt_input;
#else
return 0;
#endif
@@ -2331,10 +2249,7 @@ void
stop_polling ()
{
#ifdef POLL_FOR_INPUT
- /* XXX This condition was (read_socket_hook && !interrupt_input),
- but read_socket_hook is not global anymore. Let's pretend that
- it's always set. */
- if (!interrupt_input)
+ if (read_socket_hook && !interrupt_input)
++poll_suppress_count;
#endif
}
@@ -2546,6 +2461,10 @@ read_char_help_form_unwind (arg)
return Qnil;
}
+#ifdef MULTI_KBOARD
+static jmp_buf wrong_kboard_jmpbuf;
+#endif
+
#define STOP_POLLING \
do { if (! polling_stopped_here) stop_polling (); \
polling_stopped_here = 1; } while (0)
@@ -2572,9 +2491,6 @@ do { if (polling_stopped_here) start_polling (); \
if we used a mouse menu to read the input, or zero otherwise. If
USED_MOUSE_MENU is null, we don't dereference it.
- Value is -2 when we find input on another keyboard. A second call
- to read_char will read it.
-
If END_TIME is non-null, it is a pointer to an EMACS_TIME
specifying the maximum time to wait until. If no input arrives by
that time, stop waiting and return nil.
@@ -2601,7 +2517,6 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time)
volatile int reread;
struct gcpro gcpro1, gcpro2;
int polling_stopped_here = 0;
- struct kboard *orig_kboard = current_kboard;
also_record = Qnil;
@@ -2816,10 +2731,6 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time)
&& !detect_input_pending_run_timers (0))
{
c = read_char_minibuf_menu_prompt (commandflag, nmaps, maps);
-
- if (INTEGERP (c) && XINT (c) == -2)
- return c; /* wrong_kboard_jmpbuf */
-
if (! NILP (c))
{
key_already_recorded = 1;
@@ -2836,7 +2747,6 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time)
jmpcount = SPECPDL_INDEX ();
if (_setjmp (local_getcjmp))
{
- /* Handle quits while reading the keyboard. */
/* We must have saved the outer value of getcjmp here,
so restore it now. */
restore_getcjmp (save_jump);
@@ -2874,7 +2784,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time)
/* This is going to exit from read_char
so we had better get rid of this frame's stuff. */
UNGCPRO;
- return make_number (-2); /* wrong_kboard_jmpbuf */
+ longjmp (wrong_kboard_jmpbuf, 1);
}
}
#endif
@@ -3011,19 +2921,6 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time)
}
}
- /* Notify the caller if an autosave hook, or a timer, sentinel or
- filter in the sit_for calls above have changed the current
- kboard. This could happen if they use the minibuffer or start a
- recursive edit, like the fancy splash screen in server.el's
- filter. If this longjmp wasn't here, read_key_sequence would
- interpret the next key sequence using the wrong translation
- tables and function keymaps. */
- if (NILP (c) && current_kboard != orig_kboard)
- {
- UNGCPRO;
- return make_number (-2); /* wrong_kboard_jmpbuf */
- }
-
/* If this has become non-nil here, it has been set by a timer
or sentinel or filter. */
if (CONSP (Vunread_command_events))
@@ -3072,7 +2969,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time)
/* This is going to exit from read_char
so we had better get rid of this frame's stuff. */
UNGCPRO;
- return make_number (-2); /* wrong_kboard_jmpbuf */
+ longjmp (wrong_kboard_jmpbuf, 1);
}
}
#endif
@@ -3128,7 +3025,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time)
/* This is going to exit from read_char
so we had better get rid of this frame's stuff. */
UNGCPRO;
- return make_number (-2);
+ longjmp (wrong_kboard_jmpbuf, 1);
}
#endif
}
@@ -3183,12 +3080,8 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time)
if (!NILP (tem))
{
-#if 0 /* This shouldn't be necessary anymore. --lorentey */
int was_locked = single_kboard;
- int count = SPECPDL_INDEX ();
- record_single_kboard_state ();
-#endif
-
+
last_input_char = c;
Fcommand_execute (tem, Qnil, Fvector (1, &last_input_char), Qt);
@@ -3199,12 +3092,9 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time)
example banishing the mouse under mouse-avoidance-mode. */
timer_resume_idle ();
-#if 0 /* This shouldn't be necessary anymore. --lorentey */
/* Resume allowing input from any kboard, if that was true before. */
if (!was_locked)
any_kboard_state ();
- unbind_to (count, Qnil);
-#endif
goto retry;
}
@@ -3216,15 +3106,15 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time)
if (XINT (c) == -1)
goto exit;
- if ((STRINGP (current_kboard->Vkeyboard_translate_table)
- && SCHARS (current_kboard->Vkeyboard_translate_table) > (unsigned) XFASTINT (c))
- || (VECTORP (current_kboard->Vkeyboard_translate_table)
- && XVECTOR (current_kboard->Vkeyboard_translate_table)->size > (unsigned) XFASTINT (c))
- || (CHAR_TABLE_P (current_kboard->Vkeyboard_translate_table)
- && CHAR_VALID_P (XINT (c), 0)))
+ if ((STRINGP (Vkeyboard_translate_table)
+ && SCHARS (Vkeyboard_translate_table) > (unsigned) XFASTINT (c))
+ || (VECTORP (Vkeyboard_translate_table)
+ && XVECTOR (Vkeyboard_translate_table)->size > (unsigned) XFASTINT (c))
+ || (CHAR_TABLE_P (Vkeyboard_translate_table)
+ && CHARACTERP (c)))
{
Lisp_Object d;
- d = Faref (current_kboard->Vkeyboard_translate_table, c);
+ d = Faref (Vkeyboard_translate_table, c);
/* nil in keyboard-translate-table means no translation. */
if (!NILP (d))
c = d;
@@ -3844,10 +3734,12 @@ kbd_buffer_store_event_hold (event, hold_quit)
if (c == quit_char)
{
#ifdef MULTI_KBOARD
- KBOARD *kb = FRAME_KBOARD (XFRAME (event->frame_or_window));
+ KBOARD *kb;
struct input_event *sp;
- if (single_kboard && kb != current_kboard)
+ if (single_kboard
+ && (kb = FRAME_KBOARD (XFRAME (event->frame_or_window)),
+ kb != current_kboard))
{
kb->kbd_queue
= Fcons (make_lispy_switch_frame (event->frame_or_window),
@@ -3890,7 +3782,7 @@ kbd_buffer_store_event_hold (event, hold_quit)
}
last_event_timestamp = event->timestamp;
- handle_interrupt ();
+ interrupt_signal (0 /* dummy */);
return;
}
@@ -4023,7 +3915,6 @@ discard_mouse_events ()
if (sp->kind == MOUSE_CLICK_EVENT
|| sp->kind == WHEEL_EVENT
- || sp->kind == HORIZ_WHEEL_EVENT
#ifdef WINDOWSNT
|| sp->kind == W32_SCROLL_BAR_CLICK_EVENT
#endif
@@ -4102,12 +3993,6 @@ kbd_buffer_get_event (kbp, used_mouse_menu, end_time)
/* Wait until there is input available. */
for (;;)
{
- /* Break loop if there's an unread command event. Needed in
- moused window autoselection which uses a timer to insert such
- events. */
- if (CONSP (Vunread_command_events))
- break;
-
if (kbd_fetch_ptr != kbd_store_ptr)
break;
#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
@@ -4379,15 +4264,11 @@ kbd_buffer_get_event (kbp, used_mouse_menu, end_time)
unsigned long time;
*kbp = current_kboard;
- /* Note that this uses F to determine which terminal to look at.
+ /* Note that this uses F to determine which display to look at.
If there is no valid info, it does not store anything
so x remains nil. */
x = Qnil;
-
- /* XXX Can f or mouse_position_hook be NULL here? */
- if (f && FRAME_TERMINAL (f)->mouse_position_hook)
- (*FRAME_TERMINAL (f)->mouse_position_hook) (&f, 0, &bar_window,
- &part, &x, &y, &time);
+ (*mouse_position_hook) (&f, 0, &bar_window, &part, &x, &y, &time);
obj = Qnil;
@@ -4684,14 +4565,10 @@ timer_check (do_it_now)
{
if (NILP (vector[0]))
{
+ int was_locked = single_kboard;
int count = SPECPDL_INDEX ();
Lisp_Object old_deactivate_mark = Vdeactivate_mark;
-#if 0 /* This shouldn't be necessary anymore. --lorentey */
- /* On unbind_to, resume allowing input from any kboard, if that
- was true before. */
- record_single_kboard_state ();
-#endif
/* Mark the timer as triggered to prevent problems if the lisp
code fails to reschedule it right. */
vector[0] = Qt;
@@ -4703,6 +4580,10 @@ timer_check (do_it_now)
timers_run++;
unbind_to (count, Qnil);
+ /* Resume allowing input from any kboard, if that was true before. */
+ if (!was_locked)
+ any_kboard_state ();
+
/* Since we have handled the event,
we don't need to tell the caller to wake up and do it. */
}
@@ -5208,7 +5089,7 @@ Lisp_Object Vlispy_mouse_stem;
static char *lispy_wheel_names[] =
{
- "wheel-up", "wheel-down", "wheel-left", "wheel-right"
+ "wheel-up", "wheel-down"
};
/* drag-n-drop events are generated when a set of selected files are
@@ -5845,7 +5726,6 @@ make_lispy_event (event)
}
case WHEEL_EVENT:
- case HORIZ_WHEEL_EVENT:
{
Lisp_Object position;
Lisp_Object head;
@@ -5930,9 +5810,6 @@ make_lispy_event (event)
the up_modifier set. */
abort ();
- if (event->kind == HORIZ_WHEEL_EVENT)
- symbol_num += 2;
-
/* Get the symbol we should use for the wheel event. */
head = modify_event_symbol (symbol_num,
event->modifiers,
@@ -6667,8 +6544,8 @@ modify_event_symbol (symbol_num, modifiers, symbol_kind, name_alist_or_stem,
{
int len = SBYTES (name_alist_or_stem);
char *buf = (char *) alloca (len + 50);
- sprintf (buf, "%s-%ld", SDATA (name_alist_or_stem),
- (long) XINT (symbol_int) + 1);
+ sprintf (buf, "%s-%ld", SDATA (name_alist_or_stem),
+ (long) XINT (symbol_int) + 1);
value = intern (buf);
}
else if (name_table != 0 && name_table[symbol_num])
@@ -6933,10 +6810,7 @@ gobble_input (expected)
}
else
#ifdef POLL_FOR_INPUT
- /* XXX This condition was (read_socket_hook && !interrupt_input),
- but read_socket_hook is not global anymore. Let's pretend that
- it's always set. */
- if (!interrupt_input && poll_suppress_count == 0)
+ if (read_socket_hook && !interrupt_input && poll_suppress_count == 0)
{
SIGMASKTYPE mask;
mask = sigblock (sigmask (SIGALRM));
@@ -7013,241 +6887,170 @@ static int
read_avail_input (expected)
int expected;
{
+ register int i;
int nread = 0;
- int err = 0;
- struct terminal *t;
/* Store pending user signal events, if any. */
if (store_user_signal_events ())
expected = 0;
- /* Loop through the available terminals, and call their input hooks. */
- t = terminal_list;
- while (t)
+ if (read_socket_hook)
{
- struct terminal *next = t->next_terminal;
+ int nr;
+ struct input_event hold_quit;
- if (t->read_socket_hook)
- {
- int nr;
- struct input_event hold_quit;
-
- EVENT_INIT (hold_quit);
- hold_quit.kind = NO_EVENT;
-
- /* No need for FIONREAD or fcntl; just say don't wait. */
- while (nr = (*t->read_socket_hook) (t, expected, &hold_quit), nr > 0)
- {
- nread += nr;
- expected = 0;
- }
-
- if (nr == -1) /* Not OK to read input now. */
- {
- err = 1;
- }
- else if (nr == -2) /* Non-transient error. */
- {
- /* The terminal device terminated; it should be closed. */
-
- /* Kill Emacs if this was our last terminal. */
- if (!terminal_list->next_terminal)
- /* Formerly simply reported no input, but that
- sometimes led to a failure of Emacs to terminate.
- SIGHUP seems appropriate if we can't reach the
- terminal. */
- /* ??? Is it really right to send the signal just to
- this process rather than to the whole process
- group? Perhaps on systems with FIONREAD Emacs is
- alone in its group. */
- kill (getpid (), SIGHUP);
-
- /* XXX Is calling delete_terminal safe here? It calls Fdelete_frame. */
- if (t->delete_terminal_hook)
- (*t->delete_terminal_hook) (t);
- else
- delete_terminal (t);
- }
-
- if (hold_quit.kind != NO_EVENT)
- kbd_buffer_store_event (&hold_quit);
- }
+ EVENT_INIT (hold_quit);
+ hold_quit.kind = NO_EVENT;
- t = next;
+ /* No need for FIONREAD or fcntl; just say don't wait. */
+ while (nr = (*read_socket_hook) (input_fd, expected, &hold_quit), nr > 0)
+ {
+ nread += nr;
+ expected = 0;
+ }
+ if (hold_quit.kind != NO_EVENT)
+ kbd_buffer_store_event (&hold_quit);
}
+ else
+ {
+ /* Using KBD_BUFFER_SIZE - 1 here avoids reading more than
+ the kbd_buffer can really hold. That may prevent loss
+ of characters on some systems when input is stuffed at us. */
+ unsigned char cbuf[KBD_BUFFER_SIZE - 1];
+ int n_to_read;
- if (err && !nread)
- nread = -1;
-
- return nread;
-}
-
-/* This is the tty way of reading available input.
-
- Note that each terminal device has its own `struct terminal' object,
- and so this function is called once for each individual termcap
- terminal. The first parameter indicates which terminal to read from. */
-
-int
-tty_read_avail_input (struct terminal *terminal,
- int expected,
- struct input_event *hold_quit)
-{
- /* Using KBD_BUFFER_SIZE - 1 here avoids reading more than
- the kbd_buffer can really hold. That may prevent loss
- of characters on some systems when input is stuffed at us. */
- unsigned char cbuf[KBD_BUFFER_SIZE - 1];
- int n_to_read, i;
- struct tty_display_info *tty = terminal->display_info.tty;
- int nread = 0;
-
- if (!terminal->name) /* Don't read from a dead terminal. */
- return;
-
- if (terminal->type != output_termcap)
- abort ();
-
- /* XXX I think the following code should be moved to separate hook
- functions in system-dependent files. */
+ /* Determine how many characters we should *try* to read. */
#ifdef WINDOWSNT
- return 0;
+ return 0;
#else /* not WINDOWSNT */
#ifdef MSDOS
- n_to_read = dos_keysns ();
- if (n_to_read == 0)
- return 0;
-
- cbuf[0] = dos_keyread ();
- nread = 1;
-
+ n_to_read = dos_keysns ();
+ if (n_to_read == 0)
+ return 0;
#else /* not MSDOS */
-
- if (! tty->term_initted) /* In case we get called during bootstrap. */
- return 0;
-
- if (! tty->input)
- return 0; /* The terminal is suspended. */
-
#ifdef HAVE_GPM
- if (gpm_tty == tty)
- {
- Gpm_Event event;
- struct input_event hold_quit;
- int gpm;
+ if (term_gpm)
+ {
+ Gpm_Event event;
+ struct input_event hold_quit;
+ int gpm;
- EVENT_INIT (hold_quit);
- hold_quit.kind = NO_EVENT;
+ EVENT_INIT (hold_quit);
+ hold_quit.kind = NO_EVENT;
- while (gpm = Gpm_GetEvent (&event), gpm == 1) {
- nread += handle_one_term_event (tty, &event, &hold_quit);
- }
- if (hold_quit.kind != NO_EVENT)
- kbd_buffer_store_event (&hold_quit);
- if (nread)
- return nread;
- }
+ while (gpm = Gpm_GetEvent (&event), gpm == 1) {
+ nread += handle_one_term_event (&event, &hold_quit);
+ }
+ if (hold_quit.kind != NO_EVENT)
+ kbd_buffer_store_event (&hold_quit);
+ if (nread)
+ return nread;
+ }
#endif /* HAVE_GPM */
-
-/* Determine how many characters we should *try* to read. */
#ifdef FIONREAD
- /* Find out how much input is available. */
- if (ioctl (fileno (tty->input), FIONREAD, &n_to_read) < 0)
- {
- if (! noninteractive)
- return -2; /* Close this terminal. */
- else
- n_to_read = 0;
- }
- if (n_to_read == 0)
- return 0;
- if (n_to_read > sizeof cbuf)
- n_to_read = sizeof cbuf;
+
+ /* Find out how much input is available. */
+ if (ioctl (input_fd, FIONREAD, &n_to_read) < 0)
+ /* Formerly simply reported no input, but that sometimes led to
+ a failure of Emacs to terminate.
+ SIGHUP seems appropriate if we can't reach the terminal. */
+ /* ??? Is it really right to send the signal just to this process
+ rather than to the whole process group?
+ Perhaps on systems with FIONREAD Emacs is alone in its group. */
+ {
+ if (! noninteractive)
+ kill (getpid (), SIGHUP);
+ else
+ n_to_read = 0;
+ }
+ if (n_to_read == 0)
+ return 0;
+ if (n_to_read > sizeof cbuf)
+ n_to_read = sizeof cbuf;
#else /* no FIONREAD */
#if defined (USG) || defined (DGUX) || defined(CYGWIN)
- /* Read some input if available, but don't wait. */
- n_to_read = sizeof cbuf;
- fcntl (fileno (tty->input), F_SETFL, O_NDELAY);
+ /* Read some input if available, but don't wait. */
+ n_to_read = sizeof cbuf;
+ fcntl (input_fd, F_SETFL, O_NDELAY);
#else
- you lose;
+ you lose;
#endif
#endif
+#endif /* not MSDOS */
+#endif /* not WINDOWSNT */
- /* Now read; for one reason or another, this will not block.
- NREAD is set to the number of chars read. */
- do
- {
- nread = emacs_read (fileno (tty->input), cbuf, n_to_read);
- /* POSIX infers that processes which are not in the session leader's
- process group won't get SIGHUP's at logout time. BSDI adheres to
- this part standard and returns -1 from read (0) with errno==EIO
- when the control tty is taken away.
- Jeffrey Honig <[email protected]> says this is generally safe. */
- if (nread == -1 && errno == EIO)
- return -2; /* Close this terminal. */
+ /* Now read; for one reason or another, this will not block.
+ NREAD is set to the number of chars read. */
+ do
+ {
+#ifdef MSDOS
+ cbuf[0] = dos_keyread ();
+ nread = 1;
+#else
+ nread = emacs_read (input_fd, cbuf, n_to_read);
+#endif
+ /* POSIX infers that processes which are not in the session leader's
+ process group won't get SIGHUP's at logout time. BSDI adheres to
+ this part standard and returns -1 from read (0) with errno==EIO
+ when the control tty is taken away.
+ Jeffrey Honig <[email protected]> says this is generally safe. */
+ if (nread == -1 && errno == EIO)
+ kill (0, SIGHUP);
#if defined (AIX) && (! defined (aix386) && defined (_BSD))
- /* The kernel sometimes fails to deliver SIGHUP for ptys.
- This looks incorrect, but it isn't, because _BSD causes
- O_NDELAY to be defined in fcntl.h as O_NONBLOCK,
- and that causes a value other than 0 when there is no input. */
- if (nread == 0)
- return -2; /* Close this terminal. */
-#endif
- }
- while (
- /* We used to retry the read if it was interrupted.
- But this does the wrong thing when O_NDELAY causes
- an EAGAIN error. Does anybody know of a situation
- where a retry is actually needed? */
+ /* The kernel sometimes fails to deliver SIGHUP for ptys.
+ This looks incorrect, but it isn't, because _BSD causes
+ O_NDELAY to be defined in fcntl.h as O_NONBLOCK,
+ and that causes a value other than 0 when there is no input. */
+ if (nread == 0)
+ kill (0, SIGHUP);
+#endif
+ }
+ while (
+ /* We used to retry the read if it was interrupted.
+ But this does the wrong thing when O_NDELAY causes
+ an EAGAIN error. Does anybody know of a situation
+ where a retry is actually needed? */
#if 0
- nread < 0 && (errno == EAGAIN
+ nread < 0 && (errno == EAGAIN
#ifdef EFAULT
- || errno == EFAULT
+ || errno == EFAULT
#endif
#ifdef EBADSLT
- || errno == EBADSLT
+ || errno == EBADSLT
#endif
- )
+ )
#else
- 0
+ 0
#endif
- );
+ );
#ifndef FIONREAD
#if defined (USG) || defined (DGUX) || defined (CYGWIN)
- fcntl (fileno (tty->input), F_SETFL, 0);
+ fcntl (input_fd, F_SETFL, 0);
#endif /* USG or DGUX or CYGWIN */
#endif /* no FIONREAD */
-
- if (nread <= 0)
- return nread;
-
-#endif /* not MSDOS */
-#endif /* not WINDOWSNT */
-
- for (i = 0; i < nread; i++)
- {
- struct input_event buf;
- EVENT_INIT (buf);
- buf.kind = ASCII_KEYSTROKE_EVENT;
- buf.modifiers = 0;
- if (tty->meta_key == 1 && (cbuf[i] & 0x80))
- buf.modifiers = meta_modifier;
- if (tty->meta_key != 2)
- cbuf[i] &= ~0x80;
-
- buf.code = cbuf[i];
- /* Set the frame corresponding to the active tty. Note that the
- value of selected_frame is not reliable here, redisplay tends
- to temporarily change it. */
- buf.frame_or_window = tty->top_frame;
- buf.arg = Qnil;
-
- kbd_buffer_store_event (&buf);
- /* Don't look at input that follows a C-g too closely.
- This reduces lossage due to autorepeat on C-g. */
- if (buf.kind == ASCII_KEYSTROKE_EVENT
- && buf.code == quit_char)
- break;
+ for (i = 0; i < nread; i++)
+ {
+ struct input_event buf;
+ EVENT_INIT (buf);
+ buf.kind = ASCII_KEYSTROKE_EVENT;
+ buf.modifiers = 0;
+ if (meta_key == 1 && (cbuf[i] & 0x80))
+ buf.modifiers = meta_modifier;
+ if (meta_key != 2)
+ cbuf[i] &= ~0x80;
+
+ buf.code = cbuf[i];
+ buf.frame_or_window = selected_frame;
+ buf.arg = Qnil;
+
+ kbd_buffer_store_event (&buf);
+ /* Don't look at input that follows a C-g too closely.
+ This reduces lossage due to autorepeat on C-g. */
+ if (buf.kind == ASCII_KEYSTROKE_EVENT
+ && buf.code == quit_char)
+ break;
+ }
}
return nread;
@@ -8829,8 +8632,6 @@ read_char_minibuf_menu_prompt (commandflag, nmaps, maps)
if (!INTEGERP (obj))
return obj;
- else if (XINT (obj) == -2)
- return obj;
else
ch = XINT (obj);
@@ -9141,8 +8942,8 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
key's again in Vfunction_key_map. */
volatile keyremap fkey;
- /* Likewise, for key_translation_map and input-decode-map. */
- volatile keyremap keytran, indec;
+ /* Likewise, for key_translation_map. */
+ volatile keyremap keytran;
/* If we receive a `switch-frame' or `select-window' event in the middle of
a key sequence, we put it off for later.
@@ -9177,7 +8978,11 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
last_nonmenu_event = Qnil;
delayed_switch_frame = Qnil;
-
+ fkey.map = fkey.parent = Vfunction_key_map;
+ keytran.map = keytran.parent = Vkey_translation_map;
+ fkey.start = fkey.end = 0;
+ keytran.start = keytran.end = 0;
+
if (INTERACTIVE)
{
if (!NILP (prompt))
@@ -9217,15 +9022,6 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
keybuf[0..mock_input] holds the sequence we should reread. */
replay_sequence:
- /* We may switch keyboards between rescans, so we need to
- reinitialize fkey and keytran before each replay. */
- indec.map = indec.parent = current_kboard->Vinput_decode_map;
- fkey.map = fkey.parent = current_kboard->Vlocal_function_key_map;
- keytran.map = keytran.parent = Vkey_translation_map;
- indec.start = indec.end = 0;
- fkey.start = fkey.end = 0;
- keytran.start = keytran.end = 0;
-
starting_buffer = current_buffer;
first_unbound = bufsize + 1;
@@ -9311,7 +9107,7 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
Thus, if ESC O a has a function-key-map translation
and ESC o has a binding, don't return after ESC O,
so that we can translate ESC O plus the next character. */
- : (/* indec.start < t || fkey.start < t || */ keytran.start < t))
+ : (fkey.start < t || keytran.start < t))
{
Lisp_Object key;
int used_mouse_menu = 0;
@@ -9329,17 +9125,13 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
just one key. */
volatile int echo_local_start, keys_local_start, local_first_binding;
- eassert (indec.end == t || (indec.end > t && indec.end <= mock_input));
- eassert (indec.start <= indec.end);
+ eassert (fkey.end == t || (fkey.end > t && fkey.end <= mock_input));
eassert (fkey.start <= fkey.end);
eassert (keytran.start <= keytran.end);
- /* key-translation-map is applied *after* function-key-map
- which is itself applied *after* input-decode-map. */
- eassert (fkey.end <= indec.start);
+ /* key-translation-map is applied *after* function-key-map. */
eassert (keytran.end <= fkey.start);
- if (/* first_unbound < indec.start && first_unbound < fkey.start && */
- first_unbound < keytran.start)
+ if (first_unbound < fkey.start && first_unbound < keytran.start)
{ /* The prefix upto first_unbound has no binding and has
no translation left to do either, so we know it's unbound.
If we don't stop now, we risk staying here indefinitely
@@ -9349,8 +9141,6 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
for (i = first_unbound + 1; i < t; i++)
keybuf[i - first_unbound - 1] = keybuf[i];
mock_input = t - first_unbound - 1;
- indec.end = indec.start -= first_unbound + 1;
- indec.map = indec.parent;
fkey.end = fkey.start -= first_unbound + 1;
fkey.map = fkey.parent;
keytran.end = keytran.start -= first_unbound + 1;
@@ -9396,28 +9186,8 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
#ifdef MULTI_KBOARD
KBOARD *interrupted_kboard = current_kboard;
struct frame *interrupted_frame = SELECTED_FRAME ();
-#endif
- key = read_char (NILP (prompt), nmaps,
- (Lisp_Object *) submaps, last_nonmenu_event,
- &used_mouse_menu, NULL);
-#ifdef MULTI_KBOARD
- if (INTEGERP (key) && XINT (key) == -2) /* wrong_kboard_jmpbuf */
+ if (setjmp (wrong_kboard_jmpbuf))
{
- int found = 0;
- struct kboard *k;
-
- for (k = all_kboards; k; k = k->next_kboard)
- if (k == interrupted_kboard)
- found = 1;
-
- if (!found)
- {
- /* Don't touch interrupted_kboard when it's been
- deleted. */
- delayed_switch_frame = Qnil;
- goto replay_sequence;
- }
-
if (!NILP (delayed_switch_frame))
{
interrupted_kboard->kbd_queue
@@ -9425,7 +9195,6 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
interrupted_kboard->kbd_queue);
delayed_switch_frame = Qnil;
}
-
while (t > 0)
interrupted_kboard->kbd_queue
= Fcons (keybuf[--t], interrupted_kboard->kbd_queue);
@@ -9450,6 +9219,9 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
goto replay_sequence;
}
#endif
+ key = read_char (NILP (prompt), nmaps,
+ (Lisp_Object *) submaps, last_nonmenu_event,
+ &used_mouse_menu, NULL);
}
/* read_char returns t when it shows a menu and the user rejects it.
@@ -9776,15 +9548,15 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
/* This is needed for the following scenario:
event 0: a down-event that gets dropped by calling replay_key.
event 1: some normal prefix like C-h.
- After event 0, first_unbound is 0, after event 1 indec.start,
- fkey.start, and keytran.start are all 1, so when we see that
- C-h is bound, we need to update first_unbound. */
+ After event 0, first_unbound is 0, after event 1 fkey.start
+ and keytran.start are both 1, so when we see that C-h is bound,
+ we need to update first_unbound. */
first_unbound = max (t + 1, first_unbound);
else
{
Lisp_Object head;
- /* Remember the position to put an upper bound on indec.start. */
+ /* Remember the position to put an upper bound on fkey.start. */
first_unbound = min (t, first_unbound);
head = EVENT_HEAD (key);
@@ -9869,27 +9641,21 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
/* If mock_input > t + 1, the above simplification
will actually end up dropping keys on the floor.
This is probably OK for now, but even
- if mock_input <= t + 1, we need to adjust indec,
- fkey, and keytran.
+ if mock_input <= t + 1, we need to adjust fkey
+ and keytran.
Typical case [header-line down-mouse-N]:
mock_input = 2, t = 1, fkey.end = 1,
last_real_key_start = 0. */
- if (indec.end > last_real_key_start)
+ if (fkey.end > last_real_key_start)
{
- indec.end = indec.start
- = min (last_real_key_start, indec.start);
- indec.map = indec.parent;
- if (fkey.end > last_real_key_start)
+ fkey.end = fkey.start
+ = min (last_real_key_start, fkey.start);
+ fkey.map = fkey.parent;
+ if (keytran.end > last_real_key_start)
{
- fkey.end = fkey.start
- = min (last_real_key_start, fkey.start);
- fkey.map = fkey.parent;
- if (keytran.end > last_real_key_start)
- {
- keytran.end = keytran.start
- = min (last_real_key_start, keytran.start);
- keytran.map = keytran.parent;
- }
+ keytran.end = keytran.start
+ = min (last_real_key_start, keytran.start);
+ keytran.map = keytran.parent;
}
}
if (t == last_real_key_start)
@@ -9943,28 +9709,8 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
/* Record what part of this_command_keys is the current key sequence. */
this_single_command_key_start = this_command_key_count - t;
- /* Look for this sequence in input-decode-map.
- Scan from indec.end until we find a bound suffix. */
- while (indec.end < t)
- {
- struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
- int done, diff;
-
- GCPRO4 (indec.map, fkey.map, keytran.map, delayed_switch_frame);
- done = keyremap_step (keybuf, bufsize, &indec, max (t, mock_input),
- 1, &diff, prompt);
- UNGCPRO;
- if (done)
- {
- mock_input = diff + max (t, mock_input);
- goto replay_sequence;
- }
- }
-
- if (first_binding < nmaps && NILP (submaps[first_binding])
- && indec.start >= t)
+ if (first_binding < nmaps && NILP (submaps[first_binding]))
/* There is a binding and it's not a prefix.
- (and it doesn't have any input-decode-map translation pending).
There is thus no function-key in this sequence.
Moving fkey.start is important in this case to allow keytran.start
to go over the sequence before we return (since we keep the
@@ -9977,12 +9723,12 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
/* If the sequence is unbound, see if we can hang a function key
off the end of it. */
/* Continue scan from fkey.end until we find a bound suffix. */
- while (fkey.end < indec.start)
+ while (fkey.end < t)
{
- struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
+ struct gcpro gcpro1, gcpro2, gcpro3;
int done, diff;
- GCPRO4 (indec.map, fkey.map, keytran.map, delayed_switch_frame);
+ GCPRO3 (fkey.map, keytran.map, delayed_switch_frame);
done = keyremap_step (keybuf, bufsize, &fkey,
max (t, mock_input),
/* If there's a binding (i.e.
@@ -9994,10 +9740,6 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
if (done)
{
mock_input = diff + max (t, mock_input);
- /* Adjust the input-decode-map counters. */
- indec.end += diff;
- indec.start += diff;
-
goto replay_sequence;
}
}
@@ -10006,19 +9748,17 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
Scan from keytran.end until we find a bound suffix. */
while (keytran.end < fkey.start)
{
- struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
+ struct gcpro gcpro1, gcpro2, gcpro3;
int done, diff;
- GCPRO4 (indec.map, fkey.map, keytran.map, delayed_switch_frame);
+ GCPRO3 (fkey.map, keytran.map, delayed_switch_frame);
done = keyremap_step (keybuf, bufsize, &keytran, max (t, mock_input),
1, &diff, prompt);
UNGCPRO;
if (done)
{
mock_input = diff + max (t, mock_input);
- /* Adjust the function-key-map and input-decode-map counters. */
- indec.end += diff;
- indec.start += diff;
+ /* Adjust the function-key-map counters. */
fkey.end += diff;
fkey.start += diff;
@@ -10031,11 +9771,10 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
and is an upper case letter
use the corresponding lower-case letter instead. */
if (first_binding >= nmaps
- && /* indec.start >= t && fkey.start >= t && */ keytran.start >= t
+ && fkey.start >= t && keytran.start >= t
&& INTEGERP (key)
- && ((((XINT (key) & 0x3ffff)
- < XCHAR_TABLE (current_buffer->downcase_table)->size)
- && UPPERCASEP (XINT (key) & 0x3ffff))
+ && ((CHARACTERP (make_number (XINT (key) & ~CHAR_MODIFIER_MASK))
+ && UPPERCASEP (XINT (key) & ~CHAR_MODIFIER_MASK))
|| (XINT (key) & shift_modifier)))
{
Lisp_Object new_key;
@@ -10046,8 +9785,8 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
if (XINT (key) & shift_modifier)
XSETINT (new_key, XINT (key) & ~shift_modifier);
else
- XSETINT (new_key, (DOWNCASE (XINT (key) & 0x3ffff)
- | (XINT (key) & ~0x3ffff)));
+ XSETINT (new_key, (DOWNCASE (XINT (key) & ~CHAR_MODIFIER_MASK)
+ | (XINT (key) & ~CHAR_MODIFIER_MASK)));
/* We have to do this unconditionally, regardless of whether
the lower-case char is defined in the keymaps, because they
@@ -10062,7 +9801,7 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
and is a shifted function key,
use the corresponding unshifted function key instead. */
if (first_binding >= nmaps
- && /* indec.start >= t && fkey.start >= t && */ keytran.start >= t
+ && fkey.start >= t && keytran.start >= t
&& SYMBOLP (key))
{
Lisp_Object breakdown;
@@ -10083,6 +9822,9 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
keybuf[t - 1] = new_key;
mock_input = max (t, mock_input);
+ fkey.start = fkey.end = 0;
+ keytran.start = keytran.end = 0;
+
goto replay_sequence;
}
}
@@ -10590,12 +10332,8 @@ detect_input_pending_run_timers (do_display)
from an idle timer function. The symptom of the bug is that
the cursor sometimes doesn't become visible until the next X
event is processed. --gerd. */
- {
- Lisp_Object tail, frame;
- FOR_EACH_FRAME (tail, frame)
- if (FRAME_RIF (XFRAME (frame)))
- FRAME_RIF (XFRAME (frame))->flush_display (XFRAME (frame));
- }
+ if (rif)
+ rif->flush_display (NULL);
}
return input_pending;
@@ -10847,9 +10585,6 @@ On such systems, Emacs starts a subshell instead of suspending. */)
int width, height;
struct gcpro gcpro1;
- if (tty_list && tty_list->next)
- error ("There are other tty frames open; close them before suspending Emacs");
-
if (!NILP (stuffstring))
CHECK_STRING (stuffstring);
@@ -10858,11 +10593,11 @@ On such systems, Emacs starts a subshell instead of suspending. */)
call1 (Vrun_hooks, intern ("suspend-hook"));
GCPRO1 (stuffstring);
- get_tty_size (fileno (CURTTY ()->input), &old_width, &old_height);
- reset_all_sys_modes ();
+ get_frame_size (&old_width, &old_height);
+ reset_sys_modes ();
/* sys_suspend can get an error if it tries to fork a subshell
and the system resources aren't available for that. */
- record_unwind_protect ((Lisp_Object (*) P_ ((Lisp_Object))) init_all_sys_modes,
+ record_unwind_protect ((Lisp_Object (*) P_ ((Lisp_Object))) init_sys_modes,
Qnil);
stuff_buffered_input (stuffstring);
if (cannot_suspend)
@@ -10874,7 +10609,7 @@ On such systems, Emacs starts a subshell instead of suspending. */)
/* Check if terminal/window size has changed.
Note that this is not useful when we are running directly
with a window system; but suspend should be disabled in that case. */
- get_tty_size (fileno (CURTTY ()->input), &width, &height);
+ get_frame_size (&width, &height);
if (width != old_width || height != old_height)
change_frame_size (SELECTED_FRAME (), height, width, 0, 0, 0);
@@ -10934,10 +10669,10 @@ set_waiting_for_input (time_to_clear)
{
input_available_clear_time = time_to_clear;
- /* Tell handle_interrupt to throw back to read_char, */
+ /* Tell interrupt_signal to throw back to read_char, */
waiting_for_input = 1;
- /* If handle_interrupt was called before and buffered a C-g,
+ /* If interrupt_signal was called before and buffered a C-g,
make it run again now, to avoid timing error. */
if (!NILP (Vquit_flag))
quit_throw_to_read_char ();
@@ -10946,82 +10681,48 @@ set_waiting_for_input (time_to_clear)
void
clear_waiting_for_input ()
{
- /* Tell handle_interrupt not to throw back to read_char, */
+ /* Tell interrupt_signal not to throw back to read_char, */
waiting_for_input = 0;
input_available_clear_time = 0;
}
-/* The SIGINT handler.
+/* This routine is called at interrupt level in response to C-g.
+
+ If interrupt_input, this is the handler for SIGINT. Otherwise, it
+ is called from kbd_buffer_store_event, in handling SIGIO or
+ SIGTINT.
- If we have a frame on the controlling tty, we assume that the
- SIGINT was generated by C-g, so we call handle_interrupt.
- Otherwise, the handler kills Emacs. */
+ If `waiting_for_input' is non zero, then unless `echoing' is
+ nonzero, immediately throw back to read_char.
+
+ Otherwise it sets the Lisp variable quit-flag not-nil. This causes
+ eval to throw, when it gets a chance. If quit-flag is already
+ non-nil, it stops the job right away. */
static SIGTYPE
interrupt_signal (signalnum) /* If we don't have an argument, */
int signalnum; /* some compilers complain in signal calls. */
{
+ char c;
/* Must preserve main program's value of errno. */
int old_errno = errno;
- struct terminal *terminal;
+ struct frame *sf = SELECTED_FRAME ();
#if defined (USG) && !defined (POSIX_SIGNALS)
- /* USG systems forget handlers when they are used;
- must reestablish each time */
- signal (SIGINT, interrupt_signal);
- signal (SIGQUIT, interrupt_signal);
-#endif /* USG */
-
- SIGNAL_THREAD_CHECK (signalnum);
-
- /* See if we have an active terminal on our controlling tty. */
- terminal = get_named_tty ("/dev/tty");
- if (!terminal)
- {
- /* If there are no frames there, let's pretend that we are a
- well-behaving UN*X program and quit. */
- Fkill_emacs (Qnil);
- }
- else
+ if (!read_socket_hook && NILP (Vwindow_system))
{
- /* Otherwise, the SIGINT was probably generated by C-g. */
-
- /* Set internal_last_event_frame to the top frame of the
- controlling tty, if we have a frame there. We disable the
- interrupt key on secondary ttys, so the SIGINT must have come
- from the controlling tty. */
- internal_last_event_frame = terminal->display_info.tty->top_frame;
-
- handle_interrupt ();
+ /* USG systems forget handlers when they are used;
+ must reestablish each time */
+ signal (SIGINT, interrupt_signal);
+ signal (SIGQUIT, interrupt_signal);
}
+#endif /* USG */
- errno = old_errno;
-}
-
-/* This routine is called at interrupt level in response to C-g.
-
- It is called from the SIGINT handler or kbd_buffer_store_event.
-
- If `waiting_for_input' is non zero, then unless `echoing' is
- nonzero, immediately throw back to read_char.
-
- Otherwise it sets the Lisp variable quit-flag not-nil. This causes
- eval to throw, when it gets a chance. If quit-flag is already
- non-nil, it stops the job right away. */
-
-static void
-handle_interrupt ()
-{
- char c;
-
+ SIGNAL_THREAD_CHECK (signalnum);
cancel_echoing ();
- /* XXX This code needs to be revised for multi-tty support. */
if (!NILP (Vquit_flag)
-#ifndef MSDOS
- && get_named_tty ("/dev/tty")
-#endif
- )
+ && (FRAME_TERMCAP_P (sf) || FRAME_MSDOS_P (sf)))
{
/* If SIGINT isn't blocked, don't let us be interrupted by
another SIGINT, it might be harmful due to non-reentrancy
@@ -11029,7 +10730,7 @@ handle_interrupt ()
sigblock (sigmask (SIGINT));
fflush (stdout);
- reset_all_sys_modes ();
+ reset_sys_modes ();
#ifdef SIGTSTP /* Support possible in later USG versions */
/*
@@ -11108,7 +10809,7 @@ handle_interrupt ()
printf ("Continuing...\n");
#endif /* not MSDOS */
fflush (stdout);
- init_all_sys_modes ();
+ init_sys_modes ();
sigfree ();
}
else
@@ -11136,7 +10837,9 @@ handle_interrupt ()
}
if (waiting_for_input && !echoing)
- quit_throw_to_read_char ();
+ quit_throw_to_read_char ();
+
+ errno = old_errno;
}
/* Handle a C-g by making read_char return C-g. */
@@ -11169,203 +10872,75 @@ quit_throw_to_read_char ()
_longjmp (getcjmp, 1);
}
-DEFUN ("set-input-interrupt-mode", Fset_input_interrupt_mode, Sset_input_interrupt_mode, 1, 1, 0,
- doc: /* Set interrupt mode of reading keyboard input.
-If INTERRUPT is non-nil, Emacs will use input interrupts;
-otherwise Emacs uses CBREAK mode.
-
+DEFUN ("set-input-mode", Fset_input_mode, Sset_input_mode, 3, 4, 0,
+ doc: /* Set mode of reading keyboard input.
+First arg INTERRUPT non-nil means use input interrupts;
+ nil means use CBREAK mode.
+Second arg FLOW non-nil means use ^S/^Q flow control for output to terminal
+ (no effect except in CBREAK mode).
+Third arg META t means accept 8-bit input (for a Meta key).
+ META nil means ignore the top bit, on the assumption it is parity.
+ Otherwise, accept 8-bit input and don't use the top bit for Meta.
+Optional fourth arg QUIT if non-nil specifies character to use for quitting.
See also `current-input-mode'. */)
- (interrupt)
- Lisp_Object interrupt;
+ (interrupt, flow, meta, quit)
+ Lisp_Object interrupt, flow, meta, quit;
{
- int new_interrupt_input;
+ if (!NILP (quit)
+ && (!INTEGERP (quit) || XINT (quit) < 0 || XINT (quit) > 0400))
+ error ("set-input-mode: QUIT must be an ASCII character");
+
+#ifdef POLL_FOR_INPUT
+ stop_polling ();
+#endif
+
+#ifndef DOS_NT
+ /* this causes startup screen to be restored and messes with the mouse */
+ reset_sys_modes ();
+#endif
+
#ifdef SIGIO
/* Note SIGIO has been undef'd if FIONREAD is missing. */
-#ifdef HAVE_X_WINDOWS
- if (x_display_list != NULL)
+ if (read_socket_hook)
{
/* When using X, don't give the user a real choice,
because we haven't implemented the mechanisms to support it. */
#ifdef NO_SOCK_SIGIO
- new_interrupt_input = 0;
+ interrupt_input = 0;
#else /* not NO_SOCK_SIGIO */
- new_interrupt_input = 1;
+ interrupt_input = 1;
#endif /* NO_SOCK_SIGIO */
}
else
-#endif
- new_interrupt_input = !NILP (interrupt);
+ interrupt_input = !NILP (interrupt);
#else /* not SIGIO */
- new_interrupt_input = 0;
+ interrupt_input = 0;
#endif /* not SIGIO */
/* Our VMS input only works by interrupts, as of now. */
#ifdef VMS
- new_interrupt_input = 1;
-#endif
-
- if (new_interrupt_input != interrupt_input)
- {
-#ifdef POLL_FOR_INPUT
- stop_polling ();
-#endif
-#ifndef DOS_NT
- /* this causes startup screen to be restored and messes with the mouse */
- reset_all_sys_modes ();
-#endif
- interrupt_input = new_interrupt_input;
-#ifndef DOS_NT
- init_all_sys_modes ();
-#endif
-
-#ifdef POLL_FOR_INPUT
- poll_suppress_count = 1;
- start_polling ();
-#endif
- }
- return Qnil;
-}
-
-DEFUN ("set-output-flow-control", Fset_output_flow_control, Sset_output_flow_control, 1, 2, 0,
- doc: /* Enable or disable ^S/^Q flow control for output to TERMINAL.
-If FLOW is non-nil, flow control is enabled and you cannot use C-s or
-C-q in key sequences.
-
-This setting only has an effect on tty terminals and only when
-Emacs reads input in CBREAK mode; see `set-input-interrupt-mode'.
-
-See also `current-input-mode'. */)
- (flow, terminal)
- Lisp_Object flow, terminal;
-{
- struct terminal *t = get_terminal (terminal, 1);
- struct tty_display_info *tty;
- if (t == NULL || t->type != output_termcap)
- return Qnil;
- tty = t->display_info.tty;
-
- if (tty->flow_control != !NILP (flow))
- {
-#ifndef DOS_NT
- /* this causes startup screen to be restored and messes with the mouse */
- reset_sys_modes (tty);
-#endif
-
- tty->flow_control = !NILP (flow);
-
-#ifndef DOS_NT
- init_sys_modes (tty);
+ interrupt_input = 1;
#endif
- }
- return Qnil;
-}
-
-DEFUN ("set-input-meta-mode", Fset_input_meta_mode, Sset_input_meta_mode, 1, 2, 0,
- doc: /* Enable or disable 8-bit input on TERMINAL.
-If META is t, Emacs will accept 8-bit input, and interpret the 8th
-bit as the Meta modifier.
-
-If META is nil, Emacs will ignore the top bit, on the assumption it is
-parity.
-
-Otherwise, Emacs will accept and pass through 8-bit input without
-specially interpreting the top bit.
-
-This setting only has an effect on tty terminal devices.
-
-Optional parameter TERMINAL specifies the tty terminal device to use.
-It may be a terminal id, a frame, or nil for the terminal used by the
-currently selected frame.
-
-See also `current-input-mode'. */)
- (meta, terminal)
- Lisp_Object meta, terminal;
-{
- struct terminal *t = get_terminal (terminal, 1);
- struct tty_display_info *tty;
- int new_meta;
-
- if (t == NULL || t->type != output_termcap)
- return Qnil;
- tty = t->display_info.tty;
+ flow_control = !NILP (flow);
if (NILP (meta))
- new_meta = 0;
+ meta_key = 0;
else if (EQ (meta, Qt))
- new_meta = 1;
+ meta_key = 1;
else
- new_meta = 2;
-
- if (tty->meta_key != new_meta)
- {
-#ifndef DOS_NT
- /* this causes startup screen to be restored and messes with the mouse */
- reset_sys_modes (tty);
-#endif
-
- tty->meta_key = new_meta;
-
-#ifndef DOS_NT
- init_sys_modes (tty);
-#endif
- }
- return Qnil;
-}
-
-DEFUN ("set-quit-char", Fset_quit_char, Sset_quit_char, 1, 1, 0,
- doc: /* Specify character used for quitting.
-QUIT must be an ASCII character.
-
-This function only has an effect on the controlling tty of the Emacs
-process.
-
-See also `current-input-mode'. */)
- (quit)
- Lisp_Object quit;
-{
- struct terminal *t = get_named_tty ("/dev/tty");
- struct tty_display_info *tty;
- if (t == NULL || t->type != output_termcap)
- return Qnil;
- tty = t->display_info.tty;
-
- if (NILP (quit) || !INTEGERP (quit) || XINT (quit) < 0 || XINT (quit) > 0400)
- error ("QUIT must be an ASCII character");
+ meta_key = 2;
+ if (!NILP (quit))
+ /* Don't let this value be out of range. */
+ quit_char = XINT (quit) & (meta_key ? 0377 : 0177);
#ifndef DOS_NT
- /* this causes startup screen to be restored and messes with the mouse */
- reset_sys_modes (tty);
+ init_sys_modes ();
#endif
-
- /* Don't let this value be out of range. */
- quit_char = XINT (quit) & (tty->meta_key == 0 ? 0177 : 0377);
-#ifndef DOS_NT
- init_sys_modes (tty);
+#ifdef POLL_FOR_INPUT
+ poll_suppress_count = 1;
+ start_polling ();
#endif
-
- return Qnil;
-}
-
-DEFUN ("set-input-mode", Fset_input_mode, Sset_input_mode, 3, 4, 0,
- doc: /* Set mode of reading keyboard input.
-First arg INTERRUPT non-nil means use input interrupts;
- nil means use CBREAK mode.
-Second arg FLOW non-nil means use ^S/^Q flow control for output to terminal
- (no effect except in CBREAK mode).
-Third arg META t means accept 8-bit input (for a Meta key).
- META nil means ignore the top bit, on the assumption it is parity.
- Otherwise, accept 8-bit input and don't use the top bit for Meta.
-Optional fourth arg QUIT if non-nil specifies character to use for quitting.
-See also `current-input-mode'. */)
- (interrupt, flow, meta, quit)
- Lisp_Object interrupt, flow, meta, quit;
-{
- Fset_input_interrupt_mode (interrupt);
- Fset_output_flow_control (flow, Qnil);
- Fset_input_meta_mode (meta, Qnil);
- if (!NILP (quit))
- Fset_quit_char (quit);
return Qnil;
}
@@ -11386,21 +10961,10 @@ The elements of this list correspond to the arguments of
()
{
Lisp_Object val[4];
- struct frame *sf = XFRAME (selected_frame);
val[0] = interrupt_input ? Qt : Qnil;
- if (FRAME_TERMCAP_P (sf))
- {
- val[1] = FRAME_TTY (sf)->flow_control ? Qt : Qnil;
- val[2] = (FRAME_TTY (sf)->meta_key == 2
- ? make_number (0)
- : (CURTTY ()->meta_key == 1 ? Qt : Qnil));
- }
- else
- {
- val[1] = Qnil;
- val[2] = Qt;
- }
+ val[1] = flow_control ? Qt : Qnil;
+ val[2] = meta_key == 2 ? make_number (0) : meta_key == 1 ? Qt : Qnil;
XSETFASTINT (val[3], quit_char);
return Flist (sizeof (val) / sizeof (val[0]), val);
@@ -11492,8 +11056,6 @@ init_kboard (kb)
kb->Voverriding_terminal_local_map = Qnil;
kb->Vlast_command = Qnil;
kb->Vreal_last_command = Qnil;
- kb->Vkeyboard_translate_table = Qnil;
- kb->Vlast_repeatable_command = Qnil;
kb->Vprefix_arg = Qnil;
kb->Vlast_prefix_arg = Qnil;
kb->kbd_queue = Qnil;
@@ -11508,9 +11070,6 @@ init_kboard (kb)
kb->reference_count = 0;
kb->Vsystem_key_alist = Qnil;
kb->system_key_syms = Qnil;
- kb->Vinput_decode_map = Fmake_sparse_keymap (Qnil);
- kb->Vlocal_function_key_map = Fmake_sparse_keymap (Qnil);
- Fset_keymap_parent (kb->Vlocal_function_key_map, Vfunction_key_map);
kb->Vdefault_minibuffer_frame = Qnil;
}
@@ -11547,8 +11106,7 @@ delete_kboard (kb)
&& FRAMEP (selected_frame)
&& FRAME_LIVE_P (XFRAME (selected_frame)))
{
- current_kboard = FRAME_KBOARD (XFRAME (selected_frame));
- single_kboard = 0;
+ current_kboard = XFRAME (selected_frame)->kboard;
if (current_kboard == kb)
abort ();
}
@@ -11591,14 +11149,8 @@ init_keyboard ()
wipe_kboard (current_kboard);
init_kboard (current_kboard);
- if (!noninteractive)
+ if (!noninteractive && !read_socket_hook && NILP (Vwindow_system))
{
- /* Before multi-tty support, these handlers used to be installed
- only if the current session was a tty session. Now an Emacs
- session may have multiple display types, so we always handle
- SIGINT. There is special code in interrupt_signal to exit
- Emacs on SIGINT when there are no termcap frames on the
- controlling terminal. */
signal (SIGINT, interrupt_signal);
#if defined (HAVE_TERMIO) || defined (HAVE_TERMIOS)
/* For systems with SysV TERMIO, C-g is set up for both SIGINT and
@@ -11845,7 +11397,7 @@ syms_of_keyboard ()
staticpro (&button_down_location);
mouse_syms = Fmake_vector (make_number (1), Qnil);
staticpro (&mouse_syms);
- wheel_syms = Fmake_vector (make_number (4), Qnil);
+ wheel_syms = Fmake_vector (make_number (2), Qnil);
staticpro (&wheel_syms);
{
@@ -11923,10 +11475,6 @@ syms_of_keyboard ()
defsubr (&Stop_level);
defsubr (&Sdiscard_input);
defsubr (&Sopen_dribble_file);
- defsubr (&Sset_input_interrupt_mode);
- defsubr (&Sset_output_flow_control);
- defsubr (&Sset_input_meta_mode);
- defsubr (&Sset_quit_char);
defsubr (&Sset_input_mode);
defsubr (&Scurrent_input_mode);
defsubr (&Sexecute_extended_command);
@@ -11993,19 +11541,11 @@ In other words, the present command is the event that made the previous
command exit.
The value `kill-region' is special; it means that the previous command
-was a kill command.
-
-`last-command' has a separate binding for each terminal device.
-See Info node `(elisp)Multiple displays'. */);
+was a kill command. */);
DEFVAR_KBOARD ("real-last-command", Vreal_last_command,
doc: /* Same as `last-command', but never altered by Lisp code. */);
- DEFVAR_KBOARD ("last-repeatable-command", Vlast_repeatable_command,
- doc: /* Last command that may be repeated.
-The last command executed that was not bound to an input event.
-This is the command `repeat' will try to repeat. */);
-
DEFVAR_LISP ("this-command", &Vthis_command,
doc: /* The command now being executed.
The command can set this variable; whatever is put here
@@ -12113,8 +11653,8 @@ for that character after that prefix key. */);
Useful to set before you dump a modified Emacs. */);
Vtop_level = Qnil;
- DEFVAR_KBOARD ("keyboard-translate-table", Vkeyboard_translate_table,
- doc: /* Translate table for local keyboard input, or nil.
+ DEFVAR_LISP ("keyboard-translate-table", &Vkeyboard_translate_table,
+ doc: /* Translate table for keyboard input, or nil.
If non-nil, the value should be a char-table. Each character read
from the keyboard is looked up in this char-table. If the value found
there is non-nil, then it is used instead of the actual input character.
@@ -12124,10 +11664,8 @@ If it is a string or vector of length N, character codes N and up are left
untranslated. In a vector, an element which is nil means "no translation".
This is applied to the characters supplied to input methods, not their
-output. See also `translation-table-for-input'.
-
-This variable has a separate binding for each terminal. See Info node
-`(elisp)Multiple displays'. */);
+output. See also `translation-table-for-input'. */);
+ Vkeyboard_translate_table = Qnil;
DEFVAR_BOOL ("cannot-suspend", &cannot_suspend,
doc: /* Non-nil means to always spawn a subshell instead of suspending.
@@ -12212,11 +11750,7 @@ buffer's local map, and the minor mode keymaps and text property keymaps.
It also replaces `overriding-local-map'.
This variable is intended to let commands such as `universal-argument'
-set up a different keymap for reading the next command.
-
-`overriding-terminal-local-map' has a separate binding for each
-terminal device.
-See Info node `(elisp)Multiple displays'. */);
+set up a different keymap for reading the next command. */);
DEFVAR_LISP ("overriding-local-map", &Voverriding_local_map,
doc: /* Keymap that overrides all other local keymaps.
@@ -12241,73 +11775,7 @@ and the minor mode maps regardless of `overriding-local-map'. */);
doc: /* Alist of system-specific X windows key symbols.
Each element should have the form (N . SYMBOL) where N is the
numeric keysym code (sans the \"system-specific\" bit 1<<28)
-and SYMBOL is its name.
-
-`system-key-alist' has a separate binding for each terminal device.
-See Info node `(elisp)Multiple displays'. */);
-
- DEFVAR_KBOARD ("local-function-key-map", Vlocal_function_key_map,
- doc: /* Keymap that translates key sequences to key sequences during input.
-This is used mainly for mapping key sequences into some preferred
-key events (symbols).
-
-The `read-key-sequence' function replaces any subsequence bound by
-`local-function-key-map' with its binding. More precisely, when the
-active keymaps have no binding for the current key sequence but
-`local-function-key-map' binds a suffix of the sequence to a vector or
-string, `read-key-sequence' replaces the matching suffix with its
-binding, and continues with the new sequence.
-
-If the binding is a function, it is called with one argument (the prompt)
-and its return value (a key sequence) is used.
-
-The events that come from bindings in `local-function-key-map' are not
-themselves looked up in `local-function-key-map'.
-
-For example, suppose `local-function-key-map' binds `ESC O P' to [f1].
-Typing `ESC O P' to `read-key-sequence' would return [f1]. Typing
-`C-x ESC O P' would return [?\\C-x f1]. If [f1] were a prefix key,
-typing `ESC O P x' would return [f1 x].
-
-`local-function-key-map' has a separate binding for each terminal
-device. See Info node `(elisp)Multiple displays'. If you need to
-define a binding on all terminals, change `function-key-map'
-instead. Initially, `local-function-key-map' is an empty keymap that
-has `function-key-map' as its parent on all terminal devices. */);
-
- DEFVAR_KBOARD ("input-decode-map", Vinput_decode_map,
- doc: /* Keymap that decodes input escape sequences.
-This is used mainly for mapping ASCII function key sequences into
-real Emacs function key events (symbols).
-
-The `read-key-sequence' function replaces any subsequence bound by
-`local-function-key-map' with its binding. Contrary to `function-key-map',
-this map applies its rebinding regardless of the presence of an ordinary
-binding. So it is more like `key-translation-map' except that it applies
-before `function-key-map' rather than after.
-
-If the binding is a function, it is called with one argument (the prompt)
-and its return value (a key sequence) is used.
-
-The events that come from bindings in `input-decode-map' are not
-themselves looked up in `input-decode-map'.
-
-This variable is keyboard-local. */);
-
- DEFVAR_LISP ("function-key-map", &Vfunction_key_map,
- doc: /* The parent keymap of all `local-function-key-map' instances.
-Function key definitions that apply to all terminal devices should go
-here. If a mapping is defined in both the current
-`local-function-key-map' binding and this variable, then the local
-definition will take precendence. */);
- Vfunction_key_map = Fmake_sparse_keymap (Qnil);
-
- DEFVAR_LISP ("key-translation-map", &Vkey_translation_map,
- doc: /* Keymap of key translations that can override keymaps.
-This keymap works like `function-key-map', but comes after that,
-and its non-prefix bindings override ordinary bindings.
-Another difference is that it is global rather than keyboard-local. */);
- Vkey_translation_map = Fmake_sparse_keymap (Qnil);
+and SYMBOL is its name. */);
DEFVAR_LISP ("deferred-action-list", &Vdeferred_action_list,
doc: /* List of deferred actions to be performed at a later time.
@@ -12476,8 +11944,6 @@ mark_kboards ()
mark_object (kb->Voverriding_terminal_local_map);
mark_object (kb->Vlast_command);
mark_object (kb->Vreal_last_command);
- mark_object (kb->Vkeyboard_translate_table);
- mark_object (kb->Vlast_repeatable_command);
mark_object (kb->Vprefix_arg);
mark_object (kb->Vlast_prefix_arg);
mark_object (kb->kbd_queue);
@@ -12485,8 +11951,6 @@ mark_kboards ()
mark_object (kb->Vlast_kbd_macro);
mark_object (kb->Vsystem_key_alist);
mark_object (kb->system_key_syms);
- mark_object (kb->Vinput_decode_map);
- mark_object (kb->Vlocal_function_key_map);
mark_object (kb->Vdefault_minibuffer_frame);
mark_object (kb->echo_string);
}
diff --git a/src/keyboard.h b/src/keyboard.h
index ae135b30b7..15e55ad4e6 100644
--- a/src/keyboard.h
+++ b/src/keyboard.h
@@ -23,9 +23,8 @@ Boston, MA 02110-1301, USA. */
/* Length of echobuf field in each KBOARD. */
-/* Each KBOARD represents one logical input stream from which Emacs
- gets input. If we are using ordinary terminals, it has one KBOARD
- object for each terminal device.
+/* Each KBOARD represents one logical input stream from which Emacs gets input.
+ If we are using an ordinary terminal, it has one KBOARD object.
Usually each X display screen has its own KBOARD,
but when two of them are on the same X server,
we assume they share a keyboard and give them one KBOARD in common.
@@ -84,12 +83,6 @@ struct kboard
other commands. */
Lisp_Object Vreal_last_command;
- /* User-supplied table to translate input characters through. */
- Lisp_Object Vkeyboard_translate_table;
-
- /* Last command that may be repeated by `repeat'. */
- Lisp_Object Vlast_repeatable_command;
-
/* The prefix argument for the next command, in raw form. */
Lisp_Object Vprefix_arg;
@@ -130,15 +123,6 @@ struct kboard
/* Cache for modify_event_symbol. */
Lisp_Object system_key_syms;
- /* Keymap mapping keys to alternative preferred forms.
- See the DEFVAR for more documentation. */
- Lisp_Object Vlocal_function_key_map;
-
- /* Keymap mapping ASCII function key sequences onto their preferred
- forms. Initialized by the terminal-specific lisp files. See the
- DEFVAR for more documentation. */
- Lisp_Object Vinput_decode_map;
-
/* Minibufferless frames on this display use this frame's minibuffer. */
Lisp_Object Vdefault_minibuffer_frame;
@@ -171,7 +155,7 @@ struct kboard
};
#ifdef MULTI_KBOARD
-/* Temporarily used before a frame has been opened. */
+/* Temporarily used before a frame has been opened, and for termcap frames */
extern KBOARD *initial_kboard;
/* In the single-kboard state, this is the kboard
@@ -206,6 +190,10 @@ extern EMACS_INT num_nonmacro_input_events;
/* Nonzero means polling for input is temporarily suppressed. */
extern int poll_suppress_count;
+/* Keymap mapping ASCII function key sequences onto their preferred forms.
+ Initialized by the terminal-specific lisp files. */
+extern Lisp_Object Vfunction_key_map;
+
/* Vector holding the key sequence that invoked the current command.
It is reused for each command, and it may be longer than the current
sequence; this_command_key_count indicates how many elements
@@ -313,24 +301,18 @@ extern Lisp_Object parse_modifiers P_ ((Lisp_Object));
extern Lisp_Object reorder_modifiers P_ ((Lisp_Object));
extern Lisp_Object read_char P_ ((int, int, Lisp_Object *, Lisp_Object,
int *, EMACS_TIME *));
-
-
-/* Parent keymap of terminal-local function-key-map instances. */
-extern Lisp_Object Vfunction_key_map;
-
-/* Keymap of key translations that can override keymaps. */
-extern Lisp_Object Vkey_translation_map;
+/* User-supplied string to translate input characters through. */
+extern Lisp_Object Vkeyboard_translate_table;
extern int parse_menu_item P_ ((Lisp_Object, int, int));
extern void echo_now P_ ((void));
extern void init_kboard P_ ((KBOARD *));
extern void delete_kboard P_ ((KBOARD *));
+extern void single_kboard_state P_ ((void));
extern void not_single_kboard_state P_ ((KBOARD *));
-extern void push_kboard P_ ((struct kboard *));
extern void push_frame_kboard P_ ((struct frame *));
-extern void pop_kboard P_ ((void));
-extern void temporarily_switch_to_single_kboard P_ ((struct frame *));
+extern void pop_frame_kboard P_ ((void));
extern void record_asynch_buffer_change P_ ((void));
extern SIGTYPE input_poll_signal P_ ((int));
extern void start_polling P_ ((void));
@@ -364,8 +346,5 @@ extern Lisp_Object menu_item_eval_property P_ ((Lisp_Object));
extern int kbd_buffer_events_waiting P_ ((int));
extern void add_user_signals P_ ((int, const char *));
-extern int tty_read_avail_input P_ ((struct terminal *, int,
- struct input_event *));
-
/* arch-tag: 769cbade-1ba9-4950-b886-db265b061aa3
(do not change this comment) */
diff --git a/src/keymap.c b/src/keymap.c
index be23c20a3a..7f329cc9a1 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -29,9 +29,9 @@ Boston, MA 02110-1301, USA. */
#include "lisp.h"
#include "commands.h"
#include "buffer.h"
+#include "character.h"
#include "charset.h"
#include "keyboard.h"
-#include "frame.h"
#include "termhooks.h"
#include "blockinput.h"
#include "puresize.h"
@@ -91,6 +91,14 @@ Lisp_Object Vminor_mode_overriding_map_alist;
/* List of emulation mode keymap alists. */
Lisp_Object Vemulation_mode_map_alists;
+/* Keymap mapping ASCII function key sequences onto their preferred forms.
+ Initialized by the terminal-specific lisp files. See DEFVAR for more
+ documentation. */
+Lisp_Object Vfunction_key_map;
+
+/* Keymap mapping ASCII function key sequences onto their preferred forms. */
+Lisp_Object Vkey_translation_map;
+
/* A list of all commands given new bindings since a certain time
when nil was stored here.
This is used to speed up recomputation of menu key equivalents
@@ -422,11 +430,7 @@ Return PARENT. PARENT should be nil or another keymap. */)
if (CHAR_TABLE_P (XCAR (list)))
{
- int indices[3];
-
- map_char_table (fix_submap_inheritance, Qnil,
- XCAR (list), XCAR (list),
- keymap, 0, indices);
+ map_char_table (fix_submap_inheritance, Qnil, XCAR (list), keymap);
}
}
@@ -566,9 +570,7 @@ access_keymap (map, idx, t_ok, noinherit, autoload)
GCPRO4 (map, tail, idx, t_binding);
- /* If `t_ok' is 2, both `t' and generic-char bindings are accepted.
- If it is 1, only generic-char bindings are accepted.
- Otherwise, neither are. */
+ /* If `t_ok' is 2, both `t' is accepted. */
t_ok = t_ok ? 2 : 0;
for (tail = XCDR (map);
@@ -592,24 +594,6 @@ access_keymap (map, idx, t_ok, noinherit, autoload)
if (EQ (key, idx))
val = XCDR (binding);
- else if (t_ok
- && INTEGERP (idx)
- && (XINT (idx) & CHAR_MODIFIER_MASK) == 0
- && INTEGERP (key)
- && (XINT (key) & CHAR_MODIFIER_MASK) == 0
- && !SINGLE_BYTE_CHAR_P (XINT (idx))
- && !SINGLE_BYTE_CHAR_P (XINT (key))
- && CHAR_VALID_P (XINT (key), 1)
- && !CHAR_VALID_P (XINT (key), 0)
- && (CHAR_CHARSET (XINT (key))
- == CHAR_CHARSET (XINT (idx))))
- {
- /* KEY is the generic character of the charset of IDX.
- Use KEY's binding if there isn't a binding for IDX
- itself. */
- t_binding = XCDR (binding);
- t_ok = 0;
- }
else if (t_ok > 1 && EQ (key, Qt))
{
t_binding = XCDR (binding);
@@ -721,12 +705,10 @@ map_keymap (map, fun, args, data, autoload)
}
else if (CHAR_TABLE_P (binding))
{
- int indices[3];
- map_char_table (map_keymap_char_table_item, Qnil, binding, binding,
+ map_char_table (map_keymap_char_table_item, Qnil, binding,
Fcons (make_save_value (fun, 0),
Fcons (make_save_value (data, 0),
- args)),
- 0, indices);
+ args)));
}
}
UNGCPRO;
@@ -881,10 +863,15 @@ store_in_keymap (keymap, idx, def)
if (!CONSP (keymap) || !EQ (XCAR (keymap), Qkeymap))
error ("attempt to define a key in a non-keymap");
- /* If idx is a list (some sort of mouse click, perhaps?),
- the index we want to use is the car of the list, which
- ought to be a symbol. */
- idx = EVENT_HEAD (idx);
+ /* If idx is a cons, and the car part is a character, idx must be of
+ the form (FROM-CHAR . TO-CHAR). */
+ if (CONSP (idx) && CHARACTERP (XCAR (idx)))
+ CHECK_CHARACTER_CDR (idx);
+ else
+ /* If idx is a list (some sort of mouse click, perhaps?),
+ the index we want to use is the car of the list, which
+ ought to be a symbol. */
+ idx = EVENT_HEAD (idx);
/* If idx is a symbol, it might have modifiers, which need to
be put in the canonical order. */
@@ -921,6 +908,19 @@ store_in_keymap (keymap, idx, def)
ASET (elt, XFASTINT (idx), def);
return def;
}
+ else if (CONSP (idx) && CHARACTERP (XCAR (idx)))
+ {
+ int from = XFASTINT (XCAR (idx));
+ int to = XFASTINT (XCDR (idx));
+
+ if (to >= ASIZE (elt))
+ to = ASIZE (elt) - 1;
+ for (; from <= to; from++)
+ ASET (elt, from, def);
+ if (to == XFASTINT (XCDR (idx)))
+ /* We have defined all keys in IDX. */
+ return def;
+ }
insertion_point = tail;
}
else if (CHAR_TABLE_P (elt))
@@ -937,6 +937,11 @@ store_in_keymap (keymap, idx, def)
NILP (def) ? Qt : def);
return def;
}
+ else if (CONSP (idx) && CHARACTERP (XCAR (idx)))
+ {
+ Fset_char_table_range (elt, idx, NILP (def) ? Qt : def);
+ return def;
+ }
insertion_point = tail;
}
else if (CONSP (elt))
@@ -947,6 +952,19 @@ store_in_keymap (keymap, idx, def)
XSETCDR (elt, def);
return def;
}
+ else if (CONSP (idx) && CHARACTERP (XCAR (idx)))
+ {
+ int from = XFASTINT (XCAR (idx));
+ int to = XFASTINT (XCDR (idx));
+
+ if (from <= XFASTINT (XCAR (elt))
+ && to >= XFASTINT (XCAR (elt)))
+ {
+ XSETCDR (elt, def);
+ if (from == to)
+ return def;
+ }
+ }
}
else if (EQ (elt, Qkeymap))
/* If we find a 'keymap' symbol in the spine of KEYMAP,
@@ -961,9 +979,22 @@ store_in_keymap (keymap, idx, def)
keymap_end:
/* We have scanned the entire keymap, and not found a binding for
IDX. Let's add one. */
- CHECK_IMPURE (insertion_point);
- XSETCDR (insertion_point,
- Fcons (Fcons (idx, def), XCDR (insertion_point)));
+ {
+ Lisp_Object elt;
+
+ if (CONSP (idx) && CHARACTERP (XCAR (idx)))
+ {
+ /* IDX specifies a range of characters, and not all of them
+ were handled yet, which means this keymap doesn't have a
+ char-table. So, we insert a char-table now. */
+ elt = Fmake_char_table (Qkeymap, Qnil);
+ Fset_char_table_range (elt, idx, NILP (def) ? Qt : def);
+ }
+ else
+ elt = Fcons (idx, def);
+ CHECK_IMPURE (insertion_point);
+ XSETCDR (insertion_point, Fcons (elt, XCDR (insertion_point)));
+ }
}
return def;
@@ -1049,7 +1080,7 @@ static void
copy_keymap_1 (chartable, idx, elt)
Lisp_Object chartable, idx, elt;
{
- Faset (chartable, idx, copy_keymap_item (elt));
+ Fset_char_table_range (chartable, idx, copy_keymap_item (elt));
}
DEFUN ("copy-keymap", Fcopy_keymap, Scopy_keymap, 1, 1, 0,
@@ -1072,9 +1103,8 @@ is not copied. */)
Lisp_Object elt = XCAR (keymap);
if (CHAR_TABLE_P (elt))
{
- int indices[3];
elt = Fcopy_sequence (elt);
- map_char_table (copy_keymap_1, Qnil, elt, elt, elt, 0, indices);
+ map_char_table (copy_keymap_1, Qnil, elt, elt);
}
else if (VECTORP (elt))
{
@@ -1171,8 +1201,15 @@ binding KEY to DEF is added at the front of KEYMAP. */)
{
c = Faref (key, make_number (idx));
- if (CONSP (c) && lucid_event_type_list_p (c))
- c = Fevent_convert_list (c);
+ if (CONSP (c))
+ {
+ /* C may be a Lucid style event type list or a cons (FROM .
+ TO) specifying a range of characters. */
+ if (lucid_event_type_list_p (c))
+ c = Fevent_convert_list (c);
+ else if (CHARACTERP (XCAR (c)))
+ CHECK_CHARACTER_CDR (c);
+ }
if (SYMBOLP (c))
silly_event_symbol_error (c);
@@ -1193,7 +1230,10 @@ binding KEY to DEF is added at the front of KEYMAP. */)
idx++;
}
- if (!INTEGERP (c) && !SYMBOLP (c) && !CONSP (c))
+ if (!INTEGERP (c) && !SYMBOLP (c)
+ && (!CONSP (c)
+ /* If C is a range, it must be a leaf. */
+ || (INTEGERP (XCAR (c)) && idx != length)))
error ("Key sequence contains invalid event");
if (idx == length)
@@ -2313,15 +2353,13 @@ push_key_description (c, p, force_multibyte)
int force_multibyte;
{
unsigned c2;
- int valid_p;
/* Clear all the meaningless bits above the meta bit. */
c &= meta_modifier | ~ - meta_modifier;
c2 = c & ~(alt_modifier | ctrl_modifier | hyper_modifier
| meta_modifier | shift_modifier | super_modifier);
- valid_p = SINGLE_BYTE_CHAR_P (c2) || char_valid_p (c2, 0);
- if (! valid_p)
+ if (! CHARACTERP (make_number (c2)))
{
/* KEY_DESCRIPTION_SIZE is large enough for this. */
p += sprintf (p, "[%d]", c);
@@ -2415,25 +2453,12 @@ push_key_description (c, p, force_multibyte)
}
else
{
- if (force_multibyte)
- {
- if (SINGLE_BYTE_CHAR_P (c))
- c = unibyte_char_to_multibyte (c);
- p += CHAR_STRING (c, p);
- }
- else if (NILP (current_buffer->enable_multibyte_characters))
- {
- int bit_offset;
- *p++ = '\\';
- /* The biggest character code uses 19 bits. */
- for (bit_offset = 18; bit_offset >= 0; bit_offset -= 3)
- {
- if (c >= (1 << bit_offset))
- *p++ = ((c & (7 << bit_offset)) >> bit_offset) + '0';
- }
- }
+ /* Now we are sure that C is a valid character code. */
+ if (NILP (current_buffer->enable_multibyte_characters)
+ && ! force_multibyte)
+ *p++ = multibyte_char_to_unibyte (c, Qnil);
else
- p += CHAR_STRING (c, p);
+ p += CHAR_STRING (c, (unsigned char *) p);
}
return p;
@@ -2457,56 +2482,10 @@ around function keys and event symbols. */)
if (INTEGERP (key)) /* Normal character */
{
- unsigned int charset, c1, c2;
- int without_bits = XINT (key) & ~((-1) << CHARACTERBITS);
-
- if (SINGLE_BYTE_CHAR_P (without_bits))
- charset = 0;
- else
- SPLIT_CHAR (without_bits, charset, c1, c2);
-
- if (! CHAR_VALID_P (without_bits, 1))
- {
- char buf[256];
+ char tem[KEY_DESCRIPTION_SIZE];
- sprintf (buf, "Invalid char code %ld", XINT (key));
- return build_string (buf);
- }
- else if (charset
- && ((c1 == 0 && c2 == -1) || c2 == 0))
- {
- /* Handle a generic character. */
- Lisp_Object name;
- char buf[256];
-
- name = CHARSET_TABLE_INFO (charset, CHARSET_SHORT_NAME_IDX);
- CHECK_STRING (name);
- if (c1 == 0)
- /* Only a charset is specified. */
- sprintf (buf, "Generic char %d: all of ", without_bits);
- else
- /* 1st code-point of 2-dimensional charset is specified. */
- sprintf (buf, "Generic char %d: row %d of ", without_bits, c1);
- return concat2 (build_string (buf), name);
- }
- else
- {
- char tem[KEY_DESCRIPTION_SIZE], *end;
- int nbytes, nchars;
- Lisp_Object string;
-
- end = push_key_description (XUINT (key), tem, 1);
- nbytes = end - tem;
- nchars = multibyte_chars_in_text (tem, nbytes);
- if (nchars == nbytes)
- {
- *end = '\0';
- string = build_string (tem);
- }
- else
- string = make_multibyte_string (tem, nchars, nbytes);
- return string;
- }
+ *push_key_description (XUINT (key), tem, 1) = 0;
+ return build_string (tem);
}
else if (SYMBOLP (key)) /* Function key or event-symbol */
{
@@ -2572,7 +2551,7 @@ See Info node `(elisp)Describing Characters' for examples. */)
CHECK_NUMBER (character);
c = XINT (character);
- if (!SINGLE_BYTE_CHAR_P (c))
+ if (!ASCII_CHAR_P (c))
{
int len = CHAR_STRING (c, str);
@@ -2951,7 +2930,11 @@ where_is_internal_1 (key, binding, args, data)
Faset (sequence, last, make_number (XINT (key) | meta_modifier));
}
else
- sequence = append_key (this, key);
+ {
+ if (CONSP (key))
+ key = Fcons (XCAR (key), XCDR (key));
+ sequence = append_key (this, key);
+ }
if (!NILP (where_is_cache))
{
@@ -2994,11 +2977,11 @@ You type Translation\n\
outbuf = Fcurrent_buffer ();
/* Report on alternates for keys. */
- if (STRINGP (current_kboard->Vkeyboard_translate_table) && !NILP (prefix))
+ if (STRINGP (Vkeyboard_translate_table) && !NILP (prefix))
{
int c;
- const unsigned char *translate = SDATA (current_kboard->Vkeyboard_translate_table);
- int translate_len = SCHARS (current_kboard->Vkeyboard_translate_table);
+ const unsigned char *translate = SDATA (Vkeyboard_translate_table);
+ int translate_len = SCHARS (Vkeyboard_translate_table);
for (c = 0; c < translate_len; c++)
if (translate[c] != c)
@@ -3021,7 +3004,7 @@ You type Translation\n\
insert ("\n", 1);
/* Insert calls signal_after_change which may GC. */
- translate = SDATA (current_kboard->Vkeyboard_translate_table);
+ translate = SDATA (Vkeyboard_translate_table);
}
insert ("\n", 1);
@@ -3117,15 +3100,10 @@ You type Translation\n\
"\f\nGlobal Bindings", nomenu, 0, 1, 0);
/* Print the function-key-map translations under this prefix. */
- if (!NILP (current_kboard->Vlocal_function_key_map))
- describe_map_tree (current_kboard->Vlocal_function_key_map, 0, Qnil, prefix,
+ if (!NILP (Vfunction_key_map))
+ describe_map_tree (Vfunction_key_map, 0, Qnil, prefix,
"\f\nFunction key map translations", nomenu, 1, 0, 0);
- /* Print the input-decode-map translations under this prefix. */
- if (!NILP (current_kboard->Vinput_decode_map))
- describe_map_tree (current_kboard->Vinput_decode_map, 0, Qnil, prefix,
- "\f\nInput decoding map translations", nomenu, 1, 0, 0);
-
UNGCPRO;
return Qnil;
}
@@ -3607,9 +3585,10 @@ DESCRIBER is the output function used; nil means use `princ'. */)
If the definition in effect in the whole map does not match
the one in this vector, we ignore this one.
- When describing a sub-char-table, INDICES is a list of
- indices at higher levels in this char-table,
- and CHAR_TABLE_DEPTH says how many levels down we have gone.
+ ARGS is simply passed as the second argument to ELT_DESCRIBER.
+
+ INDICES and CHAR_TABLE_DEPTH are ignored. They will be removed in
+ the near future.
KEYMAP_P is 1 if vector is known to be a keymap, so map ESC to M-.
@@ -3634,24 +3613,18 @@ describe_vector (vector, prefix, args, elt_describer,
Lisp_Object definition;
Lisp_Object tem2;
Lisp_Object elt_prefix = Qnil;
- register int i;
+ int i;
Lisp_Object suppress;
Lisp_Object kludge;
int first = 1;
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
/* Range of elements to be handled. */
int from, to;
- /* A flag to tell if a leaf in this level of char-table is not a
- generic character (i.e. a complete multibyte character). */
- int complete_char;
- int character;
+ Lisp_Object character;
int starting_i;
suppress = Qnil;
- if (indices == 0)
- indices = (int *) alloca (3 * sizeof (int));
-
definition = Qnil;
if (!keymap_p)
@@ -3675,61 +3648,24 @@ describe_vector (vector, prefix, args, elt_describer,
if (partial)
suppress = intern ("suppress-keymap");
- if (CHAR_TABLE_P (vector))
- {
- if (char_table_depth == 0)
- {
- /* VECTOR is a top level char-table. */
- complete_char = 1;
- from = 0;
- to = CHAR_TABLE_ORDINARY_SLOTS;
- }
- else
- {
- /* VECTOR is a sub char-table. */
- if (char_table_depth >= 3)
- /* A char-table is never that deep. */
- error ("Too deep char table");
-
- complete_char
- = (CHARSET_VALID_P (indices[0])
- && ((CHARSET_DIMENSION (indices[0]) == 1
- && char_table_depth == 1)
- || char_table_depth == 2));
-
- /* Meaningful elements are from 32th to 127th. */
- from = 32;
- to = SUB_CHAR_TABLE_ORDINARY_SLOTS;
- }
- }
- else
- {
- /* This does the right thing for ordinary vectors. */
-
- complete_char = 1;
- from = 0;
- to = XVECTOR (vector)->size;
- }
+ from = 0;
+ to = CHAR_TABLE_P (vector) ? MAX_CHAR + 1 : XVECTOR (vector)->size;
for (i = from; i < to; i++)
{
int this_shadowed = 0;
- QUIT;
+ int range_beg, range_end;
+ Lisp_Object val;
- if (CHAR_TABLE_P (vector))
- {
- if (char_table_depth == 0 && i >= CHAR_TABLE_SINGLE_BYTE_SLOTS)
- complete_char = 0;
+ QUIT;
- if (i >= CHAR_TABLE_SINGLE_BYTE_SLOTS
- && !CHARSET_DEFINED_P (i - 128))
- continue;
+ starting_i = i;
- definition
- = get_keyelt (XCHAR_TABLE (vector)->contents[i], 0);
- }
+ if (CHAR_TABLE_P (vector))
+ val = char_table_ref_and_range (vector, i, &range_beg, &i);
else
- definition = get_keyelt (AREF (vector, i), 0);
+ val = AREF (vector, i);
+ definition = get_keyelt (val, 0);
if (NILP (definition)) continue;
@@ -3743,31 +3679,11 @@ describe_vector (vector, prefix, args, elt_describer,
if (!NILP (tem)) continue;
}
- /* Set CHARACTER to the character this entry describes, if any.
- Also update *INDICES. */
- if (CHAR_TABLE_P (vector))
- {
- indices[char_table_depth] = i;
-
- if (char_table_depth == 0)
- {
- character = i;
- indices[0] = i - 128;
- }
- else if (complete_char)
- {
- character = MAKE_CHAR (indices[0], indices[1], indices[2]);
- }
- else
- character = 0;
- }
- else
- character = i;
-
- ASET (kludge, 0, make_number (character));
+ character = make_number (starting_i);
+ ASET (kludge, 0, character);
/* If this binding is shadowed by some other map, ignore it. */
- if (!NILP (shadow) && complete_char)
+ if (!NILP (shadow))
{
Lisp_Object tem;
@@ -3784,7 +3700,7 @@ describe_vector (vector, prefix, args, elt_describer,
/* Ignore this definition if it is shadowed by an earlier
one in the same keymap. */
- if (!NILP (entire_map) && complete_char)
+ if (!NILP (entire_map))
{
Lisp_Object tem;
@@ -3796,89 +3712,28 @@ describe_vector (vector, prefix, args, elt_describer,
if (first)
{
- if (char_table_depth == 0)
- insert ("\n", 1);
+ insert ("\n", 1);
first = 0;
}
- /* For a sub char-table, show the depth by indentation.
- CHAR_TABLE_DEPTH can be greater than 0 only for a char-table. */
- if (char_table_depth > 0)
- insert (" ", char_table_depth * 2); /* depth is 1 or 2. */
-
/* Output the prefix that applies to every entry in this map. */
if (!NILP (elt_prefix))
insert1 (elt_prefix);
- /* Insert or describe the character this slot is for,
- or a description of what it is for. */
- if (SUB_CHAR_TABLE_P (vector))
- {
- if (complete_char)
- insert_char (character);
- else
- {
- /* We need an octal representation for this block of
- characters. */
- char work[16];
- sprintf (work, "(row %d)", i);
- insert (work, strlen (work));
- }
- }
- else if (CHAR_TABLE_P (vector))
- {
- if (complete_char)
- insert1 (Fkey_description (kludge, prefix));
- else
- {
- /* Print the information for this character set. */
- insert_string ("<");
- tem2 = CHARSET_TABLE_INFO (i - 128, CHARSET_SHORT_NAME_IDX);
- if (STRINGP (tem2))
- insert_from_string (tem2, 0, 0, SCHARS (tem2),
- SBYTES (tem2), 0);
- else
- insert ("?", 1);
- insert (">", 1);
- }
- }
- else
- {
- insert1 (Fkey_description (kludge, prefix));
- }
-
- /* If we find a sub char-table within a char-table,
- scan it recursively; it defines the details for
- a character set or a portion of a character set. */
- if (CHAR_TABLE_P (vector) && SUB_CHAR_TABLE_P (definition))
- {
- insert ("\n", 1);
- describe_vector (definition, prefix, args, elt_describer,
- partial, shadow, entire_map,
- indices, char_table_depth + 1, keymap_p,
- mention_shadow);
- continue;
- }
-
- starting_i = i;
+ insert1 (Fkey_description (kludge, prefix));
/* Find all consecutive characters or rows that have the same
definition. But, for elements of a top level char table, if
they are for charsets, we had better describe one by one even
if they have the same definition. */
if (CHAR_TABLE_P (vector))
- {
- int limit = to;
-
- if (char_table_depth == 0)
- limit = CHAR_TABLE_SINGLE_BYTE_SLOTS;
-
- while (i + 1 < limit
- && (tem2 = get_keyelt (XCHAR_TABLE (vector)->contents[i + 1], 0),
- !NILP (tem2))
- && !NILP (Fequal (tem2, definition)))
- i++;
- }
+ while (i + 1 < to
+ && (val = char_table_ref_and_range (vector, i + 1,
+ &range_beg, &range_end),
+ tem2 = get_keyelt (val, 0),
+ !NILP (tem2))
+ && !NILP (Fequal (tem2, definition)))
+ i = range_end;
else
while (i + 1 < to
&& (tem2 = get_keyelt (AREF (vector, i + 1), 0),
@@ -3886,7 +3741,6 @@ describe_vector (vector, prefix, args, elt_describer,
&& !NILP (Fequal (tem2, definition)))
i++;
-
/* If we have a range of more than one character,
print where the range reaches to. */
@@ -3899,31 +3753,7 @@ describe_vector (vector, prefix, args, elt_describer,
if (!NILP (elt_prefix))
insert1 (elt_prefix);
- if (CHAR_TABLE_P (vector))
- {
- if (char_table_depth == 0)
- {
- insert1 (Fkey_description (kludge, prefix));
- }
- else if (complete_char)
- {
- indices[char_table_depth] = i;
- character = MAKE_CHAR (indices[0], indices[1], indices[2]);
- insert_char (character);
- }
- else
- {
- /* We need an octal representation for this block of
- characters. */
- char work[16];
- sprintf (work, "(row %d)", i);
- insert (work, strlen (work));
- }
- }
- else
- {
- insert1 (Fkey_description (kludge, prefix));
- }
+ insert1 (Fkey_description (kludge, prefix));
}
/* Print a description of the definition of this character.
@@ -3939,11 +3769,11 @@ describe_vector (vector, prefix, args, elt_describer,
}
}
- /* For (sub) char-table, print `defalt' slot at last. */
- if (CHAR_TABLE_P (vector) && !NILP (XCHAR_TABLE (vector)->defalt))
+ if (CHAR_TABLE_P (vector) && ! NILP (XCHAR_TABLE (vector)->defalt))
{
- insert (" ", char_table_depth * 2);
- insert_string ("<<default>>");
+ if (!NILP (elt_prefix))
+ insert1 (elt_prefix);
+ insert ("default", 7);
(*elt_describer) (XCHAR_TABLE (vector)->defalt, args);
}
@@ -4093,6 +3923,37 @@ the same way. The "active" keymaps in each alist are used before
`minor-mode-map-alist' and `minor-mode-overriding-map-alist'. */);
Vemulation_mode_map_alists = Qnil;
+
+ DEFVAR_LISP ("function-key-map", &Vfunction_key_map,
+ doc: /* Keymap that translates key sequences to key sequences during input.
+This is used mainly for mapping ASCII function key sequences into
+real Emacs function key events (symbols).
+
+The `read-key-sequence' function replaces any subsequence bound by
+`function-key-map' with its binding. More precisely, when the active
+keymaps have no binding for the current key sequence but
+`function-key-map' binds a suffix of the sequence to a vector or string,
+`read-key-sequence' replaces the matching suffix with its binding, and
+continues with the new sequence.
+
+If the binding is a function, it is called with one argument (the prompt)
+and its return value (a key sequence) is used.
+
+The events that come from bindings in `function-key-map' are not
+themselves looked up in `function-key-map'.
+
+For example, suppose `function-key-map' binds `ESC O P' to [f1].
+Typing `ESC O P' to `read-key-sequence' would return [f1]. Typing
+`C-x ESC O P' would return [?\\C-x f1]. If [f1] were a prefix
+key, typing `ESC O P x' would return [f1 x]. */);
+ Vfunction_key_map = Fmake_sparse_keymap (Qnil);
+
+ DEFVAR_LISP ("key-translation-map", &Vkey_translation_map,
+ doc: /* Keymap of key translations that can override keymaps.
+This keymap works like `function-key-map', but comes after that,
+and its non-prefix bindings override ordinary bindings. */);
+ Vkey_translation_map = Qnil;
+
staticpro (&Vmouse_events);
Vmouse_events = Fcons (intern ("menu-bar"),
Fcons (intern ("tool-bar"),
diff --git a/src/keymap.h b/src/keymap.h
index 3268967089..1a51de705b 100644
--- a/src/keymap.h
+++ b/src/keymap.h
@@ -38,7 +38,6 @@ EXFUN (Fcurrent_active_maps, 2);
extern Lisp_Object access_keymap P_ ((Lisp_Object, Lisp_Object, int, int, int));
extern Lisp_Object get_keyelt P_ ((Lisp_Object, int));
extern Lisp_Object get_keymap P_ ((Lisp_Object, int, int));
-EXFUN (Fset_keymap_parent, 2);
extern void describe_map_tree P_ ((Lisp_Object, int, Lisp_Object, Lisp_Object,
char *, int, int, int, int));
extern int current_minor_maps P_ ((Lisp_Object **, Lisp_Object **));
diff --git a/src/lisp.h b/src/lisp.h
index 43daded691..c047355b21 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -113,57 +113,6 @@ extern void die P_((const char *, const char *, int)) NO_RETURN;
#define eassert(cond) CHECK(cond,"assertion failed")
#endif
#endif /* ENABLE_CHECKING */
-
-/***** Select the tagging scheme. *****/
-/* There are basically two options that control the tagging scheme:
- - NO_UNION_TYPE says that Lisp_Object should be an integer instead
- of a union.
- - USE_LSB_TAG means that we can assume the least 3 bits of pointers are
- always 0, and we can thus use them to hold tag bits, without
- restricting our addressing space.
-
- If USE_LSB_TAG is not set, then we use the top 3 bits for tagging, thus
- restricting our possible address range. Currently USE_LSB_TAG is not
- allowed together with a union. This is not due to any fundamental
- technical (or political ;-) problem: nobody wrote the code to do it yet.
-
- USE_LSB_TAG not only requires the least 3 bits of pointers returned by
- malloc to be 0 but also needs to be able to impose a mult-of-8 alignment
- on the few static Lisp_Objects used: all the defsubr as well
- as the two special buffers buffer_defaults and buffer_local_symbols. */
-
-/* First, try and define DECL_ALIGN(type,var) which declares a static
- variable VAR of type TYPE with the added requirement that it be
- TYPEBITS-aligned. */
-#ifndef NO_DECL_ALIGN
-# ifndef DECL_ALIGN
-/* What compiler directive should we use for non-gcc compilers? -stef */
-# if defined (__GNUC__)
-# define DECL_ALIGN(type, var) \
- type __attribute__ ((__aligned__ (1 << GCTYPEBITS))) var
-# endif
-# endif
-#endif
-
-/* Let's USE_LSB_TAG on systems where we know malloc returns mult-of-8. */
-#if defined GNU_MALLOC || defined DOUG_LEA_MALLOC || defined __GLIBC__ || defined MAC_OSX
-/* We also need to be able to specify mult-of-8 alignment on static vars. */
-# if defined DECL_ALIGN
-/* We currently do not support USE_LSB_TAG with a union Lisp_Object. */
-# if defined NO_UNION_TYPE
-# define USE_LSB_TAG
-# endif
-# endif
-#endif
-
-/* If we cannot use 8-byte alignment, make DECL_ALIGN a no-op. */
-#ifndef DECL_ALIGN
-# ifdef USE_LSB_TAG
-# error "USE_LSB_TAG used without defining DECL_ALIGN"
-# endif
-# define DECL_ALIGN(type, var) type var
-#endif
-
/* Define the fundamental Lisp data structures. */
@@ -245,7 +194,7 @@ union Lisp_Object
{
/* Used for comparing two Lisp_Objects;
also, positive integers can be accessed fast this way. */
- EMACS_UINT i;
+ EMACS_INT i;
struct
{
@@ -267,7 +216,7 @@ union Lisp_Object
{
/* Used for comparing two Lisp_Objects;
also, positive integers can be accessed fast this way. */
- EMACS_UINT i;
+ EMACS_INT i;
struct
{
@@ -298,29 +247,34 @@ LISP_MAKE_RVALUE (Lisp_Object o)
#define LISP_MAKE_RVALUE(o) (o)
#endif
-#else /* NO_UNION_TYPE */
+#endif /* NO_UNION_TYPE */
+
/* If union type is not wanted, define Lisp_Object as just a number. */
+#ifdef NO_UNION_TYPE
typedef EMACS_INT Lisp_Object;
#define LISP_MAKE_RVALUE(o) (0+(o))
#endif /* NO_UNION_TYPE */
+/* Two flags that are set during GC. On some machines, these flags
+ are defined differently by the m- file. */
+
/* In the size word of a vector, this bit means the vector has been marked. */
-#define ARRAY_MARK_FLAG ((EMACS_UINT) 1 << (BITS_PER_EMACS_INT - 1))
+#ifndef ARRAY_MARK_FLAG
+#define ARRAY_MARK_FLAG ((EMACS_INT) ((EMACS_UINT) 1 << (VALBITS + GCTYPEBITS - 1)))
+#endif /* no ARRAY_MARK_FLAG */
/* In the size word of a struct Lisp_Vector, this bit means it's really
some other vector-like object. */
-#define PSEUDOVECTOR_FLAG ((ARRAY_MARK_FLAG >> 1))
+#ifndef PSEUDOVECTOR_FLAG
+#define PSEUDOVECTOR_FLAG ((ARRAY_MARK_FLAG >> 1) & ~ARRAY_MARK_FLAG)
+#endif
/* In a pseudovector, the size field actually contains a word with one
PSEUDOVECTOR_FLAG bit set, and exactly one of the following bits to
- indicate the actual type.
- We use a bitset, even tho only one of the bits can be set at any
- particular time just so as to be able to use micro-optimizations such as
- testing membership of a particular subset of pseudovectors in Fequal.
- It is not crucial, but there are plenty of bits here, so why not do it? */
+ indicate the actual type. */
enum pvec_type
{
PVEC_NORMAL_VECTOR = 0,
@@ -334,8 +288,8 @@ enum pvec_type
PVEC_BOOL_VECTOR = 0x10000,
PVEC_BUFFER = 0x20000,
PVEC_HASH_TABLE = 0x40000,
- PVEC_TERMINAL = 0x80000,
- PVEC_TYPE_MASK = 0xffe00
+ PVEC_SUB_CHAR_TABLE = 0x80000,
+ PVEC_TYPE_MASK = 0x0ffe00
#if 0 /* This is used to make the value of PSEUDOVECTOR_FLAG available to
GDB. It doesn't work on OS Alpha. Moved to a variable in
@@ -355,15 +309,63 @@ enum pvec_type
of bool vectors. This should not vary across implementations. */
#define BOOL_VECTOR_BITS_PER_CHAR 8
+/***** Select the tagging scheme. *****/
+/* There are basically two options that control the tagging scheme:
+ - NO_UNION_TYPE says that Lisp_Object should be an integer instead
+ of a union.
+ - USE_LSB_TAG means that we can assume the least 3 bits of pointers are
+ always 0, and we can thus use them to hold tag bits, without
+ restricting our addressing space.
+
+ If USE_LSB_TAG is not set, then we use the top 3 bits for tagging, thus
+ restricting our possible address range. Currently USE_LSB_TAG is not
+ allowed together with a union. This is not due to any fundamental
+ technical (or political ;-) problem: nobody wrote the code to do it yet.
+
+ USE_LSB_TAG not only requires the least 3 bits of pointers returned by
+ malloc to be 0 but also needs to be able to impose a mult-of-8 alignment
+ on the few static Lisp_Objects used: all the defsubr as well
+ as the two special buffers buffer_defaults and buffer_local_symbols. */
+
+/* First, try and define DECL_ALIGN(type,var) which declares a static
+ variable VAR of type TYPE with the added requirement that it be
+ TYPEBITS-aligned. */
+#ifndef NO_DECL_ALIGN
+# ifndef DECL_ALIGN
+/* What compiler directive should we use for non-gcc compilers? -stef */
+# if defined (__GNUC__)
+# define DECL_ALIGN(type, var) \
+ type __attribute__ ((__aligned__ (1 << GCTYPEBITS))) var
+# endif
+# endif
+#endif
+
+/* Let's USE_LSB_TAG on systems where we know malloc returns mult-of-8. */
+#if defined GNU_MALLOC || defined DOUG_LEA_MALLOC || defined __GLIBC__ || defined MAC_OSX
+/* We also need to be able to specify mult-of-8 alignment on static vars. */
+# if defined DECL_ALIGN
+/* We currently do not support USE_LSB_TAG with a union Lisp_Object. */
+# if defined NO_UNION_TYPE
+# define USE_LSB_TAG
+# endif
+# endif
+#endif
+
+/* If we cannot use 8-byte alignment, make DECL_ALIGN a no-op. */
+#ifndef DECL_ALIGN
+# ifdef USE_LSB_TAG
+# error "USE_LSB_TAG used without defining DECL_ALIGN"
+# endif
+# define DECL_ALIGN(type, var) type var
+#endif
+
+
/* These macros extract various sorts of values from a Lisp_Object.
For example, if tem is a Lisp_Object whose type is Lisp_Cons,
XCONS (tem) is the struct Lisp_Cons * pointing to the memory for that cons. */
#ifdef NO_UNION_TYPE
-/* Return a perfect hash of the Lisp_Object representation. */
-#define XHASH(a) (a)
-
#ifdef USE_LSB_TAG
#define TYPEMASK ((((EMACS_INT) 1) << GCTYPEBITS) - 1)
@@ -425,9 +427,9 @@ enum pvec_type
#endif /* not USE_LSB_TAG */
-#else /* not NO_UNION_TYPE */
+#define EQ(x, y) ((x) == (y))
-#define XHASH(a) ((a).i)
+#else /* not NO_UNION_TYPE */
#define XTYPE(a) ((enum Lisp_Type) (a).u.type)
@@ -457,20 +459,9 @@ enum pvec_type
extern Lisp_Object make_number P_ ((EMACS_INT));
#endif
-#endif /* NO_UNION_TYPE */
+#define EQ(x, y) ((x).i == (y).i)
-#define EQ(x, y) (XHASH (x) == XHASH (y))
-
-/* During garbage collection, XGCTYPE must be used for extracting types
- so that the mark bit is ignored. XMARKBIT accesses the markbit.
- Markbits are used only in particular slots of particular structure types.
- Other markbits are always zero.
- Outside of garbage collection, all mark bits are always zero. */
-
-#ifndef XGCTYPE
-/* The distinction does not exist now that the MARKBIT has been eliminated. */
-#define XGCTYPE(a) XTYPE (a)
-#endif
+#endif /* NO_UNION_TYPE */
#ifndef XPNTR
#ifdef HAVE_SHM
@@ -513,11 +504,11 @@ extern size_t pure_size;
/* Extract a value or address from a Lisp_Object. */
-#define XCONS(a) (eassert (GC_CONSP(a)),(struct Lisp_Cons *) XPNTR(a))
-#define XVECTOR(a) (eassert (GC_VECTORLIKEP(a)),(struct Lisp_Vector *) XPNTR(a))
-#define XSTRING(a) (eassert (GC_STRINGP(a)),(struct Lisp_String *) XPNTR(a))
-#define XSYMBOL(a) (eassert (GC_SYMBOLP(a)),(struct Lisp_Symbol *) XPNTR(a))
-#define XFLOAT(a) (eassert (GC_FLOATP(a)),(struct Lisp_Float *) XPNTR(a))
+#define XCONS(a) (eassert (CONSP(a)),(struct Lisp_Cons *) XPNTR(a))
+#define XVECTOR(a) (eassert (VECTORLIKEP(a)),(struct Lisp_Vector *) XPNTR(a))
+#define XSTRING(a) (eassert (STRINGP(a)),(struct Lisp_String *) XPNTR(a))
+#define XSYMBOL(a) (eassert (SYMBOLP(a)),(struct Lisp_Symbol *) XPNTR(a))
+#define XFLOAT(a) (eassert (FLOATP(a)),(struct Lisp_Float *) XPNTR(a))
/* Misc types. */
@@ -535,13 +526,13 @@ extern size_t pure_size;
/* Pseudovector types. */
-#define XPROCESS(a) (eassert (GC_PROCESSP(a)),(struct Lisp_Process *) XPNTR(a))
-#define XWINDOW(a) (eassert (GC_WINDOWP(a)),(struct window *) XPNTR(a))
-#define XTERMINAL(a) (eassert (GC_TERMINALP(a)),(struct terminal *) XPNTR(a))
-#define XSUBR(a) (eassert (GC_SUBRP(a)),(struct Lisp_Subr *) XPNTR(a))
-#define XBUFFER(a) (eassert (GC_BUFFERP(a)),(struct buffer *) XPNTR(a))
-#define XCHAR_TABLE(a) (eassert (GC_CHAR_TABLE_P (a)), (struct Lisp_Char_Table *) XPNTR(a))
-#define XBOOL_VECTOR(a) (eassert (GC_BOOL_VECTOR_P (a)), (struct Lisp_Bool_Vector *) XPNTR(a))
+#define XPROCESS(a) (eassert (PROCESSP(a)),(struct Lisp_Process *) XPNTR(a))
+#define XWINDOW(a) (eassert (WINDOWP(a)),(struct window *) XPNTR(a))
+#define XSUBR(a) (eassert (SUBRP(a)),(struct Lisp_Subr *) XPNTR(a))
+#define XBUFFER(a) (eassert (BUFFERP(a)),(struct buffer *) XPNTR(a))
+#define XCHAR_TABLE(a) ((struct Lisp_Char_Table *) XPNTR(a))
+#define XSUB_CHAR_TABLE(a) ((struct Lisp_Sub_Char_Table *) XPNTR(a))
+#define XBOOL_VECTOR(a) ((struct Lisp_Bool_Vector *) XPNTR(a))
/* Construct a Lisp_Object from a value or address. */
@@ -559,21 +550,18 @@ extern size_t pure_size;
/* Pseudovector types. */
-#define XSETPVECTYPE(v,code) ((v)->size |= PSEUDOVECTOR_FLAG | (code))
#define XSETPSEUDOVECTOR(a, b, code) \
- (XSETVECTOR (a, b), \
- eassert ((XVECTOR (a)->size & (PSEUDOVECTOR_FLAG | PVEC_TYPE_MASK)) \
- == (PSEUDOVECTOR_FLAG | (code))))
+ (XSETVECTOR (a, b), XVECTOR (a)->size |= PSEUDOVECTOR_FLAG | (code))
#define XSETWINDOW_CONFIGURATION(a, b) \
(XSETPSEUDOVECTOR (a, b, PVEC_WINDOW_CONFIGURATION))
#define XSETPROCESS(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_PROCESS))
#define XSETWINDOW(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_WINDOW))
-#define XSETTERMINAL(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_TERMINAL))
#define XSETSUBR(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_SUBR))
#define XSETCOMPILED(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_COMPILED))
#define XSETBUFFER(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_BUFFER))
#define XSETCHAR_TABLE(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_CHAR_TABLE))
#define XSETBOOL_VECTOR(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_BOOL_VECTOR))
+#define XSETSUB_CHAR_TABLE(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_SUB_CHAR_TABLE))
/* Convenience macros for dealing with Lisp arrays. */
@@ -583,9 +571,9 @@ extern size_t pure_size;
/* Convenience macros for dealing with Lisp strings. */
+#define SREF(string, index) (XSTRING (string)->data[index] + 0)
+#define SSET(string, index, new) (XSTRING (string)->data[index] = (new))
#define SDATA(string) (XSTRING (string)->data + 0)
-#define SREF(string, index) (SDATA (string)[index] + 0)
-#define SSET(string, index, new) (SDATA (string)[index] = (new))
#define SCHARS(string) (XSTRING (string)->size + 0)
#define SBYTES(string) (STRING_BYTES (XSTRING (string)) + 0)
@@ -593,7 +581,7 @@ extern size_t pure_size;
(XSTRING (string)->size = (newsize))
#define STRING_COPYIN(string, index, new, count) \
- bcopy (new, SDATA (string) + index, count)
+ bcopy (new, XSTRING (string)->data + index, count)
/* Type checking. */
@@ -735,7 +723,7 @@ struct Lisp_String
struct Lisp_Vector
{
- EMACS_UINT size;
+ EMACS_INT size;
struct Lisp_Vector *next;
Lisp_Object contents[1];
};
@@ -754,49 +742,20 @@ struct Lisp_Vector
((OFFSETOF(type, nonlispfield) - OFFSETOF(struct Lisp_Vector, contents[0])) \
/ sizeof (Lisp_Object))
-/* A char table is a kind of vectorlike, with contents are like a
+/* A char-table is a kind of vectorlike, with contents are like a
vector but with a few other slots. For some purposes, it makes
- sense to handle a chartable with type struct Lisp_Vector. An
+ sense to handle a char-table with type struct Lisp_Vector. An
element of a char table can be any Lisp objects, but if it is a sub
char-table, we treat it a table that contains information of a
- group of characters of the same charsets or a specific character of
- a charset. A sub char-table has the same structure as a char table
- except for that the former omits several slots at the tail. A sub
- char table appears only in an element of a char table, and there's
- no way to access it directly from Emacs Lisp program. */
-
-/* This is the number of slots that apply to characters or character
- sets. The first 128 are for ASCII, the next 128 are for 8-bit
- European characters, and the last 128 are for multibyte characters.
- The first 256 are indexed by the code itself, but the last 128 are
- indexed by (charset-id + 128). */
-#define CHAR_TABLE_ORDINARY_SLOTS 384
-
-/* These are the slot of the default values for single byte
- characters. As 0x9A is never be a charset-id, it is safe to use
- that slot for ASCII. 0x9E and 0x80 are charset-ids of
- eight-bit-control and eight-bit-graphic respectively. */
-#define CHAR_TABLE_DEFAULT_SLOT_ASCII (0x9A + 128)
-#define CHAR_TABLE_DEFAULT_SLOT_8_BIT_CONTROL (0x9E + 128)
-#define CHAR_TABLE_DEFAULT_SLOT_8_BIT_GRAPHIC (0x80 + 128)
-
-/* This is the number of slots that apply to characters of ASCII and
- 8-bit Europeans only. */
-#define CHAR_TABLE_SINGLE_BYTE_SLOTS 256
+ specific range of characters. A sub char-table has the same
+ structure as a vector. A sub char table appears only in an element
+ of a char-table, and there's no way to access it directly from
+ Emacs Lisp program. */
/* This is the number of slots that every char table must have. This
counts the ordinary slots and the top, defalt, parent, and purpose
slots. */
-#define CHAR_TABLE_STANDARD_SLOTS (CHAR_TABLE_ORDINARY_SLOTS + 4)
-
-/* This is the number of slots that apply to position-code-1 and
- position-code-2 of a multibyte character at the 2nd and 3rd level
- sub char tables respectively. */
-#define SUB_CHAR_TABLE_ORDINARY_SLOTS 128
-
-/* This is the number of slots that every sub char table must have.
- This counts the ordinary slots and the top and defalt slot. */
-#define SUB_CHAR_TABLE_STANDARD_SLOTS (SUB_CHAR_TABLE_ORDINARY_SLOTS + 2)
+#define CHAR_TABLE_STANDARD_SLOTS (VECSIZE (struct Lisp_Char_Table) - 1)
/* Return the number of "extra" slots in the char table CT. */
@@ -804,79 +763,101 @@ struct Lisp_Vector
(((CT)->size & PSEUDOVECTOR_SIZE_MASK) - CHAR_TABLE_STANDARD_SLOTS)
/* Almost equivalent to Faref (CT, IDX) with optimization for ASCII
- and 8-bit Europeans characters. For these characters, do not check
- validity of CT. Do not follow parent. */
-#define CHAR_TABLE_REF(CT, IDX) \
- ((IDX) >= 0 && (IDX) < CHAR_TABLE_SINGLE_BYTE_SLOTS \
- ? (!NILP (XCHAR_TABLE (CT)->contents[IDX]) \
- ? XCHAR_TABLE (CT)->contents[IDX] \
- : XCHAR_TABLE (CT)->defalt) \
- : Faref (CT, make_number (IDX)))
+ characters. Do not check validity of CT. */
+#define CHAR_TABLE_REF(CT, IDX) \
+ ((ASCII_CHAR_P (IDX) \
+ && SUB_CHAR_TABLE_P (XCHAR_TABLE (CT)->ascii) \
+ && !NILP (XSUB_CHAR_TABLE (XCHAR_TABLE (CT)->ascii)->contents[IDX])) \
+ ? XSUB_CHAR_TABLE (XCHAR_TABLE (CT)->ascii)->contents[IDX] \
+ : char_table_ref ((CT), (IDX)))
-/* Almost equivalent to Faref (CT, IDX) with optimization for ASCII
- and 8-bit Europeans characters. However, if the result is nil,
- return IDX.
+/* Almost equivalent to Faref (CT, IDX). However, if the result is
+ not a character, return IDX.
For these characters, do not check validity of CT
and do not follow parent. */
-#define CHAR_TABLE_TRANSLATE(CT, IDX) \
- ((IDX) < CHAR_TABLE_SINGLE_BYTE_SLOTS \
- ? (!NILP (XCHAR_TABLE (CT)->contents[IDX]) \
- ? XINT (XCHAR_TABLE (CT)->contents[IDX]) \
- : IDX) \
- : char_table_translate (CT, IDX))
+#define CHAR_TABLE_TRANSLATE(CT, IDX) \
+ char_table_translate (CT, IDX)
/* Equivalent to Faset (CT, IDX, VAL) with optimization for ASCII and
- 8-bit Europeans characters. Do not check validity of CT. */
-#define CHAR_TABLE_SET(CT, IDX, VAL) \
- do { \
- if (XFASTINT (IDX) < CHAR_TABLE_SINGLE_BYTE_SLOTS) \
- XCHAR_TABLE (CT)->contents[XFASTINT (IDX)] = VAL; \
- else \
- Faset (CT, IDX, VAL); \
- } while (0)
+ 8-bit European characters. Do not check validity of CT. */
+#define CHAR_TABLE_SET(CT, IDX, VAL) \
+ (((IDX) >= 0 && ASCII_CHAR_P (IDX) \
+ && SUB_CHAR_TABLE_P (XCHAR_TABLE (CT)->ascii)) \
+ ? XSUB_CHAR_TABLE (XCHAR_TABLE (CT)->ascii)->contents[IDX] = VAL \
+ : char_table_set (CT, IDX, VAL))
+
+#define CHARTAB_SIZE_BITS_0 6
+#define CHARTAB_SIZE_BITS_1 4
+#define CHARTAB_SIZE_BITS_2 5
+#define CHARTAB_SIZE_BITS_3 7
+
+extern const int chartab_size[4];
+
+struct Lisp_Sub_Char_Table;
struct Lisp_Char_Table
{
/* This is the vector's size field, which also holds the
- pseudovector type information. It holds the size, too.
- The size counts the top, defalt, purpose, and parent slots.
- The last three are not counted if this is a sub char table. */
- EMACS_UINT size;
+ pseudovector type information. It holds the size, too. The size
+ counts the defalt, parent, purpose, ascii, contents, and extras
+ slots. */
+ EMACS_INT size;
struct Lisp_Vector *next;
- /* This holds a flag to tell if this is a top level char table (t)
- or a sub char table (nil). */
- Lisp_Object top;
+
/* This holds a default value,
which is used whenever the value for a specific character is nil. */
Lisp_Object defalt;
- /* This holds an actual value of each element. A sub char table
- has only SUB_CHAR_TABLE_ORDINARY_SLOTS number of elements. */
- Lisp_Object contents[CHAR_TABLE_ORDINARY_SLOTS];
- /* A sub char table doesn't has the following slots. */
-
- /* This points to another char table, which we inherit from
- when the value for a specific character is nil.
- The `defalt' slot takes precedence over this. */
+ /* This points to another char table, which we inherit from when the
+ value for a specific character is nil. The `defalt' slot takes
+ precedence over this. */
Lisp_Object parent;
- /* This should be a symbol which says what kind of use
- this char-table is meant for.
- Typically now the values can be `syntax-table' and `display-table'. */
+
+ /* This is a symbol which says what kind of use this char-table is
+ meant for. */
Lisp_Object purpose;
- /* These hold additional data. */
+
+ /* The bottom sub char-table for characters of the range 0..127. It
+ is nil if none of ASCII character has a specific value. */
+ Lisp_Object ascii;
+
+ Lisp_Object contents[(1 << CHARTAB_SIZE_BITS_0)];
+
+ /* These hold additional data. It is a vector. */
Lisp_Object extras[1];
};
+struct Lisp_Sub_Char_Table
+ {
+ /* This is the vector's size field, which also holds the
+ pseudovector type information. It holds the size, too. */
+ EMACS_INT size;
+ struct Lisp_Vector *next;
+
+ /* Depth of this sub char-table. It should be 1, 2, or 3. A sub
+ char-table of depth 1 contains 16 elments, and each element
+ covers 4096 (128*32) characters. A sub char-table of depth 2
+ contains 32 elements, and each element covers 128 characters. A
+ sub char-table of depth 3 contains 128 elements, and each element
+ is for one character. */
+ Lisp_Object depth;
+
+ /* Minimum character covered by the sub char-table. */
+ Lisp_Object min_char;
+
+ Lisp_Object contents[1];
+ };
+
/* A boolvector is a kind of vectorlike, with contents are like a string. */
struct Lisp_Bool_Vector
{
/* This is the vector's size field. It doesn't have the real size,
just the subtype information. */
- EMACS_UINT vector_size;
+ EMACS_INT vector_size;
struct Lisp_Vector *next;
/* This is the size in bits. */
- EMACS_UINT size;
+ EMACS_INT size;
/* This contains the actual bits, packed into bytes. */
unsigned char data[1];
};
@@ -891,11 +872,11 @@ struct Lisp_Bool_Vector
struct Lisp_Subr
{
- EMACS_UINT size;
+ EMACS_INT size;
Lisp_Object (*function) ();
short min_args, max_args;
char *symbol_name;
- char *intspec;
+ char *prompt;
char *doc;
};
@@ -1002,7 +983,7 @@ struct Lisp_Symbol
struct Lisp_Hash_Table
{
/* Vector fields. The hash table code doesn't refer to these. */
- EMACS_UINT size;
+ EMACS_INT size;
struct Lisp_Vector *vec_next;
/* Function used to compare keys. */
@@ -1021,6 +1002,13 @@ struct Lisp_Hash_Table
ratio, a float. */
Lisp_Object rehash_threshold;
+ /* Number of key/value entries in the table. */
+ Lisp_Object count;
+
+ /* Vector of keys and values. The key of item I is found at index
+ 2 * I, the value is found at index 2 * I + 1. */
+ Lisp_Object key_and_value;
+
/* Vector of hash codes.. If hash[I] is nil, this means that that
entry I is unused. */
Lisp_Object hash;
@@ -1044,18 +1032,6 @@ struct Lisp_Hash_Table
/* User-supplied key comparison function, or nil. */
Lisp_Object user_cmp_function;
- /* Only the fields above are traced normally by the GC. The ones below
- `count'. are special and are either ignored by the GC or traced in
- a special way (e.g. because of weakness). */
-
- /* Number of key/value entries in the table. */
- unsigned int count;
-
- /* Vector of keys and values. The key of item I is found at index
- 2 * I, the value is found at index 2 * I + 1.
- This is gc_marked specially if the table is weak. */
- Lisp_Object key_and_value;
-
/* Next weak hash table if this is a weak hash table. The head
of the list is in weak_hash_tables. */
struct Lisp_Hash_Table *next_weak;
@@ -1076,7 +1052,6 @@ struct Lisp_Hash_Table
(XSETPSEUDOVECTOR (VAR, PTR, PVEC_HASH_TABLE))
#define HASH_TABLE_P(OBJ) PSEUDOVECTORP (OBJ, PVEC_HASH_TABLE)
-#define GC_HASH_TABLE_P(x) GC_PSEUDOVECTORP (x, PVEC_HASH_TABLE)
#define CHECK_HASH_TABLE(x) \
CHECK_TYPE (HASH_TABLE_P (x), Qhash_table_p, x)
@@ -1132,16 +1107,8 @@ struct Lisp_Marker
/* 1 means normal insertion at the marker's position
leaves the marker after the inserted text. */
unsigned int insertion_type : 1;
- /* This is the buffer that the marker points into, or 0 if it points nowhere.
- Note: a chain of markers can contain markers pointing into different
- buffers (the chain is per buffer_text rather than per buffer, so it's
- shared between indirect buffers). */
- /* This is used for (other than NULL-checking):
- - Fmarker_buffer
- - Fset_marker: check eq(oldbuf, newbuf) to avoid unchain+rechain.
- - unchain_marker: to find the list from which to unchain.
- - Fkill_buffer: to unchain the markers of current indirect buffer.
- */
+ /* This is the buffer that the marker points into,
+ or 0 if it points nowhere. */
struct buffer *buffer;
/* The remaining fields are meaningless in a marker that
@@ -1149,8 +1116,6 @@ struct Lisp_Marker
/* For markers that point somewhere,
this is used to chain of all the markers in a given buffer. */
- /* We could remove it and use an array in buffer_text instead.
- That would also allow to preserve it ordered. */
struct Lisp_Marker *next;
/* This is the char position where the marker points. */
EMACS_INT charpos;
@@ -1248,10 +1213,6 @@ struct Lisp_Buffer_Local_Value
unsigned int found_for_frame : 1;
Lisp_Object realvalue;
/* The buffer and frame for which the loaded binding was found. */
- /* Having both is only needed if we want to allow variables that are
- both buffer local and frame local (in which case, we currently give
- precedence to the buffer-local binding). I don't think such
- a combination is desirable. --Stef */
Lisp_Object buffer, frame;
/* A cons cell, (LOADED-BINDING . DEFAULT-VALUE).
@@ -1389,9 +1350,9 @@ typedef unsigned char UCHAR;
(CHAR_ALT | CHAR_SUPER | CHAR_HYPER | CHAR_SHIFT | CHAR_CTL | CHAR_META)
-/* Actually, the current Emacs uses 19 bits for the character value
+/* Actually, the current Emacs uses 22 bits for the character value
itself. */
-#define CHARACTERBITS 19
+#define CHARACTERBITS 22
/* The maximum byte size consumed by push_key_description.
All callers should assure that at least this size of memory is
@@ -1403,6 +1364,34 @@ typedef unsigned char UCHAR;
We need one more byte for string terminator `\0'. */
#define KEY_DESCRIPTION_SIZE ((2 * 6) + 1 + (CHARACTERBITS / 3) + 1 + 1)
+#ifdef USE_X_TOOLKIT
+#ifdef NO_UNION_TYPE
+/* Use this for turning a (void *) into a Lisp_Object, as when the
+ Lisp_Object is passed into a toolkit callback function. */
+#define VOID_TO_LISP(larg,varg) \
+ do { ((larg) = ((Lisp_Object) (varg))); } while (0)
+#define CVOID_TO_LISP VOID_TO_LISP
+
+/* Use this for turning a Lisp_Object into a (void *), as when the
+ Lisp_Object is passed into a toolkit callback function. */
+#define LISP_TO_VOID(larg) ((void *) (larg))
+#define LISP_TO_CVOID(varg) ((const void *) (larg))
+
+#else /* not NO_UNION_TYPE */
+/* Use this for turning a (void *) into a Lisp_Object, as when the
+ Lisp_Object is passed into a toolkit callback function. */
+#define VOID_TO_LISP(larg,varg) \
+ do { ((larg).v = (void *) (varg)); } while (0)
+#define CVOID_TO_LISP(larg,varg) \
+ do { ((larg).cv = (const void *) (varg)); } while (0)
+
+/* Use this for turning a Lisp_Object into a (void *), as when the
+ Lisp_Object is passed into a toolkit callback function. */
+#define LISP_TO_VOID(larg) ((larg).v)
+#define LISP_TO_CVOID(larg) ((larg).cv)
+#endif /* not NO_UNION_TYPE */
+#endif /* USE_X_TOOLKIT */
+
/* The glyph datatype, used to represent characters on the display. */
@@ -1419,9 +1408,9 @@ typedef unsigned char UCHAR;
#define GLYPH int
/* Mask bits for face. */
-#define GLYPH_MASK_FACE 0x7FF80000
+#define GLYPH_MASK_FACE 0x7FC00000
/* Mask bits for character code. */
-#define GLYPH_MASK_CHAR 0x0007FFFF /* The lowest 19 bits */
+#define GLYPH_MASK_CHAR 0x003FFFFF /* The lowest 22 bits */
/* The FAST macros assume that we already know we're in an X window. */
@@ -1448,48 +1437,28 @@ typedef unsigned char UCHAR;
/* Data type checking */
#define NILP(x) EQ (x, Qnil)
-#define GC_NILP(x) GC_EQ (x, Qnil)
#define NUMBERP(x) (INTEGERP (x) || FLOATP (x))
-#define GC_NUMBERP(x) (GC_INTEGERP (x) || GC_FLOATP (x))
#define NATNUMP(x) (INTEGERP (x) && XINT (x) >= 0)
-#define GC_NATNUMP(x) (GC_INTEGERP (x) && XINT (x) >= 0)
#define INTEGERP(x) (XTYPE ((x)) == Lisp_Int)
-#define GC_INTEGERP(x) INTEGERP (x)
#define SYMBOLP(x) (XTYPE ((x)) == Lisp_Symbol)
-#define GC_SYMBOLP(x) (XGCTYPE ((x)) == Lisp_Symbol)
#define MISCP(x) (XTYPE ((x)) == Lisp_Misc)
-#define GC_MISCP(x) (XGCTYPE ((x)) == Lisp_Misc)
#define VECTORLIKEP(x) (XTYPE ((x)) == Lisp_Vectorlike)
-#define GC_VECTORLIKEP(x) (XGCTYPE ((x)) == Lisp_Vectorlike)
#define STRINGP(x) (XTYPE ((x)) == Lisp_String)
-#define GC_STRINGP(x) (XGCTYPE ((x)) == Lisp_String)
#define CONSP(x) (XTYPE ((x)) == Lisp_Cons)
-#define GC_CONSP(x) (XGCTYPE ((x)) == Lisp_Cons)
#define FLOATP(x) (XTYPE ((x)) == Lisp_Float)
-#define GC_FLOATP(x) (XGCTYPE ((x)) == Lisp_Float)
-#define VECTORP(x) (VECTORLIKEP (x) && !(XVECTOR (x)->size & PSEUDOVECTOR_FLAG))
-#define GC_VECTORP(x) (GC_VECTORLIKEP (x) && !(XVECTOR (x)->size & PSEUDOVECTOR_FLAG))
+#define VECTORP(x) (VECTORLIKEP (x) && !(XVECTOR (x)->size & PSEUDOVECTOR_FLAG))
#define OVERLAYP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Overlay)
-#define GC_OVERLAYP(x) (GC_MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Overlay)
#define MARKERP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Marker)
-#define GC_MARKERP(x) (GC_MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Marker)
#define INTFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Intfwd)
-#define GC_INTFWDP(x) (GC_MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Intfwd)
#define BOOLFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Boolfwd)
-#define GC_BOOLFWDP(x) (GC_MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Boolfwd)
#define OBJFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Objfwd)
-#define GC_OBJFWDP(x) (GC_MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Objfwd)
#define BUFFER_OBJFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Buffer_Objfwd)
-#define GC_BUFFER_OBJFWDP(x) (GC_MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Buffer_Objfwd)
#define BUFFER_LOCAL_VALUEP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Buffer_Local_Value)
-#define GC_BUFFER_LOCAL_VALUEP(x) (GC_MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Buffer_Local_Value)
#define SOME_BUFFER_LOCAL_VALUEP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Some_Buffer_Local_Value)
-#define GC_SOME_BUFFER_LOCAL_VALUEP(x) (GC_MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Some_Buffer_Local_Value)
#define KBOARD_OBJFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Kboard_Objfwd)
-#define GC_KBOARD_OBJFWDP(x) (GC_MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Kboard_Objfwd)
/* True if object X is a pseudovector whose code is CODE. */
@@ -1498,36 +1467,17 @@ typedef unsigned char UCHAR;
&& (((XVECTOR (x)->size & (PSEUDOVECTOR_FLAG | (code)))) \
== (PSEUDOVECTOR_FLAG | (code))))
-/* True if object X is a pseudovector whose code is CODE.
- This one works during GC. */
-#define GC_PSEUDOVECTORP(x, code) \
- (GC_VECTORLIKEP (x) \
- && (((XVECTOR (x)->size & (PSEUDOVECTOR_FLAG | (code)))) \
- == (PSEUDOVECTOR_FLAG | (code))))
-
/* Test for specific pseudovector types. */
#define WINDOW_CONFIGURATIONP(x) PSEUDOVECTORP (x, PVEC_WINDOW_CONFIGURATION)
-#define GC_WINDOW_CONFIGURATIONP(x) GC_PSEUDOVECTORP (x, PVEC_WINDOW_CONFIGURATION)
#define PROCESSP(x) PSEUDOVECTORP (x, PVEC_PROCESS)
-#define GC_PROCESSP(x) GC_PSEUDOVECTORP (x, PVEC_PROCESS)
#define WINDOWP(x) PSEUDOVECTORP (x, PVEC_WINDOW)
-#define GC_WINDOWP(x) GC_PSEUDOVECTORP (x, PVEC_WINDOW)
-#define TERMINALP(x) PSEUDOVECTORP (x, PVEC_TERMINAL)
-#define GC_TERMINALP(x) GC_PSEUDOVECTORP (x, PVEC_TERMINAL)
#define SUBRP(x) PSEUDOVECTORP (x, PVEC_SUBR)
-#define GC_SUBRP(x) GC_PSEUDOVECTORP (x, PVEC_SUBR)
#define COMPILEDP(x) PSEUDOVECTORP (x, PVEC_COMPILED)
-#define GC_COMPILEDP(x) GC_PSEUDOVECTORP (x, PVEC_COMPILED)
#define BUFFERP(x) PSEUDOVECTORP (x, PVEC_BUFFER)
-#define GC_BUFFERP(x) GC_PSEUDOVECTORP (x, PVEC_BUFFER)
#define CHAR_TABLE_P(x) PSEUDOVECTORP (x, PVEC_CHAR_TABLE)
-#define GC_CHAR_TABLE_P(x) GC_PSEUDOVECTORP (x, PVEC_CHAR_TABLE)
+#define SUB_CHAR_TABLE_P(x) PSEUDOVECTORP (x, PVEC_SUB_CHAR_TABLE)
#define BOOL_VECTOR_P(x) PSEUDOVECTORP (x, PVEC_BOOL_VECTOR)
-#define GC_BOOL_VECTOR_P(x) GC_PSEUDOVECTORP (x, PVEC_BOOL_VECTOR)
#define FRAMEP(x) PSEUDOVECTORP (x, PVEC_FRAME)
-#define GC_FRAMEP(x) GC_PSEUDOVECTORP (x, PVEC_FRAME)
-
-#define SUB_CHAR_TABLE_P(x) (CHAR_TABLE_P (x) && NILP (XCHAR_TABLE (x)->top))
/* Test for image (image . spec) */
#define IMAGEP(x) (CONSP (x) && EQ (XCAR (x), Qimage))
@@ -1537,8 +1487,6 @@ typedef unsigned char UCHAR;
#define ARRAYP(x) \
(VECTORP (x) || STRINGP (x) || CHAR_TABLE_P (x) || BOOL_VECTOR_P (x))
-#define GC_EQ(x, y) EQ (x, y)
-
#define CHECK_LIST(x) \
CHECK_TYPE (CONSP (x) || NILP (x), Qlistp, x)
@@ -1644,6 +1592,20 @@ typedef unsigned char UCHAR;
XSETCDR ((x), tmp); \
} while (0)
+#define CHECK_NATNUM_CAR(x) \
+ do { \
+ Lisp_Object tmp = XCAR (x); \
+ CHECK_NATNUM (tmp); \
+ XSETCAR ((x), tmp); \
+ } while (0)
+
+#define CHECK_NATNUM_CDR(x) \
+ do { \
+ Lisp_Object tmp = XCDR (x); \
+ CHECK_NATNUM (tmp); \
+ XSETCDR ((x), tmp); \
+ } while (0)
+
/* Cast pointers to this type to compare them. Some machines want int. */
#ifndef PNTR_COMPARISON_TYPE
#define PNTR_COMPARISON_TYPE EMACS_UINT
@@ -1666,33 +1628,30 @@ typedef unsigned char UCHAR;
followed by the address of a vector of Lisp_Objects
which contains the argument values.
UNEVALLED means pass the list of unevaluated arguments
- `intspec' says how interactive arguments are to be fetched.
- If the string starts with a `(', `intspec' is evaluated and the resulting
- list is the list of arguments.
- If it's a string that doesn't start with `(', the value should follow
- the one of the doc string for `interactive'.
+ `prompt' says how to read arguments for an interactive call.
+ See the doc string for `interactive'.
A null string means call interactively with no arguments.
`doc' is documentation for the user. */
#if (!defined (__STDC__) && !defined (PROTOTYPES)) \
|| defined (USE_NONANSI_DEFUN)
-#define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc) \
+#define DEFUN(lname, fnname, sname, minargs, maxargs, prompt, doc) \
Lisp_Object fnname (); \
DECL_ALIGN (struct Lisp_Subr, sname) = \
{ PVEC_SUBR | (sizeof (struct Lisp_Subr) / sizeof (EMACS_INT)), \
- fnname, minargs, maxargs, lname, intspec, 0}; \
+ fnname, minargs, maxargs, lname, prompt, 0}; \
Lisp_Object fnname
#else
/* This version of DEFUN declares a function prototype with the right
arguments, so we can catch errors with maxargs at compile-time. */
-#define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc) \
+#define DEFUN(lname, fnname, sname, minargs, maxargs, prompt, doc) \
Lisp_Object fnname DEFUN_ARGS_ ## maxargs ; \
DECL_ALIGN (struct Lisp_Subr, sname) = \
{ PVEC_SUBR | (sizeof (struct Lisp_Subr) / sizeof (EMACS_INT)), \
- fnname, minargs, maxargs, lname, intspec, 0}; \
+ fnname, minargs, maxargs, lname, prompt, 0}; \
Lisp_Object fnname
/* Note that the weird token-substitution semantics of ANSI C makes
@@ -1733,6 +1692,7 @@ extern void defvar_lisp P_ ((char *, Lisp_Object *));
extern void defvar_lisp_nopro P_ ((char *, Lisp_Object *));
extern void defvar_bool P_ ((char *, int *));
extern void defvar_int P_ ((char *, EMACS_INT *));
+extern void defvar_per_buffer P_ ((char *, Lisp_Object *, Lisp_Object, char *));
extern void defvar_kboard P_ ((char *, int));
/* Macros we use to define forwarded Lisp variables.
@@ -1743,6 +1703,15 @@ extern void defvar_kboard P_ ((char *, int));
#define DEFVAR_BOOL(lname, vname, doc) defvar_bool (lname, vname)
#define DEFVAR_INT(lname, vname, doc) defvar_int (lname, vname)
+/* TYPE is nil for a general Lisp variable.
+ An integer specifies a type; then only LIsp values
+ with that type code are allowed (except that nil is allowed too).
+ LNAME is the LIsp-level variable name.
+ VNAME is the name of the buffer slot.
+ DOC is a dummy where you write the doc string as a comment. */
+#define DEFVAR_PER_BUFFER(lname, vname, type, doc) \
+ defvar_per_buffer (lname, vname, type, 0)
+
#define DEFVAR_KBOARD(lname, vname, doc) \
defvar_kboard (lname, \
(int)((char *)(&current_kboard->vname) \
@@ -2278,34 +2247,44 @@ extern void keys_of_cmds P_ ((void));
/* Defined in coding.c */
EXFUN (Fcoding_system_p, 1);
+EXFUN (Fcoding_system_base, 1);
+EXFUN (Fcoding_system_eol_type, 1);
+EXFUN (Fcheck_coding_system, 1);
EXFUN (Fcheck_coding_system, 1);
EXFUN (Fread_coding_system, 2);
EXFUN (Fread_non_nil_coding_system, 1);
EXFUN (Ffind_operation_coding_system, MANY);
EXFUN (Fupdate_coding_systems_internal, 0);
-EXFUN (Fencode_coding_string, 3);
-EXFUN (Fdecode_coding_string, 3);
-extern Lisp_Object detect_coding_system P_ ((const unsigned char *, int, int,
- int));
+EXFUN (Fencode_coding_string, 4);
+EXFUN (Fdecode_coding_string, 4);
+extern Lisp_Object detect_coding_system P_ ((const unsigned char *, int,
+ int, int, int, Lisp_Object));
extern void init_coding P_ ((void));
extern void init_coding_once P_ ((void));
extern void syms_of_coding P_ ((void));
-extern Lisp_Object code_convert_string_norecord P_ ((Lisp_Object, Lisp_Object,
- int));
+
+/* Defined in character.c */
+extern void init_character_once P_ ((void));
+extern void syms_of_character P_ ((void));
+EXFUN (Funibyte_char_to_multibyte, 1);
/* Defined in charset.c */
-extern EMACS_INT nonascii_insert_offset;
-extern Lisp_Object Vnonascii_translation_table;
EXFUN (Fchar_bytes, 1);
EXFUN (Fchar_width, 1);
EXFUN (Fstring, MANY);
extern int chars_in_text P_ ((const unsigned char *, int));
extern int multibyte_chars_in_text P_ ((const unsigned char *, int));
-extern int unibyte_char_to_multibyte P_ ((int));
extern int multibyte_char_to_unibyte P_ ((int, Lisp_Object));
+extern int multibyte_char_to_unibyte_safe P_ ((int));
extern Lisp_Object Qcharset;
+extern void init_charset P_ ((void));
extern void init_charset_once P_ ((void));
extern void syms_of_charset P_ ((void));
+/* Structure forward declarations. */
+struct charset;
+
+/* Defined in composite.c */
+extern void syms_of_composite P_ ((void));
/* Defined in syntax.c */
EXFUN (Fforward_word, 1);
@@ -2323,9 +2302,8 @@ extern int next_almost_prime P_ ((int));
extern Lisp_Object larger_vector P_ ((Lisp_Object, int, Lisp_Object));
extern void sweep_weak_hash_tables P_ ((void));
extern Lisp_Object Qstring_lessp;
-EXFUN (Foptimize_char_table, 1);
extern Lisp_Object Vfeatures;
-extern Lisp_Object QCtest, QCweakness, Qequal;
+extern Lisp_Object QCtest, QCweakness, Qequal, Qeq;
unsigned sxhash P_ ((Lisp_Object, int));
Lisp_Object make_hash_table P_ ((Lisp_Object, Lisp_Object, Lisp_Object,
Lisp_Object, Lisp_Object, Lisp_Object,
@@ -2340,6 +2318,7 @@ void remove_hash_entry P_ ((struct Lisp_Hash_Table *, int));
extern void init_fns P_ ((void));
EXFUN (Fsxhash, 1);
EXFUN (Fmake_hash_table, MANY);
+EXFUN (Fmakehash, 1);
EXFUN (Fcopy_hash_table, 1);
EXFUN (Fhash_table_count, 1);
EXFUN (Fhash_table_rehash_size, 1);
@@ -2398,6 +2377,7 @@ extern Lisp_Object concat2 P_ ((Lisp_Object, Lisp_Object));
extern Lisp_Object concat3 P_ ((Lisp_Object, Lisp_Object, Lisp_Object));
extern Lisp_Object nconc2 P_ ((Lisp_Object, Lisp_Object));
extern Lisp_Object assq_no_quit P_ ((Lisp_Object, Lisp_Object));
+extern Lisp_Object assoc_no_quit P_ ((Lisp_Object, Lisp_Object));
extern void clear_string_char_byte_cache P_ ((void));
extern int string_char_to_byte P_ ((Lisp_Object, int));
extern int string_byte_to_char P_ ((Lisp_Object, int));
@@ -2408,18 +2388,10 @@ EXFUN (Fcopy_alist, 1);
EXFUN (Fplist_get, 2);
EXFUN (Fplist_put, 3);
EXFUN (Fplist_member, 2);
-EXFUN (Fset_char_table_parent, 2);
-EXFUN (Fchar_table_extra_slot, 2);
-EXFUN (Fset_char_table_extra_slot, 3);
EXFUN (Frassoc, 2);
EXFUN (Fstring_equal, 2);
EXFUN (Fcompare_strings, 7);
EXFUN (Fstring_lessp, 2);
-extern int char_table_translate P_ ((Lisp_Object, int));
-extern void map_char_table P_ ((void (*) (Lisp_Object, Lisp_Object, Lisp_Object),
- Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, int,
- int *));
-extern Lisp_Object char_table_ref_and_index P_ ((Lisp_Object, int, int *));
extern void syms_of_fns P_ ((void));
/* Defined in floatfns.c */
@@ -2452,6 +2424,7 @@ extern void insert P_ ((const unsigned char *, int));
extern void insert_and_inherit P_ ((const unsigned char *, int));
extern void insert_1 P_ ((const unsigned char *, int, int, int, int));
extern void insert_1_both P_ ((const unsigned char *, int, int, int, int, int));
+extern void insert_from_gap P_ ((int, int));
extern void insert_from_string P_ ((Lisp_Object, int, int, int, int, int));
extern void insert_from_buffer P_ ((struct buffer *, int, int, int));
extern void insert_char P_ ((int));
@@ -2578,8 +2551,6 @@ extern Lisp_Object make_pure_vector P_ ((EMACS_INT));
EXFUN (Fgarbage_collect, 0);
EXFUN (Fmake_byte_code, MANY);
EXFUN (Fmake_bool_vector, 2);
-EXFUN (Fmake_char_table, 2);
-extern Lisp_Object make_sub_char_table P_ ((Lisp_Object));
extern Lisp_Object Qchar_table_extra_slots;
extern struct Lisp_Vector *allocate_vector P_ ((EMACS_INT));
extern struct Lisp_Vector *allocate_other_vector P_ ((EMACS_INT));
@@ -2587,7 +2558,6 @@ extern struct Lisp_Hash_Table *allocate_hash_table P_ ((void));
extern struct window *allocate_window P_ ((void));
extern struct frame *allocate_frame P_ ((void));
extern struct Lisp_Process *allocate_process P_ ((void));
-extern struct terminal *allocate_terminal P_ ((void));
extern int gc_in_progress;
extern int abort_on_gc;
extern Lisp_Object make_float P_ ((double));
@@ -2603,6 +2573,31 @@ extern void syms_of_alloc P_ ((void));
extern struct buffer * allocate_buffer P_ ((void));
extern int valid_lisp_object_p P_ ((Lisp_Object));
+/* Defined in chartab.c */
+EXFUN (Fmake_char_table, 2);
+EXFUN (Fchar_table_parent, 1);
+EXFUN (Fset_char_table_parent, 2);
+EXFUN (Fchar_table_extra_slot, 2);
+EXFUN (Fset_char_table_extra_slot, 3);
+EXFUN (Fchar_table_range, 2);
+EXFUN (Fset_char_table_range, 3);
+EXFUN (Fset_char_table_default, 3);
+EXFUN (Foptimize_char_table, 1);
+EXFUN (Fmap_char_table, 2);
+extern Lisp_Object copy_char_table P_ ((Lisp_Object));
+extern Lisp_Object sub_char_table_ref P_ ((Lisp_Object, int));
+extern Lisp_Object char_table_ref P_ ((Lisp_Object, int));
+extern Lisp_Object char_table_ref_and_range P_ ((Lisp_Object, int,
+ int *, int *));
+extern Lisp_Object char_table_set P_ ((Lisp_Object, int, Lisp_Object));
+extern Lisp_Object char_table_set_range P_ ((Lisp_Object, int, int,
+ Lisp_Object));
+extern int char_table_translate P_ ((Lisp_Object, int));
+extern void map_char_table P_ ((void (*) (Lisp_Object, Lisp_Object,
+ Lisp_Object),
+ Lisp_Object, Lisp_Object, Lisp_Object));
+extern void syms_of_chartab P_ ((void));
+
/* Defined in print.c */
extern Lisp_Object Vprin1_to_string_buffer;
extern void debug_print P_ ((Lisp_Object));
@@ -2816,6 +2811,7 @@ extern int overlay_touches_p P_ ((int));
extern Lisp_Object Vbuffer_alist, Vinhibit_read_only;
EXFUN (Fget_buffer, 1);
EXFUN (Fget_buffer_create, 1);
+EXFUN (Fgenerate_new_buffer_name, 2);
EXFUN (Fset_buffer, 1);
EXFUN (set_buffer_if_live, 1);
EXFUN (Fbarf_if_buffer_read_only, 0);
@@ -2983,10 +2979,6 @@ extern Lisp_Object Qvertical_scroll_bar;
extern void discard_mouse_events P_ ((void));
EXFUN (Fevent_convert_list, 1);
EXFUN (Fread_key_sequence, 5);
-EXFUN (Fset_input_interrupt_mode, 1);
-EXFUN (Fset_output_flow_control, 2);
-EXFUN (Fset_input_meta_mode, 2);
-EXFUN (Fset_quit_char, 1);
EXFUN (Fset_input_mode, 4);
extern int detect_input_pending P_ ((void));
extern int detect_input_pending_ignore_squeezables P_ ((void));
@@ -3000,7 +2992,6 @@ extern void init_keyboard P_ ((void));
extern void syms_of_keyboard P_ ((void));
extern void keys_of_keyboard P_ ((void));
extern char *push_key_description P_ ((unsigned int, char *, int));
-extern void add_user_signal P_ ((int sig, const char *name));
/* defined in indent.c */
@@ -3043,7 +3034,6 @@ EXFUN (Fvisible_frame_list, 0);
EXFUN (Fframe_parameter, 2);
EXFUN (Fframe_parameters, 1);
EXFUN (Fmodify_frame_parameters, 2);
-EXFUN (Fframe_with_environment, 1);
EXFUN (Fset_frame_height, 3);
EXFUN (Fset_frame_width, 3);
EXFUN (Fset_frame_size, 3);
@@ -3112,7 +3102,7 @@ EXFUN (Fcall_process, MANY);
extern int child_setup P_ ((int, int, int, char **, int, Lisp_Object));
extern void init_callproc_1 P_ ((void));
extern void init_callproc P_ ((void));
-extern void set_initial_environment P_ ((void));
+extern void set_process_environment P_ ((void));
extern void syms_of_callproc P_ ((void));
/* defined in doc.c */
@@ -3160,6 +3150,7 @@ extern Lisp_Object Qinsert_in_front_hooks, Qinsert_behind_hooks;
EXFUN (Fnext_single_property_change, 4);
EXFUN (Fnext_single_char_property_change, 4);
EXFUN (Fprevious_single_property_change, 4);
+EXFUN (Fget_text_property, 3);
EXFUN (Fput_text_property, 5);
EXFUN (Fprevious_char_property_change, 2);
EXFUN (Fnext_char_property_change, 2);
@@ -3174,31 +3165,28 @@ EXFUN (Fx_popup_menu, 2);
EXFUN (Fx_popup_dialog, 3);
extern void syms_of_xmenu P_ ((void));
-/* defined in termchar.h */
-struct tty_display_info;
-
-/* defined in termhooks.h */
-struct terminal;
-
/* defined in sysdep.c */
#ifndef HAVE_GET_CURRENT_DIR_NAME
extern char *get_current_dir_name P_ ((void));
#endif
extern void stuff_char P_ ((char c));
extern void init_sigio P_ ((int));
+extern void request_sigio P_ ((void));
+extern void unrequest_sigio P_ ((void));
+extern void reset_sys_modes P_ ((void));
extern void sys_subshell P_ ((void));
extern void sys_suspend P_ ((void));
extern void discard_tty_input P_ ((void));
-extern void init_sys_modes P_ ((struct tty_display_info *));
-extern void reset_sys_modes P_ ((struct tty_display_info *));
-extern void init_all_sys_modes P_ ((void));
-extern void reset_all_sys_modes P_ ((void));
+extern void init_sys_modes P_ ((void));
+extern void get_frame_size P_ ((int *, int *));
extern void wait_for_termination P_ ((int));
extern void flush_pending_output P_ ((int));
extern void child_setup_tty P_ ((int));
extern void setup_pty P_ ((int));
extern int set_window_size P_ ((int, int, int));
extern void create_process P_ ((Lisp_Object, char **, Lisp_Object));
+extern int tabs_safe_p P_ ((void));
+extern void init_baud_rate P_ ((void));
extern int emacs_open P_ ((const char *, int, int));
extern int emacs_close P_ ((int));
extern int emacs_read P_ ((int, char *, unsigned int));
@@ -3220,6 +3208,7 @@ extern void init_sound P_ ((void));
/* Defined in category.c */
extern void init_category_once P_ ((void));
+extern Lisp_Object char_category_set P_ ((int));
extern void syms_of_category P_ ((void));
/* Defined in ccl.c */
@@ -3233,13 +3222,11 @@ extern void syms_of_dired P_ ((void));
extern void syms_of_term P_ ((void));
extern void fatal () NO_RETURN;
-/* Defined in terminal.c */
-extern void syms_of_terminal P_ ((void));
-
#ifdef HAVE_WINDOW_SYSTEM
/* Defined in fontset.c */
extern void syms_of_fontset P_ ((void));
-EXFUN (Fset_fontset_font, 4);
+EXFUN (Fset_fontset_font, 5);
+EXFUN (Fnew_fontset, 2);
/* Defined in xfns.c, w32fns.c, or macfns.c */
EXFUN (Fxw_display_color_p, 1);
@@ -3380,11 +3367,6 @@ extern Lisp_Object Vdirectory_sep_char;
#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))
-/* Make sure we have abs defined */
-#if !defined(abs)
-#define abs(x) ((x) < 0 ? -(x) : (x))
-#endif
-
/* Return a fixnum or float, depending on whether VAL fits in a Lisp
fixnum. */
diff --git a/src/lread.c b/src/lread.c
index ae02b45433..6bec084c5c 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -27,15 +27,15 @@ Boston, MA 02110-1301, USA. */
#include <sys/stat.h>
#include <sys/file.h>
#include <errno.h>
-#include <setjmp.h>
#include "lisp.h"
#include "intervals.h"
#include "buffer.h"
+#include "character.h"
#include "charset.h"
+#include "coding.h"
#include <epaths.h>
#include "commands.h"
#include "keyboard.h"
-#include "frame.h"
#include "termhooks.h"
#include "coding.h"
#include "blockinput.h"
@@ -92,6 +92,12 @@ Lisp_Object Qinhibit_file_name_operation;
Lisp_Object Qeval_buffer_list, Veval_buffer_list;
Lisp_Object Qfile_truename, Qdo_after_load_evaluation; /* ACM 2006/5/16 */
+/* Used instead of Qget_file_char while loading *.elc files compiled
+ by Emacs 21 or older. */
+static Lisp_Object Qget_emacs_mule_file_char;
+
+static Lisp_Object Qload_force_doc_strings;
+
extern Lisp_Object Qevent_symbol_element_mask;
extern Lisp_Object Qfile_exists_p;
@@ -135,6 +141,11 @@ static int load_force_doc_strings;
/* Nonzero means read should convert strings to unibyte. */
static int load_convert_to_unibyte;
+/* Nonzero means READCHAR should read bytes one by one (not character)
+ when READCHARFUN is Qget_file_char or Qget_emacs_mule_file_char.
+ This is set to 1 by read1 temporarily while handling #@NUMBER. */
+static int load_each_byte;
+
/* Function to use for loading an Emacs Lisp source file (not
compiled) instead of readevalloop. */
Lisp_Object Vload_source_file_function;
@@ -163,9 +174,6 @@ static int read_from_string_index;
static int read_from_string_index_byte;
static int read_from_string_limit;
-/* Number of bytes left to read in the buffer character
- that `readchar' has already advanced over. */
-static int readchar_backlog;
/* Number of characters read in the current call to Fread or
Fread_from_string. */
static int readchar_count;
@@ -210,7 +218,9 @@ int load_dangerous_libraries;
static Lisp_Object Vbytecomp_version_regexp;
-static void to_multibyte P_ ((char **, char **, int *));
+static int read_emacs_mule_char P_ ((int, int (*) (int, Lisp_Object),
+ Lisp_Object));
+
static void readevalloop P_ ((Lisp_Object, FILE*, Lisp_Object,
Lisp_Object (*) (), int,
Lisp_Object, Lisp_Object,
@@ -222,29 +232,41 @@ static void invalid_syntax P_ ((const char *, int)) NO_RETURN;
static void end_of_file_error P_ (()) NO_RETURN;
+/* Functions that read one byte from the current source READCHARFUN
+ or unreads one byte. If the integer argument C is -1, it returns
+ one read byte, or -1 when there's no more byte in the source. If C
+ is 0 or positive, it unreads C, and the return value is not
+ interesting. */
+
+static int readbyte_for_lambda P_ ((int, Lisp_Object));
+static int readbyte_from_file P_ ((int, Lisp_Object));
+static int readbyte_from_string P_ ((int, Lisp_Object));
+
/* Handle unreading and rereading of characters.
Write READCHAR to read a character,
UNREAD(c) to unread c to be read again.
- The READCHAR and UNREAD macros are meant for reading/unreading a
- byte code; they do not handle multibyte characters. The caller
- should manage them if necessary.
-
- [ Actually that seems to be a lie; READCHAR will definitely read
- multibyte characters from buffer sources, at least. Is the
- comment just out of date?
- -- Colin Walters <[email protected]>, 22 May 2002 16:36:50 -0400 ]
- */
+ These macros correctly read/unread multibyte characters. */
#define READCHAR readchar (readcharfun)
#define UNREAD(c) unreadchar (readcharfun, c)
+/* When READCHARFUN is Qget_file_char, Qget_emacs_mule_file_char,
+ Qlambda, or a cons, we use this to keep an unread character because
+ a file stream can't handle multibyte-char unreading. The value -1
+ means that there's no unread character. */
+static int unread_char;
+
static int
readchar (readcharfun)
Lisp_Object readcharfun;
{
Lisp_Object tem;
register int c;
+ int (*readbyte) P_ ((int, Lisp_Object));
+ unsigned char buf[MAX_MULTIBYTE_LENGTH];
+ int i, len;
+ int emacs_mule_encoding = 0;
readchar_count++;
@@ -253,21 +275,10 @@ readchar (readcharfun)
register struct buffer *inbuffer = XBUFFER (readcharfun);
int pt_byte = BUF_PT_BYTE (inbuffer);
- int orig_pt_byte = pt_byte;
-
- if (readchar_backlog > 0)
- /* We get the address of the byte just passed,
- which is the last byte of the character.
- The other bytes in this character are consecutive with it,
- because the gap can't be in the middle of a character. */
- return *(BUF_BYTE_ADDRESS (inbuffer, BUF_PT_BYTE (inbuffer) - 1)
- - --readchar_backlog);
if (pt_byte >= BUF_ZV_BYTE (inbuffer))
return -1;
- readchar_backlog = -1;
-
if (! NILP (inbuffer->enable_multibyte_characters))
{
/* Fetch the character code from the buffer. */
@@ -278,6 +289,8 @@ readchar (readcharfun)
else
{
c = BUF_FETCH_BYTE (inbuffer, pt_byte);
+ if (! ASCII_BYTE_P (c))
+ c = BYTE8_TO_CHAR (c);
pt_byte++;
}
SET_BUF_PT_BOTH (inbuffer, BUF_PT (inbuffer) + 1, pt_byte);
@@ -289,21 +302,10 @@ readchar (readcharfun)
register struct buffer *inbuffer = XMARKER (readcharfun)->buffer;
int bytepos = marker_byte_position (readcharfun);
- int orig_bytepos = bytepos;
-
- if (readchar_backlog > 0)
- /* We get the address of the byte just passed,
- which is the last byte of the character.
- The other bytes in this character are consecutive with it,
- because the gap can't be in the middle of a character. */
- return *(BUF_BYTE_ADDRESS (inbuffer, XMARKER (readcharfun)->bytepos - 1)
- - --readchar_backlog);
if (bytepos >= BUF_ZV_BYTE (inbuffer))
return -1;
- readchar_backlog = -1;
-
if (! NILP (inbuffer->enable_multibyte_characters))
{
/* Fetch the character code from the buffer. */
@@ -314,6 +316,8 @@ readchar (readcharfun)
else
{
c = BUF_FETCH_BYTE (inbuffer, bytepos);
+ if (! ASCII_BYTE_P (c))
+ c = BYTE8_TO_CHAR (c);
bytepos++;
}
@@ -324,25 +328,15 @@ readchar (readcharfun)
}
if (EQ (readcharfun, Qlambda))
- return read_bytecode_char (0);
+ {
+ readbyte = readbyte_for_lambda;
+ goto read_multibyte;
+ }
if (EQ (readcharfun, Qget_file_char))
{
- BLOCK_INPUT;
- c = getc (instream);
-#ifdef EINTR
- /* Interrupted reads have been observed while reading over the network */
- while (c == EOF && ferror (instream) && errno == EINTR)
- {
- UNBLOCK_INPUT;
- QUIT;
- BLOCK_INPUT;
- clearerr (instream);
- c = getc (instream);
- }
-#endif
- UNBLOCK_INPUT;
- return c;
+ readbyte = readbyte_from_file;
+ goto read_multibyte;
}
if (STRINGP (readcharfun))
@@ -357,11 +351,59 @@ readchar (readcharfun)
return c;
}
+ if (CONSP (readcharfun))
+ {
+ /* This is the case that read_vector is reading from a unibyte
+ string that contains a byte sequence previously skipped
+ because of #@NUMBER. The car part of readcharfun is that
+ string, and the cdr part is a value of readcharfun given to
+ read_vector. */
+ readbyte = readbyte_from_string;
+ if (EQ (XCDR (readcharfun), Qget_emacs_mule_file_char))
+ emacs_mule_encoding = 1;
+ goto read_multibyte;
+ }
+
+ if (EQ (readcharfun, Qget_emacs_mule_file_char))
+ {
+ readbyte = readbyte_from_file;
+ emacs_mule_encoding = 1;
+ goto read_multibyte;
+ }
+
tem = call0 (readcharfun);
if (NILP (tem))
return -1;
return XINT (tem);
+
+ read_multibyte:
+ if (unread_char >= 0)
+ {
+ c = unread_char;
+ unread_char = -1;
+ return c;
+ }
+ c = (*readbyte) (-1, readcharfun);
+ if (c < 0 || ASCII_BYTE_P (c) || load_each_byte)
+ return c;
+ if (emacs_mule_encoding)
+ return read_emacs_mule_char (c, readbyte, readcharfun);
+ i = 0;
+ buf[i++] = c;
+ len = BYTES_BY_CHAR_HEAD (c);
+ while (i < len)
+ {
+ c = (*readbyte) (-1, readcharfun);
+ if (c < 0 || ! TRAILING_CODE_P (c))
+ {
+ while (--i > 1)
+ (*readbyte) (buf[i], readcharfun);
+ return BYTE8_TO_CHAR (buf[0]);
+ }
+ buf[i++] = c;
+ }
+ return STRING_CHAR (buf, i);
}
/* Unread the character C in the way appropriate for the stream READCHARFUN.
@@ -382,36 +424,26 @@ unreadchar (readcharfun, c)
struct buffer *b = XBUFFER (readcharfun);
int bytepos = BUF_PT_BYTE (b);
- if (readchar_backlog >= 0)
- readchar_backlog++;
+ BUF_PT (b)--;
+ if (! NILP (b->enable_multibyte_characters))
+ BUF_DEC_POS (b, bytepos);
else
- {
- BUF_PT (b)--;
- if (! NILP (b->enable_multibyte_characters))
- BUF_DEC_POS (b, bytepos);
- else
- bytepos--;
+ bytepos--;
- BUF_PT_BYTE (b) = bytepos;
- }
+ BUF_PT_BYTE (b) = bytepos;
}
else if (MARKERP (readcharfun))
{
struct buffer *b = XMARKER (readcharfun)->buffer;
int bytepos = XMARKER (readcharfun)->bytepos;
- if (readchar_backlog >= 0)
- readchar_backlog++;
+ XMARKER (readcharfun)->charpos--;
+ if (! NILP (b->enable_multibyte_characters))
+ BUF_DEC_POS (b, bytepos);
else
- {
- XMARKER (readcharfun)->charpos--;
- if (! NILP (b->enable_multibyte_characters))
- BUF_DEC_POS (b, bytepos);
- else
- bytepos--;
+ bytepos--;
- XMARKER (readcharfun)->bytepos = bytepos;
- }
+ XMARKER (readcharfun)->bytepos = bytepos;
}
else if (STRINGP (readcharfun))
{
@@ -419,18 +451,165 @@ unreadchar (readcharfun, c)
read_from_string_index_byte
= string_char_to_byte (readcharfun, read_from_string_index);
}
+ else if (CONSP (readcharfun))
+ {
+ unread_char = c;
+ }
else if (EQ (readcharfun, Qlambda))
- read_bytecode_char (1);
- else if (EQ (readcharfun, Qget_file_char))
+ {
+ unread_char = c;
+ }
+ else if (EQ (readcharfun, Qget_file_char)
+ || EQ (readcharfun, Qget_emacs_mule_file_char))
+ {
+ if (load_each_byte)
+ {
+ BLOCK_INPUT;
+ ungetc (c, instream);
+ UNBLOCK_INPUT;
+ }
+ else
+ unread_char = c;
+ }
+ else
+ call1 (readcharfun, make_number (c));
+}
+
+static int
+readbyte_for_lambda (c, readcharfun)
+ int c;
+ Lisp_Object readcharfun;
+{
+ return read_bytecode_char (c >= 0);
+}
+
+
+static int
+readbyte_from_file (c, readcharfun)
+ int c;
+ Lisp_Object readcharfun;
+{
+ if (c >= 0)
{
BLOCK_INPUT;
ungetc (c, instream);
UNBLOCK_INPUT;
+ return 0;
+ }
+
+ BLOCK_INPUT;
+ c = getc (instream);
+
+#ifdef EINTR
+ /* Interrupted reads have been observed while reading over the network */
+ while (c == EOF && ferror (instream) && errno == EINTR)
+ {
+ UNBLOCK_INPUT;
+ QUIT;
+ BLOCK_INPUT;
+ clearerr (instream);
+ c = getc (instream);
}
+#endif
+
+ UNBLOCK_INPUT;
+
+ return (c == EOF ? -1 : c);
+}
+
+static int
+readbyte_from_string (c, readcharfun)
+ int c;
+ Lisp_Object readcharfun;
+{
+ Lisp_Object string = XCAR (readcharfun);
+
+ if (c >= 0)
+ {
+ read_from_string_index--;
+ read_from_string_index_byte
+ = string_char_to_byte (string, read_from_string_index);
+ }
+
+ if (read_from_string_index >= read_from_string_limit)
+ c = -1;
else
- call1 (readcharfun, make_number (c));
+ FETCH_STRING_CHAR_ADVANCE (c, string,
+ read_from_string_index,
+ read_from_string_index_byte);
+ return c;
+}
+
+
+/* Read one non-ASCII character from INSTREAM. The character is
+ encoded in `emacs-mule' and the first byte is already read in
+ C. */
+
+extern char emacs_mule_bytes[256];
+
+static int
+read_emacs_mule_char (c, readbyte, readcharfun)
+ int c;
+ int (*readbyte) P_ ((int, Lisp_Object));
+ Lisp_Object readcharfun;
+{
+ /* Emacs-mule coding uses at most 4-byte for one character. */
+ unsigned char buf[4];
+ int len = emacs_mule_bytes[c];
+ struct charset *charset;
+ int i;
+ unsigned code;
+
+ if (len == 1)
+ /* C is not a valid leading-code of `emacs-mule'. */
+ return BYTE8_TO_CHAR (c);
+
+ i = 0;
+ buf[i++] = c;
+ while (i < len)
+ {
+ c = (*readbyte) (-1, readcharfun);
+ if (c < 0xA0)
+ {
+ while (--i > 1)
+ (*readbyte) (buf[i], readcharfun);
+ return BYTE8_TO_CHAR (buf[0]);
+ }
+ buf[i++] = c;
+ }
+
+ if (len == 2)
+ {
+ charset = emacs_mule_charset[buf[0]];
+ code = buf[1] & 0x7F;
+ }
+ else if (len == 3)
+ {
+ if (buf[0] == EMACS_MULE_LEADING_CODE_PRIVATE_11
+ || buf[0] == EMACS_MULE_LEADING_CODE_PRIVATE_12)
+ {
+ charset = emacs_mule_charset[buf[1]];
+ code = buf[2] & 0x7F;
+ }
+ else
+ {
+ charset = emacs_mule_charset[buf[0]];
+ code = ((buf[1] << 8) | buf[2]) & 0x7F7F;
+ }
+ }
+ else
+ {
+ charset = emacs_mule_charset[buf[1]];
+ code = ((buf[2] << 8) | buf[3]) & 0x7F7F;
+ }
+ c = DECODE_CHAR (charset, code);
+ if (c < 0)
+ Fsignal (Qinvalid_read_syntax,
+ Fcons (build_string ("invalid multibyte form"), Qnil));
+ return c;
}
+
static Lisp_Object read_internal_start P_ ((Lisp_Object, Lisp_Object,
Lisp_Object));
static Lisp_Object read0 P_ ((Lisp_Object));
@@ -438,7 +617,6 @@ static Lisp_Object read1 P_ ((Lisp_Object, int *, int));
static Lisp_Object read_list P_ ((int, Lisp_Object));
static Lisp_Object read_vector P_ ((Lisp_Object, int));
-static int read_multibyte P_ ((int, Lisp_Object));
static Lisp_Object substitute_object_recurse P_ ((Lisp_Object, Lisp_Object,
Lisp_Object));
@@ -449,6 +627,8 @@ static void substitute_in_interval P_ ((INTERVAL, Lisp_Object));
/* Get a character from the tty. */
+extern Lisp_Object read_char ();
+
/* Read input events until we get one that's acceptable for our purposes.
If NO_SWITCH_FRAME is non-zero, switch-frame events are stashed
@@ -500,12 +680,10 @@ read_filtered_event (no_switch_frame, ascii_required, error_nonascii,
EMACS_ADD_TIME (end_time, end_time, wait_time);
}
-/* Read until we get an acceptable event. */
+ /* Read until we get an acceptable event. */
retry:
- do
- val = read_char (0, 0, 0, (input_method ? Qnil : Qt), 0,
- NUMBERP (seconds) ? &end_time : NULL);
- while (INTEGERP (val) && XINT (val) == -2); /* wrong_kboard_jmpbuf */
+ val = read_char (0, 0, 0, (input_method ? Qnil : Qt), 0,
+ NUMBERP (seconds) ? &end_time : NULL);
if (BUFFERP (val))
goto retry;
@@ -645,11 +823,11 @@ DEFUN ("get-file-char", Fget_file_char, Sget_file_char, 0, 0, 0,
-/* Value is non-zero if the file associated with file descriptor FD
- is a compiled Lisp file that's safe to load. Only files compiled
- with Emacs are safe to load. Files compiled with XEmacs can lead
- to a crash in Fbyte_code because of an incompatible change in the
- byte compiler. */
+/* Value is a version number of byte compiled code if the file
+ asswociated with file descriptor FD is a compiled Lisp file that's
+ safe to load. Only files compiled with Emacs are safe to load.
+ Files compiled with XEmacs can lead to a crash in Fbyte_code
+ because of an incompatible change in the byte compiler. */
static int
safe_to_load_p (fd)
@@ -658,6 +836,7 @@ safe_to_load_p (fd)
char buf[512];
int nbytes, i;
int safe_p = 1;
+ int version = 1;
/* Read the first few bytes from the file, and look for a line
specifying the byte compiler version used. */
@@ -667,15 +846,18 @@ safe_to_load_p (fd)
buf[nbytes] = '\0';
/* Skip to the next newline, skipping over the initial `ELC'
- with NUL bytes following it. */
+ with NUL bytes following it, but note the version. */
for (i = 0; i < nbytes && buf[i] != '\n'; ++i)
- ;
+ if (i == 4)
+ version = buf[i];
- if (i < nbytes
- && fast_c_string_match_ignore_case (Vbytecomp_version_regexp,
+ if (i == nbytes
+ || fast_c_string_match_ignore_case (Vbytecomp_version_regexp,
buf + i) < 0)
safe_p = 0;
}
+ if (safe_p)
+ safe_p = version;
lseek (fd, 0, SEEK_SET);
return safe_p;
@@ -708,7 +890,7 @@ load_warn_old_style_backquotes (file)
if (!NILP (Vold_style_backquotes))
{
Lisp_Object args[2];
- args[0] = build_string ("Loading `%s': old-style backquotes detected!");
+ args[0] = build_string ("!! File %s uses old-style backquotes !!");
args[1] = file;
Fmessage (2, args);
}
@@ -741,7 +923,7 @@ DEFUN ("load", Fload, Sload, 1, 5, 0,
doc: /* Execute a file of Lisp code named FILE.
First try FILE with `.elc' appended, then try with `.el',
then try FILE unmodified (the exact suffixes in the exact order are
-determined by `load-suffixes'). Environment variable references in
+determined by `load-suffixes'). Environment variable references in
FILE are replaced with their values by calling `substitute-in-file-name'.
This function searches the directories in `load-path'.
@@ -789,6 +971,8 @@ Return t if the file exists and loads successfully. */)
int safe_p = 1;
char *fmode = "r";
Lisp_Object tmp[2];
+ int version;
+
#ifdef DOS_NT
fmode = "rt";
#endif /* DOS_NT */
@@ -912,12 +1096,15 @@ Return t if the file exists and loads successfully. */)
tmp))
: found) ;
- /* Check for the presence of old-style quotes and warn about them. */
+ version = -1;
+
+ /* Check fore the presence of old-style quotes and warn about them. */
specbind (Qold_style_backquotes, Qnil);
record_unwind_protect (load_warn_old_style_backquotes, file);
if (!bcmp (SDATA (found) + SBYTES (found) - 4,
- ".elc", 4))
+ ".elc", 4)
+ || (version = safe_to_load_p (fd)) > 0)
/* Load .elc files directly, but not when they are
remote and have no handler! */
{
@@ -928,7 +1115,8 @@ Return t if the file exists and loads successfully. */)
GCPRO3 (file, found, hist_file_name);
- if (!safe_to_load_p (fd))
+ if (version < 0
+ && ! (version = safe_to_load_p (fd)))
{
safe_p = 0;
if (!load_dangerous_libraries)
@@ -1026,8 +1214,17 @@ Return t if the file exists and loads successfully. */)
load_descriptor_list
= Fcons (make_number (fileno (stream)), load_descriptor_list);
load_in_progress++;
- readevalloop (Qget_file_char, stream, hist_file_name,
- Feval, 0, Qnil, Qnil, Qnil, Qnil);
+ if (! version || version >= 22)
+ readevalloop (Qget_file_char, stream, hist_file_name,
+ Feval, 0, Qnil, Qnil, Qnil, Qnil);
+ else
+ {
+ /* We can't handle a file which was compiled with
+ byte-compile-dynamic by older version of Emacs. */
+ specbind (Qload_force_doc_strings, Qt);
+ readevalloop (Qget_emacs_mule_file_char, stream, hist_file_name, Feval,
+ 0, Qnil, Qnil, Qnil, Qnil);
+ }
unbind_to (count, Qnil);
/* Run any eval-after-load forms for this file */
@@ -1456,8 +1653,6 @@ readevalloop (readcharfun, stream, sourcename, evalfun,
record_unwind_protect (readevalloop_1, load_convert_to_unibyte ? Qt : Qnil);
load_convert_to_unibyte = !NILP (unibyte);
- readchar_backlog = -1;
-
GCPRO4 (sourcename, readfun, start, end);
/* Try to ensure sourcename is a truename, except whilst preloading. */
@@ -1714,7 +1909,6 @@ read_internal_start (stream, start, end)
{
Lisp_Object retval;
- readchar_backlog = -1;
readchar_count = 0;
new_backquote_flag = 0;
read_objects = Qnil;
@@ -1722,17 +1916,25 @@ read_internal_start (stream, start, end)
|| EQ (Vread_with_symbol_positions, stream))
Vread_symbol_positions_list = Qnil;
- if (STRINGP (stream))
+ if (STRINGP (stream)
+ || ((CONSP (stream) && STRINGP (XCAR (stream)))))
{
int startval, endval;
+ Lisp_Object string;
+
+ if (STRINGP (stream))
+ string = stream;
+ else
+ string = XCAR (stream);
+
if (NILP (end))
- endval = SCHARS (stream);
+ endval = SCHARS (string);
else
{
CHECK_NUMBER (end);
endval = XINT (end);
- if (endval < 0 || endval > SCHARS (stream))
- args_out_of_range (stream, end);
+ if (endval < 0 || endval > SCHARS (string))
+ args_out_of_range (string, end);
}
if (NILP (start))
@@ -1742,10 +1944,10 @@ read_internal_start (stream, start, end)
CHECK_NUMBER (start);
startval = XINT (start);
if (startval < 0 || startval > endval)
- args_out_of_range (stream, start);
+ args_out_of_range (string, start);
}
read_from_string_index = startval;
- read_from_string_index_byte = string_char_to_byte (stream, startval);
+ read_from_string_index_byte = string_char_to_byte (string, startval);
read_from_string_limit = endval;
}
@@ -1792,59 +1994,19 @@ read0 (readcharfun)
static int read_buffer_size;
static char *read_buffer;
-/* Read multibyte form and return it as a character. C is a first
- byte of multibyte form, and rest of them are read from
- READCHARFUN. */
-
-static int
-read_multibyte (c, readcharfun)
- register int c;
- Lisp_Object readcharfun;
-{
- /* We need the actual character code of this multibyte
- characters. */
- unsigned char str[MAX_MULTIBYTE_LENGTH];
- int len = 0;
- int bytes;
-
- if (c < 0)
- return c;
-
- str[len++] = c;
- while ((c = READCHAR) >= 0xA0
- && len < MAX_MULTIBYTE_LENGTH)
- {
- str[len++] = c;
- readchar_count--;
- }
- UNREAD (c);
- if (UNIBYTE_STR_AS_MULTIBYTE_P (str, len, bytes))
- return STRING_CHAR (str, len);
- /* The byte sequence is not valid as multibyte. Unread all bytes
- but the first one, and return the first byte. */
- while (--len > 0)
- UNREAD (str[len]);
- return str[0];
-}
-
/* Read a \-escape sequence, assuming we already read the `\'.
- If the escape sequence forces unibyte, store 1 into *BYTEREP.
- If the escape sequence forces multibyte, store 2 into *BYTEREP.
- Otherwise store 0 into *BYTEREP. */
+ If the escape sequence forces unibyte, return eight-bit char. */
static int
-read_escape (readcharfun, stringp, byterep)
+read_escape (readcharfun, stringp)
Lisp_Object readcharfun;
int stringp;
- int *byterep;
{
register int c = READCHAR;
/* \u allows up to four hex digits, \U up to eight. Default to the
behaviour for \u, and change this value in the case that \U is seen. */
int unicode_hex_count = 4;
- *byterep = 0;
-
switch (c)
{
case -1:
@@ -1881,7 +2043,7 @@ read_escape (readcharfun, stringp, byterep)
error ("Invalid escape character syntax");
c = READCHAR;
if (c == '\\')
- c = read_escape (readcharfun, 0, byterep);
+ c = read_escape (readcharfun, 0);
return c | meta_modifier;
case 'S':
@@ -1890,7 +2052,7 @@ read_escape (readcharfun, stringp, byterep)
error ("Invalid escape character syntax");
c = READCHAR;
if (c == '\\')
- c = read_escape (readcharfun, 0, byterep);
+ c = read_escape (readcharfun, 0);
return c | shift_modifier;
case 'H':
@@ -1899,7 +2061,7 @@ read_escape (readcharfun, stringp, byterep)
error ("Invalid escape character syntax");
c = READCHAR;
if (c == '\\')
- c = read_escape (readcharfun, 0, byterep);
+ c = read_escape (readcharfun, 0);
return c | hyper_modifier;
case 'A':
@@ -1908,7 +2070,7 @@ read_escape (readcharfun, stringp, byterep)
error ("Invalid escape character syntax");
c = READCHAR;
if (c == '\\')
- c = read_escape (readcharfun, 0, byterep);
+ c = read_escape (readcharfun, 0);
return c | alt_modifier;
case 's':
@@ -1920,7 +2082,7 @@ read_escape (readcharfun, stringp, byterep)
}
c = READCHAR;
if (c == '\\')
- c = read_escape (readcharfun, 0, byterep);
+ c = read_escape (readcharfun, 0);
return c | super_modifier;
case 'C':
@@ -1930,7 +2092,7 @@ read_escape (readcharfun, stringp, byterep)
case '^':
c = READCHAR;
if (c == '\\')
- c = read_escape (readcharfun, 0, byterep);
+ c = read_escape (readcharfun, 0);
if ((c & ~CHAR_MODIFIER_MASK) == '?')
return 0177 | (c & CHAR_MODIFIER_MASK);
else if (! SINGLE_BYTE_CHAR_P ((c & ~CHAR_MODIFIER_MASK)))
@@ -1970,7 +2132,8 @@ read_escape (readcharfun, stringp, byterep)
}
}
- *byterep = 1;
+ if (i >= 0x80 && i < 0x100)
+ i = BYTE8_TO_CHAR (i);
return i;
}
@@ -1978,6 +2141,7 @@ read_escape (readcharfun, stringp, byterep)
/* A hex escape, as in ANSI C. */
{
int i = 0;
+ int count = 0;
while (1)
{
c = READCHAR;
@@ -2000,9 +2164,11 @@ read_escape (readcharfun, stringp, byterep)
UNREAD (c);
break;
}
+ count++;
}
- *byterep = 2;
+ if (count < 3 && i >= 0x80)
+ return BYTE8_TO_CHAR (i);
return i;
}
@@ -2016,8 +2182,6 @@ read_escape (readcharfun, stringp, byterep)
{
int i = 0;
int count = 0;
- Lisp_Object lisp_char;
- struct gcpro gcpro1;
while (++count <= unicode_hex_count)
{
@@ -2034,22 +2198,10 @@ read_escape (readcharfun, stringp, byterep)
}
}
- GCPRO1 (readcharfun);
- lisp_char = call2 (intern ("decode-char"), intern ("ucs"),
- make_number (i));
- UNGCPRO;
-
- if (NILP (lisp_char))
- {
- error ("Unsupported Unicode code point: U+%x", (unsigned)i);
- }
-
- return XFASTINT (lisp_char);
+ return i;
}
default:
- if (BASE_LEADING_CODE_P (c))
- c = read_multibyte (c, readcharfun);
return c;
}
}
@@ -2120,43 +2272,6 @@ read_integer (readcharfun, radix)
}
-/* Convert unibyte text in read_buffer to multibyte.
-
- Initially, *P is a pointer after the end of the unibyte text, and
- the pointer *END points after the end of read_buffer.
-
- If read_buffer doesn't have enough room to hold the result
- of the conversion, reallocate it and adjust *P and *END.
-
- At the end, make *P point after the result of the conversion, and
- return in *NCHARS the number of characters in the converted
- text. */
-
-static void
-to_multibyte (p, end, nchars)
- char **p, **end;
- int *nchars;
-{
- int nbytes;
-
- parse_str_as_multibyte (read_buffer, *p - read_buffer, &nbytes, nchars);
- if (read_buffer_size < 2 * nbytes)
- {
- int offset = *p - read_buffer;
- read_buffer_size = 2 * max (read_buffer_size, nbytes);
- read_buffer = (char *) xrealloc (read_buffer, read_buffer_size);
- *p = read_buffer + offset;
- *end = read_buffer + read_buffer_size;
- }
-
- if (nbytes != *nchars)
- nbytes = str_as_multibyte (read_buffer, read_buffer_size,
- *p - read_buffer, nchars);
-
- *p = read_buffer + nbytes;
-}
-
-
/* If the next token is ')' or ']' or '.', we store that character
in *PCH and the return value is not interesting. Else, we store
zero in *PCH and we read and return one lisp object.
@@ -2173,6 +2288,7 @@ read1 (readcharfun, pch, first_in_list)
int uninterned_symbol = 0;
*pch = 0;
+ load_each_byte = 0;
retry:
@@ -2204,11 +2320,9 @@ read1 (readcharfun, pch, first_in_list)
{
Lisp_Object tmp;
tmp = read_vector (readcharfun, 0);
- if (XVECTOR (tmp)->size < CHAR_TABLE_STANDARD_SLOTS
- || XVECTOR (tmp)->size > CHAR_TABLE_STANDARD_SLOTS + 10)
+ if (XVECTOR (tmp)->size < CHAR_TABLE_STANDARD_SLOTS)
error ("Invalid size char-table");
XSETCHAR_TABLE (tmp, XCHAR_TABLE (tmp));
- XCHAR_TABLE (tmp)->top = Qt;
return tmp;
}
else if (c == '^')
@@ -2217,11 +2331,18 @@ read1 (readcharfun, pch, first_in_list)
if (c == '[')
{
Lisp_Object tmp;
+ int depth, size;
+
tmp = read_vector (readcharfun, 0);
- if (XVECTOR (tmp)->size != SUB_CHAR_TABLE_STANDARD_SLOTS)
+ if (!INTEGERP (AREF (tmp, 0)))
+ error ("Invalid depth in char-table");
+ depth = XINT (AREF (tmp, 0));
+ if (depth < 1 || depth > 3)
+ error ("Invalid depth in char-table");
+ size = XVECTOR (tmp)->size - 2;
+ if (chartab_size [depth] != size)
error ("Invalid size char-table");
- XSETCHAR_TABLE (tmp, XCHAR_TABLE (tmp));
- XCHAR_TABLE (tmp)->top = Qnil;
+ XSETSUB_CHAR_TABLE (tmp, XSUB_CHAR_TABLE (tmp));
return tmp;
}
invalid_syntax ("#^^", 3);
@@ -2242,12 +2363,14 @@ read1 (readcharfun, pch, first_in_list)
UNREAD (c);
tmp = read1 (readcharfun, pch, first_in_list);
- if (size_in_chars != SCHARS (tmp)
- /* We used to print 1 char too many
- when the number of bits was a multiple of 8.
- Accept such input in case it came from an old version. */
- && ! (XFASTINT (length)
- == (SCHARS (tmp) - 1) * BOOL_VECTOR_BITS_PER_CHAR))
+ if (STRING_MULTIBYTE (tmp)
+ || (size_in_chars != SCHARS (tmp)
+ /* We used to print 1 char too many
+ when the number of bits was a multiple of 8.
+ Accept such input in case it came from an old
+ version. */
+ && ! (XFASTINT (length)
+ == (SCHARS (tmp) - 1) * BOOL_VECTOR_BITS_PER_CHAR)))
invalid_syntax ("#&...", 5);
val = Fmake_bool_vector (length, Qnil);
@@ -2309,6 +2432,7 @@ read1 (readcharfun, pch, first_in_list)
{
int i, nskip = 0;
+ load_each_byte = 1;
/* Read a decimal integer. */
while ((c = READCHAR) >= 0
&& c >= '0' && c <= '9')
@@ -2319,7 +2443,9 @@ read1 (readcharfun, pch, first_in_list)
if (c >= 0)
UNREAD (c);
- if (load_force_doc_strings && EQ (readcharfun, Qget_file_char))
+ if (load_force_doc_strings
+ && (EQ (readcharfun, Qget_file_char)
+ || EQ (readcharfun, Qget_emacs_mule_file_char)))
{
/* If we are supposed to force doc strings into core right now,
record the last string that we skipped,
@@ -2371,6 +2497,7 @@ read1 (readcharfun, pch, first_in_list)
c = READCHAR;
}
+ load_each_byte = 0;
goto retry;
}
if (c == '!')
@@ -2506,7 +2633,7 @@ read1 (readcharfun, pch, first_in_list)
case '?':
{
- int discard;
+ int modifiers;
int next_char;
int ok;
@@ -2522,9 +2649,12 @@ read1 (readcharfun, pch, first_in_list)
return make_number (c);
if (c == '\\')
- c = read_escape (readcharfun, 0, &discard);
- else if (BASE_LEADING_CODE_P (c))
- c = read_multibyte (c, readcharfun);
+ c = read_escape (readcharfun, 0);
+ modifiers = c & CHAR_MODIFIER_MASK;
+ c &= ~CHAR_MODIFIER_MASK;
+ if (CHAR_BYTE8_P (c))
+ c = CHAR_TO_BYTE8 (c);
+ c |= modifiers;
next_char = READCHAR;
if (next_char == '.')
@@ -2559,14 +2689,12 @@ read1 (readcharfun, pch, first_in_list)
char *p = read_buffer;
char *end = read_buffer + read_buffer_size;
register int c;
- /* 1 if we saw an escape sequence specifying
- a multibyte character, or a multibyte character. */
+ /* Nonzero if we saw an escape sequence specifying
+ a multibyte character. */
int force_multibyte = 0;
- /* 1 if we saw an escape sequence specifying
+ /* Nonzero if we saw an escape sequence specifying
a single-byte character. */
int force_singlebyte = 0;
- /* 1 if read_buffer contains multibyte text now. */
- int is_multibyte = 0;
int cancel = 0;
int nchars = 0;
@@ -2584,9 +2712,9 @@ read1 (readcharfun, pch, first_in_list)
if (c == '\\')
{
- int byterep;
+ int modifiers;
- c = read_escape (readcharfun, 1, &byterep);
+ c = read_escape (readcharfun, 1);
/* C is -1 if \ newline has just been seen */
if (c == -1)
@@ -2596,50 +2724,55 @@ read1 (readcharfun, pch, first_in_list)
continue;
}
- if (byterep == 1)
+ modifiers = c & CHAR_MODIFIER_MASK;
+ c = c & ~CHAR_MODIFIER_MASK;
+
+ if (CHAR_BYTE8_P (c))
force_singlebyte = 1;
- else if (byterep == 2)
+ else if (! ASCII_CHAR_P (c))
force_multibyte = 1;
- }
-
- /* A character that must be multibyte forces multibyte. */
- if (! SINGLE_BYTE_CHAR_P (c & ~CHAR_MODIFIER_MASK))
- force_multibyte = 1;
+ else /* i.e. ASCII_CHAR_P (c) */
+ {
+ /* Allow `\C- ' and `\C-?'. */
+ if (modifiers == CHAR_CTL)
+ {
+ if (c == ' ')
+ c = 0, modifiers = 0;
+ else if (c == '?')
+ c = 127, modifiers = 0;
+ }
+ if (modifiers & CHAR_SHIFT)
+ {
+ /* Shift modifier is valid only with [A-Za-z]. */
+ if (c >= 'A' && c <= 'Z')
+ modifiers &= ~CHAR_SHIFT;
+ else if (c >= 'a' && c <= 'z')
+ c -= ('a' - 'A'), modifiers &= ~CHAR_SHIFT;
+ }
+
+ if (modifiers & CHAR_META)
+ {
+ /* Move the meta bit to the right place for a
+ string. */
+ modifiers &= ~CHAR_META;
+ c = BYTE8_TO_CHAR (c | 0x80);
+ force_singlebyte = 1;
+ }
+ }
- /* If we just discovered the need to be multibyte,
- convert the text accumulated thus far. */
- if (force_multibyte && ! is_multibyte)
- {
- is_multibyte = 1;
- to_multibyte (&p, &end, &nchars);
+ /* Any modifiers remaining are invalid. */
+ if (modifiers)
+ error ("Invalid modifier in string");
+ p += CHAR_STRING (c, (unsigned char *) p);
}
-
- /* Allow `\C- ' and `\C-?'. */
- if (c == (CHAR_CTL | ' '))
- c = 0;
- else if (c == (CHAR_CTL | '?'))
- c = 127;
-
- if (c & CHAR_SHIFT)
+ else
{
- /* Shift modifier is valid only with [A-Za-z]. */
- if ((c & 0377) >= 'A' && (c & 0377) <= 'Z')
- c &= ~CHAR_SHIFT;
- else if ((c & 0377) >= 'a' && (c & 0377) <= 'z')
- c = (c & ~CHAR_SHIFT) - ('a' - 'A');
+ p += CHAR_STRING (c, (unsigned char *) p);
+ if (CHAR_BYTE8_P (c))
+ force_singlebyte = 1;
+ else if (! ASCII_CHAR_P (c))
+ force_multibyte = 1;
}
-
- if (c & CHAR_META)
- /* Move the meta bit to the right place for a string. */
- c = (c & ~CHAR_META) | 0x80;
- if (c & CHAR_MODIFIER_MASK)
- error ("Invalid modifier in string");
-
- if (is_multibyte)
- p += CHAR_STRING (c, p);
- else
- *p++ = c;
-
nchars++;
}
@@ -2652,37 +2785,16 @@ read1 (readcharfun, pch, first_in_list)
if (!NILP (Vpurify_flag) && NILP (Vdoc_file_name) && cancel)
return make_number (0);
- if (is_multibyte || force_singlebyte)
+ if (force_multibyte)
+ /* READ_BUFFER already contains valid multibyte forms. */
;
- else if (load_convert_to_unibyte)
- {
- Lisp_Object string;
- to_multibyte (&p, &end, &nchars);
- if (p - read_buffer != nchars)
- {
- string = make_multibyte_string (read_buffer, nchars,
- p - read_buffer);
- return Fstring_make_unibyte (string);
- }
- /* We can make a unibyte string directly. */
- is_multibyte = 0;
- }
- else if (EQ (readcharfun, Qget_file_char)
- || EQ (readcharfun, Qlambda))
+ else if (force_singlebyte)
{
- /* Nowadays, reading directly from a file is used only for
- compiled Emacs Lisp files, and those always use the
- Emacs internal encoding. Meanwhile, Qlambda is used
- for reading dynamic byte code (compiled with
- byte-compile-dynamic = t). So make the string multibyte
- if the string contains any multibyte sequences.
- (to_multibyte is a no-op if not.) */
- to_multibyte (&p, &end, &nchars);
- is_multibyte = (p - read_buffer) != nchars;
+ nchars = str_as_unibyte (read_buffer, p - read_buffer);
+ p = read_buffer + nchars;
}
else
- /* In all other cases, if we read these bytes as
- separate characters, treat them as separate characters now. */
+ /* Otherwise, READ_BUFFER contains only ASCII. */
;
/* We want readchar_count to be the number of characters, not
@@ -2692,9 +2804,11 @@ read1 (readcharfun, pch, first_in_list)
/* readchar_count -= (p - read_buffer) - nchars; */
if (read_pure)
return make_pure_string (read_buffer, nchars, p - read_buffer,
- is_multibyte);
+ (force_multibyte
+ || (p - read_buffer != nchars)));
return make_specified_string (read_buffer, nchars, p - read_buffer,
- is_multibyte);
+ (force_multibyte
+ || (p - read_buffer != nchars)));
}
case '.':
@@ -2718,7 +2832,7 @@ read1 (readcharfun, pch, first_in_list)
}
default:
default_label:
- if (c <= 040) goto retry;
+ if (c <= 040) goto retry;
if (c == 0x8a0) /* NBSP */
goto retry;
{
@@ -2752,11 +2866,7 @@ read1 (readcharfun, pch, first_in_list)
quoted = 1;
}
- if (! SINGLE_BYTE_CHAR_P (c))
- p += CHAR_STRING (c, p);
- else
- *p++ = c;
-
+ p += CHAR_STRING (c, p);
c = READCHAR;
}
@@ -2790,6 +2900,8 @@ read1 (readcharfun, pch, first_in_list)
{
if (p1[-1] == '.')
p1[-1] = '\0';
+ /* Fixme: if we have strtol, use that, and check
+ for overflow. */
if (sizeof (int) == sizeof (EMACS_INT))
XSETINT (val, atoi (read_buffer));
else if (sizeof (long) == sizeof (EMACS_INT))
@@ -3110,7 +3222,7 @@ read_vector (readcharfun, bytecodeflag)
STRING_SET_CHARS (bytestr, SBYTES (bytestr));
STRING_SET_UNIBYTE (bytestr);
- item = Fread (bytestr);
+ item = Fread (Fcons (bytestr, readcharfun));
if (!CONSP (item))
error ("Invalid byte code");
@@ -3123,6 +3235,15 @@ read_vector (readcharfun, bytecodeflag)
/* Now handle the bytecode slot. */
ptr[COMPILED_BYTECODE] = read_pure ? Fpurecopy (bytestr) : bytestr;
}
+ else if (i == COMPILED_DOC_STRING
+ && STRINGP (item)
+ && ! STRING_MULTIBYTE (item))
+ {
+ if (EQ (readcharfun, Qget_emacs_mule_file_char))
+ item = Fdecode_coding_string (item, Qemacs_mule, Qnil, Qnil);
+ else
+ item = Fstring_as_multibyte (item);
+ }
}
ptr[i] = read_pure ? Fpurecopy (item) : item;
otem = XCONS (tem);
@@ -3219,7 +3340,15 @@ read_list (flag, readcharfun)
if (doc_reference == 2)
{
/* Get a doc string from the file we are loading.
- If it's in saved_doc_string, get it from there. */
+ If it's in saved_doc_string, get it from there.
+
+ Here, we don't know if the string is a
+ bytecode string or a doc string. As a
+ bytecode string must be unibyte, we always
+ return a unibyte string. If it is actually a
+ doc string, caller must make it
+ multibyte. */
+
int pos = XINT (XCDR (val));
/* Position is negative for user variables. */
if (pos < 0) pos = -pos;
@@ -3251,8 +3380,8 @@ read_list (flag, readcharfun)
saved_doc_string[to++] = c;
}
- return make_string (saved_doc_string + start,
- to - start);
+ return make_unibyte_string (saved_doc_string + start,
+ to - start);
}
/* Look in prev_saved_doc_string the same way. */
else if (pos >= prev_saved_doc_string_position
@@ -3283,11 +3412,12 @@ read_list (flag, readcharfun)
prev_saved_doc_string[to++] = c;
}
- return make_string (prev_saved_doc_string + start,
- to - start);
+ return make_unibyte_string (prev_saved_doc_string
+ + start,
+ to - start);
}
else
- return get_doc_string (val, 0, 0);
+ return get_doc_string (val, 1, 0);
}
return val;
@@ -3672,7 +3802,6 @@ defsubr (sname)
{
Lisp_Object sym;
sym = intern (sname->symbol_name);
- XSETPVECTYPE (sname, PVEC_SUBR);
XSETSUBR (XSYMBOL (sym)->function, sname);
}
@@ -3747,6 +3876,37 @@ defvar_lisp (namestring, address)
staticpro (address);
}
+/* Similar but define a variable whose value is the Lisp Object stored in
+ the current buffer. address is the address of the slot in the buffer
+ that is current now. */
+
+void
+defvar_per_buffer (namestring, address, type, doc)
+ char *namestring;
+ Lisp_Object *address;
+ Lisp_Object type;
+ char *doc;
+{
+ Lisp_Object sym, val;
+ int offset;
+
+ sym = intern (namestring);
+ val = allocate_misc ();
+ offset = (char *)address - (char *)current_buffer;
+
+ XMISCTYPE (val) = Lisp_Misc_Buffer_Objfwd;
+ XBUFFER_OBJFWD (val)->offset = offset;
+ SET_SYMBOL_VALUE (sym, val);
+ PER_BUFFER_SYMBOL (offset) = sym;
+ PER_BUFFER_TYPE (offset) = type;
+
+ if (PER_BUFFER_IDX (offset) == 0)
+ /* Did a DEFVAR_PER_BUFFER without initializing the corresponding
+ slot of buffer_local_flags */
+ abort ();
+}
+
+
/* Similar but define a variable whose value is the Lisp Object stored
at a particular offset in the current kboard object. */
@@ -3843,7 +4003,7 @@ init_lread ()
Vload_path = Fcons (tem, Vload_path);
}
- /* Add site-lisp under the installation dir, if it exists. */
+ /* Add site-list under the installation dir, if it exists. */
tem = Fexpand_file_name (build_string ("site-lisp"),
Vinstallation_directory);
tem1 = Ffile_exists_p (tem);
@@ -3903,7 +4063,7 @@ init_lread ()
/* NORMAL refers to the lisp dir in the source directory. */
/* We used to add ../lisp at the front here, but
that caused trouble because it was copied from dump_path
- into Vload_path, above, when Vinstallation_directory was non-nil.
+ into Vload_path, aboe, when Vinstallation_directory was non-nil.
It should be unnecessary. */
Vload_path = decode_env_path (0, normal);
dump_path = Vload_path;
@@ -3962,7 +4122,7 @@ init_lread ()
}
/* Print a warning, using format string FORMAT, that directory DIRNAME
- does not exist. Print it on stderr and put it in *Messages*. */
+ does not exist. Print it on stderr and put it in *Message*. */
void
dir_warning (format, dirname)
@@ -4208,6 +4368,12 @@ to load. See also `load-dangerous-libraries'. */);
Qget_file_char = intern ("get-file-char");
staticpro (&Qget_file_char);
+ Qget_emacs_mule_file_char = intern ("get-emacs-mule-file-char");
+ staticpro (&Qget_emacs_mule_file_char);
+
+ Qload_force_doc_strings = intern ("load-force-doc-strings");
+ staticpro (&Qload_force_doc_strings);
+
Qbackquote = intern ("`");
staticpro (&Qbackquote);
Qcomma = intern (",");
diff --git a/src/m/ibms390x.h b/src/m/ibms390x.h
index 0dafe59000..64ede365d0 100644
--- a/src/m/ibms390x.h
+++ b/src/m/ibms390x.h
@@ -22,7 +22,7 @@ Boston, MA 02110-1301, USA. */
into ibms390.h. */
-/* The following line tells the configuration script what sort of
+/* The following line tells the configuration script what sort of
operating system this machine is likely to run.
USUAL-OPSYS="<name of system .h file here, without the s- or .h>"
@@ -97,10 +97,14 @@ NOTE-END */
#define VIRT_ADDR_VARIES
-/* Define HAVE_ALLOCA to say that the system provides a properly
- working alloca function and it should be used. Undefine it if an
- assembler-language alloca in the file alloca.s should be used. */
+/* Define C_ALLOCA if this machine does not support a true alloca
+ and the one written in C should be used instead.
+ Define HAVE_ALLOCA to say that the system provides a properly
+ working alloca function and it should be used.
+ Define neither one if an assembler-language alloca
+ in the file alloca.s should be used. */
+#undef C_ALLOCA
#define HAVE_ALLOCA
/* Define NO_REMAP if memory segmentation makes it not work well
@@ -140,6 +144,11 @@ NOTE-END */
#define VALBITS 60
+/* This definition of MARKBIT is necessary because of the comparison of
+ ARRAY_MARK_FLAG and MARKBIT in an #if in lisp.h, which cpp doesn't like. */
+
+#define MARKBIT 0x8000000000000000L
+
#define LINKER $(CC) -nostdlib
/* Define XINT and XUINT so that they can take arguments of type int */
diff --git a/src/m/sh3el.h b/src/m/sh3el.h
index 77f6dc12c2..eefcccea6d 100644
--- a/src/m/sh3el.h
+++ b/src/m/sh3el.h
@@ -19,7 +19,7 @@ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* The following line tells the configuration script what sort of
+/* The following line tells the configuration script what sort of
operating system this machine is likely to run.
USUAL-OPSYS="<name of system .h file here, without the s- or .h>" */
@@ -79,11 +79,14 @@ Boston, MA 02111-1307, USA. */
#define VIRT_ADDR_VARIES
-/* Define HAVE_ALLOCA to say that the system provides a properly
+/* Define C_ALLOCA if this machine does not support a true alloca
+ and the one written in C should be used instead.
+ Define HAVE_ALLOCA to say that the system provides a properly
working alloca function and it should be used.
- Undefine it if an assembler-language alloca
+ Define neither one if an assembler-language alloca
in the file alloca.s should be used. */
+/* #define C_ALLOCA */
#define HAVE_ALLOCA
/* Define NO_REMAP if memory segmentation makes it not work well
diff --git a/src/macfns.c b/src/macfns.c
index d447ee90a4..2cfdc9f17c 100644
--- a/src/macfns.c
+++ b/src/macfns.c
@@ -107,6 +107,7 @@ extern Lisp_Object Vwindow_system_version;
int image_cache_refcount, dpyinfo_refcount;
#endif
+
#if 0 /* Use xstricmp instead. */
/* compare two strings ignoring case */
@@ -1366,11 +1367,11 @@ x_set_mouse_color (f, arg, oldval)
Cursor cursor, nontext_cursor, mode_cursor, hand_cursor;
Cursor hourglass_cursor, horizontal_drag_cursor;
unsigned long pixel = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f));
- unsigned long mask_color = FRAME_BACKGROUND_PIXEL (f);
+ unsigned long mask_color = x->background_pixel;
/* Don't let pointers be invisible. */
if (mask_color == pixel)
- pixel = FRAME_FOREGROUND_PIXEL (f);
+ pixel = x->foreground_pixel;
f->output_data.mac->mouse_pixel = pixel;
@@ -1443,7 +1444,7 @@ x_set_mouse_color (f, arg, oldval)
BLOCK_INPUT;
if (FRAME_MAC_WINDOW (f) != 0)
- FRAME_TERMINAL (f)->rif->define_frame_cursor (f, cursor);
+ rif->define_frame_cursor (f, cursor);
f->output_data.mac->text_cursor = cursor;
f->output_data.mac->nontext_cursor = nontext_cursor;
@@ -1723,8 +1724,10 @@ x_set_tool_bar_lines (f, value, oldval)
below the menu bar. */
if (FRAME_MAC_WINDOW (f) && FRAME_TOOL_BAR_LINES (f) == 0)
{
- clear_frame (f);
+ updating_frame = f;
+ clear_frame ();
clear_current_matrices (f);
+ updating_frame = NULL;
}
/* If the tool bar gets smaller, the internal border below it
@@ -2250,10 +2253,8 @@ XParseGeometry (string, x, y, width, height)
/* Create and set up the Mac window for frame F. */
static void
-mac_window (f, window_prompting, minibuffer_only)
+mac_window (f)
struct frame *f;
- long window_prompting;
- int minibuffer_only;
{
Rect r;
@@ -2426,8 +2427,8 @@ x_make_gc (f)
= (XCreatePixmapFromBitmapData
(FRAME_X_DISPLAY (f), FRAME_X_DISPLAY_INFO (f)->root_window,
gray_bits, gray_width, gray_height,
- FRAME_FOREGROUND_PIXEL (f),
- FRAME_BACKGROUND_PIXEL (f),
+ f->output_data.x->foreground_pixel,
+ f->output_data.x->background_pixel,
DefaultDepth (FRAME_X_DISPLAY (f), FRAME_X_SCREEN_NUMBER (f))));
#endif
@@ -2522,15 +2523,15 @@ DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame,
1, 1, 0,
doc: /* Make a new window, which is called a "frame" in Emacs terms.
Returns an Emacs frame object.
-PARAMETERS is an alist of frame parameters.
+ALIST is an alist of frame parameters.
If the parameters specify that the frame should not have a minibuffer,
and do not specify a specific minibuffer window to use,
then `default-minibuffer-frame' must be a frame whose minibuffer can
be shared by the new frame.
This function is an internal primitive--use `make-frame' instead. */)
- (parameters)
- Lisp_Object parameters;
+ (parms)
+ Lisp_Object parms;
{
struct frame *f;
Lisp_Object frame, tem;
@@ -2547,21 +2548,23 @@ This function is an internal primitive--use `make-frame' instead. */)
check_mac ();
+ parms = Fcopy_alist (parms);
+
/* Use this general default value to start with
until we know if this frame has a specified name. */
Vx_resource_name = Vinvocation_name;
- display = mac_get_arg (parameters, Qdisplay, 0, 0, RES_TYPE_STRING);
+ display = mac_get_arg (parms, Qdisplay, 0, 0, RES_TYPE_STRING);
if (EQ (display, Qunbound))
display = Qnil;
dpyinfo = check_x_display_info (display);
#ifdef MULTI_KBOARD
- kb = dpyinfo->terminal->kboard;
+ kb = dpyinfo->kboard;
#else
kb = &the_only_kboard;
#endif
- name = mac_get_arg (parameters, Qname, "name", "Name", RES_TYPE_STRING);
+ name = mac_get_arg (parms, Qname, "name", "Name", RES_TYPE_STRING);
if (!STRINGP (name)
&& ! EQ (name, Qunbound)
&& ! NILP (name))
@@ -2571,7 +2574,7 @@ This function is an internal primitive--use `make-frame' instead. */)
Vx_resource_name = name;
/* See if parent window is specified. */
- parent = mac_get_arg (parameters, Qparent_id, NULL, NULL, RES_TYPE_NUMBER);
+ parent = mac_get_arg (parms, Qparent_id, NULL, NULL, RES_TYPE_NUMBER);
if (EQ (parent, Qunbound))
parent = Qnil;
if (! NILP (parent))
@@ -2581,8 +2584,8 @@ This function is an internal primitive--use `make-frame' instead. */)
/* No need to protect DISPLAY because that's not used after passing
it to make_frame_without_minibuffer. */
frame = Qnil;
- GCPRO4 (parameters, parent, name, frame);
- tem = mac_get_arg (parameters, Qminibuffer, "minibuffer", "Minibuffer",
+ GCPRO4 (parms, parent, name, frame);
+ tem = mac_get_arg (parms, Qminibuffer, "minibuffer", "Minibuffer",
RES_TYPE_SYMBOL);
if (EQ (tem, Qnone) || NILP (tem))
f = make_frame_without_minibuffer (Qnil, kb, display);
@@ -2601,24 +2604,20 @@ This function is an internal primitive--use `make-frame' instead. */)
/* Note that X Windows does support scroll bars. */
FRAME_CAN_HAVE_SCROLL_BARS (f) = 1;
- f->terminal = dpyinfo->terminal;
- f->terminal->reference_count++;
-
f->output_method = output_mac;
f->output_data.mac = (struct mac_output *) xmalloc (sizeof (struct mac_output));
bzero (f->output_data.mac, sizeof (struct mac_output));
FRAME_FONTSET (f) = -1;
- record_unwind_protect (unwind_create_frame, frame);
f->icon_name
- = mac_get_arg (parameters, Qicon_name, "iconName", "Title", RES_TYPE_STRING);
+ = mac_get_arg (parms, Qicon_name, "iconName", "Title", RES_TYPE_STRING);
if (! STRINGP (f->icon_name))
f->icon_name = Qnil;
- /* XXX Is this needed? */
- /*FRAME_MAC_DISPLAY_INFO (f) = dpyinfo;*/
+/* FRAME_MAC_DISPLAY_INFO (f) = dpyinfo; */
/* With FRAME_MAC_DISPLAY_INFO set up, this unwind-protect is safe. */
+ record_unwind_protect (unwind_create_frame, frame);
#if GLYPH_DEBUG
image_cache_refcount = FRAME_X_IMAGE_CACHE (f)->refcount;
dpyinfo_refcount = dpyinfo->reference_count;
@@ -2660,7 +2659,7 @@ This function is an internal primitive--use `make-frame' instead. */)
{
Lisp_Object font;
- font = mac_get_arg (parameters, Qfont, "font", "Font", RES_TYPE_STRING);
+ font = mac_get_arg (parms, Qfont, "font", "Font", RES_TYPE_STRING);
BLOCK_INPUT;
/* First, try whatever font the caller has specified. */
@@ -2668,10 +2667,11 @@ This function is an internal primitive--use `make-frame' instead. */)
{
tem = Fquery_fontset (font, Qnil);
if (STRINGP (tem))
- font = x_new_fontset (f, SDATA (tem));
+ font = x_new_fontset (f, tem);
else
font = x_new_font (f, SDATA (font));
}
+
/* Try out a font which we hope has bold and italic variations. */
#if USE_ATSUI
if (! STRINGP (font))
@@ -2681,7 +2681,7 @@ This function is an internal primitive--use `make-frame' instead. */)
font = x_new_font (f, "-ETL-fixed-medium-r-*--*-160-*-*-*-*-iso8859-1");
/* If those didn't work, look for something which will at least work. */
if (! STRINGP (font))
- font = x_new_fontset (f, "fontset-standard");
+ font = x_new_fontset (f, build_string ("fontset-standard"));
if (! STRINGP (font))
font = x_new_font (f, "-*-monaco-*-12-*-mac-roman");
if (! STRINGP (font))
@@ -2690,50 +2690,48 @@ This function is an internal primitive--use `make-frame' instead. */)
error ("Cannot find any usable font");
UNBLOCK_INPUT;
- x_default_parameter (f, parameters, Qfont, font,
- "font", "Font", RES_TYPE_STRING);
+ x_set_frame_parameters (f, Fcons (Fcons (Qfont, font), Qnil));
}
- /* XXX Shouldn't this be borderWidth, not borderwidth ?*/
- x_default_parameter (f, parameters, Qborder_width, make_number (0),
+ x_default_parameter (f, parms, Qborder_width, make_number (0),
"borderwidth", "BorderWidth", RES_TYPE_NUMBER);
/* This defaults to 2 in order to match xterm. We recognize either
internalBorderWidth or internalBorder (which is what xterm calls
it). */
- if (NILP (Fassq (Qinternal_border_width, parameters)))
+ if (NILP (Fassq (Qinternal_border_width, parms)))
{
Lisp_Object value;
- value = mac_get_arg (parameters, Qinternal_border_width,
+ value = mac_get_arg (parms, Qinternal_border_width,
"internalBorder", "InternalBorder", RES_TYPE_NUMBER);
if (! EQ (value, Qunbound))
- parameters = Fcons (Fcons (Qinternal_border_width, value),
- parameters);
+ parms = Fcons (Fcons (Qinternal_border_width, value),
+ parms);
}
/* Default internalBorderWidth to 0 on Windows to match other programs. */
- x_default_parameter (f, parameters, Qinternal_border_width, make_number (0),
+ x_default_parameter (f, parms, Qinternal_border_width, make_number (0),
"internalBorderWidth", "InternalBorder", RES_TYPE_NUMBER);
- x_default_parameter (f, parameters, Qvertical_scroll_bars, Qright,
+ x_default_parameter (f, parms, Qvertical_scroll_bars, Qright,
"verticalScrollBars", "ScrollBars", RES_TYPE_SYMBOL);
/* Also do the stuff which must be set before the window exists. */
- x_default_parameter (f, parameters, Qforeground_color, build_string ("black"),
+ x_default_parameter (f, parms, Qforeground_color, build_string ("black"),
"foreground", "Foreground", RES_TYPE_STRING);
- x_default_parameter (f, parameters, Qbackground_color, build_string ("white"),
+ x_default_parameter (f, parms, Qbackground_color, build_string ("white"),
"background", "Background", RES_TYPE_STRING);
- x_default_parameter (f, parameters, Qmouse_color, build_string ("black"),
+ x_default_parameter (f, parms, Qmouse_color, build_string ("black"),
"pointerColor", "Foreground", RES_TYPE_STRING);
- x_default_parameter (f, parameters, Qcursor_color, build_string ("black"),
+ x_default_parameter (f, parms, Qcursor_color, build_string ("black"),
"cursorColor", "Foreground", RES_TYPE_STRING);
- x_default_parameter (f, parameters, Qborder_color, build_string ("black"),
+ x_default_parameter (f, parms, Qborder_color, build_string ("black"),
"borderColor", "BorderColor", RES_TYPE_STRING);
- x_default_parameter (f, parameters, Qscreen_gamma, Qnil,
+ x_default_parameter (f, parms, Qscreen_gamma, Qnil,
"screenGamma", "ScreenGamma", RES_TYPE_FLOAT);
- x_default_parameter (f, parameters, Qline_spacing, Qnil,
+ x_default_parameter (f, parms, Qline_spacing, Qnil,
"lineSpacing", "LineSpacing", RES_TYPE_NUMBER);
- x_default_parameter (f, parameters, Qleft_fringe, Qnil,
+ x_default_parameter (f, parms, Qleft_fringe, Qnil,
"leftFringe", "LeftFringe", RES_TYPE_NUMBER);
- x_default_parameter (f, parameters, Qright_fringe, Qnil,
+ x_default_parameter (f, parms, Qright_fringe, Qnil,
"rightFringe", "RightFringe", RES_TYPE_NUMBER);
@@ -2745,29 +2743,29 @@ This function is an internal primitive--use `make-frame' instead. */)
happen. */
init_frame_faces (f);
- x_default_parameter (f, parameters, Qmenu_bar_lines, make_number (1),
+ x_default_parameter (f, parms, Qmenu_bar_lines, make_number (1),
"menuBar", "MenuBar", RES_TYPE_NUMBER);
- x_default_parameter (f, parameters, Qtool_bar_lines, make_number (1),
- "toolBar", "ToolBar", RES_TYPE_NUMBER);
-
- x_default_parameter (f, parameters, Qbuffer_predicate, Qnil,
- "bufferPredicate", "BufferPredicate", RES_TYPE_SYMBOL);
- x_default_parameter (f, parameters, Qtitle, Qnil,
+ x_default_parameter (f, parms, Qtool_bar_lines, make_number (1),
+ "toolBar", "ToolBar", RES_TYPE_NUMBER);
+ x_default_parameter (f, parms, Qbuffer_predicate, Qnil,
+ "bufferPredicate", "BufferPredicate",
+ RES_TYPE_SYMBOL);
+ x_default_parameter (f, parms, Qtitle, Qnil,
"title", "Title", RES_TYPE_STRING);
- x_default_parameter (f, parameters, Qfullscreen, Qnil,
+ x_default_parameter (f, parms, Qfullscreen, Qnil,
"fullscreen", "Fullscreen", RES_TYPE_SYMBOL);
f->output_data.mac->parent_desc = FRAME_MAC_DISPLAY_INFO (f)->root_window;
/* Compute the size of the window. */
- window_prompting = x_figure_window_size (f, parameters, 1);
+ window_prompting = x_figure_window_size (f, parms, 1);
- tem = mac_get_arg (parameters, Qunsplittable, 0, 0, RES_TYPE_BOOLEAN);
+ tem = mac_get_arg (parms, Qunsplittable, 0, 0, RES_TYPE_BOOLEAN);
f->no_split = minibuffer_only || EQ (tem, Qt);
- mac_window (f, window_prompting, minibuffer_only);
- x_icon (f, parameters);
+ mac_window (f);
+ x_icon (f, parms);
x_make_gc (f);
/* Now consider the frame official. */
@@ -2776,17 +2774,18 @@ This function is an internal primitive--use `make-frame' instead. */)
/* We need to do this after creating the window, so that the
icon-creation functions can say whose icon they're describing. */
- x_default_parameter (f, parameters, Qicon_type, Qnil,
+ x_default_parameter (f, parms, Qicon_type, Qnil,
"bitmapIcon", "BitmapIcon", RES_TYPE_SYMBOL);
- x_default_parameter (f, parameters, Qauto_raise, Qnil,
+ x_default_parameter (f, parms, Qauto_raise, Qnil,
"autoRaise", "AutoRaiseLower", RES_TYPE_BOOLEAN);
- x_default_parameter (f, parameters, Qauto_lower, Qnil,
+ x_default_parameter (f, parms, Qauto_lower, Qnil,
"autoLower", "AutoRaiseLower", RES_TYPE_BOOLEAN);
- x_default_parameter (f, parameters, Qcursor_type, Qbox,
+ x_default_parameter (f, parms, Qcursor_type, Qbox,
"cursorType", "CursorType", RES_TYPE_SYMBOL);
- x_default_parameter (f, parameters, Qscroll_bar_width, Qnil,
- "scrollBarWidth", "ScrollBarWidth", RES_TYPE_NUMBER);
+ x_default_parameter (f, parms, Qscroll_bar_width, Qnil,
+ "scrollBarWidth", "ScrollBarWidth",
+ RES_TYPE_NUMBER);
/* Dimensions, especially FRAME_LINES (f), must be done via change_frame_size.
Change will not be effected unless different from the current
@@ -2794,8 +2793,8 @@ This function is an internal primitive--use `make-frame' instead. */)
width = FRAME_COLS (f);
height = FRAME_LINES (f);
- FRAME_LINES (f) = 0;
SET_FRAME_COLS (f, 0);
+ FRAME_LINES (f) = 0;
change_frame_size (f, height, width, 1, 0, 0);
/* Tell the server what size and position, etc, we want, and how
@@ -2812,7 +2811,7 @@ This function is an internal primitive--use `make-frame' instead. */)
{
Lisp_Object visibility;
- visibility = mac_get_arg (parameters, Qvisibility, 0, 0, RES_TYPE_SYMBOL);
+ visibility = mac_get_arg (parms, Qvisibility, 0, 0, RES_TYPE_SYMBOL);
if (EQ (visibility, Qunbound))
visibility = Qt;
@@ -2834,12 +2833,10 @@ This function is an internal primitive--use `make-frame' instead. */)
/* All remaining specified parameters, which have not been "used"
by x_get_arg and friends, now go in the misc. alist of the frame. */
- for (tem = parameters; !NILP (tem); tem = XCDR (tem))
+ for (tem = parms; !NILP (tem); tem = XCDR (tem))
if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem))))
f->param_alist = Fcons (XCAR (tem), f->param_alist);
- store_frame_param (f, Qwindow_system, Qmac);
-
UNGCPRO;
/* Make sure windows on this frame appear in calls to next-window
@@ -3302,6 +3299,9 @@ x_display_info_for_name (name)
CHECK_STRING (name);
+ if (! EQ (Vwindow_system, intern ("mac")))
+ error ("Not using Mac native windows");
+
for (dpyinfo = &one_mac_display_info, names = x_display_name_list;
dpyinfo;
dpyinfo = dpyinfo->next, names = XCDR (names))
@@ -3346,6 +3346,9 @@ terminate Emacs if we can't open the connection. */)
if (! NILP (xrm_string))
CHECK_STRING (xrm_string);
+ if (! EQ (Vwindow_system, intern ("mac")))
+ error ("Not using Mac native windows");
+
if (! NILP (xrm_string))
xrm_option = (unsigned char *) SDATA (xrm_string);
else
@@ -3608,6 +3611,10 @@ start_hourglass ()
EMACS_TIME delay;
int secs, usecs = 0;
+ /* Don't bother for ttys. */
+ if (NILP (Vwindow_system))
+ return;
+
cancel_hourglass ();
if (INTEGERP (Vhourglass_delay)
@@ -3820,7 +3827,7 @@ x_create_tip_frame (dpyinfo, parms, text)
parms = Fcopy_alist (parms);
#ifdef MULTI_KBOARD
- kb = dpyinfo->terminal->kboard;
+ kb = dpyinfo->kboard;
#else
kb = &the_only_kboard;
#endif
@@ -3901,7 +3908,7 @@ x_create_tip_frame (dpyinfo, parms, text)
{
tem = Fquery_fontset (font, Qnil);
if (STRINGP (tem))
- font = x_new_fontset (f, SDATA (tem));
+ font = x_new_fontset (f, tem);
else
font = x_new_font (f, SDATA (font));
}
@@ -3915,7 +3922,7 @@ x_create_tip_frame (dpyinfo, parms, text)
font = x_new_font (f, "-ETL-fixed-medium-r-*--*-160-*-*-*-*-iso8859-1");
/* If those didn't work, look for something which will at least work. */
if (! STRINGP (font))
- font = x_new_fontset (f, "fontset-standard");
+ font = x_new_fontset (f, build_string ("fontset-standard"));
if (! STRINGP (font))
font = x_new_font (f, "-*-monaco-*-12-*-mac-roman");
if (! STRINGP (font))
diff --git a/src/macgui.h b/src/macgui.h
index 7a65e583b1..3e3fed77c1 100644
--- a/src/macgui.h
+++ b/src/macgui.h
@@ -81,11 +81,13 @@ typedef unsigned long Time;
/* Whether to use ATSUI (Apple Type Services for Unicode Imaging) for
text drawing. */
+#if 0 /* Don't enable by default on the emacs-unicode-2 branch. */
#ifndef USE_ATSUI
#ifdef MAC_OSX
#define USE_ATSUI 1
#endif
#endif
+#endif
/* Whether to use low-level Quartz 2D (aka Core Graphics) text drawing
in preference to ATSUI for ASCII and Latin-1 characters. */
diff --git a/src/macmenu.c b/src/macmenu.c
index 8305c89ee6..883a8463c2 100644
--- a/src/macmenu.c
+++ b/src/macmenu.c
@@ -26,10 +26,10 @@ Boston, MA 02110-1301, USA. */
#include <stdio.h>
#include "lisp.h"
-#include "frame.h"
#include "termhooks.h"
#include "keyboard.h"
#include "keymap.h"
+#include "frame.h"
#include "window.h"
#include "blockinput.h"
#include "buffer.h"
@@ -720,8 +720,8 @@ no quit occurs and `x-popup-menu' returns nil. */)
enum scroll_bar_part part;
unsigned long time;
- if (FRAME_TERMINAL (new_f)->mouse_position_hook)
- (*FRAME_TERMINAL (new_f)->mouse_position_hook) (&new_f, 1, &bar_window,
+ if (mouse_position_hook)
+ (*mouse_position_hook) (&new_f, 1, &bar_window,
&part, &x, &y, &time);
if (new_f != 0)
XSETFRAME (window, new_f);
diff --git a/src/macterm.c b/src/macterm.c
index bfd7dca2c3..734bf52e18 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -80,6 +80,8 @@ Boston, MA 02110-1301, USA. */
#include "intervals.h"
#include "atimer.h"
#include "keymap.h"
+#include "character.h"
+#include "ccl.h"
@@ -226,14 +228,14 @@ void x_raise_frame P_ ((struct frame *));
void x_set_window_size P_ ((struct frame *, int, int, int));
void x_wm_set_window_state P_ ((struct frame *, int));
void x_wm_set_icon_pixmap P_ ((struct frame *, int));
-static void mac_initialize P_ ((void));
+void mac_initialize P_ ((void));
static void x_font_min_bounds P_ ((XFontStruct *, int *, int *));
static int x_compute_min_glyph_bounds P_ ((struct frame *));
static void x_update_end P_ ((struct frame *));
static void XTframe_up_to_date P_ ((struct frame *));
-static void XTset_terminal_modes P_ ((struct terminal *));
-static void XTreset_terminal_modes P_ ((struct terminal *));
-static void x_clear_frame P_ ((struct frame *));
+static void XTset_terminal_modes P_ ((void));
+static void XTreset_terminal_modes P_ ((void));
+static void x_clear_frame P_ ((void));
static void frame_highlight P_ ((struct frame *));
static void frame_unhighlight P_ ((struct frame *));
static void x_new_focus_frame P_ ((struct x_display_info *, struct frame *));
@@ -261,8 +263,6 @@ static void x_scroll_bar_report_motion P_ ((struct frame **, Lisp_Object *,
static int is_emacs_window P_ ((WindowRef));
static XCharStruct *mac_per_char_metric P_ ((XFontStruct *, XChar2b *, int));
static void XSetFont P_ ((Display *, GC, XFontStruct *));
-static struct terminal *mac_create_terminal P_ ((struct mac_display_info *dpyinfo));
-
#define GC_FORE_COLOR(gc) (&(gc)->fore_color)
#define GC_BACK_COLOR(gc) (&(gc)->back_color)
@@ -2360,9 +2360,6 @@ mac_define_fringe_bitmap (which, bits, h, wd)
for (i = 0; i < h; i++)
bits[i] = ~bits[i];
-
- BLOCK_INPUT;
-
provider = CGDataProviderCreateWithData (NULL, bits,
sizeof (unsigned short) * h, NULL);
if (provider)
@@ -2372,8 +2369,6 @@ mac_define_fringe_bitmap (which, bits, h, wd)
provider, NULL, 0);
CGDataProviderRelease (provider);
}
-
- UNBLOCK_INPUT;
}
static void
@@ -2384,11 +2379,7 @@ mac_destroy_fringe_bitmap (which)
return;
if (fringe_bmp[which])
- {
- BLOCK_INPUT;
- CGImageRelease (fringe_bmp[which]);
- UNBLOCK_INPUT;
- }
+ CGImageRelease (fringe_bmp[which]);
fringe_bmp[which] = 0;
}
#endif
@@ -2400,7 +2391,7 @@ mac_destroy_fringe_bitmap (which)
rarely happens). */
static void
-XTset_terminal_modes (struct terminal *t)
+XTset_terminal_modes ()
{
}
@@ -2408,7 +2399,7 @@ XTset_terminal_modes (struct terminal *t)
the windows go away, and suspending requires no action. */
static void
-XTreset_terminal_modes (struct terminal *t)
+XTreset_terminal_modes ()
{
}
@@ -2421,7 +2412,8 @@ XTreset_terminal_modes (struct terminal *t)
/* Function prototypes of this page. */
static XCharStruct *x_per_char_metric P_ ((XFontStruct *, XChar2b *));
-static int mac_encode_char P_ ((int, XChar2b *, struct font_info *, int *));
+static int mac_encode_char P_ ((int, XChar2b *, struct font_info *,
+ struct charset *, int *));
static void
@@ -2565,13 +2557,13 @@ mac_per_char_metric (font, char2b, font_type)
the two-byte form of C. Encoding is returned in *CHAR2B. */
static int
-mac_encode_char (c, char2b, font_info, two_byte_p)
+mac_encode_char (c, char2b, font_info, charset, two_byte_p)
int c;
XChar2b *char2b;
struct font_info *font_info;
+ struct charset *charset;
int *two_byte_p;
{
- int charset = CHAR_CHARSET (c);
XFontStruct *font = font_info->font;
/* FONT_INFO may define a scheme by which to encode byte1 and byte2.
@@ -2585,31 +2577,31 @@ mac_encode_char (c, char2b, font_info, two_byte_p)
check_ccl_update (ccl);
if (CHARSET_DIMENSION (charset) == 1)
{
- ccl->reg[0] = charset;
- ccl->reg[1] = char2b->byte2;
+ ccl->reg[0] = CHARSET_ID (charset);
+ ccl->reg[1] = XCHAR2B_BYTE2 (char2b);
ccl->reg[2] = -1;
}
else
{
- ccl->reg[0] = charset;
- ccl->reg[1] = char2b->byte1;
- ccl->reg[2] = char2b->byte2;
+ ccl->reg[0] = CHARSET_ID (charset);
+ ccl->reg[1] = XCHAR2B_BYTE1 (char2b);
+ ccl->reg[2] = XCHAR2B_BYTE2 (char2b);
}
- ccl_driver (ccl, NULL, NULL, 0, 0, NULL);
+ ccl_driver (ccl, NULL, NULL, 0, 0, Qnil);
/* We assume that MSBs are appropriately set/reset by CCL
program. */
if (font->max_byte1 == 0) /* 1-byte font */
- char2b->byte1 = 0, char2b->byte2 = ccl->reg[1];
+ STORE_XCHAR2B (char2b, 0, ccl->reg[1]);
else
- char2b->byte1 = ccl->reg[1], char2b->byte2 = ccl->reg[2];
+ STORE_XCHAR2B (char2b, ccl->reg[1], ccl->reg[2]);
}
- else if (font_info->encoding[charset])
+ else if (font_info->encoding_type)
{
/* Fixed encoding scheme. See fontset.h for the meaning of the
encoding numbers. */
- int enc = font_info->encoding[charset];
+ unsigned char enc = font_info->encoding_type;
if ((enc == 1 || enc == 2)
&& CHARSET_DIMENSION (charset) == 2)
@@ -2619,13 +2611,12 @@ mac_encode_char (c, char2b, font_info, two_byte_p)
char2b->byte2 |= 0x80;
if (enc == 4)
- {
- int sjis1, sjis2;
+ {
+ int code = (char2b->byte1 << 8) | char2b->byte2;
- ENCODE_SJIS (char2b->byte1, char2b->byte2, sjis1, sjis2);
- char2b->byte1 = sjis1;
- char2b->byte2 = sjis2;
- }
+ JIS_TO_SJIS (code);
+ STORE_XCHAR2B (char2b, (code >> 8), (code & 0xFF));
+ }
}
if (two_byte_p)
@@ -2744,9 +2735,9 @@ x_set_mouse_face_gc (s)
face = FACE_FROM_ID (s->f, MOUSE_FACE_ID);
if (s->first_glyph->type == CHAR_GLYPH)
- face_id = FACE_FOR_CHAR (s->f, face, s->first_glyph->u.ch);
+ face_id = FACE_FOR_CHAR (s->f, face, s->first_glyph->u.ch, -1, Qnil);
else
- face_id = FACE_FOR_CHAR (s->f, face, 0);
+ face_id = FACE_FOR_CHAR (s->f, face, 0, -1, Qnil);
s->face = FACE_FROM_ID (s->f, face_id);
PREPARE_FACE_FOR_DISPLAY (s->f, s->face);
@@ -3109,8 +3100,8 @@ x_frame_of_widget (widget)
/* Look for a frame with that top-level widget. Allocate the color
on that frame to get the right gamma correction value. */
- for (tail = Vframe_list; GC_CONSP (tail); tail = XCDR (tail))
- if (GC_FRAMEP (XCAR (tail))
+ for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
+ if (FRAMEP (XCAR (tail))
&& (f = XFRAME (XCAR (tail)),
(f->output_data.nothing != 1
&& FRAME_X_DISPLAY_INFO (f) == dpyinfo))
@@ -4058,8 +4049,15 @@ x_delete_glyphs (n)
frame. Otherwise clear the selected frame. */
static void
-x_clear_frame (struct frame *f)
+x_clear_frame ()
{
+ struct frame *f;
+
+ if (updating_frame)
+ f = updating_frame;
+ else
+ f = SELECTED_FRAME ();
+
/* Clearing the frame will erase any cursor, so mark them all as no
longer visible. */
mark_window_cursors_off (XWINDOW (FRAME_ROOT_WINDOW (f)));
@@ -4419,9 +4417,9 @@ mac_focus_changed (type, dpyinfo, frame, bufp)
/* Don't stop displaying the initial startup message
for a switch-frame event we don't need. */
- if (GC_NILP (Vterminal_frame)
- && GC_CONSP (Vframe_list)
- && !GC_NILP (XCDR (Vframe_list)))
+ if (NILP (Vterminal_frame)
+ && CONSP (Vframe_list)
+ && !NILP (XCDR (Vframe_list)))
{
bufp->kind = FOCUS_IN_EVENT;
XSETFRAME (bufp->frame_or_window, frame);
@@ -4494,7 +4492,7 @@ x_frame_rehighlight (dpyinfo)
if (dpyinfo->x_focus_frame)
{
dpyinfo->x_highlight_frame
- = ((GC_FRAMEP (FRAME_FOCUS_FRAME (dpyinfo->x_focus_frame)))
+ = ((FRAMEP (FRAME_FOCUS_FRAME (dpyinfo->x_focus_frame)))
? XFRAME (FRAME_FOCUS_FRAME (dpyinfo->x_focus_frame))
: dpyinfo->x_focus_frame);
if (! FRAME_LIVE_P (dpyinfo->x_highlight_frame))
@@ -4577,7 +4575,7 @@ note_mouse_movement (frame, pos)
clear_mouse_face (dpyinfo);
dpyinfo->mouse_face_mouse_frame = 0;
if (!dpyinfo->grabbed)
- FRAME_RIF (frame)->define_frame_cursor (frame,
+ rif->define_frame_cursor (frame,
frame->output_data.mac->nontext_cursor);
}
@@ -5524,7 +5522,7 @@ x_scroll_bar_handle_click (bar, part_code, er, bufp)
{
int win_y, top_range;
- if (! GC_WINDOWP (bar->window))
+ if (! WINDOWP (bar->window))
abort ();
bufp->kind = SCROLL_BAR_CLICK_EVENT;
@@ -5599,7 +5597,7 @@ x_scroll_bar_note_movement (bar, y_pos, t)
XSETVECTOR (last_mouse_scroll_bar, bar);
/* If we're dragging the bar, display it. */
- if (! GC_NILP (bar->dragging))
+ if (! NILP (bar->dragging))
{
/* Where should the handle be now? */
int new_start = y_pos - 24;
@@ -6558,11 +6556,16 @@ x_new_font (f, fontname)
register char *fontname;
{
struct font_info *fontp
- = FS_LOAD_FONT (f, 0, fontname, -1);
+ = FS_LOAD_FONT (f, fontname);
if (!fontp)
return Qnil;
+ if (FRAME_FONT (f) == (XFontStruct *) (fontp->font))
+ /* This font is already set in frame F. There's nothing more to
+ do. */
+ return build_string (fontp->full_name);
+
FRAME_FONT (f) = (XFontStruct *) (fontp->font);
FRAME_BASELINE_OFFSET (f) = fontp->baseline_offset;
FRAME_FONTSET (f) = -1;
@@ -6605,38 +6608,50 @@ x_new_font (f, fontname)
return build_string (fontp->full_name);
}
+
+/* Give frame F the fontset named FONTSETNAME as its default fontset,
+ and return the full name of that fontset. FONTSETNAME may be a
+ wildcard pattern; in that case, we choose some fontset that fits
+ the pattern. FONTSETNAME may be a font name for ASCII characters;
+ in that case, we create a fontset from that font name.
-/* Give frame F the fontset named FONTSETNAME as its default font, and
- return the full name of that fontset. FONTSETNAME may be a wildcard
- pattern; in that case, we choose some fontset that fits the pattern.
- The return value shows which fontset we chose. */
+ The return value shows which fontset we chose.
+ If FONTSETNAME specifies the default fontset, return Qt.
+ If an ASCII font in the specified fontset can't be loaded, return
+ Qnil. */
Lisp_Object
x_new_fontset (f, fontsetname)
struct frame *f;
- char *fontsetname;
+ Lisp_Object fontsetname;
{
- int fontset = fs_query_fontset (build_string (fontsetname), 0);
+ int fontset = fs_query_fontset (fontsetname, 0);
Lisp_Object result;
- if (fontset < 0)
- return Qnil;
-
- if (FRAME_FONTSET (f) == fontset)
+ if (fontset > 0 && FRAME_FONTSET(f) == fontset)
/* This fontset is already set in frame F. There's nothing more
to do. */
return fontset_name (fontset);
+ else if (fontset == 0)
+ /* The default fontset can't be the default font. */
+ return Qt;
- result = x_new_font (f, (SDATA (fontset_ascii (fontset))));
+ if (fontset > 0)
+ result = x_new_font (f, (SDATA (fontset_ascii (fontset))));
+ else
+ result = x_new_font (f, SDATA (fontsetname));
if (!STRINGP (result))
/* Can't load ASCII font. */
return Qnil;
+ if (fontset < 0)
+ fontset = new_fontset_from_font_name (result);
+
/* Since x_new_font doesn't update any fontset information, do it now. */
FRAME_FONTSET (f) = fontset;
- return build_string (fontsetname);
+ return fontset_name (fontset);
}
@@ -7850,12 +7865,12 @@ decode_mac_font_name (name, size, coding_system)
coding.src_multibyte = 0;
coding.dst_multibyte = 1;
coding.mode |= CODING_MODE_LAST_BLOCK;
- coding.composing = COMPOSITION_DISABLED;
- buf = (char *) alloca (size);
+ coding.dst_bytes = size;
+ coding.destination = (unsigned char *) alloca (coding.dst_bytes);
- decode_coding (&coding, name, buf, strlen (name), size - 1);
- bcopy (buf, name, coding.produced);
- name[coding.produced] = '\0';
+ decode_coding_c_string (&coding, name, strlen (name), Qnil);
+ bcopy (coding.destination, name, min (coding.produced, size));
+ name[min (coding.produced, size)] = '\0';
}
}
@@ -8766,7 +8781,7 @@ mac_load_query_font (f, fontname)
font_id = atsu_find_font_from_family_name (family);
if (font_id == kATSUInvalidFontID)
- return NULL;
+ return;
size_fixed = Long2Fix (size);
bold_p = (fontface & bold) != 0;
italic_p = (fontface & italic) != 0;
@@ -9192,6 +9207,7 @@ x_load_font (f, fontname, size)
bzero (fontp, sizeof (*fontp));
fontp->font = font;
fontp->font_idx = i;
+ fontp->charset = -1; /* fs_load_font sets it. */
fontp->name = (char *) xmalloc (strlen (fontname) + 1);
bcopy (fontname, fontp->name, strlen (fontname) + 1);
@@ -9237,19 +9253,20 @@ x_load_font (f, fontname, size)
fontp->height = max_height;
}
+ /* MAC_TODO: The script encoding is irrelevant in unicode? */
/* The slot `encoding' specifies how to map a character
code-points (0x20..0x7F or 0x2020..0x7F7F) of each charset to
the font code-points (0:0x20..0x7F, 1:0xA0..0xFF), or
(0:0x2020..0x7F7F, 1:0xA0A0..0xFFFF, 3:0x20A0..0x7FFF,
2:0xA020..0xFF7F). For the moment, we don't know which charset
- uses this font. So, we set information in fontp->encoding[1]
+ uses this font. So, we set information in fontp->encoding_type
which is never used by any charset. If mapping can't be
decided, set FONT_ENCODING_NOT_DECIDED. */
if (font->mac_scriptcode == smJapanese)
- fontp->encoding[1] = 4;
+ fontp->encoding_type = 4;
else
{
- fontp->encoding[1]
+ fontp->encoding_type
= (font->max_byte1 == 0
/* 1-byte font */
? (font->min_char_or_byte2 < 0x80
@@ -12157,13 +12174,7 @@ XTread_socket (sd, expected, hold_quit)
will be selected only when it is active. */
if (WINDOWP (window)
&& !EQ (window, last_window)
- && !EQ (window, selected_window)
- /* For click-to-focus window managers
- create event iff we don't leave the
- selected frame. */
- && (focus_follows_mouse
- || (EQ (XWINDOW (window)->frame,
- XWINDOW (selected_window)->frame))))
+ && !EQ (window, selected_window))
{
inev.kind = SELECT_WINDOW_EVENT;
inev.frame_or_window = window;
@@ -12541,7 +12552,6 @@ mac_term_init (display_name, xrm_option, resource_name)
char *resource_name;
{
struct mac_display_info *dpyinfo;
- struct terminal *terminal;
BLOCK_INPUT;
@@ -12557,13 +12567,6 @@ mac_term_init (display_name, xrm_option, resource_name)
dpyinfo = &one_mac_display_info;
bzero (dpyinfo, sizeof (*dpyinfo));
- terminal = mac_create_terminal (dpyinfo);
-
- /* Set the name of the terminal. */
- terminal->name = (char *) xmalloc (SBYTES (display_name) + 1);
- strncpy (terminal->name, SDATA (display_name), SBYTES (display_name));
- terminal->name[SBYTES (display_name)] = 0;
-
#ifdef MAC_OSX
dpyinfo->mac_id_name
= (char *) xmalloc (SCHARS (Vinvocation_name)
@@ -12605,10 +12608,6 @@ mac_term_init (display_name, xrm_option, resource_name)
x_display_name_list);
dpyinfo->name_list_element = XCAR (x_display_name_list);
-#if USE_CG_DRAWING
- mac_init_fringe (terminal->rif);
-#endif
-
UNBLOCK_INPUT;
return dpyinfo;
@@ -12769,72 +12768,44 @@ static struct redisplay_interface x_redisplay_interface =
mac_shift_glyphs_for_insert
};
-static struct terminal *
-mac_create_terminal (struct mac_display_info *dpyinfo)
-{
- struct terminal *terminal;
-
- terminal = create_terminal ();
-
- terminal->type = output_mac;
- terminal->display_info.mac = dpyinfo;
- dpyinfo->terminal = terminal;
-
- terminal->clear_frame_hook = x_clear_frame;
- terminal->ins_del_lines_hook = x_ins_del_lines;
- terminal->delete_glyphs_hook = x_delete_glyphs;
- terminal->ring_bell_hook = XTring_bell;
- terminal->reset_terminal_modes_hook = XTreset_terminal_modes;
- terminal->set_terminal_modes_hook = XTset_terminal_modes;
- terminal->update_begin_hook = x_update_begin;
- terminal->update_end_hook = x_update_end;
- terminal->set_terminal_window_hook = XTset_terminal_window;
- terminal->read_socket_hook = XTread_socket;
- terminal->frame_up_to_date_hook = XTframe_up_to_date;
- terminal->mouse_position_hook = XTmouse_position;
- terminal->frame_rehighlight_hook = XTframe_rehighlight;
- terminal->frame_raise_lower_hook = XTframe_raise_lower;
- /* terminal->fullscreen_hook = XTfullscreen_hook; */
- terminal->set_vertical_scroll_bar_hook = XTset_vertical_scroll_bar;
- terminal->condemn_scroll_bars_hook = XTcondemn_scroll_bars;
- terminal->redeem_scroll_bar_hook = XTredeem_scroll_bar;
- terminal->judge_scroll_bars_hook = XTjudge_scroll_bars;
- terminal->delete_frame_hook = x_destroy_window;
- /* terminal->delete_terminal_hook = x_delete_terminal; */
-
- terminal->rif = &x_redisplay_interface;
-#if 0
- TTY_SCROLL_REGION_OK (CURTTY ()) = 1; /* we'll scroll partial frames */
- TTY_CHAR_INS_DEL_OK (CURTTY ()) = 1;
- TTY_LINE_INS_DEL_OK (CURTTY ()) = 1; /* we'll just blt 'em */
- TTY_FAST_CLEAR_END_OF_LINE (CURTTY ()) = 1; /* X does this well */
- TTY_MEMORY_BELOW_FRAME (CURTTY ()) = 0; /* we don't remember what
- scrolls off the
- bottom */
-#else
- terminal->scroll_region_ok = 1; /* We'll scroll partial frames. */
- terminal->char_ins_del_ok = 1;
- terminal->line_ins_del_ok = 1; /* We'll just blt 'em. */
- terminal->fast_clear_end_of_line = 1; /* X does this well. */
- terminal->memory_below_frame = 0; /* We don't remember what scrolls
- off the bottom. */
-
-#endif
-
- return terminal;
-}
-
-static void
+void
mac_initialize ()
{
-
+ rif = &x_redisplay_interface;
+
+ clear_frame_hook = x_clear_frame;
+ ins_del_lines_hook = x_ins_del_lines;
+ delete_glyphs_hook = x_delete_glyphs;
+ ring_bell_hook = XTring_bell;
+ reset_terminal_modes_hook = XTreset_terminal_modes;
+ set_terminal_modes_hook = XTset_terminal_modes;
+ update_begin_hook = x_update_begin;
+ update_end_hook = x_update_end;
+ set_terminal_window_hook = XTset_terminal_window;
+ read_socket_hook = XTread_socket;
+ frame_up_to_date_hook = XTframe_up_to_date;
+ mouse_position_hook = XTmouse_position;
+ frame_rehighlight_hook = XTframe_rehighlight;
+ frame_raise_lower_hook = XTframe_raise_lower;
+
+ set_vertical_scroll_bar_hook = XTset_vertical_scroll_bar;
+ condemn_scroll_bars_hook = XTcondemn_scroll_bars;
+ redeem_scroll_bar_hook = XTredeem_scroll_bar;
+ judge_scroll_bars_hook = XTjudge_scroll_bars;
+
+ scroll_region_ok = 1; /* we'll scroll partial frames */
+ char_ins_del_ok = 1;
+ line_ins_del_ok = 1; /* we'll just blt 'em */
+ fast_clear_end_of_line = 1; /* X does this well */
+ memory_below_frame = 0; /* we don't remember what scrolls
+ off the bottom */
baud_rate = 19200;
last_tool_bar_item = -1;
any_help_event_p = 0;
/* Try to use interrupt input; if we can't, then start polling. */
- Fset_input_interrupt_mode (Qt);
+ Fset_input_mode (Qt, Qnil, Qt, Qnil);
BLOCK_INPUT;
@@ -12866,10 +12837,11 @@ mac_initialize ()
#if USE_CG_DRAWING
init_cg_color ();
+
+ mac_init_fringe ();
#endif
UNBLOCK_INPUT;
-
}
diff --git a/src/macterm.h b/src/macterm.h
index f319adeb65..8a85e714ab 100644
--- a/src/macterm.h
+++ b/src/macterm.h
@@ -64,9 +64,6 @@ struct mac_display_info
/* Chain of all mac_display_info structures. */
struct mac_display_info *next;
- /* The generic display parameters corresponding to this X display. */
- struct terminal *terminal;
-
/* This is a cons cell of the form (NAME . FONT-LIST-CACHE).
The same cons cell also appears in x_display_name_list. */
Lisp_Object name_list_element;
@@ -361,6 +358,9 @@ typedef struct mac_output mac_output;
#define FRAME_MAC_WINDOW(f) ((f)->output_data.mac->window_desc)
#define FRAME_X_WINDOW(f) ((f)->output_data.mac->window_desc)
+#define FRAME_FOREGROUND_PIXEL(f) ((f)->output_data.x->foreground_pixel)
+#define FRAME_BACKGROUND_PIXEL(f) ((f)->output_data.x->background_pixel)
+
#define FRAME_FONT(f) ((f)->output_data.mac->font)
#define FRAME_FONTSET(f) ((f)->output_data.mac->fontset)
@@ -636,6 +636,7 @@ extern void x_free_frame_resources P_ ((struct frame *));
extern void x_destroy_window P_ ((struct frame *));
extern void x_wm_set_size_hint P_ ((struct frame *, long, int));
extern void x_delete_display P_ ((struct x_display_info *));
+extern void mac_initialize P_ ((void));
extern Pixmap XCreatePixmap P_ ((Display *, WindowRef, unsigned int,
unsigned int, unsigned int));
extern Pixmap XCreatePixmapFromBitmapData P_ ((Display *, WindowRef, char *,
diff --git a/src/makefile.w32-in b/src/makefile.w32-in
index dd70de6fea..df42d0a08d 100644
--- a/src/makefile.w32-in
+++ b/src/makefile.w32-in
@@ -118,13 +118,15 @@ OBJ1 = $(BLD)/abbrev.$(O) \
$(BLD)/region-cache.$(O) \
$(BLD)/strftime.$(O) \
$(BLD)/charset.$(O) \
+ $(BLD)/character.$(O) \
+ $(BLD)/chartab.$(O) \
$(BLD)/coding.$(O) \
$(BLD)/category.$(O) \
$(BLD)/ccl.$(O) \
$(BLD)/fontset.$(O) \
$(BLD)/fringe.$(O) \
- $(BLD)/image.$(O) \
- $(BLD)/terminal.$(O)
+ $(BLD)/image.$(O)
+
WIN32OBJ = $(BLD)/w32term.$(O) \
$(BLD)/w32xfns.$(O) \
@@ -135,6 +137,12 @@ WIN32OBJ = $(BLD)/w32term.$(O) \
$(BLD)/w32reg.$(O) \
$(BLD)/w32bdf.$(O)
+FONTOBJ =
+ifdef USE_FONTBACKEND
+FONTOBJ = $(BLD)/font.$(O) \
+ $(BLD)/w32font.$(O)
+endif
+
LIBS = $(TLIB0) \
$(TLIB1) \
$(TLIBW32) \
@@ -148,7 +156,6 @@ LIBS = $(TLIB0) \
$(SHELL32) \
$(WINSPOOL) \
$(OLE32) \
- $(COMCTL32) \
$(libc)
#
@@ -174,10 +181,11 @@ temacs: stamp_BLD $(TEMACS)
$(TEMACS): $(TLIB0) $(TLIB1) $(TLIBW32) $(TLASTLIB) $(TOBJ) $(TRES) \
../nt/$(BLD)/addsection.exe
$(LINK) $(LINK_OUT)$(TEMACS_TMP) $(FULL_LINK_FLAGS) $(TOBJ) $(TRES) $(LIBS)
- "../nt/$(BLD)/addsection" "$(TEMACS_TMP)" "$(TEMACS)" EMHEAP 16
+ "../nt/$(BLD)/addsection" "$(TEMACS_TMP)" "$(TEMACS)" EMHEAP 20
echo $(OBJ0) > $(BLD)/buildobj.lst
echo $(OBJ1) >> $(BLD)/buildobj.lst
echo $(WIN32OBJ) >> $(BLD)/buildobj.lst
+ echo $(FONTOBJ) >> $(BLD)/buildobj.lst
bootstrap: bootstrap-emacs
@@ -226,7 +234,7 @@ $(TLIB0): $(OBJ0)
$(TLIB1): $(OBJ1)
- $(DEL) $@
$(AR) $(AR_OUT)$@ $(ALL_DEPS)
-$(TLIBW32): $(WIN32OBJ)
+$(TLIBW32): $(WIN32OBJ) $(FONTOBJ)
- $(DEL) $@
$(AR) $(AR_OUT)$@ $(ALL_DEPS)
@@ -277,6 +285,7 @@ $(BLD)/abbrev.$(O) : \
$(EMACS_ROOT)/src/m/intel386.h \
$(EMACS_ROOT)/src/config.h \
$(SRC)/buffer.h \
+ $(SRC)/character.h \
$(SRC)/charset.h \
$(SRC)/commands.h \
$(SRC)/dispextern.h \
@@ -292,6 +301,7 @@ $(BLD)/alloc.$(O) : \
$(EMACS_ROOT)/src/config.h \
$(SRC)/blockinput.h \
$(SRC)/buffer.h \
+ $(SRC)/character.h \
$(SRC)/charset.h \
$(SRC)/composite.h \
$(SRC)/dispextern.h \
@@ -374,6 +384,7 @@ $(BLD)/callproc.$(O) : \
$(EMACS_ROOT)/nt/inc/sys/file.h \
$(SRC)/buffer.h \
$(SRC)/ccl.h \
+ $(SRC)/character.h \
$(SRC)/charset.h \
$(SRC)/coding.h \
$(SRC)/commands.h \
@@ -382,8 +393,6 @@ $(BLD)/callproc.$(O) : \
$(SRC)/process.h \
$(SRC)/syssignal.h \
$(SRC)/systty.h \
- $(SRC)/frame.h \
- $(SRC)/termhooks.h \
$(SRC)/w32.h
$(BLD)/casefiddle.$(O) : \
@@ -392,6 +401,7 @@ $(BLD)/casefiddle.$(O) : \
$(EMACS_ROOT)/src/m/intel386.h \
$(EMACS_ROOT)/src/config.h \
$(SRC)/buffer.h \
+ $(SRC)/character.h \
$(SRC)/charset.h \
$(SRC)/commands.h \
$(SRC)/composite.h \
@@ -413,6 +423,7 @@ $(BLD)/category.$(O) : \
$(EMACS_ROOT)/src/config.h \
$(SRC)/buffer.h \
$(SRC)/category.h \
+ $(SRC)/character.h \
$(SRC)/charset.h \
$(SRC)/keymap.h
@@ -422,9 +433,22 @@ $(BLD)/ccl.$(O) : \
$(EMACS_ROOT)/src/m/intel386.h \
$(EMACS_ROOT)/src/config.h \
$(SRC)/ccl.h \
+ $(SRC)/character.h \
$(SRC)/charset.h \
$(SRC)/coding.h
+$(BLD)/character.$(O) : \
+ $(SRC)/character.c \
+ $(EMACS_ROOT)/src/s/ms-w32.h \
+ $(EMACS_ROOT)/src/m/intel386.h \
+ $(EMACS_ROOT)/src/config.h \
+ $(SRC)/buffer.h \
+ $(SRC)/character.h \
+ $(SRC)/charset.h \
+ $(SRC)/coding.h \
+ $(SRC)/composite.h \
+ $(SRC)/disptab.h
+
$(BLD)/charset.$(O) : \
$(SRC)/charset.c \
$(EMACS_ROOT)/src/s/ms-w32.h \
@@ -432,11 +456,20 @@ $(BLD)/charset.$(O) : \
$(EMACS_ROOT)/src/config.h \
$(SRC)/buffer.h \
$(SRC)/ccl.h \
+ $(SRC)/character.h \
$(SRC)/charset.h \
$(SRC)/coding.h \
$(SRC)/composite.h \
$(SRC)/disptab.h
+$(BLD)/chartab.$(O) : \
+ $(SRC)/chartab.c \
+ $(EMACS_ROOT)/src/s/ms-w32.h \
+ $(EMACS_ROOT)/src/m/intel386.h \
+ $(EMACS_ROOT)/src/config.h \
+ $(SRC)/charset.h \
+ $(SRC)/character.h
+
$(BLD)/cm.$(O) : \
$(SRC)/cm.c \
$(EMACS_ROOT)/src/s/ms-w32.h \
@@ -451,6 +484,7 @@ $(BLD)/cmds.$(O) : \
$(EMACS_ROOT)/src/m/intel386.h \
$(EMACS_ROOT)/src/config.h \
$(SRC)/buffer.h \
+ $(SRC)/character.h \
$(SRC)/charset.h \
$(SRC)/commands.h \
$(SRC)/dispextern.h \
@@ -468,13 +502,12 @@ $(BLD)/coding.$(O) : \
$(EMACS_ROOT)/src/config.h \
$(SRC)/buffer.h \
$(SRC)/ccl.h \
+ $(SRC)/character.h \
$(SRC)/charset.h \
$(SRC)/coding.h \
$(SRC)/composite.h \
$(SRC)/dispextern.h \
$(SRC)/intervals.h \
- $(SRC)/frame.h \
- $(SRC)/termhooks.h \
$(SRC)/w32bdf.h \
$(SRC)/w32gui.h \
$(SRC)/window.h
@@ -485,6 +518,7 @@ $(BLD)/composite.$(O) : \
$(EMACS_ROOT)/src/m/intel386.h \
$(EMACS_ROOT)/src/config.h \
$(SRC)/buffer.h \
+ $(SRC)/character.h \
$(SRC)/charset.h \
$(SRC)/composite.h \
$(SRC)/dispextern.h \
@@ -498,12 +532,12 @@ $(BLD)/data.$(O) : \
$(EMACS_ROOT)/src/m/intel386.h \
$(EMACS_ROOT)/src/config.h \
$(SRC)/buffer.h \
+ $(SRC)/character.h \
$(SRC)/charset.h \
$(SRC)/frame.h \
$(SRC)/keyboard.h \
$(SRC)/puresize.h \
- $(SRC)/syssignal.h \
- $(SRC)/termhooks.h
+ $(SRC)/syssignal.h
$(BLD)/dired.$(O) : \
$(SRC)/dired.c \
@@ -512,6 +546,7 @@ $(BLD)/dired.$(O) : \
$(EMACS_ROOT)/src/config.h \
$(SRC)/buffer.h \
$(SRC)/ccl.h \
+ $(SRC)/character.h \
$(SRC)/charset.h \
$(SRC)/coding.h \
$(SRC)/commands.h \
@@ -529,6 +564,7 @@ $(BLD)/dispnew.$(O) : \
$(SRC)/atimer.h \
$(SRC)/blockinput.h \
$(SRC)/buffer.h \
+ $(SRC)/character.h \
$(SRC)/charset.h \
$(SRC)/cm.h \
$(SRC)/commands.h \
@@ -557,6 +593,7 @@ $(BLD)/doc.$(O) : \
$(EMACS_ROOT)/src/config.h \
$(EMACS_ROOT)/nt/inc/sys/file.h \
$(SRC)/buffer.h \
+ $(SRC)/character.h \
$(SRC)/charset.h \
$(SRC)/keyboard.h \
$(SRC)/keymap.h
@@ -566,6 +603,7 @@ $(BLD)/doprnt.$(O) : \
$(EMACS_ROOT)/src/s/ms-w32.h \
$(EMACS_ROOT)/src/m/intel386.h \
$(EMACS_ROOT)/src/config.h \
+ $(SRC)/character.h \
$(SRC)/charset.c
$(BLD)/editfns.$(O) : \
@@ -576,6 +614,7 @@ $(BLD)/editfns.$(O) : \
$(EMACS_ROOT)/nt/inc/pwd.h \
$(SRC)/buffer.h \
$(SRC)/ccl.h \
+ $(SRC)/character.h \
$(SRC)/charset.h \
$(SRC)/coding.h \
$(SRC)/composite.h \
@@ -637,6 +676,7 @@ $(BLD)/fileio.$(O) : \
$(EMACS_ROOT)/nt/inc/sys/file.h \
$(SRC)/buffer.h \
$(SRC)/ccl.h \
+ $(SRC)/character.h \
$(SRC)/charset.h \
$(SRC)/coding.h \
$(SRC)/commands.h \
@@ -658,6 +698,7 @@ $(BLD)/filelock.$(O) : \
$(EMACS_ROOT)/src/epaths.h \
$(SRC)/buffer.h \
$(SRC)/ccl.h \
+ $(SRC)/character.h \
$(SRC)/charset.h \
$(SRC)/coding.h \
$(SRC)/systime.h
@@ -695,6 +736,7 @@ $(BLD)/fns.$(O) : \
$(SRC)/blockinput.h \
$(SRC)/buffer.h \
$(SRC)/ccl.h \
+ $(SRC)/character.h \
$(SRC)/charset.h \
$(SRC)/coding.h \
$(SRC)/commands.h \
@@ -706,11 +748,23 @@ $(BLD)/fns.$(O) : \
$(SRC)/keymap.h \
$(SRC)/md5.h \
$(SRC)/systime.h \
- $(SRC)/termhooks.h \
$(SRC)/w32bdf.h \
$(SRC)/w32gui.h \
$(SRC)/window.h
+$(BLD)/font.$(O) : \
+ $(SRC)/font.c \
+ $(EMACS_ROOT)/src/s/ms-w32.h \
+ $(EMACS_ROOT)/src/m/intel386.h \
+ $(EMACS_ROOT)/src/config.h \
+ $(SRC)/dispextern.h \
+ $(SRC)/frame.h \
+ $(SRC)/window.h \
+ $(SRC)/ccl.h \
+ $(SRC)/character.h \
+ $(SRC)/charset.h \
+ $(SRC)/font.h
+
$(BLD)/fontset.$(O) : \
$(SRC)/fontset.c \
$(EMACS_ROOT)/src/s/ms-w32.h \
@@ -718,12 +772,13 @@ $(BLD)/fontset.$(O) : \
$(EMACS_ROOT)/src/config.h \
$(SRC)/buffer.h \
$(SRC)/ccl.h \
+ $(SRC)/character.h \
$(SRC)/charset.h \
$(SRC)/dispextern.h \
+ $(SRC)/font.h \
$(SRC)/fontset.h \
$(SRC)/frame.h \
$(SRC)/keyboard.h \
- $(SRC)/termhooks.h \
$(SRC)/w32bdf.h \
$(SRC)/w32gui.h \
$(SRC)/window.h
@@ -736,6 +791,7 @@ $(BLD)/frame.$(O) : \
$(SRC)/atimer.h \
$(SRC)/blockinput.h \
$(SRC)/buffer.h \
+ $(SRC)/character.h \
$(SRC)/charset.h \
$(SRC)/commands.h \
$(SRC)/dispextern.h \
@@ -743,7 +799,6 @@ $(BLD)/frame.$(O) : \
$(SRC)/frame.h \
$(SRC)/keyboard.h \
$(SRC)/systime.h \
- $(SRC)/termchar.h \
$(SRC)/termhooks.h \
$(SRC)/w32bdf.h \
$(SRC)/w32gui.h \
@@ -798,6 +853,7 @@ $(BLD)/indent.$(O) : \
$(EMACS_ROOT)/src/config.h \
$(SRC)/buffer.h \
$(SRC)/category.h \
+ $(SRC)/character.h \
$(SRC)/charset.h \
$(SRC)/composite.h \
$(SRC)/dispextern.h \
@@ -821,6 +877,7 @@ $(BLD)/insdel.$(O) : \
$(SRC)/atimer.h \
$(SRC)/blockinput.h \
$(SRC)/buffer.h \
+ $(SRC)/character.h \
$(SRC)/charset.h \
$(SRC)/composite.h \
$(SRC)/dispextern.h \
@@ -856,6 +913,7 @@ $(BLD)/keyboard.$(O) : \
$(SRC)/atimer.h \
$(SRC)/blockinput.h \
$(SRC)/buffer.h \
+ $(SRC)/character.h \
$(SRC)/charset.h \
$(SRC)/commands.h \
$(SRC)/composite.h \
@@ -887,6 +945,7 @@ $(BLD)/keymap.$(O) : \
$(SRC)/atimer.h \
$(SRC)/blockinput.h \
$(SRC)/buffer.h \
+ $(SRC)/character.h \
$(SRC)/charset.h \
$(SRC)/commands.h \
$(SRC)/composite.h \
@@ -913,9 +972,9 @@ $(BLD)/lread.$(O) : \
$(EMACS_ROOT)/src/config.h \
$(EMACS_ROOT)/nt/inc/sys/file.h \
$(EMACS_ROOT)/src/epaths.h \
- $(SRC)/blockinput.h \
$(SRC)/buffer.h \
$(SRC)/ccl.h \
+ $(SRC)/character.h \
$(SRC)/charset.h \
$(SRC)/coding.h \
$(SRC)/commands.h \
@@ -947,6 +1006,7 @@ $(BLD)/marker.$(O) : \
$(EMACS_ROOT)/src/m/intel386.h \
$(EMACS_ROOT)/src/config.h \
$(SRC)/buffer.h \
+ $(SRC)/character.h \
$(SRC)/charset.h
$(BLD)/md5.$(O) : \
@@ -959,6 +1019,7 @@ $(BLD)/minibuf.$(O) : \
$(EMACS_ROOT)/src/m/intel386.h \
$(EMACS_ROOT)/src/config.h \
$(SRC)/buffer.h \
+ $(SRC)/character.h \
$(SRC)/charset.h \
$(SRC)/commands.h \
$(SRC)/composite.h \
@@ -968,7 +1029,6 @@ $(BLD)/minibuf.$(O) : \
$(SRC)/keyboard.h \
$(SRC)/keymap.h \
$(SRC)/syntax.h \
- $(SRC)/termhooks.h \
$(SRC)/w32bdf.h \
$(SRC)/w32gui.h \
$(SRC)/window.h
@@ -1014,6 +1074,7 @@ $(BLD)/w32proc.$(O) : \
$(EMACS_ROOT)/nt/inc/langinfo.h \
$(EMACS_ROOT)/nt/inc/nl_types.h \
$(SRC)/config.h \
+ $(SRC)/character.h \
$(SRC)/process.h \
$(SRC)/syssignal.h \
$(SRC)/systime.h \
@@ -1029,6 +1090,7 @@ $(BLD)/w32console.$(O) : \
$(SRC)/s/ms-w32.h \
$(SRC)/m/intel386.h \
$(SRC)/ccl.h \
+ $(SRC)/character.h \
$(SRC)/charset.h \
$(SRC)/coding.h \
$(SRC)/config.h \
@@ -1046,6 +1108,7 @@ $(BLD)/print.$(O) : \
$(EMACS_ROOT)/src/m/intel386.h \
$(EMACS_ROOT)/src/config.h \
$(SRC)/buffer.h \
+ $(SRC)/character.h \
$(SRC)/charset.h \
$(SRC)/composite.h \
$(SRC)/dispextern.h \
@@ -1069,6 +1132,7 @@ $(BLD)/process.$(O) : \
$(SRC)/blockinput.h \
$(SRC)/buffer.h \
$(SRC)/ccl.h \
+ $(SRC)/character.h \
$(SRC)/charset.h \
$(SRC)/coding.h \
$(SRC)/commands.h \
@@ -1108,6 +1172,7 @@ $(BLD)/regex.$(O) : \
$(SRC)/m/intel386.h \
$(SRC)/buffer.h \
$(SRC)/category.h \
+ $(SRC)/character.h \
$(SRC)/charset.h \
$(SRC)/config.h \
$(SRC)/regex.h \
@@ -1130,7 +1195,6 @@ $(BLD)/scroll.$(O) : \
$(SRC)/frame.h \
$(SRC)/keyboard.h \
$(SRC)/termchar.h \
- $(SRC)/termhooks.h \
$(SRC)/w32bdf.h \
$(SRC)/w32gui.h \
$(SRC)/window.h
@@ -1144,6 +1208,7 @@ $(BLD)/search.$(O) : \
$(SRC)/blockinput.h \
$(SRC)/buffer.h \
$(SRC)/category.h \
+ $(SRC)/character.h \
$(SRC)/charset.h \
$(SRC)/commands.h \
$(SRC)/composite.h \
@@ -1176,6 +1241,7 @@ $(BLD)/syntax.$(O) : \
$(EMACS_ROOT)/src/config.h \
$(SRC)/buffer.h \
$(SRC)/category.h \
+ $(SRC)/character.h \
$(SRC)/charset.h \
$(SRC)/commands.h \
$(SRC)/composite.h \
@@ -1197,7 +1263,6 @@ $(BLD)/sysdep.$(O) : \
$(EMACS_ROOT)/nt/inc/sys/file.h \
$(SRC)/atimer.h \
$(SRC)/blockinput.h \
- $(SRC)/cm.h \
$(SRC)/dispextern.h \
$(SRC)/frame.h \
$(SRC)/keyboard.h \
@@ -1221,6 +1286,7 @@ $(BLD)/term.$(O) : \
$(EMACS_ROOT)/src/m/intel386.h \
$(EMACS_ROOT)/src/config.h \
$(SRC)/ccl.h \
+ $(SRC)/character.h \
$(SRC)/charset.h \
$(SRC)/cm.h \
$(SRC)/coding.h \
@@ -1243,18 +1309,6 @@ $(BLD)/termcap.$(O) : \
$(EMACS_ROOT)/src/config.h \
$(EMACS_ROOT)/nt/inc/sys/file.h
-$(BLD)/terminal.$(O) : \
- $(SRC)/terminal.c \
- $(EMACS_ROOT)/src/s/ms-w32.h \
- $(EMACS_ROOT)/src/m/intel386.h \
- $(EMACS_ROOT)/src/config.h \
- $(SRC)/charset.h \
- $(SRC)/coding.h \
- $(SRC)/frame.h \
- $(SRC)/keyboard.h \
- $(SRC)/termchar.h \
- $(SRC)/termhooks.h
-
$(BLD)/textprop.$(O) : \
$(SRC)/textprop.c \
$(EMACS_ROOT)/src/s/ms-w32.h \
@@ -1329,12 +1383,14 @@ $(BLD)/xdisp.$(O) : \
$(SRC)/blockinput.h \
$(SRC)/buffer.h \
$(SRC)/ccl.h \
+ $(SRC)/character.h \
$(SRC)/charset.h \
$(SRC)/coding.h \
$(SRC)/commands.h \
$(SRC)/composite.h \
$(SRC)/dispextern.h \
$(SRC)/disptab.h \
+ $(SRC)/font.h \
$(SRC)/fontset.h \
$(SRC)/frame.h \
$(SRC)/indent.h \
@@ -1360,16 +1416,16 @@ $(BLD)/xfaces.$(O): \
$(SRC)/atimer.h \
$(SRC)/blockinput.h \
$(SRC)/buffer.h \
+ $(SRC)/character.h \
$(SRC)/charset.h \
$(SRC)/composite.h \
$(SRC)/dispextern.h \
+ $(SRC)/font.h \
$(SRC)/fontset.h \
$(SRC)/frame.h \
$(SRC)/intervals.h \
$(SRC)/keyboard.h \
$(SRC)/systime.h \
- $(SRC)/termchar.h \
- $(SRC)/termhooks.h \
$(SRC)/w32bdf.h \
$(SRC)/w32gui.h \
$(SRC)/w32term.h \
@@ -1384,11 +1440,13 @@ $(BLD)/w32fns.$(O): \
$(SRC)/blockinput.h \
$(SRC)/buffer.h \
$(SRC)/ccl.h \
+ $(SRC)/character.h \
$(SRC)/charset.h \
$(SRC)/coding.h \
$(SRC)/composite.h \
$(SRC)/dispextern.h \
$(SRC)/epaths.h \
+ $(SRC)/font.h \
$(SRC)/fontset.h \
$(SRC)/frame.h \
$(SRC)/intervals.h \
@@ -1409,6 +1467,7 @@ $(BLD)/w32menu.$(O): \
$(SRC)/atimer.h \
$(SRC)/blockinput.h \
$(SRC)/buffer.h \
+ $(SRC)/character.h \
$(SRC)/charset.h \
$(SRC)/coding.h \
$(SRC)/dispextern.h \
@@ -1431,11 +1490,13 @@ $(BLD)/w32term.$(O): \
$(SRC)/blockinput.h \
$(SRC)/buffer.h \
$(SRC)/ccl.h \
+ $(SRC)/character.h \
$(SRC)/charset.h \
$(SRC)/coding.h \
$(SRC)/composite.h \
$(SRC)/dispextern.h \
$(SRC)/disptab.h \
+ $(SRC)/font.h \
$(SRC)/fontset.h \
$(SRC)/frame.h \
$(SRC)/gnu.h \
@@ -1462,6 +1523,7 @@ $(BLD)/w32select.$(O): \
$(SRC)/blockinput.h \
$(SRC)/buffer.h \
$(SRC)/ccl.h \
+ $(SRC)/character.h \
$(SRC)/charset.h \
$(SRC)/coding.h \
$(SRC)/composite.h \
@@ -1493,6 +1555,7 @@ $(BLD)/w32xfns.$(O): \
$(EMACS_ROOT)/src/config.h \
$(SRC)/atimer.h \
$(SRC)/blockinput.h \
+ $(SRC)/character.h \
$(SRC)/charset.h \
$(SRC)/fontset.h \
$(SRC)/frame.h \
@@ -1509,6 +1572,7 @@ $(BLD)/w32bdf.$(O): \
$(EMACS_ROOT)/src/config.h \
$(SRC)/atimer.h \
$(SRC)/blockinput.h \
+ $(SRC)/character.h \
$(SRC)/charset.h \
$(SRC)/dispextern.h \
$(SRC)/fontset.h \
@@ -1519,7 +1583,21 @@ $(BLD)/w32bdf.$(O): \
$(SRC)/w32gui.h \
$(SRC)/w32term.h
+$(BLD)/w32font$(O): \
+ $(SRC)/w32font.c \
+ $(EMACS_ROOT)/src/s/ms-w32.h \
+ $(EMACS_ROOT)/src/m/intel386.h \
+ $(EMACS_ROOT)/src/config.h \
+ $(SRC)/character.h \
+ $(SRC)/charset.h \
+ $(SRC)/dispextern.h \
+ $(SRC)/font.h \
+ $(SRC)/fontset.h \
+ $(SRC)/frame.h \
+ $(SRC)/w32gui.h \
+ $(SRC)/w32term.h
+
# Each object file depends on stamp_BLD, because in parallel builds we must
# make sure $(BLD) exists before starting compilations.
#
-$(OBJ0) $(OBJ1) $(WIN32OBJ) $(BLD)/lastfile.$(O) $(BLD)/firstfile.$(O): stamp_BLD
+$(OBJ0) $(OBJ1) $(WIN32OBJ) $(FONTOBJ) $(BLD)/lastfile.$(O) $(BLD)/firstfile.$(O): stamp_BLD
diff --git a/src/marker.c b/src/marker.c
index 0c89f71d79..6a7652c8ce 100644
--- a/src/marker.c
+++ b/src/marker.c
@@ -23,7 +23,7 @@ Boston, MA 02110-1301, USA. */
#include <config.h>
#include "lisp.h"
#include "buffer.h"
-#include "charset.h"
+#include "character.h"
/* Record one cached position found recently by
buf_charpos_to_bytepos or buf_bytepos_to_charpos. */
@@ -452,12 +452,9 @@ Returns nil if MARKER points into a dead buffer. */)
if (XMARKER (marker)->buffer)
{
XSETBUFFER (buf, XMARKER (marker)->buffer);
- /* If the buffer is dead, we're in trouble: the buffer pointer here
- does not preserve the buffer from being GC'd (it's weak), so
- markers have to be unlinked from their buffer as soon as the buffer
- is killed. */
- eassert (!NILP (XBUFFER (buf)->name));
- return buf;
+ /* Return marker's buffer only if it is not dead. */
+ if (!NILP (XBUFFER (buf)->name))
+ return buf;
}
return Qnil;
}
diff --git a/src/minibuf.c b/src/minibuf.c
index 489c714fcb..74220d0c7c 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -27,7 +27,7 @@ Boston, MA 02110-1301, USA. */
#include "lisp.h"
#include "commands.h"
#include "buffer.h"
-#include "charset.h"
+#include "character.h"
#include "dispextern.h"
#include "keyboard.h"
#include "frame.h"
@@ -35,7 +35,6 @@ Boston, MA 02110-1301, USA. */
#include "syntax.h"
#include "intervals.h"
#include "keymap.h"
-#include "termhooks.h"
extern int quit_char;
@@ -492,6 +491,7 @@ read_minibuf (map, initial, prompt, backup_n, expflag,
if (EQ (Vminibuffer_completing_file_name, Qlambda))
Vminibuffer_completing_file_name = Qnil;
+ single_kboard_state ();
#ifdef HAVE_X_WINDOWS
if (display_hourglass_p)
cancel_hourglass ();
@@ -575,8 +575,6 @@ read_minibuf (map, initial, prompt, backup_n, expflag,
if (minibuffer_auto_raise)
Fraise_frame (mini_frame);
- temporarily_switch_to_single_kboard (XFRAME (mini_frame));
-
/* We have to do this after saving the window configuration
since that is what restores the current buffer. */
@@ -760,12 +758,8 @@ read_minibuf (map, initial, prompt, backup_n, expflag,
XWINDOW (minibuf_window)->cursor.x = 0;
XWINDOW (minibuf_window)->must_be_updated_p = 1;
update_frame (XFRAME (selected_frame), 1, 1);
- {
- struct frame *f = XFRAME (XWINDOW (minibuf_window)->frame);
- struct redisplay_interface *rif = FRAME_RIF (f);
- if (rif && rif->flush_display)
- rif->flush_display (f);
- }
+ if (rif && rif->flush_display)
+ rif->flush_display (XFRAME (XWINDOW (minibuf_window)->frame));
}
/* Make minibuffer contents into a string. */
@@ -2425,23 +2419,14 @@ Return nil if there is no valid completion, else t. */)
/* Now find first word-break in the stuff found by completion.
i gets index in string of where to stop completing. */
- {
- int len, c;
- int bytes = SBYTES (completion);
- register const unsigned char *completion_string = SDATA (completion);
- for (; i_byte < SBYTES (completion); i_byte += len, i++)
- {
- c = STRING_CHAR_AND_LENGTH (completion_string + i_byte,
- bytes - i_byte,
- len);
- if (SYNTAX (c) != Sword)
- {
- i_byte += len;
- i++;
- break;
- }
- }
- }
+ while (i_byte < SBYTES (completion))
+ {
+ int c;
+
+ FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE (c, completion, i, i_byte);
+ if (SYNTAX (c) != Sword)
+ break;
+ }
/* If got no characters, print help for user. */
@@ -2721,7 +2706,7 @@ DEFUN ("self-insert-and-exit", Fself_insert_and_exit, Sself_insert_and_exit, 0,
doc: /* Terminate minibuffer input. */)
()
{
- if (INTEGERP (last_command_char))
+ if (CHARACTERP (last_command_char))
internal_self_insert (XINT (last_command_char), 0);
else
bitch_at_user ();
diff --git a/src/msdos.c b/src/msdos.c
index dc183def75..c01755b279 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -56,7 +56,7 @@ Boston, MA 02110-1301, USA. */
#include "dispextern.h"
#include "dosfns.h"
#include "termopts.h"
-#include "charset.h"
+#include "character.h"
#include "coding.h"
#include "disptab.h"
#include "frame.h"
@@ -508,8 +508,8 @@ ScreenVisualBell (void)
{
/* This creates an xor-mask that will swap the default fore- and
background colors. */
- do_visible_bell (((FRAME_FOREGROUND_PIXEL (SELECTED_FRAME ())
- ^ FRAME_BACKGROUND_PIXEL (SELECTED_FRAME ()))
+ do_visible_bell (((the_only_x_display.foreground_pixel
+ ^ the_only_x_display.background_pixel)
* 0x11) & 0x7f);
}
#endif
@@ -2531,8 +2531,8 @@ internal_terminal_init ()
initial_screen_colors[0] = initial_screen_colors[1] = -1;
bzero (&the_only_x_display, sizeof the_only_x_display);
- FRAME_BACKGROUND_PIXEL (SELECTED_FRAME ()) = 7; /* White */
- FRAME_FOREGROUND_PIXEL (SELECTED_FRAME ()) = 0; /* Black */
+ the_only_x_display.background_pixel = 7; /* White */
+ the_only_x_display.foreground_pixel = 0; /* Black */
bright_bg ();
colors = getenv ("EMACSCOLORS");
if (colors && strlen (colors) >= 2)
@@ -2543,13 +2543,13 @@ internal_terminal_init ()
else if (isxdigit (colors[0]))
colors[0] -= (isupper (colors[0]) ? 'A' : 'a') - 10;
if (colors[0] >= 0 && colors[0] < 16)
- FRAME_FOREGROUND_PIXEL (SELECTED_FRAME ()) = colors[0];
+ the_only_x_display.foreground_pixel = colors[0];
if (isdigit (colors[1]))
colors[1] -= '0';
else if (isxdigit (colors[1]))
colors[1] -= (isupper (colors[1]) ? 'A' : 'a') - 10;
if (colors[1] >= 0 && colors[1] < 16)
- FRAME_BACKGROUND_PIXEL (SELECTED_FRAME ()) = colors[1];
+ the_only_x_display.background_pixel = colors[1];
}
the_only_x_display.font = (XFontStruct *)1; /* must *not* be zero */
the_only_x_display.display_info.mouse_face_mouse_frame = NULL;
@@ -2583,7 +2583,7 @@ internal_terminal_init ()
set_terminal_modes_hook = IT_set_terminal_modes;
reset_terminal_modes_hook = IT_reset_terminal_modes;
set_terminal_window_hook = IT_set_terminal_window;
- TTY_CHAR_INS_DEL_OK (CURTTY ()) = 0;
+ char_ins_del_ok = 0;
#endif
}
@@ -3393,13 +3393,7 @@ dos_rawgetc ()
it is active. */
if (WINDOWP (mouse_window)
&& !EQ (mouse_window, last_mouse_window)
- && !EQ (window, selected_window)
- /* For click-to-focus window managers
- create event iff we don't leave the
- selected frame. */
- && (focus_follows_mouse
- || (EQ (XWINDOW (window)->frame,
- XWINDOW (selected_window)->frame))))
+ && !EQ (mouse_window, selected_window))
{
event.kind = SELECT_WINDOW_EVENT;
event.frame_or_window = mouse_window;
@@ -3805,15 +3799,15 @@ XMenuActivate (Display *foo, XMenu *menu, int *pane, int *selidx,
screensize = screen_size * 2;
faces[0]
= lookup_derived_face (sf, intern ("msdos-menu-passive-face"),
- 0, DEFAULT_FACE_ID, 1);
+ DEFAULT_FACE_ID, 1);
faces[1]
= lookup_derived_face (sf, intern ("msdos-menu-active-face"),
- 0, DEFAULT_FACE_ID, 1);
+ DEFAULT_FACE_ID, 1);
selectface = intern ("msdos-menu-select-face");
faces[2] = lookup_derived_face (sf, selectface,
- 0, faces[0], 1);
+ faces[0], 1);
faces[3] = lookup_derived_face (sf, selectface,
- 0, faces[1], 1);
+ faces[1], 1);
/* Make sure the menu title is always displayed with
`msdos-menu-active-face', no matter where the mouse pointer is. */
@@ -4886,7 +4880,7 @@ croak (badfunc)
char *badfunc;
{
fprintf (stderr, "%s not yet implemented\r\n", badfunc);
- reset_all_sys_modes ();
+ reset_sys_modes ();
exit (1);
}
diff --git a/src/prefix-args.c b/src/prefix-args.c
index 16d7b7dba1..adf2743ba2 100644
--- a/src/prefix-args.c
+++ b/src/prefix-args.c
@@ -53,7 +53,6 @@ Boston, MA 02110-1301, USA. */
#endif
#include <stdio.h>
-#include <stdlib.h>
int
main (argc, argv)
diff --git a/src/print.c b/src/print.c
index ccb2d6e8c4..86fd93a5b3 100644
--- a/src/print.c
+++ b/src/print.c
@@ -25,6 +25,7 @@ Boston, MA 02110-1301, USA. */
#include <stdio.h>
#include "lisp.h"
#include "buffer.h"
+#include "character.h"
#include "charset.h"
#include "keyboard.h"
#include "frame.h"
@@ -34,7 +35,6 @@ Boston, MA 02110-1301, USA. */
#include "termchar.h"
#include "intervals.h"
#include "blockinput.h"
-#include "termhooks.h" /* For struct terminal. */
Lisp_Object Vstandard_output, Qstandard_output;
@@ -477,11 +477,15 @@ print_string (string, printcharfun)
{
int chars;
+ if (print_escape_nonascii)
+ string = string_escape_byte8 (string);
+
if (STRING_MULTIBYTE (string))
chars = SCHARS (string);
- else if (EQ (printcharfun, Qt)
- ? ! NILP (buffer_defaults.enable_multibyte_characters)
- : ! NILP (current_buffer->enable_multibyte_characters))
+ else if (! print_escape_nonascii
+ && (EQ (printcharfun, Qt)
+ ? ! NILP (buffer_defaults.enable_multibyte_characters)
+ : ! NILP (current_buffer->enable_multibyte_characters)))
{
/* If unibyte string STRING contains 8-bit codes, we must
convert STRING to a multibyte string containing the same
@@ -546,11 +550,6 @@ print_string (string, printcharfun)
int len;
int ch = STRING_CHAR_AND_LENGTH (SDATA (string) + i,
size_byte - i, len);
- if (!CHAR_VALID_P (ch, 0))
- {
- ch = SREF (string, i);
- len = 1;
- }
PRINTCHAR (ch);
i += len;
}
@@ -1025,7 +1024,11 @@ safe_debug_print (arg)
else
fprintf (stderr, "#<%s_LISP_OBJECT 0x%08lx>\r\n",
!valid ? "INVALID" : "SOME",
- (unsigned long) XHASH (arg)
+#ifdef NO_UNION_TYPE
+ (unsigned long) arg
+#else
+ (unsigned long) arg.i
+#endif
);
}
@@ -1385,10 +1388,10 @@ print_preprocess (obj)
for (i = 0; i < print_number_index; i++)
if (EQ (PRINT_NUMBER_OBJECT (Vprint_number_table, i), obj))
{
- /* OBJ appears more than once. Let's remember that. */
+ /* OBJ appears more than once. Let's remember that. */
PRINT_NUMBER_STATUS (Vprint_number_table, i) = Qt;
print_depth--;
- return;
+ return;
}
/* OBJ is not yet recorded. Let's add to the table. */
@@ -1422,7 +1425,7 @@ print_preprocess (obj)
print_number_index++;
}
- switch (XGCTYPE (obj))
+ switch (XTYPE (obj))
{
case Lisp_String:
/* A string may have text properties, which can be circular. */
@@ -1465,6 +1468,93 @@ print_preprocess_string (interval, arg)
print_preprocess (interval->plist);
}
+/* A flag to control printing of `charset' text property.
+ The default value is Qdefault. */
+Lisp_Object Vprint_charset_text_property;
+extern Lisp_Object Qdefault;
+
+static void print_check_string_charset_prop ();
+
+#define PRINT_STRING_NON_CHARSET_FOUND 1
+#define PRINT_STRING_UNSAFE_CHARSET_FOUND 2
+
+/* Bitwize or of the abobe macros. */
+static int print_check_string_result;
+
+static void
+print_check_string_charset_prop (interval, string)
+ INTERVAL interval;
+ Lisp_Object string;
+{
+ Lisp_Object val;
+
+ if (NILP (interval->plist)
+ || (print_check_string_result == (PRINT_STRING_NON_CHARSET_FOUND
+ | PRINT_STRING_UNSAFE_CHARSET_FOUND)))
+ return;
+ for (val = interval->plist; CONSP (val) && ! EQ (XCAR (val), Qcharset);
+ val = XCDR (XCDR (val)));
+ if (! CONSP (val))
+ {
+ print_check_string_result |= PRINT_STRING_NON_CHARSET_FOUND;
+ return;
+ }
+ if (! (print_check_string_result & PRINT_STRING_NON_CHARSET_FOUND))
+ {
+ if (! EQ (val, interval->plist)
+ || CONSP (XCDR (XCDR (val))))
+ print_check_string_result |= PRINT_STRING_NON_CHARSET_FOUND;
+ }
+ if (NILP (Vprint_charset_text_property)
+ || ! (print_check_string_result & PRINT_STRING_UNSAFE_CHARSET_FOUND))
+ {
+ int i, c;
+ int charpos = interval->position;
+ int bytepos = string_char_to_byte (string, charpos);
+ Lisp_Object charset;
+
+ charset = XCAR (XCDR (val));
+ for (i = 0; i < LENGTH (interval); i++)
+ {
+ FETCH_STRING_CHAR_ADVANCE (c, string, charpos, bytepos);
+ if (! ASCII_CHAR_P (c)
+ && ! EQ (CHARSET_NAME (CHAR_CHARSET (c)), charset))
+ {
+ print_check_string_result |= PRINT_STRING_UNSAFE_CHARSET_FOUND;
+ break;
+ }
+ }
+ }
+}
+
+/* The value is (charset . nil). */
+static Lisp_Object print_prune_charset_plist;
+
+static Lisp_Object
+print_prune_string_charset (string)
+ Lisp_Object string;
+{
+ print_check_string_result = 0;
+ traverse_intervals (STRING_INTERVALS (string), 0,
+ print_check_string_charset_prop, string);
+ if (! (print_check_string_result & PRINT_STRING_UNSAFE_CHARSET_FOUND))
+ {
+ string = Fcopy_sequence (string);
+ if (print_check_string_result & PRINT_STRING_NON_CHARSET_FOUND)
+ {
+ if (NILP (print_prune_charset_plist))
+ print_prune_charset_plist = Fcons (Qcharset, Qnil);
+ Fremove_text_properties (make_number (0),
+ make_number (SCHARS (string)),
+ print_prune_charset_plist, string);
+ }
+ else
+ Fset_text_properties (make_number (0), make_number (SCHARS (string)),
+ Qnil, string);
+ }
+ return string;
+}
+
static void
print_object (obj, printcharfun, escapeflag)
Lisp_Object obj;
@@ -1477,7 +1567,7 @@ print_object (obj, printcharfun, escapeflag)
/* Detect circularities and truncate them. */
if (STRINGP (obj) || CONSP (obj) || VECTORP (obj)
- || COMPILEDP (obj) || CHAR_TABLE_P (obj)
+ || COMPILEDP (obj) || CHAR_TABLE_P (obj) || SUB_CHAR_TABLE_P (obj)
|| (! NILP (Vprint_gensym)
&& SYMBOLP (obj)
&& !SYMBOL_INTERNED_P (obj)))
@@ -1536,7 +1626,7 @@ print_object (obj, printcharfun, escapeflag)
}
#endif /* MAX_PRINT_CHARS */
- switch (XGCTYPE (obj))
+ switch (XTYPE (obj))
{
case Lisp_Int:
if (sizeof (int) == sizeof (EMACS_INT))
@@ -1573,6 +1663,9 @@ print_object (obj, printcharfun, escapeflag)
GCPRO1 (obj);
+ if (! EQ (Vprint_charset_text_property, Qt))
+ obj = print_prune_string_charset (obj);
+
if (!NULL_INTERVAL_P (STRING_INTERVALS (obj)))
{
PRINTCHAR ('#');
@@ -1594,10 +1687,7 @@ print_object (obj, printcharfun, escapeflag)
{
c = STRING_CHAR_AND_LENGTH (str + i_byte,
size_byte - i_byte, len);
- if (CHAR_VALID_P (c, 0))
- i_byte += len;
- else
- c = str[i_byte++];
+ i_byte += len;
}
else
c = str[i_byte++];
@@ -1615,8 +1705,8 @@ print_object (obj, printcharfun, escapeflag)
PRINTCHAR ('f');
}
else if (multibyte
- && ! ASCII_BYTE_P (c)
- && (SINGLE_BYTE_CHAR_P (c) || print_escape_multibyte))
+ && (CHAR_BYTE8_P (c)
+ || (! ASCII_CHAR_P (c) && print_escape_multibyte)))
{
/* When multibyte is disabled,
print multibyte string chars using hex escapes.
@@ -1624,9 +1714,15 @@ print_object (obj, printcharfun, escapeflag)
when found in a multibyte string, always use a hex escape
so it reads back as multibyte. */
unsigned char outbuf[50];
- sprintf (outbuf, "\\x%x", c);
+
+ if (CHAR_BYTE8_P (c))
+ sprintf (outbuf, "\\%03o", CHAR_TO_BYTE8 (c));
+ else
+ {
+ sprintf (outbuf, "\\x%04x", c);
+ need_nonhex = 1;
+ }
strout (outbuf, -1, -1, printcharfun, 0);
- need_nonhex = 1;
}
else if (! multibyte
&& SINGLE_BYTE_CHAR_P (c) && ! ASCII_BYTE_P (c)
@@ -1915,7 +2011,12 @@ print_object (obj, printcharfun, escapeflag)
{
QUIT;
c = XBOOL_VECTOR (obj)->data[i];
- if (c == '\n' && print_escape_newlines)
+ if (! ASCII_BYTE_P (c))
+ {
+ sprintf (buf, "\\%03o", c);
+ strout (buf, -1, -1, printcharfun, 0);
+ }
+ else if (c == '\n' && print_escape_newlines)
{
PRINTCHAR ('\\');
PRINTCHAR ('n');
@@ -1962,19 +2063,6 @@ print_object (obj, printcharfun, escapeflag)
}
PRINTCHAR ('>');
}
- else if (TERMINALP (obj))
- {
- struct terminal *t = XTERMINAL (obj);
- strout ("#<terminal ", -1, -1, printcharfun, 0);
- sprintf (buf, "%d", t->id);
- strout (buf, -1, -1, printcharfun, 0);
- if (t->name)
- {
- strout (" on ", -1, -1, printcharfun, 0);
- strout (t->name, -1, -1, printcharfun, 0);
- }
- PRINTCHAR ('>');
- }
else if (HASH_TABLE_P (obj))
{
struct Lisp_Hash_Table *h = XHASH_TABLE (obj);
@@ -1987,7 +2075,7 @@ print_object (obj, printcharfun, escapeflag)
PRINTCHAR (' ');
strout (SDATA (SYMBOL_NAME (h->weak)), -1, -1, printcharfun, 0);
PRINTCHAR (' ');
- sprintf (buf, "%ld/%ld", (long) h->count,
+ sprintf (buf, "%ld/%ld", (long) XFASTINT (h->count),
(long) XVECTOR (h->next)->size);
strout (buf, -1, -1, printcharfun, 0);
}
@@ -2030,7 +2118,7 @@ print_object (obj, printcharfun, escapeflag)
PRINTCHAR ('#');
size &= PSEUDOVECTOR_SIZE_MASK;
}
- if (CHAR_TABLE_P (obj))
+ if (CHAR_TABLE_P (obj) || SUB_CHAR_TABLE_P (obj))
{
/* We print a char-table as if it were a vector,
lumping the parent and default slots in with the
@@ -2220,6 +2308,8 @@ print_interval (interval, printcharfun)
INTERVAL interval;
Lisp_Object printcharfun;
{
+ if (NILP (interval->plist))
+ return;
PRINTCHAR (' ');
print_object (make_number (interval->position), printcharfun, 1);
PRINTCHAR (' ');
@@ -2342,6 +2432,19 @@ the printing done so far has not found any shared structure or objects
that need to be recorded in the table. */);
Vprint_number_table = Qnil;
+ DEFVAR_LISP ("print-charset-text-property", &Vprint_charset_text_property,
+ doc: /* A flag to control printing of `charset' text property on printing a string.
+The value must be nil, t, or `default'.
+
+If the value is nil, don't print the text property `charset'.
+
+If the value is t, always print the text property `charset'.
+
+If the value is `default', print the text property `charset' only when
+the value is different from what is guessed in the current charset
+priorities. */);
+ Vprint_charset_text_property = Qdefault;
+
/* prin1_to_string_buffer initialized in init_buffer_once in buffer.c */
staticpro (&Vprin1_to_string_buffer);
@@ -2369,6 +2472,9 @@ that need to be recorded in the table. */);
Qprint_escape_nonascii = intern ("print-escape-nonascii");
staticpro (&Qprint_escape_nonascii);
+ print_prune_charset_plist = Qnil;
+ staticpro (&print_prune_charset_plist);
+
defsubr (&Swith_output_to_temp_buffer);
}
diff --git a/src/process.c b/src/process.c
index 19275e40db..9e9ef6d077 100644
--- a/src/process.c
+++ b/src/process.c
@@ -127,14 +127,14 @@ Boston, MA 02110-1301, USA. */
#include "window.h"
#include "buffer.h"
-#include "charset.h"
+#include "character.h"
#include "coding.h"
#include "process.h"
-#include "frame.h"
#include "termhooks.h"
#include "termopts.h"
#include "commands.h"
#include "keyboard.h"
+#include "frame.h"
#include "blockinput.h"
#include "dispextern.h"
#include "composite.h"
@@ -168,8 +168,8 @@ extern Lisp_Object QCfilter;
Qt nor Qnil but is instead a property list (KEY VAL ...). */
#ifdef HAVE_SOCKETS
-#define NETCONN_P(p) (GC_CONSP (XPROCESS (p)->childp))
-#define NETCONN1_P(p) (GC_CONSP ((p)->childp))
+#define NETCONN_P(p) (CONSP (XPROCESS (p)->childp))
+#define NETCONN1_P(p) (CONSP ((p)->childp))
#else
#define NETCONN_P(p) 0
#define NETCONN1_P(p) 0
@@ -673,6 +673,7 @@ setup_process_coding_systems (process)
struct Lisp_Process *p = XPROCESS (process);
int inch = p->infd;
int outch = p->outfd;
+ Lisp_Object coding_system;
if (inch < 0 || outch < 0)
return;
@@ -680,26 +681,24 @@ setup_process_coding_systems (process)
if (!proc_decode_coding_system[inch])
proc_decode_coding_system[inch]
= (struct coding_system *) xmalloc (sizeof (struct coding_system));
- setup_coding_system (p->decode_coding_system,
- proc_decode_coding_system[inch]);
+ coding_system = p->decode_coding_system;
if (! NILP (p->filter))
{
if (!p->filter_multibyte)
- setup_raw_text_coding_system (proc_decode_coding_system[inch]);
+ coding_system = raw_text_coding_system (coding_system);
}
else if (BUFFERP (p->buffer))
{
if (NILP (XBUFFER (p->buffer)->enable_multibyte_characters))
- setup_raw_text_coding_system (proc_decode_coding_system[inch]);
+ coding_system = raw_text_coding_system (coding_system);
}
+ setup_coding_system (coding_system, proc_decode_coding_system[inch]);
if (!proc_encode_coding_system[outch])
proc_encode_coding_system[outch]
= (struct coding_system *) xmalloc (sizeof (struct coding_system));
setup_coding_system (p->encode_coding_system,
proc_encode_coding_system[outch]);
- if (proc_encode_coding_system[outch]->eol_type == CODING_EOL_UNDECIDED)
- proc_encode_coding_system[outch]->eol_type = system_eol_type;
}
DEFUN ("processp", Fprocessp, Sprocessp, 1, 1, 0,
@@ -2721,9 +2720,7 @@ host, and only clients connecting to that address will be accepted.
:service SERVICE -- SERVICE is name of the service desired, or an
integer specifying a port number to connect to. If SERVICE is t,
-a random port number is selected for the server. (If Emacs was
-compiled with getaddrinfo, a port number can also be specified as a
-string, e.g. "80", as well as an integer. This is not portable.)
+a random port number is selected for the server.
:type TYPE -- TYPE is the type of connection. The default (nil) is a
stream type connection, `datagram' creates a datagram type connection.
@@ -3159,10 +3156,6 @@ usage: (make-network-process &rest ARGS) */)
open_socket:
-#ifdef __ultrix__
- /* Previously this was compiled unconditionally, but that seems
- unnecessary on modern systems, and `unrequest_sigio' was a noop
- under X anyway. --lorentey */
/* Kernel bugs (on Ultrix at least) cause lossage (not just EINTR)
when connect is interrupted. So let's not let it get interrupted.
Note we do not turn off polling, because polling is only used
@@ -3179,7 +3172,6 @@ usage: (make-network-process &rest ARGS) */)
record_unwind_protect (unwind_request_sigio, Qnil);
unrequest_sigio ();
}
-#endif
/* Do this in case we never enter the for-loop below. */
count1 = SPECPDL_INDEX ();
@@ -5146,13 +5138,13 @@ read_process_output (proc, channel)
save the match data in a special nonrecursive fashion. */
running_asynch_code = 1;
- text = decode_coding_string (make_unibyte_string (chars, nbytes),
- coding, 0);
- Vlast_coding_system_used = coding->symbol;
+ decode_coding_c_string (coding, chars, nbytes, Qt);
+ text = coding->dst_object;
+ Vlast_coding_system_used = CODING_ID_NAME (coding->id);
/* A new coding system might be found. */
- if (!EQ (p->decode_coding_system, coding->symbol))
+ if (!EQ (p->decode_coding_system, Vlast_coding_system_used))
{
- p->decode_coding_system = coding->symbol;
+ p->decode_coding_system = Vlast_coding_system_used;
/* Don't call setup_coding_system for
proc_decode_coding_system[channel] here. It is done in
@@ -5168,25 +5160,21 @@ read_process_output (proc, channel)
if (NILP (p->encode_coding_system)
&& proc_encode_coding_system[p->outfd])
{
- p->encode_coding_system = coding->symbol;
- setup_coding_system (coding->symbol,
+ p->encode_coding_system
+ = coding_inherit_eol_type (Vlast_coding_system_used, Qnil);
+ setup_coding_system (p->encode_coding_system,
proc_encode_coding_system[p->outfd]);
- if (proc_encode_coding_system[p->outfd]->eol_type
- == CODING_EOL_UNDECIDED)
- proc_encode_coding_system[p->outfd]->eol_type
- = system_eol_type;
}
}
- carryover = nbytes - coding->consumed;
- if (carryover < 0)
- abort ();
-
- if (SCHARS (p->decoding_buf) < carryover)
- p->decoding_buf = make_uninit_string (carryover);
- bcopy (chars + coding->consumed, SDATA (p->decoding_buf),
- carryover);
- p->decoding_carryover = carryover;
+ if (coding->carryover_bytes > 0)
+ {
+ if (SCHARS (p->decoding_buf) < coding->carryover_bytes)
+ p->decoding_buf = make_uninit_string (coding->carryover_bytes);
+ bcopy (coding->carryover, SDATA (p->decoding_buf),
+ coding->carryover_bytes);
+ p->decoding_carryover = coding->carryover_bytes;
+ }
/* Adjust the multibyteness of TEXT to that of the filter. */
if (!p->filter_multibyte != !STRING_MULTIBYTE (text))
text = (STRING_MULTIBYTE (text)
@@ -5271,36 +5259,31 @@ read_process_output (proc, channel)
if (! (BEGV <= PT && PT <= ZV))
Fwiden ();
- text = decode_coding_string (make_unibyte_string (chars, nbytes),
- coding, 0);
- Vlast_coding_system_used = coding->symbol;
+ decode_coding_c_string (coding, chars, nbytes, Qt);
+ text = coding->dst_object;
+ Vlast_coding_system_used = CODING_ID_NAME (coding->id);
/* A new coding system might be found. See the comment in the
similar code in the previous `if' block. */
- if (!EQ (p->decode_coding_system, coding->symbol))
+ if (!EQ (p->decode_coding_system, Vlast_coding_system_used))
{
- p->decode_coding_system = coding->symbol;
+ p->decode_coding_system = Vlast_coding_system_used;
if (NILP (p->encode_coding_system)
&& proc_encode_coding_system[p->outfd])
{
- p->encode_coding_system = coding->symbol;
- setup_coding_system (coding->symbol,
+ p->encode_coding_system
+ = coding_inherit_eol_type (Vlast_coding_system_used, Qnil);
+ setup_coding_system (p->encode_coding_system,
proc_encode_coding_system[p->outfd]);
- if (proc_encode_coding_system[p->outfd]->eol_type
- == CODING_EOL_UNDECIDED)
- proc_encode_coding_system[p->outfd]->eol_type
- = system_eol_type;
}
}
- carryover = nbytes - coding->consumed;
- if (carryover < 0)
- abort ();
-
- if (SCHARS (p->decoding_buf) < carryover)
- p->decoding_buf = make_uninit_string (carryover);
- bcopy (chars + coding->consumed, SDATA (p->decoding_buf),
- carryover);
- p->decoding_carryover = carryover;
-
+ if (coding->carryover_bytes > 0)
+ {
+ if (SCHARS (p->decoding_buf) < coding->carryover_bytes)
+ p->decoding_buf = make_uninit_string (coding->carryover_bytes);
+ bcopy (coding->carryover, SDATA (p->decoding_buf),
+ coding->carryover_bytes);
+ p->decoding_carryover = coding->carryover_bytes;
+ }
/* Adjust the multibyteness of TEXT to that of the buffer. */
if (NILP (current_buffer->enable_multibyte_characters)
!= ! STRING_MULTIBYTE (text))
@@ -5422,24 +5405,19 @@ send_process (proc, buf, len, object)
error ("Output file descriptor of %s is closed", SDATA (p->name));
coding = proc_encode_coding_system[p->outfd];
- Vlast_coding_system_used = coding->symbol;
+ Vlast_coding_system_used = CODING_ID_NAME (coding->id);
if ((STRINGP (object) && STRING_MULTIBYTE (object))
|| (BUFFERP (object)
&& !NILP (XBUFFER (object)->enable_multibyte_characters))
|| EQ (object, Qt))
{
- if (!EQ (coding->symbol, p->encode_coding_system))
+ if (!EQ (Vlast_coding_system_used, p->encode_coding_system))
/* The coding system for encoding was changed to raw-text
because we sent a unibyte text previously. Now we are
sending a multibyte text, thus we must encode it by the
original coding system specified for the current process. */
setup_coding_system (p->encode_coding_system, coding);
- if (coding->eol_type == CODING_EOL_UNDECIDED)
- coding->eol_type = system_eol_type;
- /* src_multibyte should be set to 1 _after_ a call to
- setup_coding_system, since it resets src_multibyte to
- zero. */
coding->src_multibyte = 1;
}
else
@@ -5447,60 +5425,56 @@ send_process (proc, buf, len, object)
/* For sending a unibyte text, character code conversion should
not take place but EOL conversion should. So, setup raw-text
or one of the subsidiary if we have not yet done it. */
- if (coding->type != coding_type_raw_text)
+ if (CODING_REQUIRE_ENCODING (coding))
{
if (CODING_REQUIRE_FLUSHING (coding))
{
/* But, before changing the coding, we must flush out data. */
coding->mode |= CODING_MODE_LAST_BLOCK;
send_process (proc, "", 0, Qt);
+ coding->mode &= CODING_MODE_LAST_BLOCK;
}
+ setup_coding_system (raw_text_coding_system
+ (Vlast_coding_system_used),
+ coding);
coding->src_multibyte = 0;
- setup_raw_text_coding_system (coding);
}
}
coding->dst_multibyte = 0;
if (CODING_REQUIRE_ENCODING (coding))
{
- int require = encoding_buffer_size (coding, len);
- int from_byte = -1, from = -1, to = -1;
-
+ coding->dst_object = Qt;
if (BUFFERP (object))
{
- from_byte = BUF_PTR_BYTE_POS (XBUFFER (object), buf);
- from = buf_bytepos_to_charpos (XBUFFER (object), from_byte);
- to = buf_bytepos_to_charpos (XBUFFER (object), from_byte + len);
+ int from_byte, from, to;
+ int save_pt, save_pt_byte;
+ struct buffer *cur = current_buffer;
+
+ set_buffer_internal (XBUFFER (object));
+ save_pt = PT, save_pt_byte = PT_BYTE;
+
+ from_byte = PTR_BYTE_POS (buf);
+ from = BYTE_TO_CHAR (from_byte);
+ to = BYTE_TO_CHAR (from_byte + len);
+ TEMP_SET_PT_BOTH (from, from_byte);
+ encode_coding_object (coding, object, from, from_byte,
+ to, from_byte + len, Qt);
+ TEMP_SET_PT_BOTH (save_pt, save_pt_byte);
+ set_buffer_internal (cur);
}
else if (STRINGP (object))
{
- from_byte = buf - SDATA (object);
- from = string_byte_to_char (object, from_byte);
- to = string_byte_to_char (object, from_byte + len);
+ encode_coding_string (coding, object, 1);
}
-
- if (coding->composing != COMPOSITION_DISABLED)
+ else
{
- if (from_byte >= 0)
- coding_save_composition (coding, from, to, object);
- else
- coding->composing = COMPOSITION_DISABLED;
+ coding->dst_object = make_unibyte_string (buf, len);
+ coding->produced = len;
}
- if (SBYTES (p->encoding_buf) < require)
- p->encoding_buf = make_uninit_string (require);
-
- if (from_byte >= 0)
- buf = (BUFFERP (object)
- ? BUF_BYTE_ADDRESS (XBUFFER (object), from_byte)
- : SDATA (object) + from_byte);
-
- object = p->encoding_buf;
- encode_coding (coding, (char *) buf, SDATA (object),
- len, SBYTES (object));
- coding_free_composition_data (coding);
len = coding->produced;
- buf = SDATA (object);
+ buf = SDATA (coding->dst_object);
}
#ifdef VMS
@@ -5694,91 +5668,6 @@ send_process (proc, buf, len, object)
UNGCPRO;
}
-static Lisp_Object
-send_process_object_unwind (buf)
- Lisp_Object buf;
-{
- Lisp_Object tembuf;
-
- if (XBUFFER (buf) == current_buffer)
- return Qnil;
- tembuf = Fcurrent_buffer ();
- Fset_buffer (buf);
- Fkill_buffer (tembuf);
- return Qnil;
-}
-
-/* Send current contents of region between START and END to PROC.
- If START is a string, send it instead.
- This function can evaluate Lisp code and can garbage collect. */
-
-static void
-send_process_object (proc, start, end)
- Lisp_Object proc, start, end;
-{
- int count = SPECPDL_INDEX ();
- Lisp_Object object = STRINGP (start) ? start : Fcurrent_buffer ();
- struct buffer *given_buffer = current_buffer;
- unsigned char *buf;
- int len;
-
- record_unwind_protect (send_process_object_unwind, Fcurrent_buffer ());
-
- if (STRINGP (object) ? STRING_MULTIBYTE (object)
- : ! NILP (XBUFFER (object)->enable_multibyte_characters))
- {
- struct Lisp_Process *p = XPROCESS (proc);
- struct coding_system *coding;
-
- if (p->raw_status_new)
- update_status (p);
- if (! EQ (p->status, Qrun))
- error ("Process %s not running", SDATA (p->name));
- if (p->outfd < 0)
- error ("Output file descriptor of %s is closed", SDATA (p->name));
-
- coding = proc_encode_coding_system[p->outfd];
- if (! EQ (coding->symbol, p->encode_coding_system))
- /* The coding system for encoding was changed to raw-text
- because we sent a unibyte text previously. Now we are
- sending a multibyte text, thus we must encode it by the
- original coding system specified for the current process. */
- setup_coding_system (p->encode_coding_system, coding);
- if (! NILP (coding->pre_write_conversion))
- {
- struct gcpro gcpro1, gcpro2;
-
- GCPRO2 (proc, object);
- call2 (coding->pre_write_conversion, start, end);
- UNGCPRO;
- if (given_buffer != current_buffer)
- {
- start = make_number (BEGV), end = make_number (ZV);
- object = Fcurrent_buffer ();
- }
- }
- }
-
- if (BUFFERP (object))
- {
- EMACS_INT start_byte;
-
- if (XINT (start) < GPT && XINT (end) > GPT)
- move_gap (XINT (end));
- start_byte = CHAR_TO_BYTE (XINT (start));
- buf = BYTE_POS_ADDR (start_byte);
- len = CHAR_TO_BYTE (XINT (end)) - start_byte;
- }
- else
- {
- buf = SDATA (object);
- len = SBYTES (object);
- }
- send_process (proc, buf, len, object);
-
- unbind_to (count, Qnil);
-}
-
DEFUN ("process-send-region", Fprocess_send_region, Sprocess_send_region,
3, 3, 0,
doc: /* Send current contents of region as input to PROCESS.
@@ -5792,10 +5681,19 @@ Output from processes can arrive in between bunches. */)
Lisp_Object process, start, end;
{
Lisp_Object proc;
+ int start1, end1;
proc = get_process (process);
validate_region (&start, &end);
- send_process_object (proc, start, end);
+
+ if (XINT (start) < GPT && XINT (end) > GPT)
+ move_gap (XINT (start));
+
+ start1 = CHAR_TO_BYTE (XINT (start));
+ end1 = CHAR_TO_BYTE (XINT (end));
+ send_process (proc, BYTE_POS_ADDR (start1), end1 - start1,
+ Fcurrent_buffer ());
+
return Qnil;
}
@@ -5813,7 +5711,8 @@ Output from processes can arrive in between bunches. */)
Lisp_Object proc;
CHECK_STRING (string);
proc = get_process (process);
- send_process_object (proc, string, Qnil);
+ send_process (proc, SDATA (string),
+ SBYTES (string), string);
return Qnil;
}
@@ -6462,10 +6361,10 @@ kill_buffer_processes (buffer)
{
Lisp_Object tail, proc;
- for (tail = Vprocess_alist; GC_CONSP (tail); tail = XCDR (tail))
+ for (tail = Vprocess_alist; CONSP (tail); tail = XCDR (tail))
{
proc = XCDR (XCAR (tail));
- if (GC_PROCESSP (proc)
+ if (PROCESSP (proc)
&& (NILP (buffer) || EQ (XPROCESS (proc)->buffer, buffer)))
{
if (NETCONN_P (proc))
@@ -6560,11 +6459,11 @@ sigchld_handler (signo)
/* Find the process that signaled us, and record its status. */
/* The process can have been deleted by Fdelete_process. */
- for (tail = deleted_pid_list; GC_CONSP (tail); tail = XCDR (tail))
+ for (tail = deleted_pid_list; CONSP (tail); tail = XCDR (tail))
{
Lisp_Object xpid = XCAR (tail);
- if ((GC_INTEGERP (xpid) && pid == (pid_t) XINT (xpid))
- || (GC_FLOATP (xpid) && pid == (pid_t) XFLOAT_DATA (xpid)))
+ if ((INTEGERP (xpid) && pid == (pid_t) XINT (xpid))
+ || (FLOATP (xpid) && pid == (pid_t) XFLOAT_DATA (xpid)))
{
XSETCAR (tail, Qnil);
goto sigchld_end_of_loop;
@@ -6573,11 +6472,11 @@ sigchld_handler (signo)
/* Otherwise, if it is asynchronous, it is in Vprocess_alist. */
p = 0;
- for (tail = Vprocess_alist; GC_CONSP (tail); tail = XCDR (tail))
+ for (tail = Vprocess_alist; CONSP (tail); tail = XCDR (tail))
{
proc = XCDR (XCAR (tail));
p = XPROCESS (proc);
- if (GC_EQ (p->childp, Qt) && p->pid == pid)
+ if (EQ (p->childp, Qt) && p->pid == pid)
break;
p = 0;
}
@@ -6585,7 +6484,7 @@ sigchld_handler (signo)
/* Look for an asynchronous process whose pid hasn't been filled
in yet. */
if (p == 0)
- for (tail = Vprocess_alist; GC_CONSP (tail); tail = XCDR (tail))
+ for (tail = Vprocess_alist; CONSP (tail); tail = XCDR (tail))
{
proc = XCDR (XCAR (tail));
p = XPROCESS (proc);
@@ -6908,7 +6807,7 @@ encode subprocess input. */)
error ("Output file descriptor of %s closed", SDATA (p->name));
Fcheck_coding_system (decoding);
Fcheck_coding_system (encoding);
-
+ encoding = coding_inherit_eol_type (encoding, Qnil);
p->decode_coding_system = decoding;
p->encode_coding_system = encoding;
setup_process_coding_systems (process);
@@ -6963,12 +6862,20 @@ DEFUN ("process-filter-multibyte-p", Fprocess_filter_multibyte_p,
-/* Add DESC to the set of keyboard input descriptors. */
+/* The first time this is called, assume keyboard input comes from DESC
+ instead of from where we used to expect it.
+ Subsequent calls mean assume input keyboard can come from DESC
+ in addition to other places. */
+
+static int add_keyboard_wait_descriptor_called_flag;
void
add_keyboard_wait_descriptor (desc)
int desc;
{
+ if (! add_keyboard_wait_descriptor_called_flag)
+ FD_CLR (0, &input_wait_mask);
+ add_keyboard_wait_descriptor_called_flag = 1;
FD_SET (desc, &input_wait_mask);
FD_SET (desc, &non_process_wait_mask);
if (desc > max_keyboard_desc)
@@ -7074,12 +6981,7 @@ init_process ()
process_output_skip = 0;
#endif
- /* Don't do this, it caused infinite select loops. The display
- method should call add_keyboard_wait_descriptor on stdin if it
- needs that. */
-#if 0
FD_SET (0, &input_wait_mask);
-#endif
Vprocess_alist = Qnil;
#ifdef SIGCHLD
@@ -7327,7 +7229,7 @@ The variable takes effect when `start-process' is called. */);
#include "lisp.h"
#include "systime.h"
-#include "charset.h"
+#include "character.h"
#include "coding.h"
#include "termopts.h"
#include "sysselect.h"
diff --git a/src/process.h b/src/process.h
index c1b1bc01e3..eaed95fe4b 100644
--- a/src/process.h
+++ b/src/process.h
@@ -34,7 +34,7 @@ Boston, MA 02110-1301, USA. */
struct Lisp_Process
{
- EMACS_UINT size;
+ EMACS_INT size;
struct Lisp_Vector *v_next;
/* Name of subprocess terminal. */
Lisp_Object tty_name;
diff --git a/src/puresize.h b/src/puresize.h
index 4b88283d8d..8ce51dbfd8 100644
--- a/src/puresize.h
+++ b/src/puresize.h
@@ -43,7 +43,7 @@ Boston, MA 02110-1301, USA. */
#endif
#ifndef BASE_PURESIZE
-#define BASE_PURESIZE (1164000 + SYSTEM_PURESIZE_EXTRA + SITELOAD_PURESIZE_EXTRA)
+#define BASE_PURESIZE (1140000 + SYSTEM_PURESIZE_EXTRA + SITELOAD_PURESIZE_EXTRA)
#endif
/* Increase BASE_PURESIZE by a ratio depending on the machine's word size. */
diff --git a/src/regex.c b/src/regex.c
index 125a3388f1..0858378c6e 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -124,7 +124,7 @@
# define SYNTAX_ENTRY_VIA_PROPERTY
# include "syntax.h"
-# include "charset.h"
+# include "character.h"
# include "category.h"
# ifdef malloc
@@ -145,28 +145,51 @@
# define POS_AS_IN_BUFFER(p) ((p) + (NILP (re_match_object) || BUFFERP (re_match_object)))
# define RE_MULTIBYTE_P(bufp) ((bufp)->multibyte)
-# define RE_STRING_CHAR(p, s) \
+# define RE_TARGET_MULTIBYTE_P(bufp) ((bufp)->target_multibyte)
+# define RE_STRING_CHAR(p, s, multibyte) \
(multibyte ? (STRING_CHAR (p, s)) : (*(p)))
-# define RE_STRING_CHAR_AND_LENGTH(p, s, len) \
+# define RE_STRING_CHAR_AND_LENGTH(p, s, len, multibyte) \
(multibyte ? (STRING_CHAR_AND_LENGTH (p, s, len)) : ((len) = 1, *(p)))
-/* Set C a (possibly multibyte) character before P. P points into a
- string which is the virtual concatenation of STR1 (which ends at
- END1) or STR2 (which ends at END2). */
-# define GET_CHAR_BEFORE_2(c, p, str1, end1, str2, end2) \
- do { \
- if (multibyte) \
- { \
- re_char *dtemp = (p) == (str2) ? (end1) : (p); \
- re_char *dlimit = ((p) > (str2) && (p) <= (end2)) ? (str2) : (str1); \
- re_char *d0 = dtemp; \
- PREV_CHAR_BOUNDARY (d0, dlimit); \
- c = STRING_CHAR (d0, dtemp - d0); \
- } \
- else \
- (c = ((p) == (str2) ? (end1) : (p))[-1]); \
+# define RE_CHAR_TO_MULTIBYTE(c) unibyte_to_multibyte_table[(c)]
+
+# define RE_CHAR_TO_UNIBYTE(c) \
+ (ASCII_CHAR_P (c) ? (c) \
+ : CHAR_BYTE8_P (c) ? CHAR_TO_BYTE8 (c) \
+ : multibyte_char_to_unibyte_safe (c))
+
+/* Set C a (possibly converted to multibyte) character before P. P
+ points into a string which is the virtual concatenation of STR1
+ (which ends at END1) or STR2 (which ends at END2). */
+# define GET_CHAR_BEFORE_2(c, p, str1, end1, str2, end2) \
+ do { \
+ if (target_multibyte) \
+ { \
+ re_char *dtemp = (p) == (str2) ? (end1) : (p); \
+ re_char *dlimit = ((p) > (str2) && (p) <= (end2)) ? (str2) : (str1); \
+ while (dtemp-- > dlimit && !CHAR_HEAD_P (*dtemp)); \
+ c = STRING_CHAR (dtemp, (p) - dtemp); \
+ } \
+ else \
+ { \
+ (c = ((p) == (str2) ? (end1) : (p))[-1]); \
+ (c) = RE_CHAR_TO_MULTIBYTE (c); \
+ } \
} while (0)
+/* Set C a (possibly converted to multibyte) character at P, and set
+ LEN to the byte length of that character. */
+# define GET_CHAR_AFTER(c, p, len) \
+ do { \
+ if (target_multibyte) \
+ (c) = STRING_CHAR_AND_LENGTH (p, 0, len); \
+ else \
+ { \
+ (c) = *p; \
+ len = 1; \
+ (c) = RE_CHAR_TO_MULTIBYTE (c); \
+ } \
+ } while (0)
#else /* not emacs */
@@ -278,6 +301,7 @@ enum syntaxcode { Swhitespace = 0, Sword = 1, Ssymbol = 2 };
# define CHARSET_LEADING_CODE_BASE(c) 0
# define MAX_MULTIBYTE_LENGTH 1
# define RE_MULTIBYTE_P(x) 0
+# define RE_TARGET_MULTIBYTE_P(x) 0
# define WORD_BOUNDARY_P(c1, c2) (0)
# define CHAR_HEAD_P(p) (1)
# define SINGLE_BYTE_CHAR_P(c) (1)
@@ -285,13 +309,21 @@ enum syntaxcode { Swhitespace = 0, Sword = 1, Ssymbol = 2 };
# define MULTIBYTE_FORM_LENGTH(p, s) (1)
# define PREV_CHAR_BOUNDARY(p, limit) ((p)--)
# define STRING_CHAR(p, s) (*(p))
-# define RE_STRING_CHAR STRING_CHAR
+# define RE_STRING_CHAR(p, s, multibyte) STRING_CHAR ((p), (s))
# define CHAR_STRING(c, s) (*(s) = (c), 1)
# define STRING_CHAR_AND_LENGTH(p, s, actual_len) ((actual_len) = 1, *(p))
-# define RE_STRING_CHAR_AND_LENGTH STRING_CHAR_AND_LENGTH
+# define RE_STRING_CHAR_AND_LENGTH(p, s, len, multibyte) STRING_CHAR_AND_LENGTH ((p), (s), (len))
+# define RE_CHAR_TO_MULTIBYTE(c) (c)
+# define RE_CHAR_TO_UNIBYTE(c) (c)
# define GET_CHAR_BEFORE_2(c, p, str1, end1, str2, end2) \
(c = ((p) == (str2) ? *((end1) - 1) : *((p) - 1)))
+# define GET_CHAR_AFTER(c, p, len) \
+ (c = *p, len = 1)
# define MAKE_CHAR(charset, c1, c2) (c1)
+# define BYTE8_TO_CHAR(c) (c)
+# define CHAR_BYTE8_P(c) (0)
+# define CHAR_LEADING_CODE(c) (c)
+
#endif /* not emacs */
#ifndef RE_TRANSLATE
@@ -497,7 +529,7 @@ init_syntax_once ()
# ifdef __GNUC__
# define alloca __builtin_alloca
# else /* not __GNUC__ */
-# if HAVE_ALLOCA_H
+# ifdef HAVE_ALLOCA_H
# include <alloca.h>
# endif /* HAVE_ALLOCA_H */
# endif /* not __GNUC__ */
@@ -1366,12 +1398,18 @@ static const char *re_error_msgid[] =
/* Normally, this is fine. */
#define MATCH_MAY_ALLOCATE
+/* When using GNU C, we are not REALLY using the C alloca, no matter
+ what config.h may say. So don't take precautions for it. */
+#ifdef __GNUC__
+# undef C_ALLOCA
+#endif
+
/* The match routines may not allocate if (1) they would do it with malloc
and (2) it's not safe for them to use malloc.
Note that if REL_ALLOC is defined, matching would not use malloc for the
failure stack, but we would still use it for the register vectors;
so REL_ALLOC should not affect this. */
-#if defined REGEX_MALLOC && defined emacs
+#if (defined C_ALLOCA || defined REGEX_MALLOC) && defined emacs
# undef MATCH_MAY_ALLOCATE
#endif
@@ -1731,7 +1769,7 @@ static int analyse_first _RE_ARGS ((re_char *p, re_char *pend,
do { \
int len; \
if (p == pend) return REG_EEND; \
- c = RE_STRING_CHAR_AND_LENGTH (p, pend - p, len); \
+ c = RE_STRING_CHAR_AND_LENGTH (p, pend - p, len, multibyte); \
p += len; \
} while (0)
@@ -1942,10 +1980,10 @@ struct range_table_work_area
#define EXTEND_RANGE_TABLE(work_area, n) \
do { \
- if (((work_area)->used + (n)) * sizeof (int) > (work_area)->allocated) \
+ if (((work_area).used + (n)) * sizeof (int) > (work_area).allocated) \
{ \
- extend_range_table_work_area (work_area); \
- if ((work_area)->table == 0) \
+ extend_range_table_work_area (&work_area); \
+ if ((work_area).table == 0) \
return (REG_ESPACE); \
} \
} while (0)
@@ -1962,15 +2000,12 @@ struct range_table_work_area
#define BIT_UPPER 0x10
#define BIT_MULTIBYTE 0x20
-/* Set a range START..END to WORK_AREA.
- The range is passed through TRANSLATE, so START and END
- should be untranslated. */
-#define SET_RANGE_TABLE_WORK_AREA(work_area, start, end) \
+/* Set a range (RANGE_START, RANGE_END) to WORK_AREA. */
+#define SET_RANGE_TABLE_WORK_AREA(work_area, range_start, range_end) \
do { \
- int tem; \
- tem = set_image_of_range (&work_area, start, end, translate); \
- if (tem > 0) \
- FREE_STACK_RETURN (tem); \
+ EXTEND_RANGE_TABLE ((work_area), 2); \
+ (work_area).table[(work_area).used++] = (range_start); \
+ (work_area).table[(work_area).used++] = (range_end); \
} while (0)
/* Free allocated memory for WORK_AREA. */
@@ -1990,6 +2025,113 @@ struct range_table_work_area
#define SET_LIST_BIT(c) (b[((c)) / BYTEWIDTH] |= 1 << ((c) % BYTEWIDTH))
+#ifdef emacs
+
+/* Store characters in the range FROM to TO in the bitmap at B (for
+ ASCII and unibyte characters) and WORK_AREA (for multibyte
+ characters) while translating them and paying attention to the
+ continuity of translated characters.
+
+ Implementation note: It is better to implement these fairly big
+ macros by a function, but it's not that easy because macros called
+ in this macro assume various local variables already declared. */
+
+/* Both FROM and TO are ASCII characters. */
+
+#define SETUP_ASCII_RANGE(work_area, FROM, TO) \
+ do { \
+ int C0, C1; \
+ \
+ for (C0 = (FROM); C0 <= (TO); C0++) \
+ { \
+ C1 = TRANSLATE (C0); \
+ if (! ASCII_CHAR_P (C1)) \
+ { \
+ SET_RANGE_TABLE_WORK_AREA ((work_area), C1, C1); \
+ if ((C1 = RE_CHAR_TO_UNIBYTE (C1)) < 0) \
+ C1 = C0; \
+ } \
+ SET_LIST_BIT (C1); \
+ } \
+ } while (0)
+
+
+/* Both FROM and TO are unibyte characters (0x80..0xFF). */
+
+#define SETUP_UNIBYTE_RANGE(work_area, FROM, TO) \
+ do { \
+ int C0, C1, C2, I; \
+ int USED = RANGE_TABLE_WORK_USED (work_area); \
+ \
+ for (C0 = (FROM); C0 <= (TO); C0++) \
+ { \
+ C1 = RE_CHAR_TO_MULTIBYTE (C0); \
+ if (CHAR_BYTE8_P (C1)) \
+ SET_LIST_BIT (C0); \
+ else \
+ { \
+ C2 = TRANSLATE (C1); \
+ if (C2 == C1 \
+ || (C1 = RE_CHAR_TO_UNIBYTE (C2)) < 0) \
+ C1 = C0; \
+ SET_LIST_BIT (C1); \
+ for (I = RANGE_TABLE_WORK_USED (work_area) - 2; I >= USED; I -= 2) \
+ { \
+ int from = RANGE_TABLE_WORK_ELT (work_area, I); \
+ int to = RANGE_TABLE_WORK_ELT (work_area, I + 1); \
+ \
+ if (C2 >= from - 1 && C2 <= to + 1) \
+ { \
+ if (C2 == from - 1) \
+ RANGE_TABLE_WORK_ELT (work_area, I)--; \
+ else if (C2 == to + 1) \
+ RANGE_TABLE_WORK_ELT (work_area, I + 1)++; \
+ break; \
+ } \
+ } \
+ if (I < USED) \
+ SET_RANGE_TABLE_WORK_AREA ((work_area), C2, C2); \
+ } \
+ } \
+ } while (0)
+
+
+/* Both FROM and TO are mulitbyte characters. */
+
+#define SETUP_MULTIBYTE_RANGE(work_area, FROM, TO) \
+ do { \
+ int C0, C1, C2, I, USED = RANGE_TABLE_WORK_USED (work_area); \
+ \
+ SET_RANGE_TABLE_WORK_AREA ((work_area), (FROM), (TO)); \
+ for (C0 = (FROM); C0 <= (TO); C0++) \
+ { \
+ C1 = TRANSLATE (C0); \
+ if ((C2 = RE_CHAR_TO_UNIBYTE (C1)) >= 0 \
+ || (C1 != C0 && (C2 = RE_CHAR_TO_UNIBYTE (C0)) >= 0)) \
+ SET_LIST_BIT (C2); \
+ if (C1 >= (FROM) && C1 <= (TO)) \
+ continue; \
+ for (I = RANGE_TABLE_WORK_USED (work_area) - 2; I >= USED; I -= 2) \
+ { \
+ int from = RANGE_TABLE_WORK_ELT (work_area, I); \
+ int to = RANGE_TABLE_WORK_ELT (work_area, I + 1); \
+ \
+ if (C1 >= from - 1 && C1 <= to + 1) \
+ { \
+ if (C1 == from - 1) \
+ RANGE_TABLE_WORK_ELT (work_area, I)--; \
+ else if (C1 == to + 1) \
+ RANGE_TABLE_WORK_ELT (work_area, I + 1)++; \
+ break; \
+ } \
+ } \
+ if (I < USED) \
+ SET_RANGE_TABLE_WORK_AREA ((work_area), C1, C1); \
+ } \
+ } while (0)
+
+#endif /* emacs */
+
/* Get the next unsigned number in the uncompiled pattern. */
#define GET_UNSIGNED_NUMBER(num) \
do { \
@@ -2113,6 +2255,7 @@ extend_range_table_work_area (work_area)
= (int *) malloc (work_area->allocated);
}
+#if 0
#ifdef emacs
/* Carefully find the ranges of codes that are equivalent
@@ -2345,6 +2488,7 @@ set_image_of_range (work_area, start, end, translate)
return -1;
}
+#endif /* 0 */
#ifndef MATCH_MAY_ALLOCATE
@@ -2483,6 +2627,9 @@ regex_compile (pattern, size, syntax, bufp)
/* If the object matched can contain multibyte characters. */
const boolean multibyte = RE_MULTIBYTE_P (bufp);
+ /* If a target of matching can contain multibyte characters. */
+ const boolean target_multibyte = RE_TARGET_MULTIBYTE_P (bufp);
+
/* Nonzero if we have pushed down into a subpattern. */
int in_subpattern = 0;
@@ -2835,6 +2982,7 @@ regex_compile (pattern, size, syntax, bufp)
{
boolean escaped_char = false;
const unsigned char *p2 = p;
+ re_wchar_t ch, c2;
if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
@@ -2861,10 +3009,6 @@ regex_compile (pattern, size, syntax, bufp)
break;
}
- /* What should we do for the character which is
- greater than 0x7F, but not BASE_LEADING_CODE_P?
- XXX */
-
/* See if we're at the beginning of a possible character
class. */
@@ -2901,8 +3045,8 @@ regex_compile (pattern, size, syntax, bufp)
them). */
if (c == ':' && *p == ']')
{
- re_wchar_t ch;
re_wctype_t cc;
+ int limit;
cc = re_wctype (str);
@@ -2915,6 +3059,15 @@ regex_compile (pattern, size, syntax, bufp)
if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
+#ifndef emacs
+ for (ch = 0; ch < (1 << BYTEWIDTH); ++ch)
+ if (re_iswctype (btowc (ch), cc))
+ {
+ c = TRANSLATE (ch);
+ if (c < (1 << BYTEWIDTH))
+ SET_LIST_BIT (c);
+ }
+#else /* emacs */
/* Most character classes in a multibyte match
just set a flag. Exceptions are is_blank,
is_digit, is_cntrl, and is_xdigit, since
@@ -2922,18 +3075,25 @@ regex_compile (pattern, size, syntax, bufp)
don't need to handle them for multibyte.
They are distinguished by a negative wctype. */
- if (multibyte)
- SET_RANGE_TABLE_WORK_AREA_BIT (range_table_work,
- re_wctype_to_bit (cc));
-
- for (ch = 0; ch < 1 << BYTEWIDTH; ++ch)
+ for (ch = 0; ch < 256; ++ch)
{
- int translated = TRANSLATE (ch);
- if (translated < (1 << BYTEWIDTH)
- && re_iswctype (btowc (ch), cc))
- SET_LIST_BIT (translated);
+ c = RE_CHAR_TO_MULTIBYTE (ch);
+ if (! CHAR_BYTE8_P (c)
+ && re_iswctype (c, cc))
+ {
+ SET_LIST_BIT (ch);
+ c1 = TRANSLATE (c);
+ if (c1 == c)
+ continue;
+ if (ASCII_CHAR_P (c1))
+ SET_LIST_BIT (c1);
+ else if ((c1 = RE_CHAR_TO_UNIBYTE (c1)) >= 0)
+ SET_LIST_BIT (c1);
+ }
}
-
+ SET_RANGE_TABLE_WORK_AREA_BIT
+ (range_table_work, re_wctype_to_bit (cc));
+#endif /* emacs */
/* In most cases the matching rule for char classes
only uses the syntax table for multibyte chars,
so that the content of the syntax-table it is not
@@ -2966,64 +3126,63 @@ regex_compile (pattern, size, syntax, bufp)
/* Fetch the character which ends the range. */
PATFETCH (c1);
-
- if (SINGLE_BYTE_CHAR_P (c))
- {
- if (! SINGLE_BYTE_CHAR_P (c1))
- {
- /* Handle a range starting with a
- character of less than 256, and ending
- with a character of not less than 256.
- Split that into two ranges, the low one
- ending at 0377, and the high one
- starting at the smallest character in
- the charset of C1 and ending at C1. */
- int charset = CHAR_CHARSET (c1);
- re_wchar_t c2 = MAKE_CHAR (charset, 0, 0);
-
- SET_RANGE_TABLE_WORK_AREA (range_table_work,
- c2, c1);
- c1 = 0377;
- }
- }
- else if (!SAME_CHARSET_P (c, c1))
- FREE_STACK_RETURN (REG_ERANGEX);
+#ifdef emacs
+ if (CHAR_BYTE8_P (c1)
+ && ! ASCII_CHAR_P (c) && ! CHAR_BYTE8_P (c))
+ /* Treat the range from a multibyte character to
+ raw-byte character as empty. */
+ c = c1 + 1;
+#endif /* emacs */
}
else
/* Range from C to C. */
c1 = c;
- /* Set the range ... */
- if (SINGLE_BYTE_CHAR_P (c))
- /* ... into bitmap. */
+ if (c > c1)
{
- re_wchar_t this_char;
- re_wchar_t range_start = c, range_end = c1;
-
- /* If the start is after the end, the range is empty. */
- if (range_start > range_end)
+ if (syntax & RE_NO_EMPTY_RANGES)
+ FREE_STACK_RETURN (REG_ERANGEX);
+ /* Else, repeat the loop. */
+ }
+ else
+ {
+#ifndef emacs
+ /* Set the range into bitmap */
+ for (; c <= c1; c++)
{
- if (syntax & RE_NO_EMPTY_RANGES)
- FREE_STACK_RETURN (REG_ERANGE);
- /* Else, repeat the loop. */
+ ch = TRANSLATE (c);
+ if (ch < (1 << BYTEWIDTH))
+ SET_LIST_BIT (ch);
}
- else
+#else /* emacs */
+ if (c < 128)
{
- for (this_char = range_start; this_char <= range_end;
- this_char++)
+ ch = MIN (127, c1);
+ SETUP_ASCII_RANGE (range_table_work, c, ch);
+ c = ch + 1;
+ if (CHAR_BYTE8_P (c1))
+ c = BYTE8_TO_CHAR (128);
+ }
+ if (c <= c1)
+ {
+ if (CHAR_BYTE8_P (c))
+ {
+ c = CHAR_TO_BYTE8 (c);
+ c1 = CHAR_TO_BYTE8 (c1);
+ for (; c <= c1; c++)
+ SET_LIST_BIT (c);
+ }
+ else if (multibyte)
+ {
+ SETUP_MULTIBYTE_RANGE (range_table_work, c, c1);
+ }
+ else
{
- int translated = TRANSLATE (this_char);
- if (translated < (1 << BYTEWIDTH))
- SET_LIST_BIT (translated);
- else
- SET_RANGE_TABLE_WORK_AREA
- (range_table_work, translated, translated);
+ SETUP_UNIBYTE_RANGE (range_table_work, c, c1);
}
}
+#endif /* emacs */
}
- else
- /* ... into range table. */
- SET_RANGE_TABLE_WORK_AREA (range_table_work, c, c1);
}
/* Discard any (non)matching list bytes that are all 0 at the
@@ -3634,12 +3793,25 @@ regex_compile (pattern, size, syntax, bufp)
{
int len;
- c = TRANSLATE (c);
if (multibyte)
- len = CHAR_STRING (c, b);
+ {
+ c = TRANSLATE (c);
+ len = CHAR_STRING (c, b);
+ b += len;
+ }
else
- *b = c, len = 1;
- b += len;
+ {
+ c1 = RE_CHAR_TO_MULTIBYTE (c);
+ if (! CHAR_BYTE8_P (c1))
+ {
+ re_wchar_t c2 = TRANSLATE (c1);
+
+ if (c1 != c2 && (c1 = RE_CHAR_TO_UNIBYTE (c2)) >= 0)
+ c = c1;
+ }
+ *b++ = c;
+ len = 1;
+ }
(*pending_exact) += len;
}
@@ -3909,14 +4081,21 @@ analyse_first (p, pend, fastmap, multibyte)
case exactn:
if (fastmap)
{
- int c = RE_STRING_CHAR (p + 1, pend - p);
- /* When fast-scanning, the fastmap can be indexed either with
- a char (smaller than 256) or with the first byte of
- a char's byte sequence. So we have to conservatively add
- both to the table. */
- if (SINGLE_BYTE_CHAR_P (c))
- fastmap[c] = 1;
+ /* If multibyte is nonzero, the first byte of each
+ character is an ASCII or a leading code. Otherwise,
+ each byte is a character. Thus, this works in both
+ cases. */
fastmap[p[1]] = 1;
+ if (! multibyte)
+ {
+ /* For the case of matching this unibyte regex
+ against multibyte, we must set a leading code of
+ the corresponding multibyte character. */
+ int c = RE_CHAR_TO_MULTIBYTE (p[1]);
+
+ if (! CHAR_BYTE8_P (c))
+ fastmap[CHAR_LEADING_CODE (c)] = 1;
+ }
}
break;
@@ -3929,18 +4108,14 @@ analyse_first (p, pend, fastmap, multibyte)
case charset_not:
- /* Chars beyond end of bitmap are possible matches.
- All the single-byte codes can occur in multibyte buffers.
- So any that are not listed in the charset
- are possible matches, even in multibyte buffers. */
if (!fastmap) break;
- /* We don't need to mark LEADING_CODE_8_BIT_CONTROL specially
- because it will automatically be set when needed by virtue of
- being larger than the highest char of its charset (0xbf) but
- smaller than (1<<BYTEWIDTH). */
- for (j = CHARSET_BITMAP_SIZE (&p[-1]) * BYTEWIDTH;
- j < (1 << BYTEWIDTH); j++)
- fastmap[j] = 1;
+ {
+ /* Chars beyond end of bitmap are possible matches. */
+ for (j = CHARSET_BITMAP_SIZE (&p[-1]) * BYTEWIDTH;
+ j < (1 << BYTEWIDTH); j++)
+ fastmap[j] = 1;
+ }
+
/* Fallthrough */
case charset:
if (!fastmap) break;
@@ -3948,28 +4123,24 @@ analyse_first (p, pend, fastmap, multibyte)
for (j = CHARSET_BITMAP_SIZE (&p[-1]) * BYTEWIDTH - 1, p++;
j >= 0; j--)
if (!!(p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH))) ^ not)
- {
- fastmap[j] = 1;
-#ifdef emacs
- if (j >= 0x80 && j < 0xa0)
- fastmap[LEADING_CODE_8_BIT_CONTROL] = 1;
-#endif
- }
+ fastmap[j] = 1;
- if ((not && multibyte)
- /* Any character set can possibly contain a character
+#ifdef emacs
+ if (/* Any leading code can possibly start a character
which doesn't match the specified set of characters. */
- || (CHARSET_RANGE_TABLE_EXISTS_P (&p[-2])
- && CHARSET_RANGE_TABLE_BITS (&p[-2]) != 0))
- /* If we can match a character class, we can match
- any character set. */
+ not
+ ||
+ /* If we can match a character class, we can match any
+ multibyte characters. */
+ (CHARSET_RANGE_TABLE_EXISTS_P (&p[-2])
+ && CHARSET_RANGE_TABLE_BITS (&p[-2]) != 0))
+
{
- set_fastmap_for_multibyte_characters:
if (match_any_multibyte_characters == false)
{
- for (j = 0x80; j < 0xA0; j++) /* XXX */
- if (BASE_LEADING_CODE_P (j))
- fastmap[j] = 1;
+ for (j = MIN_MULTIBYTE_LEADING_CODE;
+ j <= MAX_MULTIBYTE_LEADING_CODE; j++)
+ fastmap[j] = 1;
match_any_multibyte_characters = true;
}
}
@@ -3977,9 +4148,10 @@ analyse_first (p, pend, fastmap, multibyte)
else if (!not && CHARSET_RANGE_TABLE_EXISTS_P (&p[-2])
&& match_any_multibyte_characters == false)
{
- /* Set fastmap[I] 1 where I is a base leading code of each
- multibyte character in the range table. */
+ /* Set fastmap[I] to 1 where I is a leading code of each
+ multibyte characer in the range table. */
int c, count;
+ unsigned char lc1, lc2;
/* Make P points the range table. `+ 2' is to skip flag
bits for a character class. */
@@ -3987,14 +4159,19 @@ analyse_first (p, pend, fastmap, multibyte)
/* Extract the number of ranges in range table into COUNT. */
EXTRACT_NUMBER_AND_INCR (count, p);
- for (; count > 0; count--, p += 2 * 3) /* XXX */
+ for (; count > 0; count--, p += 3)
{
- /* Extract the start of each range. */
+ /* Extract the start and end of each range. */
EXTRACT_CHARACTER (c, p);
- j = CHAR_CHARSET (c);
- fastmap[CHARSET_LEADING_CODE_BASE (j)] = 1;
+ lc1 = CHAR_LEADING_CODE (c);
+ p += 3;
+ EXTRACT_CHARACTER (c, p);
+ lc2 = CHAR_LEADING_CODE (c);
+ for (j = lc1; j <= lc2; j++)
+ fastmap[j] = 1;
}
}
+#endif
break;
case syntaxspec:
@@ -4017,14 +4194,19 @@ analyse_first (p, pend, fastmap, multibyte)
if (!fastmap) break;
not = (re_opcode_t)p[-1] == notcategoryspec;
k = *p++;
- for (j = 0; j < (1 << BYTEWIDTH); j++)
+ for (j = (1 << BYTEWIDTH); j >= 0; j--)
if ((CHAR_HAS_CATEGORY (j, k)) ^ not)
fastmap[j] = 1;
- if (multibyte)
- /* Any character set can possibly contain a character
- whose category is K (or not). */
- goto set_fastmap_for_multibyte_characters;
+ /* Any leading code can possibly start a character which
+ has or doesn't has the specified category. */
+ if (match_any_multibyte_characters == false)
+ {
+ for (j = MIN_MULTIBYTE_LEADING_CODE;
+ j <= MAX_MULTIBYTE_LEADING_CODE; j++)
+ fastmap[j] = 1;
+ match_any_multibyte_characters = true;
+ }
break;
/* All cases after this match the empty string. These end with
@@ -4274,9 +4456,8 @@ re_search_2 (bufp, str1, size1, str2, size2, startpos, range, regs, stop)
int total_size = size1 + size2;
int endpos = startpos + range;
boolean anchored_start;
-
- /* Nonzero if we have to concern multibyte character. */
- const boolean multibyte = RE_MULTIBYTE_P (bufp);
+ /* Nonzero if we are searching multibyte string. */
+ const boolean multibyte = RE_TARGET_MULTIBYTE_P (bufp);
/* Check for out-of-range STARTPOS. */
if (startpos < 0 || startpos > total_size)
@@ -4372,59 +4553,51 @@ re_search_2 (bufp, str1, size1, str2, size2, startpos, range, regs, stop)
buf_ch = STRING_CHAR_AND_LENGTH (d, range - lim,
buf_charlen);
-
buf_ch = RE_TRANSLATE (translate, buf_ch);
- if (buf_ch >= 0400
- || fastmap[buf_ch])
+ if (fastmap[CHAR_LEADING_CODE (buf_ch)])
break;
range -= buf_charlen;
d += buf_charlen;
}
else
- {
- /* Convert *d to integer to shut up GCC's
- whining about comparison that is always
- true. */
- int di = *d;
-
- while (range > lim
- && !fastmap[RE_TRANSLATE (translate, di)])
- {
- di = *(++d);
- range--;
- }
- }
- }
- else
- do
- {
- re_char *d_start = d;
- while (range > lim && !fastmap[*d])
+ while (range > lim)
{
+ register re_wchar_t ch, translated;
+
+ buf_ch = *d;
+ ch = RE_CHAR_TO_MULTIBYTE (buf_ch);
+ translated = RE_TRANSLATE (translate, ch);
+ if (translated != ch
+ && (ch = RE_CHAR_TO_UNIBYTE (translated)) >= 0)
+ buf_ch = ch;
+ if (fastmap[buf_ch])
+ break;
d++;
range--;
}
-#ifdef emacs
- if (multibyte && range > lim)
+ }
+ else
+ {
+ if (multibyte)
+ while (range > lim)
{
- /* Check that we are at the beginning of a char. */
- int at_boundary;
- AT_CHAR_BOUNDARY_P (at_boundary, d, d_start);
- if (at_boundary)
+ int buf_charlen;
+
+ buf_ch = STRING_CHAR_AND_LENGTH (d, range - lim,
+ buf_charlen);
+ if (fastmap[CHAR_LEADING_CODE (buf_ch)])
break;
- else
- { /* We have matched an internal byte of a char
- rather than the leading byte, so it's a false
- positive: we should keep scanning. */
- d++; range--;
- }
+ range -= buf_charlen;
+ d += buf_charlen;
}
- else
-#endif
- break;
- } while (1);
-
+ else
+ while (range > lim && !fastmap[*d])
+ {
+ d++;
+ range--;
+ }
+ }
startpos += irange - range;
}
else /* Searching backwards. */
@@ -4432,12 +4605,26 @@ re_search_2 (bufp, str1, size1, str2, size2, startpos, range, regs, stop)
int room = (startpos >= size1
? size2 + size1 - startpos
: size1 - startpos);
- buf_ch = RE_STRING_CHAR (d, room);
- buf_ch = TRANSLATE (buf_ch);
-
- if (! (buf_ch >= 0400
- || fastmap[buf_ch]))
- goto advance;
+ if (multibyte)
+ {
+ buf_ch = STRING_CHAR (d, room);
+ buf_ch = TRANSLATE (buf_ch);
+ if (! fastmap[CHAR_LEADING_CODE (buf_ch)])
+ goto advance;
+ }
+ else
+ {
+ register re_wchar_t ch, translated;
+
+ buf_ch = *d;
+ ch = RE_CHAR_TO_MULTIBYTE (buf_ch);
+ translated = TRANSLATE (ch);
+ if (translated != ch
+ && (ch = RE_CHAR_TO_UNIBYTE (translated)) >= 0)
+ buf_ch = ch;
+ if (! fastmap[TRANSLATE (buf_ch)])
+ goto advance;
+ }
}
}
@@ -4448,6 +4635,11 @@ re_search_2 (bufp, str1, size1, str2, size2, startpos, range, regs, stop)
val = re_match_2_internal (bufp, string1, size1, string2, size2,
startpos, regs, stop);
+#ifndef REGEX_MALLOC
+# ifdef C_ALLOCA
+ alloca (0);
+# endif
+#endif
if (val >= 0)
return startpos;
@@ -4711,11 +4903,11 @@ mutually_exclusive_p (bufp, p1, p2)
{
register re_wchar_t c
= (re_opcode_t) *p2 == endline ? '\n'
- : RE_STRING_CHAR (p2 + 2, pend - p2 - 2);
+ : RE_STRING_CHAR (p2 + 2, pend - p2 - 2, multibyte);
if ((re_opcode_t) *p1 == exactn)
{
- if (c != RE_STRING_CHAR (p1 + 2, pend - p1 - 2))
+ if (c != RE_STRING_CHAR (p1 + 2, pend - p1 - 2, multibyte))
{
DEBUG_PRINT3 (" '%c' != '%c' => fast loop.\n", c, p1[2]);
return 1;
@@ -4729,7 +4921,7 @@ mutually_exclusive_p (bufp, p1, p2)
/* Test if C is listed in charset (or charset_not)
at `p1'. */
- if (SINGLE_BYTE_CHAR_P (c))
+ if (! multibyte || IS_REAL_ASCII (c))
{
if (c < CHARSET_BITMAP_SIZE (p1) * BYTEWIDTH
&& p1[2 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH)))
@@ -4772,9 +4964,10 @@ mutually_exclusive_p (bufp, p1, p2)
size of bitmap table of P1 is extracted by
using macro `CHARSET_BITMAP_SIZE'.
- Since we know that all the character listed in
- P2 is ASCII, it is enough to test only bitmap
- table of P1. */
+ In a multibyte case, we know that all the character
+ listed in P2 is ASCII. In a unibyte case, P1 has only a
+ bitmap table. So, in both cases, it is enough to test
+ only the bitmap table of P1. */
if ((re_opcode_t) *p1 == charset)
{
@@ -4883,6 +5076,9 @@ re_match (bufp, string, size, pos, regs)
{
int result = re_match_2_internal (bufp, NULL, 0, (re_char*) string, size,
pos, regs, size);
+# if defined C_ALLOCA && !defined REGEX_MALLOC
+ alloca (0);
+# endif
return result;
}
WEAK_ALIAS (__re_match, re_match)
@@ -4928,10 +5124,14 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
result = re_match_2_internal (bufp, (re_char*) string1, size1,
(re_char*) string2, size2,
pos, regs, stop);
+#if defined C_ALLOCA && !defined REGEX_MALLOC
+ alloca (0);
+#endif
return result;
}
WEAK_ALIAS (__re_match_2, re_match_2)
+
/* This is a separate function so that we can force an alloca cleanup
afterwards. */
static int
@@ -4968,12 +5168,15 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
re_char *p = bufp->buffer;
re_char *pend = p + bufp->used;
- /* We use this to map every character in the string. */
+ /* We use this to map every character in the string. */
RE_TRANSLATE_TYPE translate = bufp->translate;
- /* Nonzero if we have to concern multibyte character. */
+ /* Nonzero if BUFP is setup from a multibyte regex. */
const boolean multibyte = RE_MULTIBYTE_P (bufp);
+ /* Nonzero if STRING1/STRING2 are multibyte. */
+ const boolean target_multibyte = RE_TARGET_MULTIBYTE_P (bufp);
+
/* Failure point stack. Each place that can handle a failure further
down the line pushes a failure point on this stack. It consists of
regstart, and regend for all registers corresponding to
@@ -5325,63 +5528,99 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
/* Remember the start point to rollback upon failure. */
dfail = d;
+#ifndef emacs
/* This is written out as an if-else so we don't waste time
testing `translate' inside the loop. */
if (RE_TRANSLATE_P (translate))
- {
- if (multibyte)
- do
+ do
+ {
+ PREFETCH ();
+ if (RE_TRANSLATE (translate, *d) != *p++)
+ {
+ d = dfail;
+ goto fail;
+ }
+ d++;
+ }
+ while (--mcnt);
+ else
+ do
+ {
+ PREFETCH ();
+ if (*d++ != *p++)
{
- int pat_charlen, buf_charlen;
- unsigned int pat_ch, buf_ch;
+ d = dfail;
+ goto fail;
+ }
+ }
+ while (--mcnt);
+#else /* emacs */
+ /* The cost of testing `translate' is comparatively small. */
+ if (target_multibyte)
+ do
+ {
+ int pat_charlen, buf_charlen;
+ int pat_ch, buf_ch;
- PREFETCH ();
- pat_ch = STRING_CHAR_AND_LENGTH (p, pend - p, pat_charlen);
- buf_ch = STRING_CHAR_AND_LENGTH (d, dend - d, buf_charlen);
+ PREFETCH ();
+ if (multibyte)
+ pat_ch = STRING_CHAR_AND_LENGTH (p, pend - p, pat_charlen);
+ else
+ {
+ pat_ch = RE_CHAR_TO_MULTIBYTE (*p);
+ pat_charlen = 1;
+ }
+ buf_ch = STRING_CHAR_AND_LENGTH (d, dend - d, buf_charlen);
- if (RE_TRANSLATE (translate, buf_ch)
- != pat_ch)
- {
- d = dfail;
- goto fail;
- }
+ if (TRANSLATE (buf_ch) != pat_ch)
+ {
+ d = dfail;
+ goto fail;
+ }
+
+ p += pat_charlen;
+ d += buf_charlen;
+ mcnt -= pat_charlen;
+ }
+ while (mcnt > 0);
+ else
+ do
+ {
+ int pat_charlen, buf_charlen;
+ int pat_ch, buf_ch;
- p += pat_charlen;
- d += buf_charlen;
- mcnt -= pat_charlen;
+ PREFETCH ();
+ if (multibyte)
+ {
+ pat_ch = STRING_CHAR_AND_LENGTH (p, pend - p, pat_charlen);
+ if (CHAR_BYTE8_P (pat_ch))
+ pat_ch = CHAR_TO_BYTE8 (pat_ch);
+ else
+ pat_ch = RE_CHAR_TO_UNIBYTE (pat_ch);
}
- while (mcnt > 0);
- else
- do
+ else
{
- /* Avoid compiler whining about comparison being
- always true. */
- int di;
-
- PREFETCH ();
- di = *d;
- if (RE_TRANSLATE (translate, di) != *p++)
- {
- d = dfail;
- goto fail;
- }
- d++;
+ pat_ch = *p;
+ pat_charlen = 1;
}
- while (--mcnt);
- }
- else
- {
- do
- {
- PREFETCH ();
- if (*d++ != *p++)
- {
- d = dfail;
- goto fail;
- }
- }
- while (--mcnt);
- }
+ buf_ch = RE_CHAR_TO_MULTIBYTE (*d);
+ if (! CHAR_BYTE8_P (buf_ch))
+ {
+ buf_ch = TRANSLATE (buf_ch);
+ buf_ch = RE_CHAR_TO_UNIBYTE (buf_ch);
+ if (buf_ch < 0)
+ buf_ch = *d;
+ }
+ if (buf_ch != pat_ch)
+ {
+ d = dfail;
+ goto fail;
+ }
+ p += pat_charlen;
+ d++;
+ }
+ while (--mcnt);
+#endif
break;
@@ -5394,7 +5633,8 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
DEBUG_PRINT1 ("EXECUTING anychar.\n");
PREFETCH ();
- buf_ch = RE_STRING_CHAR_AND_LENGTH (d, dend - d, buf_charlen);
+ buf_ch = RE_STRING_CHAR_AND_LENGTH (d, dend - d, buf_charlen,
+ target_multibyte);
buf_ch = TRANSLATE (buf_ch);
if ((!(bufp->syntax & RE_DOT_NEWLINE)
@@ -5438,10 +5678,30 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
}
PREFETCH ();
- c = RE_STRING_CHAR_AND_LENGTH (d, dend - d, len);
- c = TRANSLATE (c); /* The character to match. */
+ c = RE_STRING_CHAR_AND_LENGTH (d, dend - d, len, target_multibyte);
+ if (target_multibyte)
+ {
+ int c1;
- if (SINGLE_BYTE_CHAR_P (c))
+ c = TRANSLATE (c);
+ c1 = RE_CHAR_TO_UNIBYTE (c);
+ if (c1 >= 0)
+ c = c1;
+ }
+ else
+ {
+ int c1 = RE_CHAR_TO_MULTIBYTE (c);
+
+ if (! CHAR_BYTE8_P (c1))
+ {
+ c1 = TRANSLATE (c1);
+ c1 = RE_CHAR_TO_UNIBYTE (c1);
+ if (c1 >= 0)
+ c = c1;
+ }
+ }
+
+ if (c < (1 << BYTEWIDTH))
{ /* Lookup bitmap. */
/* Cast to `unsigned' instead of `unsigned char' in
case the bit list is a full 32 bytes long. */
@@ -5581,7 +5841,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
/* Compare that many; failure if mismatch, else move
past them. */
if (RE_TRANSLATE_P (translate)
- ? bcmp_translate (d, d2, mcnt, translate, multibyte)
+ ? bcmp_translate (d, d2, mcnt, translate, target_multibyte)
: memcmp (d, d2, mcnt))
{
d = dfail;
@@ -5604,7 +5864,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
}
else
{
- unsigned char c;
+ unsigned c;
GET_CHAR_BEFORE_2 (c, d, string1, end1, string2, end2);
if (c == '\n')
break;
@@ -5871,6 +6131,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
is the character at D, and S2 is the syntax of C2. */
re_wchar_t c1, c2;
int s1, s2;
+ int dummy;
#ifdef emacs
int offset = PTR_TO_OFFSET (d - 1);
int charpos = SYNTAX_TABLE_BYTE_TO_CHAR (offset);
@@ -5882,7 +6143,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
UPDATE_SYNTAX_TABLE_FORWARD (charpos + 1);
#endif
PREFETCH_NOLIMIT ();
- c2 = RE_STRING_CHAR (d, dend - d);
+ GET_CHAR_AFTER (c2, d, dummy);
s2 = SYNTAX (c2);
if (/* Case 2: Only one of S1 and S2 is Sword. */
@@ -5911,13 +6172,14 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
is the character at D, and S2 is the syntax of C2. */
re_wchar_t c1, c2;
int s1, s2;
+ int dummy;
#ifdef emacs
int offset = PTR_TO_OFFSET (d);
int charpos = SYNTAX_TABLE_BYTE_TO_CHAR (offset);
UPDATE_SYNTAX_TABLE (charpos);
#endif
PREFETCH ();
- c2 = RE_STRING_CHAR (d, dend - d);
+ GET_CHAR_AFTER (c2, d, dummy);
s2 = SYNTAX (c2);
/* Case 2: S2 is not Sword. */
@@ -5955,6 +6217,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
is the character at D, and S2 is the syntax of C2. */
re_wchar_t c1, c2;
int s1, s2;
+ int dummy;
#ifdef emacs
int offset = PTR_TO_OFFSET (d) - 1;
int charpos = SYNTAX_TABLE_BYTE_TO_CHAR (offset);
@@ -5971,9 +6234,9 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
if (!AT_STRINGS_END (d))
{
PREFETCH_NOLIMIT ();
- c2 = RE_STRING_CHAR (d, dend - d);
+ GET_CHAR_AFTER (c2, d, dummy);
#ifdef emacs
- UPDATE_SYNTAX_TABLE_FORWARD (charpos + 1);
+ UPDATE_SYNTAX_TABLE_FORWARD (charpos);
#endif
s2 = SYNTAX (c2);
@@ -6005,7 +6268,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
UPDATE_SYNTAX_TABLE (charpos);
#endif
PREFETCH ();
- c2 = RE_STRING_CHAR (d, dend - d);
+ c2 = RE_STRING_CHAR (d, dend - d, target_multibyte);
s2 = SYNTAX (c2);
/* Case 2: S2 is neither Sword nor Ssymbol. */
@@ -6058,7 +6321,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
if (!AT_STRINGS_END (d))
{
PREFETCH_NOLIMIT ();
- c2 = RE_STRING_CHAR (d, dend - d);
+ c2 = RE_STRING_CHAR (d, dend - d, target_multibyte);
#ifdef emacs
UPDATE_SYNTAX_TABLE_FORWARD (charpos + 1);
#endif
@@ -6088,8 +6351,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
int len;
re_wchar_t c;
- c = RE_STRING_CHAR_AND_LENGTH (d, dend - d, len);
-
+ GET_CHAR_AFTER (c, d, len);
if ((SYNTAX (c) != (enum syntaxcode) mcnt) ^ not)
goto fail;
d += len;
@@ -6125,8 +6387,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
int len;
re_wchar_t c;
- c = RE_STRING_CHAR_AND_LENGTH (d, dend - d, len);
-
+ GET_CHAR_AFTER (c, d, len);
if ((!CHAR_HAS_CATEGORY (c, mcnt)) ^ not)
goto fail;
d += len;
@@ -6201,11 +6462,11 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
bytes; nonzero otherwise. */
static int
-bcmp_translate (s1, s2, len, translate, multibyte)
+bcmp_translate (s1, s2, len, translate, target_multibyte)
re_char *s1, *s2;
register int len;
RE_TRANSLATE_TYPE translate;
- const int multibyte;
+ const int target_multibyte;
{
register re_char *p1 = s1, *p2 = s2;
re_char *p1_end = s1 + len;
@@ -6218,8 +6479,8 @@ bcmp_translate (s1, s2, len, translate, multibyte)
int p1_charlen, p2_charlen;
re_wchar_t p1_ch, p2_ch;
- p1_ch = RE_STRING_CHAR_AND_LENGTH (p1, p1_end - p1, p1_charlen);
- p2_ch = RE_STRING_CHAR_AND_LENGTH (p2, p2_end - p2, p2_charlen);
+ GET_CHAR_AFTER (p1_ch, p1, p1_charlen);
+ GET_CHAR_AFTER (p2_ch, p2, p2_charlen);
if (RE_TRANSLATE (translate, p1_ch)
!= RE_TRANSLATE (translate, p2_ch))
diff --git a/src/regex.h b/src/regex.h
index 580b136948..69127efa57 100644
--- a/src/regex.h
+++ b/src/regex.h
@@ -398,9 +398,16 @@ struct re_pattern_buffer
unsigned used_syntax : 1;
#ifdef emacs
- /* If true, multi-byte form in the `buffer' should be recognized as a
- multibyte character. */
+ /* If true, multi-byte form in the regexp pattern should be
+ recognized as a multibyte character. */
unsigned multibyte : 1;
+
+ /* If true, multi-byte form in the target of match should be
+ recognized as a multibyte character. */
+ unsigned target_multibyte : 1;
+
+ /* Charset of unibyte characters at compiling time. */
+ int charset_unibyte;
#endif
/* [[[end pattern_buffer]]] */
diff --git a/src/s/cygwin.h b/src/s/cygwin.h
index 1785c7c6c7..3c0d9c410a 100644
--- a/src/s/cygwin.h
+++ b/src/s/cygwin.h
@@ -140,12 +140,6 @@ Boston, MA 02110-1301, USA. */
change their controlling terminal */
#define vfork fork
-/* This should work (at least when compiling with gcc). But I have no way
- or intention to verify or even test it. If you encounter a problem with
- it, feel free to change this setting, but please add a comment here about
- why it needed to be changed. */
-#define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS
-
/* the end */
/* arch-tag: 5ae7ba00-83b0-4ab3-806a-3e845779191b
diff --git a/src/s/darwin.h b/src/s/darwin.h
index 6bfa0e9510..183aecaf5d 100644
--- a/src/s/darwin.h
+++ b/src/s/darwin.h
@@ -50,12 +50,6 @@ Boston, MA 02110-1301, USA. */
#ifdef MAC_OSX
#ifdef HAVE_CARBON
#define MAC_OS
-/* We need a little extra space, see ../../lisp/loadup.el. */
-#define SYSTEM_PURESIZE_EXTRA 30000
-
-/* XXX The MULTI_KBOARD support does not work yet on this platform. */
-#undef MULTI_KBOARD
-
#endif
#endif
diff --git a/src/s/hpux.h b/src/s/hpux.h
index 62427ba98a..5f407a661e 100644
--- a/src/s/hpux.h
+++ b/src/s/hpux.h
@@ -167,15 +167,9 @@ Boston, MA 02110-1301, USA. */
/* USG systems tend to put everything declared static
into the initialized data area, which becomes pure after dumping Emacs.
- Foil this. Emacs carefully avoids static vars inside functions.
- http://lists.gnu.org/archive/html/emacs-devel/2007-09/msg00368.html
- As of at least HPUX 11.11 (2000), it seems this workaround is no
- longer needed. Try uncommenting the following if you have problems
- on older versions. */
+ Foil this. Emacs carefully avoids static vars inside functions. */
-/* This is unnecessary in HPUX versions 10.20, 11.0, 11.11, 11.23. */
-
-/* #define static */
+#define static
/* Define extra libraries to load.
This should have -lBSD, but that library is said to make
diff --git a/src/s/ms-w32.h b/src/s/ms-w32.h
index 5a297a4ee8..a5898410b3 100644
--- a/src/s/ms-w32.h
+++ b/src/s/ms-w32.h
@@ -302,8 +302,6 @@ Boston, MA 02110-1301, USA. */
#define HAVE_MOUSE 1
#define HAVE_H_ERRNO 1
-#define MULTI_KBOARD 1
-
#ifdef HAVE_NTGUI
#define HAVE_WINDOW_SYSTEM 1
#define HAVE_FACES 1
@@ -482,7 +480,7 @@ extern char *get_emacs_configuration_options (void);
/* We need a little extra space, see ../../lisp/loadup.el.
The number below comes from 23923 bytes worth (as of 2006-04)
of w32-specific files loaded by loadup.el, plus 1K spare. */
-#define SYSTEM_PURESIZE_EXTRA 50000
+#define SYSTEM_PURESIZE_EXTRA 25000
/* For unexec to work on Alpha systems, we need to put Emacs'
initialized data into a separate section from the CRT initialized
diff --git a/src/scroll.c b/src/scroll.c
index 5a59c69003..48a40fe23d 100644
--- a/src/scroll.c
+++ b/src/scroll.c
@@ -23,13 +23,12 @@ Boston, MA 02110-1301, USA. */
#include <config.h>
#include <stdio.h>
#include <string.h>
-#include "lisp.h"
#include "termchar.h"
+#include "lisp.h"
#include "dispextern.h"
#include "keyboard.h"
#include "frame.h"
#include "window.h"
-#include "termhooks.h"
/* All costs measured in characters.
So no cost can exceed the area of a frame, measured in characters.
@@ -59,12 +58,10 @@ struct matrix_elt
unsigned char writecount;
};
-static void do_direct_scrolling P_ ((struct frame *,
- struct glyph_matrix *,
+static void do_direct_scrolling P_ ((struct glyph_matrix *,
struct matrix_elt *,
int, int));
-static void do_scrolling P_ ((struct frame *,
- struct glyph_matrix *,
+static void do_scrolling P_ ((struct glyph_matrix *,
struct matrix_elt *,
int, int));
@@ -104,8 +101,7 @@ calculate_scrolling (frame, matrix, window_size, lines_below,
register struct matrix_elt *p, *p1;
register int cost, cost1;
- int lines_moved = window_size
- + (FRAME_SCROLL_REGION_OK (frame) ? 0 : lines_below);
+ int lines_moved = window_size + (scroll_region_ok ? 0 : lines_below);
/* first_insert_cost[I] is the cost of doing the first insert-line
at the i'th line of the lines we are considering,
where I is origin 1 (as it is below). */
@@ -245,8 +241,7 @@ calculate_scrolling (frame, matrix, window_size, lines_below,
of lines. */
static void
-do_scrolling (frame, current_matrix, matrix, window_size, unchanged_at_top)
- struct frame *frame;
+do_scrolling (current_matrix, matrix, window_size, unchanged_at_top)
struct glyph_matrix *current_matrix;
struct matrix_elt *matrix;
int window_size;
@@ -313,12 +308,12 @@ do_scrolling (frame, current_matrix, matrix, window_size, unchanged_at_top)
/* Set the terminal window, if not done already. */
if (! terminal_window_p)
{
- set_terminal_window (frame, window_size + unchanged_at_top);
+ set_terminal_window (window_size + unchanged_at_top);
terminal_window_p = 1;
}
/* Delete lines on the terminal. */
- ins_del_lines (frame, j + unchanged_at_top, - p->deletecount);
+ ins_del_lines (j + unchanged_at_top, - p->deletecount);
}
else
{
@@ -343,7 +338,7 @@ do_scrolling (frame, current_matrix, matrix, window_size, unchanged_at_top)
/* Set the terminal window if not yet done. */
if (!terminal_window_p)
{
- set_terminal_window (frame, window_size + unchanged_at_top);
+ set_terminal_window (window_size + unchanged_at_top);
terminal_window_p = 1;
}
@@ -352,7 +347,7 @@ do_scrolling (frame, current_matrix, matrix, window_size, unchanged_at_top)
--queue;
/* Do the deletion on the terminal. */
- ins_del_lines (frame, queue->pos, queue->count);
+ ins_del_lines (queue->pos, queue->count);
/* All lines in the range deleted become empty in the glyph
matrix. Assign to them glyph rows that are not retained.
@@ -385,7 +380,7 @@ do_scrolling (frame, current_matrix, matrix, window_size, unchanged_at_top)
CHECK_MATRIX (current_matrix);
if (terminal_window_p)
- set_terminal_window (frame, 0);
+ set_terminal_window (0);
}
@@ -472,8 +467,7 @@ calculate_direct_scrolling (frame, matrix, window_size, lines_below,
/* Overhead of setting the scroll window, plus the extra cost
cost of scrolling by a distance of one. The extra cost is
added once for consistency with the cost vectors */
- scroll_overhead
- = FRAME_SCROLL_REGION_COST (frame) + extra_cost;
+ scroll_overhead = scroll_region_cost + extra_cost;
/* initialize the top left corner of the matrix */
matrix->writecost = 0;
@@ -656,9 +650,8 @@ calculate_direct_scrolling (frame, matrix, window_size, lines_below,
the cost matrix for this approach is constructed. */
static void
-do_direct_scrolling (frame, current_matrix, cost_matrix,
- window_size, unchanged_at_top)
- struct frame *frame;
+do_direct_scrolling (current_matrix, cost_matrix, window_size,
+ unchanged_at_top)
struct glyph_matrix *current_matrix;
struct matrix_elt *cost_matrix;
int window_size;
@@ -749,9 +742,9 @@ do_direct_scrolling (frame, current_matrix, cost_matrix,
if (i > j)
{
/* Immediately insert lines */
- set_terminal_window (frame, i + unchanged_at_top);
+ set_terminal_window (i + unchanged_at_top);
terminal_window_p = 1;
- ins_del_lines (frame, j - n_to_write + unchanged_at_top, i - j);
+ ins_del_lines (j - n_to_write + unchanged_at_top, i - j);
}
else if (i < j)
{
@@ -781,9 +774,9 @@ do_direct_scrolling (frame, current_matrix, cost_matrix,
--queue;
if (queue->count)
{
- set_terminal_window (frame, queue->window);
+ set_terminal_window (queue->window);
terminal_window_p = 1;
- ins_del_lines (frame, queue->pos, queue->count);
+ ins_del_lines (queue->pos, queue->count);
}
else
{
@@ -806,7 +799,7 @@ do_direct_scrolling (frame, current_matrix, cost_matrix,
copy_from, retained_p);
if (terminal_window_p)
- set_terminal_window (frame, 0);
+ set_terminal_window (0);
}
@@ -826,13 +819,13 @@ scrolling_1 (frame, window_size, unchanged_at_top, unchanged_at_bottom,
matrix = ((struct matrix_elt *)
alloca ((window_size + 1) * (window_size + 1) * sizeof *matrix));
- if (FRAME_SCROLL_REGION_OK (frame))
+ if (scroll_region_ok)
{
calculate_direct_scrolling (frame, matrix, window_size,
unchanged_at_bottom,
draw_cost, old_draw_cost,
old_hash, new_hash, free_at_end);
- do_direct_scrolling (frame, frame->current_matrix,
+ do_direct_scrolling (frame->current_matrix,
matrix, window_size, unchanged_at_top);
}
else
@@ -840,8 +833,7 @@ scrolling_1 (frame, window_size, unchanged_at_top, unchanged_at_bottom,
calculate_scrolling (frame, matrix, window_size, unchanged_at_bottom,
draw_cost, old_hash, new_hash,
free_at_end);
- do_scrolling (frame,
- frame->current_matrix, matrix, window_size,
+ do_scrolling (frame->current_matrix, matrix, window_size,
unchanged_at_top);
}
}
@@ -923,7 +915,7 @@ scroll_cost (frame, from, to, amount)
if (amount == 0)
return 0;
- if (! FRAME_SCROLL_REGION_OK (frame))
+ if (! scroll_region_ok)
limit = height;
else if (amount > 0)
limit += amount;
diff --git a/src/search.c b/src/search.c
index aca95c0330..edcf315b2c 100644
--- a/src/search.c
+++ b/src/search.c
@@ -25,6 +25,7 @@ Boston, MA 02110-1301, USA. */
#include "syntax.h"
#include "category.h"
#include "buffer.h"
+#include "character.h"
#include "charset.h"
#include "region-cache.h"
#include "commands.h"
@@ -120,61 +121,25 @@ matcher_overflow ()
subexpression bounds.
POSIX is nonzero if we want full backtracking (POSIX style)
for this pattern. 0 means backtrack only enough to get a valid match.
- MULTIBYTE is nonzero if we want to handle multibyte characters in
- PATTERN. 0 means all multibyte characters are recognized just as
- sequences of binary data.
The behavior also depends on Vsearch_spaces_regexp. */
static void
-compile_pattern_1 (cp, pattern, translate, regp, posix, multibyte)
+compile_pattern_1 (cp, pattern, translate, regp, posix)
struct regexp_cache *cp;
Lisp_Object pattern;
Lisp_Object translate;
struct re_registers *regp;
int posix;
- int multibyte;
{
- unsigned char *raw_pattern;
- int raw_pattern_size;
char *val;
reg_syntax_t old;
- /* MULTIBYTE says whether the text to be searched is multibyte.
- We must convert PATTERN to match that, or we will not really
- find things right. */
-
- if (multibyte == STRING_MULTIBYTE (pattern))
- {
- raw_pattern = (unsigned char *) SDATA (pattern);
- raw_pattern_size = SBYTES (pattern);
- }
- else if (multibyte)
- {
- raw_pattern_size = count_size_as_multibyte (SDATA (pattern),
- SCHARS (pattern));
- raw_pattern = (unsigned char *) alloca (raw_pattern_size + 1);
- copy_text (SDATA (pattern), raw_pattern,
- SCHARS (pattern), 0, 1);
- }
- else
- {
- /* Converting multibyte to single-byte.
-
- ??? Perhaps this conversion should be done in a special way
- by subtracting nonascii-insert-offset from each non-ASCII char,
- so that only the multibyte chars which really correspond to
- the chosen single-byte character set can possibly match. */
- raw_pattern_size = SCHARS (pattern);
- raw_pattern = (unsigned char *) alloca (raw_pattern_size + 1);
- copy_text (SDATA (pattern), raw_pattern,
- SBYTES (pattern), 1, 0);
- }
-
cp->regexp = Qnil;
cp->buf.translate = (! NILP (translate) ? translate : make_number (0));
cp->posix = posix;
- cp->buf.multibyte = multibyte;
+ cp->buf.multibyte = STRING_MULTIBYTE (pattern);
+ cp->buf.charset_unibyte = charset_unibyte;
cp->whitespace_regexp = Vsearch_spaces_regexp;
/* rms: I think BLOCK_INPUT is not needed here any more,
because regex.c defines malloc to call xmalloc.
@@ -183,12 +148,11 @@ compile_pattern_1 (cp, pattern, translate, regp, posix, multibyte)
/* BLOCK_INPUT; */
old = re_set_syntax (RE_SYNTAX_EMACS
| (posix ? 0 : RE_NO_POSIX_BACKTRACKING));
-
re_set_whitespace_regexp (NILP (Vsearch_spaces_regexp) ? NULL
: SDATA (Vsearch_spaces_regexp));
- val = (char *) re_compile_pattern ((char *)raw_pattern,
- raw_pattern_size, &cp->buf);
+ val = (char *) re_compile_pattern ((char *) SDATA (pattern),
+ SBYTES (pattern), &cp->buf);
/* If the compiled pattern hard codes some of the contents of the
syntax-table, it can only be reused with *this* syntax table. */
@@ -274,10 +238,10 @@ compile_pattern (pattern, regp, translate, posix, multibyte)
&& !NILP (Fstring_equal (cp->regexp, pattern))
&& EQ (cp->buf.translate, (! NILP (translate) ? translate : make_number (0)))
&& cp->posix == posix
- && cp->buf.multibyte == multibyte
&& (EQ (cp->syntax_table, Qt)
|| EQ (cp->syntax_table, current_buffer->syntax_table))
- && !NILP (Fequal (cp->whitespace_regexp, Vsearch_spaces_regexp)))
+ && !NILP (Fequal (cp->whitespace_regexp, Vsearch_spaces_regexp))
+ && cp->buf.charset_unibyte == charset_unibyte)
break;
/* If we're at the end of the cache, compile into the nil cell
@@ -286,7 +250,7 @@ compile_pattern (pattern, regp, translate, posix, multibyte)
if (cp->next == 0)
{
compile_it:
- compile_pattern_1 (cp, pattern, translate, regp, posix, multibyte);
+ compile_pattern_1 (cp, pattern, translate, regp, posix);
break;
}
}
@@ -303,6 +267,10 @@ compile_pattern (pattern, regp, translate, posix, multibyte)
if (regp)
re_set_registers (&cp->buf, regp, regp->num_regs, regp->start, regp->end);
+ /* The compiled pattern can be used both for mulitbyte and unibyte
+ target. But, we have to tell which the pattern is used for. */
+ cp->buf.target_multibyte = multibyte;
+
return &cp->buf;
}
@@ -1264,7 +1232,7 @@ search_buffer (string, pos, pos_byte, lim, lim_byte, n,
unsigned char *base_pat;
/* Set to positive if we find a non-ASCII char that need
translation. Otherwise set to zero later. */
- int charset_base = -1;
+ int char_base = -1;
int boyer_moore_ok = 1;
/* MULTIBYTE says whether the text to be searched is multibyte.
@@ -1305,7 +1273,7 @@ search_buffer (string, pos, pos_byte, lim, lim_byte, n,
/* Copy and optionally translate the pattern. */
len = raw_pattern_size;
len_byte = raw_pattern_size_byte;
- patbuf = (unsigned char *) alloca (len_byte);
+ patbuf = (unsigned char *) alloca (len * MAX_MULTIBYTE_LENGTH);
pat = patbuf;
base_pat = raw_pattern;
if (multibyte)
@@ -1355,46 +1323,47 @@ search_buffer (string, pos, pos_byte, lim, lim_byte, n,
if (c != inverse && boyer_moore_ok)
{
/* Check if all equivalents belong to the same
- charset & row. Note that the check of C
- itself is done by the last iteration. Note
- also that we don't have to check ASCII
- characters because boyer-moore search can
- always handle their translation. */
- while (1)
+ group of characters. Note that the check of C
+ itself is done by the last iteration. */
+ int this_char_base = -1;
+
+ while (boyer_moore_ok)
{
if (ASCII_BYTE_P (inverse))
{
- if (charset_base > 0)
+ if (this_char_base > 0)
+ boyer_moore_ok = 0;
+ else
{
- boyer_moore_ok = 0;
- break;
+ this_char_base = 0;
+ if (char_base < 0)
+ char_base = this_char_base;
}
- charset_base = 0;
}
- else if (SINGLE_BYTE_CHAR_P (inverse))
+ else if (CHAR_BYTE8_P (inverse))
+ /* Boyer-moore search can't handle a
+ translation of an eight-bit
+ character. */
+ boyer_moore_ok = 0;
+ else if (this_char_base < 0)
{
- /* Boyer-moore search can't handle a
- translation of an eight-bit
- character. */
- boyer_moore_ok = 0;
- break;
- }
- else if (charset_base < 0)
- charset_base = inverse & ~CHAR_FIELD3_MASK;
- else if ((inverse & ~CHAR_FIELD3_MASK)
- != charset_base)
- {
- boyer_moore_ok = 0;
- break;
+ this_char_base = inverse & ~0x3F;
+ if (char_base < 0)
+ char_base = this_char_base;
+ else if (char_base > 0
+ && this_char_base != char_base)
+ boyer_moore_ok = 0;
}
+ else if ((inverse & ~0x3F) != this_char_base)
+ boyer_moore_ok = 0;
if (c == inverse)
break;
TRANSLATE (inverse, inverse_trt, inverse);
}
}
}
- if (charset_base < 0)
- charset_base = 0;
+ if (char_base < 0)
+ char_base = 0;
/* Store this character into the translated pattern. */
bcopy (str, pat, charlen);
@@ -1406,7 +1375,7 @@ search_buffer (string, pos, pos_byte, lim, lim_byte, n,
else
{
/* Unibyte buffer. */
- charset_base = 0;
+ char_base = 0;
while (--len >= 0)
{
int c, translated;
@@ -1433,7 +1402,7 @@ search_buffer (string, pos, pos_byte, lim, lim_byte, n,
if (boyer_moore_ok)
return boyer_moore (n, pat, len, len_byte, trt, inverse_trt,
pos, pos_byte, lim, lim_byte,
- charset_base);
+ char_base);
else
return simple_search (n, pat, len, len_byte, trt,
pos, pos_byte, lim, lim_byte);
@@ -1463,6 +1432,9 @@ simple_search (n, pat, len, len_byte, trt, pos, pos_byte, lim, lim_byte)
{
int multibyte = ! NILP (current_buffer->enable_multibyte_characters);
int forward = n > 0;
+ /* Number of buffer bytes matched. Note that this may be different
+ from len_byte in a multibyte buffer. */
+ int match_byte;
if (lim > pos && multibyte)
while (n > 0)
@@ -1475,7 +1447,7 @@ simple_search (n, pat, len, len_byte, trt, pos, pos_byte, lim, lim_byte)
int this_len = len;
int this_len_byte = len_byte;
unsigned char *p = pat;
- if (pos + len > lim)
+ if (pos + len > lim || pos_byte + len_byte > lim_byte)
goto stop;
while (this_len > 0)
@@ -1502,8 +1474,9 @@ simple_search (n, pat, len, len_byte, trt, pos, pos_byte, lim, lim_byte)
if (this_len == 0)
{
+ match_byte = this_pos_byte - pos_byte;
pos += len;
- pos_byte += len_byte;
+ pos_byte += match_byte;
break;
}
@@ -1540,6 +1513,7 @@ simple_search (n, pat, len, len_byte, trt, pos, pos_byte, lim, lim_byte)
if (this_len == 0)
{
+ match_byte = len;
pos += len;
break;
}
@@ -1557,13 +1531,15 @@ simple_search (n, pat, len, len_byte, trt, pos, pos_byte, lim, lim_byte)
{
/* Try matching at position POS. */
int this_pos = pos - len;
- int this_pos_byte = pos_byte - len_byte;
+ int this_pos_byte;
int this_len = len;
int this_len_byte = len_byte;
unsigned char *p = pat;
- if (this_pos < lim || this_pos_byte < lim_byte)
+ if (this_pos < lim || (pos_byte - len_byte) < lim_byte)
goto stop;
+ this_pos_byte = CHAR_TO_BYTE (this_pos);
+ match_byte = pos_byte - this_pos_byte;
while (this_len > 0)
{
@@ -1589,7 +1565,7 @@ simple_search (n, pat, len, len_byte, trt, pos, pos_byte, lim, lim_byte)
if (this_len == 0)
{
pos -= len;
- pos_byte -= len_byte;
+ pos_byte -= match_byte;
break;
}
@@ -1608,7 +1584,7 @@ simple_search (n, pat, len, len_byte, trt, pos, pos_byte, lim, lim_byte)
int this_len = len;
unsigned char *p = pat;
- if (pos - len < lim)
+ if (this_pos < lim)
goto stop;
while (this_len > 0)
@@ -1625,6 +1601,7 @@ simple_search (n, pat, len, len_byte, trt, pos, pos_byte, lim, lim_byte)
if (this_len == 0)
{
+ match_byte = len;
pos -= len;
break;
}
@@ -1639,9 +1616,9 @@ simple_search (n, pat, len, len_byte, trt, pos, pos_byte, lim, lim_byte)
if (n == 0)
{
if (forward)
- set_search_regs ((multibyte ? pos_byte : pos) - len_byte, len_byte);
+ set_search_regs ((multibyte ? pos_byte : pos) - match_byte, match_byte);
else
- set_search_regs (multibyte ? pos_byte : pos, len_byte);
+ set_search_regs (multibyte ? pos_byte : pos, match_byte);
return pos;
}
@@ -1662,13 +1639,13 @@ simple_search (n, pat, len, len_byte, trt, pos, pos_byte, lim, lim_byte)
have nontrivial translation are the same aside from the last byte.
This makes it possible to translate just the last byte of a
character, and do so after just a simple test of the context.
- CHARSET_BASE is nonzero if there is such a non-ASCII character.
+ CHAR_BASE is nonzero if there is such a non-ASCII character.
If that criterion is not satisfied, do not call this function. */
static int
boyer_moore (n, base_pat, len, len_byte, trt, inverse_trt,
- pos, pos_byte, lim, lim_byte, charset_base)
+ pos, pos_byte, lim, lim_byte, char_base)
int n;
unsigned char *base_pat;
int len, len_byte;
@@ -1676,7 +1653,7 @@ boyer_moore (n, base_pat, len, len_byte, trt, inverse_trt,
Lisp_Object inverse_trt;
int pos, pos_byte;
int lim, lim_byte;
- int charset_base;
+ int char_base;
{
int direction = ((n > 0) ? 1 : -1);
register int dirlen;
@@ -1690,15 +1667,20 @@ boyer_moore (n, base_pat, len, len_byte, trt, inverse_trt,
unsigned char simple_translate[0400];
/* These are set to the preceding bytes of a byte to be translated
- if charset_base is nonzero. As the maximum byte length of a
- multibyte character is 4, we have to check at most three previous
+ if char_base is nonzero. As the maximum byte length of a
+ multibyte character is 5, we have to check at most four previous
bytes. */
int translate_prev_byte1 = 0;
int translate_prev_byte2 = 0;
int translate_prev_byte3 = 0;
+ int translate_prev_byte4 = 0;
+#ifdef C_ALLOCA
+ int BM_tab_space[0400];
+ BM_tab = &BM_tab_space[0];
+#else
BM_tab = (int *) alloca (0400 * sizeof (int));
-
+#endif
/* The general approach is that we are going to maintain that we know */
/* the first (closest to the present position, in whatever direction */
/* we're searching) character that could possibly be the last */
@@ -1757,20 +1739,23 @@ boyer_moore (n, base_pat, len, len_byte, trt, inverse_trt,
for (i = 0; i < 0400; i++)
simple_translate[i] = i;
- if (charset_base)
+ if (char_base)
{
- /* Setup translate_prev_byte1/2/3 from CHARSET_BASE. Only a
+ /* Setup translate_prev_byte1/2/3/4 from CHAR_BASE. Only a
byte following them are the target of translation. */
- int sample_char = charset_base | 0x20;
unsigned char str[MAX_MULTIBYTE_LENGTH];
- int len = CHAR_STRING (sample_char, str);
+ int len = CHAR_STRING (char_base, str);
translate_prev_byte1 = str[len - 2];
if (len > 2)
{
translate_prev_byte2 = str[len - 3];
if (len > 3)
- translate_prev_byte3 = str[len - 4];
+ {
+ translate_prev_byte3 = str[len - 4];
+ if (len > 4)
+ translate_prev_byte4 = str[len - 5];
+ }
}
}
@@ -1786,12 +1771,12 @@ boyer_moore (n, base_pat, len, len_byte, trt, inverse_trt,
/* If the byte currently looking at is the last of a
character to check case-equivalents, set CH to that
character. An ASCII character and a non-ASCII character
- matching with CHARSET_BASE are to be checked. */
+ matching with CHAR_BASE are to be checked. */
int ch = -1;
if (ASCII_BYTE_P (*ptr) || ! multibyte)
ch = *ptr;
- else if (charset_base
+ else if (char_base
&& ((pat_end - ptr) == 1 || CHAR_HEAD_P (ptr[1])))
{
unsigned char *charstart = ptr - 1;
@@ -1799,12 +1784,12 @@ boyer_moore (n, base_pat, len, len_byte, trt, inverse_trt,
while (! (CHAR_HEAD_P (*charstart)))
charstart--;
ch = STRING_CHAR (charstart, ptr - charstart + 1);
- if (charset_base != (ch & ~CHAR_FIELD3_MASK))
+ if (char_base != (ch & ~0x3F))
ch = -1;
}
if (ch >= 0400)
- j = ((unsigned char) ch) | 0200;
+ j = (ch & 0x3F) | 0200;
else
j = *ptr;
@@ -1823,9 +1808,9 @@ boyer_moore (n, base_pat, len, len_byte, trt, inverse_trt,
{
TRANSLATE (ch, inverse_trt, ch);
if (ch >= 0400)
- j = ((unsigned char) ch) | 0200;
+ j = (ch & 0x3F) | 0200;
else
- j = (unsigned char) ch;
+ j = ch;
/* For all the characters that map into CH,
set up simple_translate to map the last byte
@@ -2152,7 +2137,7 @@ wordify (string)
{
int c;
- FETCH_STRING_CHAR_ADVANCE (c, string, i, i_byte);
+ FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE (c, string, i, i_byte);
if (SYNTAX (c) != Sword)
{
@@ -2187,7 +2172,7 @@ wordify (string)
int c;
int i_byte_orig = i_byte;
- FETCH_STRING_CHAR_ADVANCE (c, string, i, i_byte);
+ FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE (c, string, i, i_byte);
if (SYNTAX (c) == Sword)
{
@@ -2471,11 +2456,11 @@ since only regular expressions have distinguished subexpressions. */)
{
if (NILP (string))
{
- c = FETCH_CHAR (pos_byte);
+ c = FETCH_CHAR_AS_MULTIBYTE (pos_byte);
INC_BOTH (pos, pos_byte);
}
else
- FETCH_STRING_CHAR_ADVANCE (c, string, pos, pos_byte);
+ FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE (c, string, pos, pos_byte);
if (LOWERCASEP (c))
{
@@ -2647,10 +2632,7 @@ since only regular expressions have distinguished subexpressions. */)
Lisp_Object rev_tbl;
int really_changed = 0;
- rev_tbl= (!buf_multibyte && CHAR_TABLE_P (Vnonascii_translation_table)
- ? Fchar_table_extra_slot (Vnonascii_translation_table,
- make_number (0))
- : Qnil);
+ rev_tbl = Qnil;
substed_alloc_size = length * 2 + 100;
substed = (unsigned char *) xmalloc (substed_alloc_size + 1);
@@ -2693,7 +2675,7 @@ since only regular expressions have distinguished subexpressions. */)
{
FETCH_STRING_CHAR_ADVANCE_NO_CHECK (c, newtext,
pos, pos_byte);
- if (!buf_multibyte && !SINGLE_BYTE_CHAR_P (c))
+ if (!buf_multibyte && !ASCII_CHAR_P (c))
c = multibyte_char_to_unibyte (c, rev_tbl);
}
else
diff --git a/src/sound.c b/src/sound.c
index 0873fe8b82..8b1bda8d6e 100644
--- a/src/sound.c
+++ b/src/sound.c
@@ -97,6 +97,7 @@ Boston, MA 02110-1301, USA. */
#endif /* WINDOWSNT */
/* BEGIN: Common Definitions */
+#define abs(X) ((X) < 0 ? -(X) : (X))
/* Symbols. */
diff --git a/src/syntax.c b/src/syntax.c
index 4afaeda82d..c6cc8da078 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -26,7 +26,7 @@ Boston, MA 02110-1301, USA. */
#include "lisp.h"
#include "commands.h"
#include "buffer.h"
-#include "charset.h"
+#include "character.h"
#include "keymap.h"
#include "regex.h"
@@ -101,7 +101,8 @@ static int find_defun_start P_ ((int, int));
static int back_comment P_ ((EMACS_INT, EMACS_INT, EMACS_INT, int, int,
EMACS_INT *, EMACS_INT *));
static int char_quoted P_ ((int, int));
-static Lisp_Object skip_chars P_ ((int, int, Lisp_Object, Lisp_Object, int));
+static Lisp_Object skip_chars P_ ((int, Lisp_Object, Lisp_Object, int));
+static Lisp_Object skip_syntaxes P_ ((int, Lisp_Object, Lisp_Object));
static Lisp_Object scan_lists P_ ((EMACS_INT, EMACS_INT, EMACS_INT, int));
static void scan_sexps_forward P_ ((struct lisp_parse_state *,
int, int, int, int,
@@ -306,7 +307,7 @@ char_quoted (charpos, bytepos)
int c;
UPDATE_SYNTAX_TABLE_BACKWARD (charpos);
- c = FETCH_CHAR (bytepos);
+ c = FETCH_CHAR_AS_MULTIBYTE (bytepos);
code = SYNTAX (c);
if (! (code == Scharquote || code == Sescape))
break;
@@ -398,11 +399,11 @@ find_defun_start (pos, pos_byte)
/* Open-paren at start of line means we may have found our
defun-start. */
- c = FETCH_CHAR (PT_BYTE);
+ c = FETCH_CHAR_AS_MULTIBYTE (PT_BYTE);
if (SYNTAX (c) == Sopen)
{
SETUP_SYNTAX_TABLE (PT + 1, -1); /* Try again... */
- c = FETCH_CHAR (PT_BYTE);
+ c = FETCH_CHAR_AS_MULTIBYTE (PT_BYTE);
if (SYNTAX (c) == Sopen)
break;
/* Now fallback to the default value. */
@@ -523,7 +524,7 @@ back_comment (from, from_byte, stop, comnested, comstyle, charpos_ptr, bytepos_p
UPDATE_SYNTAX_TABLE_BACKWARD (from);
prev_syntax = syntax;
- c = FETCH_CHAR (from_byte);
+ c = FETCH_CHAR_AS_MULTIBYTE (from_byte);
syntax = SYNTAX_WITH_FLAGS (c);
code = SYNTAX (c);
@@ -552,7 +553,7 @@ back_comment (from, from_byte, stop, comnested, comstyle, charpos_ptr, bytepos_p
int next = from, next_byte = from_byte, next_c, next_syntax;
DEC_BOTH (next, next_byte);
UPDATE_SYNTAX_TABLE_BACKWARD (next);
- next_c = FETCH_CHAR (next_byte);
+ next_c = FETCH_CHAR_AS_MULTIBYTE (next_byte);
next_syntax = SYNTAX_WITH_FLAGS (next_c);
if (((com2start || comnested)
&& SYNTAX_FLAGS_COMEND_SECOND (syntax)
@@ -855,29 +856,6 @@ char syntax_code_spec[16] =
static Lisp_Object Vsyntax_code_object;
-/* Look up the value for CHARACTER in syntax table TABLE's parent
- and its parents. SYNTAX_ENTRY calls this, when TABLE itself has nil
- for CHARACTER. It's actually used only when not compiled with GCC. */
-
-Lisp_Object
-syntax_parent_lookup (table, character)
- Lisp_Object table;
- int character;
-{
- Lisp_Object value;
-
- while (1)
- {
- table = XCHAR_TABLE (table)->parent;
- if (NILP (table))
- return Qnil;
-
- value = XCHAR_TABLE (table)->contents[character];
- if (!NILP (value))
- return value;
- }
-}
-
DEFUN ("char-syntax", Fchar_syntax, Schar_syntax, 1, 1, 0,
doc: /* Return the syntax code of CHARACTER, described by a character.
For example, if CHARACTER is a word constituent,
@@ -996,6 +974,8 @@ DEFUN ("modify-syntax-entry", Fmodify_syntax_entry, Smodify_syntax_entry, 2, 3,
doc: /* Set syntax for character CHAR according to string NEWENTRY.
The syntax is changed only for table SYNTAX-TABLE, which defaults to
the current buffer's syntax table.
+CHAR may be a cons (MIN . MAX), in which case, syntaxes of all characters
+in the range MIN and MAX are changed.
The first character of NEWENTRY should be one of the following:
Space or - whitespace syntax. w word constituent.
_ symbol constituent. . punctuation.
@@ -1032,14 +1012,24 @@ usage: (modify-syntax-entry CHAR NEWENTRY &optional SYNTAX-TABLE) */)
(c, newentry, syntax_table)
Lisp_Object c, newentry, syntax_table;
{
- CHECK_NUMBER (c);
+ if (CONSP (c))
+ {
+ CHECK_CHARACTER_CAR (c);
+ CHECK_CHARACTER_CDR (c);
+ }
+ else
+ CHECK_CHARACTER (c);
if (NILP (syntax_table))
syntax_table = current_buffer->syntax_table;
else
check_syntax_table (syntax_table);
- SET_RAW_SYNTAX_ENTRY (syntax_table, XINT (c), Fstring_to_syntax (newentry));
+ newentry = Fstring_to_syntax (newentry);
+ if (CONSP (c))
+ SET_RAW_SYNTAX_ENTRY_RANGE (syntax_table, c, newentry);
+ else
+ SET_RAW_SYNTAX_ENTRY (syntax_table, XINT (c), newentry);
/* We clear the regexp cache, since character classes can now have
different values from those in the compiled regexps.*/
@@ -1198,6 +1188,10 @@ DEFUN ("internal-describe-syntax-value", Finternal_describe_syntax_value,
int parse_sexp_ignore_comments;
+/* Char-table of functions that find the next or previous word
+ boundary. */
+Lisp_Object Vfind_word_boundary_function_table;
+
/* Return the position across COUNT words from FROM.
If that many words cannot be found before the end of the buffer, return 0.
COUNT negative means scan backward and stop at word beginning. */
@@ -1211,6 +1205,7 @@ scan_words (from, count)
register int from_byte = CHAR_TO_BYTE (from);
register enum syntaxcode code;
int ch0, ch1;
+ Lisp_Object func, script, pos;
immediate_quit = 1;
QUIT;
@@ -1227,7 +1222,7 @@ scan_words (from, count)
return 0;
}
UPDATE_SYNTAX_TABLE_FORWARD (from);
- ch0 = FETCH_CHAR (from_byte);
+ ch0 = FETCH_CHAR_AS_MULTIBYTE (from_byte);
code = SYNTAX (ch0);
INC_BOTH (from, from_byte);
if (words_include_escapes
@@ -1238,18 +1233,33 @@ scan_words (from, count)
}
/* Now CH0 is a character which begins a word and FROM is the
position of the next character. */
- while (1)
+ func = CHAR_TABLE_REF (Vfind_word_boundary_function_table, ch0);
+ if (! NILP (Ffboundp (func)))
{
- if (from == end) break;
- UPDATE_SYNTAX_TABLE_FORWARD (from);
- ch1 = FETCH_CHAR (from_byte);
- code = SYNTAX (ch1);
- if (!(words_include_escapes
- && (code == Sescape || code == Scharquote)))
- if (code != Sword || WORD_BOUNDARY_P (ch0, ch1))
- break;
- INC_BOTH (from, from_byte);
- ch0 = ch1;
+ pos = call2 (func, make_number (from - 1), make_number (end));
+ if (INTEGERP (pos) && XINT (pos) > from)
+ {
+ from = XINT (pos);
+ from_byte = CHAR_TO_BYTE (from);
+ }
+ }
+ else
+ {
+ script = CHAR_TABLE_REF (Vchar_script_table, ch0);
+ while (1)
+ {
+ if (from == end) break;
+ UPDATE_SYNTAX_TABLE_FORWARD (from);
+ ch1 = FETCH_CHAR_AS_MULTIBYTE (from_byte);
+ code = SYNTAX (ch1);
+ if ((code != Sword
+ && (! words_include_escapes
+ || (code != Sescape && code != Scharquote)))
+ || ! EQ (CHAR_TABLE_REF (Vchar_script_table, ch1), script))
+ break;
+ INC_BOTH (from, from_byte);
+ ch0 = ch1;
+ }
}
count--;
}
@@ -1264,7 +1274,7 @@ scan_words (from, count)
}
DEC_BOTH (from, from_byte);
UPDATE_SYNTAX_TABLE_BACKWARD (from);
- ch1 = FETCH_CHAR (from_byte);
+ ch1 = FETCH_CHAR_AS_MULTIBYTE (from_byte);
code = SYNTAX (ch1);
if (words_include_escapes
&& (code == Sescape || code == Scharquote))
@@ -1274,22 +1284,37 @@ scan_words (from, count)
}
/* Now CH1 is a character which ends a word and FROM is the
position of it. */
- while (1)
+ func = CHAR_TABLE_REF (Vfind_word_boundary_function_table, ch1);
+ if (! NILP (Ffboundp (func)))
+ {
+ pos = call2 (func, make_number (from), make_number (beg));
+ if (INTEGERP (pos) && XINT (pos) < from)
+ {
+ from = XINT (pos);
+ from_byte = CHAR_TO_BYTE (from);
+ }
+ }
+ else
{
- if (from == beg)
- break;
- DEC_BOTH (from, from_byte);
- UPDATE_SYNTAX_TABLE_BACKWARD (from);
- ch0 = FETCH_CHAR (from_byte);
- code = SYNTAX (ch0);
- if (!(words_include_escapes
- && (code == Sescape || code == Scharquote)))
- if (code != Sword || WORD_BOUNDARY_P (ch0, ch1))
- {
- INC_BOTH (from, from_byte);
+ script = CHAR_TABLE_REF (Vchar_script_table, ch1);
+ while (1)
+ {
+ if (from == beg)
break;
- }
- ch1 = ch0;
+ DEC_BOTH (from, from_byte);
+ UPDATE_SYNTAX_TABLE_BACKWARD (from);
+ ch0 = FETCH_CHAR_AS_MULTIBYTE (from_byte);
+ code = SYNTAX (ch0);
+ if ((code != Sword
+ && (! words_include_escapes
+ || (code != Sescape && code != Scharquote)))
+ || ! EQ (CHAR_TABLE_REF (Vchar_script_table, ch0), script))
+ {
+ INC_BOTH (from, from_byte);
+ break;
+ }
+ ch1 = ch0;
+ }
}
count++;
}
@@ -1344,7 +1369,7 @@ Returns the distance traveled, either zero or positive. */)
(string, lim)
Lisp_Object string, lim;
{
- return skip_chars (1, 0, string, lim, 1);
+ return skip_chars (1, string, lim, 1);
}
DEFUN ("skip-chars-backward", Fskip_chars_backward, Sskip_chars_backward, 1, 2, 0,
@@ -1354,7 +1379,7 @@ Returns the distance traveled, either zero or negative. */)
(string, lim)
Lisp_Object string, lim;
{
- return skip_chars (0, 0, string, lim, 1);
+ return skip_chars (0, string, lim, 1);
}
DEFUN ("skip-syntax-forward", Fskip_syntax_forward, Sskip_syntax_forward, 1, 2, 0,
@@ -1366,7 +1391,7 @@ This function returns the distance traveled, either zero or positive. */)
(syntax, lim)
Lisp_Object syntax, lim;
{
- return skip_chars (1, 1, syntax, lim, 0);
+ return skip_syntaxes (1, syntax, lim);
}
DEFUN ("skip-syntax-backward", Fskip_syntax_backward, Sskip_syntax_backward, 1, 2, 0,
@@ -1378,25 +1403,27 @@ This function returns the distance traveled, either zero or negative. */)
(syntax, lim)
Lisp_Object syntax, lim;
{
- return skip_chars (0, 1, syntax, lim, 0);
+ return skip_syntaxes (0, syntax, lim);
}
static Lisp_Object
-skip_chars (forwardp, syntaxp, string, lim, handle_iso_classes)
- int forwardp, syntaxp;
+skip_chars (forwardp, string, lim, handle_iso_classes)
+ int forwardp;
Lisp_Object string, lim;
int handle_iso_classes;
{
register unsigned int c;
unsigned char fastmap[0400];
- /* If SYNTAXP is 0, STRING may contain multi-byte form of characters
- of which codes don't fit in FASTMAP. In that case, set the
- ranges of characters in CHAR_RANGES. */
+ /* Store the ranges of non-ASCII characters. */
int *char_ranges;
int n_char_ranges = 0;
int negate = 0;
register int i, i_byte;
- int multibyte = !NILP (current_buffer->enable_multibyte_characters);
+ /* Set to 1 if the current buffer is multibyte and the region
+ contains non-ASCII chars. */
+ int multibyte;
+ /* Set to 1 if STRING is multibyte and it contains non-ASCII
+ chars. */
int string_multibyte;
int size_byte;
const unsigned char *str;
@@ -1404,32 +1431,8 @@ skip_chars (forwardp, syntaxp, string, lim, handle_iso_classes)
Lisp_Object iso_classes;
CHECK_STRING (string);
- char_ranges = (int *) alloca (SCHARS (string) * (sizeof (int)) * 2);
- string_multibyte = STRING_MULTIBYTE (string);
- str = SDATA (string);
- size_byte = SBYTES (string);
iso_classes = Qnil;
- /* Adjust the multibyteness of the string to that of the buffer. */
- if (multibyte != string_multibyte)
- {
- int nbytes;
-
- if (multibyte)
- nbytes = count_size_as_multibyte (SDATA (string),
- SCHARS (string));
- else
- nbytes = SCHARS (string);
- if (nbytes != size_byte)
- {
- unsigned char *tmp = (unsigned char *) alloca (nbytes);
- copy_text (SDATA (string), tmp, size_byte,
- string_multibyte, multibyte);
- size_byte = nbytes;
- str = tmp;
- }
- }
-
if (NILP (lim))
XSETINT (lim, forwardp ? ZV : BEGV);
else
@@ -1441,10 +1444,16 @@ skip_chars (forwardp, syntaxp, string, lim, handle_iso_classes)
if (XINT (lim) < BEGV)
XSETFASTINT (lim, BEGV);
+ multibyte = (!NILP (current_buffer->enable_multibyte_characters)
+ && (XINT (lim) - PT != CHAR_TO_BYTE (XINT (lim)) - PT_BYTE));
+ string_multibyte = SBYTES (string) > SCHARS (string);
+
bzero (fastmap, sizeof fastmap);
- i_byte = 0;
+ str = SDATA (string);
+ size_byte = SBYTES (string);
+ i_byte = 0;
if (i_byte < size_byte
&& SREF (string, 0) == '^')
{
@@ -1452,21 +1461,23 @@ skip_chars (forwardp, syntaxp, string, lim, handle_iso_classes)
}
/* Find the characters specified and set their elements of fastmap.
- If syntaxp, each character counts as itself.
- Otherwise, handle backslashes and ranges specially. */
+ Handle backslashes and ranges specially.
- while (i_byte < size_byte)
+ If STRING contains non-ASCII characters, setup char_ranges for
+ them and use fastmap only for their leading codes. */
+
+ if (! string_multibyte)
{
- c = STRING_CHAR_AND_LENGTH (str + i_byte, size_byte - i_byte, len);
- i_byte += len;
+ int string_has_eight_bit = 0;
- if (syntaxp)
- fastmap[syntax_spec_code[c & 0377]] = 1;
- else
+ /* At first setup fastmap. */
+ while (i_byte < size_byte)
{
+ c = str[i_byte++];
+
if (handle_iso_classes && c == '['
&& i_byte < size_byte
- && STRING_CHAR (str + i_byte, size_byte - i_byte) == ':')
+ && str[i_byte] == ':')
{
const unsigned char *class_beg = str + i_byte + 1;
const unsigned char *class_end = class_beg;
@@ -1505,6 +1516,129 @@ skip_chars (forwardp, syntaxp, string, lim, handle_iso_classes)
if (i_byte == size_byte)
break;
+ c = str[i_byte++];
+ }
+ /* Treat `-' as range character only if another character
+ follows. */
+ if (i_byte + 1 < size_byte
+ && str[i_byte] == '-')
+ {
+ unsigned int c2;
+
+ /* Skip over the dash. */
+ i_byte++;
+
+ /* Get the end of the range. */
+ c2 = str[i_byte++];
+ if (c2 == '\\'
+ && i_byte < size_byte)
+ c2 = str[i_byte++];
+
+ if (c <= c2)
+ {
+ while (c <= c2)
+ fastmap[c++] = 1;
+ if (! ASCII_CHAR_P (c2))
+ string_has_eight_bit = 1;
+ }
+ }
+ else
+ {
+ fastmap[c] = 1;
+ if (! ASCII_CHAR_P (c))
+ string_has_eight_bit = 1;
+ }
+ }
+
+ /* If the current range is multibyte and STRING contains
+ eight-bit chars, arrange fastmap and setup char_ranges for
+ the corresponding multibyte chars. */
+ if (multibyte && string_has_eight_bit)
+ {
+ unsigned char fastmap2[0400];
+ int range_start_byte, range_start_char;
+
+ bcopy (fastmap2 + 0200, fastmap + 0200, 0200);
+ bzero (fastmap + 0200, 0200);
+ /* We are sure that this loop stops. */
+ for (i = 0200; ! fastmap2[i]; i++);
+ c = unibyte_char_to_multibyte (i);
+ fastmap[CHAR_LEADING_CODE (c)] = 1;
+ range_start_byte = i;
+ range_start_char = c;
+ char_ranges = (int *) alloca (sizeof (int) * 128 * 2);
+ for (i = 129; i < 0400; i++)
+ {
+ c = unibyte_char_to_multibyte (i);
+ fastmap[CHAR_LEADING_CODE (c)] = 1;
+ if (i - range_start_byte != c - range_start_char)
+ {
+ char_ranges[n_char_ranges++] = range_start_char;
+ char_ranges[n_char_ranges++] = ((i - 1 - range_start_byte)
+ + range_start_char);
+ range_start_byte = i;
+ range_start_char = c;
+ }
+ }
+ char_ranges[n_char_ranges++] = range_start_char;
+ char_ranges[n_char_ranges++] = ((i - 1 - range_start_byte)
+ + range_start_char);
+ }
+ }
+ else /* STRING is multibyte */
+ {
+ char_ranges = (int *) alloca (sizeof (int) * SCHARS (string) * 2);
+
+ while (i_byte < size_byte)
+ {
+ unsigned char leading_code;
+
+ leading_code = str[i_byte];
+ c = STRING_CHAR_AND_LENGTH (str + i_byte, size_byte-i_byte, len);
+ i_byte += len;
+
+ if (handle_iso_classes && c == '['
+ && i_byte < size_byte
+ && STRING_CHAR (str + i_byte, size_byte - i_byte) == ':')
+ {
+ const unsigned char *class_beg = str + i_byte + 1;
+ const unsigned char *class_end = class_beg;
+ const unsigned char *class_limit = str + size_byte - 2;
+ /* Leave room for the null. */
+ unsigned char class_name[CHAR_CLASS_MAX_LENGTH + 1];
+ re_wctype_t cc;
+
+ if (class_limit - class_beg > CHAR_CLASS_MAX_LENGTH)
+ class_limit = class_beg + CHAR_CLASS_MAX_LENGTH;
+
+ while (class_end < class_limit
+ && *class_end >= 'a' && *class_end <= 'z')
+ class_end++;
+
+ if (class_end == class_beg
+ || *class_end != ':' || class_end[1] != ']')
+ goto not_a_class_name_multibyte;
+
+ bcopy (class_beg, class_name, class_end - class_beg);
+ class_name[class_end - class_beg] = 0;
+
+ cc = re_wctype (class_name);
+ if (cc == 0)
+ error ("Invalid ISO C character class");
+
+ iso_classes = Fcons (make_number (cc), iso_classes);
+
+ i_byte = class_end + 2 - str;
+ continue;
+ }
+
+ not_a_class_name_multibyte:
+ if (c == '\\')
+ {
+ if (i_byte == size_byte)
+ break;
+
+ leading_code = str[i_byte];
c = STRING_CHAR_AND_LENGTH (str + i_byte,
size_byte - i_byte, len);
i_byte += len;
@@ -1515,61 +1649,90 @@ skip_chars (forwardp, syntaxp, string, lim, handle_iso_classes)
&& str[i_byte] == '-')
{
unsigned int c2;
+ unsigned char leading_code2;
/* Skip over the dash. */
i_byte++;
/* Get the end of the range. */
+ leading_code2 = str[i_byte];
c2 = STRING_CHAR_AND_LENGTH (str + i_byte,
size_byte - i_byte, len);
i_byte += len;
- if (SINGLE_BYTE_CHAR_P (c))
+ if (c2 == '\\'
+ && i_byte < size_byte)
+ {
+ leading_code2 = str[i_byte];
+ c2 =STRING_CHAR_AND_LENGTH (str + i_byte, size_byte-i_byte, len);
+ i_byte += len;
+ }
+
+ if (c > c2)
+ continue;
+ if (ASCII_CHAR_P (c))
+ {
+ while (c <= c2 && c < 0x80)
+ fastmap[c++] = 1;
+ leading_code = CHAR_LEADING_CODE (c);
+ }
+ if (! ASCII_CHAR_P (c))
{
- if (! SINGLE_BYTE_CHAR_P (c2))
+ while (leading_code <= leading_code2)
+ fastmap[leading_code++] = 1;
+ if (c <= c2)
{
- /* Handle a range starting with a character of
- less than 256, and ending with a character of
- not less than 256. Split that into two
- ranges, the low one ending at 0377, and the
- high one starting at the smallest character
- in the charset of C2 and ending at C2. */
- int charset = CHAR_CHARSET (c2);
- int c1 = MAKE_CHAR (charset, 0, 0);
-
- char_ranges[n_char_ranges++] = c1;
+ char_ranges[n_char_ranges++] = c;
char_ranges[n_char_ranges++] = c2;
- c2 = 0377;
}
- while (c <= c2)
- {
- fastmap[c] = 1;
- c++;
- }
- }
- else if (c <= c2) /* Both C and C2 are multibyte char. */
- {
- char_ranges[n_char_ranges++] = c;
- char_ranges[n_char_ranges++] = c2;
}
}
else
{
- if (SINGLE_BYTE_CHAR_P (c))
+ if (ASCII_CHAR_P (c))
fastmap[c] = 1;
else
{
+ fastmap[leading_code] = 1;
char_ranges[n_char_ranges++] = c;
char_ranges[n_char_ranges++] = c;
}
}
}
+
+ /* If the current range is unibyte and STRING contains non-ASCII
+ chars, arrange fastmap for the corresponding unibyte
+ chars. */
+
+ if (! multibyte && n_char_ranges > 0)
+ {
+ bzero (fastmap + 0200, 0200);
+ for (i = 0; i < n_char_ranges; i += 2)
+ {
+ int c1 = char_ranges[i];
+ int c2 = char_ranges[i + 1];
+
+ for (; c1 <= c2; c1++)
+ fastmap[CHAR_TO_BYTE8 (c1)] = 1;
+ }
+ }
}
/* If ^ was the first character, complement the fastmap. */
if (negate)
- for (i = 0; i < sizeof fastmap; i++)
- fastmap[i] ^= 1;
+ {
+ if (! multibyte)
+ for (i = 0; i < sizeof fastmap; i++)
+ fastmap[i] ^= 1;
+ else
+ {
+ for (i = 0; i < 0200; i++)
+ fastmap[i] ^= 1;
+ /* All non-ASCII chars possibly match. */
+ for (; i < sizeof fastmap; i++)
+ fastmap[i] = 1;
+ }
+ }
{
int start_point = PT;
@@ -1589,254 +1752,312 @@ skip_chars (forwardp, syntaxp, string, lim, handle_iso_classes)
}
immediate_quit = 1;
- if (syntaxp)
+ if (forwardp)
{
- SETUP_SYNTAX_TABLE (pos, forwardp ? 1 : -1);
- if (forwardp)
- {
- if (multibyte)
- while (1)
- {
- int nbytes;
+ if (multibyte)
+ while (1)
+ {
+ int nbytes;
- if (p >= stop)
- {
- if (p >= endp)
- break;
- p = GAP_END_ADDR;
- stop = endp;
- }
- c = STRING_CHAR_AND_LENGTH (p, MAX_MULTIBYTE_LENGTH, nbytes);
- if (! fastmap[(int) SYNTAX (c)])
+ if (p >= stop)
+ {
+ if (p >= endp)
break;
- p += nbytes, pos++, pos_byte += nbytes;
- UPDATE_SYNTAX_TABLE_FORWARD (pos);
+ p = GAP_END_ADDR;
+ stop = endp;
}
- else
- while (1)
+ c = STRING_CHAR_AND_LENGTH (p, MAX_MULTIBYTE_LENGTH, nbytes);
+ if (! NILP (iso_classes) && in_classes (c, iso_classes))
{
- if (p >= stop)
- {
- if (p >= endp)
- break;
- p = GAP_END_ADDR;
- stop = endp;
- }
- if (! fastmap[(int) SYNTAX (*p)])
+ if (negate)
break;
- p++, pos++;
- UPDATE_SYNTAX_TABLE_FORWARD (pos);
+ else
+ goto fwd_ok;
}
- }
- else
- {
- if (multibyte)
- while (1)
- {
- unsigned char *prev_p;
- int nbytes;
- if (p <= stop)
- {
- if (p <= endp)
- break;
- p = GPT_ADDR;
- stop = endp;
- }
- prev_p = p;
- while (--p >= stop && ! CHAR_HEAD_P (*p));
- PARSE_MULTIBYTE_SEQ (p, MAX_MULTIBYTE_LENGTH, nbytes);
- if (prev_p - p > nbytes)
- p = prev_p - 1, c = *p, nbytes = 1;
- else
- c = STRING_CHAR (p, MAX_MULTIBYTE_LENGTH);
- pos--, pos_byte -= nbytes;
- UPDATE_SYNTAX_TABLE_BACKWARD (pos);
- if (! fastmap[(int) SYNTAX (c)])
- {
- pos++;
- pos_byte += nbytes;
+ if (! fastmap[*p])
+ break;
+ if (! ASCII_CHAR_P (c))
+ {
+ /* As we are looking at a multibyte character, we
+ must look up the character in the table
+ CHAR_RANGES. If there's no data in the table,
+ that character is not what we want to skip. */
+
+ /* The following code do the right thing even if
+ n_char_ranges is zero (i.e. no data in
+ CHAR_RANGES). */
+ for (i = 0; i < n_char_ranges; i += 2)
+ if (c >= char_ranges[i] && c <= char_ranges[i + 1])
break;
- }
+ if (!(negate ^ (i < n_char_ranges)))
+ break;
}
- else
- while (1)
+ fwd_ok:
+ p += nbytes, pos++, pos_byte += nbytes;
+ }
+ else
+ while (1)
+ {
+ if (p >= stop)
{
- if (p <= stop)
- {
- if (p <= endp)
- break;
- p = GPT_ADDR;
- stop = endp;
- }
- UPDATE_SYNTAX_TABLE_BACKWARD (pos - 1);
- if (! fastmap[(int) SYNTAX (p[-1])])
+ if (p >= endp)
break;
- p--, pos--;
+ p = GAP_END_ADDR;
+ stop = endp;
}
- }
+
+ if (!NILP (iso_classes) && in_classes (*p, iso_classes))
+ {
+ if (negate)
+ break;
+ else
+ goto fwd_unibyte_ok;
+ }
+
+ if (!fastmap[*p])
+ break;
+ fwd_unibyte_ok:
+ p++, pos++, pos_byte++;
+ }
}
else
{
- if (forwardp)
- {
- if (multibyte)
- while (1)
- {
- int nbytes;
-
- if (p >= stop)
- {
- if (p >= endp)
- break;
- p = GAP_END_ADDR;
- stop = endp;
- }
- c = STRING_CHAR_AND_LENGTH (p, MAX_MULTIBYTE_LENGTH, nbytes);
+ if (multibyte)
+ while (1)
+ {
+ unsigned char *prev_p;
- if (! NILP (iso_classes) && in_classes (c, iso_classes))
- {
- if (negate)
- break;
- else
- goto fwd_ok;
- }
+ if (p <= stop)
+ {
+ if (p <= endp)
+ break;
+ p = GPT_ADDR;
+ stop = endp;
+ }
+ prev_p = p;
+ while (--p >= stop && ! CHAR_HEAD_P (*p));
+ c = STRING_CHAR (p, MAX_MULTIBYTE_LENGTH);
- if (SINGLE_BYTE_CHAR_P (c))
- {
- if (!fastmap[c])
- break;
- }
+ if (! NILP (iso_classes) && in_classes (c, iso_classes))
+ {
+ if (negate)
+ break;
else
- {
- /* If we are looking at a multibyte character,
- we must look up the character in the table
- CHAR_RANGES. If there's no data in the
- table, that character is not what we want to
- skip. */
-
- /* The following code do the right thing even if
- n_char_ranges is zero (i.e. no data in
- CHAR_RANGES). */
- for (i = 0; i < n_char_ranges; i += 2)
- if (c >= char_ranges[i] && c <= char_ranges[i + 1])
- break;
- if (!(negate ^ (i < n_char_ranges)))
- break;
- }
- fwd_ok:
- p += nbytes, pos++, pos_byte += nbytes;
+ goto back_ok;
}
- else
- while (1)
- {
- if (p >= stop)
- {
- if (p >= endp)
- break;
- p = GAP_END_ADDR;
- stop = endp;
- }
-
- if (!NILP (iso_classes) && in_classes (*p, iso_classes))
- {
- if (negate)
- break;
- else
- goto fwd_unibyte_ok;
- }
- if (!fastmap[*p])
+ if (! fastmap[*p])
+ break;
+ if (! ASCII_CHAR_P (c))
+ {
+ /* See the comment in the previous similar code. */
+ for (i = 0; i < n_char_ranges; i += 2)
+ if (c >= char_ranges[i] && c <= char_ranges[i + 1])
+ break;
+ if (!(negate ^ (i < n_char_ranges)))
break;
- fwd_unibyte_ok:
- p++, pos++;
}
- }
+ back_ok:
+ pos--, pos_byte -= prev_p - p;
+ }
else
- {
- if (multibyte)
- while (1)
+ while (1)
+ {
+ if (p <= stop)
{
- unsigned char *prev_p;
- int nbytes;
+ if (p <= endp)
+ break;
+ p = GPT_ADDR;
+ stop = endp;
+ }
- if (p <= stop)
- {
- if (p <= endp)
- break;
- p = GPT_ADDR;
- stop = endp;
- }
- prev_p = p;
- while (--p >= stop && ! CHAR_HEAD_P (*p));
- PARSE_MULTIBYTE_SEQ (p, MAX_MULTIBYTE_LENGTH, nbytes);
- if (prev_p - p > nbytes)
- p = prev_p - 1, c = *p, nbytes = 1;
+ if (! NILP (iso_classes) && in_classes (p[-1], iso_classes))
+ {
+ if (negate)
+ break;
else
- c = STRING_CHAR (p, MAX_MULTIBYTE_LENGTH);
+ goto back_unibyte_ok;
+ }
- if (! NILP (iso_classes) && in_classes (c, iso_classes))
- {
- if (negate)
- break;
- else
- goto back_ok;
- }
+ if (!fastmap[p[-1]])
+ break;
+ back_unibyte_ok:
+ p--, pos--, pos_byte--;
+ }
+ }
- if (SINGLE_BYTE_CHAR_P (c))
- {
- if (!fastmap[c])
- break;
- }
- else
- {
- /* See the comment in the previous similar code. */
- for (i = 0; i < n_char_ranges; i += 2)
- if (c >= char_ranges[i] && c <= char_ranges[i + 1])
- break;
- if (!(negate ^ (i < n_char_ranges)))
- break;
- }
- back_ok:
- pos--, pos_byte -= nbytes;
- }
- else
- while (1)
- {
- if (p <= stop)
- {
- if (p <= endp)
- break;
- p = GPT_ADDR;
- stop = endp;
- }
+ SET_PT_BOTH (pos, pos_byte);
+ immediate_quit = 0;
- if (! NILP (iso_classes) && in_classes (p[-1], iso_classes))
- {
- if (negate)
- break;
- else
- goto back_unibyte_ok;
- }
+ return make_number (PT - start_point);
+ }
+}
- if (!fastmap[p[-1]])
- break;
- back_unibyte_ok:
- p--, pos--;
- }
- }
+
+static Lisp_Object
+skip_syntaxes (forwardp, string, lim)
+ int forwardp;
+ Lisp_Object string, lim;
+{
+ register unsigned int c;
+ unsigned char fastmap[0400];
+ int negate = 0;
+ register int i, i_byte;
+ int multibyte;
+ int size_byte;
+ unsigned char *str;
+
+ CHECK_STRING (string);
+
+ if (NILP (lim))
+ XSETINT (lim, forwardp ? ZV : BEGV);
+ else
+ CHECK_NUMBER_COERCE_MARKER (lim);
+
+ /* In any case, don't allow scan outside bounds of buffer. */
+ if (XINT (lim) > ZV)
+ XSETFASTINT (lim, ZV);
+ if (XINT (lim) < BEGV)
+ XSETFASTINT (lim, BEGV);
+
+ if (forwardp ? (PT >= XFASTINT (lim)) : (PT <= XFASTINT (lim)))
+ return make_number (0);
+
+ multibyte = (!NILP (current_buffer->enable_multibyte_characters)
+ && (XINT (lim) - PT != CHAR_TO_BYTE (XINT (lim)) - PT_BYTE));
+
+ bzero (fastmap, sizeof fastmap);
+
+ if (SBYTES (string) > SCHARS (string))
+ /* As this is very rare case (syntax spec is ASCII only), don't
+ consider efficiency. */
+ string = string_make_unibyte (string);
+
+ str = SDATA (string);
+ size_byte = SBYTES (string);
+
+ i_byte = 0;
+ if (i_byte < size_byte
+ && SREF (string, 0) == '^')
+ {
+ negate = 1; i_byte++;
+ }
+
+ /* Find the syntaxes specified and set their elements of fastmap. */
+
+ while (i_byte < size_byte)
+ {
+ c = str[i_byte++];
+ fastmap[syntax_spec_code[c]] = 1;
+ }
+
+ /* If ^ was the first character, complement the fastmap. */
+ if (negate)
+ for (i = 0; i < sizeof fastmap; i++)
+ fastmap[i] ^= 1;
+
+ {
+ int start_point = PT;
+ int pos = PT;
+ int pos_byte = PT_BYTE;
+ unsigned char *p = PT_ADDR, *endp, *stop;
+
+ if (forwardp)
+ {
+ endp = (XINT (lim) == GPT) ? GPT_ADDR : CHAR_POS_ADDR (XINT (lim));
+ stop = (pos < GPT && GPT < XINT (lim)) ? GPT_ADDR : endp;
+ }
+ else
+ {
+ endp = CHAR_POS_ADDR (XINT (lim));
+ stop = (pos >= GPT && GPT > XINT (lim)) ? GAP_END_ADDR : endp;
}
-#if 0 /* Not needed now that a position in mid-character
- cannot be specified in Lisp. */
- if (multibyte
- /* INC_POS or DEC_POS might have moved POS over LIM. */
- && (forwardp ? (pos > XINT (lim)) : (pos < XINT (lim))))
- pos = XINT (lim);
-#endif
+ immediate_quit = 1;
+ SETUP_SYNTAX_TABLE (pos, forwardp ? 1 : -1);
+ if (forwardp)
+ {
+ if (multibyte)
+ {
+ while (1)
+ {
+ int nbytes;
+
+ if (p >= stop)
+ {
+ if (p >= endp)
+ break;
+ p = GAP_END_ADDR;
+ stop = endp;
+ }
+ c = STRING_CHAR_AND_LENGTH (p, MAX_MULTIBYTE_LENGTH, nbytes);
+ if (! fastmap[(int) SYNTAX (c)])
+ break;
+ p += nbytes, pos++, pos_byte += nbytes;
+ UPDATE_SYNTAX_TABLE_FORWARD (pos);
+ }
+ }
+ else
+ {
+ while (1)
+ {
+ if (p >= stop)
+ {
+ if (p >= endp)
+ break;
+ p = GAP_END_ADDR;
+ stop = endp;
+ }
+ if (! fastmap[(int) SYNTAX (*p)])
+ break;
+ p++, pos++, pos_byte++;
+ UPDATE_SYNTAX_TABLE_FORWARD (pos);
+ }
+ }
+ }
+ else
+ {
+ if (multibyte)
+ {
+ while (1)
+ {
+ unsigned char *prev_p;
- if (! multibyte)
- pos_byte = pos;
+ if (p <= stop)
+ {
+ if (p <= endp)
+ break;
+ p = GPT_ADDR;
+ stop = endp;
+ }
+ UPDATE_SYNTAX_TABLE_BACKWARD (pos - 1);
+ prev_p = p;
+ while (--p >= stop && ! CHAR_HEAD_P (*p));
+ c = STRING_CHAR (p, MAX_MULTIBYTE_LENGTH);
+ if (! fastmap[(int) SYNTAX (c)])
+ break;
+ pos--, pos_byte -= prev_p - p;
+ }
+ }
+ else
+ {
+ while (1)
+ {
+ if (p <= stop)
+ {
+ if (p <= endp)
+ break;
+ p = GPT_ADDR;
+ stop = endp;
+ }
+ UPDATE_SYNTAX_TABLE_BACKWARD (pos - 1);
+ if (! fastmap[(int) SYNTAX (p[-1])])
+ break;
+ p--, pos--, pos_byte--;
+ }
+ }
+ }
SET_PT_BOTH (pos, pos_byte);
immediate_quit = 0;
@@ -1921,7 +2142,7 @@ forw_comment (from, from_byte, stop, nesting, style, prev_syntax,
*bytepos_ptr = from_byte;
return 0;
}
- c = FETCH_CHAR (from_byte);
+ c = FETCH_CHAR_AS_MULTIBYTE (from_byte);
syntax = SYNTAX_WITH_FLAGS (c);
code = syntax & 0xff;
if (code == Sendcomment
@@ -1951,7 +2172,7 @@ forw_comment (from, from_byte, stop, nesting, style, prev_syntax,
forw_incomment:
if (from < stop && SYNTAX_FLAGS_COMEND_FIRST (syntax)
&& SYNTAX_FLAGS_COMMENT_STYLE (syntax) == style
- && (c1 = FETCH_CHAR (from_byte),
+ && (c1 = FETCH_CHAR_AS_MULTIBYTE (from_byte),
SYNTAX_COMEND_SECOND (c1))
&& ((SYNTAX_FLAGS_COMMENT_NESTED (syntax) ||
SYNTAX_COMMENT_NESTED (c1)) ? nesting > 0 : nesting < 0))
@@ -1970,7 +2191,7 @@ forw_comment (from, from_byte, stop, nesting, style, prev_syntax,
if (nesting > 0
&& from < stop
&& SYNTAX_FLAGS_COMSTART_FIRST (syntax)
- && (c1 = FETCH_CHAR (from_byte),
+ && (c1 = FETCH_CHAR_AS_MULTIBYTE (from_byte),
SYNTAX_COMMENT_STYLE (c1) == style
&& SYNTAX_COMSTART_SECOND (c1))
&& (SYNTAX_FLAGS_COMMENT_NESTED (syntax) ||
@@ -2034,7 +2255,7 @@ between them, return t; otherwise return nil. */)
immediate_quit = 0;
return Qnil;
}
- c = FETCH_CHAR (from_byte);
+ c = FETCH_CHAR_AS_MULTIBYTE (from_byte);
code = SYNTAX (c);
comstart_first = SYNTAX_COMSTART_FIRST (c);
comnested = SYNTAX_COMMENT_NESTED (c);
@@ -2042,7 +2263,7 @@ between them, return t; otherwise return nil. */)
INC_BOTH (from, from_byte);
UPDATE_SYNTAX_TABLE_FORWARD (from);
if (from < stop && comstart_first
- && (c1 = FETCH_CHAR (from_byte),
+ && (c1 = FETCH_CHAR_AS_MULTIBYTE (from_byte),
SYNTAX_COMSTART_SECOND (c1)))
{
/* We have encountered a comment start sequence and we
@@ -2100,7 +2321,7 @@ between them, return t; otherwise return nil. */)
DEC_BOTH (from, from_byte);
/* char_quoted does UPDATE_SYNTAX_TABLE_BACKWARD (from). */
quoted = char_quoted (from, from_byte);
- c = FETCH_CHAR (from_byte);
+ c = FETCH_CHAR_AS_MULTIBYTE (from_byte);
code = SYNTAX (c);
comstyle = 0;
comnested = SYNTAX_COMMENT_NESTED (c);
@@ -2117,7 +2338,7 @@ between them, return t; otherwise return nil. */)
code = Sendcomment;
/* Calling char_quoted, above, set up global syntax position
at the new value of FROM. */
- c1 = FETCH_CHAR (from_byte);
+ c1 = FETCH_CHAR_AS_MULTIBYTE (from_byte);
comstyle = SYNTAX_COMMENT_STYLE (c1);
comnested = comnested || SYNTAX_COMMENT_NESTED (c1);
}
@@ -2131,7 +2352,7 @@ between them, return t; otherwise return nil. */)
{
DEC_BOTH (from, from_byte);
UPDATE_SYNTAX_TABLE_BACKWARD (from);
- c = FETCH_CHAR (from_byte);
+ c = FETCH_CHAR_AS_MULTIBYTE (from_byte);
if (SYNTAX (c) == Scomment_fence
&& !char_quoted (from, from_byte))
{
@@ -2197,11 +2418,11 @@ between them, return t; otherwise return nil. */)
return Qt;
}
-/* Return syntax code of character C if C is a single byte character
+/* Return syntax code of character C if C is an ASCII character
or `multibyte_symbol_p' is zero. Otherwise, return Ssymbol. */
-#define SYNTAX_WITH_MULTIBYTE_CHECK(c) \
- ((SINGLE_BYTE_CHAR_P (c) || !multibyte_symbol_p) \
+#define SYNTAX_WITH_MULTIBYTE_CHECK(c) \
+ ((ASCII_CHAR_P (c) || !multibyte_symbol_p) \
? SYNTAX (c) : Ssymbol)
static Lisp_Object
@@ -2245,7 +2466,7 @@ scan_lists (from, count, depth, sexpflag)
{
int comstart_first, prefix;
UPDATE_SYNTAX_TABLE_FORWARD (from);
- c = FETCH_CHAR (from_byte);
+ c = FETCH_CHAR_AS_MULTIBYTE (from_byte);
code = SYNTAX_WITH_MULTIBYTE_CHECK (c);
comstart_first = SYNTAX_COMSTART_FIRST (c);
comnested = SYNTAX_COMMENT_NESTED (c);
@@ -2256,7 +2477,8 @@ scan_lists (from, count, depth, sexpflag)
INC_BOTH (from, from_byte);
UPDATE_SYNTAX_TABLE_FORWARD (from);
if (from < stop && comstart_first
- && (c = FETCH_CHAR (from_byte), SYNTAX_COMSTART_SECOND (c))
+ && (c = FETCH_CHAR_AS_MULTIBYTE (from_byte),
+ SYNTAX_COMSTART_SECOND (c))
&& parse_sexp_ignore_comments)
{
/* we have encountered a comment start sequence and we
@@ -2265,7 +2487,7 @@ scan_lists (from, count, depth, sexpflag)
only a comment end of the same style actually ends
the comment section */
code = Scomment;
- c1 = FETCH_CHAR (from_byte);
+ c1 = FETCH_CHAR_AS_MULTIBYTE (from_byte);
comstyle = SYNTAX_COMMENT_STYLE (c1);
comnested = comnested || SYNTAX_COMMENT_NESTED (c1);
INC_BOTH (from, from_byte);
@@ -2291,7 +2513,7 @@ scan_lists (from, count, depth, sexpflag)
UPDATE_SYNTAX_TABLE_FORWARD (from);
/* Some compilers can't handle this inside the switch. */
- c = FETCH_CHAR (from_byte);
+ c = FETCH_CHAR_AS_MULTIBYTE (from_byte);
temp = SYNTAX_WITH_MULTIBYTE_CHECK (c);
switch (temp)
{
@@ -2334,7 +2556,7 @@ scan_lists (from, count, depth, sexpflag)
case Smath:
if (!sexpflag)
break;
- if (from != stop && c == FETCH_CHAR (from_byte))
+ if (from != stop && c == FETCH_CHAR_AS_MULTIBYTE (from_byte))
{
INC_BOTH (from, from_byte);
}
@@ -2361,12 +2583,12 @@ scan_lists (from, count, depth, sexpflag)
case Sstring:
case Sstring_fence:
temp_pos = dec_bytepos (from_byte);
- stringterm = FETCH_CHAR (temp_pos);
+ stringterm = FETCH_CHAR_AS_MULTIBYTE (temp_pos);
while (1)
{
if (from >= stop) goto lose;
UPDATE_SYNTAX_TABLE_FORWARD (from);
- c = FETCH_CHAR (from_byte);
+ c = FETCH_CHAR_AS_MULTIBYTE (from_byte);
if (code == Sstring
? (c == stringterm
&& SYNTAX_WITH_MULTIBYTE_CHECK (c) == Sstring)
@@ -2409,7 +2631,7 @@ scan_lists (from, count, depth, sexpflag)
{
DEC_BOTH (from, from_byte);
UPDATE_SYNTAX_TABLE_BACKWARD (from);
- c = FETCH_CHAR (from_byte);
+ c = FETCH_CHAR_AS_MULTIBYTE (from_byte);
code = SYNTAX_WITH_MULTIBYTE_CHECK (c);
if (depth == min_depth)
last_good = from;
@@ -2427,7 +2649,7 @@ scan_lists (from, count, depth, sexpflag)
DEC_BOTH (from, from_byte);
UPDATE_SYNTAX_TABLE_BACKWARD (from);
code = Sendcomment;
- c1 = FETCH_CHAR (from_byte);
+ c1 = FETCH_CHAR_AS_MULTIBYTE (from_byte);
comstyle = SYNTAX_COMMENT_STYLE (c1);
comnested = comnested || SYNTAX_COMMENT_NESTED (c1);
}
@@ -2460,7 +2682,7 @@ scan_lists (from, count, depth, sexpflag)
else
temp_pos--;
UPDATE_SYNTAX_TABLE_BACKWARD (from - 1);
- c1 = FETCH_CHAR (temp_pos);
+ c1 = FETCH_CHAR_AS_MULTIBYTE (temp_pos);
temp_code = SYNTAX_WITH_MULTIBYTE_CHECK (c1);
/* Don't allow comment-end to be quoted. */
if (temp_code == Sendcomment)
@@ -2472,7 +2694,7 @@ scan_lists (from, count, depth, sexpflag)
temp_pos = dec_bytepos (temp_pos);
UPDATE_SYNTAX_TABLE_BACKWARD (from - 1);
}
- c1 = FETCH_CHAR (temp_pos);
+ c1 = FETCH_CHAR_AS_MULTIBYTE (temp_pos);
temp_code = SYNTAX_WITH_MULTIBYTE_CHECK (c1);
if (! (quoted || temp_code == Sword
|| temp_code == Ssymbol
@@ -2487,7 +2709,7 @@ scan_lists (from, count, depth, sexpflag)
break;
temp_pos = dec_bytepos (from_byte);
UPDATE_SYNTAX_TABLE_BACKWARD (from - 1);
- if (from != stop && c == FETCH_CHAR (temp_pos))
+ if (from != stop && c == FETCH_CHAR_AS_MULTIBYTE (temp_pos))
DEC_BOTH (from, from_byte);
if (mathexit)
{
@@ -2532,7 +2754,7 @@ scan_lists (from, count, depth, sexpflag)
DEC_BOTH (from, from_byte);
UPDATE_SYNTAX_TABLE_BACKWARD (from);
if (!char_quoted (from, from_byte)
- && (c = FETCH_CHAR (from_byte),
+ && (c = FETCH_CHAR_AS_MULTIBYTE (from_byte),
SYNTAX_WITH_MULTIBYTE_CHECK (c) == code))
break;
}
@@ -2540,14 +2762,15 @@ scan_lists (from, count, depth, sexpflag)
break;
case Sstring:
- stringterm = FETCH_CHAR (from_byte);
+ stringterm = FETCH_CHAR_AS_MULTIBYTE (from_byte);
while (1)
{
if (from == stop) goto lose;
DEC_BOTH (from, from_byte);
UPDATE_SYNTAX_TABLE_BACKWARD (from);
if (!char_quoted (from, from_byte)
- && stringterm == (c = FETCH_CHAR (from_byte))
+ && (stringterm
+ == (c = FETCH_CHAR_AS_MULTIBYTE (from_byte)))
&& SYNTAX_WITH_MULTIBYTE_CHECK (c) == Sstring)
break;
}
@@ -2650,7 +2873,7 @@ This includes chars with "quote" or "prefix" syntax (' or p). */)
while (!char_quoted (pos, pos_byte)
/* Previous statement updates syntax table. */
- && ((c = FETCH_CHAR (pos_byte), SYNTAX (c) == Squote)
+ && ((c = FETCH_CHAR_AS_MULTIBYTE (pos_byte), SYNTAX (c) == Squote)
|| SYNTAX_PREFIX (c)))
{
opoint = pos;
@@ -2678,7 +2901,8 @@ scan_sexps_forward (stateptr, from, from_byte, end, targetdepth,
stopbefore, oldstate, commentstop)
struct lisp_parse_state *stateptr;
register int from;
- int end, targetdepth, stopbefore, from_byte;
+ int from_byte;
+ int end, targetdepth, stopbefore;
Lisp_Object oldstate;
int commentstop;
{
@@ -2715,7 +2939,7 @@ scan_sexps_forward (stateptr, from, from_byte, end, targetdepth,
#define INC_FROM \
do { prev_from = from; \
prev_from_byte = from_byte; \
- temp = FETCH_CHAR (prev_from_byte); \
+ temp = FETCH_CHAR_AS_MULTIBYTE (prev_from_byte); \
prev_from_syntax = SYNTAX_WITH_FLAGS (temp); \
INC_BOTH (from, from_byte); \
if (from < end) \
@@ -2871,7 +3095,7 @@ do { prev_from = from; \
while (from < end)
{
/* Some compilers can't handle this inside the switch. */
- temp = FETCH_CHAR (from_byte);
+ temp = FETCH_CHAR_AS_MULTIBYTE (from_byte);
temp = SYNTAX (temp);
switch (temp)
{
@@ -2945,7 +3169,7 @@ do { prev_from = from; \
if (stopbefore) goto stop; /* this arg means stop at sexp start */
curlevel->last = prev_from;
state.instring = (code == Sstring
- ? (FETCH_CHAR (prev_from_byte))
+ ? (FETCH_CHAR_AS_MULTIBYTE (prev_from_byte))
: ST_STRING_STYLE);
if (boundary_stop) goto done;
startinstring:
@@ -2957,7 +3181,7 @@ do { prev_from = from; \
int c;
if (from >= end) goto done;
- c = FETCH_CHAR (from_byte);
+ c = FETCH_CHAR_AS_MULTIBYTE (from_byte);
/* Some compilers can't handle this inside the switch. */
temp = SYNTAX (c);
@@ -3183,8 +3407,7 @@ init_syntax_once ()
/* All multibyte characters have syntax `word' by default. */
temp = XVECTOR (Vsyntax_code_object)->contents[(int) Sword];
- for (i = CHAR_TABLE_SINGLE_BYTE_SLOTS; i < CHAR_TABLE_ORDINARY_SLOTS; i++)
- XCHAR_TABLE (Vstandard_syntax_table)->contents[i] = temp;
+ char_table_set_range (Vstandard_syntax_table, 0x80, MAX_CHAR, temp);
}
void
@@ -3232,6 +3455,25 @@ See the info node `(elisp)Syntax Properties' for a description of the
doc: /* *Non-nil means an open paren in column 0 denotes the start of a defun. */);
open_paren_in_column_0_is_defun_start = 1;
+
+ DEFVAR_LISP ("find-word-boundary-function-table",
+ &Vfind_word_boundary_function_table,
+ doc: /*
+Char table of functions to search for the word boundary.
+Each function is called with two arguments; POS and LIMIT.
+POS and LIMIT are character positions in the current buffer.
+
+If POS is less than LIMIT, POS is at the first character of a word,
+and the return value of a function is a position after the last
+character of that word.
+
+If POS is not less than LIMIT, POS is at the last character of a word,
+and the return value of a function is a position at the first
+character of that word.
+
+In both cases, LIMIT bounds the search. */);
+ Vfind_word_boundary_function_table = Fmake_char_table (Qnil, Qnil);
+
defsubr (&Ssyntax_table_p);
defsubr (&Ssyntax_table);
defsubr (&Sstandard_syntax_table);
diff --git a/src/syntax.h b/src/syntax.h
index 4026eeaee8..a23e838dea 100644
--- a/src/syntax.h
+++ b/src/syntax.h
@@ -58,37 +58,14 @@ enum syntaxcode
/* Set the syntax entry VAL for char C in table TABLE. */
-#define SET_RAW_SYNTAX_ENTRY(table, c, val) \
- ((((c) & 0xFF) == (c)) \
- ? (XCHAR_TABLE (table)->contents[(unsigned char) (c)] = (val)) \
- : Faset ((table), make_number (c), (val)))
+#define SET_RAW_SYNTAX_ENTRY(table, c, val) \
+ CHAR_TABLE_SET ((table), c, (val))
-/* Fetch the syntax entry for char C in syntax table TABLE.
- This macro is called only when C is less than CHAR_TABLE_ORDINARY_SLOTS.
- Do inheritance. */
+/* Set the syntax entry VAL for char-range RANGE in table TABLE.
+ RANGE is a cons (FROM . TO) specifying the range of characters. */
-#ifdef __GNUC__
-#define SYNTAX_ENTRY_FOLLOW_PARENT(table, c) \
- ({ Lisp_Object _syntax_tbl = (table); \
- Lisp_Object _syntax_temp = XCHAR_TABLE (_syntax_tbl)->contents[(c)]; \
- while (NILP (_syntax_temp)) \
- { \
- _syntax_tbl = XCHAR_TABLE (_syntax_tbl)->parent; \
- if (NILP (_syntax_tbl)) \
- break; \
- _syntax_temp = XCHAR_TABLE (_syntax_tbl)->contents[(c)]; \
- } \
- _syntax_temp; })
-#else
-extern Lisp_Object syntax_temp;
-extern Lisp_Object syntax_parent_lookup P_ ((Lisp_Object, int));
-
-#define SYNTAX_ENTRY_FOLLOW_PARENT(table, c) \
- (syntax_temp = XCHAR_TABLE (table)->contents[(c)], \
- (NILP (syntax_temp) \
- ? syntax_parent_lookup (table, (c)) \
- : syntax_temp))
-#endif
+#define SET_RAW_SYNTAX_ENTRY_RANGE(table, range, val) \
+ Fset_char_table_range ((table), (range), (val))
/* SYNTAX_ENTRY fetches the information from the entry for character C
in syntax table TABLE, or from globally kept data (gl_state).
@@ -106,12 +83,7 @@ extern Lisp_Object syntax_parent_lookup P_ ((Lisp_Object, int));
# define CURRENT_SYNTAX_TABLE current_buffer->syntax_table
#endif
-#define SYNTAX_ENTRY_INT(c) \
- ((((c) & 0xFF) == (c)) \
- ? SYNTAX_ENTRY_FOLLOW_PARENT (CURRENT_SYNTAX_TABLE, \
- (unsigned char) (c)) \
- : Faref (CURRENT_SYNTAX_TABLE, \
- make_number (c)))
+#define SYNTAX_ENTRY_INT(c) CHAR_TABLE_REF (CURRENT_SYNTAX_TABLE, (c))
/* Extract the information from the entry for character C
in the current syntax table. */
@@ -138,6 +110,7 @@ extern Lisp_Object syntax_parent_lookup P_ ((Lisp_Object, int));
? XCDR (_syntax_temp) \
: Qnil); })
#else
+extern Lisp_Object syntax_temp;
#define SYNTAX(c) \
(syntax_temp = SYNTAX_ENTRY ((c)), \
(CONSP (syntax_temp) \
diff --git a/src/sysdep.c b/src/sysdep.c
index 35a107f34c..f2170dabed 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -46,12 +46,6 @@ extern void srandom P_ ((unsigned int));
#endif
#endif
-/* The w32 build defines select stuff in w32.h, which is included by
- sys/select.h (included below). */
-#ifndef WINDOWSNT
-#include "sysselect.h"
-#endif
-
#include "blockinput.h"
#ifdef MAC_OS8
@@ -182,7 +176,6 @@ extern int quit_char;
#include "termopts.h"
#include "dispextern.h"
#include "process.h"
-#include "cm.h" /* for reset_sys_modes */
#ifdef WINDOWSNT
#include <direct.h>
@@ -246,11 +239,16 @@ static int baud_convert[] =
int emacs_ospeed;
+/* The file descriptor for Emacs's input terminal.
+ Under Unix, this is normally zero except when using X;
+ under VMS, we place the input channel number here. */
+int input_fd;
+
void croak P_ ((char *)) NO_RETURN;
#ifdef AIXHFT
-void hft_init P_ ((struct tty_display_info *));
-void hft_reset P_ ((struct tty_display_info *));
+void hft_init ();
+void hft_reset ();
#endif
/* Temporary used by `sigblock' when defined in terms of signprocmask. */
@@ -333,7 +331,16 @@ get_current_dir_name ()
#endif
-/* Discard pending input on all input descriptors. */
+/* Specify a different file descriptor for further input operations. */
+
+void
+change_input_fd (fd)
+ int fd;
+{
+ input_fd = fd;
+}
+
+/* Discard pending input on descriptor input_fd. */
void
discard_tty_input ()
@@ -344,61 +351,54 @@ discard_tty_input ()
if (noninteractive)
return;
+ /* Discarding input is not safe when the input could contain
+ replies from the X server. So don't do it. */
+ if (read_socket_hook)
+ return;
+
#ifdef VMS
end_kbd_input ();
- SYS$QIOW (0, fileno (CURTTY()->input), IO$_READVBLK|IO$M_PURGE, input_iosb, 0, 0,
+ SYS$QIOW (0, input_fd, IO$_READVBLK|IO$M_PURGE, input_iosb, 0, 0,
&buf.main, 0, 0, terminator_mask, 0, 0);
queue_kbd_input ();
#else /* not VMS */
#ifdef APOLLO
{
- struct tty_display_info *tty;
- for (tty = tty_list; tty; tty = tty->next)
- {
- int zero = 0;
- if (tty->input)
- ioctl (fileno (tty->input), TIOCFLUSH, &zero);
- }
+ int zero = 0;
+ ioctl (input_fd, TIOCFLUSH, &zero);
}
#else /* not Apollo */
#ifdef MSDOS /* Demacs 1.1.1 91/10/16 HIRANO Satoshi */
while (dos_keyread () != -1)
;
#else /* not MSDOS */
- {
- struct tty_display_info *tty;
- for (tty = tty_list; tty; tty = tty->next)
- {
- if (tty->input) /* Is the device suspended? */
- {
- EMACS_GET_TTY (fileno (tty->input), &buf);
- EMACS_SET_TTY (fileno (tty->input), &buf, 0);
- }
- }
- }
+ EMACS_GET_TTY (input_fd, &buf);
+ EMACS_SET_TTY (input_fd, &buf, 0);
#endif /* not MSDOS */
#endif /* not Apollo */
#endif /* not VMS */
#endif /* not WINDOWSNT */
}
-
#ifdef SIGTSTP
/* Arrange for character C to be read as the next input from
- the terminal.
- XXX What if we have multiple ttys?
-*/
+ the terminal. */
void
+#ifdef PROTOTYPES
stuff_char (char c)
+#else
+stuff_char (c)
+ char c;
+#endif
{
- if (! FRAME_TERMCAP_P (SELECTED_FRAME ()))
+ if (read_socket_hook)
return;
/* Should perhaps error if in batch mode */
#ifdef TIOCSTI
- ioctl (fileno (CURTTY()->input), TIOCSTI, &c);
+ ioctl (input_fd, TIOCSTI, &c);
#else /* no TIOCSTI */
error ("Cannot stuff terminal input characters in this version of Unix");
#endif /* no TIOCSTI */
@@ -407,7 +407,7 @@ stuff_char (char c)
#endif /* SIGTSTP */
void
-init_baud_rate (int fd)
+init_baud_rate ()
{
if (noninteractive)
emacs_ospeed = 0;
@@ -422,7 +422,7 @@ init_baud_rate (int fd)
#ifdef VMS
struct sensemode sg;
- SYS$QIOW (0, fd, IO$_SENSEMODE, &sg, 0, 0,
+ SYS$QIOW (0, input_fd, IO$_SENSEMODE, &sg, 0, 0,
&sg.class, 12, 0, 0, 0, 0 );
emacs_ospeed = sg.xmit_baud;
#else /* not VMS */
@@ -430,7 +430,7 @@ init_baud_rate (int fd)
struct termios sg;
sg.c_cflag = B9600;
- tcgetattr (fd, &sg);
+ tcgetattr (input_fd, &sg);
emacs_ospeed = cfgetospeed (&sg);
#if defined (USE_GETOBAUD) && defined (getobaud)
/* m88k-motorola-sysv3 needs this ([email protected]) 9/1/94. */
@@ -443,16 +443,16 @@ init_baud_rate (int fd)
sg.c_cflag = B9600;
#ifdef HAVE_TCATTR
- tcgetattr (fd, &sg);
+ tcgetattr (input_fd, &sg);
#else
- ioctl (fd, TCGETA, &sg);
+ ioctl (input_fd, TCGETA, &sg);
#endif
emacs_ospeed = sg.c_cflag & CBAUD;
#else /* neither VMS nor TERMIOS nor TERMIO */
struct sgttyb sg;
sg.sg_ospeed = B9600;
- if (ioctl (fd, TIOCGETP, &sg) < 0)
+ if (ioctl (input_fd, TIOCGETP, &sg) < 0)
abort ();
emacs_ospeed = sg.sg_ospeed;
#endif /* not HAVE_TERMIO */
@@ -468,7 +468,6 @@ init_baud_rate (int fd)
baud_rate = 1200;
}
-
/*ARGSUSED*/
void
set_exclusive_use (fd)
@@ -730,7 +729,7 @@ child_setup_tty (out)
#ifdef BSD4_1
if (interrupt_input)
- reset_sigio (0);
+ reset_sigio ();
#endif /* BSD4_1 */
#ifdef RTU
{
@@ -987,86 +986,53 @@ restore_signal_handlers (saved_handlers)
}
}
-#ifndef SIGIO
-/* If SIGIO is broken, don't do anything. */
-void
-init_sigio (int fd)
-{
-}
-
-void
-reset_sigio (int fd)
-{
-}
-
-void
-request_sigio (void)
-{
-}
-
-void
-unrequest_sigio (void)
-{
-}
-
-#else
#ifdef F_SETFL
-int old_fcntl_flags[MAXDESC];
+int old_fcntl_flags;
void
init_sigio (fd)
int fd;
{
#ifdef FASYNC
- old_fcntl_flags[fd] = fcntl (fd, F_GETFL, 0) & ~FASYNC;
- fcntl (fd, F_SETFL, old_fcntl_flags[fd] | FASYNC);
+ old_fcntl_flags = fcntl (fd, F_GETFL, 0) & ~FASYNC;
+ fcntl (fd, F_SETFL, old_fcntl_flags | FASYNC);
#endif
interrupts_deferred = 0;
}
void
-reset_sigio (fd)
- int fd;
+reset_sigio ()
{
-#ifdef FASYNC
- fcntl (fd, F_SETFL, old_fcntl_flags[fd]);
-#endif
+ unrequest_sigio ();
}
#ifdef FASYNC /* F_SETFL does not imply existence of FASYNC */
-/* XXX Uhm, FASYNC is not used anymore here. */
-/* XXX Yeah, but you need it for SIGIO, don't you? */
void
request_sigio ()
{
- if (noninteractive)
+ if (noninteractive || read_socket_hook)
return;
#ifdef SIGWINCH
sigunblock (sigmask (SIGWINCH));
#endif
- sigunblock (sigmask (SIGIO));
+ fcntl (input_fd, F_SETFL, old_fcntl_flags | FASYNC);
interrupts_deferred = 0;
}
void
-unrequest_sigio (void)
-{
- if (noninteractive)
- return;
-
-#if 0 /* XXX What's wrong with blocking SIGIO under X? */
- if (x_display_list)
+unrequest_sigio ()
+{
+ if (noninteractive || read_socket_hook)
return;
-#endif
#ifdef SIGWINCH
sigblock (sigmask (SIGWINCH));
#endif
- sigblock (sigmask (SIGIO));
+ fcntl (input_fd, F_SETFL, old_fcntl_flags);
interrupts_deferred = 1;
}
@@ -1081,8 +1047,7 @@ request_sigio ()
if (noninteractive || read_socket_hook)
return;
- /* XXX CURTTY() is bogus here. */
- ioctl (fileno (CURTTY ()->input), FIOASYNC, &on);
+ ioctl (input_fd, FIOASYNC, &on);
interrupts_deferred = 0;
}
@@ -1094,8 +1059,7 @@ unrequest_sigio ()
if (noninteractive || read_socket_hook)
return;
- /* XXX CURTTY() is bogus here. */
- ioctl (fileno (CURTTY ()->input), FIOASYNC, &off);
+ ioctl (input_fd, FIOASYNC, &off);
interrupts_deferred = 1;
}
@@ -1116,7 +1080,7 @@ request_sigio ()
sigemptyset (&st);
sigaddset (&st, SIGIO);
- ioctl (0, FIOASYNC, &on); /* XXX This fails for multiple ttys. */
+ ioctl (input_fd, FIOASYNC, &on);
interrupts_deferred = 0;
sigprocmask (SIG_UNBLOCK, &st, (sigset_t *)0);
}
@@ -1129,7 +1093,7 @@ unrequest_sigio ()
if (noninteractive || read_socket_hook)
return;
- ioctl (0, FIOASYNC, &off); /* XXX This fails for multiple ttys. */
+ ioctl (input_fd, FIOASYNC, &off);
interrupts_deferred = 1;
}
@@ -1159,7 +1123,6 @@ unrequest_sigio ()
#endif /* STRIDE */
#endif /* FASYNC */
#endif /* F_SETFL */
-#endif /* SIGIO */
/* Saving and restoring the process group of Emacs's terminal. */
@@ -1182,39 +1145,30 @@ unrequest_sigio ()
the tty's pgroup just like any other terminal setting. If
inherited_group was not the tty's pgroup, then we'll get a
SIGTTmumble when we try to change the tty's pgroup, and a CONT if
- it goes foreground in the future, which is what should happen.
-
- This variable is initialized in emacs.c. */
+ it goes foreground in the future, which is what should happen. */
int inherited_pgroup;
-/* Split off the foreground process group to Emacs alone. When we are
- in the foreground, but not started in our own process group,
- redirect the tty device handle FD to point to our own process
- group. We need to be in our own process group to receive SIGIO
- properly. */
-static void
-narrow_foreground_group (int fd)
+/* Split off the foreground process group to Emacs alone.
+ When we are in the foreground, but not started in our own process
+ group, redirect the TTY to point to our own process group. We need
+ to be in our own process group to receive SIGIO properly. */
+void
+narrow_foreground_group ()
{
int me = getpid ();
setpgrp (0, inherited_pgroup);
-#if 0
- /* XXX inherited_pgroup should not be zero here, but GTK seems to
- mess this up. */
- if (! inherited_pgroup)
- abort (); /* Should not happen. */
-#endif
if (inherited_pgroup != me)
- EMACS_SET_TTY_PGRP (fd, &me); /* XXX This only works on the controlling tty. */
+ EMACS_SET_TTY_PGRP (input_fd, &me);
setpgrp (0, me);
}
/* Set the tty to our original foreground group. */
-static void
-widen_foreground_group (int fd)
+void
+widen_foreground_group ()
{
if (inherited_pgroup != getpid ())
- EMACS_SET_TTY_PGRP (fd, &inherited_pgroup);
+ EMACS_SET_TTY_PGRP (input_fd, &inherited_pgroup);
setpgrp (0, inherited_pgroup);
}
@@ -1372,6 +1326,14 @@ emacs_set_tty (fd, settings, flushp)
}
+/* The initial tty mode bits */
+struct emacs_tty old_tty;
+
+/* 1 if we have been through init_sys_modes. */
+int term_initted;
+
+/* 1 if outer tty status has been recorded. */
+int old_tty_valid;
#ifdef BSD4_1
/* BSD 4.1 needs to keep track of the lmode bits in order to start
@@ -1381,7 +1343,7 @@ int lmode;
#ifndef F_SETOWN_BUG
#ifdef F_SETOWN
-int old_fcntl_owner[MAXDESC];
+int old_fcntl_owner;
#endif /* F_SETOWN */
#endif /* F_SETOWN_BUG */
@@ -1406,22 +1368,8 @@ static struct ltchars new_ltchars = {-1,-1,-1,-1,-1,-1};
static struct tchars new_tchars = {-1,-1,-1,-1,-1,-1};
#endif
-/* Initialize the terminal mode on all tty devices that are currently
- open. */
-
void
-init_all_sys_modes (void)
-{
- struct tty_display_info *tty;
- for (tty = tty_list; tty; tty = tty->next)
- init_sys_modes (tty);
-}
-
-/* Initialize the terminal mode on the given tty device. */
-
-void
-init_sys_modes (tty_out)
- struct tty_display_info *tty_out;
+init_sys_modes ()
{
struct emacs_tty tty;
@@ -1437,9 +1385,6 @@ init_sys_modes (tty_out)
if (noninteractive)
return;
- if (!tty_out->output)
- return; /* The tty is suspended. */
-
#ifdef VMS
if (!input_ef)
input_ef = get_kbd_event_flag ();
@@ -1470,291 +1415,269 @@ init_sys_modes (tty_out)
#ifndef VMS4_4
sys_access_reinit ();
#endif
-#endif /* VMS */
+#endif /* not VMS */
#ifdef BSD_PGRPS
-#if 0
- /* read_socket_hook is not global anymore. I think doing this
- unconditionally will not cause any problems. */
- if (! read_socket_hook && EQ (Vinitial_window_system, Qnil))
+ if (! read_socket_hook && EQ (Vwindow_system, Qnil))
+ narrow_foreground_group ();
#endif
- narrow_foreground_group (fileno (tty_out->input));
+
+#ifdef HAVE_WINDOW_SYSTEM
+ /* Emacs' window system on MSDOG uses the `internal terminal' and therefore
+ needs the initialization code below. */
+ if (!read_socket_hook && EQ (Vwindow_system, Qnil))
#endif
+ {
+ EMACS_GET_TTY (input_fd, &old_tty);
- if (! tty_out->old_tty)
- tty_out->old_tty = (struct emacs_tty *) xmalloc (sizeof (struct emacs_tty));
-
- EMACS_GET_TTY (fileno (tty_out->input), tty_out->old_tty);
+ old_tty_valid = 1;
- tty = *tty_out->old_tty;
+ tty = old_tty;
#if defined (HAVE_TERMIO) || defined (HAVE_TERMIOS)
- XSETINT (Vtty_erase_char, tty.main.c_cc[VERASE]);
+ XSETINT (Vtty_erase_char, old_tty.main.c_cc[VERASE]);
#ifdef DGUX
- /* This allows meta to be sent on 8th bit. */
- tty.main.c_iflag &= ~INPCK; /* don't check input for parity */
+ /* This allows meta to be sent on 8th bit. */
+ tty.main.c_iflag &= ~INPCK; /* don't check input for parity */
#endif
- tty.main.c_iflag |= (IGNBRK); /* Ignore break condition */
- tty.main.c_iflag &= ~ICRNL; /* Disable map of CR to NL on input */
+ tty.main.c_iflag |= (IGNBRK); /* Ignore break condition */
+ tty.main.c_iflag &= ~ICRNL; /* Disable map of CR to NL on input */
#ifdef INLCR /* I'm just being cautious,
since I can't check how widespread INLCR is--rms. */
- tty.main.c_iflag &= ~INLCR; /* Disable map of NL to CR on input */
+ tty.main.c_iflag &= ~INLCR; /* Disable map of NL to CR on input */
#endif
#ifdef ISTRIP
- tty.main.c_iflag &= ~ISTRIP; /* don't strip 8th bit on input */
+ tty.main.c_iflag &= ~ISTRIP; /* don't strip 8th bit on input */
#endif
- tty.main.c_lflag &= ~ECHO; /* Disable echo */
- tty.main.c_lflag &= ~ICANON; /* Disable erase/kill processing */
+ tty.main.c_lflag &= ~ECHO; /* Disable echo */
+ tty.main.c_lflag &= ~ICANON; /* Disable erase/kill processing */
#ifdef IEXTEN
- tty.main.c_lflag &= ~IEXTEN; /* Disable other editing characters. */
+ tty.main.c_lflag &= ~IEXTEN; /* Disable other editing characters. */
#endif
- tty.main.c_lflag |= ISIG; /* Enable signals */
- if (tty_out->flow_control)
- {
- tty.main.c_iflag |= IXON; /* Enable start/stop output control */
+ tty.main.c_lflag |= ISIG; /* Enable signals */
+ if (flow_control)
+ {
+ tty.main.c_iflag |= IXON; /* Enable start/stop output control */
#ifdef IXANY
- tty.main.c_iflag &= ~IXANY;
+ tty.main.c_iflag &= ~IXANY;
#endif /* IXANY */
- }
- else
- tty.main.c_iflag &= ~IXON; /* Disable start/stop output control */
- tty.main.c_oflag &= ~ONLCR; /* Disable map of NL to CR-NL
- on output */
- tty.main.c_oflag &= ~TAB3; /* Disable tab expansion */
+ }
+ else
+ tty.main.c_iflag &= ~IXON; /* Disable start/stop output control */
+ tty.main.c_oflag &= ~ONLCR; /* Disable map of NL to CR-NL
+ on output */
+ tty.main.c_oflag &= ~TAB3; /* Disable tab expansion */
#ifdef CS8
- if (tty_out->meta_key)
- {
- tty.main.c_cflag |= CS8; /* allow 8th bit on input */
- tty.main.c_cflag &= ~PARENB;/* Don't check parity */
- }
+ if (meta_key)
+ {
+ tty.main.c_cflag |= CS8; /* allow 8th bit on input */
+ tty.main.c_cflag &= ~PARENB;/* Don't check parity */
+ }
#endif
- if (tty_out->input == stdin)
- {
tty.main.c_cc[VINTR] = quit_char; /* C-g (usually) gives SIGINT */
/* Set up C-g for both SIGQUIT and SIGINT.
- We don't know which we will get, but we handle both alike
- so which one it really gives us does not matter. */
+ We don't know which we will get, but we handle both alike
+ so which one it really gives us does not matter. */
tty.main.c_cc[VQUIT] = quit_char;
- }
- else
- {
- /* We normally don't get interrupt or quit signals from tty
- devices other than our controlling terminal; therefore,
- we must handle C-g as normal input. Unfortunately, this
- means that the interrupt and quit feature must be
- disabled on secondary ttys, or we would not even see the
- keypress.
-
- Note that even though emacsclient could have special code
- to pass SIGINT to Emacs, we should _not_ enable
- interrupt/quit keys for emacsclient frames. This means
- that we can't break out of loops in C code from a
- secondary tty frame, but we can always decide what
- display the C-g came from, which is more important from a
- usability point of view. (Consider the case when two
- people work together using the same Emacs instance.) */
- tty.main.c_cc[VINTR] = CDISABLE;
- tty.main.c_cc[VQUIT] = CDISABLE;
- }
- tty.main.c_cc[VMIN] = 1; /* Input should wait for at least 1 char */
- tty.main.c_cc[VTIME] = 0; /* no matter how long that takes. */
+ tty.main.c_cc[VMIN] = 1; /* Input should wait for at least 1 char */
+ tty.main.c_cc[VTIME] = 0; /* no matter how long that takes. */
#ifdef VSWTCH
- tty.main.c_cc[VSWTCH] = CDISABLE; /* Turn off shell layering use
+ tty.main.c_cc[VSWTCH] = CDISABLE; /* Turn off shell layering use
of C-z */
#endif /* VSWTCH */
-
+
#if defined (mips) || defined (HAVE_TCATTR)
#ifdef VSUSP
- tty.main.c_cc[VSUSP] = CDISABLE; /* Turn off mips handling of C-z. */
+ tty.main.c_cc[VSUSP] = CDISABLE; /* Turn off mips handling of C-z. */
#endif /* VSUSP */
#ifdef V_DSUSP
- tty.main.c_cc[V_DSUSP] = CDISABLE; /* Turn off mips handling of C-y. */
+ tty.main.c_cc[V_DSUSP] = CDISABLE; /* Turn off mips handling of C-y. */
#endif /* V_DSUSP */
#ifdef VDSUSP /* Some systems have VDSUSP, some have V_DSUSP. */
- tty.main.c_cc[VDSUSP] = CDISABLE;
+ tty.main.c_cc[VDSUSP] = CDISABLE;
#endif /* VDSUSP */
#ifdef VLNEXT
- tty.main.c_cc[VLNEXT] = CDISABLE;
+ tty.main.c_cc[VLNEXT] = CDISABLE;
#endif /* VLNEXT */
#ifdef VREPRINT
- tty.main.c_cc[VREPRINT] = CDISABLE;
+ tty.main.c_cc[VREPRINT] = CDISABLE;
#endif /* VREPRINT */
#ifdef VWERASE
- tty.main.c_cc[VWERASE] = CDISABLE;
+ tty.main.c_cc[VWERASE] = CDISABLE;
#endif /* VWERASE */
#ifdef VDISCARD
- tty.main.c_cc[VDISCARD] = CDISABLE;
+ tty.main.c_cc[VDISCARD] = CDISABLE;
#endif /* VDISCARD */
- if (tty_out->flow_control)
- {
+ if (flow_control)
+ {
#ifdef VSTART
- tty.main.c_cc[VSTART] = '\021';
+ tty.main.c_cc[VSTART] = '\021';
#endif /* VSTART */
#ifdef VSTOP
- tty.main.c_cc[VSTOP] = '\023';
+ tty.main.c_cc[VSTOP] = '\023';
#endif /* VSTOP */
- }
- else
- {
+ }
+ else
+ {
#ifdef VSTART
- tty.main.c_cc[VSTART] = CDISABLE;
+ tty.main.c_cc[VSTART] = CDISABLE;
#endif /* VSTART */
#ifdef VSTOP
- tty.main.c_cc[VSTOP] = CDISABLE;
+ tty.main.c_cc[VSTOP] = CDISABLE;
#endif /* VSTOP */
- }
+ }
#endif /* mips or HAVE_TCATTR */
#ifdef SET_LINE_DISCIPLINE
- /* Need to explicitly request TERMIODISC line discipline or
- Ultrix's termios does not work correctly. */
- tty.main.c_line = SET_LINE_DISCIPLINE;
+ /* Need to explicitly request TERMIODISC line discipline or
+ Ultrix's termios does not work correctly. */
+ tty.main.c_line = SET_LINE_DISCIPLINE;
#endif
#ifdef AIX
#ifndef IBMR2AIX
- /* AIX enhanced edit loses NULs, so disable it. */
- tty.main.c_line = 0;
- tty.main.c_iflag &= ~ASCEDIT;
+ /* AIX enhanced edit loses NULs, so disable it. */
+ tty.main.c_line = 0;
+ tty.main.c_iflag &= ~ASCEDIT;
#else
- tty.main.c_cc[VSTRT] = CDISABLE;
- tty.main.c_cc[VSTOP] = CDISABLE;
- tty.main.c_cc[VSUSP] = CDISABLE;
- tty.main.c_cc[VDSUSP] = CDISABLE;
+ tty.main.c_cc[VSTRT] = CDISABLE;
+ tty.main.c_cc[VSTOP] = CDISABLE;
+ tty.main.c_cc[VSUSP] = CDISABLE;
+ tty.main.c_cc[VDSUSP] = CDISABLE;
#endif /* IBMR2AIX */
- if (tty_out->flow_control)
- {
+ if (flow_control)
+ {
#ifdef VSTART
- tty.main.c_cc[VSTART] = '\021';
+ tty.main.c_cc[VSTART] = '\021';
#endif /* VSTART */
#ifdef VSTOP
- tty.main.c_cc[VSTOP] = '\023';
+ tty.main.c_cc[VSTOP] = '\023';
#endif /* VSTOP */
- }
- /* Also, PTY overloads NUL and BREAK.
- don't ignore break, but don't signal either, so it looks like NUL.
- This really serves a purpose only if running in an XTERM window
- or via TELNET or the like, but does no harm elsewhere. */
- tty.main.c_iflag &= ~IGNBRK;
- tty.main.c_iflag &= ~BRKINT;
+ }
+ /* Also, PTY overloads NUL and BREAK.
+ don't ignore break, but don't signal either, so it looks like NUL.
+ This really serves a purpose only if running in an XTERM window
+ or via TELNET or the like, but does no harm elsewhere. */
+ tty.main.c_iflag &= ~IGNBRK;
+ tty.main.c_iflag &= ~BRKINT;
#endif
#else /* if not HAVE_TERMIO */
#ifdef VMS
- tty.main.tt_char |= TT$M_NOECHO;
- if (meta_key)
- tty.main.tt_char |= TT$M_EIGHTBIT;
- if (tty_out->flow_control)
- tty.main.tt_char |= TT$M_TTSYNC;
- else
- tty.main.tt_char &= ~TT$M_TTSYNC;
- tty.main.tt2_char |= TT2$M_PASTHRU | TT2$M_XON;
+ tty.main.tt_char |= TT$M_NOECHO;
+ if (meta_key)
+ tty.main.tt_char |= TT$M_EIGHTBIT;
+ if (flow_control)
+ tty.main.tt_char |= TT$M_TTSYNC;
+ else
+ tty.main.tt_char &= ~TT$M_TTSYNC;
+ tty.main.tt2_char |= TT2$M_PASTHRU | TT2$M_XON;
#else /* not VMS (BSD, that is) */
#ifndef DOS_NT
- XSETINT (Vtty_erase_char, tty.main.sg_erase);
- tty.main.sg_flags &= ~(ECHO | CRMOD | XTABS);
- if (meta_key)
- tty.main.sg_flags |= ANYP;
- tty.main.sg_flags |= interrupt_input ? RAW : CBREAK;
+ XSETINT (Vtty_erase_char, tty.main.sg_erase);
+ tty.main.sg_flags &= ~(ECHO | CRMOD | XTABS);
+ if (meta_key)
+ tty.main.sg_flags |= ANYP;
+ tty.main.sg_flags |= interrupt_input ? RAW : CBREAK;
#endif /* not DOS_NT */
#endif /* not VMS (BSD, that is) */
#endif /* not HAVE_TERMIO */
- /* If going to use CBREAK mode, we must request C-g to interrupt
- and turn off start and stop chars, etc. If not going to use
- CBREAK mode, do this anyway so as to turn off local flow
- control for user coming over network on 4.2; in this case,
- only t_stopc and t_startc really matter. */
+ /* If going to use CBREAK mode, we must request C-g to interrupt
+ and turn off start and stop chars, etc. If not going to use
+ CBREAK mode, do this anyway so as to turn off local flow
+ control for user coming over network on 4.2; in this case,
+ only t_stopc and t_startc really matter. */
#ifndef HAVE_TERMIO
#ifdef HAVE_TCHARS
- /* Note: if not using CBREAK mode, it makes no difference how we
- set this */
- tty.tchars = new_tchars;
- tty.tchars.t_intrc = quit_char;
- if (tty_out->flow_control)
- {
- tty.tchars.t_startc = '\021';
- tty.tchars.t_stopc = '\023';
- }
-
- tty.lmode = LDECCTQ | LLITOUT | LPASS8 | LNOFLSH | tty_out->old_tty.lmode;
+ /* Note: if not using CBREAK mode, it makes no difference how we
+ set this */
+ tty.tchars = new_tchars;
+ tty.tchars.t_intrc = quit_char;
+ if (flow_control)
+ {
+ tty.tchars.t_startc = '\021';
+ tty.tchars.t_stopc = '\023';
+ }
+
+ tty.lmode = LDECCTQ | LLITOUT | LPASS8 | LNOFLSH | old_tty.lmode;
#ifdef ultrix
- /* Under Ultrix 4.2a, leaving this out doesn't seem to hurt
- anything, and leaving it in breaks the meta key. Go figure. */
- tty.lmode &= ~LLITOUT;
+ /* Under Ultrix 4.2a, leaving this out doesn't seem to hurt
+ anything, and leaving it in breaks the meta key. Go figure. */
+ tty.lmode &= ~LLITOUT;
#endif
-
+
#ifdef BSD4_1
- lmode = tty.lmode;
+ lmode = tty.lmode;
#endif
#endif /* HAVE_TCHARS */
#endif /* not HAVE_TERMIO */
#ifdef HAVE_LTCHARS
- tty.ltchars = new_ltchars;
+ tty.ltchars = new_ltchars;
#endif /* HAVE_LTCHARS */
#ifdef MSDOS /* Demacs 1.1.2 91/10/20 Manabu Higashida, MW Aug 1993 */
- if (!tty_out->term_initted)
- internal_terminal_init ();
- dos_ttraw ();
+ if (!term_initted)
+ internal_terminal_init ();
+ dos_ttraw ();
#endif
- EMACS_SET_TTY (fileno (tty_out->input), &tty, 0);
+ EMACS_SET_TTY (input_fd, &tty, 0);
- /* This code added to insure that, if flow-control is not to be used,
- we have an unlocked terminal at the start. */
+ /* This code added to insure that, if flow-control is not to be used,
+ we have an unlocked terminal at the start. */
#ifdef TCXONC
- if (!tty_out->flow_control) ioctl (fileno (tty_out->input), TCXONC, 1);
+ if (!flow_control) ioctl (input_fd, TCXONC, 1);
#endif
#ifndef APOLLO
#ifdef TIOCSTART
- if (!tty_out->flow_control) ioctl (fileno (tty_out->input), TIOCSTART, 0);
+ if (!flow_control) ioctl (input_fd, TIOCSTART, 0);
#endif
#endif
#if defined (HAVE_TERMIOS) || defined (HPUX9)
#ifdef TCOON
- if (!tty_out->flow_control) tcflow (fileno (tty_out->input), TCOON);
+ if (!flow_control) tcflow (input_fd, TCOON);
#endif
#endif
#ifdef AIXHFT
- hft_init (tty_out);
+ hft_init ();
#ifdef IBMR2AIX
- {
- /* IBM's HFT device usually thinks a ^J should be LF/CR. We need it
- to be only LF. This is the way that is done. */
- struct termio tty;
-
- if (ioctl (1, HFTGETID, &tty) != -1)
- write (1, "\033[20l", 5);
- }
+ {
+ /* IBM's HFT device usually thinks a ^J should be LF/CR. We need it
+ to be only LF. This is the way that is done. */
+ struct termio tty;
+
+ if (ioctl (1, HFTGETID, &tty) != -1)
+ write (1, "\033[20l", 5);
+ }
#endif
#endif /* AIXHFT */
#ifdef VMS
/* Appears to do nothing when in PASTHRU mode.
- SYS$QIOW (0, fileno (tty_out->input), IO$_SETMODE|IO$M_OUTBAND, 0, 0, 0,
+ SYS$QIOW (0, input_fd, IO$_SETMODE|IO$M_OUTBAND, 0, 0, 0,
interrupt_signal, oob_chars, 0, 0, 0, 0);
*/
- queue_kbd_input (0);
+ queue_kbd_input (0);
#endif /* VMS */
+ }
#ifdef F_SETFL
#ifndef F_SETOWN_BUG
#ifdef F_GETOWN /* F_SETFL does not imply existence of F_GETOWN */
- if (interrupt_input)
+ if (interrupt_input
+ && ! read_socket_hook && EQ (Vwindow_system, Qnil))
{
- old_fcntl_owner[fileno (tty_out->input)] =
- fcntl (fileno (tty_out->input), F_GETOWN, 0);
- fcntl (fileno (tty_out->input), F_SETOWN, getpid ());
- init_sigio (fileno (tty_out->input));
+ old_fcntl_owner = fcntl (input_fd, F_GETOWN, 0);
+ fcntl (input_fd, F_SETOWN, getpid ());
+ init_sigio (input_fd);
#ifdef HAVE_GPM
- if (gpm_tty == tty_out)
+ if (term_gpm)
{
- /* Arrange for mouse events to give us SIGIO signals. */
fcntl (gpm_fd, F_SETOWN, getpid ());
fcntl (gpm_fd, F_SETFL, fcntl (gpm_fd, F_GETFL, 0) | O_NONBLOCK);
init_sigio (gpm_fd);
@@ -1767,7 +1690,7 @@ init_sys_modes (tty_out)
#ifdef BSD4_1
if (interrupt_input)
- init_sigio (fileno (tty_out->input));
+ init_sigio (input_fd);
#endif
#ifdef VMS /* VMS sometimes has this symbol but lacks setvbuf. */
@@ -1777,57 +1700,53 @@ init_sys_modes (tty_out)
/* This symbol is defined on recent USG systems.
Someone says without this call USG won't really buffer the file
even with a call to setbuf. */
- setvbuf (tty_out->output, (char *) _sobuf, _IOFBF, sizeof _sobuf);
+ setvbuf (stdout, (char *) _sobuf, _IOFBF, sizeof _sobuf);
#else
- setbuf (tty_out->output, (char *) _sobuf);
+ setbuf (stdout, (char *) _sobuf);
#endif
+#ifdef HAVE_WINDOW_SYSTEM
+ /* Emacs' window system on MSDOG uses the `internal terminal' and therefore
+ needs the initialization code below. */
+ if (EQ (Vwindow_system, Qnil)
+#ifndef WINDOWSNT
+ /* When running in tty mode on NT/Win95, we have a read_socket
+ hook, but still need the rest of the initialization code below. */
+ && (! read_socket_hook)
+#endif
+ )
+#endif
+ set_terminal_modes ();
- if (tty_out->terminal->set_terminal_modes_hook)
- tty_out->terminal->set_terminal_modes_hook (tty_out->terminal);
-
- if (!tty_out->term_initted)
- {
- Lisp_Object tail, frame;
- FOR_EACH_FRAME (tail, frame)
- {
- /* XXX This needs to be revised. */
- if (FRAME_TERMCAP_P (XFRAME (frame))
- && FRAME_TTY (XFRAME (frame)) == tty_out)
- init_frame_faces (XFRAME (frame));
- }
- }
+ if (!term_initted
+ && FRAMEP (Vterminal_frame)
+ && FRAME_TERMCAP_P (XFRAME (Vterminal_frame)))
+ init_frame_faces (XFRAME (Vterminal_frame));
- if (tty_out->term_initted && no_redraw_on_reenter)
+ if (term_initted && no_redraw_on_reenter)
{
- /* XXX This seems wrong on multi-tty. */
if (display_completed)
direct_output_forward_char (0);
}
else
{
- Lisp_Object tail, frame;
frame_garbaged = 1;
- FOR_EACH_FRAME (tail, frame)
- {
- if (FRAME_TERMCAP_P (XFRAME (frame))
- && FRAME_TTY (XFRAME (frame)) == tty_out)
- FRAME_GARBAGED_P (XFRAME (frame)) = 1;
- }
+ if (FRAMEP (Vterminal_frame))
+ FRAME_GARBAGED_P (XFRAME (Vterminal_frame)) = 1;
}
- tty_out->term_initted = 1;
+ term_initted = 1;
}
/* Return nonzero if safe to use tabs in output.
At the time this is called, init_sys_modes has not been done yet. */
int
-tabs_safe_p (int fd)
+tabs_safe_p ()
{
- struct emacs_tty etty;
+ struct emacs_tty tty;
- EMACS_GET_TTY (fd, &etty);
- return EMACS_TTY_TABS_OK (&etty);
+ EMACS_GET_TTY (input_fd, &tty);
+ return EMACS_TTY_TABS_OK (&tty);
}
/* Get terminal size from system.
@@ -1835,7 +1754,8 @@ tabs_safe_p (int fd)
We store 0 if there's no valid information. */
void
-get_tty_size (int fd, int *widthp, int *heightp)
+get_frame_size (widthp, heightp)
+ int *widthp, *heightp;
{
#ifdef TIOCGWINSZ
@@ -1843,7 +1763,7 @@ get_tty_size (int fd, int *widthp, int *heightp)
/* BSD-style. */
struct winsize size;
- if (ioctl (fd, TIOCGWINSZ, &size) == -1)
+ if (ioctl (input_fd, TIOCGWINSZ, &size) == -1)
*widthp = *heightp = 0;
else
{
@@ -1857,7 +1777,7 @@ get_tty_size (int fd, int *widthp, int *heightp)
/* SunOS - style. */
struct ttysize size;
- if (ioctl (fd, TIOCGSIZE, &size) == -1)
+ if (ioctl (input_fd, TIOCGSIZE, &size) == -1)
*widthp = *heightp = 0;
else
{
@@ -1889,6 +1809,7 @@ get_tty_size (int fd, int *widthp, int *heightp)
*widthp = 0;
*heightp = 0;
#endif
+
#endif /* not VMS */
#endif /* not SunOS-style */
#endif /* not BSD-style */
@@ -1932,58 +1853,37 @@ set_window_size (fd, height, width)
}
-
-/* Prepare all terminal devices for exiting Emacs. */
-
-void
-reset_all_sys_modes (void)
-{
- struct tty_display_info *tty;
- for (tty = tty_list; tty; tty = tty->next)
- reset_sys_modes (tty);
-}
-
-/* Prepare the terminal for closing it; move the cursor to the
+/* Prepare the terminal for exiting Emacs; move the cursor to the
bottom of the frame, turn off interrupt-driven I/O, etc. */
-
void
-reset_sys_modes (tty_out)
- struct tty_display_info *tty_out;
+reset_sys_modes ()
{
+ struct frame *sf;
+
if (noninteractive)
{
fflush (stdout);
return;
}
- if (!tty_out->term_initted)
+ if (!term_initted)
return;
-
- if (!tty_out->output)
- return; /* The tty is suspended. */
-
- /* Go to and clear the last line of the terminal. */
-
- cmgoto (tty_out, FrameRows (tty_out) - 1, 0);
-
- /* Code adapted from tty_clear_end_of_line. */
- if (tty_out->TS_clr_line)
- {
- emacs_tputs (tty_out, tty_out->TS_clr_line, 1, cmputc);
- }
- else
- { /* have to do it the hard way */
- int i;
- tty_turn_off_insert (tty_out);
-
- for (i = curX (tty_out); i < FrameCols (tty_out) - 1; i++)
- {
- fputc (' ', tty_out->output);
- }
- }
-
- cmgoto (tty_out, FrameRows (tty_out) - 1, 0);
- fflush (tty_out->output);
-
+#ifdef HAVE_WINDOW_SYSTEM
+ /* Emacs' window system on MSDOG uses the `internal terminal' and therefore
+ needs the clean-up code below. */
+ if (!EQ (Vwindow_system, Qnil)
+#ifndef WINDOWSNT
+ /* When running in tty mode on NT/Win95, we have a read_socket
+ hook, but still need the rest of the clean-up code below. */
+ || read_socket_hook
+#endif
+ )
+ return;
+#endif
+ sf = SELECTED_FRAME ();
+ cursor_to (FRAME_LINES (sf) - 1, 0);
+ clear_end_of_line (FRAME_COLS (sf));
+ /* clear_end_of_line may move the cursor */
+ cursor_to (FRAME_LINES (sf) - 1, 0);
#if defined (IBMR2AIX) && defined (AIXHFT)
{
/* HFT devices normally use ^J as a LF/CR. We forced it to
@@ -1995,13 +1895,12 @@ reset_sys_modes (tty_out)
}
#endif
- if (tty_out->terminal->reset_terminal_modes_hook)
- tty_out->terminal->reset_terminal_modes_hook (tty_out->terminal);
-
+ reset_terminal_modes ();
+ fflush (stdout);
#ifdef BSD_SYSTEM
#ifndef BSD4_1
/* Avoid possible loss of output when changing terminal modes. */
- fsync (fileno (tty_out->output));
+ fsync (fileno (stdout));
#endif
#endif
@@ -2010,25 +1909,22 @@ reset_sys_modes (tty_out)
#ifdef F_SETOWN /* F_SETFL does not imply existence of F_SETOWN */
if (interrupt_input)
{
- reset_sigio (fileno (tty_out->input));
- fcntl (fileno (tty_out->input), F_SETOWN,
- old_fcntl_owner[fileno (tty_out->input)]);
+ reset_sigio ();
+ fcntl (input_fd, F_SETOWN, old_fcntl_owner);
}
#endif /* F_SETOWN */
#endif /* F_SETOWN_BUG */
#ifdef O_NDELAY
- fcntl (fileno (tty_out->input), F_SETFL,
- fcntl (fileno (tty_out->input), F_GETFL, 0) & ~O_NDELAY);
+ fcntl (input_fd, F_SETFL, fcntl (input_fd, F_GETFL, 0) & ~O_NDELAY);
#endif
#endif /* F_SETFL */
#ifdef BSD4_1
if (interrupt_input)
- reset_sigio (fileno (tty_out->input));
+ reset_sigio ();
#endif /* BSD4_1 */
- if (tty_out->old_tty)
- while (EMACS_SET_TTY (fileno (tty_out->input),
- tty_out->old_tty, 0) < 0 && errno == EINTR)
+ if (old_tty_valid)
+ while (EMACS_SET_TTY (input_fd, &old_tty, 0) < 0 && errno == EINTR)
;
#ifdef MSDOS /* Demacs 1.1.2 91/10/20 Manabu Higashida */
@@ -2039,7 +1935,7 @@ reset_sys_modes (tty_out)
/* Ultrix's termios *ignores* any line discipline except TERMIODISC.
A different old line discipline is therefore not restored, yet.
Restore the old line discipline by hand. */
- ioctl (0, TIOCSETD, &tty_out->old_tty.main.c_line);
+ ioctl (0, TIOCSETD, &old_tty.main.c_line);
#endif
#ifdef AIXHFT
@@ -2047,7 +1943,7 @@ reset_sys_modes (tty_out)
#endif
#ifdef BSD_PGRPS
- widen_foreground_group (fileno (tty_out->input));
+ widen_foreground_group ();
#endif
}
@@ -2112,9 +2008,9 @@ init_vms_input ()
{
int status;
- if (fileno (CURTTY ()->input)) == 0)
+ if (input_fd == 0)
{
- status = SYS$ASSIGN (&input_dsc, &fileno (CURTTY ()->input)), 0, 0);
+ status = SYS$ASSIGN (&input_dsc, &input_fd, 0, 0);
if (! (status & 1))
LIB$STOP (status);
}
@@ -2125,7 +2021,7 @@ init_vms_input ()
void
stop_vms_input ()
{
- return SYS$DASSGN (fileno (CURTTY ()->input)));
+ return SYS$DASSGN (input_fd);
}
short input_buffer;
@@ -2141,7 +2037,7 @@ queue_kbd_input ()
waiting_for_ast = 0;
stop_input = 0;
- status = SYS$QIO (0, fileno (CURTTY()->input), IO$_READVBLK,
+ status = SYS$QIO (0, input_fd, IO$_READVBLK,
&input_iosb, kbd_input_ast, 1,
&input_buffer, 1, 0, terminator_mask, 0, 0);
}
@@ -2258,7 +2154,7 @@ end_kbd_input ()
#endif
if (LIB$AST_IN_PROG ()) /* Don't wait if suspending from kbd_buffer_store_event! */
{
- SYS$CANCEL (fileno (CURTTY()->input));
+ SYS$CANCEL (input_fd);
return;
}
@@ -2267,7 +2163,7 @@ end_kbd_input ()
SYS$CLREF (input_ef);
waiting_for_ast = 1;
stop_input = 1;
- SYS$CANCEL (fileno (CURTTY()->input));
+ SYS$CANCEL (input_fd);
SYS$SETAST (1);
SYS$WAITFR (input_ef);
waiting_for_ast = 0;
@@ -2329,8 +2225,7 @@ init_sigio (fd)
request_sigio ();
}
-reset_sigio (fd)
- int fd;
+reset_sigio ()
{
unrequest_sigio ();
}
@@ -2672,9 +2567,7 @@ sys_select (nfds, rfds, wfds, efds, timeout)
SELECT_TYPE *rfds, *wfds, *efds;
EMACS_TIME *timeout;
{
- /* XXX This needs to be updated for multi-tty support. Is there
- anybody who needs to emulate select these days? */
- int ravail = 0;
+ int ravail = 0;
SELECT_TYPE orfds;
int timeoutval;
int *local_timeout;
@@ -2689,7 +2582,7 @@ sys_select (nfds, rfds, wfds, efds, timeout)
#if defined (HAVE_SELECT) && defined (HAVE_X_WINDOWS)
/* If we're using X, then the native select will work; we only need the
emulation for non-X usage. */
- if (!NILP (Vinitial_window_system))
+ if (!NILP (Vwindow_system))
return select (nfds, rfds, wfds, efds, timeout);
#endif
timeoutval = timeout ? EMACS_SECS (*timeout) : 100000;
@@ -2806,8 +2699,6 @@ sys_select (nfds, rfds, wfds, efds, timeout)
void
read_input_waiting ()
{
- /* XXX This needs to be updated for multi-tty support. Is there
- anybody who needs to emulate select these days? */
int nread, i;
extern int quit_char;
@@ -2861,10 +2752,6 @@ read_input_waiting ()
}
}
-#if !defined (HAVE_SELECT) || defined (BROKEN_SELECT_NON_X)
-#define select sys_select
-#endif
-
#endif /* not HAVE_SELECT */
#endif /* not VMS */
#endif /* not MSDOS */
@@ -2881,13 +2768,12 @@ init_sigio (fd)
}
void
-reset_sigio (fd)
- int fd;
+reset_sigio ()
{
if (noninteractive)
return;
lmode = ~LINTRUP & lmode;
- ioctl (fd, TIOCLSET, &lmode);
+ ioctl (0, TIOCLSET, &lmode);
}
void
@@ -3343,7 +3229,7 @@ sys_getenv (name)
#undef abort
sys_abort ()
{
- reset_all_sys_modes ();
+ reset_sys_modes ();
LIB$SIGNAL (SS$_DEBUG);
}
#endif /* abort */
@@ -3670,7 +3556,7 @@ croak (badfunc)
char *badfunc;
{
printf ("%s not yet implemented\r\n", badfunc);
- reset_all_sys_modes ();
+ reset_sys_modes ();
exit (1);
}
@@ -5257,7 +5143,7 @@ croak (badfunc)
char *badfunc;
{
printf ("%s not yet implemented\r\n", badfunc);
- reset_all_sys_modes ();
+ reset_sys_modes ();
exit (1);
}
@@ -5279,7 +5165,7 @@ srandom (seed)
/* Called from init_sys_modes. */
void
-hft_init (struct tty_display_info *tty_out)
+hft_init ()
{
int junk;
@@ -5325,12 +5211,15 @@ hft_init (struct tty_display_info *tty_out)
keymap.hfkey[1].hf_char = 127;
hftctl (0, HFSKBD, &buf);
}
+ /* The HFT system on AIX doesn't optimize for scrolling, so it's really ugly
+ at times. */
+ line_ins_del_ok = char_ins_del_ok = 0;
}
/* Reset the rubout key to backspace. */
void
-hft_reset (struct tty_display_info *tty_out)
+hft_reset ()
{
struct hfbuf buf;
struct hfkeymap keymap;
diff --git a/src/syssignal.h b/src/syssignal.h
index 72ac1ed7f6..b52e2dd4b9 100644
--- a/src/syssignal.h
+++ b/src/syssignal.h
@@ -33,7 +33,6 @@ extern pthread_t main_thread;
indicate that SIGIO doesn't work by #undef-ing SIGIO. If this file
#includes <signal.h>, then that will re-#define SIGIO and confuse
things. */
-/* XXX This is not correct anymore, there is a BROKEN_SIGIO macro. */
#define SIGMASKTYPE sigset_t
diff --git a/src/term.c b/src/term.c
index b97e77b232..88e120d6d6 100644
--- a/src/term.c
+++ b/src/term.c
@@ -25,24 +25,18 @@ Boston, MA 02110-1301, USA. */
#include <stdio.h>
#include <ctype.h>
#include <string.h>
-#include <errno.h>
-#include <sys/file.h>
-
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-#if HAVE_TERMIOS_H
-#include <termios.h> /* For TIOCNOTTY. */
-#endif
-
-#include <signal.h>
-
-#include "lisp.h"
#include "termchar.h"
#include "termopts.h"
+#include "lisp.h"
+#include "buffer.h"
+#include "character.h"
#include "charset.h"
#include "coding.h"
+#include "composite.h"
#include "keyboard.h"
#include "frame.h"
#include "disptab.h"
@@ -51,8 +45,6 @@ Boston, MA 02110-1301, USA. */
#include "window.h"
#include "keymap.h"
#include "blockinput.h"
-#include "syssignal.h"
-#include "systty.h"
#include "intervals.h"
/* For now, don't try to include termcap.h. On some systems,
@@ -76,75 +68,221 @@ extern int tgetnum P_ ((char *id));
#include "macterm.h"
#endif
-#ifndef O_RDWR
-#define O_RDWR 2
-#endif
-
-#ifndef O_NOCTTY
-#define O_NOCTTY 0
-#endif
-
-/* The name of the default console device. */
-#ifdef WINDOWSNT
-#define DEV_TTY "CONOUT$"
-#else
-#define DEV_TTY "/dev/tty"
-#endif
-
-static void tty_set_scroll_region P_ ((struct frame *f, int start, int stop));
static void turn_on_face P_ ((struct frame *, int face_id));
static void turn_off_face P_ ((struct frame *, int face_id));
-static void tty_show_cursor P_ ((struct tty_display_info *));
-static void tty_hide_cursor P_ ((struct tty_display_info *));
-static void tty_background_highlight P_ ((struct tty_display_info *tty));
-static void clear_tty_hooks P_ ((struct terminal *terminal));
-static void set_tty_hooks P_ ((struct terminal *terminal));
-static void dissociate_if_controlling_tty P_ ((int fd));
-static void delete_tty P_ ((struct terminal *));
-
-#define OUTPUT(tty, a) \
- emacs_tputs ((tty), a, \
- (int) (FRAME_LINES (XFRAME (selected_frame)) \
- - curY (tty)), \
- cmputc)
-
-#define OUTPUT1(tty, a) emacs_tputs ((tty), a, 1, cmputc)
-#define OUTPUTL(tty, a, lines) emacs_tputs ((tty), a, lines, cmputc)
-
-#define OUTPUT_IF(tty, a) \
- do { \
- if (a) \
- emacs_tputs ((tty), a, \
- (int) (FRAME_LINES (XFRAME (selected_frame)) \
- - curY (tty) ), \
- cmputc); \
- } while (0)
-
-#define OUTPUT1_IF(tty, a) do { if (a) emacs_tputs ((tty), a, 1, cmputc); } while (0)
+static void tty_show_cursor P_ ((void));
+static void tty_hide_cursor P_ ((void));
-/* If true, use "vs", otherwise use "ve" to make the cursor visible. */
+#define OUTPUT(a) \
+ tputs (a, (int) (FRAME_LINES (XFRAME (selected_frame)) - curY), cmputc)
+#define OUTPUT1(a) tputs (a, 1, cmputc)
+#define OUTPUTL(a, lines) tputs (a, lines, cmputc)
-static int visible_cursor;
+#define OUTPUT_IF(a) \
+ do { \
+ if (a) \
+ tputs (a, (int) (FRAME_LINES (XFRAME (selected_frame)) \
+ - curY), cmputc); \
+ } while (0)
+
+#define OUTPUT1_IF(a) do { if (a) tputs (a, 1, cmputc); } while (0)
/* Display space properties */
extern Lisp_Object Qspace, QCalign_to, QCwidth;
-/* Functions to call after suspending a tty. */
-Lisp_Object Vsuspend_tty_functions;
+/* Function to use to ring the bell. */
+
+Lisp_Object Vring_bell_function;
+
+/* If true, use "vs", otherwise use "ve" to make the cursor visible. */
+
+static int visible_cursor;
+
+/* Terminal characteristics that higher levels want to look at.
+ These are all extern'd in termchar.h */
+
+int must_write_spaces; /* Nonzero means spaces in the text
+ must actually be output; can't just skip
+ over some columns to leave them blank. */
+int min_padding_speed; /* Speed below which no padding necessary */
-/* Functions to call after resuming a tty. */
-Lisp_Object Vresume_tty_functions;
+int line_ins_del_ok; /* Terminal can insert and delete lines */
+int char_ins_del_ok; /* Terminal can insert and delete chars */
+int scroll_region_ok; /* Terminal supports setting the
+ scroll window */
+int scroll_region_cost; /* Cost of setting a scroll window,
+ measured in characters */
+int memory_below_frame; /* Terminal remembers lines
+ scrolled off bottom */
+int fast_clear_end_of_line; /* Terminal has a `ce' string */
-/* Chain of all tty device parameters. */
-struct tty_display_info *tty_list;
+/* Nonzero means no need to redraw the entire frame on resuming
+ a suspended Emacs. This is useful on terminals with multiple pages,
+ where one page is used for Emacs and another for all else. */
-/* Nonzero means no need to redraw the entire frame on resuming a
- suspended Emacs. This is useful on terminals with multiple
- pages, where one page is used for Emacs and another for all
- else. */
int no_redraw_on_reenter;
+/* Hook functions that you can set to snap out the functions in this file.
+ These are all extern'd in termhooks.h */
+
+void (*cursor_to_hook) P_ ((int, int));
+void (*raw_cursor_to_hook) P_ ((int, int));
+void (*clear_to_end_hook) P_ ((void));
+void (*clear_frame_hook) P_ ((void));
+void (*clear_end_of_line_hook) P_ ((int));
+
+void (*ins_del_lines_hook) P_ ((int, int));
+
+void (*delete_glyphs_hook) P_ ((int));
+
+void (*ring_bell_hook) P_ ((void));
+
+void (*reset_terminal_modes_hook) P_ ((void));
+void (*set_terminal_modes_hook) P_ ((void));
+void (*update_begin_hook) P_ ((struct frame *));
+void (*update_end_hook) P_ ((struct frame *));
+void (*set_terminal_window_hook) P_ ((int));
+void (*insert_glyphs_hook) P_ ((struct glyph *, int));
+void (*write_glyphs_hook) P_ ((struct glyph *, int));
+void (*delete_glyphs_hook) P_ ((int));
+
+int (*read_socket_hook) P_ ((int, int, struct input_event *));
+
+void (*frame_up_to_date_hook) P_ ((struct frame *));
+
+void (*mouse_position_hook) P_ ((FRAME_PTR *f, int insist,
+ Lisp_Object *bar_window,
+ enum scroll_bar_part *part,
+ Lisp_Object *x,
+ Lisp_Object *y,
+ unsigned long *time));
+
+/* When reading from a minibuffer in a different frame, Emacs wants
+ to shift the highlight from the selected frame to the mini-buffer's
+ frame; under X, this means it lies about where the focus is.
+ This hook tells the window system code to re-decide where to put
+ the highlight. */
+
+void (*frame_rehighlight_hook) P_ ((FRAME_PTR f));
+
+/* If we're displaying frames using a window system that can stack
+ frames on top of each other, this hook allows you to bring a frame
+ to the front, or bury it behind all the other windows. If this
+ hook is zero, that means the device we're displaying on doesn't
+ support overlapping frames, so there's no need to raise or lower
+ anything.
+
+ If RAISE is non-zero, F is brought to the front, before all other
+ windows. If RAISE is zero, F is sent to the back, behind all other
+ windows. */
+
+void (*frame_raise_lower_hook) P_ ((FRAME_PTR f, int raise));
+
+/* If the value of the frame parameter changed, whis hook is called.
+ For example, if going from fullscreen to not fullscreen this hook
+ may do something OS dependent, like extended window manager hints on X11. */
+void (*fullscreen_hook) P_ ((struct frame *f));
+
+/* Set the vertical scroll bar for WINDOW to have its upper left corner
+ at (TOP, LEFT), and be LENGTH rows high. Set its handle to
+ indicate that we are displaying PORTION characters out of a total
+ of WHOLE characters, starting at POSITION. If WINDOW doesn't yet
+ have a scroll bar, create one for it. */
+
+void (*set_vertical_scroll_bar_hook)
+ P_ ((struct window *window,
+ int portion, int whole, int position));
+
+
+/* The following three hooks are used when we're doing a thorough
+ redisplay of the frame. We don't explicitly know which scroll bars
+ are going to be deleted, because keeping track of when windows go
+ away is a real pain - can you say set-window-configuration?
+ Instead, we just assert at the beginning of redisplay that *all*
+ scroll bars are to be removed, and then save scroll bars from the
+ fiery pit when we actually redisplay their window. */
+
+/* Arrange for all scroll bars on FRAME to be removed at the next call
+ to `*judge_scroll_bars_hook'. A scroll bar may be spared if
+ `*redeem_scroll_bar_hook' is applied to its window before the judgment.
+
+ This should be applied to each frame each time its window tree is
+ redisplayed, even if it is not displaying scroll bars at the moment;
+ if the HAS_SCROLL_BARS flag has just been turned off, only calling
+ this and the judge_scroll_bars_hook will get rid of them.
+
+ If non-zero, this hook should be safe to apply to any frame,
+ whether or not it can support scroll bars, and whether or not it is
+ currently displaying them. */
+
+void (*condemn_scroll_bars_hook) P_ ((FRAME_PTR frame));
+
+/* Unmark WINDOW's scroll bar for deletion in this judgement cycle.
+ Note that it's okay to redeem a scroll bar that is not condemned. */
+
+void (*redeem_scroll_bar_hook) P_ ((struct window *window));
+
+/* Remove all scroll bars on FRAME that haven't been saved since the
+ last call to `*condemn_scroll_bars_hook'.
+
+ This should be applied to each frame after each time its window
+ tree is redisplayed, even if it is not displaying scroll bars at the
+ moment; if the HAS_SCROLL_BARS flag has just been turned off, only
+ calling this and condemn_scroll_bars_hook will get rid of them.
+
+ If non-zero, this hook should be safe to apply to any frame,
+ whether or not it can support scroll bars, and whether or not it is
+ currently displaying them. */
+
+void (*judge_scroll_bars_hook) P_ ((FRAME_PTR FRAME));
+
+/* Strings, numbers and flags taken from the termcap entry. */
+
+char *TS_ins_line; /* "al" */
+char *TS_ins_multi_lines; /* "AL" (one parameter, # lines to insert) */
+char *TS_bell; /* "bl" */
+char *TS_clr_to_bottom; /* "cd" */
+char *TS_clr_line; /* "ce", clear to end of line */
+char *TS_clr_frame; /* "cl" */
+char *TS_set_scroll_region; /* "cs" (2 params, first line and last line) */
+char *TS_set_scroll_region_1; /* "cS" (4 params: total lines,
+ lines above scroll region, lines below it,
+ total lines again) */
+char *TS_del_char; /* "dc" */
+char *TS_del_multi_chars; /* "DC" (one parameter, # chars to delete) */
+char *TS_del_line; /* "dl" */
+char *TS_del_multi_lines; /* "DL" (one parameter, # lines to delete) */
+char *TS_delete_mode; /* "dm", enter character-delete mode */
+char *TS_end_delete_mode; /* "ed", leave character-delete mode */
+char *TS_end_insert_mode; /* "ei", leave character-insert mode */
+char *TS_ins_char; /* "ic" */
+char *TS_ins_multi_chars; /* "IC" (one parameter, # chars to insert) */
+char *TS_insert_mode; /* "im", enter character-insert mode */
+char *TS_pad_inserted_char; /* "ip". Just padding, no commands. */
+char *TS_end_keypad_mode; /* "ke" */
+char *TS_keypad_mode; /* "ks" */
+char *TS_pad_char; /* "pc", char to use as padding */
+char *TS_repeat; /* "rp" (2 params, # times to repeat
+ and character to be repeated) */
+char *TS_end_standout_mode; /* "se" */
+char *TS_fwd_scroll; /* "sf" */
+char *TS_standout_mode; /* "so" */
+char *TS_rev_scroll; /* "sr" */
+char *TS_end_termcap_modes; /* "te" */
+char *TS_termcap_modes; /* "ti" */
+char *TS_visible_bell; /* "vb" */
+char *TS_cursor_normal; /* "ve" */
+char *TS_cursor_visible; /* "vs" */
+char *TS_cursor_invisible; /* "vi" */
+char *TS_set_window; /* "wi" (4 params, start and end of window,
+ each as vpos and hpos) */
+
+/* Value of the "NC" (no_color_video) capability, or 0 if not
+ present. */
+
+static int TN_no_color_video;
+
/* Meaning of bits in no_color_video. Each bit set means that the
corresponding attribute cannot be combined with colors. */
@@ -161,6 +299,68 @@ enum no_color_bit
NC_ALT_CHARSET = 1 << 8
};
+/* "md" -- turn on bold (extra bright mode). */
+
+char *TS_enter_bold_mode;
+
+/* "mh" -- turn on half-bright mode. */
+
+char *TS_enter_dim_mode;
+
+/* "mb" -- enter blinking mode. */
+
+char *TS_enter_blink_mode;
+
+/* "mr" -- enter reverse video mode. */
+
+char *TS_enter_reverse_mode;
+
+/* "us"/"ue" -- start/end underlining. */
+
+char *TS_exit_underline_mode, *TS_enter_underline_mode;
+
+/* "as"/"ae" -- start/end alternate character set. Not really
+ supported, yet. */
+
+char *TS_enter_alt_charset_mode, *TS_exit_alt_charset_mode;
+
+/* "me" -- switch appearances off. */
+
+char *TS_exit_attribute_mode;
+
+/* "Co" -- number of colors. */
+
+int TN_max_colors;
+
+/* "pa" -- max. number of color pairs on screen. Not handled yet.
+ Could be a problem if not equal to TN_max_colors * TN_max_colors. */
+
+int TN_max_pairs;
+
+/* "op" -- SVr4 set default pair to its original value. */
+
+char *TS_orig_pair;
+
+/* "AF"/"AB" or "Sf"/"Sb"-- set ANSI or SVr4 foreground/background color.
+ 1 param, the color index. */
+
+char *TS_set_foreground, *TS_set_background;
+
+int TF_hazeltine; /* termcap hz flag. */
+int TF_insmode_motion; /* termcap mi flag: can move while in insert mode. */
+int TF_standout_motion; /* termcap mi flag: can move while in standout mode. */
+int TF_underscore; /* termcap ul flag: _ underlines if over-struck on
+ non-blank position. Must clear before writing _. */
+int TF_teleray; /* termcap xt flag: many weird consequences.
+ For t1061. */
+
+static int RPov; /* # chars to start a TS_repeat */
+
+static int delete_in_insert_mode; /* delete mode == insert mode */
+
+static int se_is_so; /* 1 if same string both enters and leaves
+ standout mode */
+
/* internal state */
/* The largest frame width in any call to calculate_costs. */
@@ -171,28 +371,57 @@ int max_frame_cols;
int max_frame_lines;
-/* Non-zero if we have dropped our controlling tty and therefore
- should not open a frame on stdout. */
-static int no_controlling_tty;
+static int costs_set; /* Nonzero if costs have been calculated. */
+
+int insert_mode; /* Nonzero when in insert mode. */
+int standout_mode; /* Nonzero when in standout mode. */
+
+/* Size of window specified by higher levels.
+ This is the number of lines, from the top of frame downwards,
+ which can participate in insert-line/delete-line operations.
+
+ Effectively it excludes the bottom frame_lines - specified_window_size
+ lines from those operations. */
+
+int specified_window;
+
+/* Frame currently being redisplayed; 0 if not currently redisplaying.
+ (Direct output does not count). */
+
+FRAME_PTR updating_frame;
/* Provided for lisp packages. */
static int system_uses_terminfo;
+/* Flag used in tty_show/hide_cursor. */
+
+static int tty_cursor_hidden;
+
char *tparam ();
extern char *tgetstr ();
+
+static void term_clear_mouse_face ();
+static void term_mouse_highlight (struct frame *f, int x, int y);
+#ifdef WINDOWSNT
+/* We aren't X windows, but we aren't termcap either. This makes me
+ uncertain as to what value to use for frame.output_method. For
+ this file, we'll define FRAME_TERMCAP_P to be zero so that our
+ output hooks get called instead of the termcap functions. Probably
+ the best long-term solution is to define an output_windows_nt... */
+
+#undef FRAME_TERMCAP_P
+#define FRAME_TERMCAP_P(_f_) 0
+#endif /* WINDOWSNT */
+
#ifdef HAVE_GPM
#include <sys/fcntl.h>
-#include "buffer.h"
-
-static void term_clear_mouse_face ();
-static void term_mouse_highlight (struct frame *f, int x, int y);
-/* The device for which we have enabled gpm support (or NULL). */
-struct tty_display_info *gpm_tty = NULL;
+/* Nonzero means mouse is enabled on Linux console. */
+int term_gpm = 0;
/* These variables describe the range of text currently shown in its
mouse-face, together with the window they apply to. As long as
@@ -202,180 +431,199 @@ struct tty_display_info *gpm_tty = NULL;
static int mouse_face_beg_row, mouse_face_beg_col;
static int mouse_face_end_row, mouse_face_end_col;
static int mouse_face_past_end;
-static Lisp_Object mouse_face_window;
+static Lisp_Object Qmouse_face_window;
static int mouse_face_face_id;
static int pos_x, pos_y;
static int last_mouse_x, last_mouse_y;
#endif /* HAVE_GPM */
-/* Ring the bell on a tty. */
-
-static void
-tty_ring_bell (struct frame *f)
+void
+ring_bell ()
{
- struct tty_display_info *tty = FRAME_TTY (f);
-
- if (tty->output)
+ if (!NILP (Vring_bell_function))
{
- OUTPUT (tty, (tty->TS_visible_bell && visible_bell
- ? tty->TS_visible_bell
- : tty->TS_bell));
- fflush (tty->output);
+ Lisp_Object function;
+
+ /* Temporarily set the global variable to nil
+ so that if we get an error, it stays nil
+ and we don't call it over and over.
+
+ We don't specbind it, because that would carefully
+ restore the bad value if there's an error
+ and make the loop of errors happen anyway. */
+
+ function = Vring_bell_function;
+ Vring_bell_function = Qnil;
+
+ call0 (function);
+
+ Vring_bell_function = function;
}
+ else if (!FRAME_TERMCAP_P (XFRAME (selected_frame)))
+ (*ring_bell_hook) ();
+ else
+ OUTPUT (TS_visible_bell && visible_bell ? TS_visible_bell : TS_bell);
}
-/* Set up termcap modes for Emacs. */
-
void
-tty_set_terminal_modes (struct terminal *terminal)
+set_terminal_modes ()
{
- struct tty_display_info *tty = terminal->display_info.tty;
-
- if (tty->output)
+ if (FRAME_TERMCAP_P (XFRAME (selected_frame)))
{
- if (tty->TS_termcap_modes)
- OUTPUT (tty, tty->TS_termcap_modes);
+ if (TS_termcap_modes)
+ OUTPUT (TS_termcap_modes);
else
- {
- /* Output enough newlines to scroll all the old screen contents
- off the screen, so it won't be overwritten and lost. */
- int i;
- current_tty = tty;
- for (i = 0; i < FRAME_LINES (XFRAME (selected_frame)); i++)
- cmputc ('\n');
- }
-
- OUTPUT_IF (tty, tty->TS_termcap_modes);
- OUTPUT_IF (tty, visible_cursor ? tty->TS_cursor_visible : tty->TS_cursor_normal);
- OUTPUT_IF (tty, tty->TS_keypad_mode);
- losecursor (tty);
- fflush (tty->output);
+ {
+ /* Output enough newlines to scroll all the old screen contents
+ off the screen, so it won't be overwritten and lost. */
+ int i;
+ for (i = 0; i < FRAME_LINES (XFRAME (selected_frame)); i++)
+ putchar ('\n');
+ }
+
+ OUTPUT_IF (visible_cursor ? TS_cursor_visible : TS_cursor_normal);
+ OUTPUT_IF (TS_keypad_mode);
+ losecursor ();
}
+ else
+ (*set_terminal_modes_hook) ();
}
-/* Reset termcap modes before exiting Emacs. */
-
void
-tty_reset_terminal_modes (struct terminal *terminal)
+reset_terminal_modes ()
{
- struct tty_display_info *tty = terminal->display_info.tty;
-
- if (tty->output)
+ if (FRAME_TERMCAP_P (XFRAME (selected_frame)))
{
- tty_turn_off_highlight (tty);
- tty_turn_off_insert (tty);
- OUTPUT_IF (tty, tty->TS_end_keypad_mode);
- OUTPUT_IF (tty, tty->TS_cursor_normal);
- OUTPUT_IF (tty, tty->TS_end_termcap_modes);
- OUTPUT_IF (tty, tty->TS_orig_pair);
+ turn_off_highlight ();
+ turn_off_insert ();
+ OUTPUT_IF (TS_end_keypad_mode);
+ OUTPUT_IF (TS_cursor_normal);
+ OUTPUT_IF (TS_end_termcap_modes);
+ OUTPUT_IF (TS_orig_pair);
/* Output raw CR so kernel can track the cursor hpos. */
- current_tty = tty;
cmputc ('\r');
- fflush (tty->output);
}
+ else if (reset_terminal_modes_hook)
+ (*reset_terminal_modes_hook) ();
}
-/* Flag the end of a display update on a termcap terminal. */
+void
+update_begin (f)
+ struct frame *f;
+{
+ updating_frame = f;
+ if (!FRAME_TERMCAP_P (f))
+ update_begin_hook (f);
+}
-static void
-tty_update_end (struct frame *f)
+void
+update_end (f)
+ struct frame *f;
{
- struct tty_display_info *tty = FRAME_TTY (f);
+ if (FRAME_TERMCAP_P (f))
+ {
+ if (!XWINDOW (selected_window)->cursor_off_p)
+ tty_show_cursor ();
+ turn_off_insert ();
+ background_highlight ();
+ }
+ else
+ update_end_hook (f);
- if (!XWINDOW (selected_window)->cursor_off_p)
- tty_show_cursor (tty);
- tty_turn_off_insert (tty);
- tty_background_highlight (tty);
+ updating_frame = NULL;
}
-/* The implementation of set_terminal_window for termcap frames. */
-
-static void
-tty_set_terminal_window (struct frame *f, int size)
+void
+set_terminal_window (size)
+ int size;
{
- struct tty_display_info *tty = FRAME_TTY (f);
-
- tty->specified_window = size ? size : FRAME_LINES (f);
- if (FRAME_SCROLL_REGION_OK (f))
- tty_set_scroll_region (f, 0, tty->specified_window);
+ if (FRAME_TERMCAP_P (updating_frame))
+ {
+ specified_window = size ? size : FRAME_LINES (updating_frame);
+ if (scroll_region_ok)
+ set_scroll_region (0, specified_window);
+ }
+ else
+ set_terminal_window_hook (size);
}
-static void
-tty_set_scroll_region (struct frame *f, int start, int stop)
+void
+set_scroll_region (start, stop)
+ int start, stop;
{
char *buf;
- struct tty_display_info *tty = FRAME_TTY (f);
-
- if (tty->TS_set_scroll_region)
- buf = tparam (tty->TS_set_scroll_region, 0, 0, start, stop - 1);
- else if (tty->TS_set_scroll_region_1)
- buf = tparam (tty->TS_set_scroll_region_1, 0, 0,
- FRAME_LINES (f), start,
- FRAME_LINES (f) - stop,
- FRAME_LINES (f));
+ struct frame *sf = XFRAME (selected_frame);
+
+ if (TS_set_scroll_region)
+ buf = tparam (TS_set_scroll_region, 0, 0, start, stop - 1);
+ else if (TS_set_scroll_region_1)
+ buf = tparam (TS_set_scroll_region_1, 0, 0,
+ FRAME_LINES (sf), start,
+ FRAME_LINES (sf) - stop,
+ FRAME_LINES (sf));
else
- buf = tparam (tty->TS_set_window, 0, 0, start, 0, stop, FRAME_COLS (f));
+ buf = tparam (TS_set_window, 0, 0, start, 0, stop, FRAME_COLS (sf));
- OUTPUT (tty, buf);
+ OUTPUT (buf);
xfree (buf);
- losecursor (tty);
+ losecursor ();
}
static void
-tty_turn_on_insert (struct tty_display_info *tty)
+turn_on_insert ()
{
- if (!tty->insert_mode)
- OUTPUT (tty, tty->TS_insert_mode);
- tty->insert_mode = 1;
+ if (!insert_mode)
+ OUTPUT (TS_insert_mode);
+ insert_mode = 1;
}
void
-tty_turn_off_insert (struct tty_display_info *tty)
+turn_off_insert ()
{
- if (tty->insert_mode)
- OUTPUT (tty, tty->TS_end_insert_mode);
- tty->insert_mode = 0;
+ if (insert_mode)
+ OUTPUT (TS_end_insert_mode);
+ insert_mode = 0;
}
/* Handle highlighting. */
void
-tty_turn_off_highlight (struct tty_display_info *tty)
+turn_off_highlight ()
{
- if (tty->standout_mode)
- OUTPUT_IF (tty, tty->TS_end_standout_mode);
- tty->standout_mode = 0;
+ if (standout_mode)
+ OUTPUT_IF (TS_end_standout_mode);
+ standout_mode = 0;
}
static void
-tty_turn_on_highlight (struct tty_display_info *tty)
+turn_on_highlight ()
{
- if (!tty->standout_mode)
- OUTPUT_IF (tty, tty->TS_standout_mode);
- tty->standout_mode = 1;
+ if (!standout_mode)
+ OUTPUT_IF (TS_standout_mode);
+ standout_mode = 1;
}
static void
-tty_toggle_highlight (struct tty_display_info *tty)
+toggle_highlight ()
{
- if (tty->standout_mode)
- tty_turn_off_highlight (tty);
+ if (standout_mode)
+ turn_off_highlight ();
else
- tty_turn_on_highlight (tty);
+ turn_on_highlight ();
}
/* Make cursor invisible. */
static void
-tty_hide_cursor (struct tty_display_info *tty)
+tty_hide_cursor ()
{
- if (tty->cursor_hidden == 0)
+ if (tty_cursor_hidden == 0)
{
- tty->cursor_hidden = 1;
- OUTPUT_IF (tty, tty->TS_cursor_invisible);
+ tty_cursor_hidden = 1;
+ OUTPUT_IF (TS_cursor_invisible);
}
}
@@ -383,14 +631,14 @@ tty_hide_cursor (struct tty_display_info *tty)
/* Ensure that cursor is visible. */
static void
-tty_show_cursor (struct tty_display_info *tty)
+tty_show_cursor ()
{
- if (tty->cursor_hidden)
+ if (tty_cursor_hidden)
{
- tty->cursor_hidden = 0;
- OUTPUT_IF (tty, tty->TS_cursor_normal);
+ tty_cursor_hidden = 0;
+ OUTPUT_IF (TS_cursor_normal);
if (visible_cursor)
- OUTPUT_IF (tty, tty->TS_cursor_visible);
+ OUTPUT_IF (TS_cursor_visible);
}
}
@@ -399,158 +647,189 @@ tty_show_cursor (struct tty_display_info *tty)
empty space inside windows. What this is,
depends on the user option inverse-video. */
-static void
-tty_background_highlight (struct tty_display_info *tty)
+void
+background_highlight ()
{
if (inverse_video)
- tty_turn_on_highlight (tty);
+ turn_on_highlight ();
else
- tty_turn_off_highlight (tty);
+ turn_off_highlight ();
}
/* Set standout mode to the mode specified for the text to be output. */
static void
-tty_highlight_if_desired (struct tty_display_info *tty)
+highlight_if_desired ()
{
if (inverse_video)
- tty_turn_on_highlight (tty);
+ turn_on_highlight ();
else
- tty_turn_off_highlight (tty);
+ turn_off_highlight ();
}
/* Move cursor to row/column position VPOS/HPOS. HPOS/VPOS are
frame-relative coordinates. */
-static void
-tty_cursor_to (struct frame *f, int vpos, int hpos)
+void
+cursor_to (vpos, hpos)
+ int vpos, hpos;
{
- struct tty_display_info *tty = FRAME_TTY (f);
+ struct frame *f = updating_frame ? updating_frame : XFRAME (selected_frame);
+
+ if (! FRAME_TERMCAP_P (f) && cursor_to_hook)
+ {
+ (*cursor_to_hook) (vpos, hpos);
+ return;
+ }
/* Detect the case where we are called from reset_sys_modes
and the costs have never been calculated. Do nothing. */
- if (! tty->costs_set)
+ if (! costs_set)
return;
- if (curY (tty) == vpos
- && curX (tty) == hpos)
+ if (curY == vpos && curX == hpos)
return;
- if (!tty->TF_standout_motion)
- tty_background_highlight (tty);
- if (!tty->TF_insmode_motion)
- tty_turn_off_insert (tty);
- cmgoto (tty, vpos, hpos);
+ if (!TF_standout_motion)
+ background_highlight ();
+ if (!TF_insmode_motion)
+ turn_off_insert ();
+ cmgoto (vpos, hpos);
}
/* Similar but don't take any account of the wasted characters. */
-static void
-tty_raw_cursor_to (struct frame *f, int row, int col)
+void
+raw_cursor_to (row, col)
+ int row, col;
{
- struct tty_display_info *tty = FRAME_TTY (f);
-
- if (curY (tty) == row
- && curX (tty) == col)
+ struct frame *f = updating_frame ? updating_frame : XFRAME (selected_frame);
+ if (! FRAME_TERMCAP_P (f))
+ {
+ (*raw_cursor_to_hook) (row, col);
+ return;
+ }
+ if (curY == row && curX == col)
return;
- if (!tty->TF_standout_motion)
- tty_background_highlight (tty);
- if (!tty->TF_insmode_motion)
- tty_turn_off_insert (tty);
- cmgoto (tty, row, col);
+ if (!TF_standout_motion)
+ background_highlight ();
+ if (!TF_insmode_motion)
+ turn_off_insert ();
+ cmgoto (row, col);
}
/* Erase operations */
-/* Clear from cursor to end of frame on a termcap device. */
-
-static void
-tty_clear_to_end (struct frame *f)
+/* clear from cursor to end of frame */
+void
+clear_to_end ()
{
register int i;
- struct tty_display_info *tty = FRAME_TTY (f);
- if (tty->TS_clr_to_bottom)
+ if (clear_to_end_hook && ! FRAME_TERMCAP_P (updating_frame))
{
- tty_background_highlight (tty);
- OUTPUT (tty, tty->TS_clr_to_bottom);
+ (*clear_to_end_hook) ();
+ return;
+ }
+ if (TS_clr_to_bottom)
+ {
+ background_highlight ();
+ OUTPUT (TS_clr_to_bottom);
}
else
{
- for (i = curY (tty); i < FRAME_LINES (f); i++)
+ for (i = curY; i < FRAME_LINES (XFRAME (selected_frame)); i++)
{
- cursor_to (f, i, 0);
- clear_end_of_line (f, FRAME_COLS (f));
+ cursor_to (i, 0);
+ clear_end_of_line (FRAME_COLS (XFRAME (selected_frame)));
}
}
}
-/* Clear an entire termcap frame. */
+/* Clear entire frame */
-static void
-tty_clear_frame (struct frame *f)
+void
+clear_frame ()
{
- struct tty_display_info *tty = FRAME_TTY (f);
+ struct frame *sf = XFRAME (selected_frame);
- if (tty->TS_clr_frame)
+ if (clear_frame_hook
+ && ! FRAME_TERMCAP_P ((updating_frame ? updating_frame : sf)))
{
- tty_background_highlight (tty);
- OUTPUT (tty, tty->TS_clr_frame);
- cmat (tty, 0, 0);
+ (*clear_frame_hook) ();
+ return;
+ }
+ if (TS_clr_frame)
+ {
+ background_highlight ();
+ OUTPUT (TS_clr_frame);
+ cmat (0, 0);
}
else
{
- cursor_to (f, 0, 0);
- clear_to_end (f);
+ cursor_to (0, 0);
+ clear_to_end ();
}
}
-/* An implementation of clear_end_of_line for termcap frames.
+/* Clear from cursor to end of line.
+ Assume that the line is already clear starting at column first_unused_hpos.
Note that the cursor may be moved, on terminals lacking a `ce' string. */
-static void
-tty_clear_end_of_line (struct frame *f, int first_unused_hpos)
+void
+clear_end_of_line (first_unused_hpos)
+ int first_unused_hpos;
{
register int i;
- struct tty_display_info *tty = FRAME_TTY (f);
+
+ if (clear_end_of_line_hook
+ && ! FRAME_TERMCAP_P ((updating_frame
+ ? updating_frame
+ : XFRAME (selected_frame))))
+ {
+ (*clear_end_of_line_hook) (first_unused_hpos);
+ return;
+ }
/* Detect the case where we are called from reset_sys_modes
and the costs have never been calculated. Do nothing. */
- if (! tty->costs_set)
+ if (! costs_set)
return;
- if (curX (tty) >= first_unused_hpos)
+ if (curX >= first_unused_hpos)
return;
- tty_background_highlight (tty);
- if (tty->TS_clr_line)
+ background_highlight ();
+ if (TS_clr_line)
{
- OUTPUT1 (tty, tty->TS_clr_line);
+ OUTPUT1 (TS_clr_line);
}
else
{ /* have to do it the hard way */
- tty_turn_off_insert (tty);
+ struct frame *sf = XFRAME (selected_frame);
+ turn_off_insert ();
/* Do not write in last row last col with Auto-wrap on. */
- if (AutoWrap (tty)
- && curY (tty) == FrameRows (tty) - 1
- && first_unused_hpos == FrameCols (tty))
+ if (AutoWrap && curY == FRAME_LINES (sf) - 1
+ && first_unused_hpos == FRAME_COLS (sf))
first_unused_hpos--;
- for (i = curX (tty); i < first_unused_hpos; i++)
+ for (i = curX; i < first_unused_hpos; i++)
{
- if (tty->termscript)
- fputc (' ', tty->termscript);
- fputc (' ', tty->output);
+ if (termscript)
+ fputc (' ', termscript);
+ putchar (' ');
}
- cmplus (tty, first_unused_hpos - curX (tty));
+ cmplus (first_unused_hpos - curX);
}
}
-/* Buffer to store the source and result of code conversion for terminal. */
-static unsigned char *encode_terminal_buf;
-/* Allocated size of the above buffer. */
-static int encode_terminal_bufsize;
+/* Buffers to store the source and result of code conversion for terminal. */
+static unsigned char *encode_terminal_src;
+static unsigned char *encode_terminal_dst;
+/* Allocated sizes of the above buffers. */
+static int encode_terminal_src_size;
+static int encode_terminal_dst_size;
/* Encode SRC_LEN glyphs starting at SRC to terminal output codes.
Set CODING->produced to the byte-length of the resulting byte
@@ -568,37 +847,73 @@ encode_terminal_code (src, src_len, coding)
int nchars, nbytes, required;
register int tlen = GLYPH_TABLE_LENGTH;
register Lisp_Object *tbase = GLYPH_TABLE_BASE;
+ Lisp_Object charset_list;
/* Allocate sufficient size of buffer to store all characters in
multibyte-form. But, it may be enlarged on demand if
- Vglyph_table contains a string. */
+ Vglyph_table contains a string or a composite glyph is
+ encountered. */
required = MAX_MULTIBYTE_LENGTH * src_len;
- if (encode_terminal_bufsize < required)
+ if (encode_terminal_src_size < required)
{
- if (encode_terminal_bufsize == 0)
- encode_terminal_buf = xmalloc (required);
+ if (encode_terminal_src_size == 0)
+ encode_terminal_src = xmalloc (required);
else
- encode_terminal_buf = xrealloc (encode_terminal_buf, required);
- encode_terminal_bufsize = required;
+ encode_terminal_src = xrealloc (encode_terminal_src, required);
+ encode_terminal_src_size = required;
}
- buf = encode_terminal_buf;
+ charset_list = coding_charset_list (coding);
+
+ buf = encode_terminal_src;
nchars = 0;
while (src < src_end)
{
+ if (src->type == COMPOSITE_GLYPH)
+ {
+ struct composition *cmp = composition_table[src->u.cmp_id];
+ int i;
+
+ nbytes = buf - encode_terminal_src;
+ required = MAX_MULTIBYTE_LENGTH * cmp->glyph_len;
+
+ if (encode_terminal_src_size < nbytes + required)
+ {
+ encode_terminal_src_size = nbytes + required;
+ encode_terminal_src = xrealloc (encode_terminal_src,
+ encode_terminal_src_size);
+ buf = encode_terminal_src + nbytes;
+ }
+
+ for (i = 0; i < cmp->glyph_len; i++)
+ {
+ int c = COMPOSITION_GLYPH (cmp, i);
+
+ if (! char_charset (c, charset_list, NULL))
+ break;
+ buf += CHAR_STRING (c, buf);
+ nchars++;
+ }
+ if (i == 0)
+ {
+ /* The first character of the composition is not encodable. */
+ *buf++ = '?';
+ nchars++;
+ }
+ }
/* We must skip glyphs to be padded for a wide character. */
- if (! CHAR_GLYPH_PADDING_P (*src))
+ else if (! CHAR_GLYPH_PADDING_P (*src))
{
+ int c;
+ Lisp_Object string;
+
+ string = Qnil;
g = GLYPH_FROM_CHAR_GLYPH (src[0]);
if (g < 0 || g >= tlen)
{
/* This glyph doesn't has an entry in Vglyph_table. */
- if (CHAR_VALID_P (src->u.ch, 0))
- buf += CHAR_STRING (src->u.ch, buf);
- else
- *buf++ = SPACEGLYPH;
- nchars++;
+ c = src->u.ch;
}
else
{
@@ -607,95 +922,127 @@ encode_terminal_code (src, src_len, coding)
GLYPH_FOLLOW_ALIASES (tbase, tlen, g);
if (GLYPH_SIMPLE_P (tbase, tlen, g))
- {
- int c = FAST_GLYPH_CHAR (g);
+ /* We set the multi-byte form of a character in G
+ (that should be an ASCII character) at WORKBUF. */
+ c = FAST_GLYPH_CHAR (g);
+ else
+ /* We have a string in Vglyph_table. */
+ string = tbase[g];
+ }
- if (CHAR_VALID_P (c, 0))
- buf += CHAR_STRING (c, buf);
- else
- *buf++ = SPACEGLYPH;
+ if (NILP (string))
+ {
+ nbytes = buf - encode_terminal_src;
+ if (encode_terminal_src_size < nbytes + MAX_MULTIBYTE_LENGTH)
+ {
+ encode_terminal_src_size = nbytes + MAX_MULTIBYTE_LENGTH;
+ encode_terminal_src = xrealloc (encode_terminal_src,
+ encode_terminal_src_size);
+ buf = encode_terminal_src + nbytes;
+ }
+ if (char_charset (c, charset_list, NULL))
+ {
+ /* Store the multibyte form of C at BUF. */
+ buf += CHAR_STRING (c, buf);
nchars++;
}
else
{
- /* We have a string in Vglyph_table. */
- Lisp_Object string;
-
- string = tbase[g];
- if (! STRING_MULTIBYTE (string))
- string = string_to_multibyte (string);
- nbytes = buf - encode_terminal_buf;
- if (encode_terminal_bufsize < nbytes + SBYTES (string))
+ /* C is not encodable. */
+ *buf++ = '?';
+ nchars++;
+ while (src + 1 < src_end && CHAR_GLYPH_PADDING_P (src[1]))
{
- encode_terminal_bufsize = nbytes + SBYTES (string);
- encode_terminal_buf = xrealloc (encode_terminal_buf,
- encode_terminal_bufsize);
- buf = encode_terminal_buf + nbytes;
+ *buf++ = '?';
+ nchars++;
+ src++;
}
- bcopy (SDATA (string), buf, SBYTES (string));
- buf += SBYTES (string);
- nchars += SCHARS (string);
}
}
+ else
+ {
+ unsigned char *p = SDATA (string), *pend = p + SBYTES (string);
+
+ if (! STRING_MULTIBYTE (string))
+ string = string_to_multibyte (string);
+ nbytes = buf - encode_terminal_src;
+ if (encode_terminal_src_size < nbytes + SBYTES (string))
+ {
+ encode_terminal_src_size = nbytes + SBYTES (string);
+ encode_terminal_src = xrealloc (encode_terminal_src,
+ encode_terminal_src_size);
+ buf = encode_terminal_src + nbytes;
+ }
+ bcopy (SDATA (string), buf, SBYTES (string));
+ buf += SBYTES (string);
+ nchars += SCHARS (string);
+ }
}
src++;
}
- nbytes = buf - encode_terminal_buf;
- coding->src_multibyte = 1;
- coding->dst_multibyte = 0;
- if (SYMBOLP (coding->pre_write_conversion)
- && ! NILP (Ffboundp (coding->pre_write_conversion)))
+ if (nchars == 0)
{
- run_pre_write_conversin_on_c_str (&encode_terminal_buf,
- &encode_terminal_bufsize,
- nchars, nbytes, coding);
- nchars = coding->produced_char;
- nbytes = coding->produced;
+ coding->produced = 0;
+ return NULL;
}
- required = nbytes + encoding_buffer_size (coding, nbytes);
- if (encode_terminal_bufsize < required)
+
+ nbytes = buf - encode_terminal_src;
+ coding->source = encode_terminal_src;
+ if (encode_terminal_dst_size == 0)
{
- encode_terminal_bufsize = required;
- encode_terminal_buf = xrealloc (encode_terminal_buf, required);
+ encode_terminal_dst_size = encode_terminal_src_size;
+ encode_terminal_dst = xmalloc (encode_terminal_dst_size);
}
+ coding->destination = encode_terminal_dst;
+ coding->dst_bytes = encode_terminal_dst_size;
+ encode_coding_object (coding, Qnil, 0, 0, nchars, nbytes, Qnil);
+ /* coding->destination may have been reallocated. */
+ encode_terminal_dst = coding->destination;
+ encode_terminal_dst_size = coding->dst_bytes;
- encode_coding (coding, encode_terminal_buf, encode_terminal_buf + nbytes,
- nbytes, encode_terminal_bufsize - nbytes);
- return encode_terminal_buf + nbytes;
+ return (encode_terminal_dst);
}
-/* An implementation of write_glyphs for termcap frames. */
-
-static void
-tty_write_glyphs (struct frame *f, struct glyph *string, int len)
+void
+write_glyphs (string, len)
+ register struct glyph *string;
+ register int len;
{
+ int produced, consumed;
+ struct frame *sf = XFRAME (selected_frame);
+ struct frame *f = updating_frame ? updating_frame : sf;
unsigned char *conversion_buffer;
struct coding_system *coding;
- struct tty_display_info *tty = FRAME_TTY (f);
+ if (write_glyphs_hook
+ && ! FRAME_TERMCAP_P (f))
+ {
+ (*write_glyphs_hook) (string, len);
+ return;
+ }
- tty_turn_off_insert (tty);
- tty_hide_cursor (tty);
+ turn_off_insert ();
+ tty_hide_cursor ();
/* Don't dare write in last column of bottom line, if Auto-Wrap,
since that would scroll the whole frame on some terminals. */
- if (AutoWrap (tty)
- && curY (tty) + 1 == FRAME_LINES (f)
- && (curX (tty) + len) == FRAME_COLS (f))
+ if (AutoWrap
+ && curY + 1 == FRAME_LINES (sf)
+ && (curX + len) == FRAME_COLS (sf))
len --;
if (len <= 0)
return;
- cmplus (tty, len);
+ cmplus (len);
/* If terminal_coding does any conversion, use it, otherwise use
safe_terminal_coding. We can't use CODING_REQUIRE_ENCODING here
because it always return 1 if the member src_multibyte is 1. */
- coding = (FRAME_TERMINAL_CODING (f)->common_flags & CODING_REQUIRE_ENCODING_MASK
- ? FRAME_TERMINAL_CODING (f) : &safe_terminal_coding);
+ coding = (terminal_coding.common_flags & CODING_REQUIRE_ENCODING_MASK
+ ? &terminal_coding : &safe_terminal_coding);
/* The mode bit CODING_MODE_LAST_BLOCK should be set to 1 only at
the tail. */
coding->mode &= ~CODING_MODE_LAST_BLOCK;
@@ -711,7 +1058,7 @@ tty_write_glyphs (struct frame *f, struct glyph *string, int len)
break;
/* Turn appearance modes of the face of the run on. */
- tty_highlight_if_desired (tty);
+ highlight_if_desired ();
turn_on_face (f, face_id);
if (n == len)
@@ -721,11 +1068,11 @@ tty_write_glyphs (struct frame *f, struct glyph *string, int len)
if (coding->produced > 0)
{
BLOCK_INPUT;
- fwrite (conversion_buffer, 1, coding->produced, tty->output);
- if (ferror (tty->output))
- clearerr (tty->output);
- if (tty->termscript)
- fwrite (conversion_buffer, 1, coding->produced, tty->termscript);
+ fwrite (conversion_buffer, 1, coding->produced, stdout);
+ if (ferror (stdout))
+ clearerr (stdout);
+ if (termscript)
+ fwrite (conversion_buffer, 1, coding->produced, termscript);
UNBLOCK_INPUT;
}
len -= n;
@@ -733,51 +1080,49 @@ tty_write_glyphs (struct frame *f, struct glyph *string, int len)
/* Turn appearance modes off. */
turn_off_face (f, face_id);
- tty_turn_off_highlight (tty);
+ turn_off_highlight ();
}
- cmcheckmagic (tty);
+ cmcheckmagic ();
}
-#ifdef HAVE_GPM /* Only used by GPM code. */
-
-static void
-tty_write_glyphs_with_face (f, string, len, face_id)
- register struct frame *f;
+void
+write_glyphs_with_face (string, len, face_id)
register struct glyph *string;
register int len, face_id;
{
+ struct frame *sf = XFRAME (selected_frame);
+ struct frame *f = updating_frame ? updating_frame : sf;
unsigned char *conversion_buffer;
struct coding_system *coding;
- struct tty_display_info *tty = FRAME_TTY (f);
-
- tty_turn_off_insert (tty);
- tty_hide_cursor (tty);
+ turn_off_insert ();
+ tty_hide_cursor ();
/* Don't dare write in last column of bottom line, if Auto-Wrap,
since that would scroll the whole frame on some terminals. */
- if (AutoWrap (tty)
- && curY (tty) + 1 == FRAME_LINES (f)
- && (curX (tty) + len) == FRAME_COLS (f))
+ if (AutoWrap
+ && curY + 1 == FRAME_LINES (sf)
+ && (curX + len) == FRAME_COLS (sf))
len --;
if (len <= 0)
return;
- cmplus (tty, len);
+ cmplus (len);
/* If terminal_coding does any conversion, use it, otherwise use
safe_terminal_coding. We can't use CODING_REQUIRE_ENCODING here
because it always return 1 if the member src_multibyte is 1. */
- coding = (FRAME_TERMINAL_CODING (f)->common_flags & CODING_REQUIRE_ENCODING_MASK
- ? FRAME_TERMINAL_CODING (f) : &safe_terminal_coding);
+ coding = (terminal_coding.common_flags & CODING_REQUIRE_ENCODING_MASK
+ ? &terminal_coding : &safe_terminal_coding);
/* The mode bit CODING_MODE_LAST_BLOCK should be set to 1 only at
the tail. */
coding->mode &= ~CODING_MODE_LAST_BLOCK;
+
/* Turn appearance modes of the face. */
- tty_highlight_if_desired (tty);
+ highlight_if_desired ();
turn_on_face (f, face_id);
coding->mode |= CODING_MODE_LAST_BLOCK;
@@ -785,47 +1130,59 @@ tty_write_glyphs_with_face (f, string, len, face_id)
if (coding->produced > 0)
{
BLOCK_INPUT;
- fwrite (conversion_buffer, 1, coding->produced, tty->output);
- if (ferror (tty->output))
- clearerr (tty->output);
- if (tty->termscript)
- fwrite (conversion_buffer, 1, coding->produced, tty->termscript);
+ fwrite (conversion_buffer, 1, coding->produced, stdout);
+ if (ferror (stdout))
+ clearerr (stdout);
+ if (termscript)
+ fwrite (conversion_buffer, 1, coding->produced, termscript);
UNBLOCK_INPUT;
}
/* Turn appearance modes off. */
turn_off_face (f, face_id);
- tty_turn_off_highlight (tty);
+ turn_off_highlight ();
- cmcheckmagic (tty);
+ cmcheckmagic ();
}
-#endif
-/* An implementation of insert_glyphs for termcap frames. */
+/* If start is zero, insert blanks instead of a string at start */
-static void
-tty_insert_glyphs (struct frame *f, struct glyph *start, int len)
+void
+insert_glyphs (start, len)
+ register struct glyph *start;
+ register int len;
{
char *buf;
struct glyph *glyph = NULL;
+ struct frame *f, *sf;
unsigned char *conversion_buffer;
unsigned char space[1];
struct coding_system *coding;
- struct tty_display_info *tty = FRAME_TTY (f);
+ if (len <= 0)
+ return;
+
+ if (insert_glyphs_hook)
+ {
+ (*insert_glyphs_hook) (start, len);
+ return;
+ }
+
+ sf = XFRAME (selected_frame);
+ f = updating_frame ? updating_frame : sf;
- if (tty->TS_ins_multi_chars)
+ if (TS_ins_multi_chars)
{
- buf = tparam (tty->TS_ins_multi_chars, 0, 0, len);
- OUTPUT1 (tty, buf);
+ buf = tparam (TS_ins_multi_chars, 0, 0, len);
+ OUTPUT1 (buf);
xfree (buf);
if (start)
- write_glyphs (f, start, len);
+ write_glyphs (start, len);
return;
}
- tty_turn_on_insert (tty);
- cmplus (tty, len);
+ turn_on_insert ();
+ cmplus (len);
if (! start)
space[0] = SPACEGLYPH;
@@ -833,15 +1190,15 @@ tty_insert_glyphs (struct frame *f, struct glyph *start, int len)
/* If terminal_coding does any conversion, use it, otherwise use
safe_terminal_coding. We can't use CODING_REQUIRE_ENCODING here
because it always return 1 if the member src_multibyte is 1. */
- coding = (FRAME_TERMINAL_CODING (f)->common_flags & CODING_REQUIRE_ENCODING_MASK
- ? FRAME_TERMINAL_CODING (f) : &safe_terminal_coding);
+ coding = (terminal_coding.common_flags & CODING_REQUIRE_ENCODING_MASK
+ ? &terminal_coding : &safe_terminal_coding);
/* The mode bit CODING_MODE_LAST_BLOCK should be set to 1 only at
the tail. */
coding->mode &= ~CODING_MODE_LAST_BLOCK;
while (len-- > 0)
{
- OUTPUT1_IF (tty, tty->TS_ins_char);
+ OUTPUT1_IF (TS_ins_char);
if (!start)
{
conversion_buffer = space;
@@ -849,7 +1206,7 @@ tty_insert_glyphs (struct frame *f, struct glyph *start, int len)
}
else
{
- tty_highlight_if_desired (tty);
+ highlight_if_desired ();
turn_on_face (f, start->face_id);
glyph = start;
++start;
@@ -857,7 +1214,7 @@ tty_insert_glyphs (struct frame *f, struct glyph *start, int len)
occupies more than one column. */
while (len && CHAR_GLYPH_PADDING_P (*start))
{
- OUTPUT1_IF (tty, tty->TS_ins_char);
+ OUTPUT1_IF (TS_ins_char);
start++, len--;
}
@@ -865,77 +1222,89 @@ tty_insert_glyphs (struct frame *f, struct glyph *start, int len)
/* This is the last glyph. */
coding->mode |= CODING_MODE_LAST_BLOCK;
- conversion_buffer = encode_terminal_code (glyph, 1, coding);
+ conversion_buffer = encode_terminal_code (glyph, 1, coding);
}
if (coding->produced > 0)
{
BLOCK_INPUT;
- fwrite (conversion_buffer, 1, coding->produced, tty->output);
- if (ferror (tty->output))
- clearerr (tty->output);
- if (tty->termscript)
- fwrite (conversion_buffer, 1, coding->produced, tty->termscript);
+ fwrite (conversion_buffer, 1, coding->produced, stdout);
+ if (ferror (stdout))
+ clearerr (stdout);
+ if (termscript)
+ fwrite (conversion_buffer, 1, coding->produced, termscript);
UNBLOCK_INPUT;
}
- OUTPUT1_IF (tty, tty->TS_pad_inserted_char);
+ OUTPUT1_IF (TS_pad_inserted_char);
if (start)
{
turn_off_face (f, glyph->face_id);
- tty_turn_off_highlight (tty);
+ turn_off_highlight ();
}
}
- cmcheckmagic (tty);
+ cmcheckmagic ();
}
-/* An implementation of delete_glyphs for termcap frames. */
-
-static void
-tty_delete_glyphs (struct frame *f, int n)
+void
+delete_glyphs (n)
+ register int n;
{
char *buf;
register int i;
- struct tty_display_info *tty = FRAME_TTY (f);
+ if (delete_glyphs_hook && ! FRAME_TERMCAP_P (updating_frame))
+ {
+ (*delete_glyphs_hook) (n);
+ return;
+ }
- if (tty->delete_in_insert_mode)
+ if (delete_in_insert_mode)
{
- tty_turn_on_insert (tty);
+ turn_on_insert ();
}
else
{
- tty_turn_off_insert (tty);
- OUTPUT_IF (tty, tty->TS_delete_mode);
+ turn_off_insert ();
+ OUTPUT_IF (TS_delete_mode);
}
- if (tty->TS_del_multi_chars)
+ if (TS_del_multi_chars)
{
- buf = tparam (tty->TS_del_multi_chars, 0, 0, n);
- OUTPUT1 (tty, buf);
+ buf = tparam (TS_del_multi_chars, 0, 0, n);
+ OUTPUT1 (buf);
xfree (buf);
}
else
for (i = 0; i < n; i++)
- OUTPUT1 (tty, tty->TS_del_char);
- if (!tty->delete_in_insert_mode)
- OUTPUT_IF (tty, tty->TS_end_delete_mode);
+ OUTPUT1 (TS_del_char);
+ if (!delete_in_insert_mode)
+ OUTPUT_IF (TS_end_delete_mode);
}
-/* An implementation of ins_del_lines for termcap frames. */
+/* Insert N lines at vpos VPOS. If N is negative, delete -N lines. */
-static void
-tty_ins_del_lines (struct frame *f, int vpos, int n)
+void
+ins_del_lines (vpos, n)
+ int vpos, n;
{
- struct tty_display_info *tty = FRAME_TTY (f);
- char *multi = n > 0 ? tty->TS_ins_multi_lines : tty->TS_del_multi_lines;
- char *single = n > 0 ? tty->TS_ins_line : tty->TS_del_line;
- char *scroll = n > 0 ? tty->TS_rev_scroll : tty->TS_fwd_scroll;
+ char *multi = n > 0 ? TS_ins_multi_lines : TS_del_multi_lines;
+ char *single = n > 0 ? TS_ins_line : TS_del_line;
+ char *scroll = n > 0 ? TS_rev_scroll : TS_fwd_scroll;
+ struct frame *sf;
register int i = n > 0 ? n : -n;
register char *buf;
+ if (ins_del_lines_hook && ! FRAME_TERMCAP_P (updating_frame))
+ {
+ (*ins_del_lines_hook) (vpos, n);
+ return;
+ }
+
+ sf = XFRAME (selected_frame);
+
/* If the lines below the insertion are being pushed
into the end of the window, this is the same as clearing;
and we know the lines are already clear, since the matching
@@ -943,49 +1312,45 @@ tty_ins_del_lines (struct frame *f, int vpos, int n)
/* If the lines below the deletion are blank lines coming
out of the end of the window, don't bother,
as there will be a matching inslines later that will flush them. */
- if (FRAME_SCROLL_REGION_OK (f)
- && vpos + i >= tty->specified_window)
+ if (scroll_region_ok && vpos + i >= specified_window)
return;
- if (!FRAME_MEMORY_BELOW_FRAME (f)
- && vpos + i >= FRAME_LINES (f))
+ if (!memory_below_frame && vpos + i >= FRAME_LINES (sf))
return;
-
+
if (multi)
{
- raw_cursor_to (f, vpos, 0);
- tty_background_highlight (tty);
+ raw_cursor_to (vpos, 0);
+ background_highlight ();
buf = tparam (multi, 0, 0, i);
- OUTPUT (tty, buf);
+ OUTPUT (buf);
xfree (buf);
}
else if (single)
{
- raw_cursor_to (f, vpos, 0);
- tty_background_highlight (tty);
+ raw_cursor_to (vpos, 0);
+ background_highlight ();
while (--i >= 0)
- OUTPUT (tty, single);
- if (tty->TF_teleray)
- curX (tty) = 0;
+ OUTPUT (single);
+ if (TF_teleray)
+ curX = 0;
}
else
{
- tty_set_scroll_region (f, vpos, tty->specified_window);
+ set_scroll_region (vpos, specified_window);
if (n < 0)
- raw_cursor_to (f, tty->specified_window - 1, 0);
+ raw_cursor_to (specified_window - 1, 0);
else
- raw_cursor_to (f, vpos, 0);
- tty_background_highlight (tty);
+ raw_cursor_to (vpos, 0);
+ background_highlight ();
while (--i >= 0)
- OUTPUTL (tty, scroll, tty->specified_window - vpos);
- tty_set_scroll_region (f, 0, tty->specified_window);
+ OUTPUTL (scroll, specified_window - vpos);
+ set_scroll_region (0, specified_window);
}
-
- if (!FRAME_SCROLL_REGION_OK (f)
- && FRAME_MEMORY_BELOW_FRAME (f)
- && n < 0)
+
+ if (!scroll_region_ok && memory_below_frame && n < 0)
{
- cursor_to (f, FRAME_LINES (f) + n, 0);
- clear_to_end (f);
+ cursor_to (FRAME_LINES (sf) + n, 0);
+ clear_to_end ();
}
}
@@ -993,7 +1358,8 @@ tty_ins_del_lines (struct frame *f, int vpos, int n)
not counting any line-dependent padding. */
int
-string_cost (char *str)
+string_cost (str)
+ char *str;
{
cost = 0;
if (str)
@@ -1005,7 +1371,8 @@ string_cost (char *str)
counting any line-dependent padding at one line. */
static int
-string_cost_one_line (char *str)
+string_cost_one_line (str)
+ char *str;
{
cost = 0;
if (str)
@@ -1017,7 +1384,8 @@ string_cost_one_line (char *str)
in tenths of characters. */
int
-per_line_cost (char *str)
+per_line_cost (str)
+ register char *str;
{
cost = 0;
if (str)
@@ -1040,26 +1408,26 @@ int *char_ins_del_vector;
/* ARGSUSED */
static void
-calculate_ins_del_char_costs (struct frame *f)
+calculate_ins_del_char_costs (frame)
+ FRAME_PTR frame;
{
- struct tty_display_info *tty = FRAME_TTY (f);
int ins_startup_cost, del_startup_cost;
int ins_cost_per_char, del_cost_per_char;
register int i;
register int *p;
- if (tty->TS_ins_multi_chars)
+ if (TS_ins_multi_chars)
{
ins_cost_per_char = 0;
- ins_startup_cost = string_cost_one_line (tty->TS_ins_multi_chars);
+ ins_startup_cost = string_cost_one_line (TS_ins_multi_chars);
}
- else if (tty->TS_ins_char || tty->TS_pad_inserted_char
- || (tty->TS_insert_mode && tty->TS_end_insert_mode))
+ else if (TS_ins_char || TS_pad_inserted_char
+ || (TS_insert_mode && TS_end_insert_mode))
{
- ins_startup_cost = (30 * (string_cost (tty->TS_insert_mode)
- + string_cost (tty->TS_end_insert_mode))) / 100;
- ins_cost_per_char = (string_cost_one_line (tty->TS_ins_char)
- + string_cost_one_line (tty->TS_pad_inserted_char));
+ ins_startup_cost = (30 * (string_cost (TS_insert_mode)
+ + string_cost (TS_end_insert_mode))) / 100;
+ ins_cost_per_char = (string_cost_one_line (TS_ins_char)
+ + string_cost_one_line (TS_pad_inserted_char));
}
else
{
@@ -1067,18 +1435,18 @@ calculate_ins_del_char_costs (struct frame *f)
ins_cost_per_char = 0;
}
- if (tty->TS_del_multi_chars)
+ if (TS_del_multi_chars)
{
del_cost_per_char = 0;
- del_startup_cost = string_cost_one_line (tty->TS_del_multi_chars);
+ del_startup_cost = string_cost_one_line (TS_del_multi_chars);
}
- else if (tty->TS_del_char)
+ else if (TS_del_char)
{
- del_startup_cost = (string_cost (tty->TS_delete_mode)
- + string_cost (tty->TS_end_delete_mode));
- if (tty->delete_in_insert_mode)
+ del_startup_cost = (string_cost (TS_delete_mode)
+ + string_cost (TS_end_delete_mode));
+ if (delete_in_insert_mode)
del_startup_cost /= 2;
- del_cost_per_char = string_cost_one_line (tty->TS_del_char);
+ del_cost_per_char = string_cost_one_line (TS_del_char);
}
else
{
@@ -1087,80 +1455,75 @@ calculate_ins_del_char_costs (struct frame *f)
}
/* Delete costs are at negative offsets */
- p = &char_ins_del_cost (f)[0];
- for (i = FRAME_COLS (f); --i >= 0;)
+ p = &char_ins_del_cost (frame)[0];
+ for (i = FRAME_COLS (frame); --i >= 0;)
*--p = (del_startup_cost += del_cost_per_char);
/* Doing nothing is free */
- p = &char_ins_del_cost (f)[0];
+ p = &char_ins_del_cost (frame)[0];
*p++ = 0;
/* Insert costs are at positive offsets */
- for (i = FRAME_COLS (f); --i >= 0;)
+ for (i = FRAME_COLS (frame); --i >= 0;)
*p++ = (ins_startup_cost += ins_cost_per_char);
}
void
-calculate_costs (struct frame *frame)
+calculate_costs (frame)
+ FRAME_PTR frame;
{
- FRAME_COST_BAUD_RATE (frame) = baud_rate;
+ register char *f = (TS_set_scroll_region
+ ? TS_set_scroll_region
+ : TS_set_scroll_region_1);
- if (FRAME_TERMCAP_P (frame))
- {
- struct tty_display_info *tty = FRAME_TTY (frame);
- register char *f = (tty->TS_set_scroll_region
- ? tty->TS_set_scroll_region
- : tty->TS_set_scroll_region_1);
-
- FRAME_SCROLL_REGION_COST (frame) = string_cost (f);
-
- tty->costs_set = 1;
-
- /* These variables are only used for terminal stuff. They are
- allocated once for the terminal frame of X-windows emacs, but not
- used afterwards.
+ FRAME_COST_BAUD_RATE (frame) = baud_rate;
- char_ins_del_vector (i.e., char_ins_del_cost) isn't used because
- X turns off char_ins_del_ok. */
+ scroll_region_cost = string_cost (f);
- max_frame_lines = max (max_frame_lines, FRAME_LINES (frame));
- max_frame_cols = max (max_frame_cols, FRAME_COLS (frame));
+ /* These variables are only used for terminal stuff. They are allocated
+ once for the terminal frame of X-windows emacs, but not used afterwards.
- if (char_ins_del_vector != 0)
- char_ins_del_vector
- = (int *) xrealloc (char_ins_del_vector,
- (sizeof (int)
- + 2 * max_frame_cols * sizeof (int)));
- else
- char_ins_del_vector
- = (int *) xmalloc (sizeof (int)
- + 2 * max_frame_cols * sizeof (int));
+ char_ins_del_vector (i.e., char_ins_del_cost) isn't used because
+ X turns off char_ins_del_ok. */
- bzero (char_ins_del_vector, (sizeof (int)
- + 2 * max_frame_cols * sizeof (int)));
+ max_frame_lines = max (max_frame_lines, FRAME_LINES (frame));
+ max_frame_cols = max (max_frame_cols, FRAME_COLS (frame));
+ costs_set = 1;
- if (f && (!tty->TS_ins_line && !tty->TS_del_line))
- do_line_insertion_deletion_costs (frame,
- tty->TS_rev_scroll, tty->TS_ins_multi_lines,
- tty->TS_fwd_scroll, tty->TS_del_multi_lines,
- f, f, 1);
- else
- do_line_insertion_deletion_costs (frame,
- tty->TS_ins_line, tty->TS_ins_multi_lines,
- tty->TS_del_line, tty->TS_del_multi_lines,
- 0, 0, 1);
+ if (char_ins_del_vector != 0)
+ char_ins_del_vector
+ = (int *) xrealloc (char_ins_del_vector,
+ (sizeof (int)
+ + 2 * max_frame_cols * sizeof (int)));
+ else
+ char_ins_del_vector
+ = (int *) xmalloc (sizeof (int)
+ + 2 * max_frame_cols * sizeof (int));
+
+ bzero (char_ins_del_vector, (sizeof (int)
+ + 2 * max_frame_cols * sizeof (int)));
+
+ if (f && (!TS_ins_line && !TS_del_line))
+ do_line_insertion_deletion_costs (frame,
+ TS_rev_scroll, TS_ins_multi_lines,
+ TS_fwd_scroll, TS_del_multi_lines,
+ f, f, 1);
+ else
+ do_line_insertion_deletion_costs (frame,
+ TS_ins_line, TS_ins_multi_lines,
+ TS_del_line, TS_del_multi_lines,
+ 0, 0, 1);
- calculate_ins_del_char_costs (frame);
+ calculate_ins_del_char_costs (frame);
- /* Don't use TS_repeat if its padding is worse than sending the chars */
- if (tty->TS_repeat && per_line_cost (tty->TS_repeat) * baud_rate < 9000)
- tty->RPov = string_cost (tty->TS_repeat);
- else
- tty->RPov = FRAME_COLS (frame) * 2;
+ /* Don't use TS_repeat if its padding is worse than sending the chars */
+ if (TS_repeat && per_line_cost (TS_repeat) * baud_rate < 9000)
+ RPov = string_cost (TS_repeat);
+ else
+ RPov = FRAME_COLS (frame) * 2;
- cmcostinit (FRAME_TTY (frame)); /* set up cursor motion costs */
- }
+ cmcostinit (); /* set up cursor motion costs */
}
struct fkey_table {
@@ -1270,18 +1633,16 @@ static struct fkey_table keys[] =
{"!3", "S-undo"} /*shifted undo key*/
};
-static char **term_get_fkeys_address;
-static KBOARD *term_get_fkeys_kboard;
+static char **term_get_fkeys_arg;
static Lisp_Object term_get_fkeys_1 ();
-/* Find the escape codes sent by the function keys for Vinput_decode_map.
+/* Find the escape codes sent by the function keys for Vfunction_key_map.
This function scans the termcap function key sequence entries, and
- adds entries to Vinput_decode_map for each function key it finds. */
+ adds entries to Vfunction_key_map for each function key it finds. */
-static void
-term_get_fkeys (address, kboard)
+void
+term_get_fkeys (address)
char **address;
- KBOARD *kboard;
{
/* We run the body of the function (term_get_fkeys_1) and ignore all Lisp
errors during the call. The only errors should be from Fdefine_key
@@ -1292,8 +1653,7 @@ term_get_fkeys (address, kboard)
refusing to run at all on such a terminal. */
extern Lisp_Object Fidentity ();
- term_get_fkeys_address = address;
- term_get_fkeys_kboard = kboard;
+ term_get_fkeys_arg = address;
internal_condition_case (term_get_fkeys_1, Qerror, Fidentity);
}
@@ -1302,18 +1662,17 @@ term_get_fkeys_1 ()
{
int i;
- char **address = term_get_fkeys_address;
- KBOARD *kboard = term_get_fkeys_kboard;
-
+ char **address = term_get_fkeys_arg;
+
/* This can happen if CANNOT_DUMP or with strange options. */
- if (!KEYMAPP (kboard->Vinput_decode_map))
- kboard->Vinput_decode_map = Fmake_sparse_keymap (Qnil);
+ if (!initialized)
+ Vfunction_key_map = Fmake_sparse_keymap (Qnil);
for (i = 0; i < (sizeof (keys)/sizeof (keys[0])); i++)
{
char *sequence = tgetstr (keys[i].cap, address);
if (sequence)
- Fdefine_key (kboard->Vinput_decode_map, build_string (sequence),
+ Fdefine_key (Vfunction_key_map, build_string (sequence),
Fmake_vector (make_number (1),
intern (keys[i].name)));
}
@@ -1333,13 +1692,13 @@ term_get_fkeys_1 ()
if (k0)
/* Define f0 first, so that f10 takes precedence in case the
key sequences happens to be the same. */
- Fdefine_key (kboard->Vinput_decode_map, build_string (k0),
+ Fdefine_key (Vfunction_key_map, build_string (k0),
Fmake_vector (make_number (1), intern ("f0")));
- Fdefine_key (kboard->Vinput_decode_map, build_string (k_semi),
+ Fdefine_key (Vfunction_key_map, build_string (k_semi),
Fmake_vector (make_number (1), intern ("f10")));
}
else if (k0)
- Fdefine_key (kboard->Vinput_decode_map, build_string (k0),
+ Fdefine_key (Vfunction_key_map, build_string (k0),
Fmake_vector (make_number (1), intern (k0_name)));
}
@@ -1362,7 +1721,7 @@ term_get_fkeys_1 ()
if (sequence)
{
sprintf (fkey, "f%d", i);
- Fdefine_key (kboard->Vinput_decode_map, build_string (sequence),
+ Fdefine_key (Vfunction_key_map, build_string (sequence),
Fmake_vector (make_number (1),
intern (fkey)));
}
@@ -1378,10 +1737,10 @@ term_get_fkeys_1 ()
if (!tgetstr (cap1, address)) \
{ \
char *sequence = tgetstr (cap2, address); \
- if (sequence) \
- Fdefine_key (kboard->Vinput_decode_map, build_string (sequence), \
- Fmake_vector (make_number (1), \
- intern (sym))); \
+ if (sequence) \
+ Fdefine_key (Vfunction_key_map, build_string (sequence), \
+ Fmake_vector (make_number (1), \
+ intern (sym))); \
}
/* if there's no key_next keycap, map key_npage to `next' keysym */
@@ -1419,11 +1778,14 @@ term_get_fkeys_1 ()
#ifdef static
#define append_glyph append_glyph_term
#define produce_stretch_glyph produce_stretch_glyph_term
+#define append_composite_glyph append_composite_glyph_term
+#define produce_composite_glyph produce_composite_glyph_term
#endif
static void append_glyph P_ ((struct it *));
static void produce_stretch_glyph P_ ((struct it *));
-
+static void append_composite_glyph P_ ((struct it *));
+static void produce_composite_glyph P_ ((struct it *));
/* Append glyphs to IT's glyph_row. Called from produce_glyphs for
terminal frames if IT->glyph_row != NULL. IT->char_to_display is
@@ -1484,6 +1846,8 @@ produce_glyphs (it)
struct it *it;
{
/* If a hook is installed, let it do the work. */
+
+ /* Nothing but characters are supported on terminal frames. */
xassert (it->what == IT_CHARACTER
|| it->what == IT_COMPOSITION
|| it->what == IT_STRETCH);
@@ -1494,11 +1858,11 @@ produce_glyphs (it)
goto done;
}
- /* Nothing but characters are supported on terminal frames. For a
- composition sequence, it->c is the first character of the
- sequence. */
- xassert (it->what == IT_CHARACTER
- || it->what == IT_COMPOSITION);
+ if (it->what == IT_COMPOSITION)
+ {
+ produce_composite_glyph (it);
+ goto done;
+ }
/* Maybe translate single-byte characters to multibyte. */
it->char_to_display = it->c;
@@ -1542,28 +1906,24 @@ produce_glyphs (it)
it->pixel_width = nspaces;
it->nglyphs = nspaces;
}
- else if (SINGLE_BYTE_CHAR_P (it->c))
+ else if (CHAR_BYTE8_P (it->c))
{
if (unibyte_display_via_language_environment
- && (it->c >= 0240
- || !NILP (Vnonascii_translation_table)))
+ && (it->c >= 0240))
{
- int charset;
-
it->char_to_display = unibyte_char_to_multibyte (it->c);
- charset = CHAR_CHARSET (it->char_to_display);
- it->pixel_width = CHARSET_WIDTH (charset);
+ it->pixel_width = CHAR_WIDTH (it->char_to_display);
it->nglyphs = it->pixel_width;
if (it->glyph_row)
append_glyph (it);
}
else
{
- /* Coming here means that it->c is from display table, thus we
- must send the code as is to the terminal. Although there's
- no way to know how many columns it occupies on a screen, it
- is a good assumption that a single byte code has 1-column
- width. */
+ /* Coming here means that it->c is from display table, thus
+ we must send the raw 8-bit byte as is to the terminal.
+ Although there's no way to know how many columns it
+ occupies on a screen, it is a good assumption that a
+ single byte code has 1-column width. */
it->pixel_width = it->nglyphs = 1;
if (it->glyph_row)
append_glyph (it);
@@ -1571,13 +1931,7 @@ produce_glyphs (it)
}
else
{
- /* A multi-byte character. The display width is fixed for all
- characters of the set. Some of the glyphs may have to be
- ignored because they are already displayed in a continued
- line. */
- int charset = CHAR_CHARSET (it->c);
-
- it->pixel_width = CHARSET_WIDTH (charset);
+ it->pixel_width = CHAR_WIDTH (it->c);
it->nglyphs = it->pixel_width;
if (it->glyph_row)
@@ -1667,6 +2021,57 @@ produce_stretch_glyph (it)
}
+/* Append glyphs to IT's glyph_row for the composition IT->cmp_id.
+ Called from produce_composite_glyph for terminal frames if
+ IT->glyph_row != NULL. IT->face_id contains the character's
+ face. */
+
+static void
+append_composite_glyph (it)
+ struct it *it;
+{
+ struct glyph *glyph;
+
+ xassert (it->glyph_row);
+ glyph = it->glyph_row->glyphs[it->area] + it->glyph_row->used[it->area];
+ if (glyph < it->glyph_row->glyphs[1 + it->area])
+ {
+ glyph->type = COMPOSITE_GLYPH;
+ glyph->pixel_width = it->pixel_width;
+ glyph->u.cmp_id = it->cmp_id;
+ glyph->face_id = it->face_id;
+ glyph->padding_p = 0;
+ glyph->charpos = CHARPOS (it->position);
+ glyph->object = it->object;
+
+ ++it->glyph_row->used[it->area];
+ ++glyph;
+ }
+}
+
+
+/* Produce a composite glyph for iterator IT. IT->cmp_id is the ID of
+ the composition. We simply produces components of the composition
+ assuming that that the terminal has a capability to layout/render
+ it correctly. */
+
+static void
+produce_composite_glyph (it)
+ struct it *it;
+{
+ struct composition *cmp = composition_table[it->cmp_id];
+ int c;
+
+ xassert (cmp->glyph_len > 0);
+ c = COMPOSITION_GLYPH (cmp, 0);
+ it->pixel_width = CHAR_WIDTH (it->c);
+ it->nglyphs = 1;
+
+ if (it->glyph_row)
+ append_composite_glyph (it);
+}
+
+
/* Get information about special display element WHAT in an
environment described by IT. WHAT is one of IT_TRUNCATION or
IT_CONTINUATION. Maybe produce glyphs for WHAT if IT has a
@@ -1737,10 +2142,10 @@ produce_special_glyphs (it, what)
from them. Some display attributes may not be used together with
color; the termcap capability `NC' specifies which ones. */
-#define MAY_USE_WITH_COLORS_P(tty, ATTR) \
- (tty->TN_max_colors > 0 \
- ? (tty->TN_no_color_video & (ATTR)) == 0 \
- : 1)
+#define MAY_USE_WITH_COLORS_P(ATTR) \
+ (TN_max_colors > 0 \
+ ? (TN_no_color_video & (ATTR)) == 0 \
+ : 1)
/* Turn appearances of face FACE_ID on tty frame F on.
FACE_ID is a realized face ID number, in the face cache. */
@@ -1753,13 +2158,12 @@ turn_on_face (f, face_id)
struct face *face = FACE_FROM_ID (f, face_id);
long fg = face->foreground;
long bg = face->background;
- struct tty_display_info *tty = FRAME_TTY (f);
/* Do this first because TS_end_standout_mode may be the same
as TS_exit_attribute_mode, which turns all appearances off. */
- if (MAY_USE_WITH_COLORS_P (tty, NC_REVERSE))
+ if (MAY_USE_WITH_COLORS_P (NC_REVERSE))
{
- if (tty->TN_max_colors > 0)
+ if (TN_max_colors > 0)
{
if (fg >= 0 && bg >= 0)
{
@@ -1773,13 +2177,13 @@ turn_on_face (f, face_id)
{
if (fg == FACE_TTY_DEFAULT_FG_COLOR
|| bg == FACE_TTY_DEFAULT_BG_COLOR)
- tty_toggle_highlight (tty);
+ toggle_highlight ();
}
else
{
if (fg == FACE_TTY_DEFAULT_BG_COLOR
|| bg == FACE_TTY_DEFAULT_FG_COLOR)
- tty_toggle_highlight (tty);
+ toggle_highlight ();
}
}
else
@@ -1790,55 +2194,55 @@ turn_on_face (f, face_id)
{
if (fg == FACE_TTY_DEFAULT_FG_COLOR
|| bg == FACE_TTY_DEFAULT_BG_COLOR)
- tty_toggle_highlight (tty);
+ toggle_highlight ();
}
else
{
if (fg == FACE_TTY_DEFAULT_BG_COLOR
|| bg == FACE_TTY_DEFAULT_FG_COLOR)
- tty_toggle_highlight (tty);
+ toggle_highlight ();
}
}
}
if (face->tty_bold_p)
{
- if (MAY_USE_WITH_COLORS_P (tty, NC_BOLD))
- OUTPUT1_IF (tty, tty->TS_enter_bold_mode);
+ if (MAY_USE_WITH_COLORS_P (NC_BOLD))
+ OUTPUT1_IF (TS_enter_bold_mode);
}
else if (face->tty_dim_p)
- if (MAY_USE_WITH_COLORS_P (tty, NC_DIM))
- OUTPUT1_IF (tty, tty->TS_enter_dim_mode);
+ if (MAY_USE_WITH_COLORS_P (NC_DIM))
+ OUTPUT1_IF (TS_enter_dim_mode);
/* Alternate charset and blinking not yet used. */
if (face->tty_alt_charset_p
- && MAY_USE_WITH_COLORS_P (tty, NC_ALT_CHARSET))
- OUTPUT1_IF (tty, tty->TS_enter_alt_charset_mode);
+ && MAY_USE_WITH_COLORS_P (NC_ALT_CHARSET))
+ OUTPUT1_IF (TS_enter_alt_charset_mode);
if (face->tty_blinking_p
- && MAY_USE_WITH_COLORS_P (tty, NC_BLINK))
- OUTPUT1_IF (tty, tty->TS_enter_blink_mode);
+ && MAY_USE_WITH_COLORS_P (NC_BLINK))
+ OUTPUT1_IF (TS_enter_blink_mode);
- if (face->tty_underline_p && MAY_USE_WITH_COLORS_P (tty, NC_UNDERLINE))
- OUTPUT1_IF (tty, tty->TS_enter_underline_mode);
+ if (face->tty_underline_p && MAY_USE_WITH_COLORS_P (NC_UNDERLINE))
+ OUTPUT1_IF (TS_enter_underline_mode);
- if (tty->TN_max_colors > 0)
+ if (TN_max_colors > 0)
{
char *ts, *p;
- ts = tty->standout_mode ? tty->TS_set_background : tty->TS_set_foreground;
+ ts = standout_mode ? TS_set_background : TS_set_foreground;
if (fg >= 0 && ts)
{
- p = tparam (ts, NULL, 0, (int) fg);
- OUTPUT (tty, p);
+ p = tparam (ts, NULL, 0, (int) fg);
+ OUTPUT (p);
xfree (p);
}
- ts = tty->standout_mode ? tty->TS_set_foreground : tty->TS_set_background;
+ ts = standout_mode ? TS_set_foreground : TS_set_background;
if (bg >= 0 && ts)
{
- p = tparam (ts, NULL, 0, (int) bg);
- OUTPUT (tty, p);
+ p = tparam (ts, NULL, 0, (int) bg);
+ OUTPUT (p);
xfree (p);
}
}
@@ -1853,11 +2257,10 @@ turn_off_face (f, face_id)
int face_id;
{
struct face *face = FACE_FROM_ID (f, face_id);
- struct tty_display_info *tty = FRAME_TTY (f);
xassert (face != NULL);
- if (tty->TS_exit_attribute_mode)
+ if (TS_exit_attribute_mode)
{
/* Capability "me" will turn off appearance modes double-bright,
half-bright, reverse-video, standout, underline. It may or
@@ -1869,32 +2272,32 @@ turn_off_face (f, face_id)
|| face->tty_blinking_p
|| face->tty_underline_p)
{
- OUTPUT1_IF (tty, tty->TS_exit_attribute_mode);
- if (strcmp (tty->TS_exit_attribute_mode, tty->TS_end_standout_mode) == 0)
- tty->standout_mode = 0;
+ OUTPUT1_IF (TS_exit_attribute_mode);
+ if (strcmp (TS_exit_attribute_mode, TS_end_standout_mode) == 0)
+ standout_mode = 0;
}
if (face->tty_alt_charset_p)
- OUTPUT_IF (tty, tty->TS_exit_alt_charset_mode);
+ OUTPUT_IF (TS_exit_alt_charset_mode);
}
else
{
/* If we don't have "me" we can only have those appearances
that have exit sequences defined. */
if (face->tty_alt_charset_p)
- OUTPUT_IF (tty, tty->TS_exit_alt_charset_mode);
+ OUTPUT_IF (TS_exit_alt_charset_mode);
if (face->tty_underline_p)
- OUTPUT_IF (tty, tty->TS_exit_underline_mode);
+ OUTPUT_IF (TS_exit_underline_mode);
}
/* Switch back to default colors. */
- if (tty->TN_max_colors > 0
+ if (TN_max_colors > 0
&& ((face->foreground != FACE_TTY_DEFAULT_COLOR
&& face->foreground != FACE_TTY_DEFAULT_FG_COLOR)
|| (face->background != FACE_TTY_DEFAULT_COLOR
&& face->background != FACE_TTY_DEFAULT_BG_COLOR)))
- OUTPUT1_IF (tty, tty->TS_orig_pair);
+ OUTPUT1_IF (TS_orig_pair);
}
@@ -1903,61 +2306,46 @@ turn_off_face (f, face_id)
colors FG and BG. */
int
-tty_capable_p (tty, caps, fg, bg)
- struct tty_display_info *tty;
+tty_capable_p (f, caps, fg, bg)
+ struct frame *f;
unsigned caps;
unsigned long fg, bg;
{
-#define TTY_CAPABLE_P_TRY(tty, cap, TS, NC_bit) \
- if ((caps & (cap)) && (!(TS) || !MAY_USE_WITH_COLORS_P(tty, NC_bit))) \
+#define TTY_CAPABLE_P_TRY(cap, TS, NC_bit) \
+ if ((caps & (cap)) && (!(TS) || !MAY_USE_WITH_COLORS_P(NC_bit))) \
return 0;
- TTY_CAPABLE_P_TRY (tty, TTY_CAP_INVERSE, tty->TS_standout_mode, NC_REVERSE);
- TTY_CAPABLE_P_TRY (tty, TTY_CAP_UNDERLINE, tty->TS_enter_underline_mode, NC_UNDERLINE);
- TTY_CAPABLE_P_TRY (tty, TTY_CAP_BOLD, tty->TS_enter_bold_mode, NC_BOLD);
- TTY_CAPABLE_P_TRY (tty, TTY_CAP_DIM, tty->TS_enter_dim_mode, NC_DIM);
- TTY_CAPABLE_P_TRY (tty, TTY_CAP_BLINK, tty->TS_enter_blink_mode, NC_BLINK);
- TTY_CAPABLE_P_TRY (tty, TTY_CAP_ALT_CHARSET, tty->TS_enter_alt_charset_mode, NC_ALT_CHARSET);
+ TTY_CAPABLE_P_TRY (TTY_CAP_INVERSE, TS_standout_mode, NC_REVERSE);
+ TTY_CAPABLE_P_TRY (TTY_CAP_UNDERLINE, TS_enter_underline_mode, NC_UNDERLINE);
+ TTY_CAPABLE_P_TRY (TTY_CAP_BOLD, TS_enter_bold_mode, NC_BOLD);
+ TTY_CAPABLE_P_TRY (TTY_CAP_DIM, TS_enter_dim_mode, NC_DIM);
+ TTY_CAPABLE_P_TRY (TTY_CAP_BLINK, TS_enter_blink_mode, NC_BLINK);
+ TTY_CAPABLE_P_TRY (TTY_CAP_ALT_CHARSET, TS_enter_alt_charset_mode, NC_ALT_CHARSET);
/* We can do it! */
return 1;
}
+
/* Return non-zero if the terminal is capable to display colors. */
DEFUN ("tty-display-color-p", Ftty_display_color_p, Stty_display_color_p,
0, 1, 0,
- doc: /* Return non-nil if the tty device TERMINAL can display colors.
-
-TERMINAL can be a terminal id, a frame or nil (meaning the selected
-frame's terminal). This function always returns nil if TERMINAL
-is not on a tty device. */)
- (terminal)
- Lisp_Object terminal;
+ doc: /* Return non-nil if TTY can display colors on DISPLAY. */)
+ (display)
+ Lisp_Object display;
{
- struct terminal *t = get_tty_terminal (terminal, 0);
- if (!t)
- return Qnil;
- else
- return t->display_info.tty->TN_max_colors > 0 ? Qt : Qnil;
+ return TN_max_colors > 0 ? Qt : Qnil;
}
/* Return the number of supported colors. */
DEFUN ("tty-display-color-cells", Ftty_display_color_cells,
Stty_display_color_cells, 0, 1, 0,
- doc: /* Return the number of colors supported by the tty device TERMINAL.
-
-TERMINAL can be a terminal id, a frame or nil (meaning the selected
-frame's terminal). This function always returns 0 if TERMINAL
-is not on a tty device. */)
- (terminal)
- Lisp_Object terminal;
+ doc: /* Return the number of colors supported by TTY on DISPLAY. */)
+ (display)
+ Lisp_Object display;
{
- struct terminal *t = get_tty_terminal (terminal, 0);
- if (!t)
- return make_number (0);
- else
- return make_number (t->display_info.tty->TN_max_colors);
+ return make_number (TN_max_colors);
}
#ifndef WINDOWSNT
@@ -1975,46 +2363,48 @@ static char *default_set_background;
/* Save or restore the default color-related capabilities of this
terminal. */
static void
-tty_default_color_capabilities (struct tty_display_info *tty, int save)
+tty_default_color_capabilities (save)
+ int save;
{
if (save)
{
if (default_orig_pair)
xfree (default_orig_pair);
- default_orig_pair = tty->TS_orig_pair ? xstrdup (tty->TS_orig_pair) : NULL;
+ default_orig_pair = TS_orig_pair ? xstrdup (TS_orig_pair) : NULL;
if (default_set_foreground)
xfree (default_set_foreground);
- default_set_foreground = tty->TS_set_foreground ? xstrdup (tty->TS_set_foreground)
+ default_set_foreground = TS_set_foreground ? xstrdup (TS_set_foreground)
: NULL;
if (default_set_background)
xfree (default_set_background);
- default_set_background = tty->TS_set_background ? xstrdup (tty->TS_set_background)
+ default_set_background = TS_set_background ? xstrdup (TS_set_background)
: NULL;
- default_max_colors = tty->TN_max_colors;
- default_max_pairs = tty->TN_max_pairs;
- default_no_color_video = tty->TN_no_color_video;
+ default_max_colors = TN_max_colors;
+ default_max_pairs = TN_max_pairs;
+ default_no_color_video = TN_no_color_video;
}
else
{
- tty->TS_orig_pair = default_orig_pair;
- tty->TS_set_foreground = default_set_foreground;
- tty->TS_set_background = default_set_background;
- tty->TN_max_colors = default_max_colors;
- tty->TN_max_pairs = default_max_pairs;
- tty->TN_no_color_video = default_no_color_video;
+ TS_orig_pair = default_orig_pair;
+ TS_set_foreground = default_set_foreground;
+ TS_set_background = default_set_background;
+ TN_max_colors = default_max_colors;
+ TN_max_pairs = default_max_pairs;
+ TN_no_color_video = default_no_color_video;
}
}
/* Setup one of the standard tty color schemes according to MODE.
MODE's value is generally the number of colors which we want to
support; zero means set up for the default capabilities, the ones
- we saw at init_tty time; -1 means turn off color support. */
-static void
-tty_setup_colors (struct tty_display_info *tty, int mode)
+ we saw at term_init time; -1 means turn off color support. */
+void
+tty_setup_colors (mode)
+ int mode;
{
/* Canonicalize all negative values of MODE. */
if (mode < -1)
@@ -2023,27 +2413,27 @@ tty_setup_colors (struct tty_display_info *tty, int mode)
switch (mode)
{
case -1: /* no colors at all */
- tty->TN_max_colors = 0;
- tty->TN_max_pairs = 0;
- tty->TN_no_color_video = 0;
- tty->TS_set_foreground = tty->TS_set_background = tty->TS_orig_pair = NULL;
+ TN_max_colors = 0;
+ TN_max_pairs = 0;
+ TN_no_color_video = 0;
+ TS_set_foreground = TS_set_background = TS_orig_pair = NULL;
break;
case 0: /* default colors, if any */
default:
- tty_default_color_capabilities (tty, 0);
+ tty_default_color_capabilities (0);
break;
case 8: /* 8 standard ANSI colors */
- tty->TS_orig_pair = "\033[0m";
+ TS_orig_pair = "\033[0m";
#ifdef TERMINFO
- tty->TS_set_foreground = "\033[3%p1%dm";
- tty->TS_set_background = "\033[4%p1%dm";
+ TS_set_foreground = "\033[3%p1%dm";
+ TS_set_background = "\033[4%p1%dm";
#else
- tty->TS_set_foreground = "\033[3%dm";
- tty->TS_set_background = "\033[4%dm";
+ TS_set_foreground = "\033[3%dm";
+ TS_set_background = "\033[4%dm";
#endif
- tty->TN_max_colors = 8;
- tty->TN_max_pairs = 64;
- tty->TN_no_color_video = 0;
+ TN_max_colors = 8;
+ TN_max_pairs = 64;
+ TN_no_color_video = 0;
break;
}
}
@@ -2094,7 +2484,7 @@ set_tty_color_mode (f, val)
if (mode != old_mode)
{
- tty_setup_colors (FRAME_TTY (f), mode);
+ tty_setup_colors (mode);
/* This recomputes all the faces given the new color
definitions. */
call0 (intern ("tty-set-up-initial-frame-faces"));
@@ -2105,241 +2495,6 @@ set_tty_color_mode (f, val)
#endif /* !WINDOWSNT */
-
-/* Return the tty display object specified by TERMINAL. */
-
-struct terminal *
-get_tty_terminal (Lisp_Object terminal, int throw)
-{
- struct terminal *t = get_terminal (terminal, throw);
-
- if (t && t->type != output_termcap)
- {
- if (throw)
- error ("Device %d is not a termcap terminal device", t->id);
- else
- return NULL;
- }
-
- return t;
-}
-
-/* Return an active termcap device that uses the tty device with the
- given name.
-
- This function ignores suspended devices.
-
- Returns NULL if the named terminal device is not opened. */
-
-struct terminal *
-get_named_tty (name)
- char *name;
-{
- struct terminal *t;
-
- if (!name)
- abort ();
-
- for (t = terminal_list; t; t = t->next_terminal)
- {
- if (t->type == output_termcap
- && !strcmp (t->display_info.tty->name, name)
- && TERMINAL_ACTIVE_P (t))
- return t;
- }
-
- return 0;
-}
-
-
-DEFUN ("tty-type", Ftty_type, Stty_type, 0, 1, 0,
- doc: /* Return the type of the tty device that TERMINAL uses.
-Returns nil if TERMINAL is not on a tty device.
-
-TERMINAL can be a terminal id, a frame or nil (meaning the selected
-frame's terminal). */)
- (terminal)
- Lisp_Object terminal;
-{
- struct terminal *t = get_terminal (terminal, 1);
-
- if (t->type != output_termcap)
- return Qnil;
-
- if (t->display_info.tty->type)
- return build_string (t->display_info.tty->type);
- else
- return Qnil;
-}
-
-DEFUN ("controlling-tty-p", Fcontrolling_tty_p, Scontrolling_tty_p, 0, 1, 0,
- doc: /* Return non-nil if TERMINAL is on the controlling tty of the Emacs process.
-
-TERMINAL can be a terminal id, a frame or nil (meaning the selected
-frame's terminal). This function always returns nil if TERMINAL
-is not on a tty device. */)
- (terminal)
- Lisp_Object terminal;
-{
- struct terminal *t = get_terminal (terminal, 1);
-
- if (t->type != output_termcap || strcmp (t->display_info.tty->name, DEV_TTY))
- return Qnil;
- else
- return Qt;
-}
-
-DEFUN ("tty-no-underline", Ftty_no_underline, Stty_no_underline, 0, 1, 0,
- doc: /* Declare that the tty used by TERMINAL does not handle underlining.
-This is used to override the terminfo data, for certain terminals that
-do not really do underlining, but say that they do. This function has
-no effect if used on a non-tty terminal.
-
-TERMINAL can be a terminal id, a frame or nil (meaning the selected
-frame's terminal). This function always returns nil if TERMINAL
-is not on a tty device. */)
- (terminal)
- Lisp_Object terminal;
-{
- struct terminal *t = get_terminal (terminal, 1);
-
- if (t->type == output_termcap)
- t->display_info.tty->TS_enter_underline_mode = 0;
- return Qnil;
-}
-
-
-
-DEFUN ("suspend-tty", Fsuspend_tty, Ssuspend_tty, 0, 1, 0,
- doc: /* Suspend the terminal device TTY.
-
-The device is restored to its default state, and Emacs ceases all
-access to the tty device. Frames that use the device are not deleted,
-but input is not read from them and if they change, their display is
-not updated.
-
-TTY may be a terminal id, a frame, or nil for the terminal device of
-the currently selected frame.
-
-This function runs `suspend-tty-functions' after suspending the
-device. The functions are run with one arg, the id of the suspended
-terminal device.
-
-`suspend-tty' does nothing if it is called on a device that is already
-suspended.
-
-A suspended tty may be resumed by calling `resume-tty' on it. */)
- (tty)
- Lisp_Object tty;
-{
- struct terminal *t = get_tty_terminal (tty, 1);
- FILE *f;
-
- if (!t)
- error ("Unknown tty device");
-
- f = t->display_info.tty->input;
-
- if (f)
- {
- /* First run `suspend-tty-functions' and then clean up the tty
- state because `suspend-tty-functions' might need to change
- the tty state. */
- if (!NILP (Vrun_hooks))
- {
- Lisp_Object args[2];
- args[0] = intern ("suspend-tty-functions");
- XSETTERMINAL (args[1], t);
- Frun_hook_with_args (2, args);
- }
-
- reset_sys_modes (t->display_info.tty);
-
- delete_keyboard_wait_descriptor (fileno (f));
-
- fclose (f);
- if (f != t->display_info.tty->output)
- fclose (t->display_info.tty->output);
-
- t->display_info.tty->input = 0;
- t->display_info.tty->output = 0;
-
- if (FRAMEP (t->display_info.tty->top_frame))
- FRAME_SET_VISIBLE (XFRAME (t->display_info.tty->top_frame), 0);
-
- }
-
- /* Clear display hooks to prevent further output. */
- clear_tty_hooks (t);
-
- return Qnil;
-}
-
-DEFUN ("resume-tty", Fresume_tty, Sresume_tty, 0, 1, 0,
- doc: /* Resume the previously suspended terminal device TTY.
-The terminal is opened and reinitialized. Frames that are on the
-suspended terminal are revived.
-
-It is an error to resume a terminal while another terminal is active
-on the same device.
-
-This function runs `resume-tty-functions' after resuming the terminal.
-The functions are run with one arg, the id of the resumed terminal
-device.
-
-`resume-tty' does nothing if it is called on a device that is not
-suspended.
-
-TTY may be a terminal id, a frame, or nil for the terminal device of
-the currently selected frame. */)
- (tty)
- Lisp_Object tty;
-{
- struct terminal *t = get_tty_terminal (tty, 1);
- int fd;
-
- if (!t)
- error ("Unknown tty device");
-
- if (!t->display_info.tty->input)
- {
- if (get_named_tty (t->display_info.tty->name))
- error ("Cannot resume display while another display is active on the same device");
-
- fd = emacs_open (t->display_info.tty->name, O_RDWR | O_NOCTTY, 0);
-
- if (fd == -1)
- error ("Can not reopen tty device %s: %s", t->display_info.tty->name, strerror (errno));
-
- if (strcmp (t->display_info.tty->name, DEV_TTY))
- dissociate_if_controlling_tty (fd);
-
- t->display_info.tty->output = fdopen (fd, "w+");
- t->display_info.tty->input = t->display_info.tty->output;
-
- add_keyboard_wait_descriptor (fd);
-
- if (FRAMEP (t->display_info.tty->top_frame))
- FRAME_SET_VISIBLE (XFRAME (t->display_info.tty->top_frame), 1);
-
- init_sys_modes (t->display_info.tty);
-
- /* Run `resume-tty-functions'. */
- if (!NILP (Vrun_hooks))
- {
- Lisp_Object args[2];
- args[0] = intern ("resume-tty-functions");
- XSETTERMINAL (args[1], t);
- Frun_hook_with_args (2, args);
- }
- }
-
- set_tty_hooks (t);
-
- return Qnil;
-}
-
-
/***********************************************************************
Mouse
***********************************************************************/
@@ -2362,13 +2517,10 @@ term_mouse_moveto (int x, int y)
static void
term_show_mouse_face (enum draw_glyphs_face draw)
{
- struct window *w = XWINDOW (mouse_face_window);
+ struct window *w = XWINDOW (Qmouse_face_window);
int save_x, save_y;
int i;
- struct frame *f = XFRAME (w->frame);
- struct tty_display_info *tty = FRAME_TTY (f);
-
if (/* If window is in the process of being destroyed, don't bother
to do anything. */
w->current_matrix != NULL
@@ -2381,8 +2533,8 @@ term_show_mouse_face (enum draw_glyphs_face draw)
the highlight region. */
/* Save current cursor co-ordinates */
- save_y = curY (tty);
- save_x = curX (tty);
+ save_y = curY;
+ save_x = curX;
/* Note that mouse_face_beg_row etc. are window relative. */
for (i = mouse_face_beg_row; i <= mouse_face_end_row; i++)
@@ -2424,29 +2576,29 @@ term_show_mouse_face (enum draw_glyphs_face draw)
pos_x = row->used[LEFT_MARGIN_AREA] + start_hpos
+ WINDOW_LEFT_EDGE_X (w);
- cursor_to (f, pos_y, pos_x);
+ cursor_to (pos_y, pos_x);
if (draw == DRAW_MOUSE_FACE)
{
- tty_write_glyphs_with_face (f, row->glyphs[TEXT_AREA] + start_hpos,
+ write_glyphs_with_face (row->glyphs[TEXT_AREA] + start_hpos,
nglyphs, mouse_face_face_id);
}
else /* draw == DRAW_NORMAL_TEXT */
- write_glyphs (f, row->glyphs[TEXT_AREA] + start_hpos, nglyphs);
+ write_glyphs (row->glyphs[TEXT_AREA] + start_hpos, nglyphs);
}
- cursor_to (f, save_y, save_x);
+ cursor_to (save_y, save_x);
}
}
static void
term_clear_mouse_face ()
{
- if (!NILP (mouse_face_window))
+ if (!NILP (Qmouse_face_window))
term_show_mouse_face (DRAW_NORMAL_TEXT);
mouse_face_beg_row = mouse_face_beg_col = -1;
mouse_face_end_row = mouse_face_end_col = -1;
- mouse_face_window = Qnil;
+ Qmouse_face_window = Qnil;
}
/* Find the glyph matrix position of buffer position POS in window W.
@@ -2543,7 +2695,7 @@ term_mouse_highlight (struct frame *f, int x, int y)
if (!WINDOWP (window))
return;
- if (!EQ (window, mouse_face_window))
+ if (!EQ (window, Qmouse_face_window))
term_clear_mouse_face ();
w = XWINDOW (window);
@@ -2626,7 +2778,7 @@ term_mouse_highlight (struct frame *f, int x, int y)
noverlays = sort_overlays (overlay_vec, noverlays, w);
/* Check mouse-face highlighting. */
- if (!(EQ (window, mouse_face_window)
+ if (!(EQ (window, Qmouse_face_window)
&& y >= mouse_face_beg_row
&& y <= mouse_face_end_row
&& (y > mouse_face_beg_row
@@ -2676,7 +2828,7 @@ term_mouse_highlight (struct frame *f, int x, int y)
= !fast_find_position (w, XFASTINT (after),
&mouse_face_end_col,
&mouse_face_end_row);
- mouse_face_window = window;
+ Qmouse_face_window = window;
mouse_face_face_id
= face_at_buffer_position (w, pos, 0, 0,
@@ -2711,7 +2863,7 @@ term_mouse_highlight (struct frame *f, int x, int y)
= !fast_find_position (w, XFASTINT (after),
&mouse_face_end_col,
&mouse_face_end_row);
- mouse_face_window = window;
+ Qmouse_face_window = window;
mouse_face_face_id
= face_at_buffer_position (w, pos, 0, 0,
@@ -2884,9 +3036,10 @@ term_mouse_click (struct input_event *result, Gpm_Event *event,
}
int
-handle_one_term_event (struct tty_display_info *tty, Gpm_Event *event, struct input_event* hold_quit)
+handle_one_term_event (Gpm_Event *event, struct input_event* hold_quit)
{
- struct frame *f = XFRAME (tty->top_frame);
+ struct frame *f = SELECTED_FRAME ();
+ int fd;
struct input_event ie;
int do_help = 0;
int count = 0;
@@ -2896,10 +3049,24 @@ handle_one_term_event (struct tty_display_info *tty, Gpm_Event *event, struct in
ie.arg = Qnil;
if (event->type & (GPM_MOVE | GPM_DRAG)) {
+ unsigned char buf[6 * sizeof (short)];
+ unsigned short *arg = (unsigned short *) buf + 1;
+ const char *name;
+
previous_help_echo_string = help_echo_string;
help_echo_string = Qnil;
- Gpm_DrawPointer (event->x, event->y, fileno (tty->output));
+ /* Display mouse pointer */
+ buf[sizeof(short) - 1] = 2; /* set selection */
+
+ arg[0] = arg[2] = (unsigned short) event->x + gpm_zerobased;
+ arg[1] = arg[3] = (unsigned short) event->y + gpm_zerobased;
+ arg[4] = (unsigned short) 3;
+
+ name = ttyname (0);
+ fd = open (name, O_WRONLY);
+ ioctl (fd, TIOCLINUX, buf + sizeof (short) - 1);
+ close (fd);
if (!term_mouse_movement (f, event))
help_echo_string = previous_help_echo_string;
@@ -2942,25 +3109,13 @@ handle_one_term_event (struct tty_display_info *tty, Gpm_Event *event, struct in
return count;
}
-DEFUN ("gpm-mouse-start", Fgpm_mouse_start, Sgpm_mouse_start,
+DEFUN ("term-open-connection", Fterm_open_connection, Sterm_open_connection,
0, 0, 0,
- doc: /* Open a connection to Gpm.
-Gpm-mouse can only be activated for one tty at a time. */)
+ doc: /* Open a connection to Gpm. */)
()
{
- struct frame *f = SELECTED_FRAME ();
- struct tty_display_info *tty
- = ((f)->output_method == output_termcap
- ? (f)->terminal->display_info.tty : NULL);
Gpm_Connect connection;
- if (!tty)
- error ("Gpm-mouse only works in the GNU/Linux console");
- if (gpm_tty == tty)
- return Qnil; /* Already activated, nothing to do. */
- if (gpm_tty)
- error ("Gpm-mouse can only be activated for one tty at a time");
-
connection.eventMask = ~0;
connection.defaultMask = ~GPM_HARD;
connection.maxMod = ~0;
@@ -2968,38 +3123,26 @@ Gpm-mouse can only be activated for one tty at a time. */)
gpm_zerobased = 1;
if (Gpm_Open (&connection, 0) < 0)
- error ("Gpm-mouse failed to connect to the gpm daemon");
+ return Qnil;
else
{
- gpm_tty = tty;
- /* `init_sys_modes' arranges for mouse movements sent through gpm_fd
- to generate SIGIOs. Apparently we need to call reset_sys_modes
- before calling init_sys_modes. */
- reset_sys_modes (tty);
- init_sys_modes (tty);
+ term_gpm = 1;
+ reset_sys_modes ();
+ init_sys_modes ();
add_gpm_wait_descriptor (gpm_fd);
- return Qnil;
+ return Qt;
}
}
-DEFUN ("gpm-mouse-stop", Fgpm_mouse_stop, Sgpm_mouse_stop,
+DEFUN ("term-close-connection", Fterm_close_connection, Sterm_close_connection,
0, 0, 0,
doc: /* Close a connection to Gpm. */)
()
{
- struct frame *f = SELECTED_FRAME ();
- struct tty_display_info *tty
- = ((f)->output_method == output_termcap
- ? (f)->terminal->display_info.tty : NULL);
-
- if (!tty || gpm_tty != tty)
- return Qnil; /* Not activated on this terminal, nothing to do. */
-
- if (gpm_fd >= 0)
- delete_gpm_wait_descriptor (gpm_fd);
- while (Gpm_Close()); /* close all the stack */
- gpm_tty = NULL;
- return Qnil;
+ delete_gpm_wait_descriptor (gpm_fd);
+ while (Gpm_Close()); /* close all the stack */
+ term_gpm = 0;
+ return Qnil;
}
#endif /* HAVE_GPM */
@@ -3008,358 +3151,87 @@ DEFUN ("gpm-mouse-stop", Fgpm_mouse_stop, Sgpm_mouse_stop,
Initialization
***********************************************************************/
-/* Initialize the tty-dependent part of frame F. The frame must
- already have its device initialized. */
-
void
-create_tty_output (struct frame *f)
-{
- struct tty_output *t;
-
- if (! FRAME_TERMCAP_P (f))
- abort ();
-
- t = xmalloc (sizeof (struct tty_output));
- bzero (t, sizeof (struct tty_output));
-
- t->display_info = FRAME_TERMINAL (f)->display_info.tty;
-
- f->output_data.tty = t;
-}
-
-/* Delete the tty-dependent part of frame F. */
-
-static void
-delete_tty_output (struct frame *f)
+term_init (terminal_type)
+ char *terminal_type;
{
- if (! FRAME_TERMCAP_P (f))
- abort ();
-
- xfree (f->output_data.tty);
-}
-
-
-/* Reset the hooks in TERMINAL. */
-
-static void
-clear_tty_hooks (struct terminal *terminal)
-{
- terminal->rif = 0;
- terminal->cursor_to_hook = 0;
- terminal->raw_cursor_to_hook = 0;
- terminal->clear_to_end_hook = 0;
- terminal->clear_frame_hook = 0;
- terminal->clear_end_of_line_hook = 0;
- terminal->ins_del_lines_hook = 0;
- terminal->insert_glyphs_hook = 0;
- terminal->write_glyphs_hook = 0;
- terminal->delete_glyphs_hook = 0;
- terminal->ring_bell_hook = 0;
- terminal->reset_terminal_modes_hook = 0;
- terminal->set_terminal_modes_hook = 0;
- terminal->update_begin_hook = 0;
- terminal->update_end_hook = 0;
- terminal->set_terminal_window_hook = 0;
- terminal->mouse_position_hook = 0;
- terminal->frame_rehighlight_hook = 0;
- terminal->frame_raise_lower_hook = 0;
- terminal->fullscreen_hook = 0;
- terminal->set_vertical_scroll_bar_hook = 0;
- terminal->condemn_scroll_bars_hook = 0;
- terminal->redeem_scroll_bar_hook = 0;
- terminal->judge_scroll_bars_hook = 0;
- terminal->read_socket_hook = 0;
- terminal->frame_up_to_date_hook = 0;
-
- /* Leave these two set, or suspended frames are not deleted
- correctly. */
- terminal->delete_frame_hook = &delete_tty_output;
- terminal->delete_terminal_hook = &delete_tty;
-}
-
-/* Initialize hooks in TERMINAL with the values needed for a tty. */
-
-static void
-set_tty_hooks (struct terminal *terminal)
-{
- terminal->rif = 0; /* ttys don't support window-based redisplay. */
-
- terminal->cursor_to_hook = &tty_cursor_to;
- terminal->raw_cursor_to_hook = &tty_raw_cursor_to;
-
- terminal->clear_to_end_hook = &tty_clear_to_end;
- terminal->clear_frame_hook = &tty_clear_frame;
- terminal->clear_end_of_line_hook = &tty_clear_end_of_line;
-
- terminal->ins_del_lines_hook = &tty_ins_del_lines;
-
- terminal->insert_glyphs_hook = &tty_insert_glyphs;
- terminal->write_glyphs_hook = &tty_write_glyphs;
- terminal->delete_glyphs_hook = &tty_delete_glyphs;
-
- terminal->ring_bell_hook = &tty_ring_bell;
-
- terminal->reset_terminal_modes_hook = &tty_reset_terminal_modes;
- terminal->set_terminal_modes_hook = &tty_set_terminal_modes;
- terminal->update_begin_hook = 0; /* Not needed. */
- terminal->update_end_hook = &tty_update_end;
- terminal->set_terminal_window_hook = &tty_set_terminal_window;
-
- terminal->mouse_position_hook = 0; /* Not needed. */
- terminal->frame_rehighlight_hook = 0; /* Not needed. */
- terminal->frame_raise_lower_hook = 0; /* Not needed. */
-
- terminal->set_vertical_scroll_bar_hook = 0; /* Not needed. */
- terminal->condemn_scroll_bars_hook = 0; /* Not needed. */
- terminal->redeem_scroll_bar_hook = 0; /* Not needed. */
- terminal->judge_scroll_bars_hook = 0; /* Not needed. */
-
- terminal->read_socket_hook = &tty_read_avail_input; /* keyboard.c */
- terminal->frame_up_to_date_hook = 0; /* Not needed. */
-
- terminal->delete_frame_hook = &delete_tty_output;
- terminal->delete_terminal_hook = &delete_tty;
-}
-
-/* Drop the controlling terminal if fd is the same device. */
-static void
-dissociate_if_controlling_tty (int fd)
-{
-#ifndef WINDOWSNT
- int pgid;
- EMACS_GET_TTY_PGRP (fd, &pgid); /* If tcgetpgrp succeeds, fd is the ctty. */
- if (pgid != -1)
- {
-#if defined (USG) && !defined (BSD_PGRPS)
- setpgrp ();
- no_controlling_tty = 1;
-#elif defined (CYGWIN)
- setsid ();
- no_controlling_tty = 1;
-#else
-#ifdef TIOCNOTTY /* Try BSD ioctls. */
- sigblock (sigmask (SIGTTOU));
- fd = emacs_open (DEV_TTY, O_RDWR, 0);
- if (fd != -1 && ioctl (fd, TIOCNOTTY, 0) != -1)
- {
- no_controlling_tty = 1;
- }
- if (fd != -1)
- emacs_close (fd);
- sigunblock (sigmask (SIGTTOU));
-#else
- /* Unknown system. */
- croak ();
-#endif /* ! TIOCNOTTY */
-#endif /* ! USG */
- }
-#endif /* !WINDOWSNT */
-}
-
-static void maybe_fatal();
-
-/* Create a termcap display on the tty device with the given name and
- type.
-
- If NAME is NULL, then use the controlling tty, i.e., "/dev/tty".
- Otherwise NAME should be a path to the tty device file,
- e.g. "/dev/pts/7".
-
- TERMINAL_TYPE is the termcap type of the device, e.g. "vt100".
-
- If MUST_SUCCEED is true, then all errors are fatal. */
-
-struct terminal *
-init_tty (char *name, char *terminal_type, int must_succeed)
-{
- char *area = NULL;
+ char *area;
char **address = &area;
char *buffer = NULL;
int buffer_size = 4096;
- register char *p = NULL;
+ register char *p;
int status;
- struct tty_display_info *tty = NULL;
- struct terminal *terminal = NULL;
- int ctty = 0; /* 1 if asked to open controlling tty. */
-
- if (!terminal_type)
- maybe_fatal (must_succeed, 0, 0,
- "Unknown terminal type",
- "Unknown terminal type");
-
- if (name == NULL)
- name = DEV_TTY;
- if (!strcmp (name, DEV_TTY))
- ctty = 1;
-
- /* If we already have a terminal on the given device, use that. If
- all such terminals are suspended, create a new one instead. */
- /* XXX Perhaps this should be made explicit by having init_tty
- always create a new terminal and separating terminal and frame
- creation on Lisp level. */
- terminal = get_named_tty (name);
- if (terminal)
- return terminal;
-
- terminal = create_terminal ();
- tty = (struct tty_display_info *) xmalloc (sizeof (struct tty_display_info));
- bzero (tty, sizeof (struct tty_display_info));
- tty->next = tty_list;
- tty_list = tty;
-
- terminal->type = output_termcap;
- terminal->display_info.tty = tty;
- tty->terminal = terminal;
-
- tty->Wcm = (struct cm *) xmalloc (sizeof (struct cm));
- Wcm_clear (tty);
-
-#ifndef WINDOWSNT
- set_tty_hooks (terminal);
-
- {
- int fd;
- FILE *file;
-
-#ifdef O_IGNORE_CTTY
- if (!ctty)
- /* Open the terminal device. Don't recognize it as our
- controlling terminal, and don't make it the controlling tty
- if we don't have one at the moment. */
- fd = emacs_open (name, O_RDWR | O_IGNORE_CTTY | O_NOCTTY, 0);
- else
-#else
- /* Alas, O_IGNORE_CTTY is a GNU extension that seems to be only
- defined on Hurd. On other systems, we need to explicitly
- dissociate ourselves from the controlling tty when we want to
- open a frame on the same terminal. */
- fd = emacs_open (name, O_RDWR | O_NOCTTY, 0);
-#endif /* O_IGNORE_CTTY */
-
- if (fd < 0)
- maybe_fatal (must_succeed, buffer, terminal,
- "Could not open file: %s",
- "Could not open file: %s",
- name);
- if (!isatty (fd))
- {
- close (fd);
- maybe_fatal (must_succeed, buffer, terminal,
- "Not a tty device: %s",
- "Not a tty device: %s",
- name);
- }
-
-#ifndef O_IGNORE_CTTY
- if (!ctty)
- dissociate_if_controlling_tty (fd);
-#endif
-
- file = fdopen (fd, "w+");
- tty->name = xstrdup (name);
- terminal->name = xstrdup (name);
- tty->input = file;
- tty->output = file;
- }
-
- tty->type = xstrdup (terminal_type);
+ struct frame *sf = XFRAME (selected_frame);
- add_keyboard_wait_descriptor (fileno (tty->input));
-
-#endif
-
- encode_terminal_bufsize = 0;
+ encode_terminal_src_size = 0;
+ encode_terminal_dst_size = 0;
#ifdef HAVE_GPM
- terminal->mouse_position_hook = term_mouse_position;
- mouse_face_window = Qnil;
+ mouse_position_hook = term_mouse_position;
+ Qmouse_face_window = Qnil;
#endif
#ifdef WINDOWSNT
- initialize_w32_display (terminal);
- /* The following two are inaccessible from w32console.c. */
- terminal->delete_frame_hook = &delete_tty_output;
- terminal->delete_terminal_hook = &delete_tty;
-
- tty->name = xstrdup (name);
- terminal->name = xstrdup (name);
- tty->type = xstrdup (terminal_type);
+ initialize_w32_display ();
- tty->output = stdout;
- tty->input = stdin;
- add_keyboard_wait_descriptor (0);
+ Wcm_clear ();
- Wcm_clear (tty);
+ area = (char *) xmalloc (2044);
- {
- struct frame *f = XFRAME (selected_frame);
+ FrameRows = FRAME_LINES (sf);
+ FrameCols = FRAME_COLS (sf);
+ specified_window = FRAME_LINES (sf);
- FrameRows (tty) = FRAME_LINES (f);
- FrameCols (tty) = FRAME_COLS (f);
- tty->specified_window = FRAME_LINES (f);
+ delete_in_insert_mode = 1;
- FRAME_CAN_HAVE_SCROLL_BARS (f) = 0;
- FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_none;
- }
- tty->delete_in_insert_mode = 1;
+ UseTabs = 0;
+ scroll_region_ok = 0;
- UseTabs (tty) = 0;
- terminal->scroll_region_ok = 0;
+ /* Seems to insert lines when it's not supposed to, messing
+ up the display. In doing a trace, it didn't seem to be
+ called much, so I don't think we're losing anything by
+ turning it off. */
- /* Seems to insert lines when it's not supposed to, messing up the
- display. In doing a trace, it didn't seem to be called much, so I
- don't think we're losing anything by turning it off. */
- terminal->line_ins_del_ok = 0;
- terminal->char_ins_del_ok = 1;
+ line_ins_del_ok = 0;
+ char_ins_del_ok = 1;
baud_rate = 19200;
- tty->TN_max_colors = 16; /* Required to be non-zero for tty-display-color-p */
+ FRAME_CAN_HAVE_SCROLL_BARS (sf) = 0;
+ FRAME_VERTICAL_SCROLL_BAR_TYPE (sf) = vertical_scroll_bar_none;
+ TN_max_colors = 16; /* Required to be non-zero for tty-display-color-p */
+ return;
#else /* not WINDOWSNT */
- Wcm_clear (tty);
+ Wcm_clear ();
buffer = (char *) xmalloc (buffer_size);
-
- /* On some systems, tgetent tries to access the controlling
- terminal. */
- sigblock (sigmask (SIGTTOU));
status = tgetent (buffer, terminal_type);
- sigunblock (sigmask (SIGTTOU));
-
if (status < 0)
{
#ifdef TERMINFO
- maybe_fatal (must_succeed, buffer, terminal,
- "Cannot open terminfo database file",
- "Cannot open terminfo database file");
+ fatal ("Cannot open terminfo database file");
#else
- maybe_fatal (must_succeed, buffer, terminal,
- "Cannot open termcap database file",
- "Cannot open termcap database file");
+ fatal ("Cannot open termcap database file");
#endif
}
if (status == 0)
{
#ifdef TERMINFO
- maybe_fatal (must_succeed, buffer, terminal,
- "Terminal type %s is not defined",
- "Terminal type %s is not defined.\n\
+ fatal ("Terminal type %s is not defined.\n\
If that is not the actual type of terminal you have,\n\
use the Bourne shell command `TERM=... export TERM' (C-shell:\n\
`setenv TERM ...') to specify the correct type. It may be necessary\n\
to do `unset TERMINFO' (C-shell: `unsetenv TERMINFO') as well.",
- terminal_type);
+ terminal_type);
#else
- maybe_fatal (must_succeed, buffer, terminal,
- "Terminal type %s is not defined",
- "Terminal type %s is not defined.\n\
+ fatal ("Terminal type %s is not defined.\n\
If that is not the actual type of terminal you have,\n\
use the Bourne shell command `TERM=... export TERM' (C-shell:\n\
`setenv TERM ...') to specify the correct type. It may be necessary\n\
to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.",
- terminal_type);
+ terminal_type);
#endif
}
@@ -3370,237 +3242,219 @@ to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.",
#endif
area = (char *) xmalloc (buffer_size);
- tty->TS_ins_line = tgetstr ("al", address);
- tty->TS_ins_multi_lines = tgetstr ("AL", address);
- tty->TS_bell = tgetstr ("bl", address);
- BackTab (tty) = tgetstr ("bt", address);
- tty->TS_clr_to_bottom = tgetstr ("cd", address);
- tty->TS_clr_line = tgetstr ("ce", address);
- tty->TS_clr_frame = tgetstr ("cl", address);
- ColPosition (tty) = NULL; /* tgetstr ("ch", address); */
- AbsPosition (tty) = tgetstr ("cm", address);
- CR (tty) = tgetstr ("cr", address);
- tty->TS_set_scroll_region = tgetstr ("cs", address);
- tty->TS_set_scroll_region_1 = tgetstr ("cS", address);
- RowPosition (tty) = tgetstr ("cv", address);
- tty->TS_del_char = tgetstr ("dc", address);
- tty->TS_del_multi_chars = tgetstr ("DC", address);
- tty->TS_del_line = tgetstr ("dl", address);
- tty->TS_del_multi_lines = tgetstr ("DL", address);
- tty->TS_delete_mode = tgetstr ("dm", address);
- tty->TS_end_delete_mode = tgetstr ("ed", address);
- tty->TS_end_insert_mode = tgetstr ("ei", address);
- Home (tty) = tgetstr ("ho", address);
- tty->TS_ins_char = tgetstr ("ic", address);
- tty->TS_ins_multi_chars = tgetstr ("IC", address);
- tty->TS_insert_mode = tgetstr ("im", address);
- tty->TS_pad_inserted_char = tgetstr ("ip", address);
- tty->TS_end_keypad_mode = tgetstr ("ke", address);
- tty->TS_keypad_mode = tgetstr ("ks", address);
- LastLine (tty) = tgetstr ("ll", address);
- Right (tty) = tgetstr ("nd", address);
- Down (tty) = tgetstr ("do", address);
- if (!Down (tty))
- Down (tty) = tgetstr ("nl", address); /* Obsolete name for "do" */
+ TS_ins_line = tgetstr ("al", address);
+ TS_ins_multi_lines = tgetstr ("AL", address);
+ TS_bell = tgetstr ("bl", address);
+ BackTab = tgetstr ("bt", address);
+ TS_clr_to_bottom = tgetstr ("cd", address);
+ TS_clr_line = tgetstr ("ce", address);
+ TS_clr_frame = tgetstr ("cl", address);
+ ColPosition = NULL; /* tgetstr ("ch", address); */
+ AbsPosition = tgetstr ("cm", address);
+ CR = tgetstr ("cr", address);
+ TS_set_scroll_region = tgetstr ("cs", address);
+ TS_set_scroll_region_1 = tgetstr ("cS", address);
+ RowPosition = tgetstr ("cv", address);
+ TS_del_char = tgetstr ("dc", address);
+ TS_del_multi_chars = tgetstr ("DC", address);
+ TS_del_line = tgetstr ("dl", address);
+ TS_del_multi_lines = tgetstr ("DL", address);
+ TS_delete_mode = tgetstr ("dm", address);
+ TS_end_delete_mode = tgetstr ("ed", address);
+ TS_end_insert_mode = tgetstr ("ei", address);
+ Home = tgetstr ("ho", address);
+ TS_ins_char = tgetstr ("ic", address);
+ TS_ins_multi_chars = tgetstr ("IC", address);
+ TS_insert_mode = tgetstr ("im", address);
+ TS_pad_inserted_char = tgetstr ("ip", address);
+ TS_end_keypad_mode = tgetstr ("ke", address);
+ TS_keypad_mode = tgetstr ("ks", address);
+ LastLine = tgetstr ("ll", address);
+ Right = tgetstr ("nd", address);
+ Down = tgetstr ("do", address);
+ if (!Down)
+ Down = tgetstr ("nl", address); /* Obsolete name for "do" */
#ifdef VMS
/* VMS puts a carriage return before each linefeed,
so it is not safe to use linefeeds. */
- if (Down (tty) && Down (tty)[0] == '\n' && Down (tty)[1] == '\0')
- Down (tty) = 0;
+ if (Down && Down[0] == '\n' && Down[1] == '\0')
+ Down = 0;
#endif /* VMS */
if (tgetflag ("bs"))
- Left (tty) = "\b"; /* can't possibly be longer! */
+ Left = "\b"; /* can't possibly be longer! */
else /* (Actually, "bs" is obsolete...) */
- Left (tty) = tgetstr ("le", address);
- if (!Left (tty))
- Left (tty) = tgetstr ("bc", address); /* Obsolete name for "le" */
- tty->TS_pad_char = tgetstr ("pc", address);
- tty->TS_repeat = tgetstr ("rp", address);
- tty->TS_end_standout_mode = tgetstr ("se", address);
- tty->TS_fwd_scroll = tgetstr ("sf", address);
- tty->TS_standout_mode = tgetstr ("so", address);
- tty->TS_rev_scroll = tgetstr ("sr", address);
- tty->Wcm->cm_tab = tgetstr ("ta", address);
- tty->TS_end_termcap_modes = tgetstr ("te", address);
- tty->TS_termcap_modes = tgetstr ("ti", address);
- Up (tty) = tgetstr ("up", address);
- tty->TS_visible_bell = tgetstr ("vb", address);
- tty->TS_cursor_normal = tgetstr ("ve", address);
- tty->TS_cursor_visible = tgetstr ("vs", address);
- tty->TS_cursor_invisible = tgetstr ("vi", address);
- tty->TS_set_window = tgetstr ("wi", address);
-
- tty->TS_enter_underline_mode = tgetstr ("us", address);
- tty->TS_exit_underline_mode = tgetstr ("ue", address);
- tty->TS_enter_bold_mode = tgetstr ("md", address);
- tty->TS_enter_dim_mode = tgetstr ("mh", address);
- tty->TS_enter_blink_mode = tgetstr ("mb", address);
- tty->TS_enter_reverse_mode = tgetstr ("mr", address);
- tty->TS_enter_alt_charset_mode = tgetstr ("as", address);
- tty->TS_exit_alt_charset_mode = tgetstr ("ae", address);
- tty->TS_exit_attribute_mode = tgetstr ("me", address);
-
- MultiUp (tty) = tgetstr ("UP", address);
- MultiDown (tty) = tgetstr ("DO", address);
- MultiLeft (tty) = tgetstr ("LE", address);
- MultiRight (tty) = tgetstr ("RI", address);
+ Left = tgetstr ("le", address);
+ if (!Left)
+ Left = tgetstr ("bc", address); /* Obsolete name for "le" */
+ TS_pad_char = tgetstr ("pc", address);
+ TS_repeat = tgetstr ("rp", address);
+ TS_end_standout_mode = tgetstr ("se", address);
+ TS_fwd_scroll = tgetstr ("sf", address);
+ TS_standout_mode = tgetstr ("so", address);
+ TS_rev_scroll = tgetstr ("sr", address);
+ Wcm.cm_tab = tgetstr ("ta", address);
+ TS_end_termcap_modes = tgetstr ("te", address);
+ TS_termcap_modes = tgetstr ("ti", address);
+ Up = tgetstr ("up", address);
+ TS_visible_bell = tgetstr ("vb", address);
+ TS_cursor_normal = tgetstr ("ve", address);
+ TS_cursor_visible = tgetstr ("vs", address);
+ TS_cursor_invisible = tgetstr ("vi", address);
+ TS_set_window = tgetstr ("wi", address);
+
+ TS_enter_underline_mode = tgetstr ("us", address);
+ TS_exit_underline_mode = tgetstr ("ue", address);
+ TS_enter_bold_mode = tgetstr ("md", address);
+ TS_enter_dim_mode = tgetstr ("mh", address);
+ TS_enter_blink_mode = tgetstr ("mb", address);
+ TS_enter_reverse_mode = tgetstr ("mr", address);
+ TS_enter_alt_charset_mode = tgetstr ("as", address);
+ TS_exit_alt_charset_mode = tgetstr ("ae", address);
+ TS_exit_attribute_mode = tgetstr ("me", address);
+
+ MultiUp = tgetstr ("UP", address);
+ MultiDown = tgetstr ("DO", address);
+ MultiLeft = tgetstr ("LE", address);
+ MultiRight = tgetstr ("RI", address);
/* SVr4/ANSI color suppert. If "op" isn't available, don't support
color because we can't switch back to the default foreground and
background. */
- tty->TS_orig_pair = tgetstr ("op", address);
- if (tty->TS_orig_pair)
+ TS_orig_pair = tgetstr ("op", address);
+ if (TS_orig_pair)
{
- tty->TS_set_foreground = tgetstr ("AF", address);
- tty->TS_set_background = tgetstr ("AB", address);
- if (!tty->TS_set_foreground)
+ TS_set_foreground = tgetstr ("AF", address);
+ TS_set_background = tgetstr ("AB", address);
+ if (!TS_set_foreground)
{
/* SVr4. */
- tty->TS_set_foreground = tgetstr ("Sf", address);
- tty->TS_set_background = tgetstr ("Sb", address);
+ TS_set_foreground = tgetstr ("Sf", address);
+ TS_set_background = tgetstr ("Sb", address);
}
- tty->TN_max_colors = tgetnum ("Co");
- tty->TN_max_pairs = tgetnum ("pa");
+ TN_max_colors = tgetnum ("Co");
+ TN_max_pairs = tgetnum ("pa");
- tty->TN_no_color_video = tgetnum ("NC");
- if (tty->TN_no_color_video == -1)
- tty->TN_no_color_video = 0;
+ TN_no_color_video = tgetnum ("NC");
+ if (TN_no_color_video == -1)
+ TN_no_color_video = 0;
}
- tty_default_color_capabilities (tty, 1);
+ tty_default_color_capabilities (1);
- MagicWrap (tty) = tgetflag ("xn");
+ MagicWrap = tgetflag ("xn");
/* Since we make MagicWrap terminals look like AutoWrap, we need to have
the former flag imply the latter. */
- AutoWrap (tty) = MagicWrap (tty) || tgetflag ("am");
- terminal->memory_below_frame = tgetflag ("db");
- tty->TF_hazeltine = tgetflag ("hz");
- terminal->must_write_spaces = tgetflag ("in");
- tty->meta_key = tgetflag ("km") || tgetflag ("MT");
- tty->TF_insmode_motion = tgetflag ("mi");
- tty->TF_standout_motion = tgetflag ("ms");
- tty->TF_underscore = tgetflag ("ul");
- tty->TF_teleray = tgetflag ("xt");
-
-#endif /* !WINDOWSNT */
-#ifdef MULTI_KBOARD
- terminal->kboard = (KBOARD *) xmalloc (sizeof (KBOARD));
- init_kboard (terminal->kboard);
- terminal->kboard->next_kboard = all_kboards;
- all_kboards = terminal->kboard;
- terminal->kboard->reference_count++;
- /* Don't let the initial kboard remain current longer than necessary.
- That would cause problems if a file loaded on startup tries to
- prompt in the mini-buffer. */
- if (current_kboard == initial_kboard)
- current_kboard = terminal->kboard;
-#ifndef WINDOWSNT
- term_get_fkeys (address, terminal->kboard);
-#endif
-#endif
+ AutoWrap = MagicWrap || tgetflag ("am");
+ memory_below_frame = tgetflag ("db");
+ TF_hazeltine = tgetflag ("hz");
+ must_write_spaces = tgetflag ("in");
+ meta_key = tgetflag ("km") || tgetflag ("MT");
+ TF_insmode_motion = tgetflag ("mi");
+ TF_standout_motion = tgetflag ("ms");
+ TF_underscore = tgetflag ("ul");
+ TF_teleray = tgetflag ("xt");
+
+ term_get_fkeys (address);
-#ifndef WINDOWSNT
/* Get frame size from system, or else from termcap. */
{
int height, width;
- get_tty_size (fileno (tty->input), &width, &height);
- FrameCols (tty) = width;
- FrameRows (tty) = height;
+ get_frame_size (&width, &height);
+ FRAME_COLS (sf) = width;
+ FRAME_LINES (sf) = height;
}
- if (FrameCols (tty) <= 0)
- FrameCols (tty) = tgetnum ("co");
- if (FrameRows (tty) <= 0)
- FrameRows (tty) = tgetnum ("li");
-
- if (FrameRows (tty) < 3 || FrameCols (tty) < 3)
- maybe_fatal (must_succeed, NULL, terminal,
- "Screen size %dx%d is too small"
- "Screen size %dx%d is too small",
- FrameCols (tty), FrameRows (tty));
+ if (FRAME_COLS (sf) <= 0)
+ SET_FRAME_COLS (sf, tgetnum ("co"));
+ else
+ /* Keep width and external_width consistent */
+ SET_FRAME_COLS (sf, FRAME_COLS (sf));
+ if (FRAME_LINES (sf) <= 0)
+ FRAME_LINES (sf) = tgetnum ("li");
-#if 0 /* This is not used anywhere. */
- tty->terminal->min_padding_speed = tgetnum ("pb");
-#endif
+ if (FRAME_LINES (sf) < 3 || FRAME_COLS (sf) < 3)
+ fatal ("Screen size %dx%d is too small",
+ FRAME_LINES (sf), FRAME_COLS (sf));
- TabWidth (tty) = tgetnum ("tw");
+ min_padding_speed = tgetnum ("pb");
+ TabWidth = tgetnum ("tw");
#ifdef VMS
/* These capabilities commonly use ^J.
I don't know why, but sending them on VMS does not work;
it causes following spaces to be lost, sometimes.
For now, the simplest fix is to avoid using these capabilities ever. */
- if (Down (tty) && Down (tty)[0] == '\n')
- Down (tty) = 0;
+ if (Down && Down[0] == '\n')
+ Down = 0;
#endif /* VMS */
- if (!tty->TS_bell)
- tty->TS_bell = "\07";
+ if (!TS_bell)
+ TS_bell = "\07";
- if (!tty->TS_fwd_scroll)
- tty->TS_fwd_scroll = Down (tty);
+ if (!TS_fwd_scroll)
+ TS_fwd_scroll = Down;
- PC = tty->TS_pad_char ? *tty->TS_pad_char : 0;
+ PC = TS_pad_char ? *TS_pad_char : 0;
- if (TabWidth (tty) < 0)
- TabWidth (tty) = 8;
+ if (TabWidth < 0)
+ TabWidth = 8;
/* Turned off since /etc/termcap seems to have :ta= for most terminals
and newer termcap doc does not seem to say there is a default.
- if (!tty->Wcm->cm_tab)
- tty->Wcm->cm_tab = "\t";
+ if (!Wcm.cm_tab)
+ Wcm.cm_tab = "\t";
*/
/* We don't support standout modes that use `magic cookies', so
turn off any that do. */
- if (tty->TS_standout_mode && tgetnum ("sg") >= 0)
+ if (TS_standout_mode && tgetnum ("sg") >= 0)
{
- tty->TS_standout_mode = 0;
- tty->TS_end_standout_mode = 0;
+ TS_standout_mode = 0;
+ TS_end_standout_mode = 0;
}
- if (tty->TS_enter_underline_mode && tgetnum ("ug") >= 0)
+ if (TS_enter_underline_mode && tgetnum ("ug") >= 0)
{
- tty->TS_enter_underline_mode = 0;
- tty->TS_exit_underline_mode = 0;
+ TS_enter_underline_mode = 0;
+ TS_exit_underline_mode = 0;
}
/* If there's no standout mode, try to use underlining instead. */
- if (tty->TS_standout_mode == 0)
+ if (TS_standout_mode == 0)
{
- tty->TS_standout_mode = tty->TS_enter_underline_mode;
- tty->TS_end_standout_mode = tty->TS_exit_underline_mode;
+ TS_standout_mode = TS_enter_underline_mode;
+ TS_end_standout_mode = TS_exit_underline_mode;
}
/* If no `se' string, try using a `me' string instead.
If that fails, we can't use standout mode at all. */
- if (tty->TS_end_standout_mode == 0)
+ if (TS_end_standout_mode == 0)
{
char *s = tgetstr ("me", address);
if (s != 0)
- tty->TS_end_standout_mode = s;
+ TS_end_standout_mode = s;
else
- tty->TS_standout_mode = 0;
+ TS_standout_mode = 0;
}
- if (tty->TF_teleray)
+ if (TF_teleray)
{
- tty->Wcm->cm_tab = 0;
+ Wcm.cm_tab = 0;
/* We can't support standout mode, because it uses magic cookies. */
- tty->TS_standout_mode = 0;
+ TS_standout_mode = 0;
/* But that means we cannot rely on ^M to go to column zero! */
- CR (tty) = 0;
+ CR = 0;
/* LF can't be trusted either -- can alter hpos */
/* if move at column 0 thru a line with TS_standout_mode */
- Down (tty) = 0;
+ Down = 0;
}
/* Special handling for certain terminal types known to need it */
if (!strcmp (terminal_type, "supdup"))
{
- terminal->memory_below_frame = 1;
- tty->Wcm->cm_losewrap = 1;
+ memory_below_frame = 1;
+ Wcm.cm_losewrap = 1;
}
if (!strncmp (terminal_type, "c10", 3)
|| !strcmp (terminal_type, "perq"))
@@ -3617,140 +3471,102 @@ to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.",
It would be simpler if the :wi string could go in the termcap
entry, but it can't because it is not fully valid.
If it were in the termcap entry, it would confuse other programs. */
- if (!tty->TS_set_window)
+ if (!TS_set_window)
{
- p = tty->TS_termcap_modes;
+ p = TS_termcap_modes;
while (*p && strcmp (p, "\033v "))
p++;
if (*p)
- tty->TS_set_window = "\033v%C %C %C %C ";
+ TS_set_window = "\033v%C %C %C %C ";
}
/* Termcap entry often fails to have :in: flag */
- terminal->must_write_spaces = 1;
+ must_write_spaces = 1;
/* :ti string typically fails to have \E^G! in it */
/* This limits scope of insert-char to one line. */
- strcpy (area, tty->TS_termcap_modes);
+ strcpy (area, TS_termcap_modes);
strcat (area, "\033\007!");
- tty->TS_termcap_modes = area;
+ TS_termcap_modes = area;
area += strlen (area) + 1;
- p = AbsPosition (tty);
+ p = AbsPosition;
/* Change all %+ parameters to %C, to handle
- values above 96 correctly for the C100. */
+ values above 96 correctly for the C100. */
while (*p)
- {
- if (p[0] == '%' && p[1] == '+')
- p[1] = 'C';
- p++;
- }
+ {
+ if (p[0] == '%' && p[1] == '+')
+ p[1] = 'C';
+ p++;
+ }
}
- tty->specified_window = FrameRows (tty);
+ FrameRows = FRAME_LINES (sf);
+ FrameCols = FRAME_COLS (sf);
+ specified_window = FRAME_LINES (sf);
- if (Wcm_init (tty) == -1) /* can't do cursor motion */
- {
- maybe_fatal (must_succeed, NULL, terminal,
- "Terminal type \"%s\" is not powerful enough to run Emacs",
+ if (Wcm_init () == -1) /* can't do cursor motion */
#ifdef VMS
- "Terminal type \"%s\" is not powerful enough to run Emacs.\n\
+ fatal ("Terminal type \"%s\" is not powerful enough to run Emacs.\n\
It lacks the ability to position the cursor.\n\
If that is not the actual type of terminal you have, use either the\n\
DCL command `SET TERMINAL/DEVICE= ...' for DEC-compatible terminals,\n\
or `define EMACS_TERM \"terminal type\"' for non-DEC terminals.",
+ terminal_type);
#else /* not VMS */
# ifdef TERMINFO
- "Terminal type \"%s\" is not powerful enough to run Emacs.\n\
+ fatal ("Terminal type \"%s\" is not powerful enough to run Emacs.\n\
It lacks the ability to position the cursor.\n\
If that is not the actual type of terminal you have,\n\
use the Bourne shell command `TERM=... export TERM' (C-shell:\n\
`setenv TERM ...') to specify the correct type. It may be necessary\n\
to do `unset TERMINFO' (C-shell: `unsetenv TERMINFO') as well.",
+ terminal_type);
# else /* TERMCAP */
- "Terminal type \"%s\" is not powerful enough to run Emacs.\n\
+ fatal ("Terminal type \"%s\" is not powerful enough to run Emacs.\n\
It lacks the ability to position the cursor.\n\
If that is not the actual type of terminal you have,\n\
use the Bourne shell command `TERM=... export TERM' (C-shell:\n\
`setenv TERM ...') to specify the correct type. It may be necessary\n\
to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.",
+ terminal_type);
# endif /* TERMINFO */
#endif /*VMS */
- terminal_type);
- }
-
- if (FrameRows (tty) <= 0 || FrameCols (tty) <= 0)
- maybe_fatal (must_succeed, NULL, terminal,
- "Could not determine the frame size",
- "Could not determine the frame size");
+ if (FRAME_LINES (sf) <= 0
+ || FRAME_COLS (sf) <= 0)
+ fatal ("The frame size has not been specified");
- tty->delete_in_insert_mode
- = tty->TS_delete_mode && tty->TS_insert_mode
- && !strcmp (tty->TS_delete_mode, tty->TS_insert_mode);
+ delete_in_insert_mode
+ = TS_delete_mode && TS_insert_mode
+ && !strcmp (TS_delete_mode, TS_insert_mode);
- tty->se_is_so = (tty->TS_standout_mode
- && tty->TS_end_standout_mode
- && !strcmp (tty->TS_standout_mode, tty->TS_end_standout_mode));
-
- UseTabs (tty) = tabs_safe_p (fileno (tty->input)) && TabWidth (tty) == 8;
-
- terminal->scroll_region_ok
- = (tty->Wcm->cm_abs
- && (tty->TS_set_window || tty->TS_set_scroll_region || tty->TS_set_scroll_region_1));
-
- terminal->line_ins_del_ok
- = (((tty->TS_ins_line || tty->TS_ins_multi_lines)
- && (tty->TS_del_line || tty->TS_del_multi_lines))
- || (terminal->scroll_region_ok
- && tty->TS_fwd_scroll && tty->TS_rev_scroll));
-
- terminal->char_ins_del_ok
- = ((tty->TS_ins_char || tty->TS_insert_mode
- || tty->TS_pad_inserted_char || tty->TS_ins_multi_chars)
- && (tty->TS_del_char || tty->TS_del_multi_chars));
-
- terminal->fast_clear_end_of_line = tty->TS_clr_line != 0;
-
- init_baud_rate (fileno (tty->input));
-
-#ifdef AIXHFT
- /* The HFT system on AIX doesn't optimize for scrolling, so it's
- really ugly at times. */
- terminal->line_ins_del_ok = 0;
- terminal->char_ins_del_ok = 0;
-#endif
+ se_is_so = (TS_standout_mode
+ && TS_end_standout_mode
+ && !strcmp (TS_standout_mode, TS_end_standout_mode));
- /* Don't do this. I think termcap may still need the buffer. */
- /* xfree (buffer); */
+ UseTabs = tabs_safe_p () && TabWidth == 8;
-#endif /* not WINDOWSNT */
+ scroll_region_ok
+ = (Wcm.cm_abs
+ && (TS_set_window || TS_set_scroll_region || TS_set_scroll_region_1));
- /* Init system terminal modes (RAW or CBREAK, etc.). */
- init_sys_modes (tty);
+ line_ins_del_ok = (((TS_ins_line || TS_ins_multi_lines)
+ && (TS_del_line || TS_del_multi_lines))
+ || (scroll_region_ok && TS_fwd_scroll && TS_rev_scroll));
- return terminal;
-}
+ char_ins_del_ok = ((TS_ins_char || TS_insert_mode
+ || TS_pad_inserted_char || TS_ins_multi_chars)
+ && (TS_del_char || TS_del_multi_chars));
-/* Auxiliary error-handling function for init_tty.
- Free BUFFER and delete TERMINAL, then call error or fatal
- with str1 or str2, respectively, according to MUST_SUCCEED. */
+ fast_clear_end_of_line = TS_clr_line != 0;
-static void
-maybe_fatal (must_succeed, buffer, terminal, str1, str2, arg1, arg2)
- int must_succeed;
- char *buffer;
- struct terminal *terminal;
- char *str1, *str2, *arg1, *arg2;
-{
- if (buffer)
- xfree (buffer);
+ init_baud_rate ();
+ if (read_socket_hook) /* Baudrate is somewhat */
+ /* meaningless in this case */
+ baud_rate = 9600;
- if (terminal)
- delete_tty (terminal);
-
- if (must_succeed)
- fatal (str2, arg1, arg2);
- else
- error (str1, arg1, arg2);
+ FRAME_CAN_HAVE_SCROLL_BARS (sf) = 0;
+ FRAME_VERTICAL_SCROLL_BAR_TYPE (sf) = vertical_scroll_bar_none;
+#endif /* WINDOWSNT */
- abort ();
+ xfree (buffer);
}
/* VARARGS 1 */
@@ -3765,105 +3581,16 @@ fatal (str, arg1, arg2)
exit (1);
}
-
-
-/* Delete the given tty terminal, closing all frames on it. */
-
-static void
-delete_tty (struct terminal *terminal)
-{
- struct tty_display_info *tty;
- Lisp_Object tail, frame;
- int last_terminal;
-
- /* Protect against recursive calls. Fdelete_frame in
- delete_terminal calls us back when it deletes our last frame. */
- if (!terminal->name)
- return;
-
- if (terminal->type != output_termcap)
- abort ();
-
- tty = terminal->display_info.tty;
-
- last_terminal = 1;
- FOR_EACH_FRAME (tail, frame)
- {
- struct frame *f = XFRAME (frame);
- if (FRAME_LIVE_P (f) && (!FRAME_TERMCAP_P (f) || FRAME_TTY (f) != tty))
- {
- last_terminal = 0;
- break;
- }
- }
- if (last_terminal)
- error ("Attempt to delete the sole terminal device with live frames");
-
- if (tty == tty_list)
- tty_list = tty->next;
- else
- {
- struct tty_display_info *p;
- for (p = tty_list; p && p->next != tty; p = p->next)
- ;
-
- if (! p)
- /* This should not happen. */
- abort ();
-
- p->next = tty->next;
- tty->next = 0;
- }
-
- /* reset_sys_modes needs a valid device, so this call needs to be
- before delete_terminal. */
- reset_sys_modes (tty);
-
- delete_terminal (terminal);
-
- if (tty->name)
- xfree (tty->name);
-
- if (tty->type)
- xfree (tty->type);
-
- if (tty->input)
- {
- delete_keyboard_wait_descriptor (fileno (tty->input));
- if (tty->input != stdin)
- fclose (tty->input);
- }
- if (tty->output && tty->output != stdout && tty->output != tty->input)
- fclose (tty->output);
- if (tty->termscript)
- fclose (tty->termscript);
-
- if (tty->old_tty)
- xfree (tty->old_tty);
-
- if (tty->Wcm)
- xfree (tty->Wcm);
-
- bzero (tty, sizeof (struct tty_display_info));
- xfree (tty);
-}
-
-
-
-/* Mark the pointers in the tty_display_info objects.
- Called by the Fgarbage_collector. */
-
-void
-mark_ttys (void)
+DEFUN ("tty-no-underline", Ftty_no_underline, Stty_no_underline, 0, 0, 0,
+ doc: /* Declare that this terminal does not handle underlining.
+This is used to override the terminfo data, for certain terminals that
+do not really do underlining, but say that they do. */)
+ ()
{
- struct tty_display_info *tty;
-
- for (tty = tty_list; tty; tty = tty->next)
- mark_object (tty->top_frame);
+ TS_enter_underline_mode = 0;
+ return Qnil;
}
-
-
void
syms_of_term ()
{
@@ -3876,18 +3603,10 @@ This variable can be used by terminal emulator packages. */);
system_uses_terminfo = 0;
#endif
- DEFVAR_LISP ("suspend-tty-functions", &Vsuspend_tty_functions,
- doc: /* Functions to be run after suspending a tty.
-The functions are run with one argument, the terminal id to be suspended.
-See `suspend-tty'. */);
- Vsuspend_tty_functions = Qnil;
-
-
- DEFVAR_LISP ("resume-tty-functions", &Vresume_tty_functions,
- doc: /* Functions to be run after resuming a tty.
-The functions are run with one argument, the terminal id that was revived.
-See `resume-tty'. */);
- Vresume_tty_functions = Qnil;
+ DEFVAR_LISP ("ring-bell-function", &Vring_bell_function,
+ doc: /* Non-nil means call this function to ring the bell.
+The function should accept no arguments. */);
+ Vring_bell_function = Qnil;
DEFVAR_BOOL ("visible-cursor", &visible_cursor,
doc: /* Non-nil means to make the cursor very visible.
@@ -3899,19 +3618,15 @@ bigger, or it may make it blink, or it may do nothing at all. */);
defsubr (&Stty_display_color_p);
defsubr (&Stty_display_color_cells);
defsubr (&Stty_no_underline);
- defsubr (&Stty_type);
- defsubr (&Scontrolling_tty_p);
- defsubr (&Ssuspend_tty);
- defsubr (&Sresume_tty);
#ifdef HAVE_GPM
- defsubr (&Sgpm_mouse_start);
- defsubr (&Sgpm_mouse_stop);
+ defsubr (&Sterm_open_connection);
+ defsubr (&Sterm_close_connection);
- staticpro (&mouse_face_window);
+ staticpro (&Qmouse_face_window);
#endif /* HAVE_GPM */
-}
-
+ fullscreen_hook = NULL;
+}
/* arch-tag: 498e7449-6f2e-45e2-91dd-b7d4ca488193
(do not change this comment) */
diff --git a/src/termchar.h b/src/termchar.h
index 381210fd65..c4bf2adb0b 100644
--- a/src/termchar.h
+++ b/src/termchar.h
@@ -19,185 +19,32 @@ along with GNU Emacs; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
-/* Each termcap frame points to its own struct tty_output object in
- the output_data.tty field. The tty_output structure contains the
- information that is specific to termcap frames. */
-struct tty_output
-{
- /* The Emacs structure for the tty device this frame is on. */
- struct tty_display_info *display_info;
-
- /* There is nothing else here at the moment... */
-};
-
-/* Parameters that are shared between frames on the same tty device. */
-
-struct tty_display_info
-{
- struct tty_display_info *next; /* Chain of all tty devices. */
-
- char *name; /* The name of the device file or 0 if
- stdin/stdout. */
- char *type; /* The type of the tty. */
-
- /* Input/output */
-
- FILE *input; /* The stream to be used for terminal input.
- NULL if the terminal is suspended. */
- FILE *output; /* The stream to be used for terminal output.
- NULL if the terminal is suspended. */
-
- FILE *termscript; /* If nonzero, send all terminal output
- characters to this stream also. */
-
- struct emacs_tty *old_tty; /* The initial tty mode bits */
-
- int term_initted; /* 1 if we have been through init_sys_modes. */
-
-
- int reference_count; /* Number of frames that are on this display. */
-
- struct terminal *terminal; /* Points back to the generic terminal
- structure. This is sometimes handy. */
-
- /* Info on cursor positioning. */
- struct cm *Wcm;
-
- /* Redisplay. */
-
- Lisp_Object top_frame; /* The topmost frame on this tty. */
-
- /* The previous frame we displayed on this tty. */
- struct frame *previous_frame;
-
- /* Strings, numbers and flags taken from the termcap entry. */
-
- char *TS_ins_line; /* "al" */
- char *TS_ins_multi_lines; /* "AL" (one parameter, # lines to insert) */
- char *TS_bell; /* "bl" */
- char *TS_clr_to_bottom; /* "cd" */
- char *TS_clr_line; /* "ce", clear to end of line */
- char *TS_clr_frame; /* "cl" */
- char *TS_set_scroll_region; /* "cs" (2 params, first line and last line) */
- char *TS_set_scroll_region_1; /* "cS" (4 params: total lines,
- lines above scroll region, lines below it,
- total lines again) */
- char *TS_del_char; /* "dc" */
- char *TS_del_multi_chars; /* "DC" (one parameter, # chars to delete) */
- char *TS_del_line; /* "dl" */
- char *TS_del_multi_lines; /* "DL" (one parameter, # lines to delete) */
- char *TS_delete_mode; /* "dm", enter character-delete mode */
- char *TS_end_delete_mode; /* "ed", leave character-delete mode */
- char *TS_end_insert_mode; /* "ei", leave character-insert mode */
- char *TS_ins_char; /* "ic" */
- char *TS_ins_multi_chars; /* "IC" (one parameter, # chars to insert) */
- char *TS_insert_mode; /* "im", enter character-insert mode */
- char *TS_pad_inserted_char; /* "ip". Just padding, no commands. */
- char *TS_end_keypad_mode; /* "ke" */
- char *TS_keypad_mode; /* "ks" */
- char *TS_pad_char; /* "pc", char to use as padding */
- char *TS_repeat; /* "rp" (2 params, # times to repeat
- and character to be repeated) */
- char *TS_end_standout_mode; /* "se" */
- char *TS_fwd_scroll; /* "sf" */
- char *TS_standout_mode; /* "so" */
- char *TS_rev_scroll; /* "sr" */
- char *TS_end_termcap_modes; /* "te" */
- char *TS_termcap_modes; /* "ti" */
- char *TS_visible_bell; /* "vb" */
- char *TS_cursor_normal; /* "ve" */
- char *TS_cursor_visible; /* "vs" */
- char *TS_cursor_invisible; /* "vi" */
- char *TS_set_window; /* "wi" (4 params, start and end of window,
- each as vpos and hpos) */
-
- char *TS_enter_bold_mode; /* "md" -- turn on bold (extra bright mode). */
- char *TS_enter_dim_mode; /* "mh" -- turn on half-bright mode. */
- char *TS_enter_blink_mode; /* "mb" -- enter blinking mode. */
- char *TS_enter_reverse_mode; /* "mr" -- enter reverse video mode. */
- char *TS_exit_underline_mode; /* "us" -- start underlining. */
- char *TS_enter_underline_mode; /* "ue" -- end underlining. */
-
- /* "as"/"ae" -- start/end alternate character set. Not really
- supported, yet. */
- char *TS_enter_alt_charset_mode;
- char *TS_exit_alt_charset_mode;
-
- char *TS_exit_attribute_mode; /* "me" -- switch appearances off. */
-
- /* Value of the "NC" (no_color_video) capability, or 0 if not present. */
- int TN_no_color_video;
-
- int TN_max_colors; /* "Co" -- number of colors. */
-
- /* "pa" -- max. number of color pairs on screen. Not handled yet.
- Could be a problem if not equal to TN_max_colors * TN_max_colors. */
- int TN_max_pairs;
-
- /* "op" -- SVr4 set default pair to its original value. */
- char *TS_orig_pair;
-
- /* "AF"/"AB" or "Sf"/"Sb"-- set ANSI or SVr4 foreground/background color.
- 1 param, the color index. */
- char *TS_set_foreground;
- char *TS_set_background;
-
- int TF_hazeltine; /* termcap hz flag. */
- int TF_insmode_motion; /* termcap mi flag: can move while in insert mode. */
- int TF_standout_motion; /* termcap mi flag: can move while in standout mode. */
- int TF_underscore; /* termcap ul flag: _ underlines if over-struck on
- non-blank position. Must clear before writing _. */
- int TF_teleray; /* termcap xt flag: many weird consequences.
- For t1061. */
-
- int RPov; /* # chars to start a TS_repeat */
-
- int delete_in_insert_mode; /* delete mode == insert mode */
-
- int se_is_so; /* 1 if same string both enters and leaves
- standout mode */
-
- int costs_set; /* Nonzero if costs have been calculated. */
-
- int insert_mode; /* Nonzero when in insert mode. */
- int standout_mode; /* Nonzero when in standout mode. */
-
-
-
- /* 1 if should obey 0200 bit in input chars as "Meta", 2 if should
- keep 0200 bit in input chars. 0 to ignore the 0200 bit. */
-
- int meta_key;
-
- /* Size of window specified by higher levels.
- This is the number of lines, from the top of frame downwards,
- which can participate in insert-line/delete-line operations.
-
- Effectively it excludes the bottom frame_lines - specified_window_size
- lines from those operations. */
-
- int specified_window;
-
- /* Flag used in tty_show/hide_cursor. */
-
- int cursor_hidden;
-
- /* Nonzero means use ^S/^Q for flow control. */
- int flow_control;
-
-};
-
-/* A chain of structures for all tty devices currently in use. */
-extern struct tty_display_info *tty_list;
-
-
-#define FRAME_TTY(f) \
- ((f)->output_method == output_termcap \
- ? (f)->terminal->display_info.tty \
- : (abort(), (struct tty_display_info *) 0))
-
-#define CURTTY() FRAME_TTY (SELECTED_FRAME())
+/* extern EMACS_INT baud_rate; */ /* Output speed in baud */
+extern int must_write_spaces; /* Nonzero means spaces in the text
+ must actually be output; can't just skip
+ over some columns to leave them blank. */
+extern int min_padding_speed; /* Speed below which no padding necessary */
+extern int fast_clear_end_of_line; /* Nonzero means terminal has
+ command for this */
+
+extern int line_ins_del_ok; /* Terminal can insert and delete lines */
+extern int char_ins_del_ok; /* Terminal can insert and delete chars */
+extern int scroll_region_ok; /* Terminal supports setting the scroll
+ window */
+extern int scroll_region_cost; /* Cost of setting the scroll window,
+ measured in characters */
+extern int memory_below_frame; /* Terminal remembers lines scrolled
+ off bottom */
+extern int fast_clear_end_of_line; /* Terminal has a `ce' string */
+
+extern int dont_calculate_costs; /* Nonzero means don't bother computing
+ various cost tables; we won't use them. */
+
+/* Nonzero means no need to redraw the entire frame on resuming
+ a suspended Emacs. This is useful on terminals with multiple pages,
+ where one page is used for Emacs and another for all else. */
+extern int no_redraw_on_reenter;
/* arch-tag: bf9f0d49-842b-42fb-9348-ec8759b27193
(do not change this comment) */
diff --git a/src/termhooks.h b/src/termhooks.h
index 4d8fb8a861..eb074608e1 100644
--- a/src/termhooks.h
+++ b/src/termhooks.h
@@ -1,6 +1,7 @@
-/* Parameters and display hooks for terminal devices.
- Copyright (C) 1985, 1986, 1993, 1994, 2002, 2003, 2004,
- 2005, 2006, 2007 Free Software Foundation, Inc.
+/* Hooks by which low level terminal operations
+ can be made to call other routines.
+ Copyright (C) 1985, 1986, 1993, 1994, 2001, 2002, 2003, 2004,
+ 2005, 2006, 2007 Free Software Foundation, Inc.
This file is part of GNU Emacs.
@@ -25,11 +26,40 @@ Boston, MA 02110-1301, USA. */
struct glyph;
struct frame;
+/* If nonzero, send all terminal output characters to this stream also. */
+extern FILE *termscript;
+
/* Only use prototypes when lisp.h has been included. */
#ifndef P_
#define P_(X) ()
#endif
+/* Text display hooks. */
+
+extern void (*cursor_to_hook) P_ ((int vpos, int hpos));
+extern void (*raw_cursor_to_hook) P_ ((int, int));
+
+extern void (*clear_to_end_hook) P_ ((void));
+extern void (*clear_frame_hook) P_ ((void));
+extern void (*clear_end_of_line_hook) P_ ((int));
+
+extern void (*ins_del_lines_hook) P_ ((int, int));
+
+extern void (*insert_glyphs_hook) P_ ((struct glyph *s, int n));
+extern void (*write_glyphs_hook) P_ ((struct glyph *s, int n));
+extern void (*delete_glyphs_hook) P_ ((int));
+
+extern void (*ring_bell_hook) P_ ((void));
+
+extern void (*reset_terminal_modes_hook) P_ ((void));
+extern void (*set_terminal_modes_hook) P_ ((void));
+extern void (*update_begin_hook) P_ ((struct frame *));
+extern void (*update_end_hook) P_ ((struct frame *));
+extern void (*set_terminal_window_hook) P_ ((int));
+
+
+
+/* Multi-frame and mouse support hooks. */
enum scroll_bar_part {
scroll_bar_above_handle,
@@ -43,12 +73,131 @@ enum scroll_bar_part {
scroll_bar_move_ratio
};
+/* Return the current position of the mouse.
+
+ Set *f to the frame the mouse is in, or zero if the mouse is in no
+ Emacs frame. If it is set to zero, all the other arguments are
+ garbage.
+
+ If the motion started in a scroll bar, set *bar_window to the
+ scroll bar's window, *part to the part the mouse is currently over,
+ *x to the position of the mouse along the scroll bar, and *y to the
+ overall length of the scroll bar.
+
+ Otherwise, set *bar_window to Qnil, and *x and *y to the column and
+ row of the character cell the mouse is over.
+
+ Set *time to the time the mouse was at the returned position.
+
+ This should clear mouse_moved until the next motion
+ event arrives. */
+extern void (*mouse_position_hook) P_ ((struct frame **f, int,
+ Lisp_Object *bar_window,
+ enum scroll_bar_part *part,
+ Lisp_Object *x,
+ Lisp_Object *y,
+ unsigned long *time));
+
+/* The window system handling code should set this if the mouse has
+ moved since the last call to the mouse_position_hook. Calling that
+ hook should clear this. */
+extern int mouse_moved;
+
+/* When a frame's focus redirection is changed, this hook tells the
+ window system code to re-decide where to put the highlight. Under
+ X, this means that Emacs lies about where the focus is. */
+extern void (*frame_rehighlight_hook) P_ ((struct frame *));
+
+/* If we're displaying frames using a window system that can stack
+ frames on top of each other, this hook allows you to bring a frame
+ to the front, or bury it behind all the other windows. If this
+ hook is zero, that means the device we're displaying on doesn't
+ support overlapping frames, so there's no need to raise or lower
+ anything.
+
+ If RAISE is non-zero, F is brought to the front, before all other
+ windows. If RAISE is zero, F is sent to the back, behind all other
+ windows. */
+extern void (*frame_raise_lower_hook) P_ ((struct frame *f, int raise));
+
/* If the value of the frame parameter changed, whis hook is called.
For example, if going from fullscreen to not fullscreen this hook
may do something OS dependent, like extended window manager hints on X11. */
extern void (*fullscreen_hook) P_ ((struct frame *f));
+/* Scroll bar hooks. */
+
+/* The representation of scroll bars is determined by the code which
+ implements them, except for one thing: they must be represented by
+ lisp objects. This allows us to place references to them in
+ Lisp_Windows without worrying about those references becoming
+ dangling references when the scroll bar is destroyed.
+
+ The window-system-independent portion of Emacs just refers to
+ scroll bars via their windows, and never looks inside the scroll bar
+ representation; it always uses hook functions to do all the
+ scroll bar manipulation it needs.
+
+ The `vertical_scroll_bar' field of a Lisp_Window refers to that
+ window's scroll bar, or is nil if the window doesn't have a
+ scroll bar.
+
+ The `scroll_bars' and `condemned_scroll_bars' fields of a Lisp_Frame
+ are free for use by the scroll bar implementation in any way it sees
+ fit. They are marked by the garbage collector. */
+
+
+/* Set the vertical scroll bar for WINDOW to have its upper left corner
+ at (TOP, LEFT), and be LENGTH rows high. Set its handle to
+ indicate that we are displaying PORTION characters out of a total
+ of WHOLE characters, starting at POSITION. If WINDOW doesn't yet
+ have a scroll bar, create one for it. */
+extern void (*set_vertical_scroll_bar_hook)
+ P_ ((struct window *window,
+ int portion, int whole, int position));
+
+
+/* The following three hooks are used when we're doing a thorough
+ redisplay of the frame. We don't explicitly know which scroll bars
+ are going to be deleted, because keeping track of when windows go
+ away is a real pain - can you say set-window-configuration?
+ Instead, we just assert at the beginning of redisplay that *all*
+ scroll bars are to be removed, and then save scroll bars from the
+ fiery pit when we actually redisplay their window. */
+
+/* Arrange for all scroll bars on FRAME to be removed at the next call
+ to `*judge_scroll_bars_hook'. A scroll bar may be spared if
+ `*redeem_scroll_bar_hook' is applied to its window before the judgement.
+
+ This should be applied to each frame each time its window tree is
+ redisplayed, even if it is not displaying scroll bars at the moment;
+ if the HAS_SCROLL_BARS flag has just been turned off, only calling
+ this and the judge_scroll_bars_hook will get rid of them.
+
+ If non-zero, this hook should be safe to apply to any frame,
+ whether or not it can support scroll bars, and whether or not it is
+ currently displaying them. */
+extern void (*condemn_scroll_bars_hook) P_ ((struct frame *frame));
+
+/* Unmark WINDOW's scroll bar for deletion in this judgement cycle.
+ Note that it's okay to redeem a scroll bar that is not condemned. */
+extern void (*redeem_scroll_bar_hook) P_ ((struct window *window));
+
+/* Remove all scroll bars on FRAME that haven't been saved since the
+ last call to `*condemn_scroll_bars_hook'.
+
+ This should be applied to each frame after each time its window
+ tree is redisplayed, even if it is not displaying scroll bars at the
+ moment; if the HAS_SCROLL_BARS flag has just been turned off, only
+ calling this and condemn_scroll_bars_hook will get rid of them.
+
+ If non-zero, this hook should be safe to apply to any frame,
+ whether or not it can support scroll bars, and whether or not it is
+ currently displaying them. */
+extern void (*judge_scroll_bars_hook) P_ ((struct frame *FRAME));
+
+
/* Input queue declarations and hooks. */
/* Expedient hack: only provide the below definitions to files that
@@ -109,9 +258,6 @@ enum event_kind
the wheel event occurred in.
.timestamp gives a timestamp (in
milliseconds) for the event. */
- HORIZ_WHEEL_EVENT, /* A wheel event generated by a second
- horizontal wheel that is present on some
- mice. See WHEEL_EVENT. */
#if defined (WINDOWSNT) || defined (MAC_OS)
LANGUAGE_CHANGE_EVENT, /* A LANGUAGE_CHANGE_EVENT is
generated on WINDOWSNT or Mac OS
@@ -185,7 +331,7 @@ enum event_kind
/* Queued from XTread_socket when session manager sends
save yourself before shutdown. */
- SAVE_SESSION_EVENT
+ SAVE_SESSION_EVENT,
#ifdef MAC_OS
/* Generated when an Apple event, a HICommand event, or a Services
@@ -194,11 +340,11 @@ enum event_kind
symbols, respectively. Member `arg' is a Lisp object converted
from the received Apple event. Parameters for non-Apple events
are converted to those in Apple events. */
- , MAC_APPLE_EVENT
+ MAC_APPLE_EVENT,
#endif
#ifdef HAVE_GPM
- , GPM_CLICK_EVENT
+ GPM_CLICK_EVENT
#endif
};
@@ -248,6 +394,13 @@ struct input_event
#define EVENT_INIT(event) bzero (&(event), sizeof (struct input_event))
+/* Called to read input events. */
+extern int (*read_socket_hook) P_ ((int, int, struct input_event *));
+
+/* Called when a frame's display becomes entirely up to date. */
+extern void (*frame_up_to_date_hook) P_ ((struct frame *));
+
+
/* Bits in the modifiers member of the input_event structure.
Note that reorder_modifiers assumes that the bits are in canonical
order.
@@ -299,350 +452,14 @@ enum {
#ifdef HAVE_GPM
#include <gpm.h>
-extern int handle_one_term_event (struct tty_display_info *, Gpm_Event *, struct input_event *);
+extern int handle_one_term_event (Gpm_Event *, struct input_event *);
extern void term_mouse_moveto (int, int);
-/* The device for which we have enabled gpm support. */
-extern struct tty_display_info *gpm_tty;
-#endif
-
-#endif /* CONSP */
-
-
-struct mac_display_info;
-struct w32_display_info;
-
-/* Terminal-local parameters. */
-struct terminal
-{
- /* The first two fields are really the header of a vector */
- /* The terminal code does not refer to them. */
- EMACS_UINT size;
- struct Lisp_Vector *vec_next;
-
- /* Parameter alist of this terminal. */
- Lisp_Object param_alist;
-
- /* All fields before `next_terminal' should be Lisp_Object and are traced
- by the GC. All fields afterwards are ignored by the GC. */
-
- /* Chain of all terminal devices. */
- struct terminal *next_terminal;
-
- /* Unique id for this terminal device. */
- int id;
-
- /* The number of frames that are on this terminal. */
- int reference_count;
-
- /* The type of the terminal device. */
- enum output_method type;
-
- /* The name of the terminal device. Do not use this to uniquely
- identify a terminal; the same device may be opened multiple
- times. */
- char *name;
-
-#ifdef MULTI_KBOARD
- /* The terminal's keyboard object. */
- struct kboard *kboard;
-#endif
-
- /* Device-type dependent data shared amongst all frames on this terminal. */
- union display_info
- {
- struct tty_display_info *tty; /* termchar.h */
- struct x_display_info *x; /* xterm.h */
- struct w32_display_info *w32; /* w32term.h */
- struct mac_display_info *mac; /* macterm.h */
- } display_info;
-
-
- /* Coding-system to be used for encoding terminal output. This
- structure contains information of a coding-system specified by
- the function `set-terminal-coding-system'. Also see
- `safe_terminal_coding' in coding.h. */
- struct coding_system *terminal_coding;
-
- /* Coding-system of what is sent from terminal keyboard. This
- structure contains information of a coding-system specified by
- the function `set-keyboard-coding-system'. */
- struct coding_system *keyboard_coding;
-
- /* Terminal characteristics. */
- /* XXX Are these really used on non-termcap displays? */
-
- int must_write_spaces; /* Nonzero means spaces in the text must
- actually be output; can't just skip over
- some columns to leave them blank. */
- int fast_clear_end_of_line; /* Nonzero means terminal has a `ce' string */
-
- int line_ins_del_ok; /* Terminal can insert and delete lines */
- int char_ins_del_ok; /* Terminal can insert and delete chars */
- int scroll_region_ok; /* Terminal supports setting the scroll
- window */
- int scroll_region_cost; /* Cost of setting the scroll window,
- measured in characters. */
- int memory_below_frame; /* Terminal remembers lines scrolled
- off bottom */
-
-#if 0 /* These are not used anywhere. */
- /* EMACS_INT baud_rate; */ /* Output speed in baud */
- int min_padding_speed; /* Speed below which no padding necessary. */
- int dont_calculate_costs; /* Nonzero means don't bother computing
- various cost tables; we won't use them. */
+/* Nonzero means mouse is enabled on Linux console */
+extern int term_gpm;
#endif
-
- /* Window-based redisplay interface for this device (0 for tty
- devices). */
- struct redisplay_interface *rif;
-
- /* Frame-based redisplay interface. */
-
- /* Text display hooks. */
-
- void (*cursor_to_hook) P_ ((struct frame *f, int vpos, int hpos));
- void (*raw_cursor_to_hook) P_ ((struct frame *, int, int));
-
- void (*clear_to_end_hook) P_ ((struct frame *));
- void (*clear_frame_hook) P_ ((struct frame *));
- void (*clear_end_of_line_hook) P_ ((struct frame *, int));
-
- void (*ins_del_lines_hook) P_ ((struct frame *f, int, int));
-
- void (*insert_glyphs_hook) P_ ((struct frame *f, struct glyph *s, int n));
- void (*write_glyphs_hook) P_ ((struct frame *f, struct glyph *s, int n));
- void (*delete_glyphs_hook) P_ ((struct frame *, int));
-
- void (*ring_bell_hook) P_ ((struct frame *f));
-
- void (*reset_terminal_modes_hook) P_ ((struct terminal *));
- void (*set_terminal_modes_hook) P_ ((struct terminal *));
-
- void (*update_begin_hook) P_ ((struct frame *));
- void (*update_end_hook) P_ ((struct frame *));
- void (*set_terminal_window_hook) P_ ((struct frame *, int));
-
- /* Multi-frame and mouse support hooks. */
-
- /* Return the current position of the mouse.
-
- Set *f to the frame the mouse is in, or zero if the mouse is in no
- Emacs frame. If it is set to zero, all the other arguments are
- garbage.
-
- If the motion started in a scroll bar, set *bar_window to the
- scroll bar's window, *part to the part the mouse is currently over,
- *x to the position of the mouse along the scroll bar, and *y to the
- overall length of the scroll bar.
-
- Otherwise, set *bar_window to Qnil, and *x and *y to the column and
- row of the character cell the mouse is over.
-
- Set *time to the time the mouse was at the returned position.
-
- This should clear mouse_moved until the next motion
- event arrives. */
- void (*mouse_position_hook) P_ ((struct frame **f, int,
- Lisp_Object *bar_window,
- enum scroll_bar_part *part,
- Lisp_Object *x,
- Lisp_Object *y,
- unsigned long *time));
-
- /* The window system handling code should set this if the mouse has
- moved since the last call to the mouse_position_hook. Calling that
- hook should clear this. */
- int mouse_moved;
-
- /* When a frame's focus redirection is changed, this hook tells the
- window system code to re-decide where to put the highlight. Under
- X, this means that Emacs lies about where the focus is. */
- void (*frame_rehighlight_hook) P_ ((struct frame *));
-
- /* If we're displaying frames using a window system that can stack
- frames on top of each other, this hook allows you to bring a frame
- to the front, or bury it behind all the other windows. If this
- hook is zero, that means the terminal we're displaying on doesn't
- support overlapping frames, so there's no need to raise or lower
- anything.
-
- If RAISE is non-zero, F is brought to the front, before all other
- windows. If RAISE is zero, F is sent to the back, behind all other
- windows. */
- void (*frame_raise_lower_hook) P_ ((struct frame *f, int raise));
-
- /* If the value of the frame parameter changed, whis hook is called.
- For example, if going from fullscreen to not fullscreen this hook
- may do something OS dependent, like extended window manager hints on X11. */
- void (*fullscreen_hook) P_ ((struct frame *f));
-
-
- /* Scroll bar hooks. */
-
- /* The representation of scroll bars is determined by the code which
- implements them, except for one thing: they must be represented by
- lisp objects. This allows us to place references to them in
- Lisp_Windows without worrying about those references becoming
- dangling references when the scroll bar is destroyed.
-
- The window-system-independent portion of Emacs just refers to
- scroll bars via their windows, and never looks inside the scroll bar
- representation; it always uses hook functions to do all the
- scroll bar manipulation it needs.
-
- The `vertical_scroll_bar' field of a Lisp_Window refers to that
- window's scroll bar, or is nil if the window doesn't have a
- scroll bar.
-
- The `scroll_bars' and `condemned_scroll_bars' fields of a Lisp_Frame
- are free for use by the scroll bar implementation in any way it sees
- fit. They are marked by the garbage collector. */
-
-
- /* Set the vertical scroll bar for WINDOW to have its upper left corner
- at (TOP, LEFT), and be LENGTH rows high. Set its handle to
- indicate that we are displaying PORTION characters out of a total
- of WHOLE characters, starting at POSITION. If WINDOW doesn't yet
- have a scroll bar, create one for it. */
- void (*set_vertical_scroll_bar_hook) P_ ((struct window *window,
- int portion, int whole,
- int position));
-
-
- /* The following three hooks are used when we're doing a thorough
- redisplay of the frame. We don't explicitly know which scroll bars
- are going to be deleted, because keeping track of when windows go
- away is a real pain - can you say set-window-configuration?
- Instead, we just assert at the beginning of redisplay that *all*
- scroll bars are to be removed, and then save scroll bars from the
- fiery pit when we actually redisplay their window. */
-
- /* Arrange for all scroll bars on FRAME to be removed at the next call
- to `*judge_scroll_bars_hook'. A scroll bar may be spared if
- `*redeem_scroll_bar_hook' is applied to its window before the judgement.
-
- This should be applied to each frame each time its window tree is
- redisplayed, even if it is not displaying scroll bars at the moment;
- if the HAS_SCROLL_BARS flag has just been turned off, only calling
- this and the judge_scroll_bars_hook will get rid of them.
-
- If non-zero, this hook should be safe to apply to any frame,
- whether or not it can support scroll bars, and whether or not it is
- currently displaying them. */
- void (*condemn_scroll_bars_hook) P_ ((struct frame *frame));
-
- /* Unmark WINDOW's scroll bar for deletion in this judgement cycle.
- Note that it's okay to redeem a scroll bar that is not condemned. */
- void (*redeem_scroll_bar_hook) P_ ((struct window *window));
-
- /* Remove all scroll bars on FRAME that haven't been saved since the
- last call to `*condemn_scroll_bars_hook'.
-
- This should be applied to each frame after each time its window
- tree is redisplayed, even if it is not displaying scroll bars at the
- moment; if the HAS_SCROLL_BARS flag has just been turned off, only
- calling this and condemn_scroll_bars_hook will get rid of them.
-
- If non-zero, this hook should be safe to apply to any frame,
- whether or not it can support scroll bars, and whether or not it is
- currently displaying them. */
- void (*judge_scroll_bars_hook) P_ ((struct frame *FRAME));
-
-
- /* Called to read input events.
-
- TERMINAL indicates which terminal device to read from. Input
- events should be read into BUF, the size of which is given in
- SIZE. EXPECTED is non-zero if the caller suspects that new input
- is available.
-
- A positive return value indicates that that many input events
- where read into BUF.
- Zero means no events were immediately available.
- A value of -1 means a transient read error, while -2 indicates
- that the device was closed (hangup), and it should be deleted.
-
- XXX Please note that a non-zero value of EXPECTED only means that
- there is available input on at least one of the currently opened
- terminal devices -- but not necessarily on this device.
- Therefore, in most cases EXPECTED should be simply ignored.
-
- XXX This documentation needs to be updated. */
- int (*read_socket_hook) P_ ((struct terminal *terminal,
- int expected,
- struct input_event *hold_quit));
-
- /* Called when a frame's display becomes entirely up to date. */
- void (*frame_up_to_date_hook) P_ ((struct frame *));
-
-
- /* Called to delete the device-specific portions of a frame that is
- on this terminal device. */
- void (*delete_frame_hook) P_ ((struct frame *));
-
- /* Called after the last frame on this terminal is deleted, or when
- the display device was closed (hangup).
-
- If this is NULL, then the generic delete_terminal is called
- instead. Otherwise the hook must call delete_terminal itself.
-
- The hook must check for and close any live frames that are still
- on the terminal. Fdelete_frame ensures that there are no live
- frames on the terminal when it calls this hook, so infinite
- recursion is prevented. */
- void (*delete_terminal_hook) P_ ((struct terminal *));
-};
-
-
-/* Chain of all terminal devices currently in use. */
-extern struct terminal *terminal_list;
-
-#define FRAME_MUST_WRITE_SPACES(f) ((f)->terminal->must_write_spaces)
-#define FRAME_FAST_CLEAR_END_OF_LINE(f) ((f)->terminal->fast_clear_end_of_line)
-#define FRAME_LINE_INS_DEL_OK(f) ((f)->terminal->line_ins_del_ok)
-#define FRAME_CHAR_INS_DEL_OK(f) ((f)->terminal->char_ins_del_ok)
-#define FRAME_SCROLL_REGION_OK(f) ((f)->terminal->scroll_region_ok)
-#define FRAME_SCROLL_REGION_COST(f) ((f)->terminal->scroll_region_cost)
-#define FRAME_MEMORY_BELOW_FRAME(f) ((f)->terminal->memory_below_frame)
-
-#define FRAME_TERMINAL_CODING(f) ((f)->terminal->terminal_coding)
-#define FRAME_KEYBOARD_CODING(f) ((f)->terminal->keyboard_coding)
-
-#define TERMINAL_TERMINAL_CODING(d) ((d)->terminal_coding)
-#define TERMINAL_KEYBOARD_CODING(d) ((d)->keyboard_coding)
-
-#define FRAME_RIF(f) ((f)->terminal->rif)
-
-#define FRAME_TERMINAL(f) ((f)->terminal)
-
-/* FRAME_WINDOW_P tests whether the frame is a window, and is
- defined to be the predicate for the window system being used. */
-
-#ifdef HAVE_X_WINDOWS
-#define FRAME_WINDOW_P(f) FRAME_X_P (f)
#endif
-#ifdef HAVE_NTGUI
-#define FRAME_WINDOW_P(f) FRAME_W32_P (f)
-#endif
-#ifdef MAC_OS
-#define FRAME_WINDOW_P(f) FRAME_MAC_P (f)
-#endif
-#ifndef FRAME_WINDOW_P
-#define FRAME_WINDOW_P(f) (0)
-#endif
-
-/* Return true if the terminal device is not suspended. */
-#define TERMINAL_ACTIVE_P(d) ((d)->type != output_termcap || (d)->display_info.tty->input)
-
-extern Lisp_Object get_terminal_param P_ ((struct terminal *, Lisp_Object));
-extern struct terminal *get_terminal P_ ((Lisp_Object terminal, int));
-extern struct terminal *create_terminal P_ ((void));
-extern void delete_terminal P_ ((struct terminal *));
-
-/* The initial terminal device, created by initial_term_init. */
-extern struct terminal *initial_terminal;
/* arch-tag: 33a00ecc-52b5-4186-a410-8801ac9f087d
(do not change this comment) */
diff --git a/src/terminal.c b/src/terminal.c
deleted file mode 100644
index 46ffb3c2dc..0000000000
--- a/src/terminal.c
+++ /dev/null
@@ -1,566 +0,0 @@
-/* Functions related to terminal devices.
- Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
-
-This file is part of GNU Emacs.
-
-GNU Emacs is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 3, or (at your option)
-any later version.
-
-GNU Emacs is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Emacs; see the file COPYING. If not, write to
-the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-Boston, MA 02110-1301, USA. */
-
-#include <config.h>
-#include <stdio.h>
-
-#include "lisp.h"
-#include "frame.h"
-#include "termchar.h"
-#include "termhooks.h"
-#include "charset.h"
-#include "coding.h"
-#include "keyboard.h"
-
-/* Chain of all terminals currently in use. */
-struct terminal *terminal_list;
-
-/* The first unallocated terminal id. */
-static int next_terminal_id;
-
-/* The initial terminal device, created by initial_term_init. */
-struct terminal *initial_terminal;
-
-/* Function to use to ring the bell. */
-Lisp_Object Vring_bell_function;
-
-static void delete_initial_terminal P_ ((struct terminal *));
-
-
-
-void
-ring_bell (struct frame *f)
-{
- if (!NILP (Vring_bell_function))
- {
- Lisp_Object function;
-
- /* Temporarily set the global variable to nil
- so that if we get an error, it stays nil
- and we don't call it over and over.
-
- We don't specbind it, because that would carefully
- restore the bad value if there's an error
- and make the loop of errors happen anyway. */
-
- function = Vring_bell_function;
- Vring_bell_function = Qnil;
-
- call0 (function);
-
- Vring_bell_function = function;
- }
- else if (FRAME_TERMINAL (f)->ring_bell_hook)
- (*FRAME_TERMINAL (f)->ring_bell_hook) (f);
-}
-
-void
-update_begin (struct frame *f)
-{
- if (FRAME_TERMINAL (f)->update_begin_hook)
- (*FRAME_TERMINAL (f)->update_begin_hook) (f);
-}
-
-void
-update_end (struct frame *f)
-{
- if (FRAME_TERMINAL (f)->update_end_hook)
- (*FRAME_TERMINAL (f)->update_end_hook) (f);
-}
-
-/* Specify how many text lines, from the top of the window,
- should be affected by insert-lines and delete-lines operations.
- This, and those operations, are used only within an update
- that is bounded by calls to update_begin and update_end. */
-
-void
-set_terminal_window (struct frame *f, int size)
-{
- if (FRAME_TERMINAL (f)->set_terminal_window_hook)
- (*FRAME_TERMINAL (f)->set_terminal_window_hook) (f, size);
-}
-
-/* Move cursor to row/column position VPOS/HPOS. HPOS/VPOS are
- frame-relative coordinates. */
-
-void
-cursor_to (struct frame *f, int vpos, int hpos)
-{
- if (FRAME_TERMINAL (f)->cursor_to_hook)
- (*FRAME_TERMINAL (f)->cursor_to_hook) (f, vpos, hpos);
-}
-
-/* Similar but don't take any account of the wasted characters. */
-
-void
-raw_cursor_to (struct frame *f, int row, int col)
-{
- if (FRAME_TERMINAL (f)->raw_cursor_to_hook)
- (*FRAME_TERMINAL (f)->raw_cursor_to_hook) (f, row, col);
-}
-
-/* Erase operations */
-
-/* Clear from cursor to end of frame. */
-void
-clear_to_end (struct frame *f)
-{
- if (FRAME_TERMINAL (f)->clear_to_end_hook)
- (*FRAME_TERMINAL (f)->clear_to_end_hook) (f);
-}
-
-/* Clear entire frame */
-
-void
-clear_frame (struct frame *f)
-{
- if (FRAME_TERMINAL (f)->clear_frame_hook)
- (*FRAME_TERMINAL (f)->clear_frame_hook) (f);
-}
-
-/* Clear from cursor to end of line.
- Assume that the line is already clear starting at column first_unused_hpos.
-
- Note that the cursor may be moved, on terminals lacking a `ce' string. */
-
-void
-clear_end_of_line (struct frame *f, int first_unused_hpos)
-{
- if (FRAME_TERMINAL (f)->clear_end_of_line_hook)
- (*FRAME_TERMINAL (f)->clear_end_of_line_hook) (f, first_unused_hpos);
-}
-
-/* Output LEN glyphs starting at STRING at the nominal cursor position.
- Advance the nominal cursor over the text. */
-
-void
-write_glyphs (struct frame *f, struct glyph *string, int len)
-{
- if (FRAME_TERMINAL (f)->write_glyphs_hook)
- (*FRAME_TERMINAL (f)->write_glyphs_hook) (f, string, len);
-}
-
-/* Insert LEN glyphs from START at the nominal cursor position.
-
- If start is zero, insert blanks instead of a string at start */
-
-void
-insert_glyphs (struct frame *f, struct glyph *start, int len)
-{
- if (len <= 0)
- return;
-
- if (FRAME_TERMINAL (f)->insert_glyphs_hook)
- (*FRAME_TERMINAL (f)->insert_glyphs_hook) (f, start, len);
-}
-
-/* Delete N glyphs at the nominal cursor position. */
-
-void
-delete_glyphs (struct frame *f, int n)
-{
- if (FRAME_TERMINAL (f)->delete_glyphs_hook)
- (*FRAME_TERMINAL (f)->delete_glyphs_hook) (f, n);
-}
-
-/* Insert N lines at vpos VPOS. If N is negative, delete -N lines. */
-
-void
-ins_del_lines (struct frame *f, int vpos, int n)
-{
- if (FRAME_TERMINAL (f)->ins_del_lines_hook)
- (*FRAME_TERMINAL (f)->ins_del_lines_hook) (f, vpos, n);
-}
-
-
-
-
-/* Return the terminal object specified by TERMINAL. TERMINAL may be a
- terminal id, a frame, or nil for the terminal device of the current
- frame. If THROW is zero, return NULL for failure, otherwise throw
- an error. */
-
-struct terminal *
-get_terminal (Lisp_Object terminal, int throw)
-{
- struct terminal *result = NULL;
-
- if (NILP (terminal))
- terminal = selected_frame;
-
- if (TERMINALP (terminal))
- result = XTERMINAL (terminal);
-
- else if (FRAMEP (terminal))
- {
- result = FRAME_TERMINAL (XFRAME (terminal));
- }
-
- if (result && !result->name)
- result = NULL;
-
- if (result == NULL && throw)
- wrong_type_argument (Qterminal_live_p, terminal);
-
- return result;
-}
-
-
-
-/* Create a new terminal object and add it to the terminal list. */
-
-struct terminal *
-create_terminal (void)
-{
- struct terminal *terminal = allocate_terminal ();
-
- terminal->name = NULL;
- terminal->next_terminal = terminal_list;
- terminal_list = terminal;
-
- terminal->id = next_terminal_id++;
-
- terminal->keyboard_coding =
- (struct coding_system *) xmalloc (sizeof (struct coding_system));
- terminal->terminal_coding =
- (struct coding_system *) xmalloc (sizeof (struct coding_system));
-
- setup_coding_system (Qnil, terminal->keyboard_coding);
- setup_coding_system (Qnil, terminal->terminal_coding);
-
- terminal->param_alist = Qnil;
- return terminal;
-}
-
-/* Low-level function to close all frames on a terminal, remove it
- from the terminal list and free its memory. */
-
-void
-delete_terminal (struct terminal *terminal)
-{
- struct terminal **tp;
- Lisp_Object tail, frame;
-
- /* Protect against recursive calls. Fdelete_frame calls the
- delete_terminal_hook when we delete our last frame. */
- if (!terminal->name)
- return;
- xfree (terminal->name);
- terminal->name = NULL;
-
- /* Check for live frames that are still on this terminal. */
- FOR_EACH_FRAME (tail, frame)
- {
- struct frame *f = XFRAME (frame);
- if (FRAME_LIVE_P (f) && f->terminal == terminal)
- {
- Fdelete_frame (frame, Qt);
- }
- }
-
- for (tp = &terminal_list; *tp != terminal; tp = &(*tp)->next_terminal)
- if (! *tp)
- abort ();
- *tp = terminal->next_terminal;
-
- xfree (terminal->keyboard_coding);
- terminal->keyboard_coding = NULL;
- xfree (terminal->terminal_coding);
- terminal->terminal_coding = NULL;
-
-#ifdef MULTI_KBOARD
- if (terminal->kboard && --terminal->kboard->reference_count == 0)
- {
- delete_kboard (terminal->kboard);
- terminal->kboard = NULL;
- }
-#endif
-}
-
-DEFUN ("delete-terminal", Fdelete_terminal, Sdelete_terminal, 0, 2, 0,
- doc: /* Delete TERMINAL by deleting all frames on it and closing the terminal.
-TERMINAL may be a terminal id, a frame, or nil (meaning the selected
-frame's terminal).
-
-Normally, you may not delete a display if all other displays are suspended,
-but if the second argument FORCE is non-nil, you may do so. */)
- (terminal, force)
- Lisp_Object terminal, force;
-{
- struct terminal *t, *p;
-
- t = get_terminal (terminal, 0);
-
- if (!t)
- return Qnil;
-
- p = terminal_list;
- while (p && (p == t || !TERMINAL_ACTIVE_P (p)))
- p = p->next_terminal;
-
- if (NILP (force) && !p)
- error ("Attempt to delete the sole active display terminal");
-
- if (t->delete_terminal_hook)
- (*t->delete_terminal_hook) (t);
- else
- delete_terminal (t);
-
- return Qnil;
-}
-
-
-DEFUN ("frame-terminal", Fframe_terminal, Sframe_terminal, 0, 1, 0,
- doc: /* Return the terminal that FRAME is displayed on.
-If FRAME is nil, the selected frame is used.
-
-The terminal device is represented by its integer identifier. */)
- (frame)
- Lisp_Object frame;
-{
- struct terminal *t;
-
- if (NILP (frame))
- frame = selected_frame;
-
- CHECK_LIVE_FRAME (frame);
-
- t = FRAME_TERMINAL (XFRAME (frame));
-
- if (!t)
- return Qnil;
- else
- {
- Lisp_Object terminal;
- XSETTERMINAL (terminal, t);
- return terminal;
- }
-}
-
-DEFUN ("terminal-live-p", Fterminal_live_p, Sterminal_live_p, 1, 1, 0,
- doc: /* Return non-nil if OBJECT is a terminal which has not been deleted.
-Value is nil if OBJECT is not a live display terminal.
-If object is a live display terminal, the return value indicates what
-sort of output terminal it uses. See the documentation of `framep' for
-possible return values. */)
- (object)
- Lisp_Object object;
-{
- struct terminal *t;
-
- t = get_terminal (object, 0);
-
- if (!t)
- return Qnil;
-
- switch (t->type)
- {
- case output_initial: /* The initial frame is like a termcap frame. */
- case output_termcap:
- return Qt;
- case output_x_window:
- return Qx;
- case output_w32:
- return Qw32;
- case output_msdos_raw:
- return Qpc;
- case output_mac:
- return Qmac;
- default:
- abort ();
- }
-}
-
-DEFUN ("terminal-list", Fterminal_list, Sterminal_list, 0, 0, 0,
- doc: /* Return a list of all terminal devices. */)
- ()
-{
- Lisp_Object terminal, terminals = Qnil;
- struct terminal *t;
-
- for (t = terminal_list; t; t = t->next_terminal)
- {
- XSETTERMINAL (terminal, t);
- terminals = Fcons (terminal, terminals);
- }
-
- return terminals;
-}
-
-DEFUN ("terminal-name", Fterminal_name, Sterminal_name, 0, 1, 0,
- doc: /* Return the name of the terminal device TERMINAL.
-It is not guaranteed that the returned value is unique among opened devices.
-
-TERMINAL may be a terminal id, a frame, or nil (meaning the
-selected frame's terminal). */)
- (terminal)
- Lisp_Object terminal;
-{
- struct terminal *t
- = TERMINALP (terminal) ? XTERMINAL (terminal) : get_terminal (terminal, 1);
-
- return t->name ? build_string (t->name) : Qnil;
-}
-
-
-
-/* Return the value of terminal parameter PARAM in terminal T. */
-Lisp_Object
-get_terminal_param (t, param)
- struct terminal *t;
- Lisp_Object param;
-{
- Lisp_Object tem = Fassq (param, t->param_alist);
- if (EQ (tem, Qnil))
- return tem;
- return Fcdr (tem);
-}
-
-/* Set the value of terminal parameter PARAMETER in terminal D to VALUE.
- Return the previous value. */
-
-Lisp_Object
-store_terminal_param (t, parameter, value)
- struct terminal *t;
- Lisp_Object parameter;
- Lisp_Object value;
-{
- Lisp_Object old_alist_elt = Fassq (parameter, t->param_alist);
- if (EQ (old_alist_elt, Qnil))
- {
- t->param_alist = Fcons (Fcons (parameter, value), t->param_alist);
- return Qnil;
- }
- else
- {
- Lisp_Object result = Fcdr (old_alist_elt);
- Fsetcdr (old_alist_elt, value);
- return result;
- }
-}
-
-
-DEFUN ("terminal-parameters", Fterminal_parameters, Sterminal_parameters, 0, 1, 0,
- doc: /* Return the parameter-alist of terminal TERMINAL.
-The value is a list of elements of the form (PARM . VALUE), where PARM
-is a symbol.
-
-TERMINAL can be a terminal id, a frame or nil (meaning the selected
-frame's terminal). */)
- (terminal)
- Lisp_Object terminal;
-{
- struct terminal *t
- = TERMINALP (terminal) ? XTERMINAL (terminal) : get_terminal (terminal, 1);
- return Fcopy_alist (t->param_alist);
-}
-
-DEFUN ("terminal-parameter", Fterminal_parameter, Sterminal_parameter, 2, 2, 0,
- doc: /* Return TERMINAL's value for parameter PARAMETER.
-TERMINAL can be a terminal id, a frame or nil (meaning the selected
-frame's terminal). */)
- (terminal, parameter)
- Lisp_Object terminal;
- Lisp_Object parameter;
-{
- Lisp_Object value;
- struct terminal *t
- = TERMINALP (terminal) ? XTERMINAL (terminal) : get_terminal (terminal, 1);
- CHECK_SYMBOL (parameter);
- value = Fcdr (Fassq (parameter, t->param_alist));
- return value;
-}
-
-DEFUN ("set-terminal-parameter", Fset_terminal_parameter,
- Sset_terminal_parameter, 3, 3, 0,
- doc: /* Set TERMINAL's value for parameter PARAMETER to VALUE.
-Return the previous value of PARAMETER.
-
-TERMINAL can be a terminal id, a frame or nil (meaning the selected
-frame's terminal). */)
- (terminal, parameter, value)
- Lisp_Object terminal;
- Lisp_Object parameter;
- Lisp_Object value;
-{
- struct terminal *t
- = TERMINALP (terminal) ? XTERMINAL (terminal) : get_terminal (terminal, 1);
- return store_terminal_param (t, parameter, value);
-}
-
-
-
-/* Create the bootstrap display terminal for the initial frame.
- Returns a terminal of type output_initial. */
-
-struct terminal *
-init_initial_terminal (void)
-{
- if (initialized || terminal_list || tty_list)
- abort ();
-
- initial_terminal = create_terminal ();
- initial_terminal->type = output_initial;
- initial_terminal->name = xstrdup ("initial_terminal");
-#ifdef MULTI_KBOARD
- initial_terminal->kboard = initial_kboard;
-#endif
- initial_terminal->delete_terminal_hook = &delete_initial_terminal;
- /* All other hooks are NULL. */
-
- return initial_terminal;
-}
-
-/* Deletes the bootstrap terminal device.
- Called through delete_terminal_hook. */
-
-static void
-delete_initial_terminal (struct terminal *terminal)
-{
- if (terminal != initial_terminal)
- abort ();
-
- delete_terminal (terminal);
- initial_terminal = NULL;
-}
-
-void
-syms_of_terminal ()
-{
-
- DEFVAR_LISP ("ring-bell-function", &Vring_bell_function,
- doc: /* Non-nil means call this function to ring the bell.
-The function should accept no arguments. */);
- Vring_bell_function = Qnil;
-
- defsubr (&Sdelete_terminal);
- defsubr (&Sframe_terminal);
- defsubr (&Sterminal_live_p);
- defsubr (&Sterminal_list);
- defsubr (&Sterminal_name);
- defsubr (&Sterminal_parameters);
- defsubr (&Sterminal_parameter);
- defsubr (&Sset_terminal_parameter);
-
- Fprovide (intern ("multi-tty"), Qnil);
-}
-
-/* arch-tag: e9af6f27-b483-47dc-bb1a-730c1c5cab03
- (do not change this comment) */
diff --git a/src/termopts.h b/src/termopts.h
index 5946666654..210236017d 100644
--- a/src/termopts.h
+++ b/src/termopts.h
@@ -41,10 +41,5 @@ extern int meta_key;
/* Nonzero means truncate lines in all windows less wide than the frame */
extern int truncate_partial_width_windows;
-/* Nonzero means no need to redraw the entire frame on resuming a suspended
- Emacs. This is useful on terminals with multiple pages, where one page is
- used for Emacs and another for all else. */
-extern int no_redraw_on_reenter;
-
/* arch-tag: 35d4d284-dc1a-4fff-97fa-0154a21aebdb
(do not change this comment) */
diff --git a/src/w16select.c b/src/w16select.c
index a66fba7d07..80246af8fb 100644
--- a/src/w16select.c
+++ b/src/w16select.c
@@ -39,7 +39,7 @@ Boston, MA 02110-1301, USA. */
#include "frame.h" /* Need this to get the X window of selected_frame */
#include "blockinput.h"
#include "buffer.h"
-#include "charset.h"
+#include "character.h"
#include "coding.h"
#include "composite.h"
diff --git a/src/w32.c b/src/w32.c
index 500e85733b..d7e95aac7d 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -904,6 +904,18 @@ alarm (int seconds)
return 0;
}
+void
+unrequest_sigio (void)
+{
+ return;
+}
+
+void
+request_sigio (void)
+{
+ return;
+}
+
#define REG_ROOT "SOFTWARE\\GNU\\Emacs"
LPBYTE
@@ -927,7 +939,6 @@ w32_get_resource (key, lpdwtype)
&& (lpvalue = (LPBYTE) xmalloc (cbData)) != NULL
&& RegQueryValueEx (hrootkey, key, NULL, lpdwtype, lpvalue, &cbData) == ERROR_SUCCESS)
{
- RegCloseKey (hrootkey);
return (lpvalue);
}
@@ -944,7 +955,6 @@ w32_get_resource (key, lpdwtype)
&& (lpvalue = (LPBYTE) xmalloc (cbData)) != NULL
&& RegQueryValueEx (hrootkey, key, NULL, lpdwtype, lpvalue, &cbData) == ERROR_SUCCESS)
{
- RegCloseKey (hrootkey);
return (lpvalue);
}
diff --git a/src/w32bdf.c b/src/w32bdf.c
index 80ef098d8d..1ccd7ff242 100644
--- a/src/w32bdf.c
+++ b/src/w32bdf.c
@@ -29,7 +29,7 @@ Boston, MA 02110-1301, USA. */
#endif
#include "lisp.h"
-#include "charset.h"
+#include "character.h"
#include "keyboard.h"
#include "frame.h"
#include "dispextern.h"
@@ -93,7 +93,7 @@ proceed_file_line(char *key, char *start, int *len, char **val, char **next)
return 1;
}
-char*
+static char*
get_quoted_string(char *start, char *end)
{
char *p, *q, *result;
@@ -202,7 +202,7 @@ set_bdf_font_info(bdffont *fontp)
else if (search_file_line("CHARSET_ENCODING", start, len,
(char **)&p, (char **)&q) == 1)
{
- fontp->encoding = get_quoted_string(p, q);
+ fontp->encoding = get_quoted_string(p, q);
}
else if (search_file_line("SLANT", start, len,
(char **)&p, (char **)&q) == 1)
@@ -790,7 +790,7 @@ struct font_info *w32_load_bdf_font (struct frame *f, char *fontname,
uses this font. So, we set informatoin in fontp->encoding[1]
which is never used by any charset. If mapping can't be
decided, set FONT_ENCODING_NOT_DECIDED. */
- fontp->encoding[1] = FONT_ENCODING_NOT_DECIDED;
+ fontp->encoding_type = FONT_ENCODING_NOT_DECIDED;
fontp->baseline_offset = bdf_font->yoffset;
fontp->relative_compose = bdf_font->relative_compose;
fontp->default_ascent = bdf_font->default_ascent;
diff --git a/src/w32console.c b/src/w32console.c
index d8d2a24f81..f828808caf 100644
--- a/src/w32console.c
+++ b/src/w32console.c
@@ -32,15 +32,14 @@ Boston, MA 02110-1301, USA.
#include <string.h>
#include "lisp.h"
-#include "charset.h"
+#include "character.h"
#include "coding.h"
#include "disptab.h"
+#include "termhooks.h"
+#include "dispextern.h"
/* Disable features in frame.h that require a Window System. */
#undef HAVE_WINDOW_SYSTEM
#include "frame.h"
-#include "termhooks.h"
-#include "termchar.h"
-#include "dispextern.h"
#include "w32inevt.h"
/* from window.c */
@@ -52,17 +51,21 @@ extern int detect_input_pending ();
/* from sysdep.c */
extern int read_input_pending ();
-static void w32con_move_cursor (struct frame *f, int row, int col);
-static void w32con_clear_to_end (struct frame *f);
-static void w32con_clear_frame (struct frame *f);
-static void w32con_clear_end_of_line (struct frame *f, int);
-static void w32con_ins_del_lines (struct frame *f, int vpos, int n);
-static void w32con_insert_glyphs (struct frame *f, struct glyph *start, int len);
-static void w32con_write_glyphs (struct frame *f, struct glyph *string, int len);
-static void w32con_delete_glyphs (struct frame *f, int n);
-static void w32con_reset_terminal_modes (struct terminal *t);
-static void w32con_set_terminal_modes (struct terminal *t);
-static void w32con_set_terminal_window (struct frame *f, int size);
+extern struct frame * updating_frame;
+extern int meta_key;
+
+static void w32con_move_cursor (int row, int col);
+static void w32con_clear_to_end (void);
+static void w32con_clear_frame (void);
+static void w32con_clear_end_of_line (int);
+static void w32con_ins_del_lines (int vpos, int n);
+static void w32con_insert_glyphs (struct glyph *start, int len);
+static void w32con_write_glyphs (struct glyph *string, int len);
+static void w32con_delete_glyphs (int n);
+void w32_sys_ring_bell (void);
+static void w32con_reset_terminal_modes (void);
+static void w32con_set_terminal_modes (void);
+static void w32con_set_terminal_window (int size);
static void w32con_update_begin (struct frame * f);
static void w32con_update_end (struct frame * f);
static WORD w32_face_attributes (struct frame *f, int face_id);
@@ -96,31 +99,38 @@ ctrl_c_handler (unsigned long type)
&& (type == CTRL_C_EVENT || type == CTRL_BREAK_EVENT));
}
+/* If we're updating a frame, use it as the current frame
+ Otherwise, use the selected frame. */
+#define PICK_FRAME() (updating_frame ? updating_frame : SELECTED_FRAME ())
-/* Move the cursor to (ROW, COL) on FRAME. */
+/* Move the cursor to (row, col). */
static void
-w32con_move_cursor (struct frame *f, int row, int col)
+w32con_move_cursor (int row, int col)
{
cursor_coords.X = col;
cursor_coords.Y = row;
- /* TODO: for multi-tty support, cur_screen should be replaced with a
- reference to the terminal for this frame. */
- SetConsoleCursorPosition (cur_screen, cursor_coords);
+ if (updating_frame == (struct frame *) NULL)
+ {
+ SetConsoleCursorPosition (cur_screen, cursor_coords);
+ }
}
/* Clear from cursor to end of screen. */
static void
-w32con_clear_to_end (struct frame *f)
+w32con_clear_to_end (void)
{
- w32con_clear_end_of_line (f, FRAME_COLS (f) - 1);
- w32con_ins_del_lines (f, cursor_coords.Y, FRAME_LINES (f) - cursor_coords.Y - 1);
+ struct frame * f = PICK_FRAME ();
+
+ w32con_clear_end_of_line (FRAME_COLS (f) - 1);
+ w32con_ins_del_lines (cursor_coords.Y, FRAME_LINES (f) - cursor_coords.Y - 1);
}
/* Clear the frame. */
static void
-w32con_clear_frame (struct frame *f)
+w32con_clear_frame (void)
{
+ struct frame * f = PICK_FRAME ();
COORD dest;
int n;
DWORD r;
@@ -135,7 +145,7 @@ w32con_clear_frame (struct frame *f)
FillConsoleOutputAttribute (cur_screen, char_attr_normal, n, dest, &r);
FillConsoleOutputCharacter (cur_screen, ' ', n, dest, &r);
- w32con_move_cursor (f, 0, 0);
+ w32con_move_cursor (0, 0);
}
@@ -144,7 +154,7 @@ static BOOL ceol_initialized = FALSE;
/* Clear from Cursor to end (what's "standout marker"?). */
static void
-w32con_clear_end_of_line (struct frame *f, int end)
+w32con_clear_end_of_line (int end)
{
if (!ceol_initialized)
{
@@ -155,17 +165,18 @@ w32con_clear_end_of_line (struct frame *f, int end)
}
ceol_initialized = TRUE;
}
- w32con_write_glyphs (f, glyph_base, end - cursor_coords.X); /* fencepost ? */
+ w32con_write_glyphs (glyph_base, end - cursor_coords.X); /* fencepost ? */
}
/* Insert n lines at vpos. if n is negative delete -n lines. */
static void
-w32con_ins_del_lines (struct frame *f, int vpos, int n)
+w32con_ins_del_lines (int vpos, int n)
{
int i, nb;
SMALL_RECT scroll;
COORD dest;
CHAR_INFO fill;
+ struct frame * f = PICK_FRAME ();
if (n < 0)
{
@@ -202,8 +213,8 @@ w32con_ins_del_lines (struct frame *f, int vpos, int n)
{
for (i = scroll.Bottom; i < dest.Y; i++)
{
- w32con_move_cursor (f, i, 0);
- w32con_clear_end_of_line (f, FRAME_COLS (f));
+ w32con_move_cursor (i, 0);
+ w32con_clear_end_of_line (FRAME_COLS (f));
}
}
}
@@ -215,8 +226,8 @@ w32con_ins_del_lines (struct frame *f, int vpos, int n)
{
for (i = nb; i < scroll.Top; i++)
{
- w32con_move_cursor (f, i, 0);
- w32con_clear_end_of_line (f, FRAME_COLS (f));
+ w32con_move_cursor (i, 0);
+ w32con_clear_end_of_line (FRAME_COLS (f));
}
}
}
@@ -231,13 +242,14 @@ w32con_ins_del_lines (struct frame *f, int vpos, int n)
#define RIGHT 0
static void
-scroll_line (struct frame *f, int dist, int direction)
+scroll_line (int dist, int direction)
{
/* The idea here is to implement a horizontal scroll in one line to
implement delete and half of insert. */
SMALL_RECT scroll;
COORD dest;
CHAR_INFO fill;
+ struct frame * f = PICK_FRAME ();
scroll.Top = cursor_coords.Y;
scroll.Bottom = cursor_coords.Y;
@@ -265,9 +277,9 @@ scroll_line (struct frame *f, int dist, int direction)
/* If start is zero insert blanks instead of a string at start ?. */
static void
-w32con_insert_glyphs (struct frame *f, register struct glyph *start, register int len)
+w32con_insert_glyphs (register struct glyph *start, register int len)
{
- scroll_line (f, len, RIGHT);
+ scroll_line (len, RIGHT);
/* Move len chars to the right starting at cursor_coords, fill with blanks */
if (start)
@@ -275,11 +287,11 @@ w32con_insert_glyphs (struct frame *f, register struct glyph *start, register in
/* Print the first len characters of start, cursor_coords.X adjusted
by write_glyphs. */
- w32con_write_glyphs (f, start, len);
+ w32con_write_glyphs (start, len);
}
else
{
- w32con_clear_end_of_line (f, cursor_coords.X + len);
+ w32con_clear_end_of_line (cursor_coords.X + len);
}
}
@@ -287,11 +299,11 @@ extern unsigned char *encode_terminal_code P_ ((struct glyph *, int,
struct coding_system *));
static void
-w32con_write_glyphs (struct frame *f, register struct glyph *string,
- register int len)
+w32con_write_glyphs (register struct glyph *string, register int len)
{
int produced, consumed;
DWORD r;
+ struct frame * f = PICK_FRAME ();
WORD char_attr;
unsigned char *conversion_buffer;
struct coding_system *coding;
@@ -302,11 +314,11 @@ w32con_write_glyphs (struct frame *f, register struct glyph *string,
/* If terminal_coding does any conversion, use it, otherwise use
safe_terminal_coding. We can't use CODING_REQUIRE_ENCODING here
because it always return 1 if the member src_multibyte is 1. */
- coding = (FRAME_TERMINAL_CODING (f)->common_flags & CODING_REQUIRE_ENCODING_MASK
- ? FRAME_TERMINAL_CODING (f) : &safe_terminal_coding);
+ coding = (terminal_coding.common_flags & CODING_REQUIRE_ENCODING_MASK
+ ? &terminal_coding : &safe_terminal_coding);
/* The mode bit CODING_MODE_LAST_BLOCK should be set to 1 only at
the tail. */
- coding->mode &= ~CODING_MODE_LAST_BLOCK;
+ terminal_coding.mode &= ~CODING_MODE_LAST_BLOCK;
while (len > 0)
{
@@ -348,7 +360,7 @@ w32con_write_glyphs (struct frame *f, register struct glyph *string,
}
cursor_coords.X += coding->produced;
- w32con_move_cursor (f, cursor_coords.Y, cursor_coords.X);
+ w32con_move_cursor (cursor_coords.Y, cursor_coords.X);
}
len -= n;
string += n;
@@ -357,20 +369,20 @@ w32con_write_glyphs (struct frame *f, register struct glyph *string,
static void
-w32con_delete_glyphs (struct frame *f, int n)
+w32con_delete_glyphs (int n)
{
/* delete chars means scroll chars from cursor_coords.X + n to
cursor_coords.X, anything beyond the edge of the screen should
come out empty... */
- scroll_line (f, n, LEFT);
+ scroll_line (n, LEFT);
}
static unsigned int sound_type = 0xFFFFFFFF;
#define MB_EMACS_SILENT (0xFFFFFFFF - 1)
void
-w32_sys_ring_bell (struct frame *f)
+w32_sys_ring_bell (void)
{
if (sound_type == 0xFFFFFFFF)
{
@@ -416,7 +428,7 @@ SOUND is nil to use the normal beep. */)
}
static void
-w32con_reset_terminal_modes (struct terminal *t)
+w32con_reset_terminal_modes (void)
{
#ifdef USE_SEPARATE_SCREEN
SetConsoleActiveScreenBuffer (prev_screen);
@@ -427,7 +439,7 @@ w32con_reset_terminal_modes (struct terminal *t)
}
static void
-w32con_set_terminal_modes (struct terminal *t)
+w32con_set_terminal_modes (void)
{
CONSOLE_CURSOR_INFO cci;
@@ -461,7 +473,7 @@ w32con_update_end (struct frame * f)
}
static void
-w32con_set_terminal_window (struct frame *f, int size)
+w32con_set_terminal_window (int size)
{
}
@@ -535,38 +547,28 @@ vga_stdcolor_name (int idx)
typedef int (*term_hook) ();
void
-initialize_w32_display (struct terminal *term)
+initialize_w32_display (void)
{
CONSOLE_SCREEN_BUFFER_INFO info;
- term->rif = 0; /* No window based redisplay on the console. */
- term->cursor_to_hook = w32con_move_cursor;
- term->raw_cursor_to_hook = w32con_move_cursor;
- term->clear_to_end_hook = w32con_clear_to_end;
- term->clear_frame_hook = w32con_clear_frame;
- term->clear_end_of_line_hook = w32con_clear_end_of_line;
- term->ins_del_lines_hook = w32con_ins_del_lines;
- term->insert_glyphs_hook = w32con_insert_glyphs;
- term->write_glyphs_hook = w32con_write_glyphs;
- term->delete_glyphs_hook = w32con_delete_glyphs;
- term->ring_bell_hook = w32_sys_ring_bell;
- term->reset_terminal_modes_hook = w32con_reset_terminal_modes;
- term->set_terminal_modes_hook = w32con_set_terminal_modes;
- term->set_terminal_window_hook = w32con_set_terminal_window;
- term->update_begin_hook = w32con_update_begin;
- term->update_end_hook = w32con_update_end;
-
- term->read_socket_hook = w32_console_read_socket;
- term->mouse_position_hook = w32_console_mouse_position;
-
- /* The following are not used on the console. */
- term->frame_rehighlight_hook = 0;
- term->frame_raise_lower_hook = 0;
- term->set_vertical_scroll_bar_hook = 0;
- term->condemn_scroll_bars_hook = 0;
- term->redeem_scroll_bar_hook = 0;
- term->judge_scroll_bars_hook = 0;
- term->frame_up_to_date_hook = 0;
+ cursor_to_hook = w32con_move_cursor;
+ raw_cursor_to_hook = w32con_move_cursor;
+ clear_to_end_hook = w32con_clear_to_end;
+ clear_frame_hook = w32con_clear_frame;
+ clear_end_of_line_hook = w32con_clear_end_of_line;
+ ins_del_lines_hook = w32con_ins_del_lines;
+ insert_glyphs_hook = w32con_insert_glyphs;
+ write_glyphs_hook = w32con_write_glyphs;
+ delete_glyphs_hook = w32con_delete_glyphs;
+ ring_bell_hook = w32_sys_ring_bell;
+ reset_terminal_modes_hook = w32con_reset_terminal_modes;
+ set_terminal_modes_hook = w32con_set_terminal_modes;
+ set_terminal_window_hook = w32con_set_terminal_window;
+ update_begin_hook = w32con_update_begin;
+ update_end_hook = w32con_update_end;
+
+ read_socket_hook = w32_console_read_socket;
+ mouse_position_hook = w32_console_mouse_position;
/* Initialize interrupt_handle. */
init_crit ();
@@ -631,6 +633,7 @@ initialize_w32_display (struct terminal *term)
GetConsoleScreenBufferInfo (cur_screen, &info);
+ meta_key = 1;
char_attr_normal = info.wAttributes;
/* Determine if the info returned by GetConsoleScreenBufferInfo
@@ -671,7 +674,6 @@ initialize_w32_display (struct terminal *term)
}
-
DEFUN ("set-screen-color", Fset_screen_color, Sset_screen_color, 2, 2, 0,
doc: /* Set screen colors. */)
(foreground, background)
diff --git a/src/w32fns.c b/src/w32fns.c
index aca888f8b2..6c2beae7d9 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -29,26 +29,26 @@ Boston, MA 02110-1301, USA. */
#include <errno.h>
#include "lisp.h"
-#include "charset.h"
-#include "dispextern.h"
#include "w32term.h"
-#include "keyboard.h"
#include "frame.h"
#include "window.h"
#include "buffer.h"
-#include "fontset.h"
#include "intervals.h"
+#include "dispextern.h"
+#include "keyboard.h"
#include "blockinput.h"
#include "epaths.h"
-#include "w32heap.h"
-#include "termhooks.h"
+#include "character.h"
+#include "charset.h"
#include "coding.h"
#include "ccl.h"
+#include "fontset.h"
#include "systime.h"
+#include "termhooks.h"
+#include "w32heap.h"
#include "bitmaps/gray.xbm"
-#include <commctrl.h>
#include <commdlg.h>
#include <shellapi.h>
#include <ctype.h>
@@ -58,6 +58,10 @@ Boston, MA 02110-1301, USA. */
#include <dlgs.h>
#define FILE_NAME_TEXT_FIELD edt1
+#ifdef USE_FONT_BACKEND
+#include "font.h"
+#endif
+
void syms_of_w32fns ();
void globals_of_w32fns ();
@@ -383,10 +387,10 @@ x_window_to_frame (dpyinfo, wdesc)
Lisp_Object tail, frame;
struct frame *f;
- for (tail = Vframe_list; GC_CONSP (tail); tail = XCDR (tail))
+ for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
{
frame = XCAR (tail);
- if (!GC_FRAMEP (frame))
+ if (!FRAMEP (frame))
continue;
f = XFRAME (frame);
if (!FRAME_W32_P (f) || FRAME_W32_DISPLAY_INFO (f) != dpyinfo)
@@ -1819,8 +1823,10 @@ x_set_tool_bar_lines (f, value, oldval)
below the menu bar. */
if (FRAME_W32_WINDOW (f) && FRAME_TOOL_BAR_LINES (f) == 0)
{
- clear_frame (f);
+ updating_frame = f;
+ clear_frame ();
clear_current_matrices (f);
+ updating_frame = NULL;
}
/* If the tool bar gets smaller, the internal border below it
@@ -2462,8 +2468,8 @@ register_hot_keys (hwnd)
{
Lisp_Object keylist;
- /* Use GC_CONSP, since we are called asynchronously. */
- for (keylist = w32_grabbed_keys; GC_CONSP (keylist); keylist = XCDR (keylist))
+ /* Use CONSP, since we are called asynchronously. */
+ for (keylist = w32_grabbed_keys; CONSP (keylist); keylist = XCDR (keylist))
{
Lisp_Object key = XCAR (keylist);
@@ -2482,8 +2488,7 @@ unregister_hot_keys (hwnd)
{
Lisp_Object keylist;
- /* Use GC_CONSP, since we are called asynchronously. */
- for (keylist = w32_grabbed_keys; GC_CONSP (keylist); keylist = XCDR (keylist))
+ for (keylist = w32_grabbed_keys; CONSP (keylist); keylist = XCDR (keylist))
{
Lisp_Object key = XCAR (keylist);
@@ -3384,20 +3389,16 @@ w32_wnd_proc (hwnd, msg, wParam, lParam)
return 0;
case WM_MOUSEWHEEL:
- case WM_DROPFILES:
wmsg.dwModifiers = w32_get_modifiers ();
my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
signal_user_input ();
return 0;
- case WM_MOUSEHWHEEL:
+ case WM_DROPFILES:
wmsg.dwModifiers = w32_get_modifiers ();
my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
signal_user_input ();
- /* Non-zero must be returned when WM_MOUSEHWHEEL messages are
- handled, to prevent the system trying to handle it by faking
- scroll bar events. */
- return 1;
+ return 0;
case WM_TIMER:
/* Flush out saved messages if necessary. */
@@ -4144,6 +4145,38 @@ unwind_create_frame (frame)
return Qnil;
}
+#ifdef USE_FONT_BACKEND
+static void
+x_default_font_parameter (f, parms)
+ struct frame *f;
+ Lisp_Object parms;
+{
+ struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f);
+ Lisp_Object font = x_get_arg (dpyinfo, parms, Qfont, "font", "Font",
+ RES_TYPE_STRING);
+
+ if (!STRINGP (font))
+ {
+ int i;
+ static char *names[]
+ = { "Courier New-10",
+ "-*-Courier-normal-r-*-*-13-*-*-*-c-*-iso8859-1",
+ "-*-Fixedsys-normal-r-*-*-12-*-*-*-c-*-iso8859-1",
+ "Fixedsys",
+ NULL };
+
+ for (i = 0; names[i]; i++)
+ {
+ font = font_open_by_name (f, names[i]);
+ if (! NILP (font))
+ break;
+ }
+ if (NILP (font))
+ error ("No suitable font was found");
+ }
+ x_default_parameter (f, parms, Qfont, font, "font", "Font", RES_TYPE_STRING);
+}
+#endif
DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame,
1, 1, 0,
@@ -4183,7 +4216,7 @@ This function is an internal primitive--use `make-frame' instead. */)
display = Qnil;
dpyinfo = check_x_display_info (display);
#ifdef MULTI_KBOARD
- kb = dpyinfo->terminal->kboard;
+ kb = dpyinfo->kboard;
#else
kb = &the_only_kboard;
#endif
@@ -4231,9 +4264,6 @@ This function is an internal primitive--use `make-frame' instead. */)
/* By default, make scrollbars the system standard width. */
FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = GetSystemMetrics (SM_CXVSCROLL);
- f->terminal = dpyinfo->terminal;
- f->terminal->reference_count++;
-
f->output_method = output_w32;
f->output_data.w32 =
(struct w32_output *) xmalloc (sizeof (struct w32_output));
@@ -4279,8 +4309,28 @@ This function is an internal primitive--use `make-frame' instead. */)
specbind (Qx_resource_name, name);
}
+ f->resx = dpyinfo->resx;
+ f->resy = dpyinfo->resy;
+
+#ifdef USE_FONT_BACKEND
+ if (enable_font_backend)
+ {
+ /* Perhaps, we must allow frame parameter, say `font-backend',
+ to specify which font backends to use. */
+ register_font_driver (&w32font_driver, f);
+
+ x_default_parameter (f, parameters, Qfont_backend, Qnil,
+ "fontBackend", "FontBackend", RES_TYPE_STRING);
+ }
+#endif /* USE_FONT_BACKEND */
+
/* Extract the window parameters from the supplied values
that are needed to determine window geometry. */
+#ifdef USE_FONT_BACKEND
+ if (enable_font_backend)
+ x_default_font_parameter (f, parameters);
+ else
+#endif
{
Lisp_Object font;
@@ -4292,7 +4342,7 @@ This function is an internal primitive--use `make-frame' instead. */)
{
tem = Fquery_fontset (font, Qnil);
if (STRINGP (tem))
- font = x_new_fontset (f, SDATA (tem));
+ font = x_new_fontset (f, tem);
else
font = x_new_font (f, SDATA (font));
}
@@ -4448,22 +4498,6 @@ This function is an internal primitive--use `make-frame' instead. */)
/* Must have been Qnil. */
;
}
-
- /* Initialize `default-minibuffer-frame' in case this is the first
- frame on this terminal. */
- if (FRAME_HAS_MINIBUF_P (f)
- && (!FRAMEP (kb->Vdefault_minibuffer_frame)
- || !FRAME_LIVE_P (XFRAME (kb->Vdefault_minibuffer_frame))))
- kb->Vdefault_minibuffer_frame = frame;
-
- /* All remaining specified parameters, which have not been "used"
- by x_get_arg and friends, now go in the misc. alist of the frame. */
- for (tem = parameters; !NILP (tem); tem = XCDR (tem))
- if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem))))
- f->param_alist = Fcons (XCAR (tem), f->param_alist);
-
- store_frame_param (f, Qwindow_system, Qw32);
-
UNGCPRO;
/* Make sure windows on this frame appear in calls to next-window
@@ -4489,7 +4523,7 @@ x_get_focus_frame (frame)
return xfocus;
}
-DEFUN ("x-focus-frame", Fx_focus_frame, Sx_focus_frame, 1, 1, 0,
+DEFUN ("w32-focus-frame", Fw32_focus_frame, Sw32_focus_frame, 1, 1, 0,
doc: /* Give FRAME input focus, raising to foreground if necessary. */)
(frame)
Lisp_Object frame;
@@ -4688,10 +4722,10 @@ w32_load_system_font (f,fontname,size)
fontp->name = (char *) xmalloc (strlen (fontname) + 1);
bcopy (fontname, fontp->name, strlen (fontname) + 1);
- if (lf.lfPitchAndFamily == FIXED_PITCH)
+ if ((lf.lfPitchAndFamily & 0x03) == FIXED_PITCH)
{
/* Fixed width font. */
- fontp->average_width = fontp->space_width = FONT_WIDTH (font);
+ fontp->average_width = fontp->space_width = FONT_AVG_WIDTH (font);
}
else
{
@@ -4701,11 +4735,12 @@ w32_load_system_font (f,fontname,size)
if (pcm)
fontp->space_width = pcm->width;
else
- fontp->space_width = FONT_WIDTH (font);
+ fontp->space_width = FONT_AVG_WIDTH (font);
fontp->average_width = font->tm.tmAveCharWidth;
}
+ fontp->charset = -1;
charset = xlfd_charset_of_font (fontname);
/* Cache the W32 codepage for a font. This makes w32_encode_char
@@ -4732,7 +4767,7 @@ w32_load_system_font (f,fontname,size)
(0:0x20..0x7F, 1:0xA0..0xFF,
(0:0x2020..0x7F7F, 1:0xA0A0..0xFFFF, 3:0x20A0..0x7FFF,
2:0xA020..0xFF7F). For the moment, we don't know which charset
- uses this font. So, we set information in fontp->encoding[1]
+ uses this font. So, we set information in fontp->encoding_type
which is never used by any charset. If mapping can't be
decided, set FONT_ENCODING_NOT_DECIDED. */
@@ -4740,9 +4775,9 @@ w32_load_system_font (f,fontname,size)
type FONT_ENCODING_NOT_DECIDED. */
encoding = strrchr (fontp->name, '-');
if (encoding && strnicmp (encoding+1, "sjis", 4) == 0)
- fontp->encoding[1] = 4;
+ fontp->encoding_type = 4;
else
- fontp->encoding[1] = FONT_ENCODING_NOT_DECIDED;
+ fontp->encoding_type = FONT_ENCODING_NOT_DECIDED;
/* The following three values are set to 0 under W32, which is
what they get set to if XGetFontProperty fails under X. */
@@ -4884,7 +4919,7 @@ w32_to_x_weight (fnweight)
return "*";
}
-static LONG
+LONG
x_to_w32_charset (lpcs)
char * lpcs;
{
@@ -4896,12 +4931,16 @@ x_to_w32_charset (lpcs)
if (strncmp (lpcs, "*-#", 3) == 0)
return atoi (lpcs + 3);
+ /* All Windows fonts qualify as unicode. */
+ if (!strncmp (lpcs, "iso10646", 8))
+ return DEFAULT_CHARSET;
+
/* Handle wildcards by ignoring them; eg. treat "big5*-*" as "big5". */
charset = alloca (len + 1);
strcpy (charset, lpcs);
lpcs = strchr (charset, '*');
if (lpcs)
- *lpcs = 0;
+ *lpcs = '\0';
/* Look through w32-charset-info-alist for the character set.
Format of each entry is
@@ -4968,12 +5007,27 @@ x_to_w32_charset (lpcs)
}
-static char *
-w32_to_x_charset (fncharset)
+char *
+w32_to_x_charset (fncharset, matching)
int fncharset;
+ char *matching;
{
static char buf[32];
Lisp_Object charset_type;
+ int match_len = 0;
+
+ if (matching)
+ {
+ /* If fully specified, accept it as it is. Otherwise use a
+ substring match. */
+ char *wildcard = strchr (matching, '*');
+ if (wildcard)
+ *wildcard = '\0';
+ else if (strchr (matching, '-'))
+ return matching;
+
+ match_len = strlen (matching);
+ }
switch (fncharset)
{
@@ -5058,6 +5112,7 @@ w32_to_x_charset (fncharset)
{
Lisp_Object rest;
char * best_match = NULL;
+ int matching_found = 0;
/* Look through w32-charset-info-alist for the character set.
Prefer ISO codepages, and prefer lower numbers in the ISO
@@ -5093,12 +5148,34 @@ w32_to_x_charset (fncharset)
/* If we don't have a match already, then this is the
best. */
if (!best_match)
- best_match = x_charset;
- /* If this is an ISO codepage, and the best so far isn't,
- then this is better. */
- else if (strnicmp (best_match, "iso", 3) != 0
- && strnicmp (x_charset, "iso", 3) == 0)
- best_match = x_charset;
+ {
+ best_match = x_charset;
+ if (matching && !strnicmp (x_charset, matching, match_len))
+ matching_found = 1;
+ }
+ /* If we already found a match for MATCHING, then
+ only consider other matches. */
+ else if (matching_found
+ && strnicmp (x_charset, matching, match_len))
+ continue;
+ /* If this matches what we want, and the best so far doesn't,
+ then this is better. */
+ else if (!matching_found && matching
+ && !strnicmp (x_charset, matching, match_len))
+ {
+ best_match = x_charset;
+ matching_found = 1;
+ }
+ /* If this is fully specified, and the best so far isn't,
+ then this is better. */
+ else if ((!strchr (best_match, '-') && strchr (x_charset, '-'))
+ /* If this is an ISO codepage, and the best so far isn't,
+ then this is better, but only if it fully specifies the
+ encoding. */
+ || (strnicmp (best_match, "iso", 3) != 0
+ && strnicmp (x_charset, "iso", 3) == 0
+ && strchr (x_charset, '-')))
+ best_match = x_charset;
/* If both are ISO8859 codepages, choose the one with the
lowest number in the encoding field. */
else if (strnicmp (best_match, "iso8859-", 8) == 0
@@ -5119,7 +5196,18 @@ w32_to_x_charset (fncharset)
return buf;
}
- strncpy(buf, best_match, 31);
+ strncpy (buf, best_match, 31);
+ /* If the charset is not fully specified, put -0 on the end. */
+ if (!strchr (best_match, '-'))
+ {
+ int pos = strlen (best_match);
+ /* Charset specifiers shouldn't be very long. If it is a made
+ up one, truncating it should not do any harm since it isn't
+ recognized anyway. */
+ if (pos > 29)
+ pos = 29;
+ strcpy (buf + pos, "-0");
+ }
buf[31] = '\0';
return buf;
}
@@ -5219,7 +5307,8 @@ w32_to_all_x_charsets (fncharset)
{
Lisp_Object rest;
/* Look through w32-charset-info-alist for the character set.
- Only return charsets for codepages which are installed.
+ Only return fully specified charsets for codepages which are
+ installed.
Format of each entry in Vw32_charset_info_alist is
(CHARSET_NAME . (WINDOWS_CHARSET . CODEPAGE)).
@@ -5242,6 +5331,9 @@ w32_to_all_x_charsets (fncharset)
w32_charset = XCAR (XCDR (this_entry));
codepage = XCDR (XCDR (this_entry));
+ if (!strchr (SDATA (x_charset), '-'))
+ continue;
+
/* Look for Same charset and a valid codepage (or non-int
which means ignore). */
if (EQ (w32_charset, charset_type)
@@ -5272,9 +5364,6 @@ w32_codepage_for_font (char *fontname)
Lisp_Object codepage, entry;
char *charset_str, *charset, *end;
- if (NILP (Vw32_charset_info_alist))
- return CP_DEFAULT;
-
/* Extract charset part of font string. */
charset = xlfd_charset_of_font (fontname);
@@ -5300,6 +5389,12 @@ w32_codepage_for_font (char *fontname)
*end = '\0';
}
+ if (!strcmp (charset, "iso10646"))
+ return CP_UNICODE;
+
+ if (NILP (Vw32_charset_info_alist))
+ return CP_DEFAULT;
+
entry = Fassoc (build_string(charset), Vw32_charset_info_alist);
if (NILP (entry))
return CP_UNKNOWN;
@@ -5332,7 +5427,6 @@ w32_to_x_font (lplogfont, lpxstr, len, specific_charset)
char *fontname_dash;
int display_resy = (int) one_w32_display_info.resy;
int display_resx = (int) one_w32_display_info.resx;
- int bufsz;
struct coding_system coding;
if (!lpxstr) abort ();
@@ -5354,12 +5448,14 @@ w32_to_x_font (lplogfont, lpxstr, len, specific_charset)
coding.mode |= CODING_MODE_LAST_BLOCK;
/* We explicitely disable composition handling because selection
data should not contain any composition sequence. */
- coding.composing = COMPOSITION_DISABLED;
- bufsz = decoding_buffer_size (&coding, LF_FACESIZE);
+ coding.common_flags &= ~CODING_ANNOTATION_MASK;
+
+ coding.dst_bytes = LF_FACESIZE * 2;
+ coding.destination = (unsigned char *) xmalloc (coding.dst_bytes + 1);
+ decode_coding_c_string (&coding, lplogfont->lfFaceName,
+ strlen(lplogfont->lfFaceName), Qnil);
+ fontname = coding.destination;
- fontname = alloca(sizeof(*fontname) * bufsz);
- decode_coding (&coding, lplogfont->lfFaceName, fontname,
- strlen(lplogfont->lfFaceName), bufsz - 1);
*(fontname + coding.produced) = '\0';
/* Replace dashes with underscores so the dashes are not
@@ -5403,8 +5499,7 @@ w32_to_x_font (lplogfont, lpxstr, len, specific_charset)
((lplogfont->lfPitchAndFamily & 0x3) == VARIABLE_PITCH)
? 'p' : 'c', /* spacing */
width_pixels, /* avg width */
- specific_charset ? specific_charset
- : w32_to_x_charset (lplogfont->lfCharSet)
+ w32_to_x_charset (lplogfont->lfCharSet, specific_charset)
/* charset registry and encoding */
);
@@ -5482,26 +5577,24 @@ x_to_w32_font (lpxstr, lplogfont)
if (fields > 0 && name[0] != '*')
{
- int bufsize;
- unsigned char *buf;
-
+ Lisp_Object string = build_string (name);
setup_coding_system
(Fcheck_coding_system (Vlocale_coding_system), &coding);
- coding.src_multibyte = 1;
- coding.dst_multibyte = 0;
- /* Need to set COMPOSITION_DISABLED, otherwise Emacs crashes in
- encode_coding_iso2022 trying to dereference a null pointer. */
- coding.composing = COMPOSITION_DISABLED;
- if (coding.type == coding_type_iso2022)
- coding.flags |= CODING_FLAG_ISO_SAFE;
- bufsize = encoding_buffer_size (&coding, strlen (name));
- buf = (unsigned char *) alloca (bufsize);
- coding.mode |= CODING_MODE_LAST_BLOCK;
- encode_coding (&coding, name, buf, strlen (name), bufsize);
+ coding.mode |= (CODING_MODE_SAFE_ENCODING | CODING_MODE_LAST_BLOCK);
+ /* Disable composition/charset annotation. */
+ coding.common_flags &= ~CODING_ANNOTATION_MASK;
+ coding.dst_bytes = SCHARS (string) * 2;
+
+ coding.destination = (unsigned char *) xmalloc (coding.dst_bytes);
+ encode_coding_object (&coding, string, 0, 0,
+ SCHARS (string), SBYTES (string), Qnil);
if (coding.produced >= LF_FACESIZE)
coding.produced = LF_FACESIZE - 1;
- buf[coding.produced] = 0;
- strcpy (lplogfont->lfFaceName, buf);
+
+ coding.destination[coding.produced] = '\0';
+
+ strcpy (lplogfont->lfFaceName, coding.destination);
+ xfree (coding.destination);
}
else
{
@@ -5533,8 +5626,12 @@ x_to_w32_font (lpxstr, lplogfont)
lplogfont->lfHeight = atoi (height) * dpi / 720;
if (fields > 0)
- lplogfont->lfPitchAndFamily =
- (fields > 0 && pitch == 'p') ? VARIABLE_PITCH : FIXED_PITCH;
+ {
+ if (pitch == 'p')
+ lplogfont->lfPitchAndFamily = VARIABLE_PITCH | FF_DONTCARE;
+ else if (pitch == 'c')
+ lplogfont->lfPitchAndFamily = FIXED_PITCH | FF_DONTCARE;
+ }
fields--;
@@ -5879,14 +5976,17 @@ enum_font_cb2 (lplf, lptm, FontType, lpef)
if (charset
&& strncmp (charset, "*-*", 3) != 0
&& lpef->logfont.lfCharSet == DEFAULT_CHARSET
- && strcmp (charset, w32_to_x_charset (DEFAULT_CHARSET)) != 0)
+ && strcmp (charset, w32_to_x_charset (DEFAULT_CHARSET, NULL)) != 0)
return 1;
}
if (charset)
charset_list = Fcons (build_string (charset), Qnil);
else
- charset_list = w32_to_all_x_charsets (lplf->elfLogFont.lfCharSet);
+ /* Always prefer unicode. */
+ charset_list
+ = Fcons (build_string ("iso10646-1"),
+ w32_to_all_x_charsets (lplf->elfLogFont.lfCharSet));
/* Loop through the charsets. */
for ( ; CONSP (charset_list); charset_list = Fcdr (charset_list))
@@ -5894,14 +5994,15 @@ enum_font_cb2 (lplf, lptm, FontType, lpef)
Lisp_Object this_charset = Fcar (charset_list);
charset = SDATA (this_charset);
+ enum_font_maybe_add_to_list (lpef, &(lplf->elfLogFont),
+ charset, width);
+
/* List bold and italic variations if w32-enable-synthesized-fonts
is non-nil and this is a plain font. */
if (w32_enable_synthesized_fonts
&& lplf->elfLogFont.lfWeight == FW_NORMAL
&& lplf->elfLogFont.lfItalic == FALSE)
{
- enum_font_maybe_add_to_list (lpef, &(lplf->elfLogFont),
- charset, width);
/* bold. */
lplf->elfLogFont.lfWeight = FW_BOLD;
enum_font_maybe_add_to_list (lpef, &(lplf->elfLogFont),
@@ -5915,9 +6016,6 @@ enum_font_cb2 (lplf, lptm, FontType, lpef)
enum_font_maybe_add_to_list (lpef, &(lplf->elfLogFont),
charset, width);
}
- else
- enum_font_maybe_add_to_list (lpef, &(lplf->elfLogFont),
- charset, width);
}
}
@@ -6181,7 +6279,7 @@ w32_list_fonts (f, pattern, size, maxnames)
hdc = GetDC (dpyinfo->root_window);
oldobj = SelectObject (hdc, thisinfo.hfont);
if (GetTextMetrics (hdc, &thisinfo.tm))
- XSETCDR (tem, make_number (FONT_WIDTH (&thisinfo)));
+ XSETCDR (tem, make_number (FONT_AVG_WIDTH (&thisinfo)));
else
XSETCDR (tem, make_number (0));
SelectObject (hdc, oldobj);
@@ -6738,10 +6836,8 @@ terminate Emacs if we can't open the connection. */)
if (! NILP (xrm_string))
CHECK_STRING (xrm_string);
-#if 0
if (! EQ (Vwindow_system, intern ("w32")))
error ("Not using Microsoft Windows");
-#endif
/* Allow color mapping to be defined externally; first look in user's
HOME directory, then in Emacs etc dir for a file called rgb.txt. */
@@ -7243,7 +7339,7 @@ x_create_tip_frame (dpyinfo, parms, text)
Vx_resource_name = Vinvocation_name;
#ifdef MULTI_KBOARD
- kb = dpyinfo->terminal->kboard;
+ kb = dpyinfo->kboard;
#else
kb = &the_only_kboard;
#endif
@@ -7281,8 +7377,6 @@ x_create_tip_frame (dpyinfo, parms, text)
the frame is live, as per FRAME_LIVE_P. If we get a signal
from this point on, x_destroy_window might screw up reference
counts etc. */
- f->terminal = dpyinfo->terminal;
- f->terminal->reference_count++;
f->output_method = output_w32;
f->output_data.w32 =
(struct w32_output *) xmalloc (sizeof (struct w32_output));
@@ -7316,8 +7410,28 @@ x_create_tip_frame (dpyinfo, parms, text)
specbind (Qx_resource_name, name);
}
+ f->resx = dpyinfo->resx;
+ f->resy = dpyinfo->resy;
+
+#ifdef USE_FONT_BACKEND
+ if (enable_font_backend)
+ {
+ /* Perhaps, we must allow frame parameter, say `font-backend',
+ to specify which font backends to use. */
+ register_font_driver (&w32font_driver, f);
+
+ x_default_parameter (f, parms, Qfont_backend, Qnil,
+ "fontBackend", "FontBackend", RES_TYPE_STRING);
+ }
+#endif /* USE_FONT_BACKEND */
+
/* Extract the window parameters from the supplied values
that are needed to determine window geometry. */
+#ifdef USE_FONT_BACKEND
+ if (enable_font_backend)
+ x_default_font_parameter (f, parms);
+ else
+#endif /* USE_FONT_BACKEND */
{
Lisp_Object font;
@@ -7329,7 +7443,7 @@ x_create_tip_frame (dpyinfo, parms, text)
{
tem = Fquery_fontset (font, Qnil);
if (STRINGP (tem))
- font = x_new_fontset (f, SDATA (tem));
+ font = x_new_fontset (f, tem);
else
font = x_new_font (f, SDATA (font));
}
@@ -7446,8 +7560,6 @@ x_create_tip_frame (dpyinfo, parms, text)
Qnil));
}
- Fmodify_frame_parameters (frame, Fcons (Fcons (Qwindow_system, Qw32), Qnil));
-
f->no_split = 1;
UNGCPRO;
@@ -8634,6 +8746,9 @@ frame_parm_handler w32_frame_parm_handlers[] =
x_set_fringe_width,
0, /* x_set_wait_for_wm, */
x_set_fullscreen,
+#ifdef USE_FONT_BACKEND
+ x_set_font_backend
+#endif
};
void
@@ -8646,29 +8761,17 @@ syms_of_w32fns ()
w32_visible_system_caret_hwnd = NULL;
- Qnone = intern ("none");
- staticpro (&Qnone);
- Qsuppress_icon = intern ("suppress-icon");
- staticpro (&Qsuppress_icon);
- Qundefined_color = intern ("undefined-color");
- staticpro (&Qundefined_color);
- Qcancel_timer = intern ("cancel-timer");
- staticpro (&Qcancel_timer);
-
- Qhyper = intern ("hyper");
- staticpro (&Qhyper);
- Qsuper = intern ("super");
- staticpro (&Qsuper);
- Qmeta = intern ("meta");
- staticpro (&Qmeta);
- Qalt = intern ("alt");
- staticpro (&Qalt);
- Qctrl = intern ("ctrl");
- staticpro (&Qctrl);
- Qcontrol = intern ("control");
- staticpro (&Qcontrol);
- Qshift = intern ("shift");
- staticpro (&Qshift);
+ DEFSYM (Qnone, "none");
+ DEFSYM (Qsuppress_icon, "suppress-icon");
+ DEFSYM (Qundefined_color, "undefined-color");
+ DEFSYM (Qcancel_timer, "cancel-timer");
+ DEFSYM (Qhyper, "hyper");
+ DEFSYM (Qsuper, "super");
+ DEFSYM (Qmeta, "meta");
+ DEFSYM (Qalt, "alt");
+ DEFSYM (Qctrl, "ctrl");
+ DEFSYM (Qcontrol, "control");
+ DEFSYM (Qshift, "shift");
/* This is the end of symbol initialization. */
/* Text property `display' should be nonsticky by default. */
@@ -8935,24 +9038,16 @@ CODEPAGE should be an integer specifying the codepage that should be used
to display the character set, t to do no translation and output as Unicode,
or nil to do no translation and output as 8 bit (or multibyte on far-east
versions of Windows) characters. */);
- Vw32_charset_info_alist = Qnil;
-
- staticpro (&Qw32_charset_ansi);
- Qw32_charset_ansi = intern ("w32-charset-ansi");
- staticpro (&Qw32_charset_symbol);
- Qw32_charset_default = intern ("w32-charset-default");
- staticpro (&Qw32_charset_default);
- Qw32_charset_symbol = intern ("w32-charset-symbol");
- staticpro (&Qw32_charset_shiftjis);
- Qw32_charset_shiftjis = intern ("w32-charset-shiftjis");
- staticpro (&Qw32_charset_hangeul);
- Qw32_charset_hangeul = intern ("w32-charset-hangeul");
- staticpro (&Qw32_charset_chinesebig5);
- Qw32_charset_chinesebig5 = intern ("w32-charset-chinesebig5");
- staticpro (&Qw32_charset_gb2312);
- Qw32_charset_gb2312 = intern ("w32-charset-gb2312");
- staticpro (&Qw32_charset_oem);
- Qw32_charset_oem = intern ("w32-charset-oem");
+ Vw32_charset_info_alist = Qnil;
+
+ DEFSYM (Qw32_charset_ansi, "w32-charset-ansi");
+ DEFSYM (Qw32_charset_symbol, "w32-charset-symbol");
+ DEFSYM (Qw32_charset_default, "w32-charset-default");
+ DEFSYM (Qw32_charset_shiftjis, "w32-charset-shiftjis");
+ DEFSYM (Qw32_charset_hangeul, "w32-charset-hangeul");
+ DEFSYM (Qw32_charset_chinesebig5, "w32-charset-chinesebig5");
+ DEFSYM (Qw32_charset_gb2312, "w32-charset-gb2312");
+ DEFSYM (Qw32_charset_oem, "w32-charset-oem");
#ifdef JOHAB_CHARSET
{
@@ -8960,28 +9055,17 @@ versions of Windows) characters. */);
DEFVAR_BOOL ("w32-extra-charsets-defined", &w32_extra_charsets_defined,
doc: /* Internal variable. */);
- staticpro (&Qw32_charset_johab);
- Qw32_charset_johab = intern ("w32-charset-johab");
- staticpro (&Qw32_charset_easteurope);
- Qw32_charset_easteurope = intern ("w32-charset-easteurope");
- staticpro (&Qw32_charset_turkish);
- Qw32_charset_turkish = intern ("w32-charset-turkish");
- staticpro (&Qw32_charset_baltic);
- Qw32_charset_baltic = intern ("w32-charset-baltic");
- staticpro (&Qw32_charset_russian);
- Qw32_charset_russian = intern ("w32-charset-russian");
- staticpro (&Qw32_charset_arabic);
- Qw32_charset_arabic = intern ("w32-charset-arabic");
- staticpro (&Qw32_charset_greek);
- Qw32_charset_greek = intern ("w32-charset-greek");
- staticpro (&Qw32_charset_hebrew);
- Qw32_charset_hebrew = intern ("w32-charset-hebrew");
- staticpro (&Qw32_charset_vietnamese);
- Qw32_charset_vietnamese = intern ("w32-charset-vietnamese");
- staticpro (&Qw32_charset_thai);
- Qw32_charset_thai = intern ("w32-charset-thai");
- staticpro (&Qw32_charset_mac);
- Qw32_charset_mac = intern ("w32-charset-mac");
+ DEFSYM (Qw32_charset_johab, "w32-charset-johab");
+ DEFSYM (Qw32_charset_easteurope, "w32-charset-easteurope");
+ DEFSYM (Qw32_charset_turkish, "w32-charset-turkish");
+ DEFSYM (Qw32_charset_baltic, "w32-charset-baltic");
+ DEFSYM (Qw32_charset_russian, "w32-charset-russian");
+ DEFSYM (Qw32_charset_arabic, "w32-charset-arabic");
+ DEFSYM (Qw32_charset_greek, "w32-charset-greek");
+ DEFSYM (Qw32_charset_hebrew, "w32-charset-hebrew");
+ DEFSYM (Qw32_charset_vietnamese, "w32-charset-vietnamese");
+ DEFSYM (Qw32_charset_thai, "w32-charset-thai");
+ DEFSYM (Qw32_charset_mac, "w32-charset-mac");
}
#endif
@@ -8991,9 +9075,7 @@ versions of Windows) characters. */);
DEFVAR_BOOL ("w32-unicode-charset-defined",
&w32_unicode_charset_defined,
doc: /* Internal variable. */);
-
- staticpro (&Qw32_charset_unicode);
- Qw32_charset_unicode = intern ("w32-charset-unicode");
+ DEFSYM (Qw32_charset_unicode, "w32-charset-unicode");
}
#endif
@@ -9024,10 +9106,10 @@ versions of Windows) characters. */);
defsubr (&Sx_close_connection);
defsubr (&Sx_display_list);
defsubr (&Sx_synchronize);
- defsubr (&Sx_focus_frame);
/* W32 specific functions */
+ defsubr (&Sw32_focus_frame);
defsubr (&Sw32_select_font);
defsubr (&Sw32_define_rgb_color);
defsubr (&Sw32_default_color_map);
@@ -9057,6 +9139,7 @@ versions of Windows) characters. */);
find_ccl_program_func = w32_find_ccl_program;
query_font_func = w32_query_font;
set_frame_fontset_func = x_set_font;
+ get_font_repertory_func = x_get_font_repertory;
check_window_system_func = check_w32;
@@ -9101,9 +9184,6 @@ void globals_of_w32fns ()
&w32_ansi_code_page,
doc: /* The ANSI code page used by the system. */);
w32_ansi_code_page = GetACP ();
-
- /* MessageBox does not work without this when linked to comctl32.dll 6.0. */
- InitCommonControls ();
}
#undef abort
diff --git a/src/w32font.c b/src/w32font.c
new file mode 100644
index 0000000000..16ae98f13b
--- /dev/null
+++ b/src/w32font.c
@@ -0,0 +1,1382 @@
+/* Font backend for the Microsoft W32 API.
+ Copyright (C) 2007 Free Software Foundation, Inc.
+
+This file is part of GNU Emacs.
+
+GNU Emacs is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Emacs is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Emacs; see the file COPYING. If not, write to
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+#include <config.h>
+#include <windows.h>
+
+#include "lisp.h"
+#include "w32term.h"
+#include "frame.h"
+#include "dispextern.h"
+#include "character.h"
+#include "charset.h"
+#include "fontset.h"
+#include "font.h"
+
+/* The actual structure for a w32 font, that can be cast to struct font. */
+struct w32font_info
+{
+ struct font font;
+ TEXTMETRIC metrics;
+};
+
+extern struct font_driver w32font_driver;
+
+Lisp_Object Qgdi, QCfamily;
+static Lisp_Object Qmonospace, Qsans_serif, Qserif, Qmono, Qsans, Qsans__serif;
+static Lisp_Object Qscript, Qdecorative, Qraster, Qoutline, Qunknown;
+
+/* scripts */
+static Lisp_Object Qlatin, Qgreek, Qcoptic, Qcyrillic, Qarmenian, Qhebrew;
+static Lisp_Object Qarabic, Qsyriac, Qnko, Qthaana, Qdevanagari, Qbengali;
+static Lisp_Object Qgurmukhi, Qgujarati, Qoriya, Qtamil, Qtelugu;
+static Lisp_Object Qkannada, Qmalayalam, Qsinhala, Qthai, Qlao;
+static Lisp_Object Qtibetan, Qmyanmar, Qgeorgian, Qhangul, Qethiopic;
+static Lisp_Object Qcherokee, Qcanadian_aboriginal, Qogham, Qrunic;
+static Lisp_Object Qkhmer, Qmongolian, Qsymbol, Qbraille, Qhan;
+static Lisp_Object Qideographic_description, Qcjk_misc, Qkana, Qbopomofo;
+static Lisp_Object Qkanbun, Qyi, Qbyzantine_musical_symbol;
+static Lisp_Object Qmusical_symbol, Qmathematical;
+
+/* Font spacing symbols - defined in font.c. */
+extern Lisp_Object Qc, Qp, Qm;
+
+static void fill_in_logfont P_ ((FRAME_PTR f, LOGFONT *logfont,
+ Lisp_Object font_spec));
+
+static Lisp_Object font_supported_scripts P_ ((FONTSIGNATURE * sig));
+
+/* From old font code in w32fns.c */
+char * w32_to_x_charset P_ ((int charset, char * matching));
+
+static Lisp_Object w32_registry P_ ((LONG w32_charset));
+
+/* EnumFontFamiliesEx callbacks. */
+static int CALLBACK add_font_entity_to_list P_ ((ENUMLOGFONTEX *,
+ NEWTEXTMETRICEX *,
+ DWORD, LPARAM));
+static int CALLBACK add_one_font_entity_to_list P_ ((ENUMLOGFONTEX *,
+ NEWTEXTMETRICEX *,
+ DWORD, LPARAM));
+static int CALLBACK add_font_name_to_list P_ ((ENUMLOGFONTEX *,
+ NEWTEXTMETRICEX *,
+ DWORD, LPARAM));
+
+/* struct passed in as LPARAM arg to EnumFontFamiliesEx, for keeping track
+ of what we really want. */
+struct font_callback_data
+{
+ /* The logfont we are matching against. EnumFontFamiliesEx only matches
+ face name and charset, so we need to manually match everything else
+ in the callback function. */
+ LOGFONT pattern;
+ /* The original font spec or entity. */
+ Lisp_Object orig_font_spec;
+ /* The frame the font is being loaded on. */
+ Lisp_Object frame;
+ /* The list to add matches to. */
+ Lisp_Object list;
+};
+
+/* Handles the problem that EnumFontFamiliesEx will not return all
+ style variations if the font name is not specified. */
+static void list_all_matching_fonts P_ ((struct font_callback_data *match_data));
+
+
+/* MingW headers only define this when _WIN32_WINNT >= 0x0500, but we
+ target older versions. */
+#define GGI_MARK_NONEXISTING_GLYPHS 1
+
+static int
+memq_no_quit (elt, list)
+ Lisp_Object elt, list;
+{
+ while (CONSP (list) && ! EQ (XCAR (list), elt))
+ list = XCDR (list);
+ return (CONSP (list));
+}
+
+/* w32 implementation of get_cache for font backend.
+ Return a cache of font-entities on FRAME. The cache must be a
+ cons whose cdr part is the actual cache area. */
+static Lisp_Object
+w32font_get_cache (frame)
+ Lisp_Object frame;
+{
+ struct w32_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (XFRAME (frame));
+
+ return (dpyinfo->name_list_element);
+}
+
+/* w32 implementation of list for font backend.
+ List fonts exactly matching with FONT_SPEC on FRAME. The value
+ is a vector of font-entities. This is the sole API that
+ allocates font-entities. */
+static Lisp_Object
+w32font_list (frame, font_spec)
+ Lisp_Object frame, font_spec;
+{
+ Lisp_Object tem;
+ struct font_callback_data match_data;
+ HDC dc;
+ FRAME_PTR f = XFRAME (frame);
+
+ match_data.orig_font_spec = font_spec;
+ match_data.list = Qnil;
+ match_data.frame = frame;
+ bzero (&match_data.pattern, sizeof (LOGFONT));
+ fill_in_logfont (f, &match_data.pattern, font_spec);
+
+ if (match_data.pattern.lfFaceName[0] == '\0')
+ {
+ /* EnumFontFamiliesEx does not take other fields into account if
+ font name is blank, so need to use two passes. */
+ list_all_matching_fonts (&match_data);
+ }
+ else
+ {
+ dc = get_frame_dc (f);
+
+ EnumFontFamiliesEx (dc, &match_data.pattern,
+ (FONTENUMPROC) add_font_entity_to_list,
+ (LPARAM) &match_data, 0);
+ release_frame_dc (f, dc);
+ }
+
+ return NILP (match_data.list) ? null_vector : Fvconcat (1, &match_data.list);
+}
+
+/* w32 implementation of match for font backend.
+ Return a font entity most closely matching with FONT_SPEC on
+ FRAME. The closeness is detemined by the font backend, thus
+ `face-font-selection-order' is ignored here. */
+static Lisp_Object
+w32font_match (frame, font_spec)
+ Lisp_Object frame, font_spec;
+{
+ struct font_callback_data match_data;
+ HDC dc;
+ FRAME_PTR f = XFRAME (frame);
+
+ match_data.orig_font_spec = font_spec;
+ match_data.frame = frame;
+ match_data.list = Qnil;
+ bzero (&match_data.pattern, sizeof (LOGFONT));
+ fill_in_logfont (f, &match_data.pattern, font_spec);
+
+ dc = get_frame_dc (f);
+
+ EnumFontFamiliesEx (dc, &match_data.pattern,
+ (FONTENUMPROC) add_one_font_entity_to_list,
+ (LPARAM) &match_data, 0);
+ release_frame_dc (f, dc);
+
+ return NILP (match_data.list) ? Qnil : XCAR (match_data.list);
+}
+
+
+/* w32 implementation of list_family for font backend.
+ List available families. The value is a list of family names
+ (symbols). */
+static Lisp_Object
+w32font_list_family (frame)
+ Lisp_Object frame;
+{
+ Lisp_Object list = Qnil;
+ LOGFONT font_match_pattern;
+ HDC dc;
+ FRAME_PTR f = XFRAME (frame);
+
+ bzero (&font_match_pattern, sizeof (font_match_pattern));
+
+ dc = get_frame_dc (f);
+
+ EnumFontFamiliesEx (dc, &font_match_pattern,
+ (FONTENUMPROC) add_font_name_to_list,
+ (LPARAM) &list, 0);
+ release_frame_dc (f, dc);
+
+ return list;
+}
+
+/* w32 implementation of open for font backend.
+ Open a font specified by FONT_ENTITY on frame F.
+ If the font is scalable, open it with PIXEL_SIZE. */
+static struct font *
+w32font_open (f, font_entity, pixel_size)
+ FRAME_PTR f;
+ Lisp_Object font_entity;
+ int pixel_size;
+{
+ int len, size;
+ LOGFONT logfont;
+ HDC dc;
+ HFONT hfont, old_font;
+ Lisp_Object val, extra;
+ /* For backwards compatibility. */
+ W32FontStruct *compat_w32_font;
+
+ struct w32font_info *w32_font = xmalloc (sizeof (struct w32font_info));
+
+ struct font * font = (struct font *) w32_font;
+ if (!font)
+ return NULL;
+
+ bzero (&logfont, sizeof (logfont));
+ fill_in_logfont (f, &logfont, font_entity);
+
+ size = XINT (AREF (font_entity, FONT_SIZE_INDEX));
+ if (!size)
+ size = pixel_size;
+
+ logfont.lfHeight = -size;
+ hfont = CreateFontIndirect (&logfont);
+
+ if (hfont == NULL)
+ {
+ xfree (w32_font);
+ return NULL;
+ }
+
+ /* Get the metrics for this font. */
+ dc = get_frame_dc (f);
+ old_font = SelectObject (dc, hfont);
+
+ GetTextMetrics (dc, &w32_font->metrics);
+
+ SelectObject (dc, old_font);
+ release_frame_dc (f, dc);
+ /* W32FontStruct - we should get rid of this, and use the w32font_info
+ struct for any W32 specific fields. font->font.font can then be hfont. */
+ font->font.font = xmalloc (sizeof (W32FontStruct));
+ compat_w32_font = (W32FontStruct *) font->font.font;
+ bzero (compat_w32_font, sizeof (W32FontStruct));
+ compat_w32_font->font_type = UNICODE_FONT;
+ /* Duplicate the text metrics. */
+ bcopy (&w32_font->metrics, &compat_w32_font->tm, sizeof (TEXTMETRIC));
+ compat_w32_font->hfont = hfont;
+
+ len = strlen (logfont.lfFaceName);
+ font->font.name = (char *) xmalloc (len + 1);
+ bcopy (logfont.lfFaceName, font->font.name, len);
+ font->font.name[len] = '\0';
+ font->font.full_name = font->font.name;
+ font->font.charset = 0;
+ font->font.codepage = 0;
+ font->font.size = w32_font->metrics.tmMaxCharWidth;
+ font->font.height = w32_font->metrics.tmHeight
+ + w32_font->metrics.tmExternalLeading;
+ font->font.space_width = font->font.average_width
+ = w32_font->metrics.tmAveCharWidth;
+
+ font->font.vertical_centering = 0;
+ font->font.encoding_type = 0;
+ font->font.baseline_offset = 0;
+ font->font.relative_compose = 0;
+ font->font.default_ascent = w32_font->metrics.tmAscent;
+ font->font.font_encoder = NULL;
+ font->entity = font_entity;
+ font->pixel_size = size;
+ font->driver = &w32font_driver;
+ font->format = Qgdi;
+ font->file_name = NULL;
+ font->encoding_charset = -1;
+ font->repertory_charset = -1;
+ font->min_width = 0;
+ font->ascent = w32_font->metrics.tmAscent;
+ font->descent = w32_font->metrics.tmDescent;
+ font->scalable = w32_font->metrics.tmPitchAndFamily & TMPF_VECTOR;
+
+ return font;
+}
+
+/* w32 implementation of close for font_backend.
+ Close FONT on frame F. */
+static void
+w32font_close (f, font)
+ FRAME_PTR f;
+ struct font *font;
+{
+ if (font->font.font)
+ {
+ W32FontStruct *old_w32_font = (W32FontStruct *)font->font.font;
+ DeleteObject (old_w32_font->hfont);
+ xfree (old_w32_font);
+ font->font.font = 0;
+ }
+
+ if (font->font.name)
+ xfree (font->font.name);
+ xfree (font);
+}
+
+/* w32 implementation of has_char for font backend.
+ Optional.
+ If FONT_ENTITY has a glyph for character C (Unicode code point),
+ return 1. If not, return 0. If a font must be opened to check
+ it, return -1. */
+static int
+w32font_has_char (entity, c)
+ Lisp_Object entity;
+ int c;
+{
+ Lisp_Object supported_scripts, extra, script;
+ DWORD mask;
+
+ extra = AREF (entity, FONT_EXTRA_INDEX);
+ if (!CONSP (extra))
+ return -1;
+
+ supported_scripts = assq_no_quit (QCscript, extra);
+ if (!CONSP (supported_scripts))
+ return -1;
+
+ supported_scripts = XCDR (supported_scripts);
+
+ script = CHAR_TABLE_REF (Vchar_script_table, c);
+
+ return (memq_no_quit (script, supported_scripts)) ? 1 : 0;
+}
+
+/* w32 implementation of encode_char for font backend.
+ Return a glyph code of FONT for characer C (Unicode code point).
+ If FONT doesn't have such a glyph, return FONT_INVALID_CODE. */
+static unsigned
+w32font_encode_char (font, c)
+ struct font *font;
+ int c;
+{
+ /* Avoid unneccesary conversion - all the Win32 APIs will take a unicode
+ character. */
+ return c;
+}
+
+/* w32 implementation of text_extents for font backend.
+ Perform the size computation of glyphs of FONT and fillin members
+ of METRICS. The glyphs are specified by their glyph codes in
+ CODE (length NGLYPHS). Apparently metrics can be NULL, in this
+ case just return the overall width. */
+static int
+w32font_text_extents (font, code, nglyphs, metrics)
+ struct font *font;
+ unsigned *code;
+ int nglyphs;
+ struct font_metrics *metrics;
+{
+ int i;
+ HFONT old_font;
+ /* FIXME: Be nice if we had a frame here, rather than getting the desktop's
+ device context to measure against... */
+ HDC dc = GetDC (NULL);
+ int total_width = 0;
+ WORD *wcode = alloca(nglyphs * sizeof (WORD));
+ SIZE size;
+
+ old_font = SelectObject (dc, ((W32FontStruct *)(font->font.font))->hfont);
+
+ if (metrics)
+ {
+ GLYPHMETRICS gm;
+ MAT2 transform;
+
+ /* Set transform to the identity matrix. */
+ bzero (&transform, sizeof (transform));
+ transform.eM11.value = 1;
+ transform.eM22.value = 1;
+ metrics->width = 0;
+ metrics->ascent = 0;
+ metrics->descent = 0;
+
+ for (i = 0; i < nglyphs; i++)
+ {
+ if (GetGlyphOutlineW (dc, *(code + i), GGO_METRICS, &gm, 0,
+ NULL, &transform) != GDI_ERROR)
+ {
+ int new_val = metrics->width + gm.gmBlackBoxX
+ + gm.gmptGlyphOrigin.x;
+
+ metrics->rbearing = max (metrics->rbearing, new_val);
+ metrics->width += gm.gmCellIncX;
+ new_val = -gm.gmptGlyphOrigin.y;
+ metrics->ascent = max (metrics->ascent, new_val);
+ new_val = gm.gmBlackBoxY + gm.gmptGlyphOrigin.y;
+ metrics->descent = max (metrics->descent, new_val);
+ }
+ else
+ {
+ /* Rely on an estimate based on the overall font metrics. */
+ break;
+ }
+ }
+
+ /* If we got through everything, return. */
+ if (i == nglyphs)
+ {
+ /* Restore state and release DC. */
+ SelectObject (dc, old_font);
+ ReleaseDC (NULL, dc);
+
+ return metrics->width;
+ }
+ }
+
+ for (i = 0; i < nglyphs; i++)
+ {
+ if (code[i] < 0x10000)
+ wcode[i] = code[i];
+ else
+ {
+ /* TODO: Convert to surrogate, reallocating array if needed */
+ wcode[i] = 0xffff;
+ }
+ }
+
+ if (GetTextExtentPoint32W (dc, wcode, nglyphs, &size))
+ {
+ total_width = size.cx;
+ }
+
+ if (!total_width)
+ {
+ RECT rect;
+ rect.top = 0; rect.bottom = font->font.height; rect.left = 0; rect.right = 1;
+ DrawTextW (dc, wcode, nglyphs, &rect,
+ DT_CALCRECT | DT_NOPREFIX | DT_SINGLELINE);
+ total_width = rect.right;
+ }
+
+ if (metrics)
+ {
+ metrics->width = total_width;
+ metrics->ascent = font->ascent;
+ metrics->descent = font->descent;
+ metrics->lbearing = 0;
+ metrics->rbearing = total_width
+ + ((struct w32font_info *) font)->metrics.tmOverhang;
+ }
+
+ /* Restore state and release DC. */
+ SelectObject (dc, old_font);
+ ReleaseDC (NULL, dc);
+
+ return total_width;
+}
+
+/* w32 implementation of draw for font backend.
+ Optional.
+ Draw glyphs between FROM and TO of S->char2b at (X Y) pixel
+ position of frame F with S->FACE and S->GC. If WITH_BACKGROUND
+ is nonzero, fill the background in advance. It is assured that
+ WITH_BACKGROUND is zero when (FROM > 0 || TO < S->nchars). */
+static int
+w32font_draw (s, from, to, x, y, with_background)
+ struct glyph_string *s;
+ int from, to, x, y, with_background;
+{
+ UINT options = 0;
+ HRGN orig_clip;
+
+ /* Save clip region for later restoration. */
+ GetClipRgn(s->hdc, orig_clip);
+
+ if (s->num_clips > 0)
+ {
+ HRGN new_clip = CreateRectRgnIndirect (s->clip);
+
+ if (s->num_clips > 1)
+ {
+ HRGN clip2 = CreateRectRgnIndirect (s->clip + 1);
+
+ CombineRgn (new_clip, new_clip, clip2, RGN_OR);
+ DeleteObject (clip2);
+ }
+
+ SelectClipRgn (s->hdc, new_clip);
+ DeleteObject (new_clip);
+ }
+
+ if (with_background)
+ {
+ SetBkColor (s->hdc, s->gc->background);
+ SetBkMode (s->hdc, OPAQUE);
+#if 0
+ HBRUSH brush;
+ RECT rect;
+
+ brush = CreateSolidBrush (s->gc->background);
+ rect.left = x;
+ rect.top = y - ((struct font *) (s->font_info->font))->ascent;
+ rect.right = x + s->width;
+ rect.bottom = y + ((struct font *) (s->font_info->font))->descent;
+ FillRect (s->hdc, &rect, brush);
+ DeleteObject (brush);
+#endif
+ }
+ else
+ SetBkMode (s->hdc, TRANSPARENT);
+
+ ExtTextOutW (s->hdc, x, y, options, NULL, s->char2b + from, to - from, NULL);
+
+ /* Restore clip region. */
+ if (s->num_clips > 0)
+ {
+ SelectClipRgn (s->hdc, orig_clip);
+ }
+}
+
+/* w32 implementation of free_entity for font backend.
+ Optional (if FONT_EXTRA_INDEX is not Lisp_Save_Value).
+ Free FONT_EXTRA_INDEX field of FONT_ENTITY.
+static void
+w32font_free_entity (Lisp_Object entity);
+ */
+
+/* w32 implementation of prepare_face for font backend.
+ Optional (if FACE->extra is not used).
+ Prepare FACE for displaying characters by FONT on frame F by
+ storing some data in FACE->extra. If successful, return 0.
+ Otherwise, return -1.
+static int
+w32font_prepare_face (FRAME_PTR f, struct face *face);
+ */
+/* w32 implementation of done_face for font backend.
+ Optional.
+ Done FACE for displaying characters by FACE->font on frame F.
+static void
+w32font_done_face (FRAME_PTR f, struct face *face); */
+
+/* w32 implementation of get_bitmap for font backend.
+ Optional.
+ Store bitmap data for glyph-code CODE of FONT in BITMAP. It is
+ intended that this method is called from the other font-driver
+ for actual drawing.
+static int
+w32font_get_bitmap (struct font *font, unsigned code,
+ struct font_bitmap *bitmap, int bits_per_pixel);
+ */
+/* w32 implementation of free_bitmap for font backend.
+ Optional.
+ Free bitmap data in BITMAP.
+static void
+w32font_free_bitmap (struct font *font, struct font_bitmap *bitmap);
+ */
+/* w32 implementation of get_outline for font backend.
+ Optional.
+ Return an outline data for glyph-code CODE of FONT. The format
+ of the outline data depends on the font-driver.
+static void *
+w32font_get_outline (struct font *font, unsigned code);
+ */
+/* w32 implementation of free_outline for font backend.
+ Optional.
+ Free OUTLINE (that is obtained by the above method).
+static void
+w32font_free_outline (struct font *font, void *outline);
+ */
+/* w32 implementation of anchor_point for font backend.
+ Optional.
+ Get coordinates of the INDEXth anchor point of the glyph whose
+ code is CODE. Store the coordinates in *X and *Y. Return 0 if
+ the operations was successfull. Otherwise return -1.
+static int
+w32font_anchor_point (struct font *font, unsigned code,
+ int index, int *x, int *y);
+ */
+/* w32 implementation of otf_capability for font backend.
+ Optional.
+ Return a list describing which scripts/languages FONT
+ supports by which GSUB/GPOS features of OpenType tables.
+static Lisp_Object
+w32font_otf_capability (struct font *font);
+ */
+/* w32 implementation of otf_drive for font backend.
+ Optional.
+ Apply FONT's OTF-FEATURES to the glyph string.
+
+ FEATURES specifies which OTF features to apply in this format:
+ (SCRIPT LANGSYS GSUB-FEATURE GPOS-FEATURE)
+ See the documentation of `font-drive-otf' for the detail.
+
+ This method applies the specified features to the codes in the
+ elements of GSTRING-IN (between FROMth and TOth). The output
+ codes are stored in GSTRING-OUT at the IDXth element and the
+ following elements.
+
+ Return the number of output codes. If none of the features are
+ applicable to the input data, return 0. If GSTRING-OUT is too
+ short, return -1.
+static int
+w32font_otf_drive (struct font *font, Lisp_Object features,
+ Lisp_Object gstring_in, int from, int to,
+ Lisp_Object gstring_out, int idx,
+ int alternate_subst);
+ */
+
+/* Callback function for EnumFontFamiliesEx.
+ * Adds the name of a font to a Lisp list (passed in as the lParam arg). */
+static int CALLBACK
+add_font_name_to_list (logical_font, physical_font, font_type, list_object)
+ ENUMLOGFONTEX *logical_font;
+ NEWTEXTMETRICEX *physical_font;
+ DWORD font_type;
+ LPARAM list_object;
+{
+ Lisp_Object* list = (Lisp_Object *) list_object;
+ Lisp_Object family = intern_downcase (logical_font->elfLogFont.lfFaceName,
+ strlen (logical_font->elfLogFont.lfFaceName));
+ if (! memq_no_quit (family, *list))
+ *list = Fcons (family, *list);
+
+ return 1;
+}
+
+/* Convert an enumerated Windows font to an Emacs font entity. */
+static Lisp_Object
+w32_enumfont_pattern_entity (frame, logical_font, physical_font, font_type)
+ Lisp_Object frame;
+ ENUMLOGFONTEX *logical_font;
+ NEWTEXTMETRICEX *physical_font;
+ DWORD font_type;
+{
+ Lisp_Object entity, tem;
+ LOGFONT *lf = (LOGFONT*) logical_font;
+ BYTE generic_type;
+
+ entity = Fmake_vector (make_number (FONT_ENTITY_MAX), Qnil);
+
+ ASET (entity, FONT_TYPE_INDEX, Qgdi);
+ ASET (entity, FONT_FRAME_INDEX, frame);
+ ASET (entity, FONT_REGISTRY_INDEX, w32_registry (lf->lfCharSet));
+ ASET (entity, FONT_OBJLIST_INDEX, Qnil);
+
+ /* Foundry is difficult to get in readable form on Windows.
+ But Emacs crashes if it is not set, so set it to something more
+ generic. Thes values make xflds compatible with Emacs 22. */
+ if (lf->lfOutPrecision == OUT_STRING_PRECIS)
+ tem = Qraster;
+ else if (lf->lfOutPrecision == OUT_STROKE_PRECIS)
+ tem = Qoutline;
+ else
+ tem = Qunknown;
+
+ ASET (entity, FONT_FOUNDRY_INDEX, tem);
+
+ /* Save the generic family in the extra info, as it is likely to be
+ useful to users looking for a close match. */
+ generic_type = physical_font->ntmTm.tmPitchAndFamily & 0xF0;
+ if (generic_type == FF_DECORATIVE)
+ tem = Qdecorative;
+ else if (generic_type == FF_MODERN)
+ tem = Qmonospace;
+ else if (generic_type == FF_ROMAN)
+ tem = Qserif;
+ else if (generic_type == FF_SCRIPT)
+ tem = Qscript;
+ else if (generic_type == FF_SWISS)
+ tem = Qsans_serif;
+ else
+ tem = Qnil;
+
+ if (! NILP (tem))
+ font_put_extra (entity, QCfamily, tem);
+
+
+ if (physical_font->ntmTm.tmPitchAndFamily & 0x01)
+ font_put_extra (entity, QCspacing, make_number (FONT_SPACING_PROPORTIONAL));
+ else
+ font_put_extra (entity, QCspacing, make_number (FONT_SPACING_MONO));
+
+ ASET (entity, FONT_FAMILY_INDEX,
+ intern_downcase (lf->lfFaceName, strlen (lf->lfFaceName)));
+
+ ASET (entity, FONT_WEIGHT_INDEX, make_number (lf->lfWeight));
+ ASET (entity, FONT_SLANT_INDEX, make_number (lf->lfItalic ? 200 : 100));
+ /* TODO: PANOSE struct has this info, but need to call GetOutlineTextMetrics
+ to get it. */
+ ASET (entity, FONT_WIDTH_INDEX, make_number (100));
+
+ if (font_type & RASTER_FONTTYPE)
+ ASET (entity, FONT_SIZE_INDEX, make_number (physical_font->ntmTm.tmHeight));
+ else
+ ASET (entity, FONT_SIZE_INDEX, make_number (0));
+
+ /* Cache unicode codepoints covered by this font, as there is no other way
+ of getting this information easily. */
+ if (font_type & TRUETYPE_FONTTYPE)
+ {
+ font_put_extra (entity, QCscript,
+ font_supported_scripts (&physical_font->ntmFontSig));
+ }
+
+ return entity;
+}
+
+
+/* Convert generic families to the family portion of lfPitchAndFamily. */
+BYTE
+w32_generic_family (Lisp_Object name)
+{
+ /* Generic families. */
+ if (EQ (name, Qmonospace) || EQ (name, Qmono))
+ return FF_MODERN;
+ else if (EQ (name, Qsans_serif) || EQ (name, Qsans__serif)
+ || EQ (name, Qsans))
+ return FF_SWISS;
+ else if (EQ (name, Qserif))
+ return FF_ROMAN;
+ else if (EQ (name, Qdecorative))
+ return FF_DECORATIVE;
+ else if (EQ (name, Qscript))
+ return FF_SCRIPT;
+ else
+ return FF_DONTCARE;
+}
+
+static int
+logfonts_match (font, pattern)
+ LOGFONT *font, *pattern;
+{
+ /* Only check height for raster fonts. */
+ if (pattern->lfHeight && font->lfOutPrecision == OUT_STRING_PRECIS
+ && font->lfHeight != pattern->lfHeight)
+ return 0;
+
+ /* Have some flexibility with weights. */
+ if (pattern->lfWeight
+ && ((font->lfWeight < (pattern->lfWeight - 150))
+ || font->lfWeight > (pattern->lfWeight + 150)))
+ return 0;
+
+ /* Charset and face should be OK. Italic has to be checked
+ against the original spec, in case we don't have any preference. */
+ return 1;
+}
+
+static int
+font_matches_spec (type, font, spec)
+ DWORD type;
+ NEWTEXTMETRICEX *font;
+ Lisp_Object spec;
+{
+ Lisp_Object extra, val;
+
+ /* Check italic. Can't check logfonts, since it is a boolean field,
+ so there is no difference between "non-italic" and "don't care". */
+ val = AREF (spec, FONT_SLANT_INDEX);
+ if (INTEGERP (val))
+ {
+ int slant = XINT (val);
+ if ((slant > 150 && !font->ntmTm.tmItalic)
+ || (slant <= 150 && font->ntmTm.tmItalic))
+ {
+ OutputDebugString ("italic mismatch");
+ return 0;
+ }
+ }
+
+ /* Check extra parameters. */
+ for (extra = AREF (spec, FONT_EXTRA_INDEX);
+ CONSP (extra); extra = XCDR (extra))
+ {
+ Lisp_Object extra_entry;
+ extra_entry = XCAR (extra);
+ if (CONSP (extra_entry))
+ {
+ Lisp_Object key = XCAR (extra_entry);
+ val = XCDR (extra_entry);
+ if (EQ (key, QCfamily))
+ {
+ /* Generic family. Most useful when there is no font name
+ specified. eg, if a script does not exist in the default
+ font, we could look for a font with the same generic family
+ that does support the script. Full PANOSE support would
+ be better, but we need to open the font to get that. */
+ BYTE w32_family = w32_generic_family (val);
+
+ /* Reject if FF_DONTCARE is returned, as it means the
+ font spec is bad. */
+ if (w32_family == FF_DONTCARE
+ || w32_family != (font->ntmTm.tmPitchAndFamily & 0xF0))
+ return 0;
+ }
+ else if (EQ (key, QCspacing))
+ {
+ int proportional;
+ if (INTEGERP (val))
+ {
+ int spacing = XINT (val);
+ proportional = (spacing < FONT_SPACING_MONO);
+ }
+ else if (EQ (val, Qp))
+ proportional = 1;
+ else if (EQ (val, Qc) || EQ (val, Qm))
+ proportional = 0;
+ else
+ return 0; /* Bad font spec. */
+
+ if ((proportional && !(font->ntmTm.tmPitchAndFamily & 0x01))
+ || (!proportional && (font->ntmTm.tmPitchAndFamily & 0x01)))
+ return 0;
+ }
+ else if (EQ (key, QCscript) && SYMBOLP (val))
+ {
+ /* Only truetype fonts will have information about what
+ scripts they support. This probably means the user
+ will have to force Emacs to use raster, postscript
+ or atm fonts for non-ASCII text. */
+ if (type & TRUETYPE_FONTTYPE)
+ {
+ Lisp_Object support
+ = font_supported_scripts (&font->ntmFontSig);
+ if (! memq_no_quit (val, support))
+ return 0;
+ }
+ else
+ {
+ /* Return specific matches, but play it safe. Fonts
+ that cover more than their charset would suggest
+ are likely to be truetype or opentype fonts,
+ covered above. */
+ if (EQ (val, Qlatin))
+ {
+ /* Although every charset but symbol, thai and
+ arabic contains the basic ASCII set of latin
+ characters, Emacs expects much more. */
+ if (font->ntmTm.tmCharSet != ANSI_CHARSET)
+ return 0;
+ }
+ else if (EQ (val, Qsymbol))
+ {
+ if (font->ntmTm.tmCharSet != SYMBOL_CHARSET)
+ return 0;
+ }
+ else if (EQ (val, Qcyrillic))
+ {
+ if (font->ntmTm.tmCharSet != RUSSIAN_CHARSET)
+ return 0;
+ }
+ else if (EQ (val, Qgreek))
+ {
+ if (font->ntmTm.tmCharSet != GREEK_CHARSET)
+ return 0;
+ }
+ else if (EQ (val, Qarabic))
+ {
+ if (font->ntmTm.tmCharSet != ARABIC_CHARSET)
+ return 0;
+ }
+ else if (EQ (val, Qhebrew))
+ {
+ if (font->ntmTm.tmCharSet != HEBREW_CHARSET)
+ return 0;
+ }
+ else if (EQ (val, Qthai))
+ {
+ if (font->ntmTm.tmCharSet != THAI_CHARSET)
+ return 0;
+ }
+ else if (EQ (val, Qkana))
+ {
+ if (font->ntmTm.tmCharSet != SHIFTJIS_CHARSET)
+ return 0;
+ }
+ else if (EQ (val, Qbopomofo))
+ {
+ if (font->ntmTm.tmCharSet != CHINESEBIG5_CHARSET)
+ return 0;
+ }
+ else if (EQ (val, Qhangul))
+ {
+ if (font->ntmTm.tmCharSet != HANGUL_CHARSET
+ && font->ntmTm.tmCharSet != JOHAB_CHARSET)
+ return 0;
+ }
+ else if (EQ (val, Qhan))
+ {
+ if (font->ntmTm.tmCharSet != CHINESEBIG5_CHARSET
+ && font->ntmTm.tmCharSet != GB2312_CHARSET
+ && font->ntmTm.tmCharSet != HANGUL_CHARSET
+ && font->ntmTm.tmCharSet != JOHAB_CHARSET
+ && font->ntmTm.tmCharSet != SHIFTJIS_CHARSET)
+ return 0;
+ }
+ else
+ /* Other scripts unlikely to be handled. */
+ return 0;
+ }
+ }
+ }
+ }
+ return 1;
+}
+
+/* Callback function for EnumFontFamiliesEx.
+ * Checks if a font matches everything we are trying to check agaist,
+ * and if so, adds it to a list. Both the data we are checking against
+ * and the list to which the fonts are added are passed in via the
+ * lparam argument, in the form of a font_callback_data struct. */
+static int CALLBACK
+add_font_entity_to_list (logical_font, physical_font, font_type, lParam)
+ ENUMLOGFONTEX *logical_font;
+ NEWTEXTMETRICEX *physical_font;
+ DWORD font_type;
+ LPARAM lParam;
+{
+ struct font_callback_data *match_data
+ = (struct font_callback_data *) lParam;
+
+ if (logfonts_match (&logical_font->elfLogFont, &match_data->pattern)
+ && font_matches_spec (font_type, physical_font,
+ match_data->orig_font_spec))
+ {
+ Lisp_Object entity
+ = w32_enumfont_pattern_entity (match_data->frame, logical_font,
+ physical_font, font_type);
+ if (!NILP (entity))
+ match_data->list = Fcons (entity, match_data->list);
+ }
+ return 1;
+}
+
+/* Callback function for EnumFontFamiliesEx.
+ * Terminates the search once we have a match. */
+static int CALLBACK
+add_one_font_entity_to_list (logical_font, physical_font, font_type, lParam)
+ ENUMLOGFONTEX *logical_font;
+ NEWTEXTMETRICEX *physical_font;
+ DWORD font_type;
+ LPARAM lParam;
+{
+ struct font_callback_data *match_data
+ = (struct font_callback_data *) lParam;
+ add_font_entity_to_list (logical_font, physical_font, font_type, lParam);
+
+ /* If we have a font in the list, terminate the search. */
+ return !NILP (match_data->list);
+}
+
+/* Convert a Lisp font registry (symbol) to a windows charset. */
+static LONG
+registry_to_w32_charset (charset)
+ Lisp_Object charset;
+{
+ if (EQ (charset, Qiso10646_1) || EQ (charset, Qunicode_bmp)
+ || EQ (charset, Qunicode_sip))
+ return DEFAULT_CHARSET; /* UNICODE_CHARSET not defined in MingW32 */
+ else if (EQ (charset, Qiso8859_1))
+ return ANSI_CHARSET;
+ else if (SYMBOLP (charset))
+ return x_to_w32_charset (SDATA (SYMBOL_NAME (charset)));
+ else if (STRINGP (charset))
+ return x_to_w32_charset (SDATA (charset));
+ else
+ return DEFAULT_CHARSET;
+}
+
+static Lisp_Object
+w32_registry (w32_charset)
+ LONG w32_charset;
+{
+ if (w32_charset == ANSI_CHARSET)
+ return Qiso10646_1;
+ else
+ {
+ char * charset = w32_to_x_charset (w32_charset, NULL);
+ return intern_downcase (charset, strlen(charset));
+ }
+}
+
+/* Fill in all the available details of LOGFONT from FONT_SPEC. */
+static void
+fill_in_logfont (f, logfont, font_spec)
+ FRAME_PTR f;
+ LOGFONT *logfont;
+ Lisp_Object font_spec;
+{
+ Lisp_Object tmp, extra;
+ int dpi = FRAME_W32_DISPLAY_INFO (f)->resy;
+
+ extra = AREF (font_spec, FONT_EXTRA_INDEX);
+ /* Allow user to override dpi settings. */
+ if (CONSP (extra))
+ {
+ tmp = assq_no_quit (QCdpi, extra);
+ if (CONSP (tmp) && INTEGERP (XCDR (tmp)))
+ {
+ dpi = XINT (XCDR (tmp));
+ }
+ else if (CONSP (tmp) && FLOATP (XCDR (tmp)))
+ {
+ dpi = (int) (XFLOAT_DATA (XCDR (tmp)) + 0.5);
+ }
+ }
+
+ /* Height */
+ tmp = AREF (font_spec, FONT_SIZE_INDEX);
+ if (INTEGERP (tmp))
+ logfont->lfHeight = -1 * XINT (tmp);
+ else if (FLOATP (tmp))
+ logfont->lfHeight = (int) (-1.0 * dpi * XFLOAT_DATA (tmp) / 72.27 + 0.5);
+
+ /* Escapement */
+
+ /* Orientation */
+
+ /* Weight */
+ tmp = AREF (font_spec, FONT_WEIGHT_INDEX);
+ if (INTEGERP (tmp))
+ logfont->lfWeight = XINT (tmp);
+
+ /* Italic */
+ tmp = AREF (font_spec, FONT_SLANT_INDEX);
+ if (INTEGERP (tmp))
+ {
+ int slant = XINT (tmp);
+ logfont->lfItalic = slant > 150 ? 1 : 0;
+ }
+
+ /* Underline */
+
+ /* Strikeout */
+
+ /* Charset */
+ tmp = AREF (font_spec, FONT_REGISTRY_INDEX);
+ if (! NILP (tmp))
+ logfont->lfCharSet = registry_to_w32_charset (tmp);
+
+ /* Out Precision */
+ /* Clip Precision */
+ /* Quality TODO: Allow different quality to be specified, so user
+ can enable/disable anti-aliasing for individual fonts. */
+ logfont->lfQuality = DEFAULT_QUALITY;
+
+ /* Generic Family and Face Name */
+ logfont->lfPitchAndFamily = FF_DONTCARE | DEFAULT_PITCH;
+
+ tmp = AREF (font_spec, FONT_FAMILY_INDEX);
+ if (! NILP (tmp))
+ {
+ logfont->lfPitchAndFamily = w32_generic_family (tmp) | DEFAULT_PITCH;
+ if ((logfont->lfPitchAndFamily & 0xF0) != FF_DONTCARE)
+ ; /* Font name was generic, don't fill in font name. */
+ /* Font families are interned, but allow for strings also in case of
+ user input. */
+ else if (SYMBOLP (tmp))
+ strncpy (logfont->lfFaceName, SDATA (SYMBOL_NAME (tmp)), LF_FACESIZE);
+ else if (STRINGP (tmp))
+ strncpy (logfont->lfFaceName, SDATA (tmp), LF_FACESIZE);
+ }
+
+ /* Process EXTRA info. */
+ for ( ; CONSP (extra); extra = XCDR (extra))
+ {
+ tmp = XCAR (extra);
+ if (CONSP (tmp))
+ {
+ Lisp_Object key, val;
+ key = XCAR (tmp), val = XCDR (tmp);
+ if (EQ (key, QCfamily))
+ {
+ /* Override generic family. */
+ BYTE family = w32_generic_family (val);
+ if (family != FF_DONTCARE)
+ logfont->lfPitchAndFamily
+ = logfont->lfPitchAndFamily & 0x0F | family;
+ }
+ else if (EQ (key, QCspacing))
+ {
+ /* Set pitch based on the spacing property. */
+ if (INTEGERP (val))
+ {
+ int spacing = XINT (val);
+ if (spacing < FONT_SPACING_MONO)
+ logfont->lfPitchAndFamily
+ = logfont->lfPitchAndFamily & 0xF0 | VARIABLE_PITCH;
+ else
+ logfont->lfPitchAndFamily
+ = logfont->lfPitchAndFamily & 0xF0 | FIXED_PITCH;
+ }
+ else if (EQ (val, Qp))
+ logfont->lfPitchAndFamily
+ = logfont->lfPitchAndFamily & 0xF0 | VARIABLE_PITCH;
+ else if (EQ (val, Qc) || EQ (val, Qm))
+ logfont->lfPitchAndFamily
+ = logfont->lfPitchAndFamily & 0xF0 | FIXED_PITCH;
+ }
+ /* Only use QCscript if charset is not provided, or is unicode
+ and a single script is specified. This is rather crude,
+ and is only used to narrow down the fonts returned where
+ there is a definite match. Some scripts, such as latin, han,
+ cjk-misc match multiple lfCharSet values, so we can't pre-filter
+ them. */
+ else if (EQ (key, QCscript)
+ && logfont->lfCharSet == DEFAULT_CHARSET
+ && SYMBOLP (val))
+ {
+ if (EQ (val, Qgreek))
+ logfont->lfCharSet = GREEK_CHARSET;
+ else if (EQ (val, Qhangul))
+ logfont->lfCharSet = HANGUL_CHARSET;
+ else if (EQ (val, Qkana) || EQ (val, Qkanbun))
+ logfont->lfCharSet = SHIFTJIS_CHARSET;
+ else if (EQ (val, Qbopomofo))
+ logfont->lfCharSet = CHINESEBIG5_CHARSET;
+ /* GB 18030 supports tibetan, yi, mongolian,
+ fonts that support it should show up if we ask for
+ GB2312 fonts. */
+ else if (EQ (val, Qtibetan) || EQ (val, Qyi)
+ || EQ (val, Qmongolian))
+ logfont->lfCharSet = GB2312_CHARSET;
+ else if (EQ (val, Qhebrew))
+ logfont->lfCharSet = HEBREW_CHARSET;
+ else if (EQ (val, Qarabic))
+ logfont->lfCharSet = ARABIC_CHARSET;
+ else if (EQ (val, Qthai))
+ logfont->lfCharSet = THAI_CHARSET;
+ else if (EQ (val, Qsymbol))
+ logfont->lfCharSet = SYMBOL_CHARSET;
+ }
+ }
+ }
+}
+
+static void
+list_all_matching_fonts (match_data)
+ struct font_callback_data *match_data;
+{
+ HDC dc;
+ Lisp_Object families = w32font_list_family (match_data->frame);
+ struct frame *f = XFRAME (match_data->frame);
+
+ dc = get_frame_dc (f);
+
+ while (!NILP (families))
+ {
+ /* TODO: Use the Unicode versions of the W32 APIs, so we can
+ handle non-ASCII font names. */
+ char *name;
+ Lisp_Object family = CAR (families);
+ families = CDR (families);
+ if (NILP (family))
+ continue;
+ else if (STRINGP (family))
+ name = SDATA (family);
+ else
+ name = SDATA (SYMBOL_NAME (family));
+
+ strncpy (match_data->pattern.lfFaceName, name, LF_FACESIZE);
+ match_data->pattern.lfFaceName[LF_FACESIZE - 1] = '\0';
+
+ EnumFontFamiliesEx (dc, &match_data->pattern,
+ (FONTENUMPROC) add_font_entity_to_list,
+ (LPARAM) match_data, 0);
+ }
+
+ release_frame_dc (f, dc);
+}
+
+/* Return a list of all the scripts that the font supports. */
+static Lisp_Object
+font_supported_scripts (FONTSIGNATURE * sig)
+{
+ DWORD * subranges = sig->fsUsb;
+ Lisp_Object supported = Qnil;
+
+ /* Match a single subrange. SYM is set if bit N is set in subranges. */
+#define SUBRANGE(n,sym) \
+ if (subranges[(n) / 32] & (1 << ((n) % 32))) \
+ supported = Fcons ((sym), supported)
+
+ /* Match multiple subranges. SYM is set if any MASK bit is set in
+ subranges[0 - 3]. */
+#define MASK_ANY(mask0,mask1,mask2,mask3,sym) \
+ if ((subranges[0] & (mask0)) || (subranges[1] & (mask1)) \
+ || (subranges[2] & (mask2)) || (subranges[3] & (mask3))) \
+ supported = Fcons ((sym), supported)
+
+ SUBRANGE (0, Qlatin); /* There are many others... */
+
+ SUBRANGE (7, Qgreek);
+ SUBRANGE (8, Qcoptic);
+ SUBRANGE (9, Qcyrillic);
+ SUBRANGE (10, Qarmenian);
+ SUBRANGE (11, Qhebrew);
+ SUBRANGE (13, Qarabic);
+ SUBRANGE (14, Qnko);
+ SUBRANGE (15, Qdevanagari);
+ SUBRANGE (16, Qbengali);
+ SUBRANGE (17, Qgurmukhi);
+ SUBRANGE (18, Qgujarati);
+ SUBRANGE (19, Qoriya);
+ SUBRANGE (20, Qtamil);
+ SUBRANGE (21, Qtelugu);
+ SUBRANGE (22, Qkannada);
+ SUBRANGE (23, Qmalayalam);
+ SUBRANGE (24, Qthai);
+ SUBRANGE (25, Qlao);
+ SUBRANGE (26, Qgeorgian);
+
+ SUBRANGE (48, Qcjk_misc);
+ SUBRANGE (51, Qbopomofo);
+ SUBRANGE (54, Qkanbun); /* Is this right? */
+ SUBRANGE (56, Qhangul);
+
+ SUBRANGE (59, Qhan); /* There are others, but this is the main one. */
+ SUBRANGE (59, Qideographic_description); /* Windows lumps this in */
+
+ SUBRANGE (70, Qtibetan);
+ SUBRANGE (71, Qsyriac);
+ SUBRANGE (72, Qthaana);
+ SUBRANGE (73, Qsinhala);
+ SUBRANGE (74, Qmyanmar);
+ SUBRANGE (75, Qethiopic);
+ SUBRANGE (76, Qcherokee);
+ SUBRANGE (77, Qcanadian_aboriginal);
+ SUBRANGE (78, Qogham);
+ SUBRANGE (79, Qrunic);
+ SUBRANGE (80, Qkhmer);
+ SUBRANGE (81, Qmongolian);
+ SUBRANGE (82, Qbraille);
+ SUBRANGE (83, Qyi);
+
+ SUBRANGE (88, Qbyzantine_musical_symbol);
+ SUBRANGE (88, Qmusical_symbol); /* Windows doesn't distinguish these. */
+
+ SUBRANGE (89, Qmathematical);
+
+ /* Match either katakana or hiragana for kana. */
+ MASK_ANY (0, 0x00060000, 0, 0, Qkana);
+
+ /* There isn't really a main symbol range, so include symbol if any
+ relevant range is set. */
+ MASK_ANY (0x8000000, 0x0000FFFF, 0, 0, Qsymbol);
+
+#undef SUBRANGE
+#undef MASK_ANY
+
+ return supported;
+}
+
+
+struct font_driver w32font_driver =
+ {
+ 0, /* Qgdi */
+ w32font_get_cache,
+ w32font_list,
+ w32font_match,
+ w32font_list_family,
+ NULL, /* free_entity */
+ w32font_open,
+ w32font_close,
+ NULL, /* prepare_face */
+ NULL, /* done_face */
+ w32font_has_char,
+ w32font_encode_char,
+ w32font_text_extents,
+ w32font_draw,
+ NULL, /* get_bitmap */
+ NULL, /* free_bitmap */
+ NULL, /* get_outline */
+ NULL, /* free_outline */
+ NULL, /* anchor_point */
+ NULL, /* otf_capability */
+ NULL /* otf_drive */
+ };
+
+
+/* Initialize state that does not change between invocations. This is only
+ called when Emacs is dumped. */
+void
+syms_of_w32font ()
+{
+ DEFSYM (Qgdi, "gdi");
+
+ /* Generic font families. */
+ DEFSYM (Qmonospace, "monospace");
+ DEFSYM (Qserif, "serif");
+ DEFSYM (Qsans_serif, "sans-serif");
+ DEFSYM (Qscript, "script");
+ DEFSYM (Qdecorative, "decorative");
+ /* Aliases. */
+ DEFSYM (Qsans__serif, "sans_serif");
+ DEFSYM (Qsans, "sans");
+ DEFSYM (Qmono, "mono");
+
+ /* Fake foundries. */
+ DEFSYM (Qraster, "raster");
+ DEFSYM (Qoutline, "outline");
+ DEFSYM (Qunknown, "unknown");
+
+ /* Indexes for extra info. */
+ DEFSYM (QCfamily, ":family");
+
+ /* Scripts */
+ DEFSYM (Qlatin, "latin");
+ DEFSYM (Qgreek, "greek");
+ DEFSYM (Qcoptic, "coptic");
+ DEFSYM (Qcyrillic, "cyrillic");
+ DEFSYM (Qarmenian, "armenian");
+ DEFSYM (Qhebrew, "hebrew");
+ DEFSYM (Qarabic, "arabic");
+ DEFSYM (Qsyriac, "syriac");
+ DEFSYM (Qnko, "nko");
+ DEFSYM (Qthaana, "thaana");
+ DEFSYM (Qdevanagari, "devanagari");
+ DEFSYM (Qbengali, "bengali");
+ DEFSYM (Qgurmukhi, "gurmukhi");
+ DEFSYM (Qgujarati, "gujarati");
+ DEFSYM (Qoriya, "oriya");
+ DEFSYM (Qtamil, "tamil");
+ DEFSYM (Qtelugu, "telugu");
+ DEFSYM (Qkannada, "kannada");
+ DEFSYM (Qmalayalam, "malayalam");
+ DEFSYM (Qsinhala, "sinhala");
+ DEFSYM (Qthai, "thai");
+ DEFSYM (Qlao, "lao");
+ DEFSYM (Qtibetan, "tibetan");
+ DEFSYM (Qmyanmar, "myanmar");
+ DEFSYM (Qgeorgian, "georgian");
+ DEFSYM (Qhangul, "hangul");
+ DEFSYM (Qethiopic, "ethiopic");
+ DEFSYM (Qcherokee, "cherokee");
+ DEFSYM (Qcanadian_aboriginal, "canadian-aboriginal");
+ DEFSYM (Qogham, "ogham");
+ DEFSYM (Qrunic, "runic");
+ DEFSYM (Qkhmer, "khmer");
+ DEFSYM (Qmongolian, "mongolian");
+ DEFSYM (Qsymbol, "symbol");
+ DEFSYM (Qbraille, "braille");
+ DEFSYM (Qhan, "han");
+ DEFSYM (Qideographic_description, "ideographic-description");
+ DEFSYM (Qcjk_misc, "cjk-misc");
+ DEFSYM (Qkana, "kana");
+ DEFSYM (Qbopomofo, "bopomofo");
+ DEFSYM (Qkanbun, "kanbun");
+ DEFSYM (Qyi, "yi");
+ DEFSYM (Qbyzantine_musical_symbol, "byzantine-musical-symbol");
+ DEFSYM (Qmusical_symbol, "musical-symbol");
+ DEFSYM (Qmathematical, "mathematical");
+
+ w32font_driver.type = Qgdi;
+ register_font_driver (&w32font_driver, NULL);
+}
+
+/* arch-tag: 65b8a3cd-46aa-4c0d-a1f3-99e75b9c07ee
+ (do not change this comment) */
diff --git a/src/w32inevt.c b/src/w32inevt.c
index 17cfd38440..fa2d34c299 100644
--- a/src/w32inevt.c
+++ b/src/w32inevt.c
@@ -643,9 +643,7 @@ maybe_generate_resize_event ()
}
int
-w32_console_read_socket (struct terminal *terminal,
- int expected,
- struct input_event *hold_quit)
+w32_console_read_socket (int sd, int expected, struct input_event *hold_quit)
{
BOOL no_events = TRUE;
int nev, ret = 0, add;
diff --git a/src/w32inevt.h b/src/w32inevt.h
index 08d85a0b2e..53f36e3a34 100644
--- a/src/w32inevt.h
+++ b/src/w32inevt.h
@@ -22,7 +22,7 @@ Boston, MA 02110-1301, USA. */
#ifndef EMACS_W32INEVT_H
#define EMACS_W32INEVT_H
-extern int w32_console_read_socket (struct terminal *term, int numchars,
+extern int w32_console_read_socket (int sd, int numchars,
struct input_event *hold_quit);
extern void w32_console_mouse_position (FRAME_PTR *f, int insist,
Lisp_Object *bar_window,
diff --git a/src/w32menu.c b/src/w32menu.c
index e5638cc4bf..22389eea2a 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -20,20 +20,20 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
#include <config.h>
-
#include <signal.h>
+
#include <stdio.h>
#include <mbstring.h>
-
#include "lisp.h"
+#include "termhooks.h"
#include "keyboard.h"
#include "keymap.h"
#include "frame.h"
-#include "termhooks.h"
#include "window.h"
#include "blockinput.h"
#include "buffer.h"
#include "charset.h"
+#include "character.h"
#include "coding.h"
/* This may include sys/types.h, and that somehow loses
@@ -259,10 +259,10 @@ menubar_id_to_frame (id)
Lisp_Object tail, frame;
FRAME_PTR f;
- for (tail = Vframe_list; GC_CONSP (tail); tail = XCDR (tail))
+ for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
{
frame = XCAR (tail);
- if (!GC_FRAMEP (frame))
+ if (!FRAMEP (frame))
continue;
f = XFRAME (frame);
if (!FRAME_WINDOW_P (f))
@@ -675,8 +675,8 @@ cached information about equivalent key sequences. */)
enum scroll_bar_part part;
unsigned long time;
- if (FRAME_TERMINAL (new_f)->mouse_position_hook)
- (*FRAME_TERMINAL (new_f)->mouse_position_hook) (&new_f, 1, &bar_window,
+ if (mouse_position_hook)
+ (*mouse_position_hook) (&new_f, 1, &bar_window,
&part, &x, &y, &time);
if (new_f != 0)
XSETFRAME (window, new_f);
@@ -2597,14 +2597,13 @@ DEFUN ("menu-or-popup-active-p", Fmenu_or_popup_active_p, Smenu_or_popup_active_
void syms_of_w32menu ()
{
- globals_of_w32menu ();
+ globals_of_w32menu ();
staticpro (&menu_items);
menu_items = Qnil;
current_popup_menu = NULL;
- Qdebug_on_next_call = intern ("debug-on-next-call");
- staticpro (&Qdebug_on_next_call);
+ DEFSYM (Qdebug_on_next_call, "debug-on-next-call");
defsubr (&Sx_popup_menu);
defsubr (&Smenu_or_popup_active_p);
diff --git a/src/w32proc.c b/src/w32proc.c
index c21d589c52..c625c1b1fe 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -55,6 +55,7 @@ extern BOOL WINAPI IsValidLocale(LCID, DWORD);
#endif
#include "lisp.h"
+#include "character.h"
#include "w32.h"
#include "w32heap.h"
#include "systime.h"
@@ -216,18 +217,12 @@ delete_child (child_process *cp)
/* let the thread exit cleanly if possible */
cp->status = STATUS_READ_ERROR;
SetEvent (cp->char_consumed);
-#if 0
- /* We used to forceably terminate the thread here, but it
- is normally unnecessary, and in abnormal cases, the worst that
- will happen is we have an extra idle thread hanging around
- waiting for the zombie process. */
if (WaitForSingleObject (cp->thrd, 1000) != WAIT_OBJECT_0)
{
DebPrint (("delete_child.WaitForSingleObject (thread) failed "
"with %lu for fd %ld\n", GetLastError (), cp->fd));
TerminateThread (cp->thrd, 0);
}
-#endif
}
CloseHandle (cp->thrd);
cp->thrd = NULL;
@@ -2251,10 +2246,8 @@ If successful, the new layout id is returned, otherwise nil. */)
syms_of_ntproc ()
{
- Qhigh = intern ("high");
- Qlow = intern ("low");
- staticpro (&Qhigh);
- staticpro (&Qlow);
+ DEFSYM (Qhigh, "high");
+ DEFSYM (Qlow, "low");
#ifdef HAVE_SOCKETS
defsubr (&Sw32_has_winsock);
diff --git a/src/w32select.c b/src/w32select.c
index 0690204ad7..d620206aa1 100644
--- a/src/w32select.c
+++ b/src/w32select.c
@@ -82,6 +82,7 @@ Boston, MA 02110-1301, USA. */
#include "keyboard.h" /* cmd_error_internal() */
#include "charset.h"
#include "coding.h"
+#include "character.h"
#include "composite.h"
@@ -100,6 +101,9 @@ static void setup_config (void);
static BOOL WINAPI enum_locale_callback (/*const*/ char* loc_string);
static UINT cp_from_locale (LCID lcid, UINT format);
static Lisp_Object coding_from_cp (UINT codepage);
+static Lisp_Object validate_coding_system (Lisp_Object coding_system);
+static void setup_windows_coding_system (Lisp_Object coding_system,
+ struct coding_system * coding);
/* A remnant from X11: Symbol for the CLIPBORD selection type. Other
@@ -213,63 +217,36 @@ convert_to_handle_as_ascii (void)
static HGLOBAL
convert_to_handle_as_coded (Lisp_Object coding_system)
{
- HGLOBAL htext = NULL, htext2;
- int nbytes;
- unsigned char *src;
+ HGLOBAL htext;
unsigned char *dst = NULL;
- int bufsize;
struct coding_system coding;
- Lisp_Object string = Qnil;
ONTRACE (fprintf (stderr, "convert_to_handle_as_coded: %s\n",
SDATA (SYMBOL_NAME (coding_system))));
- setup_coding_system (Fcheck_coding_system (coding_system), &coding);
- coding.src_multibyte = 1;
- coding.dst_multibyte = 0;
- /* Need to set COMPOSITION_DISABLED, otherwise Emacs crashes in
- encode_coding_iso2022 trying to dereference a null pointer. */
- coding.composing = COMPOSITION_DISABLED;
- if (coding.type == coding_type_iso2022)
- coding.flags |= CODING_FLAG_ISO_SAFE;
- coding.mode |= CODING_MODE_LAST_BLOCK;
- /* Force DOS line-ends. */
- coding.eol_type = CODING_EOL_CRLF;
-
- if (SYMBOLP (coding.pre_write_conversion)
- && !NILP (Ffboundp (coding.pre_write_conversion)))
- string = run_pre_post_conversion_on_str (current_text, &coding, 1);
- else
- string = current_text;
-
- nbytes = SBYTES (string);
- src = SDATA (string);
+ setup_windows_coding_system (coding_system, &coding);
+ coding.dst_bytes = SBYTES(current_text) * 2;
+ coding.destination = (unsigned char *) xmalloc (coding.dst_bytes);
+ encode_coding_object (&coding, current_text, 0, 0,
+ SCHARS (current_text), SBYTES (current_text), Qnil);
- bufsize = encoding_buffer_size (&coding, nbytes) +2;
- htext = GlobalAlloc (GMEM_MOVEABLE | GMEM_DDESHARE, bufsize);
+ htext = GlobalAlloc (GMEM_MOVEABLE | GMEM_DDESHARE, coding.produced +2);
if (htext != NULL)
dst = (unsigned char *) GlobalLock (htext);
if (dst != NULL)
{
- encode_coding (&coding, src, dst, nbytes, bufsize-2);
+ memcpy (dst, coding.destination, coding.produced);
/* Add the string terminator. Add two NULs in case we are
producing Unicode here. */
dst[coding.produced] = dst[coding.produced+1] = '\0';
- }
-
- if (dst != NULL)
- GlobalUnlock (htext);
- if (htext != NULL)
- {
- /* Shrink data block to actual size. */
- htext2 = GlobalReAlloc (htext, coding.produced+2,
- GMEM_MOVEABLE | GMEM_DDESHARE);
- if (htext2 != NULL) htext = htext2;
+ GlobalUnlock (htext);
}
+ xfree (coding.destination);
+
return htext;
}
@@ -518,17 +495,26 @@ setup_config (void)
const char *cp;
char *end;
int slen;
- Lisp_Object new_coding_system;
+ Lisp_Object coding_system;
+ Lisp_Object dos_coding_system;
CHECK_SYMBOL (Vselection_coding_system);
- /* Check if we have it cached */
- new_coding_system = NILP (Vnext_selection_coding_system) ?
+ coding_system = NILP (Vnext_selection_coding_system) ?
Vselection_coding_system : Vnext_selection_coding_system;
+
+ dos_coding_system = validate_coding_system (coding_system);
+ if (NILP (dos_coding_system))
+ Fsignal (Qerror,
+ list2 (build_string ("Coding system is invalid or doesn't have "
+ "an eol variant for dos line ends"),
+ coding_system));
+
+ /* Check if we have it cached */
if (!NILP (cfg_coding_system)
- && EQ (cfg_coding_system, new_coding_system))
+ && EQ (cfg_coding_system, dos_coding_system))
return;
- cfg_coding_system = new_coding_system;
+ cfg_coding_system = dos_coding_system;
/* Set some sensible fallbacks */
cfg_codepage = ANSICP;
@@ -637,12 +623,61 @@ coding_from_cp (UINT codepage)
char buffer[30];
sprintf (buffer, "cp%d-dos", (int) codepage);
return intern (buffer);
- /* We don't need to check that this coding system exists right here,
- because that is done when the coding system is actually
- instantiated, i.e. it is passed through Fcheck_coding_system()
- there. */
+ /* We don't need to check that this coding system actually exists
+ right here, because that is done later for all coding systems
+ used, regardless of where they originate. */
}
+static Lisp_Object
+validate_coding_system (Lisp_Object coding_system)
+{
+ Lisp_Object eol_type;
+
+ /* Make sure the input is valid. */
+ if (NILP (Fcoding_system_p (coding_system)))
+ return Qnil;
+
+ /* Make sure we use a DOS coding system as mandated by the system
+ specs. */
+ eol_type = Fcoding_system_eol_type (coding_system);
+
+ /* Already a DOS coding system? */
+ if (EQ (eol_type, make_number (1)))
+ return coding_system;
+
+ /* Get EOL_TYPE vector of the base of CODING_SYSTEM. */
+ if (!VECTORP (eol_type))
+ {
+ eol_type = Fcoding_system_eol_type (Fcoding_system_base (coding_system));
+ if (!VECTORP (eol_type))
+ return Qnil;
+ }
+
+ return AREF (eol_type, 1);
+}
+
+static void
+setup_windows_coding_system (Lisp_Object coding_system,
+ struct coding_system * coding)
+{
+ memset (coding, 0, sizeof (*coding));
+ setup_coding_system (coding_system, coding);
+
+ /* Unset CODING_ANNOTATE_COMPOSITION_MASK. Previous code had
+ comments about crashes in encode_coding_iso2022 trying to
+ dereference a null pointer when composition was on. Selection
+ data should not contain any composition sequence on Windows.
+
+ CODING_ANNOTATION_MASK also includes
+ CODING_ANNOTATE_DIRECTION_MASK and CODING_ANNOTATE_CHARSET_MASK,
+ which both apply to ISO6429 only. We don't know if these really
+ need to be unset on Windows, but it probably doesn't hurt
+ either. */
+ coding->mode &= ~CODING_ANNOTATION_MASK;
+ coding->mode |= CODING_MODE_LAST_BLOCK | CODING_MODE_SAFE_ENCODING;
+}
+
+
DEFUN ("w32-set-clipboard-data", Fw32_set_clipboard_data,
Sw32_set_clipboard_data, 1, 2, 0,
@@ -847,10 +882,9 @@ DEFUN ("w32-get-clipboard-data", Fw32_get_clipboard_data,
if (require_decoding)
{
- int bufsize;
- unsigned char *buf;
struct coding_system coding;
Lisp_Object coding_system = Qnil;
+ Lisp_Object dos_coding_system;
/* `next-selection-coding-system' should override everything,
even when the locale passed by the system disagrees. The
@@ -912,27 +946,16 @@ DEFUN ("w32-get-clipboard-data", Fw32_get_clipboard_data,
coding_system = Vselection_coding_system;
Vnext_selection_coding_system = Qnil;
- setup_coding_system (Fcheck_coding_system (coding_system), &coding);
- coding.src_multibyte = 0;
- coding.dst_multibyte = 1;
- coding.mode |= CODING_MODE_LAST_BLOCK;
- /* We explicitely disable composition handling because
- selection data should not contain any composition
- sequence. */
- coding.composing = COMPOSITION_DISABLED;
- /* Force DOS line-ends. */
- coding.eol_type = CODING_EOL_CRLF;
-
- bufsize = decoding_buffer_size (&coding, nbytes);
- buf = (unsigned char *) xmalloc (bufsize);
- decode_coding (&coding, src, buf, nbytes, bufsize);
- Vlast_coding_system_used = coding.symbol;
- ret = make_string_from_bytes ((char *) buf,
- coding.produced_char, coding.produced);
- xfree (buf);
- if (SYMBOLP (coding.post_read_conversion)
- && !NILP (Ffboundp (coding.post_read_conversion)))
- ret = run_pre_post_conversion_on_str (ret, &coding, 0);
+ dos_coding_system = validate_coding_system (coding_system);
+ if (!NILP (dos_coding_system))
+ {
+ setup_windows_coding_system (dos_coding_system, &coding);
+ coding.source = src;
+ decode_coding_object (&coding, Qnil, 0, 0, nbytes, nbytes, Qt);
+ ret = coding.dst_object;
+
+ Vlast_coding_system_used = CODING_ID_NAME (coding.id);
+ }
}
else
{
@@ -1017,10 +1040,11 @@ and t is the same as `SECONDARY'. */)
{
Lisp_Object val = Qnil;
+ setup_config ();
+
if (OpenClipboard (NULL))
{
UINT format = 0;
- setup_config ();
while ((format = EnumClipboardFormats (format)))
/* Check CF_TEXT in addition to cfg_clipboard_type,
because we can fall back on that if CF_UNICODETEXT is
@@ -1066,13 +1090,13 @@ next communication only. After the communication, this variable is
set to nil. */);
Vnext_selection_coding_system = Qnil;
- QCLIPBOARD = intern ("CLIPBOARD"); staticpro (&QCLIPBOARD);
+ DEFSYM (QCLIPBOARD, "CLIPBOARD");
cfg_coding_system = Qnil; staticpro (&cfg_coding_system);
current_text = Qnil; staticpro (&current_text);
current_coding_system = Qnil; staticpro (&current_coding_system);
- QUNICODE = intern ("utf-16le-dos"); staticpro (&QUNICODE);
+ DEFSYM (QUNICODE, "utf-16le-dos");
QANSICP = Qnil; staticpro (&QANSICP);
QOEMCP = Qnil; staticpro (&QOEMCP);
}
diff --git a/src/w32term.c b/src/w32term.c
index f46a54fafb..9ba602fe7c 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -25,25 +25,21 @@ Boston, MA 02110-1301, USA. */
#include <stdio.h>
#include <stdlib.h>
#include "lisp.h"
-#include "charset.h"
#include "blockinput.h"
-
-#include "w32heap.h"
#include "w32term.h"
-#include "w32bdf.h"
-#include <shellapi.h>
#include "systty.h"
#include "systime.h"
-#include "atimer.h"
-#include "keymap.h"
#include <ctype.h>
#include <errno.h>
#include <setjmp.h>
#include <sys/stat.h>
-#include "keyboard.h"
+#include "charset.h"
+#include "character.h"
+#include "coding.h"
+#include "ccl.h"
#include "frame.h"
#include "dispextern.h"
#include "fontset.h"
@@ -54,9 +50,21 @@ Boston, MA 02110-1301, USA. */
#include "disptab.h"
#include "buffer.h"
#include "window.h"
+#include "keyboard.h"
#include "intervals.h"
-#include "composite.h"
-#include "coding.h"
+#include "process.h"
+#include "atimer.h"
+#include "keymap.h"
+
+#include "w32heap.h"
+#include "w32bdf.h"
+#include <shellapi.h>
+
+#ifdef USE_FONT_BACKEND
+#include "font.h"
+#endif /* USE_FONT_BACKEND */
+
+#define abs(x) ((x) < 0 ? -(x) : (x))
/* Fringe bitmaps. */
@@ -119,6 +127,31 @@ struct w32_display_info *x_display_list;
FONT-LIST-CACHE records previous values returned by x-list-fonts. */
Lisp_Object w32_display_name_list;
+
+#ifndef GLYPHSET
+/* Pre Windows 2000, this was not available, but define it here so
+ that Emacs compiled on such a platform will run on newer versions. */
+
+typedef struct tagWCRANGE
+{
+ WCHAR wcLow;
+ USHORT cGlyphs;
+} WCRANGE;
+
+typedef struct tagGLYPHSET
+{
+ DWORD cbThis;
+ DWORD flAccel;
+ DWORD cGlyphsSupported;
+ DWORD cRanges;
+ WCRANGE ranges[1];
+} GLYPHSET;
+
+#endif
+
+/* Dynamic linking to GetFontUnicodeRanges (not available on 95, 98, ME). */
+DWORD (PASCAL *pfnGetFontUnicodeRanges) (HDC device, GLYPHSET *ranges);
+
/* Frame being updated by update_frame. This is declared in term.c.
This is set by update_begin and looked at by all the
w32 functions. It is zero while not inside an update.
@@ -232,9 +265,9 @@ static void x_font_min_bounds P_ ((XFontStruct *, int *, int *));
int x_compute_min_glyph_bounds P_ ((struct frame *));
static void x_update_end P_ ((struct frame *));
static void w32_frame_up_to_date P_ ((struct frame *));
-static void w32_set_terminal_modes P_ ((struct terminal *));
-static void w32_reset_terminal_modes P_ ((struct terminal *));
-static void x_clear_frame P_ ((struct frame *));
+static void w32_set_terminal_modes P_ ((void));
+static void w32_reset_terminal_modes P_ ((void));
+static void x_clear_frame P_ ((void));
static void frame_highlight P_ ((struct frame *));
static void frame_unhighlight P_ ((struct frame *));
static void x_new_focus_frame P_ ((struct w32_display_info *,
@@ -846,7 +879,7 @@ w32_destroy_fringe_bitmap (which)
rarely happens). */
static void
-w32_set_terminal_modes (struct terminal *term)
+w32_set_terminal_modes (void)
{
}
@@ -854,7 +887,7 @@ w32_set_terminal_modes (struct terminal *term)
the W32 windows go away, and suspending requires no action. */
static void
-w32_reset_terminal_modes (struct terminal *term)
+w32_reset_terminal_modes (void)
{
}
@@ -867,7 +900,8 @@ w32_reset_terminal_modes (struct terminal *term)
/* Function prototypes of this page. */
XCharStruct *w32_per_char_metric P_ ((XFontStruct *, wchar_t *, int));
-static int w32_encode_char P_ ((int, wchar_t *, struct font_info *, int *));
+static int w32_encode_char P_ ((int, wchar_t *, struct font_info *,
+ struct charset *, int *));
/* Get metrics of character CHAR2B in FONT. Value is always non-null.
@@ -992,8 +1026,8 @@ w32_native_per_char_metric (font, char2b, font_type, pcm)
if (retval)
{
- pcm->width = sz.cx - font->tm.tmOverhang;
- pcm->rbearing = sz.cx;
+ pcm->width = sz.cx;
+ pcm->rbearing = sz.cx + font->tm.tmOverhang;
pcm->lbearing = 0;
pcm->ascent = FONT_BASE (font);
pcm->descent = FONT_DESCENT (font);
@@ -1074,9 +1108,9 @@ w32_cache_char_metrics (font)
{
/* Use the font width and height as max bounds, as not all BDF
fonts contain the letter 'x'. */
- font->max_bounds.width = FONT_MAX_WIDTH (font);
+ font->max_bounds.width = FONT_WIDTH (font);
font->max_bounds.lbearing = -font->bdf->llx;
- font->max_bounds.rbearing = FONT_MAX_WIDTH (font) - font->bdf->urx;
+ font->max_bounds.rbearing = FONT_WIDTH (font) - font->bdf->urx;
font->max_bounds.ascent = FONT_BASE (font);
font->max_bounds.descent = FONT_DESCENT (font);
}
@@ -1131,13 +1165,13 @@ w32_use_unicode_for_codepage (codepage)
the two-byte form of C. Encoding is returned in *CHAR2B. */
static int /* enum w32_char_font_type */
-w32_encode_char (c, char2b, font_info, two_byte_p)
+w32_encode_char (c, char2b, font_info, charset, two_byte_p)
int c;
wchar_t *char2b;
struct font_info *font_info;
+ struct charset *charset;
int * two_byte_p;
{
- int charset = CHAR_CHARSET (c);
int codepage;
int unicode_p = 0;
int internal_two_byte_p = 0;
@@ -1145,29 +1179,39 @@ w32_encode_char (c, char2b, font_info, two_byte_p)
XFontStruct *font = font_info->font;
internal_two_byte_p = w32_font_is_double_byte (font);
+ codepage = font_info->codepage;
+
+ /* If font can output unicode, use the original unicode character. */
+ if ( font && !font->bdf && w32_use_unicode_for_codepage (codepage)
+ && c >= 0x100)
+ {
+ *char2b = c;
+ unicode_p = 1;
+ internal_two_byte_p = 1;
+ }
/* FONT_INFO may define a scheme by which to encode byte1 and byte2.
This may be either a program in a special encoder language or a
fixed encoding. */
- if (font_info->font_encoder)
+ else if (font_info->font_encoder)
{
/* It's a program. */
struct ccl_program *ccl = font_info->font_encoder;
if (CHARSET_DIMENSION (charset) == 1)
{
- ccl->reg[0] = charset;
+ ccl->reg[0] = CHARSET_ID (charset);
ccl->reg[1] = XCHAR2B_BYTE2 (char2b);
ccl->reg[2] = -1;
}
else
{
- ccl->reg[0] = charset;
+ ccl->reg[0] = CHARSET_ID (charset);
ccl->reg[1] = XCHAR2B_BYTE1 (char2b);
ccl->reg[2] = XCHAR2B_BYTE2 (char2b);
}
- ccl_driver (ccl, NULL, NULL, 0, 0, NULL);
+ ccl_driver (ccl, NULL, NULL, 0, 0, Qnil);
/* We assume that MSBs are appropriately set/reset by CCL
program. */
@@ -1176,50 +1220,26 @@ w32_encode_char (c, char2b, font_info, two_byte_p)
else
STORE_XCHAR2B (char2b, ccl->reg[1], ccl->reg[2]);
}
- else if (font_info->encoding[charset])
+ else if (font_info->encoding_type)
{
/* Fixed encoding scheme. See fontset.h for the meaning of the
encoding numbers. */
- int enc = font_info->encoding[charset];
+ unsigned char enc = font_info->encoding_type;
if ((enc == 1 || enc == 2)
&& CHARSET_DIMENSION (charset) == 2)
STORE_XCHAR2B (char2b, XCHAR2B_BYTE1 (char2b) | 0x80, XCHAR2B_BYTE2 (char2b));
- if (enc == 1 || enc == 3
- || (enc == 4 && CHARSET_DIMENSION (charset) == 1))
+ if (enc == 1 || enc == 3 || (enc == 4 && CHARSET_DIMENSION (charset) == 1))
STORE_XCHAR2B (char2b, XCHAR2B_BYTE1 (char2b), XCHAR2B_BYTE2 (char2b) | 0x80);
else if (enc == 4)
{
- int sjis1, sjis2;
+ int code = (int) (*char2b);
- ENCODE_SJIS (XCHAR2B_BYTE1 (char2b), XCHAR2B_BYTE2 (char2b),
- sjis1, sjis2);
- STORE_XCHAR2B (char2b, sjis1, sjis2);
+ JIS_TO_SJIS (code);
+ STORE_XCHAR2B (char2b, (code >> 8), (code & 0xFF));
}
}
- codepage = font_info->codepage;
-
- /* If charset is not ASCII or Latin-1, may need to move it into
- Unicode space. */
- if ( font && !font->bdf && w32_use_unicode_for_codepage (codepage)
- && charset != CHARSET_ASCII && charset != charset_latin_iso8859_1
- && charset != CHARSET_8_BIT_CONTROL && charset != CHARSET_8_BIT_GRAPHIC)
- {
- char temp[3];
- temp[0] = XCHAR2B_BYTE1 (char2b);
- temp[1] = XCHAR2B_BYTE2 (char2b);
- temp[2] = '\0';
- if (codepage != CP_UNICODE)
- {
- if (temp[0])
- MultiByteToWideChar (codepage, 0, temp, 2, char2b, 1);
- else
- MultiByteToWideChar (codepage, 0, temp+1, 1, char2b, 1);
- }
- unicode_p = 1;
- internal_two_byte_p = 1;
- }
if (two_byte_p)
*two_byte_p = internal_two_byte_p;
@@ -1237,6 +1257,207 @@ w32_encode_char (c, char2b, font_info, two_byte_p)
}
+/* Return a char-table whose elements are t if the font FONT_INFO
+ contains a glyph for the corresponding character, and nil if not.
+
+ Fixme: For the moment, this function works only for fonts whose
+ glyph encoding is the same as Unicode (e.g. ISO10646-1 fonts). */
+
+Lisp_Object
+x_get_font_repertory (f, font_info)
+ FRAME_PTR f;
+ struct font_info *font_info;
+{
+ XFontStruct *font = (XFontStruct *) font_info->font;
+ Lisp_Object table;
+ int min_byte1, max_byte1, min_byte2, max_byte2;
+ int c;
+ struct charset *charset = CHARSET_FROM_ID (font_info->charset);
+ int offset = CHARSET_OFFSET (charset);
+
+ table = Fmake_char_table (Qnil, Qnil);
+
+ if (!font->bdf && pfnGetFontUnicodeRanges)
+ {
+ GLYPHSET *glyphset;
+ DWORD glyphset_size;
+ HDC display = get_frame_dc (f);
+ HFONT prev_font;
+ int i;
+
+ prev_font = SelectObject (display, font->hfont);
+
+ /* First call GetFontUnicodeRanges to find out how big a structure
+ we need. */
+ glyphset_size = pfnGetFontUnicodeRanges (display, NULL);
+ if (glyphset_size)
+ {
+ glyphset = (GLYPHSET *) alloca (glyphset_size);
+ glyphset->cbThis = glyphset_size;
+
+ /* Now call it again to get the ranges. */
+ glyphset_size = pfnGetFontUnicodeRanges (display, glyphset);
+
+ if (glyphset_size)
+ {
+ /* Store the ranges in TABLE. */
+ for (i = 0; i < glyphset->cRanges; i++)
+ {
+ int from = glyphset->ranges[i].wcLow;
+ int to = from + glyphset->ranges[i].cGlyphs - 1;
+ char_table_set_range (table, from, to, Qt);
+ }
+ }
+ }
+
+ SelectObject (display, prev_font);
+ release_frame_dc (f, display);
+
+ /* If we got the information we wanted above, then return it. */
+ if (glyphset_size)
+ return table;
+ }
+
+#if 0 /* TODO: Convert to work on Windows so BDF and older platforms work. */
+ /* When GetFontUnicodeRanges is not available or does not work,
+ work it out manually. */
+ min_byte1 = font->min_byte1;
+ max_byte1 = font->max_byte1;
+ min_byte2 = font->min_char_or_byte2;
+ max_byte2 = font->max_char_or_byte2;
+ if (min_byte1 == 0 && max_byte1 == 0)
+ {
+ if (! font->per_char || font->all_chars_exist == True)
+ {
+ if (offset >= 0)
+ char_table_set_range (table, offset + min_byte2,
+ offset + max_byte2, Qt);
+ else
+ for (; min_byte2 <= max_byte2; min_byte2++)
+ {
+ c = DECODE_CHAR (charset, min_byte2);
+ CHAR_TABLE_SET (table, c, Qt);
+ }
+ }
+ else
+ {
+ XCharStruct *pcm = font->per_char;
+ int from = -1;
+ int i;
+
+ for (i = min_byte2; i <= max_byte2; i++, pcm++)
+ {
+ if (pcm->width == 0 && pcm->rbearing == pcm->lbearing)
+ {
+ if (from >= 0)
+ {
+ if (offset >= 0)
+ char_table_set_range (table, offset + from,
+ offset + i - 1, Qt);
+ else
+ for (; from < i; from++)
+ {
+ c = DECODE_CHAR (charset, from);
+ CHAR_TABLE_SET (table, c, Qt);
+ }
+ from = -1;
+ }
+ }
+ else if (from < 0)
+ from = i;
+ }
+ if (from >= 0)
+ {
+ if (offset >= 0)
+ char_table_set_range (table, offset + from, offset + i - 1,
+ Qt);
+ else
+ for (; from < i; from++)
+ {
+ c = DECODE_CHAR (charset, from);
+ CHAR_TABLE_SET (table, c, Qt);
+ }
+ }
+ }
+ }
+ else
+ {
+ if (! font->per_char || font->all_chars_exist == True)
+ {
+ int i, j;
+
+ if (offset >= 0)
+ for (i = min_byte1; i <= max_byte1; i++)
+ char_table_set_range
+ (table, offset + ((i << 8) | min_byte2),
+ offset + ((i << 8) | max_byte2), Qt);
+ else
+ for (i = min_byte1; i <= max_byte1; i++)
+ for (j = min_byte2; j <= max_byte2; j++)
+ {
+ unsiged code = (i << 8) | j;
+ c = DECODE_CHAR (charset, code);
+ CHAR_TABLE_SET (table, c, Qt);
+ }
+ }
+ else
+ {
+ XCharStruct *pcm = font->per_char;
+ int i;
+
+ for (i = min_byte1; i <= max_byte1; i++)
+ {
+ int from = -1;
+ int j;
+
+ for (j = min_byte2; j <= max_byte2; j++, pcm++)
+ {
+ if (pcm->width == 0 && pcm->rbearing == pcm->lbearing)
+ {
+ if (from >= 0)
+ {
+ if (offset >= 0)
+ char_table_set_range
+ (table, offset + ((i << 8) | from),
+ offset + ((i << 8) | (j - 1)), Qt);
+ else
+ {
+ for (; from < j; from++)
+ {
+ unsigned code = (i << 8) | from;
+ c = ENCODE_CHAR (charset, code);
+ CHAR_TABLE_SET (table, c, Qt);
+ }
+ }
+ from = -1;
+ }
+ }
+ else if (from < 0)
+ from = j;
+ }
+ if (from >= 0)
+ {
+ if (offset >= 0)
+ char_table_set_range
+ (table, offset + ((i << 8) | from),
+ offset + ((i << 8) | (j - 1)), Qt);
+ else
+ {
+ for (; from < j; from++)
+ {
+ unsigned code = (i << 8) | from;
+ c = DECODE_CHAR (charset, code);
+ CHAR_TABLE_SET (table, c, Qt);
+ }
+ }
+ }
+ }
+ }
+ }
+#endif
+ return table;
+}
+
/***********************************************************************
Glyph display
@@ -1366,15 +1587,20 @@ x_set_mouse_face_gc (s)
face = FACE_FROM_ID (s->f, MOUSE_FACE_ID);
if (s->first_glyph->type == CHAR_GLYPH)
- face_id = FACE_FOR_CHAR (s->f, face, s->first_glyph->u.ch);
+ face_id = FACE_FOR_CHAR (s->f, face, s->first_glyph->u.ch, -1, Qnil);
else
- face_id = FACE_FOR_CHAR (s->f, face, 0);
+ face_id = FACE_FOR_CHAR (s->f, face, 0, -1, Qnil);
s->face = FACE_FROM_ID (s->f, face_id);
PREPARE_FACE_FOR_DISPLAY (s->f, s->face);
/* If font in this face is same as S->font, use it. */
if (s->font == s->face->font)
s->gc = s->face->gc;
+#ifdef USE_FONT_BACKEND
+ else if (enable_font_backend)
+ /* No need of setting a font for s->gc. */
+ s->gc = s->face->gc;
+#endif /* USE_FONT_BACKEND */
else
{
/* Otherwise construct scratch_cursor_gc with values from FACE
@@ -1468,11 +1694,68 @@ static INLINE void
x_set_glyph_string_clipping (s)
struct glyph_string *s;
{
- RECT r;
- get_glyph_string_clip_rect (s, &r);
- w32_set_clip_rectangle (s->hdc, &r);
+#ifdef USE_FONT_BACKEND
+ RECT *r = s->clip;
+#else
+ RECT r[2];
+#endif
+ int n = get_glyph_string_clip_rects (s, r, 2);
+
+ if (n == 1)
+ w32_set_clip_rectangle (s->hdc, r);
+ else if (n > 1)
+ {
+ HRGN full_clip, clip1, clip2;
+ clip1 = CreateRectRgnIndirect (r);
+ clip2 = CreateRectRgnIndirect (r + 1);
+ if (CombineRgn (full_clip, clip1, clip2, RGN_OR) != ERROR)
+ {
+ SelectClipRgn (s->hdc, full_clip);
+ }
+ DeleteObject (clip1);
+ DeleteObject (clip2);
+ DeleteObject (full_clip);
+ }
+#ifdef USE_FONT_BACKEND
+ s->num_clips = n;
+#endif /* USE_FONT_BACKEND */
}
+/* Set SRC's clipping for output of glyph string DST. This is called
+ when we are drawing DST's left_overhang or right_overhang only in
+ the area of SRC. */
+
+static void
+x_set_glyph_string_clipping_exactly (src, dst)
+ struct glyph_string *src, *dst;
+{
+ RECT r;
+
+#ifdef USE_FONT_BACKEND
+ if (enable_font_backend)
+ {
+ r.left = src->x;
+ r.right = r.left + src->width;
+ r.top = src->y;
+ r.bottom = r.top + src->height;
+ dst->clip[0] = r;
+ dst->num_clips = 1;
+ }
+ else
+ {
+#endif /* USE_FONT_BACKEND */
+ struct glyph_string *clip_head = src->clip_head;
+ struct glyph_string *clip_tail = src->clip_tail;
+
+ /* This foces clipping just this glyph string. */
+ src->clip_head = src->clip_tail = src;
+ get_glyph_string_clip_rect (src, &r);
+ src->clip_head = clip_head, src->clip_tail = clip_tail;
+#ifdef USE_FONT_BACKEND
+ }
+#endif /* USE_FONT_BACKEND */
+ w32_set_clip_rectangle (dst->hdc, &r);
+}
/* RIF:
Compute left and right overhang of glyph string S. If S is a glyph
@@ -1617,6 +1900,26 @@ x_draw_glyph_string_foreground (s)
x += g->pixel_width;
}
}
+#ifdef USE_FONT_BACKEND
+ else if (enable_font_backend)
+ {
+ int boff = s->font_info->baseline_offset;
+ struct font *font = (struct font *) s->font_info;
+ int y;
+
+ if (s->font_info->vertical_centering)
+ boff = VCENTER_BASELINE_OFFSET (s->font, s->f) - boff;
+
+ y = s->ybase - boff;
+ if (s->for_overlaps
+ || (s->background_filled_p && s->hl != DRAW_CURSOR))
+ font->driver->draw (s, 0, s->nchars, x, y, 0);
+ else
+ font->driver->draw (s, 0, s->nchars, x, y, 1);
+ if (s->face->overstrike)
+ font->driver->draw (s, 0, s->nchars, x + 1, y, 0);
+ }
+#endif /* USE_FONT_BACKEND */
else
{
char *char1b = (char *) s->char2b;
@@ -1653,12 +1956,12 @@ static void
x_draw_composite_glyph_string_foreground (s)
struct glyph_string *s;
{
- int i, x;
+ int i, j, x;
HFONT old_font;
/* If first glyph of S has a left box line, start drawing the text
of S to the right of that box line. */
- if (s->face->box != FACE_NO_BOX
+ if (s->face && s->face->box != FACE_NO_BOX
&& s->first_glyph->left_box_line_p)
x = s->x + abs (s->face->box_line_width);
else
@@ -1685,19 +1988,77 @@ x_draw_composite_glyph_string_foreground (s)
w32_draw_rectangle (s->hdc, s->gc, x, s->y, s->width - 1,
s->height - 1);
}
- else
+#ifdef USE_FONT_BACKEND
+ else if (enable_font_backend)
{
- for (i = 0; i < s->nchars; i++, ++s->gidx)
+ struct font *font = (struct font *) s->font_info;
+ int y = s->ybase;
+ int width = 0;
+
+ if (s->cmp->method == COMPOSITION_WITH_GLYPH_STRING)
+ {
+ Lisp_Object gstring = AREF (XHASH_TABLE (composition_hash_table)
+ ->key_and_value,
+ s->cmp->hash_index * 2);
+ int from;
+
+ for (i = from = 0; i < s->nchars; i++)
+ {
+ Lisp_Object g = LGSTRING_GLYPH (gstring, i);
+ Lisp_Object adjustment = LGLYPH_ADJUSTMENT (g);
+ int xoff, yoff, wadjust;
+
+ if (! VECTORP (adjustment))
+ {
+ width += XINT (LGLYPH_WIDTH (g));
+ continue;
+ }
+ if (from < i)
+ {
+ font->driver->draw (s, from, i, x, y, 0);
+ x += width;
+ }
+ xoff = XINT (AREF (adjustment, 0));
+ yoff = XINT (AREF (adjustment, 1));
+ wadjust = XINT (AREF (adjustment, 2));
+
+ font->driver->draw (s, i, i + 1, x + xoff, y + yoff, 0);
+ x += XINT (LGLYPH_WIDTH (g)) + wadjust;
+ from = i + 1;
+ width = 0;
+ }
+ if (from < i)
+ font->driver->draw (s, from, i, x, y, 0);
+ }
+ else
{
- w32_text_out (s, x + s->cmp->offsets[s->gidx * 2],
- s->ybase - s->cmp->offsets[s->gidx * 2 + 1],
- s->char2b + i, 1);
- if (s->face->overstrike)
- w32_text_out (s, x + s->cmp->offsets[s->gidx * 2] + 1,
- s->ybase - s->cmp->offsets[s->gidx * 2 + 1],
- s->char2b + i, 1);
+ for (i = 0, j = s->gidx; i < s->nchars; i++, j++)
+ if (COMPOSITION_GLYPH (s->cmp, j) != '\t')
+ {
+ int xx = x + s->cmp->offsets[j * 2];
+ int yy = y - s->cmp->offsets[j * 2 + 1];
+
+ font->driver->draw (s, j, j + 1, xx, yy, 0);
+ if (s->face->overstrike)
+ font->driver->draw (s, j, j + 1, xx + 1, yy, 0);
+ }
}
}
+#endif /* USE_FONT_BACKEND */
+ else
+ {
+ for (i = 0, j = s->gidx; i < s->nchars; i++, j++)
+ if (s->face)
+ {
+ w32_text_out (s, x + s->cmp->offsets[j * 2],
+ s->ybase - s->cmp->offsets[j * 2 + 1],
+ s->char2b + j, 1);
+ if (s->face->overstrike)
+ w32_text_out (s, x + s->cmp->offsets[j * 2] + 1,
+ s->ybase - s->cmp->offsets[j + 1],
+ s->char2b + j, 1);
+ }
+ }
if (s->font && s->font->hfont)
SelectObject (s->hdc, old_font);
@@ -2499,10 +2860,19 @@ x_draw_glyph_string (s)
This makes S->next use XDrawString instead of XDrawImageString. */
if (s->next && s->right_overhang && !s->for_overlaps)
{
- xassert (s->next->img == NULL);
- x_set_glyph_string_gc (s->next);
- x_set_glyph_string_clipping (s->next);
- x_draw_glyph_string_background (s->next, 1);
+ int width;
+ struct glyph_string *next;
+ for (width = 0, next = s->next; next;
+ width += next->width, next = next->next)
+ if (next->first_glyph->type != IMAGE_GLYPH)
+ {
+ x_set_glyph_string_gc (next);
+ x_set_glyph_string_clipping (next);
+ x_draw_glyph_string_background (next, 1);
+#ifdef USE_FONT_BACKEND
+ next->num_clips = 0;
+#endif /* USE_FONT_BACKEND */
+ }
}
/* Set up S->gc, set clipping and draw S. */
@@ -2522,6 +2892,12 @@ x_draw_glyph_string (s)
x_set_glyph_string_clipping (s);
relief_drawn_p = 1;
}
+ else if ((s->prev && s->prev->hl != s->hl && s->left_overhang)
+ || (s->next && s->next->hl != s->hl && s->right_overhang))
+ /* We must clip just this glyph. left_overhang part has already
+ drawn when s->prev was drawn, and right_overhang part will be
+ drawn later when s->next is drawn. */
+ x_set_glyph_string_clipping_exactly (s, s);
else
x_set_glyph_string_clipping (s);
@@ -2561,41 +2937,64 @@ x_draw_glyph_string (s)
if (s->face->underline_p
&& (s->font->bdf || !s->font->tm.tmUnderlined))
{
- unsigned long h = 1;
- unsigned long dy = 0;
+ unsigned long h;
+ int y;
+ /* Get the underline thickness. Default is 1 pixel. */
+#ifdef USE_FONT_BACKEND
+ if (enable_font_backend)
+ /* In the future, we must use information of font. */
+ h = 1;
+ else
+#endif /* USE_FONT_BACKEND */
+ h = 1;
- if (x_underline_at_descent_line)
- dy = s->height - h;
- else
+#ifdef USE_FONT_BACKEND
+ if (enable_font_backend)
+ {
+ if (s->face->font)
+ /* In the future, we must use information of font. */
+ y = s->ybase + (s->face->font->max_bounds.descent + 1) / 2;
+ else
+ y = s->y + s->height - h;
+ }
+ else
+#endif
{
- /* TODO: Use font information for positioning and thickness of
- underline. See OUTLINETEXTMETRIC, and xterm.c. Note: If
- you make this work, don't forget to change the doc string of
- x-use-underline-position-properties below. */
- dy = s->height - h;
+ y = s->y + s->height - h;
+ /* TODO: Use font information for positioning and
+ thickness of underline. See OUTLINETEXTMETRIC,
+ and xterm.c. Note: If you make this work,
+ don't forget to change the doc string of
+ x-use-underline_color-position-properties
+ below. */
+#if 0
+ if (!x_underline_at_descent_line)
+ {
+ ...
+ }
+#endif
}
if (s->face->underline_defaulted_p)
{
w32_fill_area (s->f, s->hdc, s->gc->foreground, s->x,
- s->y + dy, s->background_width, 1);
+ y, s->background_width, 1);
}
else
{
w32_fill_area (s->f, s->hdc, s->face->underline_color, s->x,
- s->y + dy, s->background_width, 1);
+ y, s->background_width, 1);
}
}
-
/* Draw overline. */
if (s->face->overline_p)
{
unsigned long dy = 0, h = 1;
if (s->face->overline_color_defaulted_p)
- {
- w32_fill_area (s->f, s->hdc, s->gc->foreground, s->x,
- s->y + dy, s->background_width, h);
- }
+ {
+ w32_fill_area (s->f, s->hdc, s->gc->foreground, s->x,
+ s->y + dy, s->background_width, h);
+ }
else
{
w32_fill_area (s->f, s->hdc, s->face->overline_color, s->x,
@@ -2617,18 +3016,75 @@ x_draw_glyph_string (s)
}
else
{
- w32_fill_area (s->f, s->hdc, s->face->strike_through_color, s->x,
+ w32_fill_area (s->f, s->hdc, s->face->underline_color, s->x,
s->y + dy, s->width, h);
}
}
- /* Draw relief. */
+ /* Draw relief if not yet drawn. */
if (!relief_drawn_p && s->face->box != FACE_NO_BOX)
x_draw_glyph_string_box (s);
+
+ if (s->prev)
+ {
+ struct glyph_string *prev;
+
+ for (prev = s->prev; prev; prev = prev->prev)
+ if (prev->hl != s->hl
+ && prev->x + prev->width + prev->right_overhang > s->x)
+ {
+ /* As prev was drawn while clipped to its own area, we
+ must draw the right_overhang part using s->hl now. */
+ enum draw_glyphs_face save = prev->hl;
+
+ prev->hl = s->hl;
+ x_set_glyph_string_gc (prev);
+ x_set_glyph_string_clipping_exactly (s, prev);
+ if (prev->first_glyph->type == CHAR_GLYPH)
+ x_draw_glyph_string_foreground (prev);
+ else
+ x_draw_composite_glyph_string_foreground (prev);
+ w32_set_clip_rectangle (prev->hdc, NULL);
+ prev->hl = save;
+#ifdef USE_FONT_BACKEND
+ prev->num_clips = 0;
+#endif /* USE_FONT_BACKEND */
+ }
+ }
+
+ if (s->next)
+ {
+ struct glyph_string *next;
+
+ for (next = s->next; next; next = next->next)
+ if (next->hl != s->hl
+ && next->x - next->left_overhang < s->x + s->width)
+ {
+ /* As next will be drawn while clipped to its own area,
+ we must draw the left_overhang part using s->hl now. */
+ enum draw_glyphs_face save = next->hl;
+
+ next->hl = s->hl;
+ x_set_glyph_string_gc (next);
+ x_set_glyph_string_clipping_exactly (s, next);
+ if (next->first_glyph->type == CHAR_GLYPH)
+ x_draw_glyph_string_foreground (next);
+ else
+ x_draw_composite_glyph_string_foreground (next);
+ w32_set_clip_rectangle (next->hdc, NULL);
+ next->hl = save;
+#ifdef USE_FONT_BACKEND
+ next->num_clips = 0;
+#endif /* USE_FONT_BACKEND */
+ }
+ }
}
/* Reset clipping. */
w32_set_clip_rectangle (s->hdc, NULL);
+#ifdef USE_FONT_BACKEND
+ s->num_clips = 0;
+#endif /* USE_FONT_BACKEND */
}
@@ -2653,10 +3109,16 @@ w32_shift_glyphs_for_insert (f, x, y, width, height, shift_by)
for X frames. */
static void
-x_delete_glyphs (f, n)
- struct frame *f;
+x_delete_glyphs (n)
register int n;
{
+ struct frame *f;
+
+ if (updating_frame)
+ f = updating_frame;
+ else
+ f = SELECTED_FRAME ();
+
if (! FRAME_W32_P (f))
return;
@@ -2668,8 +3130,15 @@ x_delete_glyphs (f, n)
frame. Otherwise clear the selected frame. */
static void
-x_clear_frame (struct frame *f)
+x_clear_frame ()
{
+ struct frame *f;
+
+ if (updating_frame)
+ f = updating_frame;
+ else
+ f = SELECTED_FRAME ();
+
if (! FRAME_W32_P (f))
return;
@@ -2696,14 +3165,18 @@ x_clear_frame (struct frame *f)
/* Make audible bell. */
static void
-w32_ring_bell (struct frame *f)
+w32_ring_bell (void)
{
+ struct frame *f;
+
+ f = SELECTED_FRAME ();
+
BLOCK_INPUT;
if (FRAME_W32_P (f) && visible_bell)
{
int i;
- HWND hwnd = FRAME_W32_WINDOW (f);
+ HWND hwnd = FRAME_W32_WINDOW (SELECTED_FRAME ());
for (i = 0; i < 5; i++)
{
@@ -2713,7 +3186,7 @@ w32_ring_bell (struct frame *f)
FlashWindow (hwnd, FALSE);
}
else
- w32_sys_ring_bell (f);
+ w32_sys_ring_bell ();
UNBLOCK_INPUT;
}
@@ -2740,10 +3213,16 @@ w32_set_terminal_window (n)
lines or deleting -N lines at vertical position VPOS. */
static void
-x_ins_del_lines (f, vpos, n)
- struct frame *f;
+x_ins_del_lines (vpos, n)
int vpos, n;
{
+ struct frame *f;
+
+ if (updating_frame)
+ f = updating_frame;
+ else
+ f = SELECTED_FRAME ();
+
if (! FRAME_W32_P (f))
return;
@@ -2904,9 +3383,9 @@ x_focus_changed (type, state, dpyinfo, frame, bufp)
/* Don't stop displaying the initial startup message
for a switch-frame event we don't need. */
- if (GC_NILP (Vterminal_frame)
- && GC_CONSP (Vframe_list)
- && !GC_NILP (XCDR (Vframe_list)))
+ if (NILP (Vterminal_frame)
+ && CONSP (Vframe_list)
+ && !NILP (XCDR (Vframe_list)))
{
bufp->kind = FOCUS_IN_EVENT;
XSETFRAME (bufp->frame_or_window, frame);
@@ -2992,7 +3471,7 @@ x_frame_rehighlight (dpyinfo)
if (dpyinfo->w32_focus_frame)
{
dpyinfo->x_highlight_frame
- = ((GC_FRAMEP (FRAME_FOCUS_FRAME (dpyinfo->w32_focus_frame)))
+ = ((FRAMEP (FRAME_FOCUS_FRAME (dpyinfo->w32_focus_frame)))
? XFRAME (FRAME_FOCUS_FRAME (dpyinfo->w32_focus_frame))
: dpyinfo->w32_focus_frame);
if (! FRAME_LIVE_P (dpyinfo->x_highlight_frame))
@@ -3148,8 +3627,7 @@ construct_mouse_wheel (result, msg, f)
POINT p;
int delta;
- result->kind = msg->msg.message == WM_MOUSEHWHEEL ? HORIZ_WHEEL_EVENT
- : WHEEL_EVENT;
+ result->kind = WHEEL_EVENT;
result->code = 0;
result->timestamp = msg->msg.time;
@@ -3251,6 +3729,9 @@ note_mouse_movement (frame, msg)
memcpy (&last_mouse_motion_event, msg, sizeof (last_mouse_motion_event));
XSETFRAME (last_mouse_motion_frame, frame);
+ if (!FRAME_X_OUTPUT (frame))
+ return 0;
+
if (msg->hwnd != FRAME_W32_WINDOW (frame))
{
frame->mouse_moved = 1;
@@ -3458,15 +3939,13 @@ x_window_to_scroll_bar (window_id)
{
Lisp_Object tail;
- for (tail = Vframe_list;
- XGCTYPE (tail) == Lisp_Cons;
- tail = XCDR (tail))
+ for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
{
Lisp_Object frame, bar, condemned;
frame = XCAR (tail);
/* All elements of Vframe_list should be frames. */
- if (! GC_FRAMEP (frame))
+ if (! FRAMEP (frame))
abort ();
/* Scan this frame's scroll bar list for a scroll bar with the
@@ -3475,9 +3954,9 @@ x_window_to_scroll_bar (window_id)
for (bar = FRAME_SCROLL_BARS (XFRAME (frame));
/* This trick allows us to search both the ordinary and
condemned scroll bar lists with one loop. */
- ! GC_NILP (bar) || (bar = condemned,
+ ! NILP (bar) || (bar = condemned,
condemned = Qnil,
- ! GC_NILP (bar));
+ ! NILP (bar));
bar = XSCROLL_BAR (bar)->next)
if (SCROLL_BAR_W32_WINDOW (XSCROLL_BAR (bar)) == window_id)
return XSCROLL_BAR (bar);
@@ -3967,7 +4446,7 @@ w32_scroll_bar_handle_click (bar, msg, emacs_event)
W32Msg *msg;
struct input_event *emacs_event;
{
- if (! GC_WINDOWP (bar->window))
+ if (! WINDOWP (bar->window))
abort ();
emacs_event->kind = W32_SCROLL_BAR_CLICK_EVENT;
@@ -4380,13 +4859,7 @@ w32_read_socket (sd, expected, hold_quit)
only when it is active. */
if (WINDOWP(window)
&& !EQ (window, last_window)
- && !EQ (window, selected_window)
- /* For click-to-focus window managers
- create event iff we don't leave the
- selected frame. */
- && (focus_follows_mouse
- || (EQ (XWINDOW (window)->frame,
- XWINDOW (selected_window)->frame))))
+ && !EQ (window, selected_window))
{
inev.kind = SELECT_WINDOW_EVENT;
inev.frame_or_window = window;
@@ -4491,7 +4964,6 @@ w32_read_socket (sd, expected, hold_quit)
}
case WM_MOUSEWHEEL:
- case WM_MOUSEHWHEEL:
{
if (dpyinfo->grabbed && last_mouse_frame
&& FRAME_LIVE_P (last_mouse_frame))
@@ -5303,11 +5775,16 @@ x_new_font (f, fontname)
register char *fontname;
{
struct font_info *fontp
- = FS_LOAD_FONT (f, 0, fontname, -1);
+ = FS_LOAD_FONT (f, fontname);
if (!fontp)
return Qnil;
+ if (FRAME_FONT (f) == (XFontStruct *) (fontp->font))
+ /* This font is already set in frame F. There's nothing more to
+ do. */
+ return build_string (fontp->full_name);
+
FRAME_FONT (f) = (XFontStruct *) (fontp->font);
FRAME_BASELINE_OFFSET (f) = fontp->baseline_offset;
FRAME_FONTSET (f) = -1;
@@ -5341,39 +5818,113 @@ x_new_font (f, fontname)
return build_string (fontp->full_name);
}
-/* Give frame F the fontset named FONTSETNAME as its default font, and
- return the full name of that fontset. FONTSETNAME may be a wildcard
- pattern; in that case, we choose some fontset that fits the pattern.
- The return value shows which fontset we chose. */
+/* Give frame F the fontset named FONTSETNAME as its default fontset,
+ and return the full name of that fontset. FONTSETNAME may be a
+ wildcard pattern; in that case, we choose some fontset that fits
+ the pattern. FONTSETNAME may be a font name for ASCII characters;
+ in that case, we create a fontset from that font name.
+
+ The return value shows which fontset we chose.
+ If FONTSETNAME specifies the default fontset, return Qt.
+ If an ASCII font in the specified fontset can't be loaded, return
+ Qnil. */
Lisp_Object
x_new_fontset (f, fontsetname)
struct frame *f;
- char *fontsetname;
+ Lisp_Object fontsetname;
{
- int fontset = fs_query_fontset (build_string (fontsetname), 0);
+ int fontset = fs_query_fontset (fontsetname, 0);
Lisp_Object result;
- if (fontset < 0)
- return Qnil;
-
- if (FRAME_FONTSET (f) == fontset)
+ if (fontset > 0 && FRAME_FONTSET(f) == fontset)
/* This fontset is already set in frame F. There's nothing more
to do. */
return fontset_name (fontset);
+ else if (fontset == 0)
+ /* The default fontset can't be the default font. */
+ return Qt;
- result = x_new_font (f, (SDATA (fontset_ascii (fontset))));
+ if (fontset > 0)
+ result = x_new_font (f, (SDATA (fontset_ascii (fontset))));
+ else
+ result = x_new_font (f, SDATA (fontsetname));
if (!STRINGP (result))
/* Can't load ASCII font. */
return Qnil;
+ if (fontset < 0)
+ fontset = new_fontset_from_font_name (result);
+
/* Since x_new_font doesn't update any fontset information, do it now. */
FRAME_FONTSET(f) = fontset;
- return build_string (fontsetname);
+ return fontset_name (fontset);
}
+#ifdef USE_FONT_BACKEND
+Lisp_Object
+x_new_fontset2 (f, fontset, font_object)
+ struct frame *f;
+ int fontset;
+ Lisp_Object font_object;
+{
+ struct font *font = XSAVE_VALUE (font_object)->pointer;
+
+ if (FRAME_FONT_OBJECT (f) == font)
+ /* This font is already set in frame F. There's nothing more to
+ do. */
+ return fontset_name (fontset);
+
+ BLOCK_INPUT;
+
+ FRAME_FONT_OBJECT (f) = font;
+ FRAME_FONT (f) = font->font.font;
+ FRAME_BASELINE_OFFSET (f) = font->font.baseline_offset;
+ FRAME_FONTSET (f) = fontset;
+
+ FRAME_COLUMN_WIDTH (f) = font->font.average_width;
+ FRAME_SPACE_WIDTH (f) = font->font.space_width;
+ FRAME_LINE_HEIGHT (f) = font->font.height;
+
+ compute_fringe_widths (f, 1);
+
+ /* Compute the scroll bar width in character columns. */
+ if (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) > 0)
+ {
+ int wid = FRAME_COLUMN_WIDTH (f);
+ FRAME_CONFIG_SCROLL_BAR_COLS (f)
+ = (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) + wid - 1) / wid;
+ }
+ else
+ {
+ int wid = FRAME_COLUMN_WIDTH (f);
+ FRAME_CONFIG_SCROLL_BAR_COLS (f) = (14 + wid - 1) / wid;
+ }
+
+ /* Now make the frame display the given font. */
+ if (FRAME_X_WINDOW (f) != 0)
+ {
+ /* Don't change the size of a tip frame; there's no point in
+ doing it because it's done in Fx_show_tip, and it leads to
+ problems because the tip frame has no widget. */
+ if (NILP (tip_frame) || XFRAME (tip_frame) != f)
+ x_set_window_size (f, 0, FRAME_COLS (f), FRAME_LINES (f));
+ }
+
+#ifdef HAVE_X_I18N
+ if (FRAME_XIC (f)
+ && (FRAME_XIC_STYLE (f) & (XIMPreeditPosition | XIMStatusArea)))
+ xic_set_xfontset (f, SDATA (fontset_ascii (fontset)));
+#endif
+
+ UNBLOCK_INPUT;
+
+ return fontset_name (fontset);
+}
+#endif /* USE_FONT_BACKEND */
+
/***********************************************************************
TODO: W32 Input Methods
@@ -5913,13 +6464,22 @@ x_free_frame_resources (f)
BLOCK_INPUT;
+#ifdef USE_FONT_BACKEND
+ /* We must free faces before destroying windows because some
+ font-driver (e.g. xft) access a window while finishing a
+ face. */
+ if (enable_font_backend
+ && FRAME_FACE_CACHE (f))
+ free_frame_faces (f);
+#endif /* USE_FONT_BACKEND */
+
if (FRAME_W32_WINDOW (f))
my_destroy_window (f, FRAME_W32_WINDOW (f));
free_frame_menubar (f);
- unload_color (f, FRAME_FOREGROUND_PIXEL (f));
- unload_color (f, FRAME_BACKGROUND_PIXEL (f));
+ unload_color (f, f->output_data.x->foreground_pixel);
+ unload_color (f, f->output_data.x->background_pixel);
unload_color (f, f->output_data.w32->cursor_pixel);
unload_color (f, f->output_data.w32->cursor_foreground_pixel);
unload_color (f, f->output_data.w32->border_pixel);
@@ -5958,13 +6518,14 @@ x_free_frame_resources (f)
/* Destroy the window of frame F. */
-void
+
x_destroy_window (f)
struct frame *f;
{
struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f);
x_free_frame_resources (f);
+
dpyinfo->reference_count--;
}
@@ -6065,7 +6626,7 @@ x_font_min_bounds (font, w, h)
* average and maximum width, and maximum height.
*/
*h = FONT_HEIGHT (font);
- *w = FONT_WIDTH (font);
+ *w = FONT_AVG_WIDTH (font);
}
@@ -6224,132 +6785,6 @@ w32_make_rdb (xrm_option)
return buffer;
}
-void
-x_flush (struct frame * f)
-{ /* Nothing to do */ }
-
-
-extern frame_parm_handler w32_frame_parm_handlers[];
-
-static struct redisplay_interface w32_redisplay_interface =
-{
- w32_frame_parm_handlers,
- x_produce_glyphs,
- x_write_glyphs,
- x_insert_glyphs,
- x_clear_end_of_line,
- x_scroll_run,
- x_after_update_window_line,
- x_update_window_begin,
- x_update_window_end,
- x_cursor_to,
- x_flush,
- 0, /* flush_display_optional */
- x_clear_window_mouse_face,
- w32_get_glyph_overhangs,
- x_fix_overlapping_area,
- w32_draw_fringe_bitmap,
- w32_define_fringe_bitmap,
- w32_destroy_fringe_bitmap,
- w32_per_char_metric,
- w32_encode_char,
- NULL, /* w32_compute_glyph_string_overhangs */
- x_draw_glyph_string,
- w32_define_frame_cursor,
- w32_clear_frame_area,
- w32_draw_window_cursor,
- w32_draw_vertical_window_border,
- w32_shift_glyphs_for_insert
-};
-
-static void x_delete_terminal (struct terminal *term);
-
-static struct terminal *
-w32_create_terminal (struct w32_display_info *dpyinfo)
-{
- struct terminal *terminal;
-
- terminal = create_terminal ();
-
- terminal->type = output_w32;
- terminal->display_info.w32 = dpyinfo;
- dpyinfo->terminal = terminal;
-
- /* MSVC does not type K&R functions with no arguments correctly, and
- so we must explicitly cast them. */
- terminal->clear_frame_hook = x_clear_frame;
- terminal->ins_del_lines_hook = x_ins_del_lines;
- terminal->delete_glyphs_hook = x_delete_glyphs;
- terminal->ring_bell_hook = w32_ring_bell;
- terminal->reset_terminal_modes_hook = w32_reset_terminal_modes;
- terminal->set_terminal_modes_hook = w32_set_terminal_modes;
- terminal->update_begin_hook = x_update_begin;
- terminal->update_end_hook = x_update_end;
- terminal->set_terminal_window_hook = w32_set_terminal_window;
- terminal->read_socket_hook = w32_read_socket;
- terminal->frame_up_to_date_hook = w32_frame_up_to_date;
- terminal->mouse_position_hook = w32_mouse_position;
- terminal->frame_rehighlight_hook = w32_frame_rehighlight;
- terminal->frame_raise_lower_hook = w32_frame_raise_lower;
- // terminal->fullscreen_hook = XTfullscreen_hook;
- terminal->set_vertical_scroll_bar_hook = w32_set_vertical_scroll_bar;
- terminal->condemn_scroll_bars_hook = w32_condemn_scroll_bars;
- terminal->redeem_scroll_bar_hook = w32_redeem_scroll_bar;
- terminal->judge_scroll_bars_hook = w32_judge_scroll_bars;
-
- terminal->delete_frame_hook = x_destroy_window;
- terminal->delete_terminal_hook = x_delete_terminal;
-
- terminal->rif = &w32_redisplay_interface;
- terminal->scroll_region_ok = 1; /* We'll scroll partial frames. */
- terminal->char_ins_del_ok = 1;
- terminal->line_ins_del_ok = 1; /* We'll just blt 'em. */
- terminal->fast_clear_end_of_line = 1; /* X does this well. */
- terminal->memory_below_frame = 0; /* We don't remember what scrolls
- off the bottom. */
-
-#ifdef MULTI_KBOARD
- /* We don't yet support separate terminals on W32, so don't try to share
- keyboards between virtual terminals that are on the same physical
- terminal like X does. */
- terminal->kboard = (KBOARD *) xmalloc (sizeof (KBOARD));
- init_kboard (terminal->kboard);
- terminal->kboard->next_kboard = all_kboards;
- all_kboards = terminal->kboard;
- /* Don't let the initial kboard remain current longer than necessary.
- That would cause problems if a file loaded on startup tries to
- prompt in the mini-buffer. */
- if (current_kboard == initial_kboard)
- current_kboard = terminal->kboard;
- terminal->kboard->reference_count++;
-#endif
-
- return terminal;
-}
-
-static void
-x_delete_terminal (struct terminal *terminal)
-{
- struct w32_display_info *dpyinfo = terminal->display_info.w32;
- int i;
-
- /* Protect against recursive calls. Fdelete_frame in
- delete_terminal calls us back when it deletes our last frame. */
- if (!terminal->name)
- return;
-
- BLOCK_INPUT;
- /* Free the fonts in the font table. */
- for (i = 0; i < dpyinfo->n_fonts; i++)
- if (dpyinfo->font_table[i].name)
- {
- DeleteObject (((XFontStruct*)(dpyinfo->font_table[i].font))->hfont);
- }
-
- x_delete_display (dpyinfo);
- UNBLOCK_INPUT;
-}
-
struct w32_display_info *
w32_term_init (display_name, xrm_option, resource_name)
Lisp_Object display_name;
@@ -6357,7 +6792,6 @@ w32_term_init (display_name, xrm_option, resource_name)
char *resource_name;
{
struct w32_display_info *dpyinfo;
- struct terminal *terminal;
HDC hdc;
BLOCK_INPUT;
@@ -6371,12 +6805,6 @@ w32_term_init (display_name, xrm_option, resource_name)
w32_initialize_display_info (display_name);
dpyinfo = &one_w32_display_info;
- terminal = w32_create_terminal (dpyinfo);
-
- /* Set the name of the terminal. */
- terminal->name = (char *) xmalloc (SBYTES (display_name) + 1);
- strncpy (terminal->name, SDATA (display_name), SBYTES (display_name));
- terminal->name[SBYTES (display_name)] = 0;
dpyinfo->xrdb = xrm_option ? w32_make_rdb (xrm_option) : NULL;
@@ -6406,9 +6834,6 @@ w32_term_init (display_name, xrm_option, resource_name)
w32_defined_color (0, "black", &color, 1);
}
- /* Add the default keyboard. */
- add_keyboard_wait_descriptor (0);
-
/* Create Fringe Bitmaps and store them for later use.
On W32, bitmaps are all unsigned short, as Windows requires
@@ -6416,7 +6841,7 @@ w32_term_init (display_name, xrm_option, resource_name)
horizontally reflected compared to how they appear on X, so we
need to bitswap and convert to unsigned shorts before creating
the bitmaps. */
- w32_init_fringe (terminal->rif);
+ w32_init_fringe ();
#ifndef F_SETOWN_BUG
#ifdef F_SETOWN
@@ -6440,6 +6865,7 @@ w32_term_init (display_name, xrm_option, resource_name)
}
/* Get rid of display DPYINFO, assuming all frames are already gone. */
+
void
x_delete_display (dpyinfo)
struct w32_display_info *dpyinfo;
@@ -6490,9 +6916,73 @@ x_delete_display (dpyinfo)
DWORD WINAPI w32_msg_worker (void * arg);
+void
+x_flush (struct frame * f)
+{ /* Nothing to do */ }
+
+extern frame_parm_handler w32_frame_parm_handlers[];
+
+static struct redisplay_interface w32_redisplay_interface =
+{
+ w32_frame_parm_handlers,
+ x_produce_glyphs,
+ x_write_glyphs,
+ x_insert_glyphs,
+ x_clear_end_of_line,
+ x_scroll_run,
+ x_after_update_window_line,
+ x_update_window_begin,
+ x_update_window_end,
+ x_cursor_to,
+ x_flush,
+ 0, /* flush_display_optional */
+ x_clear_window_mouse_face,
+ w32_get_glyph_overhangs,
+ x_fix_overlapping_area,
+ w32_draw_fringe_bitmap,
+ w32_define_fringe_bitmap,
+ w32_destroy_fringe_bitmap,
+ w32_per_char_metric,
+ w32_encode_char,
+ NULL, /* w32_compute_glyph_string_overhangs */
+ x_draw_glyph_string,
+ w32_define_frame_cursor,
+ w32_clear_frame_area,
+ w32_draw_window_cursor,
+ w32_draw_vertical_window_border,
+ w32_shift_glyphs_for_insert
+};
+
static void
w32_initialize ()
{
+ rif = &w32_redisplay_interface;
+
+ /* MSVC does not type K&R functions with no arguments correctly, and
+ so we must explicitly cast them. */
+ clear_frame_hook = (void (*)(void)) x_clear_frame;
+ ring_bell_hook = (void (*)(void)) w32_ring_bell;
+ update_begin_hook = x_update_begin;
+ update_end_hook = x_update_end;
+
+ read_socket_hook = w32_read_socket;
+
+ frame_up_to_date_hook = w32_frame_up_to_date;
+
+ mouse_position_hook = w32_mouse_position;
+ frame_rehighlight_hook = w32_frame_rehighlight;
+ frame_raise_lower_hook = w32_frame_raise_lower;
+ set_vertical_scroll_bar_hook = w32_set_vertical_scroll_bar;
+ condemn_scroll_bars_hook = w32_condemn_scroll_bars;
+ redeem_scroll_bar_hook = w32_redeem_scroll_bar;
+ judge_scroll_bars_hook = w32_judge_scroll_bars;
+
+ scroll_region_ok = 1; /* we'll scroll partial frames */
+ char_ins_del_ok = 1;
+ line_ins_del_ok = 1; /* we'll just blt 'em */
+ fast_clear_end_of_line = 1; /* X does this well */
+ memory_below_frame = 0; /* we don't remember what scrolls
+ off the bottom */
baud_rate = 19200;
w32_system_caret_hwnd = NULL;
@@ -6547,13 +7037,22 @@ w32_initialize ()
AttachThreadInput (dwMainThreadId, dwWindowsThreadId, TRUE);
#endif
- /* Load system settings. */
+ /* Dynamically link to optional system components. */
{
UINT smoothing_type;
BOOL smoothing_enabled;
- /* If using proportional scroll bars, ensure handle is at least 5 pixels;
- otherwise use the fixed height. */
+ HANDLE gdi_lib = LoadLibrary ("gdi32.dll");
+
+#define LOAD_PROC(lib, fn) pfn##fn = (void *) GetProcAddress (lib, #fn)
+
+ LOAD_PROC (gdi_lib, GetFontUnicodeRanges);
+
+#undef LOAD_PROC
+
+ FreeLibrary (gdi_lib);
+
+ /* Ensure scrollbar handle is at least 5 pixels. */
vertical_scroll_bar_min_handle = 5;
/* For either kind of scroll bar, take account of the arrows; these
@@ -6594,8 +7093,7 @@ syms_of_w32term ()
staticpro (&last_mouse_scroll_bar);
last_mouse_scroll_bar = Qnil;
- staticpro (&Qvendor_specific_keysyms);
- Qvendor_specific_keysyms = intern ("vendor-specific-keysyms");
+ DEFSYM (Qvendor_specific_keysyms, "vendor-specific-keysyms");
DEFVAR_INT ("w32-num-mouse-buttons",
&w32_num_mouse_buttons,
diff --git a/src/w32term.h b/src/w32term.h
index 1af1d89846..cea3110ff8 100644
--- a/src/w32term.h
+++ b/src/w32term.h
@@ -28,15 +28,15 @@ Boston, MA 02110-1301, USA. */
#define WHITE_PIX_DEFAULT(f) PALETTERGB(255,255,255)
#define FONT_WIDTH(f) \
- ((f)->bdf ? (f)->bdf->width : (f)->tm.tmAveCharWidth)
+ ((f)->bdf ? (f)->bdf->width : (f)->tm.tmMaxCharWidth)
#define FONT_HEIGHT(f) \
((f)->bdf ? (f)->bdf->height : (f)->tm.tmHeight)
#define FONT_BASE(f) \
((f)->bdf ? (f)->bdf->ury : (f)->tm.tmAscent)
#define FONT_DESCENT(f) \
((f)->bdf ? -((f)->bdf->lly) : (f)->tm.tmDescent)
-#define FONT_MAX_WIDTH(f) \
- ((f)->bdf ? (f)->bdf->width : (f)->tm.tmMaxCharWidth)
+#define FONT_AVG_WIDTH(f) \
+ ((f)->bdf ? (f)->bdf->width : (f)->tm.tmAveCharWidth)
#define CP_DEFAULT 1004
/* Special pseudo-codepages. */
@@ -100,9 +100,6 @@ struct w32_display_info
/* Chain of all w32_display_info structures. */
struct w32_display_info *next;
- /* The generic display parameters corresponding to this w32 display. */
- struct terminal *terminal;
-
/* This is a cons cell of the form (NAME . FONT-LIST-CACHE).
The same cons cell also appears in x_display_name_list. */
Lisp_Object name_list_element;
@@ -263,6 +260,8 @@ extern Lisp_Object w32_list_fonts P_ ((struct frame *, Lisp_Object, int, int));
extern struct font_info *w32_get_font_info (), *w32_query_font ();
extern void w32_cache_char_metrics (XFontStruct *font);
extern void w32_find_ccl_program();
+extern Lisp_Object x_get_font_repertory P_ ((struct frame *,
+ struct font_info *));
#define PIX_TYPE COLORREF
@@ -275,10 +274,8 @@ extern void w32_find_ccl_program();
diffs between X and w32 code. */
struct x_output
{
-#if 0 /* These are also defined in struct frame. Use that instead. */
PIX_TYPE background_pixel;
PIX_TYPE foreground_pixel;
-#endif
/* Keep track of focus. May be EXPLICIT if we received a FocusIn for this
frame, or IMPLICIT if we received an EnterNotify.
@@ -327,6 +324,10 @@ struct w32_output
/* Default ASCII font of this frame. */
XFontStruct *font;
+#ifdef USE_FONT_BACKEND
+ struct font *fontp;
+#endif /* USE_FONT_BACKEND */
+
/* The baseline offset of the default ASCII font. */
int baseline_offset;
@@ -410,10 +411,16 @@ extern struct w32_output w32term_display;
#define FRAME_W32_WINDOW(f) ((f)->output_data.w32->window_desc)
#define FRAME_X_WINDOW(f) ((f)->output_data.w32->window_desc)
+#define FRAME_FOREGROUND_PIXEL(f) ((f)->output_data.x->foreground_pixel)
+#define FRAME_BACKGROUND_PIXEL(f) ((f)->output_data.x->background_pixel)
#define FRAME_FONT(f) ((f)->output_data.w32->font)
#define FRAME_FONTSET(f) ((f)->output_data.w32->fontset)
#define FRAME_BASELINE_OFFSET(f) ((f)->output_data.w32->baseline_offset)
+#ifdef USE_FONT_BACKEND
+#define FRAME_FONT_OBJECT(f) ((f)->output_data.w32->fontp)
+#endif /* USE_FONT_BACKEND */
+
/* This gives the w32_display_info structure for the display F is on. */
#define FRAME_W32_DISPLAY_INFO(f) (&one_w32_display_info)
#define FRAME_X_DISPLAY_INFO(f) (&one_w32_display_info)
@@ -593,10 +600,10 @@ do { \
} while (0)
#define w32_clear_rect(f,hdc,lprect) \
- w32_fill_rect (f, hdc, FRAME_BACKGROUND_PIXEL (f), lprect)
+w32_fill_rect (f,hdc,f->output_data.x->background_pixel,lprect)
#define w32_clear_area(f,hdc,px,py,nx,ny) \
- w32_fill_area (f, hdc, FRAME_BACKGROUND_PIXEL (f), px, py, nx, ny)
+w32_fill_area (f,hdc,f->output_data.x->background_pixel,px,py,nx,ny)
extern struct font_info *w32_load_font ();
extern void w32_unload_font ();
@@ -612,9 +619,6 @@ extern void w32_unload_font ();
#define WM_XBUTTONDOWN (WM_MOUSEWHEEL + 1)
#define WM_XBUTTONUP (WM_MOUSEWHEEL + 2)
#endif /* WM_XBUTTONDOWN */
-#ifndef WM_MOUSEHWHEEL
-#define WM_MOUSEHWHEEL (WM_MOUSEWHEEL + 4)
-#endif /* WM_MOUSEHWHEEL */
#define WM_EMACS_START (WM_USER + 1)
#define WM_EMACS_KILL (WM_EMACS_START + 0)
@@ -694,9 +698,6 @@ extern void wait_for_sync ();
extern BOOL parse_button ();
-extern void w32_sys_ring_bell (struct frame *f);
-extern void x_delete_display (struct w32_display_info *dpyinfo);
-
/* Keypad command key support. W32 doesn't have virtual keys defined
for the function keys on the keypad (they are mapped to the standard
fuction keys), so we define our own. */
diff --git a/src/w32xfns.c b/src/w32xfns.c
index 9d50676f92..8c87fde3ef 100644
--- a/src/w32xfns.c
+++ b/src/w32xfns.c
@@ -192,6 +192,47 @@ get_next_msg (lpmsg, bWait)
}
nQueue--;
+ /* Consolidate WM_PAINT messages to optimise redrawing. */
+ if (lpmsg->msg.message == WM_PAINT && nQueue)
+ {
+ int_msg * lpCur = lpHead;
+ int_msg * lpPrev = NULL;
+ int_msg * lpNext = NULL;
+
+ while (lpCur && nQueue)
+ {
+ lpNext = lpCur->lpNext;
+ if (lpCur->w32msg.msg.message == WM_PAINT)
+ {
+ /* Remove this message from the queue. */
+ if (lpPrev)
+ lpPrev->lpNext = lpNext;
+ else
+ lpHead = lpNext;
+
+ if (lpCur == lpTail)
+ lpTail = lpPrev;
+
+ /* Adjust clip rectangle to cover both. */
+ if (!UnionRect (&(lpmsg->rect), &(lpmsg->rect),
+ &(lpCur->w32msg.rect)))
+ {
+ SetRectEmpty(&(lpmsg->rect));
+ }
+
+ myfree (lpCur);
+
+ nQueue--;
+
+ lpCur = lpNext;
+ }
+ else
+ {
+ lpPrev = lpCur;
+ lpCur = lpNext;
+ }
+ }
+ }
bRet = TRUE;
}
diff --git a/src/widget.c b/src/widget.c
index c76cce9e32..714da205a6 100644
--- a/src/widget.c
+++ b/src/widget.c
@@ -659,10 +659,10 @@ update_from_various_frame_slots (ew)
struct x_output *x = f->output_data.x;
ew->core.height = FRAME_PIXEL_HEIGHT (f) - x->menubar_height;
ew->core.width = FRAME_PIXEL_WIDTH (f);
- ew->core.background_pixel = FRAME_BACKGROUND_PIXEL (f);
+ ew->core.background_pixel = x->background_pixel;
ew->emacs_frame.internal_border_width = f->internal_border_width;
ew->emacs_frame.font = x->font;
- ew->emacs_frame.foreground_pixel = FRAME_FOREGROUND_PIXEL (f);
+ ew->emacs_frame.foreground_pixel = x->foreground_pixel;
ew->emacs_frame.cursor_color = x->cursor_pixel;
ew->core.border_pixel = x->border_pixel;
}
diff --git a/src/window.c b/src/window.c
index bd1f55b164..43ea423dd9 100644
--- a/src/window.c
+++ b/src/window.c
@@ -21,8 +21,6 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
#include <config.h>
-#include <stdio.h>
-
#include "lisp.h"
#include "buffer.h"
#include "keyboard.h"
@@ -36,7 +34,6 @@ Boston, MA 02110-1301, USA. */
#include "dispextern.h"
#include "blockinput.h"
#include "intervals.h"
-#include "termhooks.h" /* For FRAME_TERMINAL. */
#ifdef HAVE_X_WINDOWS
#include "xterm.h"
@@ -193,10 +190,6 @@ Lisp_Object Qtemp_buffer_show_hook;
EMACS_INT split_height_threshold;
-/* How to split windows (horizontally/vertically/hybrid). */
-
-Lisp_Object Vsplit_window_preferred_function;
-
/* Number of lines of continuity in scrolling by screenfuls. */
EMACS_INT next_screen_context_lines;
@@ -1795,28 +1788,12 @@ candidate_window_p (window, owindow, minibuf, all_frames)
else if (EQ (all_frames, Qvisible))
{
FRAME_SAMPLE_VISIBILITY (f);
- candidate_p = FRAME_VISIBLE_P (f)
- && (FRAME_TERMINAL (XFRAME (w->frame))
- == FRAME_TERMINAL (XFRAME (selected_frame)));
-
+ candidate_p = FRAME_VISIBLE_P (f);
}
else if (INTEGERP (all_frames) && XINT (all_frames) == 0)
{
FRAME_SAMPLE_VISIBILITY (f);
- candidate_p = (FRAME_VISIBLE_P (f) || FRAME_ICONIFIED_P (f)
-#ifdef HAVE_X_WINDOWS
- /* Yuck!! If we've just created the frame and the
- window-manager requested the user to place it
- manually, the window may still not be considered
- `visible'. I'd argue it should be at least
- something like `iconified', but don't know how to do
- that yet. --Stef */
- || (FRAME_X_P (f) && f->output_data.x->asked_for_visible
- && !f->output_data.x->has_been_visible)
-#endif
- )
- && (FRAME_TERMINAL (XFRAME (w->frame))
- == FRAME_TERMINAL (XFRAME (selected_frame)));
+ candidate_p = FRAME_VISIBLE_P (f) || FRAME_ICONIFIED_P (f);
}
else if (WINDOWP (all_frames))
candidate_p = (EQ (FRAME_MINIBUF_WINDOW (f), all_frames)
@@ -2185,10 +2162,8 @@ window_loop (type, obj, mini, frames)
if (NILP (best_window))
best_window = window;
else if (EQ (window, selected_window))
- /* Prefer to return selected-window. */
- RETURN_UNGCPRO (window);
- else if (EQ (Fwindow_frame (window), selected_frame))
- /* Prefer windows on the current frame. */
+ /* For compatibility with 20.x, prefer to return
+ selected-window. */
best_window = window;
}
break;
@@ -3470,22 +3445,6 @@ selects the buffer of the selected window before each command. */)
if (EQ (window, selected_window))
return window;
- sf = SELECTED_FRAME ();
- if (XFRAME (WINDOW_FRAME (w)) != sf)
- {
- XFRAME (WINDOW_FRAME (w))->selected_window = window;
- /* Use this rather than Fhandle_switch_frame
- so that FRAME_FOCUS_FRAME is moved appropriately as we
- move around in the state where a minibuffer in a separate
- frame is active. */
- Fselect_frame (WINDOW_FRAME (w));
- /* Fselect_frame called us back so we've done all the work already. */
- eassert (EQ (window, selected_window));
- return window;
- }
- else
- sf->selected_window = window;
-
/* Store the current buffer's actual point into the
old selected window. It belongs to that window,
and when the window is not selected, must be in the window. */
@@ -3499,6 +3458,18 @@ selects the buffer of the selected window before each command. */)
}
selected_window = window;
+ sf = SELECTED_FRAME ();
+ if (XFRAME (WINDOW_FRAME (w)) != sf)
+ {
+ XFRAME (WINDOW_FRAME (w))->selected_window = window;
+ /* Use this rather than Fhandle_switch_frame
+ so that FRAME_FOCUS_FRAME is moved appropriately as we
+ move around in the state where a minibuffer in a separate
+ frame is active. */
+ Fselect_frame (WINDOW_FRAME (w));
+ }
+ else
+ sf->selected_window = window;
if (NILP (norecord))
record_buffer (w->buffer);
@@ -3678,7 +3649,7 @@ If `even-window-heights' is non-nil, window heights will be evened out
if displaying the buffer causes two vertically adjacent windows to be
displayed. */)
(buffer, not_this_window, frame)
- Lisp_Object buffer, not_this_window, frame;
+ register Lisp_Object buffer, not_this_window, frame;
{
register Lisp_Object window, tem, swp;
struct frame *f;
@@ -3750,8 +3721,6 @@ displayed. */)
|| !NILP (XWINDOW (FRAME_ROOT_WINDOW (f))->dedicated))
{
Lisp_Object frames;
- struct gcpro gcpro1;
- GCPRO1 (buffer);
frames = Qnil;
if (FRAME_MINIBUF_ONLY_P (f))
@@ -3783,26 +3752,26 @@ displayed. */)
if (!NILP (window)
&& ! FRAME_NO_SPLIT_P (XFRAME (XWINDOW (window)->frame))
&& WINDOW_FULL_WIDTH_P (XWINDOW (window))
- && (window_height (window) >= split_height_threshold
- || (NILP (XWINDOW (window)->parent)))
+ && (window_height (window) >= split_height_threshold
+ || (NILP (XWINDOW (window)->parent)))
&& (window_height (window)
>= (2 * window_min_size_2 (XWINDOW (window), 0))))
- window = call1 (Vsplit_window_preferred_function, window);
+ window = Fsplit_window (window, Qnil, Qnil);
else
{
- Lisp_Object upper, lower, other;
+ Lisp_Object upper, other;
window = Fget_lru_window (frames, Qt);
- /* If the LRU window is tall enough, and either eligible for
- splitting and selected or the only window, split it. */
+ /* If the LRU window is tall enough, and either eligible for splitting
+ and selected or the only window, split it. */
if (!NILP (window)
&& ! FRAME_NO_SPLIT_P (XFRAME (XWINDOW (window)->frame))
- && ((EQ (window, selected_window)
- && window_height (window) >= split_height_threshold)
- || (NILP (XWINDOW (window)->parent)))
- && (window_height (window)
- >= (2 * window_min_size_2 (XWINDOW (window), 0))))
- window = call1 (Vsplit_window_preferred_function, window);
+ && ((EQ (window, selected_window)
+ && window_height (window) >= split_height_threshold)
+ || (NILP (XWINDOW (window)->parent)))
+ && (window_height (window)
+ >= (2 * window_min_size_2 (XWINDOW (window), 0))))
+ window = Fsplit_window (window, Qnil, Qnil);
else
window = Fget_lru_window (frames, Qnil);
/* If Fget_lru_window returned nil, try other approaches. */
@@ -3829,11 +3798,11 @@ displayed. */)
window = Fframe_selected_window (call0 (Vpop_up_frame_function));
/* If window appears above or below another,
even out their heights. */
- other = upper = lower = Qnil;
+ other = upper = Qnil;
if (!NILP (XWINDOW (window)->prev))
- other = upper = XWINDOW (window)->prev, lower = window;
+ other = upper = XWINDOW (window)->prev;
if (!NILP (XWINDOW (window)->next))
- other = lower = XWINDOW (window)->next, upper = window;
+ other = XWINDOW (window)->next, upper = window;
if (!NILP (other)
&& !NILP (Veven_window_heights)
/* Check that OTHER and WINDOW are vertically arrayed. */
@@ -3848,7 +3817,6 @@ displayed. */)
0);
}
}
- UNGCPRO;
}
else
window = Fget_lru_window (Qnil, Qnil);
@@ -6049,7 +6017,7 @@ zero means top of window, negative means relative to bottom of window. */)
struct save_window_data
{
- EMACS_UINT size;
+ EMACS_INT size_from_Lisp_Vector_struct;
struct Lisp_Vector *next_from_Lisp_Vector_struct;
Lisp_Object frame_cols, frame_lines, frame_menu_bar_lines;
Lisp_Object frame_tool_bar_lines;
@@ -6072,7 +6040,7 @@ struct save_window_data
struct saved_window
{
/* these first two must agree with struct Lisp_Vector in lisp.h */
- EMACS_UINT size;
+ EMACS_INT size_from_Lisp_Vector_struct;
struct Lisp_Vector *next_from_Lisp_Vector_struct;
Lisp_Object window;
@@ -6663,7 +6631,6 @@ redirection (see `redirect-frame-focus'). */)
n_windows = count_windows (XWINDOW (FRAME_ROOT_WINDOW (f)));
vec = allocate_other_vector (VECSIZE (struct save_window_data));
- XSETPVECTYPE (vec, PVEC_WINDOW_CONFIGURATION);
data = (struct save_window_data *)vec;
XSETFASTINT (data->frame_cols, FRAME_COLS (f));
@@ -7135,12 +7102,11 @@ freeze_window_start (w, freeze_p)
struct window *w;
void *freeze_p;
{
- if (MINI_WINDOW_P (w)
- || (WINDOWP (selected_window) /* Can be nil in corner cases. */
- && (w == XWINDOW (selected_window)
- || (MINI_WINDOW_P (XWINDOW (selected_window))
- && ! NILP (Vminibuf_scroll_window)
- && w == XWINDOW (Vminibuf_scroll_window)))))
+ if (w == XWINDOW (selected_window)
+ || MINI_WINDOW_P (w)
+ || (MINI_WINDOW_P (XWINDOW (selected_window))
+ && ! NILP (Vminibuf_scroll_window)
+ && w == XWINDOW (Vminibuf_scroll_window)))
freeze_p = NULL;
w->frozen_window_start_p = freeze_p != NULL;
@@ -7303,7 +7269,7 @@ and scrolling positions. */)
void
init_window_once ()
{
- struct frame *f = make_initial_frame ();
+ struct frame *f = make_terminal_frame ();
XSETFRAME (selected_frame, f);
Vterminal_frame = selected_frame;
minibuf_window = f->minibuffer_window;
@@ -7522,15 +7488,6 @@ by `display-buffer'. The value is in line units.
If there is only one window, it is split regardless of this value. */);
split_height_threshold = 500;
- DEFVAR_LISP ("split-window-preferred-function",
- &Vsplit_window_preferred_function,
- doc: /* Function to use to split a window.
-This is used by `display-buffer' to allow the user to choose whether
-to split windows horizontally or vertically or some mix of the two.
-It is called with a window as single argument and should split it in two
-and return the new window. */);
- Vsplit_window_preferred_function = intern ("split-window");
-
DEFVAR_INT ("window-min-height", &window_min_height,
doc: /* *Delete any window less than this tall (including its mode line).
The value is in line units. */);
diff --git a/src/window.h b/src/window.h
index 3b9107acaa..ea8965392c 100644
--- a/src/window.h
+++ b/src/window.h
@@ -92,7 +92,7 @@ struct window
{
/* The first two fields are really the header of a vector */
/* The window code does not refer to them. */
- EMACS_UINT size;
+ EMACS_INT size;
struct Lisp_Vector *vec_next;
/* The frame this window is on. */
Lisp_Object frame;
@@ -744,7 +744,7 @@ extern Lisp_Object Vminibuf_scroll_window;
/* Nil or a symbol naming the window system under which emacs is
running ('x is the only current possibility) */
-extern Lisp_Object Vinitial_window_system;
+extern Lisp_Object Vwindow_system;
/* Version number of X windows: 10, 11 or nil. */
diff --git a/src/xdisp.c b/src/xdisp.c
index da254bc11b..3a85ef9dd2 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -177,6 +177,7 @@ Boston, MA 02110-1301, USA. */
#include "termchar.h"
#include "dispextern.h"
#include "buffer.h"
+#include "character.h"
#include "charset.h"
#include "indent.h"
#include "commands.h"
@@ -201,6 +202,12 @@ Boston, MA 02110-1301, USA. */
#include "macterm.h"
#endif
+#ifdef HAVE_WINDOW_SYSTEM
+#ifdef USE_FONT_BACKEND
+#include "font.h"
+#endif /* USE_FONT_BACKEND */
+#endif /* HAVE_WINDOW_SYSTEM */
+
#ifndef FRAME_X_OUTPUT
#define FRAME_X_OUTPUT(f) ((f)->output_data.x)
#endif
@@ -580,12 +587,21 @@ Lisp_Object Vmessage_log_max;
static Lisp_Object Vmessages_buffer_name;
-/* Current, index 0, and last displayed echo area message. Either
- buffers from echo_buffers, or nil to indicate no message. */
+/* Index 0 is the buffer that holds the current (desired) echo area message,
+ or nil if none is desired right now.
+
+ Index 1 is the buffer that holds the previously displayed echo area message,
+ or nil to indicate no message. This is normally what's on the screen now.
+
+ These two can point to the same buffer. That happens when the last
+ message output by the user (or made by echoing) has been displayed. */
Lisp_Object echo_area_buffer[2];
-/* The buffers referenced from echo_area_buffer. */
+/* Permanent pointers to the two buffers that are used for echo area
+ purposes. Once the two buffers are made, and their pointers are
+ placed here, these two slots remain unchanged unless those buffers
+ need to be created afresh. */
static Lisp_Object echo_buffer[2];
@@ -744,6 +760,7 @@ static enum prop_handled handle_display_prop P_ ((struct it *));
static enum prop_handled handle_composition_prop P_ ((struct it *));
static enum prop_handled handle_overlay_change P_ ((struct it *));
static enum prop_handled handle_fontified_prop P_ ((struct it *));
+static enum prop_handled handle_auto_composed_prop P_ ((struct it *));
/* Properties handled by iterators. */
@@ -755,6 +772,7 @@ static struct props it_props[] =
{&Qface, FACE_PROP_IDX, handle_face_prop},
{&Qdisplay, DISPLAY_PROP_IDX, handle_display_prop},
{&Qinvisible, INVISIBLE_PROP_IDX, handle_invisible_prop},
+ {&Qauto_composed, AUTO_COMPOSED_PROP_IDX, handle_auto_composed_prop},
{&Qcomposition, COMPOSITION_PROP_IDX, handle_composition_prop},
{NULL, 0, NULL}
};
@@ -804,6 +822,10 @@ static int clear_face_cache_count;
static int clear_image_cache_count;
#endif
+/* Record the previous terminal frame we displayed. */
+
+static struct frame *previous_terminal_frame;
+
/* Non-zero while redisplay_internal is in progress. */
int redisplaying_p;
@@ -1923,6 +1945,14 @@ get_glyph_string_clip_rects (s, rects, n)
}
}
+ if (s->row->clip)
+ {
+ XRectangle r_save = r;
+
+ if (! x_intersect_rectangles (&r_save, s->row->clip, &r))
+ r.width = 0;
+ }
+
if ((s->for_overlaps & OVERLAPS_BOTH) == 0
|| ((s->for_overlaps & OVERLAPS_BOTH) == OVERLAPS_BOTH && n == 1))
{
@@ -2495,7 +2525,7 @@ init_iterator (it, w, charpos, bytepos, row, base_face_id)
XSETWINDOW (it->window, w);
it->w = w;
it->f = XFRAME (w->frame);
-
+
/* Extra space between lines (on window systems only). */
if (base_face_id == DEFAULT_FACE_ID
&& FRAME_WINDOW_P (it->f))
@@ -2512,9 +2542,9 @@ init_iterator (it, w, charpos, bytepos, row, base_face_id)
/* If realized faces have been removed, e.g. because of face
attribute changes of named faces, recompute them. When running
- in batch mode, the face cache of the initial frame is null. If
+ in batch mode, the face cache of Vterminal_frame is null. If
we happen to get called, make a dummy face cache. */
- if (FRAME_FACE_CACHE (it->f) == NULL)
+ if (noninteractive && FRAME_FACE_CACHE (it->f) == NULL)
init_frame_faces (it->f);
if (FRAME_FACE_CACHE (it->f)->used == 0)
recompute_basic_faces (it->f);
@@ -3491,7 +3521,7 @@ face_before_or_after_it_pos (it, before_p)
struct face *face = FACE_FROM_ID (it->f, face_id);
c = string_char_and_length (p, rest, &len);
- face_id = FACE_FOR_CHAR (it->f, face, c);
+ face_id = FACE_FOR_CHAR (it->f, face, c, CHARPOS (pos), it->string);
}
}
else
@@ -3530,7 +3560,7 @@ face_before_or_after_it_pos (it, before_p)
{
int c = FETCH_MULTIBYTE_CHAR (BYTEPOS (pos));
struct face *face = FACE_FROM_ID (it->f, face_id);
- face_id = FACE_FOR_CHAR (it->f, face, c);
+ face_id = FACE_FOR_CHAR (it->f, face, c, CHARPOS (pos), Qnil);
}
}
@@ -3609,8 +3639,7 @@ handle_invisible_prop (it)
}
else
{
- int invis_p;
- EMACS_INT newpos, next_stop, start_charpos;
+ int invis_p, newpos, next_stop, start_charpos;
Lisp_Object pos, prop, overlay;
/* First of all, is there invisible text at this position? */
@@ -3940,7 +3969,7 @@ handle_single_display_spec (it, spec, object, position,
&& EQ (XCAR (spec), Qheight)
&& CONSP (XCDR (spec)))
{
- if (!FRAME_WINDOW_P (it->f))
+ if (FRAME_TERMCAP_P (it->f) || FRAME_MSDOS_P (it->f))
return 0;
it->font_height = XCAR (XCDR (spec));
@@ -4006,7 +4035,7 @@ handle_single_display_spec (it, spec, object, position,
&& EQ (XCAR (spec), Qspace_width)
&& CONSP (XCDR (spec)))
{
- if (!FRAME_WINDOW_P (it->f))
+ if (FRAME_TERMCAP_P (it->f) || FRAME_MSDOS_P (it->f))
return 0;
value = XCAR (XCDR (spec));
@@ -4022,7 +4051,7 @@ handle_single_display_spec (it, spec, object, position,
{
Lisp_Object tem;
- if (!FRAME_WINDOW_P (it->f))
+ if (FRAME_TERMCAP_P (it->f) || FRAME_MSDOS_P (it->f))
return 0;
if (tem = XCDR (spec), CONSP (tem))
@@ -4048,7 +4077,7 @@ handle_single_display_spec (it, spec, object, position,
&& EQ (XCAR (spec), Qraise)
&& CONSP (XCDR (spec)))
{
- if (!FRAME_WINDOW_P (it->f))
+ if (FRAME_TERMCAP_P (it->f) || FRAME_MSDOS_P (it->f))
return 0;
#ifdef HAVE_WINDOW_SYSTEM
@@ -4089,7 +4118,7 @@ handle_single_display_spec (it, spec, object, position,
int face_id = DEFAULT_FACE_ID;
int fringe_bitmap;
- if (!FRAME_WINDOW_P (it->f))
+ if (FRAME_TERMCAP_P (it->f) || FRAME_MSDOS_P (it->f))
/* If we return here, POSITION has been advanced
across the text with this property. */
return 0;
@@ -4106,7 +4135,7 @@ handle_single_display_spec (it, spec, object, position,
{
Lisp_Object face_name = XCAR (XCDR (XCDR (spec)));
int face_id2 = lookup_derived_face (it->f, face_name,
- 'A', FRINGE_FACE_ID, 0);
+ FRINGE_FACE_ID, 0);
if (face_id2 >= 0)
face_id = face_id2;
}
@@ -4138,7 +4167,7 @@ handle_single_display_spec (it, spec, object, position,
it->left_user_fringe_face_id = face_id;
}
else
- {
+ {
it->right_user_fringe_bitmap = fringe_bitmap;
it->right_user_fringe_face_id = face_id;
}
@@ -4183,9 +4212,9 @@ handle_single_display_spec (it, spec, object, position,
valid_p = (STRINGP (value)
#ifdef HAVE_WINDOW_SYSTEM
- || (FRAME_WINDOW_P (it->f) && valid_image_p (value))
+ || (!FRAME_TERMCAP_P (it->f) && valid_image_p (value))
#endif /* not HAVE_WINDOW_SYSTEM */
- || (CONSP (value) && EQ (XCAR (value), Qspace)));
+ || (CONSP (value) && EQ (XCAR (value), Qspace)));
if (valid_p && !display_replaced_before_p)
{
@@ -4255,7 +4284,7 @@ handle_single_display_spec (it, spec, object, position,
}
-/* Check if SPEC is a display sub-property value whose text should be
+/* Check if SPEC is a display specification value whose text should be
treated as intangible. */
static int
@@ -4457,6 +4486,117 @@ string_buffer_position (w, string, around_charpos)
`composition' property
***********************************************************************/
+static enum prop_handled
+handle_auto_composed_prop (it)
+ struct it *it;
+{
+ enum prop_handled handled = HANDLED_NORMALLY;
+
+ if (FUNCTIONP (Vauto_composition_function))
+ {
+ Lisp_Object val;
+ EMACS_INT pos, this_pos;
+
+ if (STRINGP (it->string))
+ pos = IT_STRING_CHARPOS (*it);
+ else
+ pos = IT_CHARPOS (*it);
+ this_pos = pos;
+
+ val =Fget_char_property (make_number (pos), Qauto_composed, it->string);
+ if (! NILP (val))
+ {
+ Lisp_Object limit = Qnil, next;
+
+ /* As Fnext_single_char_property_change is very slow, we
+ limit the search to the current line. */
+ if (STRINGP (it->string))
+ limit = make_number (SCHARS (it->string));
+ else
+ limit = make_number (find_next_newline_no_quit (pos, 1));
+
+ next = (Fnext_single_property_change
+ (make_number (pos), Qauto_composed, it->string, limit));
+ if (XINT (next) < XINT (limit))
+ {
+ /* The current point is auto-composed, but there exist
+ characters not yet composed beyond the auto-composed
+ region. There's a possiblity that the last
+ characters in the region may be newly composed. */
+ int charpos = XINT (next) - 1, bytepos, c;
+
+ if (STRINGP (it->string))
+ {
+ bytepos = string_char_to_byte (it->string, charpos);
+ c = SDATA (it->string)[bytepos];
+ }
+ else
+ {
+ bytepos = CHAR_TO_BYTE (charpos);
+ c = FETCH_BYTE (bytepos);
+ }
+ if (c != '\n')
+ /* If the last character is not newline, it may be
+ composed with the following characters. */
+ val = Qnil, pos = charpos + 1;
+ }
+ }
+ if (NILP (val))
+ {
+ int count = SPECPDL_INDEX ();
+ Lisp_Object args[4];
+
+ args[0] = Vauto_composition_function;
+ specbind (Qauto_composition_function, Qnil);
+ args[1] = make_number (pos);
+ args[2] = it->string;
+#ifdef USE_FONT_BACKEND
+ if (enable_font_backend)
+ {
+ struct face *face = FACE_FROM_ID (it->f, it->face_id);
+ int c;
+
+ if (STRINGP (it->string))
+ {
+ EMACS_INT pos_byte = IT_STRING_BYTEPOS (*it);
+ const unsigned char *s = SDATA (it->string) + pos_byte;
+
+ if (STRING_MULTIBYTE (it->string))
+ it->c = STRING_CHAR (s, 0);
+ else
+ it->c = *s;
+ }
+ else
+ {
+ EMACS_INT pos_byte = IT_BYTEPOS (*it);
+
+ it->c = FETCH_CHAR (pos_byte);
+ }
+ args[3] = font_at (it->c, this_pos, face, it->w, it->string);
+ }
+ else
+#endif /* USE_FONT_BACKEND */
+ args[3] = Qnil;
+ safe_call (4, args);
+ unbind_to (count, Qnil);
+
+ if (this_pos == pos)
+ {
+ val = Fget_char_property (args[1], Qauto_composed, it->string);
+ /* Return HANDLED_RECOMPUTE_PROPS only if function composed
+ something. This avoids an endless loop if they failed to
+ fontify the text for which reason ever. */
+ if (! NILP (val))
+ handled = HANDLED_RECOMPUTE_PROPS;
+ }
+ else
+ handled = HANDLED_RECOMPUTE_PROPS;
+ }
+ }
+
+ return handled;
+}
+
/* Set up iterator IT from `composition' property at its current
position. Called from handle_stop. */
@@ -4465,7 +4605,7 @@ handle_composition_prop (it)
struct it *it;
{
Lisp_Object prop, string;
- int pos, pos_byte, end;
+ EMACS_INT pos, pos_byte, start, end;
enum prop_handled handled = HANDLED_NORMALLY;
if (STRINGP (it->string))
@@ -4484,11 +4624,20 @@ handle_composition_prop (it)
/* If there's a valid composition and point is not inside of the
composition (in the case that the composition is from the current
buffer), draw a glyph composed from the composition components. */
- if (find_composition (pos, -1, &pos, &end, &prop, string)
- && COMPOSITION_VALID_P (pos, end, prop)
- && (STRINGP (it->string) || (PT <= pos || PT >= end)))
+ if (find_composition (pos, -1, &start, &end, &prop, string)
+ && COMPOSITION_VALID_P (start, end, prop)
+ && (STRINGP (it->string) || (PT <= start || PT >= end)))
{
- int id = get_composition_id (pos, pos_byte, end - pos, prop, string);
+ int id;
+
+ if (start != pos)
+ {
+ if (STRINGP (it->string))
+ pos_byte = string_char_to_byte (it->string, start);
+ else
+ pos_byte = CHAR_TO_BYTE (start);
+ }
+ id = get_composition_id (start, pos_byte, end - start, prop, string);
if (id >= 0)
{
@@ -4517,9 +4666,29 @@ handle_composition_prop (it)
it->method = GET_FROM_COMPOSITION;
it->cmp_id = id;
it->cmp_len = COMPOSITION_LENGTH (prop);
- /* For a terminal, draw only the first character of the
- components. */
- it->c = COMPOSITION_GLYPH (composition_table[id], 0);
+ /* For a terminal, draw only the first (non-TAB) character
+ of the components. */
+#ifdef USE_FONT_BACKEND
+ if (composition_table[id]->method == COMPOSITION_WITH_GLYPH_STRING)
+ {
+ Lisp_Object lgstring = AREF (XHASH_TABLE (composition_hash_table)
+ ->key_and_value,
+ cmp->hash_index * 2);
+
+ it->c = XINT (LGLYPH_CHAR (LGSTRING_GLYPH (lgstring, 0)));
+ }
+ else
+#endif /* USE_FONT_BACKEND */
+ {
+ int i;
+
+ for (i = 0; i < cmp->glyph_len; i++)
+ if ((it->c = COMPOSITION_GLYPH (composition_table[id], i))
+ != '\t')
+ break;
+ }
+ if (it->c == '\t')
+ it->c = ' ';
it->len = (STRINGP (it->string)
? string_char_to_byte (it->string, end)
: CHAR_TO_BYTE (end)) - pos_byte;
@@ -5536,31 +5705,26 @@ get_next_display_element (it)
the translation. This could easily be changed but I
don't believe that it is worth doing.
- If it->multibyte_p is nonzero, eight-bit characters and
- non-printable multibyte characters are also translated to
- octal form.
+ If it->multibyte_p is nonzero, non-printable non-ASCII
+ characters are also translated to octal form.
If it->multibyte_p is zero, eight-bit characters that
don't have corresponding multibyte char code are also
translated to octal form. */
else if ((it->c < ' '
- && (it->area != TEXT_AREA
- /* In mode line, treat \n like other crl chars. */
- || (it->c != '\t'
- && it->glyph_row && it->glyph_row->mode_line_p)
- || (it->c != '\n' && it->c != '\t')))
- || (it->multibyte_p
- ? ((it->c >= 127
- && it->len == 1)
- || !CHAR_PRINTABLE_P (it->c)
+ ? (it->area != TEXT_AREA
+ /* In mode line, treat \n, \t like other crl chars. */
+ || (it->c != '\t'
+ && it->glyph_row && it->glyph_row->mode_line_p)
+ || (it->c != '\n' && it->c != '\t'))
+ : (it->multibyte_p
+ ? (!CHAR_PRINTABLE_P (it->c)
|| (!NILP (Vnobreak_char_display)
- && (it->c == 0x8a0 || it->c == 0x8ad
- || it->c == 0x920 || it->c == 0x92d
- || it->c == 0xe20 || it->c == 0xe2d
- || it->c == 0xf20 || it->c == 0xf2d)))
+ && (it->c == 0xA0 /* NO-BREAK SPACE */
+ || it->c == 0xAD /* SOFT HYPHEN */)))
: (it->c >= 127
- && (!unibyte_display_via_language_environment
- || it->c == unibyte_char_to_multibyte (it->c)))))
+ && (! unibyte_display_via_language_environment
+ || (UNIBYTE_CHAR_HAS_MULTIBYTE_P (it->c)))))))
{
/* IT->c is a control character which must be displayed
either as '\003' or as `^C' where the '\\' and '^'
@@ -5617,8 +5781,7 @@ get_next_display_element (it)
highlighting. */
if (EQ (Vnobreak_char_display, Qt)
- && (it->c == 0x8a0 || it->c == 0x920
- || it->c == 0xe20 || it->c == 0xf20))
+ && it->c == 0xA0)
{
/* Merge the no-break-space face into the current face. */
face_id = merge_faces (it->f, Qnobreak_space, 0,
@@ -5669,8 +5832,7 @@ get_next_display_element (it)
highlighting. */
if (EQ (Vnobreak_char_display, Qt)
- && (it->c == 0x8ad || it->c == 0x92d
- || it->c == 0xe2d || it->c == 0xf2d))
+ && it->c == 0xAD)
{
g = it->c = '-';
XSETINT (it->ctl_chars[0], g);
@@ -5681,13 +5843,10 @@ get_next_display_element (it)
/* Handle non-break space and soft hyphen
with the escape glyph. */
- if (it->c == 0x8a0 || it->c == 0x8ad
- || it->c == 0x920 || it->c == 0x92d
- || it->c == 0xe20 || it->c == 0xe2d
- || it->c == 0xf20 || it->c == 0xf2d)
+ if (it->c == 0xA0 || it->c == 0xAD)
{
XSETINT (it->ctl_chars[0], escape_glyph);
- g = it->c = ((it->c & 0xf) == 0 ? ' ' : '-');
+ g = it->c = (it->c == 0xA0 ? ' ' : '-');
XSETINT (it->ctl_chars[1], g);
ctl_len = 2;
goto display_control;
@@ -5699,23 +5858,27 @@ get_next_display_element (it)
int i;
/* Set IT->ctl_chars[0] to the glyph for `\\'. */
- if (SINGLE_BYTE_CHAR_P (it->c))
- str[0] = it->c, len = 1;
+ if (CHAR_BYTE8_P (it->c))
+ {
+ str[0] = CHAR_TO_BYTE8 (it->c);
+ len = 1;
+ }
+ else if (it->c < 256)
+ {
+ str[0] = it->c;
+ len = 1;
+ }
else
{
- len = CHAR_STRING_NO_SIGNAL (it->c, str);
- if (len < 0)
- {
- /* It's an invalid character, which shouldn't
- happen actually, but due to bugs it may
- happen. Let's print the char as is, there's
- not much meaningful we can do with it. */
- str[0] = it->c;
- str[1] = it->c >> 8;
- str[2] = it->c >> 16;
- str[3] = it->c >> 24;
- len = 4;
- }
+ /* It's an invalid character, which shouldn't
+ happen actually, but due to bugs it may
+ happen. Let's print the char as is, there's
+ not much meaningful we can do with it. */
+ str[0] = it->c;
+ str[1] = it->c >> 8;
+ str[2] = it->c >> 16;
+ str[3] = it->c >> 24;
+ len = 4;
}
for (i = 0; i < len; i++)
@@ -5746,16 +5909,21 @@ get_next_display_element (it)
goto get_next;
}
}
+ }
- /* Adjust face id for a multibyte character. There are no
- multibyte character in unibyte text. */
- if (it->multibyte_p
- && success_p
- && FRAME_WINDOW_P (it->f))
- {
- struct face *face = FACE_FROM_ID (it->f, it->face_id);
- it->face_id = FACE_FOR_CHAR (it->f, face, it->c);
- }
+ /* Adjust face id for a multibyte character. There are no multibyte
+ character in unibyte text. */
+ if ((it->what == IT_CHARACTER || it->what == IT_COMPOSITION)
+ && it->multibyte_p
+ && success_p
+ && FRAME_WINDOW_P (it->f))
+ {
+ struct face *face = FACE_FROM_ID (it->f, it->face_id);
+ int pos = (it->s ? -1
+ : STRINGP (it->string) ? IT_STRING_CHARPOS (*it)
+ : IT_CHARPOS (*it));
+
+ it->face_id = FACE_FOR_CHAR (it->f, face, it->c, pos, it->string);
}
/* Is this character the last one of a run of characters with
@@ -6757,6 +6925,16 @@ move_it_to (it, to_charpos, to_x, to_y, to_vpos, op)
the line. */
if (skip == MOVE_X_REACHED)
{
+ /* Wait! We can conclude that TO_Y is in the line if
+ the already scanned glyphs make the line tall enough
+ because further scanning doesn't make it shorter. */
+ line_height = it->max_ascent + it->max_descent;
+ if (to_y >= it->current_y
+ && to_y < it->current_y + line_height)
+ {
+ reached = 6;
+ break;
+ }
it_backup = *it;
TRACE_MOVE ((stderr, "move_it: from %d\n", IT_CHARPOS (*it)));
skip2 = move_it_in_display_line_to (it, to_charpos, -1,
@@ -7293,7 +7471,7 @@ message_dolog (m, nbytes, nlflag, multibyte)
for (i = 0; i < nbytes; i += char_bytes)
{
c = string_char_and_length (m + i, nbytes - i, &char_bytes);
- work[0] = (SINGLE_BYTE_CHAR_P (c)
+ work[0] = (ASCII_CHAR_P (c)
? c
: multibyte_char_to_unibyte (c, Qnil));
insert_1_both (work, 1, 1, 1, 0, 0);
@@ -7309,7 +7487,8 @@ message_dolog (m, nbytes, nlflag, multibyte)
for the *Message* buffer. */
for (i = 0; i < nbytes; i++)
{
- c = unibyte_char_to_multibyte (msg[i]);
+ c = msg[i];
+ c = unibyte_char_to_multibyte (c);
char_bytes = CHAR_STRING (c, str);
insert_1_both (str, 1, char_bytes, 1, 0, 0);
}
@@ -7516,8 +7695,8 @@ message2_nolog (m, nbytes, multibyte)
do_pending_window_change (0);
echo_area_display (1);
do_pending_window_change (0);
- if (FRAME_TERMINAL (f)->frame_up_to_date_hook != 0 && ! gc_in_progress)
- (*FRAME_TERMINAL (f)->frame_up_to_date_hook) (f);
+ if (frame_up_to_date_hook != 0 && ! gc_in_progress)
+ (*frame_up_to_date_hook) (f);
}
}
@@ -7620,8 +7799,8 @@ message3_nolog (m, nbytes, multibyte)
do_pending_window_change (0);
echo_area_display (1);
do_pending_window_change (0);
- if (FRAME_TERMINAL (f)->frame_up_to_date_hook != 0 && ! gc_in_progress)
- (*FRAME_TERMINAL (f)->frame_up_to_date_hook) (f);
+ if (frame_up_to_date_hook != 0 && ! gc_in_progress)
+ (*frame_up_to_date_hook) (f);
}
}
@@ -7859,10 +8038,6 @@ ensure_echo_area_buffers ()
WHICH > 0 means use echo_area_buffer[1]. If that is nil, choose a
suitable buffer from echo_buffer[] and clear it.
- If WHICH < 0, set echo_area_buffer[1] to echo_area_buffer[0], so
- that the current message becomes the last displayed one, make
- choose a suitable buffer for echo_area_buffer[0], and clear it.
-
Value is what FN returns. */
static int
@@ -7887,17 +8062,6 @@ with_echo_area_buffer (w, which, fn, a1, a2, a3, a4)
this_one = 0, the_other = 1;
else if (which > 0)
this_one = 1, the_other = 0;
- else
- {
- this_one = 0, the_other = 1;
- clear_buffer_p = 1;
-
- /* We need a fresh one in case the current echo buffer equals
- the one containing the last displayed echo area message. */
- if (!NILP (echo_area_buffer[this_one])
- && EQ (echo_area_buffer[this_one], echo_area_buffer[the_other]))
- echo_area_buffer[this_one] = Qnil;
- }
/* Choose a suitable buffer from echo_buffer[] is we don't
have one. */
@@ -8535,7 +8699,7 @@ set_message (s, string, nbytes, multibyte_p)
= ((s && multibyte_p)
|| (STRINGP (string) && STRING_MULTIBYTE (string)));
- with_echo_area_buffer (0, -1, set_message_1,
+ with_echo_area_buffer (0, 0, set_message_1,
(EMACS_INT) s, string, nbytes, multibyte_p);
message_buf_print = 0;
help_echo_showing_p = 0;
@@ -8565,6 +8729,7 @@ set_message_1 (a1, a2, nbytes, multibyte_p)
/* Insert new message at BEG. */
TEMP_SET_PT_BOTH (BEG, BEG_BYTE);
+ Ferase_buffer ();
if (STRINGP (string))
{
@@ -8594,7 +8759,7 @@ set_message_1 (a1, a2, nbytes, multibyte_p)
for (i = 0; i < nbytes; i += n)
{
c = string_char_and_length (s + i, nbytes - i, &n);
- work[0] = (SINGLE_BYTE_CHAR_P (c)
+ work[0] = (ASCII_CHAR_P (c)
? c
: multibyte_char_to_unibyte (c, Qnil));
insert_1_both (work, 1, 1, 1, 0, 0);
@@ -8611,7 +8776,8 @@ set_message_1 (a1, a2, nbytes, multibyte_p)
/* Convert a single-byte string to multibyte. */
for (i = 0; i < nbytes; i++)
{
- c = unibyte_char_to_multibyte (msg[i]);
+ c = msg[i];
+ c = unibyte_char_to_multibyte (c);
n = CHAR_STRING (c, str);
insert_1_both (str, 1, n, 1, 0, 0);
}
@@ -8660,11 +8826,11 @@ clear_garbaged_frames ()
{
Lisp_Object tail, frame;
int changed_count = 0;
-
+
FOR_EACH_FRAME (tail, frame)
{
struct frame *f = XFRAME (frame);
-
+
if (FRAME_VISIBLE_P (f) && FRAME_GARBAGED_P (f))
{
if (f->resized_p)
@@ -8678,7 +8844,7 @@ clear_garbaged_frames ()
f->resized_p = 0;
}
}
-
+
frame_garbaged = 0;
if (changed_count)
++windows_or_buffers_changed;
@@ -8711,10 +8877,11 @@ echo_area_display (update_frame_p)
/* The terminal frame is used as the first Emacs frame on the Mac OS. */
#ifndef MAC_OS8
#ifdef HAVE_WINDOW_SYSTEM
- /* When Emacs starts, selected_frame may be the initial terminal
- frame. If we let this through, a message would be displayed on
- the terminal. */
- if (FRAME_INITIAL_P (XFRAME (selected_frame)))
+ /* When Emacs starts, selected_frame may be a visible terminal
+ frame, even if we run under a window system. If we let this
+ through, a message would be displayed on the terminal. */
+ if (EQ (selected_frame, Vterminal_frame)
+ && !NILP (Vwindow_system))
return 0;
#endif /* HAVE_WINDOW_SYSTEM */
#endif
@@ -8765,7 +8932,7 @@ echo_area_display (update_frame_p)
Can do with a display update of the echo area,
unless we displayed some mode lines. */
update_single_window (w, 1);
- FRAME_RIF (f)->flush_display (f);
+ rif->flush_display (f);
}
else
update_frame (f, 1, 1);
@@ -8780,10 +8947,8 @@ echo_area_display (update_frame_p)
else if (!EQ (mini_window, selected_window))
windows_or_buffers_changed++;
- /* Last displayed message is now the current message. */
+ /* The current message is now also the last one displayed. */
echo_area_buffer[1] = echo_area_buffer[0];
- /* Inform read_char that we're not echoing. */
- echo_message_buffer = Qnil;
/* Prevent redisplay optimization in redisplay_internal by resetting
this_line_start_pos. This is done because the mini-buffer now
@@ -9337,8 +9502,8 @@ x_cursor_to (vpos, hpos, y, x)
{
BLOCK_INPUT;
display_and_set_cursor (w, 1, hpos, vpos, x, y);
- if (FRAME_RIF (SELECTED_FRAME ())->flush_display_optional)
- FRAME_RIF (SELECTED_FRAME ())->flush_display_optional (SELECTED_FRAME ());
+ if (rif->flush_display_optional)
+ rif->flush_display_optional (SELECTED_FRAME ());
UNBLOCK_INPUT;
}
}
@@ -10709,7 +10874,7 @@ check_point_in_composition (prev_buf, prev_pt, buf, pt)
struct buffer *prev_buf, *buf;
int prev_pt, pt;
{
- int start, end;
+ EMACS_INT start, end;
Lisp_Object prop;
Lisp_Object buffer;
@@ -10790,8 +10955,6 @@ select_frame_for_redisplay (frame)
Lisp_Object tail, sym, val;
Lisp_Object old = selected_frame;
- xassert (FRAMEP (frame) && FRAME_LIVE_P (XFRAME (frame)));
-
selected_frame = frame;
for (tail = XFRAME (frame)->param_alist; CONSP (tail); tail = XCDR (tail))
@@ -10848,7 +11011,6 @@ redisplay_internal (preserve_echo_area)
int count, count1;
struct frame *sf;
int polling_stopped_here = 0;
- Lisp_Object old_frame = selected_frame;
/* Non-zero means redisplay has to consider all windows on all
frames. Zero means, only selected_window is considered. */
@@ -10910,14 +11072,6 @@ redisplay_internal (preserve_echo_area)
}
retry:
- if (!EQ (old_frame, selected_frame)
- && FRAME_LIVE_P (XFRAME (old_frame)))
- /* When running redisplay, we play a bit fast-and-loose and allow e.g.
- selected_frame and selected_window to be temporarily out-of-sync so
- when we come back here via `goto retry', we need to resync because we
- may need to run Elisp code (via prepare_menu_bars). */
- select_frame_for_redisplay (old_frame);
-
pause = 0;
reconsider_clip_changes (w, current_buffer);
last_escape_glyph_frame = NULL;
@@ -10938,16 +11092,17 @@ redisplay_internal (preserve_echo_area)
if (face_change_count)
++windows_or_buffers_changed;
- if (FRAME_TERMCAP_P (sf)
- && FRAME_TTY (sf)->previous_frame != sf)
+ if (! FRAME_WINDOW_P (sf)
+ && previous_terminal_frame != sf)
{
- /* Since frames on a single ASCII terminal share the same
- display area, displaying a different frame means redisplay
- the whole thing. */
+ /* Since frames on an ASCII terminal share the same display
+ area, displaying a different frame means redisplay the whole
+ thing. */
windows_or_buffers_changed++;
SET_FRAME_GARBAGED (sf);
- FRAME_TTY (sf)->previous_frame = sf;
+ XSETFRAME (Vterminal_frame, sf);
}
+ previous_terminal_frame = sf;
/* Set the visible flags for all frames. Do this before checking
for resized or garbaged frames; they want to know if their frames
@@ -10969,7 +11124,6 @@ redisplay_internal (preserve_echo_area)
}
}
-
/* Notice any pending interrupt request to change frame size. */
do_pending_window_change (1);
@@ -11331,7 +11485,7 @@ redisplay_internal (preserve_echo_area)
{
struct frame *f = XFRAME (frame);
- if (FRAME_WINDOW_P (f) || FRAME_TERMCAP_P (f) || f == sf)
+ if (FRAME_WINDOW_P (f) || f == sf)
{
if (! EQ (frame, selected_frame))
/* Select the frame, for the sake of frame-local
@@ -11340,16 +11494,16 @@ redisplay_internal (preserve_echo_area)
/* Mark all the scroll bars to be removed; we'll redeem
the ones we want when we redisplay their windows. */
- if (FRAME_TERMINAL (f)->condemn_scroll_bars_hook)
- FRAME_TERMINAL (f)->condemn_scroll_bars_hook (f);
+ if (condemn_scroll_bars_hook)
+ condemn_scroll_bars_hook (f);
if (FRAME_VISIBLE_P (f) && !FRAME_OBSCURED_P (f))
redisplay_windows (FRAME_ROOT_WINDOW (f));
/* Any scroll bars which redisplay_windows should have
nuked should now go away. */
- if (FRAME_TERMINAL (f)->judge_scroll_bars_hook)
- FRAME_TERMINAL (f)->judge_scroll_bars_hook (f);
+ if (judge_scroll_bars_hook)
+ judge_scroll_bars_hook (f);
/* If fonts changed, display again. */
/* ??? rms: I suspect it is a mistake to jump all the way
@@ -11396,12 +11550,12 @@ redisplay_internal (preserve_echo_area)
FOR_EACH_FRAME (tail, frame)
{
struct frame *f = XFRAME (frame);
- if (f->updated_p)
- {
- mark_window_display_accurate (f->root_window, 1);
- if (FRAME_TERMINAL (f)->frame_up_to_date_hook)
- FRAME_TERMINAL (f)->frame_up_to_date_hook (f);
- }
+ if (f->updated_p)
+ {
+ mark_window_display_accurate (f->root_window, 1);
+ if (frame_up_to_date_hook)
+ frame_up_to_date_hook (f);
+ }
}
}
}
@@ -11486,8 +11640,8 @@ redisplay_internal (preserve_echo_area)
/* Say overlay arrows are up to date. */
update_overlay_arrows (1);
- if (FRAME_TERMINAL (sf)->frame_up_to_date_hook != 0)
- FRAME_TERMINAL (sf)->frame_up_to_date_hook (sf);
+ if (frame_up_to_date_hook != 0)
+ frame_up_to_date_hook (sf);
}
update_mode_lines = 0;
@@ -11597,9 +11751,8 @@ redisplay_preserve_echo_area (from_where)
else
redisplay_internal (1);
- if (FRAME_RIF (SELECTED_FRAME ()) != NULL
- && FRAME_RIF (SELECTED_FRAME ())->flush_display_optional)
- FRAME_RIF (SELECTED_FRAME ())->flush_display_optional (NULL);
+ if (rif != NULL && rif->flush_display_optional)
+ rif->flush_display_optional (NULL);
}
@@ -11607,8 +11760,7 @@ redisplay_preserve_echo_area (from_where)
redisplay_internal. Reset redisplaying_p to the value it had
before redisplay_internal was called, and clear
prevent_freeing_realized_faces_p. It also selects the previously
- selected frame, unless it has been deleted (by an X connection
- failure during redisplay, for example). */
+ selected frame. */
static Lisp_Object
unwind_redisplay (val)
@@ -11619,8 +11771,7 @@ unwind_redisplay (val)
old_redisplaying_p = XCAR (val);
redisplaying_p = XFASTINT (old_redisplaying_p);
old_frame = XCDR (val);
- if (! EQ (old_frame, selected_frame)
- && FRAME_LIVE_P (XFRAME (old_frame)))
+ if (! EQ (old_frame, selected_frame))
select_frame_for_redisplay (old_frame);
return Qnil;
}
@@ -11731,35 +11882,24 @@ disp_char_vector (dp, c)
struct Lisp_Char_Table *dp;
int c;
{
- int code[4], i;
Lisp_Object val;
- if (SINGLE_BYTE_CHAR_P (c))
- return (dp->contents[c]);
-
- SPLIT_CHAR (c, code[0], code[1], code[2]);
- if (code[1] < 32)
- code[1] = -1;
- else if (code[2] < 32)
- code[2] = -1;
-
- /* Here, the possible range of code[0] (== charset ID) is
- 128..max_charset. Since the top level char table contains data
- for multibyte characters after 256th element, we must increment
- code[0] by 128 to get a correct index. */
- code[0] += 128;
- code[3] = -1; /* anchor */
-
- for (i = 0; code[i] >= 0; i++, dp = XCHAR_TABLE (val))
+ if (ASCII_CHAR_P (c))
{
- val = dp->contents[code[i]];
- if (!SUB_CHAR_TABLE_P (val))
- return (NILP (val) ? dp->defalt : val);
+ val = dp->ascii;
+ if (SUB_CHAR_TABLE_P (val))
+ val = XSUB_CHAR_TABLE (val)->contents[c];
}
+ else
+ {
+ Lisp_Object table;
- /* Here, val is a sub char table. We return the default value of
- it. */
- return (dp->defalt);
+ XSETCHAR_TABLE (table, dp);
+ val = char_table_ref (table, c);
+ }
+ if (NILP (val))
+ val = dp->defalt;
+ return val;
}
@@ -12769,9 +12909,7 @@ set_vertical_scroll_bar (w)
start = end = whole = 0;
/* Indicate what this scroll bar ought to be displaying now. */
- if (FRAME_TERMINAL (XFRAME (w->frame))->set_vertical_scroll_bar_hook)
- (*FRAME_TERMINAL (XFRAME (w->frame))->set_vertical_scroll_bar_hook)
- (w, end - start, whole, start);
+ set_vertical_scroll_bar_hook (w, end - start, whole, start);
}
@@ -13490,22 +13628,20 @@ redisplay_window (window, just_this_one_p)
display_menu_bar (w);
#ifdef HAVE_WINDOW_SYSTEM
- if (FRAME_WINDOW_P (f))
- {
#if defined (USE_GTK) || USE_MAC_TOOLBAR
- redisplay_tool_bar_p = FRAME_EXTERNAL_TOOL_BAR (f);
+ redisplay_tool_bar_p = FRAME_EXTERNAL_TOOL_BAR (f);
#else
- redisplay_tool_bar_p = WINDOWP (f->tool_bar_window)
- && (FRAME_TOOL_BAR_LINES (f) > 0
- || !NILP (Vauto_resize_tool_bars));
+ redisplay_tool_bar_p = WINDOWP (f->tool_bar_window)
+ && (FRAME_TOOL_BAR_LINES (f) > 0
+ || !NILP (Vauto_resize_tool_bars));
+
#endif
- if (redisplay_tool_bar_p && redisplay_tool_bar (f))
- {
- extern int ignore_mouse_drag_p;
- ignore_mouse_drag_p = 1;
- }
- }
+ if (redisplay_tool_bar_p && redisplay_tool_bar (f))
+ {
+ extern int ignore_mouse_drag_p;
+ ignore_mouse_drag_p = 1;
+ }
#endif
}
@@ -13539,8 +13675,7 @@ redisplay_window (window, just_this_one_p)
/* Note that we actually used the scroll bar attached to this
window, so it shouldn't be deleted at the end of redisplay. */
- if (FRAME_TERMINAL (f)->redeem_scroll_bar_hook)
- (*FRAME_TERMINAL (f)->redeem_scroll_bar_hook) (w);
+ redeem_scroll_bar_hook (w);
}
/* Restore current_buffer and value of point in it. */
@@ -13809,10 +13944,10 @@ try_window_reusing_current_matrix (w)
if (run.height > 0 && run.current_y != run.desired_y)
{
update_begin (f);
- FRAME_RIF (f)->update_window_begin_hook (w);
- FRAME_RIF (f)->clear_window_mouse_face (w);
- FRAME_RIF (f)->scroll_run_hook (w, &run);
- FRAME_RIF (f)->update_window_end_hook (w, 0, 0);
+ rif->update_window_begin_hook (w);
+ rif->clear_window_mouse_face (w);
+ rif->scroll_run_hook (w, &run);
+ rif->update_window_end_hook (w, 0, 0);
update_end (f);
}
@@ -13981,10 +14116,10 @@ try_window_reusing_current_matrix (w)
if (run.height)
{
update_begin (f);
- FRAME_RIF (f)->update_window_begin_hook (w);
- FRAME_RIF (f)->clear_window_mouse_face (w);
- FRAME_RIF (f)->scroll_run_hook (w, &run);
- FRAME_RIF (f)->update_window_end_hook (w, 0, 0);
+ rif->update_window_begin_hook (w);
+ rif->clear_window_mouse_face (w);
+ rif->scroll_run_hook (w, &run);
+ rif->update_window_end_hook (w, 0, 0);
update_end (f);
}
@@ -14434,7 +14569,7 @@ try_window_id (w)
/* Window must either use window-based redisplay or be full width. */
if (!FRAME_WINDOW_P (f)
- && (!FRAME_LINE_INS_DEL_OK (f)
+ && (!line_ins_del_ok
|| !WINDOW_FULL_WIDTH_P (w)))
GIVE_UP (4);
@@ -14843,10 +14978,10 @@ try_window_id (w)
if (FRAME_WINDOW_P (f))
{
- FRAME_RIF (f)->update_window_begin_hook (w);
- FRAME_RIF (f)->clear_window_mouse_face (w);
- FRAME_RIF (f)->scroll_run_hook (w, &run);
- FRAME_RIF (f)->update_window_end_hook (w, 0, 0);
+ rif->update_window_begin_hook (w);
+ rif->clear_window_mouse_face (w);
+ rif->scroll_run_hook (w, &run);
+ rif->update_window_end_hook (w, 0, 0);
}
else
{
@@ -14864,36 +14999,36 @@ try_window_id (w)
{
/* Scroll last_unchanged_at_beg_row to the end of the
window down dvpos lines. */
- set_terminal_window (f, end);
+ set_terminal_window (end);
/* On dumb terminals delete dvpos lines at the end
before inserting dvpos empty lines. */
- if (!FRAME_SCROLL_REGION_OK (f))
- ins_del_lines (f, end - dvpos, -dvpos);
+ if (!scroll_region_ok)
+ ins_del_lines (end - dvpos, -dvpos);
/* Insert dvpos empty lines in front of
last_unchanged_at_beg_row. */
- ins_del_lines (f, from, dvpos);
+ ins_del_lines (from, dvpos);
}
else if (dvpos < 0)
{
/* Scroll up last_unchanged_at_beg_vpos to the end of
the window to last_unchanged_at_beg_vpos - |dvpos|. */
- set_terminal_window (f, end);
+ set_terminal_window (end);
/* Delete dvpos lines in front of
last_unchanged_at_beg_vpos. ins_del_lines will set
the cursor to the given vpos and emit |dvpos| delete
line sequences. */
- ins_del_lines (f, from + dvpos, dvpos);
+ ins_del_lines (from + dvpos, dvpos);
/* On a dumb terminal insert dvpos empty lines at the
end. */
- if (!FRAME_SCROLL_REGION_OK (f))
- ins_del_lines (f, end + dvpos, -dvpos);
+ if (!scroll_region_ok)
+ ins_del_lines (end + dvpos, -dvpos);
}
- set_terminal_window (f, 0);
+ set_terminal_window (0);
}
update_end (f);
@@ -15685,7 +15820,7 @@ append_space_for_newline (it, default_face_p)
else if (it->face_before_selective_p)
it->face_id = it->saved_face_id;
face = FACE_FROM_ID (it->f, it->face_id);
- it->face_id = FACE_FOR_CHAR (it->f, face, 0);
+ it->face_id = FACE_FOR_CHAR (it->f, face, 0, -1, Qnil);
PRODUCE_GLYPHS (it);
@@ -15745,9 +15880,9 @@ extend_face_to_end_of_line (it)
ASCII face. This will be automatically undone the next time
get_next_display_element returns a multibyte character. Note
that the character will always be single byte in unibyte text. */
- if (!SINGLE_BYTE_CHAR_P (it->c))
+ if (!ASCII_CHAR_P (it->c))
{
- it->face_id = FACE_FOR_CHAR (f, face, 0);
+ it->face_id = FACE_FOR_CHAR (f, face, 0, -1, Qnil);
}
if (FRAME_WINDOW_P (f))
@@ -15853,7 +15988,7 @@ highlight_trailing_whitespace (f, row)
&& glyph->u.ch == ' '))
&& trailing_whitespace_p (glyph->charpos))
{
- int face_id = lookup_named_face (f, Qtrailing_whitespace, 0, 0);
+ int face_id = lookup_named_face (f, Qtrailing_whitespace, 0);
if (face_id < 0)
return;
@@ -16467,7 +16602,7 @@ display_menu_bar (w)
/* Don't do all this for graphical frames. */
#ifdef HAVE_NTGUI
- if (FRAME_W32_P (f))
+ if (!NILP (Vwindow_system))
return;
#endif
#if defined (USE_X_TOOLKIT) || defined (USE_GTK)
@@ -16698,10 +16833,10 @@ display_mode_line (w, face_id, format)
/* Temporarily make frame's keyboard the current kboard so that
kboard-local variables in the mode_line_format will get the right
values. */
- push_kboard (FRAME_KBOARD (it.f));
+ push_frame_kboard (it.f);
record_unwind_save_match_data ();
display_mode_element (&it, 0, 0, 0, format, Qnil, 0);
- pop_kboard ();
+ pop_frame_kboard ();
unbind_to (count, Qnil);
@@ -17380,7 +17515,7 @@ are the selected window and the window's buffer). */)
{
if (EQ (face, Qt))
face = (EQ (window, selected_window) ? Qmode_line : Qmode_line_inactive);
- face_id = lookup_named_face (XFRAME (WINDOW_FRAME (w)), face, 0, 0);
+ face_id = lookup_named_face (XFRAME (WINDOW_FRAME (w)), face, 0);
}
if (face_id < 0)
@@ -17416,9 +17551,9 @@ are the selected window and the window's buffer). */)
= (NILP (face) ? Qnil : Fcons (Qface, Fcons (face, Qnil)));
}
- push_kboard (FRAME_KBOARD (it.f));
+ push_frame_kboard (it.f);
display_mode_element (&it, 0, 0, 0, format, Qnil, 0);
- pop_kboard ();
+ pop_frame_kboard ();
if (no_props)
{
@@ -17603,7 +17738,7 @@ decode_mode_spec_coding (coding_system, buf, eol_flag)
/* The EOL conversion we are using. */
Lisp_Object eoltype;
- val = Fget (coding_system, Qcoding_system);
+ val = CODING_SYSTEM_SPEC (coding_system);
eoltype = Qnil;
if (!VECTORP (val)) /* Not yet decided. */
@@ -17616,12 +17751,14 @@ decode_mode_spec_coding (coding_system, buf, eol_flag)
}
else
{
+ Lisp_Object attrs;
Lisp_Object eolvalue;
- eolvalue = Fget (coding_system, Qeol_type);
+ attrs = AREF (val, 0);
+ eolvalue = AREF (val, 2);
if (multibyte)
- *buf++ = XFASTINT (AREF (val, 1));
+ *buf++ = XFASTINT (CODING_ATTR_MNEMONIC (attrs));
if (eol_flag)
{
@@ -17631,10 +17768,10 @@ decode_mode_spec_coding (coding_system, buf, eol_flag)
eoltype = eol_mnemonic_undecided;
else if (VECTORP (eolvalue)) /* Not yet decided. */
eoltype = eol_mnemonic_undecided;
- else /* INTEGERP (eolvalue) -- 0:LF, 1:CRLF, 2:CR */
- eoltype = (XFASTINT (eolvalue) == 0
+ else /* eolvalue is Qunix, Qdos, or Qmac. */
+ eoltype = (EQ (eolvalue, Qunix)
? eol_mnemonic_unix
- : (XFASTINT (eolvalue) == 1
+ : (EQ (eolvalue, Qdos) == 1
? eol_mnemonic_dos : eol_mnemonic_mac));
}
}
@@ -17647,8 +17784,7 @@ decode_mode_spec_coding (coding_system, buf, eol_flag)
eol_str = SDATA (eoltype);
eol_str_len = SBYTES (eoltype);
}
- else if (INTEGERP (eoltype)
- && CHAR_VALID_P (XINT (eoltype), 0))
+ else if (CHARACTERP (eoltype))
{
unsigned char *tmp = (unsigned char *) alloca (MAX_MULTIBYTE_LENGTH);
eol_str_len = CHAR_STRING (XINT (eoltype), tmp);
@@ -18052,8 +18188,10 @@ decode_mode_spec (w, c, field_width, precision, multibyte)
{
/* No need to mention EOL here--the terminal never needs
to do EOL conversion. */
- p = decode_mode_spec_coding (FRAME_KEYBOARD_CODING (f)->symbol, p, 0);
- p = decode_mode_spec_coding (FRAME_TERMINAL_CODING (f)->symbol, p, 0);
+ p = decode_mode_spec_coding (CODING_ID_NAME (keyboard_coding.id),
+ p, 0);
+ p = decode_mode_spec_coding (CODING_ID_NAME (terminal_coding.id),
+ p, 0);
}
p = decode_mode_spec_coding (b->buffer_file_coding_system,
p, eol_flag);
@@ -18325,7 +18463,7 @@ display_string (string, lisp_string, face_string, face_string_pos,
}
break;
}
- else if (x + glyph->pixel_width > it->first_visible_x)
+ else if (x + glyph->pixel_width >= it->first_visible_x)
{
/* Glyph is at least partially visible. */
++it->hpos;
@@ -18566,8 +18704,6 @@ calc_pixel_width_or_height (res, it, prop, font, width_p, align_to)
if (NILP (prop))
return OK_PIXELS (0);
- xassert (FRAME_LIVE_P (it->f));
-
if (SYMBOLP (prop))
{
if (SCHARS (SYMBOL_NAME (prop)) == 2)
@@ -18684,8 +18820,7 @@ calc_pixel_width_or_height (res, it, prop, font, width_p, align_to)
if (SYMBOLP (car))
{
#ifdef HAVE_WINDOW_SYSTEM
- if (FRAME_WINDOW_P (it->f)
- && valid_image_p (prop))
+ if (valid_image_p (prop))
{
int id = lookup_image (it->f, prop);
struct image *img = IMAGE_FROM_ID (it->f, id);
@@ -18877,6 +19012,80 @@ append_glyph_string (head, tail, s)
}
+/* Get face and two-byte form of character C in face FACE_ID on frame
+ F. The encoding of C is returned in *CHAR2B. MULTIBYTE_P non-zero
+ means we want to display multibyte text. DISPLAY_P non-zero means
+ make sure that X resources for the face returned are allocated.
+ Value is a pointer to a realized face that is ready for display if
+ DISPLAY_P is non-zero. */
+
+static INLINE struct face *
+get_char_face_and_encoding (f, c, face_id, char2b, multibyte_p, display_p)
+ struct frame *f;
+ int c, face_id;
+ XChar2b *char2b;
+ int multibyte_p, display_p;
+{
+ struct face *face = FACE_FROM_ID (f, face_id);
+
+#ifdef USE_FONT_BACKEND
+ if (enable_font_backend)
+ {
+ struct font *font = (struct font *) face->font_info;
+
+ if (font)
+ {
+ unsigned code = font->driver->encode_char (font, c);
+
+ if (code != FONT_INVALID_CODE)
+ STORE_XCHAR2B (char2b, (code >> 8), (code & 0xFF));
+ else
+ STORE_XCHAR2B (char2b, 0, 0);
+ }
+ }
+ else
+#endif /* USE_FONT_BACKEND */
+ if (!multibyte_p)
+ {
+ /* Unibyte case. We don't have to encode, but we have to make
+ sure to use a face suitable for unibyte. */
+ STORE_XCHAR2B (char2b, 0, c);
+ face_id = FACE_FOR_CHAR (f, face, c, -1, Qnil);
+ face = FACE_FROM_ID (f, face_id);
+ }
+ else if (c < 128)
+ {
+ /* Case of ASCII in a face known to fit ASCII. */
+ STORE_XCHAR2B (char2b, 0, c);
+ }
+ else if (face->font != NULL)
+ {
+ struct font_info *font_info
+ = FONT_INFO_FROM_ID (f, face->font_info_id);
+ struct charset *charset = CHARSET_FROM_ID (font_info->charset);
+ unsigned code = ENCODE_CHAR (charset, c);
+
+ if (CHARSET_DIMENSION (charset) == 1)
+ STORE_XCHAR2B (char2b, 0, code);
+ else
+ STORE_XCHAR2B (char2b, (code >> 8), (code & 0xFF));
+ /* Maybe encode the character in *CHAR2B. */
+ rif->encode_char (c, char2b, font_info, charset, NULL);
+ }
+
+ /* Make sure X resources of the face are allocated. */
+#ifdef HAVE_X_WINDOWS
+ if (display_p)
+#endif
+ {
+ xassert (face != NULL);
+ PREPARE_FACE_FOR_DISPLAY (f, face);
+ }
+
+ return face;
+}
+
+
/* Get face and two-byte form of character glyph GLYPH on frame F.
The encoding of GLYPH->u.ch is returned in *CHAR2B. Value is
a pointer to a realized face that is ready for display. */
@@ -18896,6 +19105,23 @@ get_glyph_face_and_encoding (f, glyph, char2b, two_byte_p)
if (two_byte_p)
*two_byte_p = 0;
+#ifdef USE_FONT_BACKEND
+ if (enable_font_backend)
+ {
+ struct font *font = (struct font *) face->font_info;
+
+ if (font)
+ {
+ unsigned code = font->driver->encode_char (font, glyph->u.ch);
+
+ if (code != FONT_INVALID_CODE)
+ STORE_XCHAR2B (char2b, (code >> 8), (code & 0xFF));
+ else
+ STORE_XCHAR2B (char2b, 0, code);
+ }
+ }
+ else
+#endif /* USE_FONT_BACKEND */
if (!glyph->multibyte_p)
{
/* Unibyte case. We don't have to encode, but we have to make
@@ -18909,24 +19135,25 @@ get_glyph_face_and_encoding (f, glyph, char2b, two_byte_p)
}
else
{
- int c1, c2, charset;
+ struct font_info *font_info
+ = FONT_INFO_FROM_ID (f, face->font_info_id);
+ if (font_info)
+ {
+ struct charset *charset = CHARSET_FROM_ID (font_info->charset);
+ unsigned code = ENCODE_CHAR (charset, glyph->u.ch);
- /* Split characters into bytes. If c2 is -1 afterwards, C is
- really a one-byte character so that byte1 is zero. */
- SPLIT_CHAR (glyph->u.ch, charset, c1, c2);
- if (c2 > 0)
- STORE_XCHAR2B (char2b, c1, c2);
- else
- STORE_XCHAR2B (char2b, 0, c1);
+ if (CHARSET_DIMENSION (charset) == 1)
+ STORE_XCHAR2B (char2b, 0, code);
+ else
+ STORE_XCHAR2B (char2b, (code >> 8), (code & 0xFF));
- /* Maybe encode the character in *CHAR2B. */
- if (charset != CHARSET_ASCII)
- {
- struct font_info *font_info
- = FONT_INFO_FROM_ID (f, face->font_info_id);
- if (font_info)
- glyph->font_type
- = FRAME_RIF (f)->encode_char (glyph->u.ch, char2b, font_info, two_byte_p);
+ /* Maybe encode the character in *CHAR2B. */
+ if (CHARSET_ID (charset) != charset_ascii)
+ {
+ glyph->font_type
+ = rif->encode_char (glyph->u.ch, char2b, font_info, charset,
+ two_byte_p);
+ }
}
}
@@ -18939,7 +19166,7 @@ get_glyph_face_and_encoding (f, glyph, char2b, two_byte_p)
/* Fill glyph string S with composition components specified by S->cmp.
- FACES is an array of faces for all components of this composition.
+ BASE_FACE is the base face of the composition.
S->gidx is the index of the first component for S.
OVERLAPS non-zero means S should draw the foreground only, and use
@@ -18948,9 +19175,9 @@ get_glyph_face_and_encoding (f, glyph, char2b, two_byte_p)
Value is the index of a component not in S. */
static int
-fill_composite_glyph_string (s, faces, overlaps)
+fill_composite_glyph_string (s, base_face, overlaps)
struct glyph_string *s;
- struct face **faces;
+ struct face *base_face;
int overlaps;
{
int i;
@@ -18959,21 +19186,69 @@ fill_composite_glyph_string (s, faces, overlaps)
s->for_overlaps = overlaps;
- s->face = faces[s->gidx];
- s->font = s->face->font;
- s->font_info = FONT_INFO_FROM_ID (s->f, s->face->font_info_id);
+#ifdef USE_FONT_BACKEND
+ if (enable_font_backend && s->cmp->method == COMPOSITION_WITH_GLYPH_STRING)
+ {
+ Lisp_Object gstring
+ = AREF (XHASH_TABLE (composition_hash_table)->key_and_value,
+ s->cmp->hash_index * 2);
- /* For all glyphs of this composition, starting at the offset
- S->gidx, until we reach the end of the definition or encounter a
- glyph that requires the different face, add it to S. */
- ++s->nchars;
- for (i = s->gidx + 1; i < s->cmp->glyph_len && faces[i] == s->face; ++i)
- ++s->nchars;
+ s->face = base_face;
+ s->font_info = s->cmp->font;
+ s->font = s->font_info->font;
+ for (i = 0, s->nchars = 0; i < s->cmp->glyph_len; i++, s->nchars++)
+ {
+ Lisp_Object g = LGSTRING_GLYPH (gstring, i);
+ unsigned code;
+ XChar2b * store_pos;
+ if (NILP (LGLYPH_FROM (g)))
+ break;
+ code = XUINT (LGLYPH_CODE (g));
+ store_pos = s->char2b + i;
+ STORE_XCHAR2B (store_pos, code >> 8, code & 0xFF);
+ }
+ s->width = s->cmp->pixel_width;
+ }
+ else
+#endif /* USE_FONT_BACKEND */
+ {
+ /* For all glyphs of this composition, starting at the offset
+ S->gidx, until we reach the end of the definition or encounter a
+ glyph that requires the different face, add it to S. */
+ struct face *face;
- /* All glyph strings for the same composition has the same width,
- i.e. the width set for the first component of the composition. */
+ s->face = NULL;
+ s->font = NULL;
+ s->font_info = NULL;
+ for (i = s->gidx; i < s->cmp->glyph_len; i++)
+ {
+ int c = COMPOSITION_GLYPH (s->cmp, i);
- s->width = s->first_glyph->pixel_width;
+ if (c != '\t')
+ {
+ int face_id = FACE_FOR_CHAR (s->f, base_face, c, -1, Qnil);
+
+ face = get_char_face_and_encoding (s->f, c, face_id,
+ s->char2b + i, 1, 1);
+ if (face)
+ {
+ if (! s->face)
+ {
+ s->face = face;
+ s->font = s->face->font;
+ s->font_info = FONT_INFO_FROM_FACE (s->f, s->face);
+ }
+ else if (s->face != face)
+ break;
+ }
+ }
+ ++s->nchars;
+ }
+
+ /* All glyph strings for the same composition has the same width,
+ i.e. the width set for the first component of the composition. */
+ s->width = s->first_glyph->pixel_width;
+ }
/* If the specified font could not be loaded, use the frame's
default font, but record the fact that we couldn't load it in
@@ -18988,8 +19263,6 @@ fill_composite_glyph_string (s, faces, overlaps)
/* Adjust base line for subscript/superscript text. */
s->ybase += s->first_glyph->voffset;
- xassert (s->face && s->face->gc);
-
/* This glyph string must always be drawn with 16-bit functions. */
s->two_byte_p = 1;
@@ -19047,7 +19320,7 @@ fill_glyph_string (s, face_id, start, end, overlaps)
}
s->font = s->face->font;
- s->font_info = FONT_INFO_FROM_ID (s->f, s->face->font_info_id);
+ s->font_info = FONT_INFO_FROM_FACE (s->f, s->face);
/* If the specified font could not be loaded, use the frame's font,
but record the fact that we couldn't load it in
@@ -19111,7 +19384,7 @@ fill_stretch_glyph_string (s, row, area, start, end)
face_id = glyph->face_id;
s->face = FACE_FROM_ID (s->f, face_id);
s->font = s->face->font;
- s->font_info = FONT_INFO_FROM_ID (s->f, s->face->font_info_id);
+ s->font_info = FONT_INFO_FROM_FACE (s->f, s->face);
s->width = glyph->pixel_width;
s->nchars = 1;
voffset = glyph->voffset;
@@ -19133,6 +19406,35 @@ fill_stretch_glyph_string (s, row, area, start, end)
return glyph - s->row->glyphs[s->area];
}
+static XCharStruct *
+get_per_char_metric (font, font_info, char2b, font_type)
+ XFontStruct *font;
+ struct font_info *font_info;
+ XChar2b *char2b;
+ int font_type;
+{
+#ifdef USE_FONT_BACKEND
+ if (enable_font_backend)
+ {
+ static XCharStruct pcm_value;
+ unsigned code = (XCHAR2B_BYTE1 (char2b) << 8) | XCHAR2B_BYTE2 (char2b);
+ struct font *fontp;
+ struct font_metrics metrics;
+
+ if (! font_info || code == FONT_INVALID_CODE)
+ return NULL;
+ fontp = (struct font *) font_info;
+ fontp->driver->text_extents (fontp, &code, 1, &metrics);
+ pcm_value.lbearing = metrics.lbearing;
+ pcm_value.rbearing = metrics.rbearing;
+ pcm_value.ascent = metrics.ascent;
+ pcm_value.descent = metrics.descent;
+ pcm_value.width = metrics.width;
+ return &pcm_value;
+ }
+#endif /* USE_FONT_BACKEND */
+ return rif->per_char_metric (font, char2b, font_type);
+}
/* EXPORT for RIF:
Set *LEFT and *RIGHT to the left and right overhang of GLYPH on
@@ -19157,9 +19459,9 @@ x_get_glyph_overhangs (glyph, f, left, right)
face = get_glyph_face_and_encoding (f, glyph, &char2b, NULL);
font = face->font;
- font_info = FONT_INFO_FROM_ID (f, face->font_info_id);
+ font_info = FONT_INFO_FROM_FACE (f, face);
if (font /* ++KFS: Should this be font_info ? */
- && (pcm = FRAME_RIF (f)->per_char_metric (font, &char2b, glyph->font_type)))
+ && (pcm = get_per_char_metric (font, font_info, &char2b, glyph->font_type)))
{
if (pcm->rbearing > pcm->width)
*right = pcm->rbearing - pcm->width;
@@ -19167,6 +19469,13 @@ x_get_glyph_overhangs (glyph, f, left, right)
*left = -pcm->lbearing;
}
}
+ else if (glyph->type == COMPOSITE_GLYPH)
+ {
+ struct composition *cmp = composition_table[glyph->u.cmp_id];
+
+ *right = cmp->rbearing - cmp->pixel_width;
+ *left = - cmp->lbearing;
+ }
}
@@ -19280,70 +19589,6 @@ right_overwriting (s)
}
-/* Get face and two-byte form of character C in face FACE_ID on frame
- F. The encoding of C is returned in *CHAR2B. MULTIBYTE_P non-zero
- means we want to display multibyte text. DISPLAY_P non-zero means
- make sure that X resources for the face returned are allocated.
- Value is a pointer to a realized face that is ready for display if
- DISPLAY_P is non-zero. */
-
-static INLINE struct face *
-get_char_face_and_encoding (f, c, face_id, char2b, multibyte_p, display_p)
- struct frame *f;
- int c, face_id;
- XChar2b *char2b;
- int multibyte_p, display_p;
-{
- struct face *face = FACE_FROM_ID (f, face_id);
-
- if (!multibyte_p)
- {
- /* Unibyte case. We don't have to encode, but we have to make
- sure to use a face suitable for unibyte. */
- STORE_XCHAR2B (char2b, 0, c);
- face_id = FACE_FOR_CHAR (f, face, c);
- face = FACE_FROM_ID (f, face_id);
- }
- else if (c < 128)
- {
- /* Case of ASCII in a face known to fit ASCII. */
- STORE_XCHAR2B (char2b, 0, c);
- }
- else
- {
- int c1, c2, charset;
-
- /* Split characters into bytes. If c2 is -1 afterwards, C is
- really a one-byte character so that byte1 is zero. */
- SPLIT_CHAR (c, charset, c1, c2);
- if (c2 > 0)
- STORE_XCHAR2B (char2b, c1, c2);
- else
- STORE_XCHAR2B (char2b, 0, c1);
-
- /* Maybe encode the character in *CHAR2B. */
- if (face->font != NULL)
- {
- struct font_info *font_info
- = FONT_INFO_FROM_ID (f, face->font_info_id);
- if (font_info)
- FRAME_RIF (f)->encode_char (c, char2b, font_info, 0);
- }
- }
-
- /* Make sure X resources of the face are allocated. */
-#ifdef HAVE_X_WINDOWS
- if (display_p)
-#endif
- {
- xassert (face != NULL);
- PREPARE_FACE_FOR_DISPLAY (f, face);
- }
-
- return face;
-}
-
-
/* Set background width of glyph string S. START is the index of the
first glyph following S. LAST_X is the right-most x-position + 1
in the drawing area. */
@@ -19390,8 +19635,8 @@ compute_overhangs_and_x (s, x, backward_p)
{
while (s)
{
- if (FRAME_RIF (s->f)->compute_glyph_string_overhangs)
- FRAME_RIF (s->f)->compute_glyph_string_overhangs (s);
+ if (rif->compute_glyph_string_overhangs)
+ rif->compute_glyph_string_overhangs (s);
x -= s->width;
s->x = x;
s = s->prev;
@@ -19401,8 +19646,8 @@ compute_overhangs_and_x (s, x, backward_p)
{
while (s)
{
- if (FRAME_RIF (s->f)->compute_glyph_string_overhangs)
- FRAME_RIF (s->f)->compute_glyph_string_overhangs (s);
+ if (rif->compute_glyph_string_overhangs)
+ rif->compute_glyph_string_overhangs (s);
s->x = x;
x += s->width;
s = s->next;
@@ -19483,10 +19728,9 @@ compute_overhangs_and_x (s, x, backward_p)
#define BUILD_CHAR_GLYPH_STRINGS(START, END, HEAD, TAIL, HL, X, LAST_X) \
do \
{ \
- int c, face_id; \
+ int face_id; \
XChar2b *char2b; \
\
- c = (row)->glyphs[area][START].u.ch; \
face_id = (row)->glyphs[area][START].face_id; \
\
s = (struct glyph_string *) alloca (sizeof *s); \
@@ -19509,49 +19753,35 @@ compute_overhangs_and_x (s, x, backward_p)
x-position of the drawing area. */
#define BUILD_COMPOSITE_GLYPH_STRING(START, END, HEAD, TAIL, HL, X, LAST_X) \
- do { \
- int cmp_id = (row)->glyphs[area][START].u.cmp_id; \
- int face_id = (row)->glyphs[area][START].face_id; \
- struct face *base_face = FACE_FROM_ID (f, face_id); \
- struct composition *cmp = composition_table[cmp_id]; \
- int glyph_len = cmp->glyph_len; \
- XChar2b *char2b; \
- struct face **faces; \
- struct glyph_string *first_s = NULL; \
- int n; \
- \
- base_face = base_face->ascii_face; \
- char2b = (XChar2b *) alloca ((sizeof *char2b) * glyph_len); \
- faces = (struct face **) alloca ((sizeof *faces) * glyph_len); \
- /* At first, fill in `char2b' and `faces'. */ \
- for (n = 0; n < glyph_len; n++) \
- { \
- int c = COMPOSITION_GLYPH (cmp, n); \
- int this_face_id = FACE_FOR_CHAR (f, base_face, c); \
- faces[n] = FACE_FROM_ID (f, this_face_id); \
- get_char_face_and_encoding (f, c, this_face_id, \
- char2b + n, 1, 1); \
- } \
- \
- /* Make glyph_strings for each glyph sequence that is drawable by \
- the same face, and append them to HEAD/TAIL. */ \
- for (n = 0; n < cmp->glyph_len;) \
- { \
- s = (struct glyph_string *) alloca (sizeof *s); \
- INIT_GLYPH_STRING (s, char2b + n, w, row, area, START, HL); \
- append_glyph_string (&(HEAD), &(TAIL), s); \
- s->cmp = cmp; \
- s->gidx = n; \
- s->x = (X); \
- \
- if (n == 0) \
- first_s = s; \
- \
- n = fill_composite_glyph_string (s, faces, overlaps); \
- } \
- \
- ++START; \
- s = first_s; \
+ do { \
+ int face_id = (row)->glyphs[area][START].face_id; \
+ struct face *base_face = FACE_FROM_ID (f, face_id); \
+ int cmp_id = (row)->glyphs[area][START].u.cmp_id; \
+ struct composition *cmp = composition_table[cmp_id]; \
+ XChar2b *char2b; \
+ struct glyph_string *first_s; \
+ int n; \
+ \
+ char2b = (XChar2b *) alloca ((sizeof *char2b) * cmp->glyph_len); \
+ base_face = base_face->ascii_face; \
+ \
+ /* Make glyph_strings for each glyph sequence that is drawable by \
+ the same face, and append them to HEAD/TAIL. */ \
+ for (n = 0; n < cmp->glyph_len;) \
+ { \
+ s = (struct glyph_string *) alloca (sizeof *s); \
+ INIT_GLYPH_STRING (s, char2b, w, row, area, START, HL); \
+ append_glyph_string (&(HEAD), &(TAIL), s); \
+ s->cmp = cmp; \
+ s->gidx = n; \
+ s->x = (X); \
+ if (n == 0) \
+ first_s = s; \
+ n = fill_composite_glyph_string (s, base_face, overlaps); \
+ } \
+ \
+ ++START; \
+ s = first_s; \
} while (0)
@@ -19598,8 +19828,11 @@ compute_overhangs_and_x (s, x, backward_p)
abort (); \
} \
\
- set_glyph_string_background_width (s, START, LAST_X); \
- (X) += s->width; \
+ if (s) \
+ { \
+ set_glyph_string_background_width (s, START, LAST_X); \
+ (X) += s->width; \
+ } \
} \
} \
while (0)
@@ -19633,7 +19866,7 @@ draw_glyphs (w, x, row, area, start, end, hl, overlaps)
int x;
struct glyph_row *row;
enum glyph_row_area area;
- int start, end;
+ EMACS_INT start, end;
enum draw_glyphs_face hl;
int overlaps;
{
@@ -19690,9 +19923,9 @@ draw_glyphs (w, x, row, area, start, end, hl, overlaps)
struct glyph_string *h, *t;
/* Compute overhangs for all glyph strings. */
- if (FRAME_RIF (f)->compute_glyph_string_overhangs)
+ if (rif->compute_glyph_string_overhangs)
for (s = head; s; s = s->next)
- FRAME_RIF (f)->compute_glyph_string_overhangs (s);
+ rif->compute_glyph_string_overhangs (s);
/* Prepend glyph strings for glyphs in front of the first glyph
string that are overwritten because of the first glyph
@@ -19753,6 +19986,7 @@ draw_glyphs (w, x, row, area, start, end, hl, overlaps)
if (i >= 0)
{
clip_tail = tail;
+ i++; /* We must include the Ith glyph. */
BUILD_GLYPH_STRINGS (end, i, h, t,
DRAW_NORMAL_TEXT, x, last_x);
for (s = h; s; s = s->next)
@@ -19770,7 +20004,7 @@ draw_glyphs (w, x, row, area, start, end, hl, overlaps)
/* Draw all strings. */
for (s = head; s; s = s->next)
- FRAME_RIF (f)->draw_glyph_string (s);
+ rif->draw_glyph_string (s);
if (area == TEXT_AREA
&& !row->full_width_p
@@ -20342,7 +20576,7 @@ calc_line_height_property (it, val, font, boff, override)
struct face *face;
struct font_info *font_info;
- face_id = lookup_named_face (it->f, face_name, ' ', 0);
+ face_id = lookup_named_face (it->f, face_name, 0);
if (face_id < 0)
return make_number (-1);
@@ -20351,7 +20585,7 @@ calc_line_height_property (it, val, font, boff, override)
if (font == NULL)
return make_number (-1);
- font_info = FONT_INFO_FROM_ID (it->f, face->font_info_id);
+ font_info = FONT_INFO_FROM_FACE (it->f, face);
boff = font_info->baseline_offset;
if (font_info->vertical_centering)
boff = VCENTER_BASELINE_OFFSET (font, it->f) - boff;
@@ -20415,23 +20649,17 @@ x_produce_glyphs (it)
/* Maybe translate single-byte characters to multibyte, or the
other way. */
it->char_to_display = it->c;
- if (!ASCII_BYTE_P (it->c))
+ if (!ASCII_BYTE_P (it->c)
+ && ! it->multibyte_p)
{
- if (unibyte_display_via_language_environment
- && SINGLE_BYTE_CHAR_P (it->c)
- && (it->c >= 0240
- || !NILP (Vnonascii_translation_table)))
+ if (SINGLE_BYTE_CHAR_P (it->c)
+ && unibyte_display_via_language_environment)
+ it->char_to_display = unibyte_char_to_multibyte (it->c);
+ if (! SINGLE_BYTE_CHAR_P (it->char_to_display))
{
- it->char_to_display = unibyte_char_to_multibyte (it->c);
it->multibyte_p = 1;
- it->face_id = FACE_FOR_CHAR (it->f, face, it->char_to_display);
- face = FACE_FROM_ID (it->f, it->face_id);
- }
- else if (!SINGLE_BYTE_CHAR_P (it->c)
- && !it->multibyte_p)
- {
- it->multibyte_p = 1;
- it->face_id = FACE_FOR_CHAR (it->f, face, it->char_to_display);
+ it->face_id = FACE_FOR_CHAR (it->f, face, it->char_to_display,
+ -1, Qnil);
face = FACE_FROM_ID (it->f, it->face_id);
}
}
@@ -20451,7 +20679,7 @@ x_produce_glyphs (it)
}
else
{
- font_info = FONT_INFO_FROM_ID (it->f, face->font_info_id);
+ font_info = FONT_INFO_FROM_FACE (it->f, face);
boff = font_info->baseline_offset;
if (font_info->vertical_centering)
boff = VCENTER_BASELINE_OFFSET (font, it->f) - boff;
@@ -20465,20 +20693,20 @@ x_produce_glyphs (it)
it->nglyphs = 1;
- pcm = FRAME_RIF (it->f)->per_char_metric
- (font, &char2b, FONT_TYPE_FOR_UNIBYTE (font, it->char_to_display));
-
- if (it->override_ascent >= 0)
- {
- it->ascent = it->override_ascent;
- it->descent = it->override_descent;
- boff = it->override_boff;
- }
- else
- {
- it->ascent = FONT_BASE (font) + boff;
- it->descent = FONT_DESCENT (font) - boff;
- }
+ pcm = get_per_char_metric (font, font_info, &char2b,
+ FONT_TYPE_FOR_UNIBYTE (font, it->char_to_display));
+
+ if (it->override_ascent >= 0)
+ {
+ it->ascent = it->override_ascent;
+ it->descent = it->override_descent;
+ boff = it->override_boff;
+ }
+ else
+ {
+ it->ascent = FONT_BASE (font) + boff;
+ it->descent = FONT_DESCENT (font) - boff;
+ }
if (pcm)
{
@@ -20692,20 +20920,24 @@ x_produce_glyphs (it)
/* If we found a font, this font should give us the right
metrics. If we didn't find a font, use the frame's
- default font and calculate the width of the character
- from the charset width; this is what old redisplay code
- did. */
+ default font and calculate the width of the character by
+ multiplying the width of font by the width of the
+ character. */
- pcm = FRAME_RIF (it->f)->per_char_metric (font, &char2b,
- FONT_TYPE_FOR_MULTIBYTE (font, it->c));
+ pcm = get_per_char_metric (font, font_info, &char2b,
+ FONT_TYPE_FOR_MULTIBYTE (font, it->c));
if (font_not_found_p || !pcm)
{
- int charset = CHAR_CHARSET (it->char_to_display);
+ int char_width = CHAR_WIDTH (it->char_to_display);
+ if (char_width == 0)
+ /* This is a non spacing character. But, as we are
+ going to display an empty box, the box must occupy
+ at least one column. */
+ char_width = 1;
it->glyph_not_available_p = 1;
- it->pixel_width = (FRAME_COLUMN_WIDTH (it->f)
- * CHARSET_WIDTH (charset));
+ it->pixel_width = FRAME_COLUMN_WIDTH (it->f) * char_width;
it->phys_ascent = FONT_BASE (font) + boff;
it->phys_descent = FONT_DESCENT (font) - boff;
}
@@ -20755,99 +20987,120 @@ x_produce_glyphs (it)
else if (it->what == IT_COMPOSITION)
{
/* Note: A composition is represented as one glyph in the
- glyph matrix. There are no padding glyphs. */
- XChar2b char2b;
- XFontStruct *font;
+ glyph matrix. There are no padding glyphs.
+
+ Important is that pixel_width, ascent, and descent are the
+ values of what is drawn by draw_glyphs (i.e. the values of
+ the overall glyphs composed). */
struct face *face = FACE_FROM_ID (it->f, it->face_id);
- XCharStruct *pcm;
- int font_not_found_p;
- struct font_info *font_info;
int boff; /* baseline offset */
struct composition *cmp = composition_table[it->cmp_id];
+ int glyph_len = cmp->glyph_len;
+ XFontStruct *font = face->font;
- /* Maybe translate single-byte characters to multibyte. */
- it->char_to_display = it->c;
- if (unibyte_display_via_language_environment
- && SINGLE_BYTE_CHAR_P (it->c)
- && (it->c >= 0240
- || (it->c >= 0200
- && !NILP (Vnonascii_translation_table))))
- {
- it->char_to_display = unibyte_char_to_multibyte (it->c);
- }
-
- /* Get face and font to use. Encode IT->char_to_display. */
- it->face_id = FACE_FOR_CHAR (it->f, face, it->char_to_display);
- face = FACE_FROM_ID (it->f, it->face_id);
- get_char_face_and_encoding (it->f, it->char_to_display, it->face_id,
- &char2b, it->multibyte_p, 0);
- font = face->font;
+ it->nglyphs = 1;
- /* When no suitable font found, use the default font. */
- font_not_found_p = font == NULL;
- if (font_not_found_p)
+#ifdef USE_FONT_BACKEND
+ if (cmp->method == COMPOSITION_WITH_GLYPH_STRING)
{
- font = FRAME_FONT (it->f);
- boff = FRAME_BASELINE_OFFSET (it->f);
- font_info = NULL;
+ if (! cmp->font || cmp->font != font)
+ font_prepare_composition (cmp);
}
else
- {
- font_info = FONT_INFO_FROM_ID (it->f, face->font_info_id);
- boff = font_info->baseline_offset;
- if (font_info->vertical_centering)
- boff = VCENTER_BASELINE_OFFSET (font, it->f) - boff;
- }
-
- /* There are no padding glyphs, so there is only one glyph to
- produce for the composition. Important is that pixel_width,
- ascent and descent are the values of what is drawn by
- draw_glyphs (i.e. the values of the overall glyphs composed). */
- it->nglyphs = 1;
-
+#endif /* USE_FONT_BACKEND */
/* If we have not yet calculated pixel size data of glyphs of
the composition for the current face font, calculate them
now. Theoretically, we have to check all fonts for the
glyphs, but that requires much time and memory space. So,
here we check only the font of the first glyph. This leads
- to incorrect display very rarely, and C-l (recenter) can
- correct the display anyway. */
- if (cmp->font != (void *) font)
- {
- /* Ascent and descent of the font of the first character of
- this composition (adjusted by baseline offset). Ascent
- and descent of overall glyphs should not be less than
- them respectively. */
- int font_ascent = FONT_BASE (font) + boff;
- int font_descent = FONT_DESCENT (font) - boff;
+ to incorrect display, but it's very rare, and C-l (recenter)
+ can correct the display anyway. */
+ if (! cmp->font || cmp->font != font)
+ {
+ /* Ascent and descent of the font of the first character
+ of this composition (adjusted by baseline offset).
+ Ascent and descent of overall glyphs should not be less
+ than them respectively. */
+ int font_ascent, font_descent, font_height;
/* Bounding box of the overall glyphs. */
int leftmost, rightmost, lowest, highest;
+ int lbearing, rbearing;
int i, width, ascent, descent;
+ int left_padded = 0, right_padded = 0;
+ int face_id;
+ int c;
+ XChar2b char2b;
+ XCharStruct *pcm;
+ int font_not_found_p;
+ struct font_info *font_info;
+ int pos;
+
+ for (glyph_len = cmp->glyph_len; glyph_len > 0; glyph_len--)
+ if ((c = COMPOSITION_GLYPH (cmp, glyph_len - 1)) != '\t')
+ break;
+ if (glyph_len < cmp->glyph_len)
+ right_padded = 1;
+ for (i = 0; i < glyph_len; i++)
+ {
+ if ((c = COMPOSITION_GLYPH (cmp, i)) != '\t')
+ break;
+ cmp->offsets[i * 2] = cmp->offsets[i * 2 + 1] = 0;
+ }
+ if (i > 0)
+ left_padded = 1;
+
+ pos = (STRINGP (it->string) ? IT_STRING_CHARPOS (*it)
+ : IT_CHARPOS (*it));
+ /* When no suitable font found, use the default font. */
+ font_not_found_p = font == NULL;
+ if (font_not_found_p)
+ {
+ face = face->ascii_face;
+ font = face->font;
+ }
+ font_info = FONT_INFO_FROM_FACE (it->f, face);
+ boff = font_info->baseline_offset;
+ if (font_info->vertical_centering)
+ boff = VCENTER_BASELINE_OFFSET (font, it->f) - boff;
+ font_ascent = FONT_BASE (font) + boff;
+ font_descent = FONT_DESCENT (font) - boff;
+ font_height = FONT_HEIGHT (font);
cmp->font = (void *) font;
+ pcm = NULL;
+ if (! font_not_found_p)
+ {
+ get_char_face_and_encoding (it->f, c, it->face_id,
+ &char2b, it->multibyte_p, 0);
+ pcm = get_per_char_metric (font, font_info, &char2b,
+ FONT_TYPE_FOR_MULTIBYTE (font, c));
+ }
+
/* Initialize the bounding box. */
- if (font_info
- && (pcm = FRAME_RIF (it->f)->per_char_metric (font, &char2b,
- FONT_TYPE_FOR_MULTIBYTE (font, it->c))))
+ if (pcm)
{
width = pcm->width;
ascent = pcm->ascent;
descent = pcm->descent;
+ lbearing = pcm->lbearing;
+ rbearing = pcm->rbearing;
}
else
{
width = FONT_WIDTH (font);
ascent = FONT_BASE (font);
descent = FONT_DESCENT (font);
+ lbearing = 0;
+ rbearing = width;
}
rightmost = width;
+ leftmost = 0;
lowest = - descent + boff;
highest = ascent + boff;
- leftmost = 0;
- if (font_info
+ if (! font_not_found_p
&& font_info->default_ascent
&& CHAR_TABLE_P (Vuse_default_ascent)
&& !NILP (Faref (Vuse_default_ascent,
@@ -20855,123 +21108,138 @@ x_produce_glyphs (it)
highest = font_info->default_ascent + boff;
/* Draw the first glyph at the normal position. It may be
- shifted to right later if some other glyphs are drawn at
- the left. */
- cmp->offsets[0] = 0;
- cmp->offsets[1] = boff;
+ shifted to right later if some other glyphs are drawn
+ at the left. */
+ cmp->offsets[i * 2] = 0;
+ cmp->offsets[i * 2 + 1] = boff;
+ cmp->lbearing = lbearing;
+ cmp->rbearing = rbearing;
/* Set cmp->offsets for the remaining glyphs. */
- for (i = 1; i < cmp->glyph_len; i++)
+ for (i++; i < glyph_len; i++)
{
int left, right, btm, top;
int ch = COMPOSITION_GLYPH (cmp, i);
- int face_id = FACE_FOR_CHAR (it->f, face, ch);
+ int face_id;
+ struct face *this_face;
+ int this_boff;
+
+ if (ch == '\t')
+ ch = ' ';
+ face_id = FACE_FOR_CHAR (it->f, face, ch, pos, it->string);
+ this_face = FACE_FROM_ID (it->f, face_id);
+ font = this_face->font;
- face = FACE_FROM_ID (it->f, face_id);
- get_char_face_and_encoding (it->f, ch, face->id,
- &char2b, it->multibyte_p, 0);
- font = face->font;
if (font == NULL)
- {
- font = FRAME_FONT (it->f);
- boff = FRAME_BASELINE_OFFSET (it->f);
- font_info = NULL;
- }
+ pcm = NULL;
else
{
- font_info
- = FONT_INFO_FROM_ID (it->f, face->font_info_id);
- boff = font_info->baseline_offset;
+ font_info = FONT_INFO_FROM_FACE (it->f, this_face);
+ this_boff = font_info->baseline_offset;
if (font_info->vertical_centering)
- boff = VCENTER_BASELINE_OFFSET (font, it->f) - boff;
+ this_boff = VCENTER_BASELINE_OFFSET (font, it->f) - boff;
+ get_char_face_and_encoding (it->f, ch, face_id,
+ &char2b, it->multibyte_p, 0);
+ pcm = get_per_char_metric (font, font_info, &char2b,
+ FONT_TYPE_FOR_MULTIBYTE (font,
+ ch));
}
-
- if (font_info
- && (pcm = FRAME_RIF (it->f)->per_char_metric (font, &char2b,
- FONT_TYPE_FOR_MULTIBYTE (font, ch))))
+ if (! pcm)
+ cmp->offsets[i * 2] = cmp->offsets[i * 2 + 1] = 0;
+ else
{
width = pcm->width;
ascent = pcm->ascent;
descent = pcm->descent;
- }
- else
- {
- width = FONT_WIDTH (font);
- ascent = 1;
- descent = 0;
- }
+ lbearing = pcm->lbearing;
+ rbearing = pcm->rbearing;
+ if (cmp->method != COMPOSITION_WITH_RULE_ALTCHARS)
+ {
+ /* Relative composition with or without
+ alternate chars. */
+ left = (leftmost + rightmost - width) / 2;
+ btm = - descent + boff;
+ if (font_info->relative_compose
+ && (! CHAR_TABLE_P (Vignore_relative_composition)
+ || NILP (Faref (Vignore_relative_composition,
+ make_number (ch)))))
+ {
- if (cmp->method != COMPOSITION_WITH_RULE_ALTCHARS)
- {
- /* Relative composition with or without
- alternate chars. */
- left = (leftmost + rightmost - width) / 2;
- btm = - descent + boff;
- if (font_info && font_info->relative_compose
- && (! CHAR_TABLE_P (Vignore_relative_composition)
- || NILP (Faref (Vignore_relative_composition,
- make_number (ch)))))
+ if (- descent >= font_info->relative_compose)
+ /* One extra pixel between two glyphs. */
+ btm = highest + 1;
+ else if (ascent <= 0)
+ /* One extra pixel between two glyphs. */
+ btm = lowest - 1 - ascent - descent;
+ }
+ }
+ else
{
+ /* A composition rule is specified by an integer
+ value that encodes global and new reference
+ points (GREF and NREF). GREF and NREF are
+ specified by numbers as below:
+
+ 0---1---2 -- ascent
+ | |
+ | |
+ | |
+ 9--10--11 -- center
+ | |
+ ---3---4---5--- baseline
+ | |
+ 6---7---8 -- descent
+ */
+ int rule = COMPOSITION_RULE (cmp, i);
+ int gref, nref, grefx, grefy, nrefx, nrefy, xoff, yoff;
+
+ COMPOSITION_DECODE_RULE (rule, gref, nref, xoff, yoff);
+ grefx = gref % 3, nrefx = nref % 3;
+ grefy = gref / 3, nrefy = nref / 3;
+ if (xoff)
+ xoff = font_height * (xoff - 128) / 256;
+ if (yoff)
+ yoff = font_height * (yoff - 128) / 256;
+
+ left = (leftmost
+ + grefx * (rightmost - leftmost) / 2
+ - nrefx * width / 2
+ + xoff);
+
+ btm = ((grefy == 0 ? highest
+ : grefy == 1 ? 0
+ : grefy == 2 ? lowest
+ : (highest + lowest) / 2)
+ - (nrefy == 0 ? ascent + descent
+ : nrefy == 1 ? descent - boff
+ : nrefy == 2 ? 0
+ : (ascent + descent) / 2)
+ + yoff);
+ }
+
+ cmp->offsets[i * 2] = left;
+ cmp->offsets[i * 2 + 1] = btm + descent;
- if (- descent >= font_info->relative_compose)
- /* One extra pixel between two glyphs. */
- btm = highest + 1;
- else if (ascent <= 0)
- /* One extra pixel between two glyphs. */
- btm = lowest - 1 - ascent - descent;
+ /* Update the bounding box of the overall glyphs. */
+ if (width > 0)
+ {
+ right = left + width;
+ if (left < leftmost)
+ leftmost = left;
+ if (right > rightmost)
+ rightmost = right;
}
+ top = btm + descent + ascent;
+ if (top > highest)
+ highest = top;
+ if (btm < lowest)
+ lowest = btm;
+
+ if (cmp->lbearing > left + lbearing)
+ cmp->lbearing = left + lbearing;
+ if (cmp->rbearing < left + rbearing)
+ cmp->rbearing = left + rbearing;
}
- else
- {
- /* A composition rule is specified by an integer
- value that encodes global and new reference
- points (GREF and NREF). GREF and NREF are
- specified by numbers as below:
-
- 0---1---2 -- ascent
- | |
- | |
- | |
- 9--10--11 -- center
- | |
- ---3---4---5--- baseline
- | |
- 6---7---8 -- descent
- */
- int rule = COMPOSITION_RULE (cmp, i);
- int gref, nref, grefx, grefy, nrefx, nrefy;
-
- COMPOSITION_DECODE_RULE (rule, gref, nref);
- grefx = gref % 3, nrefx = nref % 3;
- grefy = gref / 3, nrefy = nref / 3;
-
- left = (leftmost
- + grefx * (rightmost - leftmost) / 2
- - nrefx * width / 2);
- btm = ((grefy == 0 ? highest
- : grefy == 1 ? 0
- : grefy == 2 ? lowest
- : (highest + lowest) / 2)
- - (nrefy == 0 ? ascent + descent
- : nrefy == 1 ? descent - boff
- : nrefy == 2 ? 0
- : (ascent + descent) / 2));
- }
-
- cmp->offsets[i * 2] = left;
- cmp->offsets[i * 2 + 1] = btm + descent;
-
- /* Update the bounding box of the overall glyphs. */
- right = left + width;
- top = btm + descent + ascent;
- if (left < leftmost)
- leftmost = left;
- if (right > rightmost)
- rightmost = right;
- if (top > highest)
- highest = top;
- if (btm < lowest)
- lowest = btm;
}
/* If there are glyphs whose x-offsets are negative,
@@ -20982,6 +21250,21 @@ x_produce_glyphs (it)
for (i = 0; i < cmp->glyph_len; i++)
cmp->offsets[i * 2] -= leftmost;
rightmost -= leftmost;
+ cmp->lbearing -= leftmost;
+ cmp->rbearing -= leftmost;
+ }
+
+ if (left_padded && cmp->lbearing < 0)
+ {
+ for (i = 0; i < cmp->glyph_len; i++)
+ cmp->offsets[i * 2] -= cmp->lbearing;
+ rightmost -= cmp->lbearing;
+ cmp->rbearing -= cmp->lbearing;
+ cmp->lbearing = 0;
+ }
+ if (right_padded && rightmost < cmp->rbearing)
+ {
+ rightmost = cmp->rbearing;
}
cmp->pixel_width = rightmost;
@@ -20993,6 +21276,11 @@ x_produce_glyphs (it)
cmp->descent = font_descent;
}
+ if (it->glyph_row
+ && (cmp->lbearing < 0
+ || cmp->rbearing > cmp->pixel_width))
+ it->glyph_row->contains_overlapping_glyphs_p = 1;
+
it->pixel_width = cmp->pixel_width;
it->ascent = it->phys_ascent = cmp->ascent;
it->descent = it->phys_descent = cmp->descent;
@@ -21103,7 +21391,8 @@ x_insert_glyphs (start, len)
int line_height, shift_by_width, shifted_region_width;
struct glyph_row *row;
struct glyph *glyph;
- int frame_x, frame_y, hpos;
+ int frame_x, frame_y;
+ EMACS_INT hpos;
xassert (updated_window && updated_row);
BLOCK_INPUT;
@@ -21128,8 +21417,8 @@ x_insert_glyphs (start, len)
frame_x = window_box_left (w, updated_area) + output_cursor.x;
frame_y = WINDOW_TO_FRAME_PIXEL_Y (w, output_cursor.y);
- FRAME_RIF (f)->shift_glyphs_for_insert (f, frame_x, frame_y, shifted_region_width,
- line_height, shift_by_width);
+ rif->shift_glyphs_for_insert (f, frame_x, frame_y, shifted_region_width,
+ line_height, shift_by_width);
/* Write the glyphs. */
hpos = start - row->glyphs[updated_area];
@@ -21211,8 +21500,8 @@ x_clear_end_of_line (to_x)
if (to_x > from_x && to_y > from_y)
{
BLOCK_INPUT;
- FRAME_RIF (f)->clear_frame_area (f, from_x, from_y,
- to_x - from_x, to_y - from_y);
+ rif->clear_frame_area (f, from_x, from_y,
+ to_x - from_x, to_y - from_y);
UNBLOCK_INPUT;
}
}
@@ -21355,7 +21644,7 @@ get_window_cursor_type (w, glyph, width, active_cursor)
non_selected = 1;
}
- /* Detect a nonselected window or nonselected frame. */
+ /* Nonselected window or nonselected frame. */
else if (w != XWINDOW (f->selected_window)
#ifdef HAVE_WINDOW_SYSTEM
|| f != FRAME_X_DISPLAY_INFO (f)->x_highlight_frame
@@ -21374,6 +21663,13 @@ get_window_cursor_type (w, glyph, width, active_cursor)
if (NILP (b->cursor_type))
return NO_CURSOR;
+ /* Use cursor-in-non-selected-windows for non-selected window or frame. */
+ if (non_selected)
+ {
+ alt_cursor = b->cursor_in_non_selected_windows;
+ return get_specified_cursor_type (alt_cursor, width);
+ }
+
/* Get the normal cursor type for this window. */
if (EQ (b->cursor_type, Qt))
{
@@ -21383,21 +21679,6 @@ get_window_cursor_type (w, glyph, width, active_cursor)
else
cursor_type = get_specified_cursor_type (b->cursor_type, width);
- /* Use cursor-in-non-selected-windows instead
- for non-selected window or frame. */
- if (non_selected)
- {
- alt_cursor = b->cursor_in_non_selected_windows;
- if (!EQ (Qt, alt_cursor))
- return get_specified_cursor_type (alt_cursor, width);
- /* t means modify the normal cursor type. */
- if (cursor_type == FILLED_BOX_CURSOR)
- cursor_type = HOLLOW_BOX_CURSOR;
- else if (cursor_type == BAR_CURSOR && *width > 1)
- --*width;
- return cursor_type;
- }
-
/* Use normal cursor if not blinked off. */
if (!w->cursor_off_p)
{
@@ -21733,7 +22014,7 @@ erase_phys_cursor (w)
x = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, max (x, left_x));
if (width > 0)
- FRAME_RIF (f)->clear_frame_area (f, x, y, width, cursor_row->visible_height);
+ rif->clear_frame_area (f, x, y, width, cursor_row->visible_height);
}
/* Erase the cursor by redrawing the character underneath it. */
@@ -21830,9 +22111,9 @@ display_and_set_cursor (w, on, hpos, vpos, x, y)
w->phys_cursor.vpos = vpos;
}
- FRAME_RIF (f)->draw_window_cursor (w, glyph_row, x, y,
- new_cursor_type, new_cursor_width,
- on, active_cursor);
+ rif->draw_window_cursor (w, glyph_row, x, y,
+ new_cursor_type, new_cursor_width,
+ on, active_cursor);
}
@@ -21981,11 +22262,11 @@ show_mouse_face (dpyinfo, draw)
/* Change the mouse cursor. */
if (draw == DRAW_NORMAL_TEXT && !EQ (dpyinfo->mouse_face_window, f->tool_bar_window))
- FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->text_cursor);
+ rif->define_frame_cursor (f, FRAME_X_OUTPUT (f)->text_cursor);
else if (draw == DRAW_MOUSE_FACE)
- FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->hand_cursor);
+ rif->define_frame_cursor (f, FRAME_X_OUTPUT (f)->hand_cursor);
else
- FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->nontext_cursor);
+ rif->define_frame_cursor (f, FRAME_X_OUTPUT (f)->nontext_cursor);
}
/* EXPORT:
@@ -22061,7 +22342,7 @@ cursor_in_mouse_face_p (w)
static int
fast_find_position (w, charpos, hpos, vpos, x, y, stop)
struct window *w;
- int charpos;
+ EMACS_INT charpos;
int *hpos, *vpos, *x, *y;
Lisp_Object stop;
{
@@ -22149,7 +22430,7 @@ fast_find_position (w, charpos, hpos, vpos, x, y, stop)
static int
fast_find_position (w, pos, hpos, vpos, x, y, stop)
struct window *w;
- int pos;
+ EMACS_INT pos;
int *hpos, *vpos, *x, *y;
Lisp_Object stop;
{
@@ -22263,7 +22544,7 @@ fast_find_position (w, pos, hpos, vpos, x, y, stop)
static int
fast_find_string_pos (w, pos, object, hpos, vpos, x, y, right_p)
struct window *w;
- int pos;
+ EMACS_INT pos;
Lisp_Object object;
int *hpos, *vpos, *x, *y;
int right_p;
@@ -22424,6 +22705,7 @@ on_hot_spot_p (hot_spot, x, y)
return inside;
}
}
+ /* If we don't understand the format, pretend we're not in the hot-spot. */
return 0;
}
@@ -22503,7 +22785,7 @@ define_frame_cursor1 (f, cursor, pointer)
}
if (cursor != No_Cursor)
- FRAME_RIF (f)->define_frame_cursor (f, cursor);
+ rif->define_frame_cursor (f, cursor);
}
/* Take proper action when mouse has moved to the mode or header line
@@ -23424,10 +23706,11 @@ expose_line (w, row, r)
LAST_OVERLAPPING_ROW is the last such row. */
static void
-expose_overlaps (w, first_overlapping_row, last_overlapping_row)
+expose_overlaps (w, first_overlapping_row, last_overlapping_row, r)
struct window *w;
struct glyph_row *first_overlapping_row;
struct glyph_row *last_overlapping_row;
+ XRectangle *r;
{
struct glyph_row *row;
@@ -23436,6 +23719,7 @@ expose_overlaps (w, first_overlapping_row, last_overlapping_row)
{
xassert (row->enabled_p && !row->mode_line_p);
+ row->clip = r;
if (row->used[LEFT_MARGIN_AREA])
x_fix_overlapping_area (w, row, LEFT_MARGIN_AREA, OVERLAPS_BOTH);
@@ -23444,6 +23728,7 @@ expose_overlaps (w, first_overlapping_row, last_overlapping_row)
if (row->used[RIGHT_MARGIN_AREA])
x_fix_overlapping_area (w, row, RIGHT_MARGIN_AREA, OVERLAPS_BOTH);
+ row->clip = NULL;
}
}
@@ -23471,8 +23756,8 @@ phys_cursor_in_rect_p (w, r)
I assume the effect is the same -- and this is portable. */
return x_intersect_rectangles (&cr, r, &result);
}
- /* If we don't understand the format, pretend we're not in the hot-spot. */
- return 0;
+ else
+ return 0;
}
@@ -23484,8 +23769,6 @@ void
x_draw_vertical_border (w)
struct window *w;
{
- struct frame *f = XFRAME (WINDOW_FRAME (w));
-
/* We could do better, if we knew what type of scroll-bar the adjacent
windows (on either side) have... But we don't :-(
However, I think this works ok. ++KFS 2003-04-25 */
@@ -23506,9 +23789,9 @@ x_draw_vertical_border (w)
y1 -= 1;
if (WINDOW_LEFT_FRINGE_WIDTH (w) == 0)
- x1 -= 1;
+ x1 -= 1;
- FRAME_RIF (f)->draw_vertical_window_border (w, x1, y0, y1);
+ rif->draw_vertical_window_border (w, x1, y0, y1);
}
else if (!WINDOW_LEFTMOST_P (w)
&& !WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w))
@@ -23519,9 +23802,9 @@ x_draw_vertical_border (w)
y1 -= 1;
if (WINDOW_LEFT_FRINGE_WIDTH (w) == 0)
- x0 -= 1;
+ x0 -= 1;
- FRAME_RIF (f)->draw_vertical_window_border (w, x0, y0, y1);
+ rif->draw_vertical_window_border (w, x0, y0, y1);
}
}
@@ -23609,8 +23892,22 @@ expose_window (w, fr)
last_overlapping_row = row;
}
+ row->clip = fr;
if (expose_line (w, row, &r))
mouse_face_overwritten_p = 1;
+ row->clip = NULL;
+ }
+ else if (row->overlapping_p)
+ {
+ /* We must redraw a row overlapping the exposed area. */
+ if (y0 < r.y
+ ? y0 + row->phys_height > r.y
+ : y0 + row->ascent - row->phys_ascent < r.y +r.height)
+ {
+ if (first_overlapping_row == NULL)
+ first_overlapping_row = row;
+ last_overlapping_row = row;
+ }
}
if (y1 >= yb)
@@ -23631,7 +23928,8 @@ expose_window (w, fr)
{
/* Fix the display of overlapping rows. */
if (first_overlapping_row)
- expose_overlaps (w, first_overlapping_row, last_overlapping_row);
+ expose_overlaps (w, first_overlapping_row, last_overlapping_row,
+ fr);
/* Draw border between windows. */
x_draw_vertical_border (w);
@@ -24202,10 +24500,7 @@ Any other value means to autoselect window instantaneously when the
mouse pointer enters it.
Autoselection selects the minibuffer only if it is active, and never
-unselects the minibuffer if it is active.
-
-When customizing this variable make sure that the actual value of
-`focus-follows-mouse' matches the behavior of your window manager. */);
+unselects the minibuffer if it is active. */);
Vmouse_autoselect_window = Qnil;
DEFVAR_LISP ("auto-resize-tool-bars", &Vauto_resize_tool_bars,
diff --git a/src/xfaces.c b/src/xfaces.c
index eb45d1eb3e..c21d0a1cd5 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -56,7 +56,7 @@ Boston, MA 02110-1301, USA. */
13. Whether or not a box should be drawn around characters, the box
type, and, for simple boxes, in what color.
- 14. Font or fontset pattern, or nil. This is a special attribute.
+ 14. Font pattern, or nil. This is a special attribute.
When this attribute is specified, the face uses a font opened by
that pattern as is. In addition, all the other font-related
attributes (1st thru 5th) are generated from the opened font name.
@@ -72,6 +72,8 @@ Boston, MA 02110-1301, USA. */
and is used to ensure that a font specified on the command line,
for example, can be matched exactly.
+ 17. A fontset name.
+
Faces are frame-local by nature because Emacs allows to define the
same named face (face names are symbols) differently for different
frames. Each frame has an alist of face definitions for all named
@@ -123,7 +125,7 @@ Boston, MA 02110-1301, USA. */
is realized, it inherits (thus shares) a fontset of an ASCII face
that has the same attributes other than font-related ones.
- Thus, all realized face have a realized fontset.
+ Thus, all realized faces have a realized fontset.
Unibyte text.
@@ -195,13 +197,12 @@ Boston, MA 02110-1301, USA. */
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
-#include <stdio.h> /* This needs to be before termchar.h */
#include "lisp.h"
+#include "character.h"
#include "charset.h"
#include "keyboard.h"
#include "frame.h"
-#include "termhooks.h"
#ifdef HAVE_WINDOW_SYSTEM
#include "fontset.h"
@@ -244,7 +245,12 @@ Boston, MA 02110-1301, USA. */
#include "blockinput.h"
#include "window.h"
#include "intervals.h"
-#include "termchar.h"
+
+#ifdef HAVE_WINDOW_SYSTEM
+#ifdef USE_FONT_BACKEND
+#include "font.h"
+#endif /* USE_FONT_BACKEND */
+#endif /* HAVE_WINDOW_SYSTEM */
#ifdef HAVE_X_WINDOWS
@@ -267,6 +273,8 @@ Boston, MA 02110-1301, USA. */
#include <ctype.h>
+#define abs(X) ((X) < 0 ? -(X) : (X))
+
/* Number of pt per inch (from the TeXbook). */
#define PT_PER_INCH 72.27
@@ -305,6 +313,7 @@ Lisp_Object QCinverse_video, QCforeground, QCbackground, QCstipple;
Lisp_Object QCwidth, QCfont, QCbold, QCitalic;
Lisp_Object QCreverse_video;
Lisp_Object QCoverline, QCstrike_through, QCbox, QCinherit;
+Lisp_Object QCfontset;
/* Symbols used for attribute values. */
@@ -488,7 +497,7 @@ static int get_lface_attributes P_ ((struct frame *, Lisp_Object, Lisp_Object *,
static int load_pixmap P_ ((struct frame *, Lisp_Object, unsigned *, unsigned *));
static unsigned char *xstrlwr P_ ((unsigned char *));
static struct frame *frame_or_selected_frame P_ ((Lisp_Object, int));
-static void load_face_font P_ ((struct frame *, struct face *, int));
+static void load_face_font P_ ((struct frame *, struct face *));
static void load_face_colors P_ ((struct frame *, struct face *, Lisp_Object *));
static void free_face_colors P_ ((struct frame *, struct face *));
static int face_color_gray_p P_ ((struct frame *, char *));
@@ -501,18 +510,17 @@ static int font_list_1 P_ ((struct frame *, Lisp_Object, Lisp_Object,
Lisp_Object, struct font_name **));
static int font_list P_ ((struct frame *, Lisp_Object, Lisp_Object,
Lisp_Object, struct font_name **));
-static int try_font_list P_ ((struct frame *, Lisp_Object *,
- Lisp_Object, Lisp_Object, struct font_name **,
- int));
+static int try_font_list P_ ((struct frame *, Lisp_Object,
+ Lisp_Object, Lisp_Object, struct font_name **));
static int try_alternative_families P_ ((struct frame *f, Lisp_Object,
Lisp_Object, struct font_name **));
static int cmp_font_names P_ ((const void *, const void *));
-static struct face *realize_face P_ ((struct face_cache *, Lisp_Object *, int,
- struct face *, int));
-static struct face *realize_x_face P_ ((struct face_cache *,
- Lisp_Object *, int, struct face *));
-static struct face *realize_tty_face P_ ((struct face_cache *,
- Lisp_Object *, int));
+static struct face *realize_face P_ ((struct face_cache *, Lisp_Object *,
+ int));
+static struct face *realize_non_ascii_face P_ ((struct frame *, int,
+ struct face *));
+static struct face *realize_x_face P_ ((struct face_cache *, Lisp_Object *));
+static struct face *realize_tty_face P_ ((struct face_cache *, Lisp_Object *));
static int realize_basic_faces P_ ((struct frame *));
static int realize_default_face P_ ((struct frame *));
static void realize_named_face P_ ((struct frame *, Lisp_Object, int));
@@ -522,23 +530,22 @@ static unsigned hash_string_case_insensitive P_ ((Lisp_Object));
static unsigned lface_hash P_ ((Lisp_Object *));
static int lface_same_font_attributes_p P_ ((Lisp_Object *, Lisp_Object *));
static struct face_cache *make_face_cache P_ ((struct frame *));
-static void free_realized_face P_ ((struct frame *, struct face *));
static void clear_face_gcs P_ ((struct face_cache *));
static void free_face_cache P_ ((struct face_cache *));
static int face_numeric_weight P_ ((Lisp_Object));
static int face_numeric_slant P_ ((Lisp_Object));
static int face_numeric_swidth P_ ((Lisp_Object));
static int face_fontset P_ ((Lisp_Object *));
-static char *choose_face_font P_ ((struct frame *, Lisp_Object *, int, int, int*));
static void merge_face_vectors P_ ((struct frame *, Lisp_Object *, Lisp_Object*,
struct named_merge_point *));
static int merge_face_ref P_ ((struct frame *, Lisp_Object, Lisp_Object *,
int, struct named_merge_point *));
static int set_lface_from_font_name P_ ((struct frame *, Lisp_Object,
Lisp_Object, int, int));
+static void set_lface_from_font_and_fontset P_ ((struct frame *, Lisp_Object,
+ Lisp_Object, int, int));
static Lisp_Object lface_from_face_name P_ ((struct frame *, Lisp_Object, int));
static struct face *make_realized_face P_ ((Lisp_Object *));
-static void free_realized_faces P_ ((struct face_cache *));
static char *best_matching_font P_ ((struct frame *, Lisp_Object *,
struct font_name *, int, int, int *));
static void cache_face P_ ((struct face_cache *, struct face *, unsigned));
@@ -744,9 +751,10 @@ x_free_gc (f, gc)
struct frame *f;
GC gc;
{
- eassert (interrupt_input_blocked);
+ BLOCK_INPUT;
IF_DEBUG (xassert (--ngcs >= 0));
XFreeGC (FRAME_X_DISPLAY (f), gc);
+ UNBLOCK_INPUT;
}
#endif /* HAVE_X_WINDOWS */
@@ -776,8 +784,10 @@ x_free_gc (f, gc)
struct frame *f;
GC gc;
{
+ BLOCK_INPUT;
IF_DEBUG (xassert (--ngcs >= 0));
xfree (gc);
+ UNBLOCK_INPUT;
}
#endif /* WINDOWSNT */
@@ -804,9 +814,10 @@ x_free_gc (f, gc)
struct frame *f;
GC gc;
{
- eassert (interrupt_input_blocked);
+ BLOCK_INPUT;
IF_DEBUG (xassert (--ngcs >= 0));
XFreeGC (FRAME_MAC_DISPLAY (f), gc);
+ UNBLOCK_INPUT;
}
#endif /* MAC_OS */
@@ -973,6 +984,9 @@ clear_face_cache (clear_fonts_p)
{
struct x_display_info *dpyinfo;
+#ifdef USE_FONT_BACKEND
+ if (! enable_font_backend)
+#endif /* USE_FONT_BACKEND */
/* Fonts are common for frames on one display, i.e. on
one X screen. */
for (dpyinfo = x_display_list; dpyinfo; dpyinfo = dpyinfo->next)
@@ -1219,30 +1233,32 @@ load_pixmap (f, name, w_ptr, h_ptr)
#ifdef HAVE_WINDOW_SYSTEM
-/* Load font of face FACE which is used on frame F to display
- character C. The name of the font to load is determined by lface
- and fontset of FACE. */
+/* Load font of face FACE which is used on frame F to display ASCII
+ characters. The name of the font to load is determined by lface. */
static void
-load_face_font (f, face, c)
+load_face_font (f, face)
struct frame *f;
struct face *face;
- int c;
{
struct font_info *font_info = NULL;
char *font_name;
int needs_overstrike;
+#ifdef USE_FONT_BACKEND
+ if (enable_font_backend)
+ abort ();
+#endif /* USE_FONT_BACKEND */
face->font_info_id = -1;
face->font = NULL;
+ face->font_name = NULL;
- font_name = choose_face_font (f, face->lface, face->fontset, c,
- &needs_overstrike);
+ font_name = choose_face_font (f, face->lface, Qnil, &needs_overstrike);
if (!font_name)
return;
BLOCK_INPUT;
- font_info = FS_LOAD_FACE_FONT (f, c, font_name, face);
+ font_info = FS_LOAD_FONT (f, font_name);
UNBLOCK_INPUT;
if (font_info)
@@ -1253,10 +1269,8 @@ load_face_font (f, face, c)
face->overstrike = needs_overstrike;
if (face->gc)
{
- BLOCK_INPUT;
x_free_gc (f, face->gc);
face->gc = 0;
- UNBLOCK_INPUT;
}
}
else
@@ -1383,7 +1397,7 @@ tty_defined_color (f, color_name, color_def, alloc)
color_def->green = 0;
if (*color_name)
- status = tty_lookup_color (f, build_string (color_name), color_def, 0);
+ status = tty_lookup_color (f, build_string (color_name), color_def, NULL);
if (color_def->pixel == FACE_TTY_DEFAULT_COLOR && *color_name)
{
@@ -2131,7 +2145,7 @@ face_value (table, dim, symbol)
static INLINE int
face_numeric_value (table, dim, symbol)
struct table_entry *table;
- int dim;
+ size_t dim;
Lisp_Object symbol;
{
struct table_entry *p = face_value (table, dim, symbol);
@@ -2172,9 +2186,117 @@ face_numeric_swidth (width)
return face_numeric_value (swidth_table, DIM (swidth_table), width);
}
-
#ifdef HAVE_WINDOW_SYSTEM
+#ifdef USE_FONT_BACKEND
+static INLINE Lisp_Object
+face_symbolic_value (table, dim, font_prop)
+ struct table_entry *table;
+ int dim;
+ Lisp_Object font_prop;
+{
+ struct table_entry *p;
+ char *s = SDATA (SYMBOL_NAME (font_prop));
+ int low, mid, high, cmp;
+
+ low = 0;
+ high = dim - 1;
+
+ while (low <= high)
+ {
+ mid = (low + high) / 2;
+ cmp = strcmp (table[mid].name, s);
+
+ if (cmp < 0)
+ low = mid + 1;
+ else if (cmp > 0)
+ high = mid - 1;
+ else
+ return *table[mid].symbol;
+ }
+
+ return Qnil;
+}
+
+static INLINE Lisp_Object
+face_symbolic_weight (weight)
+ Lisp_Object weight;
+{
+ return face_symbolic_value (weight_table, DIM (weight_table), weight);
+}
+
+static INLINE Lisp_Object
+face_symbolic_slant (slant)
+ Lisp_Object slant;
+{
+ return face_symbolic_value (slant_table, DIM (slant_table), slant);
+}
+
+static INLINE Lisp_Object
+face_symbolic_swidth (width)
+ Lisp_Object width;
+{
+ return face_symbolic_value (swidth_table, DIM (swidth_table), width);
+}
+#endif /* USE_FONT_BACKEND */
+
+Lisp_Object
+split_font_name_into_vector (fontname)
+ Lisp_Object fontname;
+{
+ struct font_name font;
+ Lisp_Object vec;
+ int i;
+
+ font.name = LSTRDUPA (fontname);
+ if (! split_font_name (NULL, &font, 0))
+ return Qnil;
+ vec = Fmake_vector (make_number (XLFD_LAST), Qnil);
+ for (i = 0; i < XLFD_LAST; i++)
+ if (font.fields[i][0] != '*')
+ ASET (vec, i, build_string (font.fields[i]));
+ return vec;
+}
+
+Lisp_Object
+build_font_name_from_vector (vec)
+ Lisp_Object vec;
+{
+ struct font_name font;
+ Lisp_Object fontname;
+ char *p;
+ int i;
+
+ for (i = 0; i < XLFD_LAST; i++)
+ {
+ font.fields[i] = (NILP (AREF (vec, i))
+ ? "*" : (char *) SDATA (AREF (vec, i)));
+ if ((i == XLFD_FAMILY || i == XLFD_REGISTRY)
+ && (p = strchr (font.fields[i], '-')))
+ {
+ char *p1 = STRDUPA (font.fields[i]);
+
+ p1[p - font.fields[i]] = '\0';
+ if (i == XLFD_FAMILY)
+ {
+ font.fields[XLFD_FOUNDRY] = p1;
+ font.fields[XLFD_FAMILY] = p + 1;
+ }
+ else
+ {
+ font.fields[XLFD_REGISTRY] = p1;
+ font.fields[XLFD_ENCODING] = p + 1;
+ break;
+ }
+ }
+ }
+
+ p = build_font_name (&font);
+ fontname = build_string (p);
+ xfree (p);
+ return fontname;
+}
+
/* Return non-zero if FONT is the name of a fixed-pitch font. */
static INLINE int
@@ -2197,7 +2319,9 @@ xlfd_fixed_p (font)
72dpi versions, only.)
Value is the real point size of FONT on frame F, or 0 if it cannot
- be determined. */
+ be determined.
+
+ By side effect, set FONT->numeric[XLFD_PIXEL_SIZE]. */
static INLINE int
xlfd_point_size (f, font)
@@ -2236,6 +2360,7 @@ xlfd_point_size (f, font)
else
pixel = atoi (pixel_field);
+ font->numeric[XLFD_PIXEL_SIZE] = pixel;
if (pixel == 0)
real_pt = 0;
else
@@ -2722,12 +2847,12 @@ cmp_font_names (a, b)
}
-/* Get a sorted list of fonts of family FAMILY on frame F. If PATTERN
- is non-nil list fonts matching that pattern. Otherwise, if
- REGISTRY is non-nil return only fonts with that registry, otherwise
- return fonts of any registry. Set *FONTS to a vector of font_name
- structures allocated from the heap containing the fonts found.
- Value is the number of fonts found. */
+/* Get a sorted list of fonts matching PATTERN on frame F. If PATTERN
+ is nil, list fonts matching FAMILY and REGISTRY. FAMILY is a
+ family name string or nil. REGISTRY is a registry name string.
+ Set *FONTS to a vector of font_name structures allocated from the
+ heap containing the fonts found. Value is the number of fonts
+ found. */
static int
font_list_1 (f, pattern, family, registry, fonts)
@@ -2788,10 +2913,11 @@ concat_font_list (fonts1, nfonts1, fonts2, nfonts2)
/* Get a sorted list of fonts of family FAMILY on frame F.
- If PATTERN is non-nil list fonts matching that pattern.
+ If PATTERN is non-nil, list fonts matching that pattern.
- If REGISTRY is non-nil, return fonts with that registry and the
- alternative registries from Vface_alternative_font_registry_alist.
+ If REGISTRY is non-nil, it is a list of registry (and encoding)
+ names. Return fonts with those registries and the alternative
+ registries from Vface_alternative_font_registry_alist.
If REGISTRY is nil return fonts of any registry.
@@ -2805,35 +2931,37 @@ font_list (f, pattern, family, registry, fonts)
Lisp_Object pattern, family, registry;
struct font_name **fonts;
{
- int nfonts = font_list_1 (f, pattern, family, registry, fonts);
+ int nfonts;
+ int reg_prio;
+ int i;
+
+ if (NILP (registry))
+ return font_list_1 (f, pattern, family, registry, fonts);
- if (!NILP (registry)
- && CONSP (Vface_alternative_font_registry_alist))
+ for (reg_prio = 0, nfonts = 0; CONSP (registry); registry = XCDR (registry))
{
- Lisp_Object alter;
+ Lisp_Object elt, alter;
+ int nfonts2;
+ struct font_name *fonts2;
- alter = Fassoc (registry, Vface_alternative_font_registry_alist);
- if (CONSP (alter))
+ elt = XCAR (registry);
+ alter = Fassoc (elt, Vface_alternative_font_registry_alist);
+ if (NILP (alter))
+ alter = Fcons (elt, Qnil);
+ for (; CONSP (alter); alter = XCDR (alter), reg_prio++)
{
- int reg_prio, i;
-
- for (alter = XCDR (alter), reg_prio = 1;
- CONSP (alter);
- alter = XCDR (alter), reg_prio++)
- if (STRINGP (XCAR (alter)))
- {
- int nfonts2;
- struct font_name *fonts2;
-
- nfonts2 = font_list_1 (f, pattern, family, XCAR (alter),
- &fonts2);
+ nfonts2 = font_list_1 (f, pattern, family, XCAR (alter), &fonts2);
+ if (nfonts2 > 0)
+ {
+ if (reg_prio > 0)
for (i = 0; i < nfonts2; i++)
fonts2[i].registry_priority = reg_prio;
- *fonts = (nfonts > 0
- ? concat_font_list (*fonts, nfonts, fonts2, nfonts2)
- : fonts2);
- nfonts += nfonts2;
- }
+ if (nfonts > 0)
+ *fonts = concat_font_list (*fonts, nfonts, fonts2, nfonts2);
+ else
+ *fonts = fonts2;
+ nfonts += nfonts2;
+ }
}
}
@@ -3015,18 +3143,11 @@ the WIDTH times as wide as FACE on FRAME. */)
{
/* This is of limited utility since it works with character
widths. Keep it for compatibility. --gerd. */
- int face_id = lookup_named_face (f, face, 0, 0);
+ int face_id = lookup_named_face (f, face, 0);
struct face *face = (face_id < 0
? NULL
: FACE_FROM_ID (f, face_id));
-#ifdef WINDOWSNT
-/* For historic reasons, FONT_WIDTH refers to average width on W32,
- not maximum as on X. Redefine here. */
-#undef FONT_WIDTH
-#define FONT_WIDTH FONT_MAX_WIDTH
-#endif
-
if (face && face->font)
size = FONT_WIDTH (face->font);
else
@@ -3074,6 +3195,7 @@ the WIDTH times as wide as FACE on FRAME. */)
#define LFACE_FONT(LFACE) AREF ((LFACE), LFACE_FONT_INDEX)
#define LFACE_INHERIT(LFACE) AREF ((LFACE), LFACE_INHERIT_INDEX)
#define LFACE_AVGWIDTH(LFACE) AREF ((LFACE), LFACE_AVGWIDTH_INDEX)
+#define LFACE_FONTSET(LFACE) AREF ((LFACE), LFACE_FONTSET_INDEX)
/* Non-zero if LFACE is a Lisp face. A Lisp face is a vector of size
LFACE_VECTOR_SIZE which has the symbol `face' in slot 0. */
@@ -3152,7 +3274,12 @@ check_lface_attrs (attrs)
xassert (UNSPECIFIEDP (attrs[LFACE_FONT_INDEX])
|| IGNORE_DEFFACE_P (attrs[LFACE_FONT_INDEX])
|| NILP (attrs[LFACE_FONT_INDEX])
+#ifdef USE_FONT_BACKEND
+ || FONT_OBJECT_P (attrs[LFACE_FONT_INDEX])
+#endif /* USE_FONT_BACKEND */
|| STRINGP (attrs[LFACE_FONT_INDEX]));
+ xassert (UNSPECIFIEDP (attrs[LFACE_FONTSET_INDEX])
+ || STRINGP (attrs[LFACE_FONTSET_INDEX]));
#endif
}
@@ -3220,22 +3347,6 @@ push_named_merge_point (struct named_merge_point *new_named_merge_point,
-#if 0 /* Seems to be unused. */
-static Lisp_Object
-internal_resolve_face_name (nargs, args)
- int nargs;
- Lisp_Object *args;
-{
- return Fget (args[0], args[1]);
-}
-
-static Lisp_Object
-resolve_face_name_error (ignore)
- Lisp_Object ignore;
-{
- return Qnil;
-}
-#endif
/* Resolve face name FACE_NAME. If FACE_NAME is a string, intern it
to make it a symbol. If FACE_NAME is an alias for another face,
@@ -3360,7 +3471,7 @@ lface_fully_specified_p (attrs)
for (i = 1; i < LFACE_VECTOR_SIZE; ++i)
if (i != LFACE_FONT_INDEX && i != LFACE_INHERIT_INDEX
- && i != LFACE_AVGWIDTH_INDEX)
+ && i != LFACE_AVGWIDTH_INDEX && i != LFACE_FONTSET_INDEX)
if ((UNSPECIFIEDP (attrs[i]) || IGNORE_DEFFACE_P (attrs[i]))
#ifdef MAC_OS
/* MAC_TODO: No stipple support on Mac OS yet, this index is
@@ -3404,8 +3515,15 @@ set_lface_from_font_name (f, lface, fontname, force_p, may_fail_p)
/* If FONTNAME is actually a fontset name, get ASCII font name of it. */
fontset = fs_query_fontset (fontname, 0);
- if (fontset >= 0)
+
+ if (fontset > 0)
font_name = SDATA (fontset_ascii (fontset));
+ else if (fontset == 0)
+ {
+ if (may_fail_p)
+ return 0;
+ abort ();
+ }
/* Check if FONT_NAME is surely available on the system. Usually
FONT_NAME is already cached for the frame F and FS_LOAD_FONT
@@ -3413,7 +3531,7 @@ set_lface_from_font_name (f, lface, fontname, force_p, may_fail_p)
caching it now is not futail because we anyway load the font
later. */
BLOCK_INPUT;
- font_info = FS_LOAD_FONT (f, 0, font_name, -1);
+ font_info = FS_LOAD_FONT (f, font_name);
UNBLOCK_INPUT;
if (!font_info)
@@ -3475,11 +3593,103 @@ set_lface_from_font_name (f, lface, fontname, force_p, may_fail_p)
LFACE_SLANT (lface)
= have_xlfd_p ? xlfd_symbolic_slant (&font) : Qnormal;
- LFACE_FONT (lface) = fontname;
-
+ if (fontset > 0)
+ {
+ LFACE_FONT (lface) = build_string (font_info->full_name);
+ LFACE_FONTSET (lface) = fontset_name (fontset);
+ }
+ else
+ {
+ LFACE_FONT (lface) = fontname;
+ fontset
+ = new_fontset_from_font_name (build_string (font_info->full_name));
+ LFACE_FONTSET (lface) = fontset_name (fontset);
+ }
return 1;
}
+#ifdef USE_FONT_BACKEND
+/* Set font-related attributes of Lisp face LFACE from FONT-OBJECT and
+ FONTSET. If FORCE_P is zero, set only unspecified attributes of
+ LFACE. The exceptions are `font' and `fontset' attributes. They
+ are set regardless of FORCE_P. */
+
+static void
+set_lface_from_font_and_fontset (f, lface, font_object, fontset, force_p)
+ struct frame *f;
+ Lisp_Object lface, font_object;
+ int fontset;
+ int force_p;
+{
+ struct font *font = XSAVE_VALUE (font_object)->pointer;
+ Lisp_Object entity = font->entity;
+ Lisp_Object val;
+
+ /* Set attributes only if unspecified, otherwise face defaults for
+ new frames would never take effect. If the font doesn't have a
+ specific property, set a normal value for that. */
+
+ if (force_p || UNSPECIFIEDP (LFACE_FAMILY (lface)))
+ {
+ Lisp_Object foundry = AREF (entity, FONT_FOUNDRY_INDEX);
+ Lisp_Object family = AREF (entity, FONT_FAMILY_INDEX);
+
+ if (! NILP (foundry))
+ {
+ if (! NILP (family))
+ val = concat3 (SYMBOL_NAME (foundry), build_string ("-"),
+ SYMBOL_NAME (family));
+ else
+ val = concat2 (SYMBOL_NAME (foundry), build_string ("-*"));
+ }
+ else
+ {
+ if (! NILP (family))
+ val = SYMBOL_NAME (family);
+ else
+ val = build_string ("*");
+ }
+ LFACE_FAMILY (lface) = val;
+ }
+
+ if (force_p || UNSPECIFIEDP (LFACE_HEIGHT (lface)))
+ {
+ int pt = pixel_point_size (f, font->pixel_size * 10);
+
+ xassert (pt > 0);
+ LFACE_HEIGHT (lface) = make_number (pt);
+ }
+
+ if (force_p || UNSPECIFIEDP (LFACE_AVGWIDTH (lface)))
+ LFACE_AVGWIDTH (lface) = make_number (font->font.average_width);
+
+ if (force_p || UNSPECIFIEDP (LFACE_WEIGHT (lface)))
+ {
+ Lisp_Object weight = font_symbolic_weight (entity);
+
+ val = NILP (weight) ? Qnormal : face_symbolic_weight (weight);
+ LFACE_WEIGHT (lface) = ! NILP (val) ? val : weight;
+ }
+ if (force_p || UNSPECIFIEDP (LFACE_SLANT (lface)))
+ {
+ Lisp_Object slant = font_symbolic_slant (entity);
+
+ val = NILP (slant) ? Qnormal : face_symbolic_slant (slant);
+ LFACE_SLANT (lface) = ! NILP (val) ? val : slant;
+ }
+ if (force_p || UNSPECIFIEDP (LFACE_SWIDTH (lface)))
+ {
+ Lisp_Object width = font_symbolic_width (entity);
+
+ val = NILP (width) ? Qnormal : face_symbolic_swidth (width);
+ LFACE_SWIDTH (lface) = ! NILP (val) ? val : width;
+ }
+
+ LFACE_FONT (lface) = font_object;
+ LFACE_FONTSET (lface) = fontset_name (fontset);
+}
+#endif /* USE_FONT_BACKEND */
+
#endif /* HAVE_WINDOW_SYSTEM */
@@ -4304,7 +4514,7 @@ FRAME 0 means change the face on all frames, and change the default
LFACE_SWIDTH (lface) = value;
font_related_attr_p = 1;
}
- else if (EQ (attr, QCfont))
+ else if (EQ (attr, QCfont) || EQ (attr, QCfontset))
{
#ifdef HAVE_WINDOW_SYSTEM
if (EQ (frame, Qt) || FRAME_WINDOW_P (XFRAME (frame)))
@@ -4319,6 +4529,48 @@ FRAME 0 means change the face on all frames, and change the default
else
f = check_x_frame (frame);
+#ifdef USE_FONT_BACKEND
+ if (enable_font_backend
+ && !UNSPECIFIEDP (value) && !IGNORE_DEFFACE_P (value))
+ {
+ int fontset;
+
+ if (EQ (attr, QCfontset))
+ {
+ Lisp_Object fontset_name = Fquery_fontset (value, Qnil);
+
+ if (NILP (fontset_name))
+ signal_error ("Invalid fontset name", value);
+ LFACE_FONTSET (lface) = value;
+ }
+ else
+ {
+ Lisp_Object font_object;
+
+ if (FONT_OBJECT_P (value))
+ {
+ font_object = value;
+ fontset = FRAME_FONTSET (f);
+ }
+ else
+ {
+ CHECK_STRING (value);
+
+ fontset = fs_query_fontset (value, 0);
+ if (fontset >= 0)
+ value = fontset_ascii (fontset);
+ else
+ fontset = FRAME_FONTSET (f);
+ font_object = font_open_by_name (f, SDATA (value));
+ if (NILP (font_object))
+ signal_error ("Invalid font", value);
+ }
+ set_lface_from_font_and_fontset (f, lface, font_object,
+ fontset, 1);
+ }
+ }
+ else
+#endif /* USE_FONT_BACKEND */
if (!UNSPECIFIEDP (value) && !IGNORE_DEFFACE_P (value))
{
CHECK_STRING (value);
@@ -4328,9 +4580,16 @@ FRAME 0 means change the face on all frames, and change the default
tmp = Fquery_fontset (value, Qnil);
if (!NILP (tmp))
value = tmp;
+ else if (EQ (attr, QCfontset))
+ signal_error ("Invalid fontset name", value);
- if (!set_lface_from_font_name (f, lface, value, 1, 1))
- signal_error ("Invalid font or fontset name", value);
+ if (EQ (attr, QCfont))
+ {
+ if (!set_lface_from_font_name (f, lface, value, 1, 1))
+ signal_error ("Invalid font or fontset name", value);
+ }
+ else
+ LFACE_FONTSET (lface) = value;
}
font_attr_p = 1;
@@ -4382,6 +4641,7 @@ FRAME 0 means change the face on all frames, and change the default
if (!EQ (frame, Qt)
&& NILP (Fget (face, Qface_no_inherit))
&& (EQ (attr, QCfont)
+ || EQ (attr, QCfontset)
|| NILP (Fequal (old_value, value))))
{
++face_change_count;
@@ -4489,7 +4749,7 @@ FRAME 0 means change the face on all frames, and change the default
#ifdef HAVE_WINDOW_SYSTEM
/* Set the `font' frame parameter of FRAME determined from `default'
- face attributes LFACE. If a face or fontset name is explicitely
+ face attributes LFACE. If a font name is explicitely
specfied in LFACE, use it as is. Otherwise, determine a font name
from the other font-related atrributes of LFACE. In that case, if
there's no matching font, signals an error. */
@@ -4507,12 +4767,30 @@ set_font_frame_param (frame, lface)
if (STRINGP (LFACE_FONT (lface)))
font_name = LFACE_FONT (lface);
+#ifdef USE_FONT_BACKEND
+ else if (enable_font_backend)
+ {
+ /* We set FONT_NAME to a font-object. */
+ if (FONT_OBJECT_P (LFACE_FONT (lface)))
+ font_name = LFACE_FONT (lface);
+ else
+ {
+ font_name = font_find_for_lface (f, &AREF (lface, 0), Qnil);
+ if (NILP (font_name))
+ error ("No font matches the specified attribute");
+ font_name = font_open_for_lface (f, font_name, &AREF (lface, 0),
+ Qnil);
+ if (NILP (font_name))
+ error ("No font matches the specified attribute");
+ }
+ }
+#endif
else
{
/* Choose a font name that reflects LFACE's attributes and has
the registry and encoding pattern specified in the default
fontset (3rd arg: -1) for ASCII characters (4th arg: 0). */
- font = choose_face_font (f, XVECTOR (lface)->contents, -1, 0, 0);
+ font = choose_face_font (f, XVECTOR (lface)->contents, Qnil, NULL);
if (!font)
error ("No font matches the specified attribute");
font_name = build_string (font);
@@ -4895,6 +5173,8 @@ frames). If FRAME is omitted or nil, use the selected frame. */)
value = LFACE_INHERIT (lface);
else if (EQ (keyword, QCfont))
value = LFACE_FONT (lface);
+ else if (EQ (keyword, QCfontset))
+ value = LFACE_FONTSET (lface);
else
signal_error ("Invalid face attribute name", keyword);
@@ -4999,15 +5279,18 @@ Default face attributes override any local face attributes. */)
return fonts with the same size as the font of a face. This is
done in fontset.el. */
-DEFUN ("face-font", Fface_font, Sface_font, 1, 2, 0,
+DEFUN ("face-font", Fface_font, Sface_font, 1, 3, 0,
doc: /* Return the font name of face FACE, or nil if it is unspecified.
+The font name is, by default, for ASCII characters.
If the optional argument FRAME is given, report on face FACE in that frame.
If FRAME is t, report on the defaults for face FACE (for new frames).
The font default for a face is either nil, or a list
of the form (bold), (italic) or (bold italic).
-If FRAME is omitted or nil, use the selected frame. */)
- (face, frame)
- Lisp_Object face, frame;
+If FRAME is omitted or nil, use the selected frame. And, in this case,
+if the optional third argument CHARACTER is given,
+return the font name used for CHARACTER. */)
+ (face, frame, character)
+ Lisp_Object face, frame, character;
{
if (EQ (frame, Qt))
{
@@ -5027,9 +5310,23 @@ If FRAME is omitted or nil, use the selected frame. */)
else
{
struct frame *f = frame_or_selected_frame (frame, 1);
- int face_id = lookup_named_face (f, face, 0, 1);
+ int face_id = lookup_named_face (f, face, 1);
struct face *face = FACE_FROM_ID (f, face_id);
- return face ? build_string (face->font_name) : Qnil;
+
+ if (! face)
+ return Qnil;
+#ifdef HAVE_WINDOW_SYSTEM
+ if (FRAME_WINDOW_P (f) && !NILP (character))
+ {
+ CHECK_CHARACTER (character);
+ face_id = FACE_FOR_CHAR (f, face, XINT (character), -1, Qnil);
+ face = FACE_FROM_ID (f, face_id);
+ return (face->font && face->font_name
+ ? build_string (face->font_name)
+ : Qnil);
+ }
+#endif
+ return build_string (face->font_name);
}
}
@@ -5192,8 +5489,8 @@ lface_hash (v)
/* Return non-zero if LFACE1 and LFACE2 specify the same font (without
considering charsets/registries). They do if they specify the same
- family, point size, weight, width, slant, and fontset. Both LFACE1
- and LFACE2 must be fully-specified. */
+ family, point size, weight, width, slant, font, and fontset. Both
+ LFACE1 and LFACE2 must be fully-specified. */
static INLINE int
lface_same_font_attributes_p (lface1, lface2)
@@ -5211,8 +5508,14 @@ lface_same_font_attributes_p (lface1, lface2)
&& (EQ (lface1[LFACE_FONT_INDEX], lface2[LFACE_FONT_INDEX])
|| (STRINGP (lface1[LFACE_FONT_INDEX])
&& STRINGP (lface2[LFACE_FONT_INDEX])
- && xstricmp (SDATA (lface1[LFACE_FONT_INDEX]),
- SDATA (lface2[LFACE_FONT_INDEX])))));
+ && ! xstricmp (SDATA (lface1[LFACE_FONT_INDEX]),
+ SDATA (lface2[LFACE_FONT_INDEX]))))
+ && (EQ (lface1[LFACE_FONTSET_INDEX], lface2[LFACE_FONTSET_INDEX])
+ || (STRINGP (lface1[LFACE_FONTSET_INDEX])
+ && STRINGP (lface2[LFACE_FONTSET_INDEX])
+ && ! xstricmp (SDATA (lface1[LFACE_FONTSET_INDEX]),
+ SDATA (lface2[LFACE_FONTSET_INDEX]))))
+ );
}
@@ -5239,7 +5542,7 @@ make_realized_face (attr)
/* Free realized face FACE, including its X resources. FACE may
be null. */
-static void
+void
free_realized_face (f, face)
struct frame *f;
struct face *face;
@@ -5254,10 +5557,12 @@ free_realized_face (f, face)
free_face_fontset (f, face);
if (face->gc)
{
- BLOCK_INPUT;
+#ifdef USE_FONT_BACKEND
+ if (enable_font_backend && face->font_info)
+ font_done_for_face (f, face);
+#endif /* USE_FONT_BACKEND */
x_free_gc (f, face->gc);
face->gc = 0;
- UNBLOCK_INPUT;
}
free_face_colors (f, face);
@@ -5317,6 +5622,10 @@ prepare_face_for_display (f, face)
}
#endif
face->gc = x_create_gc (f, mask, &xgcv);
+#ifdef USE_FONT_BACKEND
+ if (enable_font_backend && face->font)
+ font_prepare_for_face (f, face);
+#endif /* USE_FONT_BACKEND */
UNBLOCK_INPUT;
}
#endif /* HAVE_WINDOW_SYSTEM */
@@ -5421,10 +5730,12 @@ clear_face_gcs (c)
struct face *face = c->faces_by_id[i];
if (face && face->gc)
{
- BLOCK_INPUT;
+#ifdef USE_FONT_BACKEND
+ if (enable_font_backend && face->font_info)
+ font_done_for_face (c->f, face);
+#endif /* USE_FONT_BACKEND */
x_free_gc (c->f, face->gc);
face->gc = 0;
- UNBLOCK_INPUT;
}
}
#endif /* HAVE_WINDOW_SYSTEM */
@@ -5476,11 +5787,10 @@ free_realized_faces (c)
}
-/* Free all faces realized for multibyte characters on frame F that
- has FONTSET. */
+/* Free all realized faces that are using FONTSET on frame F. */
void
-free_realized_multibyte_face (f, fontset)
+free_realized_faces_for_fontset (f, fontset)
struct frame *f;
int fontset;
{
@@ -5497,7 +5807,6 @@ free_realized_multibyte_face (f, fontset)
{
face = cache->faces_by_id[i];
if (face
- && face != face->ascii_face
&& face->fontset == fontset)
{
uncache_face (cache, face);
@@ -5555,10 +5864,11 @@ free_face_cache (c)
/* Cache realized face FACE in face cache C. HASH is the hash value
- of FACE. If FACE->fontset >= 0, add the new face to the end of the
- collision list of the face hash table of C. This is done because
- otherwise lookup_face would find FACE for every character, even if
- faces with the same attributes but for specific characters exist. */
+ of FACE. If FACE is for ASCII characters (i.e. FACE->ascii_face ==
+ FACE), insert the new face to the beginning of the collision list
+ of the face hash table of C. Otherwise, add the new face to the
+ end of the collision list. This way, lookup_face can quickly find
+ that a requested face is not cached. */
static void
cache_face (c, face, hash)
@@ -5570,7 +5880,7 @@ cache_face (c, face, hash)
face->hash = hash;
- if (face->fontset >= 0)
+ if (face->ascii_face != face)
{
struct face *last = c->buckets[i];
if (last)
@@ -5662,17 +5972,14 @@ uncache_face (c, face)
/* Look up a realized face with face attributes ATTR in the face cache
- of frame F. The face will be used to display character C. Value
- is the ID of the face found. If no suitable face is found, realize
- a new one. In that case, if C is a multibyte character, BASE_FACE
- is a face that has the same attributes. */
+ of frame F. The face will be used to display ASCII characters.
+ Value is the ID of the face found. If no suitable face is found,
+ realize a new one. */
INLINE int
-lookup_face (f, attr, c, base_face)
+lookup_face (f, attr)
struct frame *f;
Lisp_Object *attr;
- int c;
- struct face *base_face;
{
struct face_cache *cache = FRAME_FACE_CACHE (f);
unsigned hash;
@@ -5687,44 +5994,121 @@ lookup_face (f, attr, c, base_face)
i = hash % FACE_CACHE_BUCKETS_SIZE;
for (face = cache->buckets[i]; face; face = face->next)
- if (face->hash == hash
- && (!FRAME_WINDOW_P (f)
- || FACE_SUITABLE_FOR_CHAR_P (face, c))
- && lface_equal_p (face->lface, attr))
- break;
+ {
+ if (face->ascii_face != face)
+ {
+ /* There's no more ASCII face. */
+ face = NULL;
+ break;
+ }
+ if (face->hash == hash
+ && lface_equal_p (face->lface, attr))
+ break;
+ }
/* If not found, realize a new face. */
if (face == NULL)
- face = realize_face (cache, attr, c, base_face, -1);
+ face = realize_face (cache, attr, -1);
#if GLYPH_DEBUG
xassert (face == FACE_FROM_ID (f, face->id));
+#endif /* GLYPH_DEBUG */
-/* When this function is called from face_for_char (in this case, C is
- a multibyte character), a fontset of a face returned by
- realize_face is not yet set, i.e. FACE_SUITABLE_FOR_CHAR_P (FACE,
- C) is not sutisfied. The fontset is set for this face by
- face_for_char later. */
-#if 0
- if (FRAME_WINDOW_P (f))
- xassert (FACE_SUITABLE_FOR_CHAR_P (face, c));
-#endif
+ return face->id;
+}
+
+#ifdef HAVE_WINDOW_SYSTEM
+/* Look up a realized face that has the same attributes as BASE_FACE
+ except for the font in the face cache of frame F. If FONT_ID is
+ not negative, it is an ID number of an already opened font that is
+ used by the face. If FONT_ID is negative, the face has no font.
+ Value is the ID of the face found. If no suitable face is found,
+ realize a new one. */
+
+int
+lookup_non_ascii_face (f, font_id, base_face)
+ struct frame *f;
+ int font_id;
+ struct face *base_face;
+{
+ struct face_cache *cache = FRAME_FACE_CACHE (f);
+ unsigned hash;
+ int i;
+ struct face *face;
+
+ xassert (cache != NULL);
+ base_face = base_face->ascii_face;
+ hash = lface_hash (base_face->lface);
+ i = hash % FACE_CACHE_BUCKETS_SIZE;
+
+ for (face = cache->buckets[i]; face; face = face->next)
+ {
+ if (face->ascii_face == face)
+ continue;
+ if (face->ascii_face == base_face
+ && face->font_info_id == font_id)
+ break;
+ }
+
+ /* If not found, realize a new face. */
+ if (face == NULL)
+ face = realize_non_ascii_face (f, font_id, base_face);
+
+#if GLYPH_DEBUG
+ xassert (face == FACE_FROM_ID (f, face->id));
#endif /* GLYPH_DEBUG */
return face->id;
}
+#ifdef USE_FONT_BACKEND
+int
+face_for_font (f, font, base_face)
+ struct frame *f;
+ struct font *font;
+ struct face *base_face;
+{
+ struct face_cache *cache = FRAME_FACE_CACHE (f);
+ unsigned hash;
+ int i;
+ struct face *face;
+
+ xassert (cache != NULL);
+ base_face = base_face->ascii_face;
+ hash = lface_hash (base_face->lface);
+ i = hash % FACE_CACHE_BUCKETS_SIZE;
+
+ for (face = cache->buckets[i]; face; face = face->next)
+ {
+ if (face->ascii_face == face)
+ continue;
+ if (face->ascii_face == base_face
+ && face->font == font->font.font
+ && face->font_info == (struct font_info *) font)
+ return face->id;
+ }
+
+ /* If not found, realize a new face. */
+ face = realize_non_ascii_face (f, -1, base_face);
+ face->font = font->font.font;
+ face->font_info = (struct font_info *) font;
+ face->font_info_id = 0;
+ face->font_name = font->font.full_name;
+ return face->id;
+}
+#endif /* USE_FONT_BACKEND */
+
+#endif /* HAVE_WINDOW_SYSTEM */
/* Return the face id of the realized face for named face SYMBOL on
- frame F suitable for displaying character C. Value is -1 if the
- face couldn't be determined, which might happen if the default face
- isn't realized and cannot be realized. */
+ frame F suitable for displaying ASCII characters. Value is -1 if
+ the face couldn't be determined, which might happen if the default
+ face isn't realized and cannot be realized. */
int
-lookup_named_face (f, symbol, c, signal_p)
+lookup_named_face (f, symbol, signal_p)
struct frame *f;
Lisp_Object symbol;
- int c;
int signal_p;
{
Lisp_Object attrs[LFACE_VECTOR_SIZE];
@@ -5746,7 +6130,7 @@ lookup_named_face (f, symbol, c, signal_p)
bcopy (default_face->lface, attrs, sizeof attrs);
merge_face_vectors (f, symbol_attrs, attrs, 0);
- return lookup_face (f, attrs, c, NULL);
+ return lookup_face (f, attrs);
}
@@ -5763,7 +6147,7 @@ ascii_face_of_lisp_face (f, lface_id)
if (lface_id >= 0 && lface_id < lface_id_to_name_size)
{
Lisp_Object face_name = lface_id_to_name[lface_id];
- face_id = lookup_named_face (f, face_name, 0, 1);
+ face_id = lookup_named_face (f, face_name, 1);
}
else
face_id = -1;
@@ -5811,7 +6195,7 @@ smaller_face (f, face_id, steps)
/* Look up a face for a slightly smaller/larger font. */
pt += delta;
attrs[LFACE_HEIGHT_INDEX] = make_number (pt);
- new_face_id = lookup_face (f, attrs, 0, NULL);
+ new_face_id = lookup_face (f, attrs);
new_face = FACE_FROM_ID (f, new_face_id);
/* If height changes, count that as one step. */
@@ -5854,7 +6238,7 @@ face_with_height (f, face_id, height)
face = FACE_FROM_ID (f, face_id);
bcopy (face->lface, attrs, sizeof attrs);
attrs[LFACE_HEIGHT_INDEX] = make_number (height);
- face_id = lookup_face (f, attrs, 0, NULL);
+ face_id = lookup_face (f, attrs);
#endif /* HAVE_WINDOW_SYSTEM */
return face_id;
@@ -5862,17 +6246,16 @@ face_with_height (f, face_id, height)
/* Return the face id of the realized face for named face SYMBOL on
- frame F suitable for displaying character C, and use attributes of
- the face FACE_ID for attributes that aren't completely specified by
- SYMBOL. This is like lookup_named_face, except that the default
- attributes come from FACE_ID, not from the default face. FACE_ID
- is assumed to be already realized. */
+ frame F suitable for displaying ASCII characters, and use
+ attributes of the face FACE_ID for attributes that aren't
+ completely specified by SYMBOL. This is like lookup_named_face,
+ except that the default attributes come from FACE_ID, not from the
+ default face. FACE_ID is assumed to be already realized. */
int
-lookup_derived_face (f, symbol, c, face_id, signal_p)
+lookup_derived_face (f, symbol, face_id, signal_p)
struct frame *f;
Lisp_Object symbol;
- int c;
int face_id;
int signal_p;
{
@@ -5886,7 +6269,7 @@ lookup_derived_face (f, symbol, c, face_id, signal_p)
get_lface_attributes (f, symbol, symbol_attrs, signal_p);
bcopy (default_face->lface, attrs, sizeof attrs);
merge_face_vectors (f, symbol_attrs, attrs, 0);
- return lookup_face (f, attrs, c, default_face);
+ return lookup_face (f, attrs);
}
DEFUN ("face-attributes-as-vector", Fface_attributes_as_vector,
@@ -5973,6 +6356,7 @@ x_supports_face_attributes_p (f, attrs, def_face)
|| !UNSPECIFIEDP (attrs[LFACE_SWIDTH_INDEX])
|| !UNSPECIFIEDP (attrs[LFACE_AVGWIDTH_INDEX]))
{
+ int face_id;
struct face *face;
Lisp_Object merged_attrs[LFACE_VECTOR_SIZE];
@@ -5980,7 +6364,8 @@ x_supports_face_attributes_p (f, attrs, def_face)
merge_face_vectors (f, attrs, merged_attrs, 0);
- face = FACE_FROM_ID (f, lookup_face (f, merged_attrs, 0, 0));
+ face_id = lookup_face (f, merged_attrs);
+ face = FACE_FROM_ID (f, face_id);
if (! face)
error ("Cannot make face");
@@ -6085,7 +6470,7 @@ tty_supports_face_attributes_p (f, attrs, def_face)
val = attrs[LFACE_INVERSE_INDEX];
if (!UNSPECIFIEDP (val))
{
- if (face_attr_equal_p (val, def_attrs[LFACE_INVERSE_INDEX]))
+ if (face_attr_equal_p (val, def_attrs[LFACE_UNDERLINE_INDEX]))
return 0; /* same as default */
else
test_caps |= TTY_CAP_INVERSE;
@@ -6128,7 +6513,7 @@ tty_supports_face_attributes_p (f, attrs, def_face)
bg = attrs[LFACE_BACKGROUND_INDEX];
if (STRINGP (bg))
{
- Lisp_Object def_bg = def_attrs[LFACE_BACKGROUND_INDEX];
+ Lisp_Object def_bg = def_attrs[LFACE_FOREGROUND_INDEX];
if (face_attr_equal_p (bg, def_bg))
return 0; /* same as default */
@@ -6166,7 +6551,7 @@ tty_supports_face_attributes_p (f, attrs, def_face)
/* See if the capabilities we selected above are supported, with the
given colors. */
if (test_caps != 0 &&
- ! tty_capable_p (FRAME_TTY (f), test_caps, fg_tty_color.pixel, bg_tty_color.pixel))
+ ! tty_capable_p (f, test_caps, fg_tty_color.pixel, bg_tty_color.pixel))
return 0;
@@ -6262,7 +6647,7 @@ face for italic. */)
Font selection
***********************************************************************/
-DEFUN ("internal-set-font-selection-order",
+ DEFUN ("internal-set-font-selection-order",
Finternal_set_font_selection_order,
Sinternal_set_font_selection_order, 1, 1, 0,
doc: /* Set font selection order for face font selection to ORDER.
@@ -6318,6 +6703,10 @@ Value is ORDER. */)
free_all_realized_faces (Qnil);
}
+#ifdef USE_FONT_BACKEND
+ font_update_sort_order (font_sort_order);
+#endif /* USE_FONT_BACKEND */
+
return Qnil;
}
@@ -6508,6 +6897,12 @@ build_scalable_font_name (f, font, specified_pt)
double resy = FRAME_X_DISPLAY_INFO (f)->resy;
double pt;
+ if (font->numeric[XLFD_PIXEL_SIZE] != 0
+ || font->numeric[XLFD_POINT_SIZE] != 0)
+ /* This is a scalable font but is requested for a specific size.
+ We should not change that size. */
+ return build_font_name (font);
+
/* If scalable font is for a specific resolution, compute
the point size we must specify from the resolution of
the display and the specified resolution of the font. */
@@ -6780,78 +7175,62 @@ try_alternative_families (f, family, registry, fonts)
/* Get a list of matching fonts on frame F.
- FAMILY, if a string, specifies a font family derived from the fontset.
- It is only used if the face does not specify any family in ATTRS or
- if we cannot find any font of the face's family.
+ PATTERN, if a string, specifies a font name pattern to match while
+ ignoring FAMILY and REGISTRY.
- REGISTRY, if a string, specifies a font registry and encoding to
- match. A value of nil means include fonts of any registry and
- encoding.
+ FAMILY, if a list, specifies a list of font families to try.
- If PREFER_FACE_FAMILY is nonzero, perfer face's family to FAMILY.
- Otherwise, prefer FAMILY.
+ REGISTRY, if a list, specifies a list of font registries and
+ encodinging to try.
Return in *FONTS a pointer to a vector of font_name structures for
the fonts matched. Value is the number of fonts found. */
static int
-try_font_list (f, attrs, family, registry, fonts, prefer_face_family)
+try_font_list (f, pattern, family, registry, fonts)
struct frame *f;
- Lisp_Object *attrs;
- Lisp_Object family, registry;
+ Lisp_Object pattern, family, registry;
struct font_name **fonts;
- int prefer_face_family;
{
int nfonts = 0;
- Lisp_Object face_family = attrs[LFACE_FAMILY_INDEX];
- Lisp_Object try_family;
-
- try_family = (prefer_face_family || NILP (family)) ? face_family : family;
-
- if (STRINGP (try_family))
- nfonts = try_alternative_families (f, try_family, registry, fonts);
-#ifdef MAC_OS
- if (nfonts == 0 && STRINGP (try_family) && STRINGP (registry))
- {
- if (xstricmp (SDATA (registry), "mac-roman") == 0)
- /* When realizing the default face and a font spec does not
- matched exactly, Emacs looks for ones with the same registry
- as the default font. On the Mac, this is mac-roman, which
- does not work if the family is -etl-fixed, e.g. The
- following widens the choices and fixes that problem. */
- nfonts = try_alternative_families (f, try_family, Qnil, fonts);
- else if (SBYTES (try_family) > 0
- && SREF (try_family, SBYTES (try_family) - 1) != '*')
- /* Some Central European/Cyrillic font family names have the
- Roman counterpart name as their prefix. */
- nfonts = try_alternative_families (f, concat2 (try_family,
- build_string ("*")),
- registry, fonts);
+ if (STRINGP (pattern))
+ {
+ nfonts = font_list (f, pattern, Qnil, Qnil, fonts);
+ if (nfonts == 0 && ! EQ (Vscalable_fonts_allowed, Qt))
+ {
+ int count = SPECPDL_INDEX ();
+ specbind (Qscalable_fonts_allowed, Qt);
+ nfonts = font_list (f, pattern, Qnil, Qnil, fonts);
+ unbind_to (count, Qnil);
+ }
}
-#endif
+ else
+ {
+ Lisp_Object tail;
- if (EQ (try_family, family))
- family = face_family;
+ if (NILP (family))
+ nfonts = font_list (f, Qnil, Qnil, registry, fonts);
+ else
+ for (tail = family; ! nfonts && CONSP (tail); tail = XCDR (tail))
+ nfonts = try_alternative_families (f, XCAR (tail), registry, fonts);
- if (nfonts == 0 && STRINGP (family))
- nfonts = try_alternative_families (f, family, registry, fonts);
+ /* Try font family of the default face or "fixed". */
+ if (nfonts == 0 && !NILP (family))
+ {
+ struct face *default_face = FACE_FROM_ID (f, DEFAULT_FACE_ID);
+ if (default_face)
+ family = default_face->lface[LFACE_FAMILY_INDEX];
+ else
+ family = build_string ("fixed");
+ nfonts = try_alternative_families (f, family, registry, fonts);
+ }
- /* Try font family of the default face or "fixed". */
- if (nfonts == 0)
- {
- struct face *default_face = FACE_FROM_ID (f, DEFAULT_FACE_ID);
- if (default_face)
- family = default_face->lface[LFACE_FAMILY_INDEX];
- else
- family = build_string ("fixed");
- nfonts = font_list (f, Qnil, family, registry, fonts);
+ /* Try any family with the given registry. */
+ if (nfonts == 0 && !NILP (family))
+ nfonts = try_alternative_families (f, Qnil, registry, fonts);
}
- /* Try any family with the given registry. */
- if (nfonts == 0)
- nfonts = try_alternative_families (f, Qnil, registry, fonts);
-
return nfonts;
}
@@ -6866,63 +7245,108 @@ face_fontset (attrs)
{
Lisp_Object name;
- name = attrs[LFACE_FONT_INDEX];
+ name = attrs[LFACE_FONTSET_INDEX];
if (!STRINGP (name))
return -1;
return fs_query_fontset (name, 0);
}
-/* Choose a name of font to use on frame F to display character C with
+/* Choose a name of font to use on frame F to display characters with
Lisp face attributes specified by ATTRS. The font name is
- determined by the font-related attributes in ATTRS and the name
- pattern for C in FONTSET. Value is the font name which is
- allocated from the heap and must be freed by the caller, or NULL if
- we can get no information about the font name of C. It is assured
- that we always get some information for a single byte
- character.
+ determined by the font-related attributes in ATTRS and FONT-SPEC
+ (if specified).
- If NEEDS_OVERSTRIKE is non-zero, a boolean is returned in it to
- indicate whether the resulting font should be drawn using overstrike
- to simulate bold-face. */
+ When we are choosing a font for ASCII characters, FONT-SPEC is
+ always nil. Otherwise FONT-SPEC is a list
+ [ FAMILY WEIGHT SLANT SWIDTH ADSTYLE REGISTRY ]
+ or a string specifying a font name pattern.
-static char *
-choose_face_font (f, attrs, fontset, c, needs_overstrike)
+ If NEEDS_OVERSTRIKE is not NULL, a boolean is returned in it to
+ indicate whether the resulting font should be drawn using
+ overstrike to simulate bold-face.
+
+ Value is the font name which is allocated from the heap and must be
+ freed by the caller. */
+
+char *
+choose_face_font (f, attrs, font_spec, needs_overstrike)
struct frame *f;
Lisp_Object *attrs;
- int fontset, c;
+ Lisp_Object font_spec;
int *needs_overstrike;
{
- Lisp_Object pattern;
+ Lisp_Object pattern, family, adstyle, registry;
char *font_name = NULL;
struct font_name *fonts;
- int nfonts, width_ratio;
+ int nfonts;
if (needs_overstrike)
*needs_overstrike = 0;
- /* Get (foundry and) family name and registry (and encoding) name of
- a font for C. */
- pattern = fontset_font_pattern (f, fontset, c);
- if (NILP (pattern))
+ /* If we are choosing an ASCII font and a font name is explicitly
+ specified in ATTRS, return it. */
+ if (NILP (font_spec) && STRINGP (attrs[LFACE_FONT_INDEX]))
+ return xstrdup (SDATA (attrs[LFACE_FONT_INDEX]));
+
+ if (NILP (attrs[LFACE_FAMILY_INDEX]))
+ family = Qnil;
+ else
+ family = Fcons (attrs[LFACE_FAMILY_INDEX], Qnil);
+
+ /* Decide FAMILY, ADSTYLE, and REGISTRY from FONT_SPEC. But,
+ ADSTYLE is not used in the font selector for the moment. */
+ if (VECTORP (font_spec))
{
- xassert (!SINGLE_BYTE_CHAR_P (c));
- return NULL;
+ pattern = Qnil;
+ if (STRINGP (AREF (font_spec, FONT_SPEC_FAMILY_INDEX)))
+ family = Fcons (AREF (font_spec, FONT_SPEC_FAMILY_INDEX), family);
+ adstyle = AREF (font_spec, FONT_SPEC_ADSTYLE_INDEX);
+ registry = Fcons (AREF (font_spec, FONT_SPEC_REGISTRY_INDEX), Qnil);
+ }
+ else if (STRINGP (font_spec))
+ {
+ pattern = font_spec;
+ family = Qnil;
+ adstyle = Qnil;
+ registry = Qnil;
+ }
+ else
+ {
+ /* We are choosing an ASCII font. By default, use the registry
+ name "iso8859-1". But, if the registry name of the ASCII
+ font specified in the fontset of ATTRS is not "iso8859-1"
+ (e.g "iso10646-1"), use also that name with higher
+ priority. */
+ int fontset = face_fontset (attrs);
+ Lisp_Object ascii;
+ int len;
+ struct font_name font;
+
+ pattern = Qnil;
+ adstyle = Qnil;
+ registry = Fcons (build_string ("iso8859-1"), Qnil);
+
+ ascii = fontset_ascii (fontset);
+ len = SBYTES (ascii);
+ if (len < 9
+ || strcmp (SDATA (ascii) + len - 9, "iso8859-1"))
+ {
+ font.name = LSTRDUPA (ascii);
+ /* Check if the name is in XLFD. */
+ if (split_font_name (f, &font, 0))
+ {
+ font.fields[XLFD_ENCODING][-1] = '-';
+ registry = Fcons (build_string (font.fields[XLFD_REGISTRY]),
+ registry);
+ }
+ }
}
-
- /* If what we got is a name pattern, return it. */
- if (STRINGP (pattern))
- return xstrdup (SDATA (pattern));
/* Get a list of fonts matching that pattern and choose the
best match for the specified face attributes from it. */
- nfonts = try_font_list (f, attrs, XCAR (pattern), XCDR (pattern), &fonts,
- (SINGLE_BYTE_CHAR_P (c)
- || CHAR_CHARSET (c) == charset_latin_iso8859_1));
- width_ratio = (SINGLE_BYTE_CHAR_P (c)
- ? 1
- : CHARSET_WIDTH (CHAR_CHARSET (c)));
- font_name = best_matching_font (f, attrs, fonts, nfonts, width_ratio,
+ nfonts = try_font_list (f, pattern, family, registry, &fonts);
+ font_name = best_matching_font (f, attrs, fonts, nfonts, NILP (font_spec),
needs_overstrike);
return font_name;
}
@@ -6970,8 +7394,7 @@ realize_basic_faces (f)
{
FRAME_FACE_CACHE (f)->menu_face_changed_p = 0;
#ifdef USE_X_TOOLKIT
- if (FRAME_WINDOW_P (f))
- x_update_menu_appearance (f);
+ x_update_menu_appearance (f);
#endif
}
@@ -7011,12 +7434,27 @@ realize_default_face (f)
#ifdef HAVE_WINDOW_SYSTEM
if (FRAME_WINDOW_P (f))
{
+#ifdef USE_FONT_BACKEND
+ if (enable_font_backend)
+ {
+ frame_font = font_find_object (FRAME_FONT_OBJECT (f));
+ xassert (FONT_OBJECT_P (frame_font));
+ set_lface_from_font_and_fontset (f, lface, frame_font,
+ FRAME_FONTSET (f),
+ f->default_face_done_p);
+ }
+ else
+ {
+#endif /* USE_FONT_BACKEND */
/* Set frame_font to the value of the `font' frame parameter. */
frame_font = Fassq (Qfont, f->param_alist);
xassert (CONSP (frame_font) && STRINGP (XCDR (frame_font)));
frame_font = XCDR (frame_font);
set_lface_from_font_name (f, lface, frame_font,
f->default_face_done_p, 1);
+#ifdef USE_FONT_BACKEND
+ }
+#endif /* USE_FONT_BACKEND */
f->default_face_done_p = 1;
}
#endif /* HAVE_WINDOW_SYSTEM */
@@ -7058,7 +7496,7 @@ realize_default_face (f)
LFACE_FOREGROUND (lface) = XCDR (color);
else if (FRAME_WINDOW_P (f))
return 0;
- else if (FRAME_INITIAL_P (f) || FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f))
+ else if (FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f))
LFACE_FOREGROUND (lface) = build_string (unspecified_fg);
else
abort ();
@@ -7073,7 +7511,7 @@ realize_default_face (f)
LFACE_BACKGROUND (lface) = XCDR (color);
else if (FRAME_WINDOW_P (f))
return 0;
- else if (FRAME_INITIAL_P (f) || FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f))
+ else if (FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f))
LFACE_BACKGROUND (lface) = build_string (unspecified_bg);
else
abort ();
@@ -7086,21 +7524,21 @@ realize_default_face (f)
xassert (lface_fully_specified_p (XVECTOR (lface)->contents));
check_lface (lface);
bcopy (XVECTOR (lface)->contents, attrs, sizeof attrs);
- face = realize_face (c, attrs, 0, NULL, DEFAULT_FACE_ID);
+ face = realize_face (c, attrs, DEFAULT_FACE_ID);
#ifdef HAVE_WINDOW_SYSTEM
#ifdef HAVE_X_WINDOWS
- if (FRAME_X_P (f) && face->font != FRAME_FONT (f))
+ if (face->font != FRAME_FONT (f))
{
/* This can happen when making a frame on a display that does
- not support the default font. */
+ not support the default font. */
if (!face->font)
- return 0;
-
+ return 0;
+
/* Otherwise, the font specified for the frame was not
- acceptable as a font for the default face (perhaps because
- auto-scaled fonts are rejected), so we must adjust the frame
- font. */
+ acceptable as a font for the default face (perhaps because
+ auto-scaled fonts are rejected), so we must adjust the frame
+ font. */
x_set_font (f, build_string (face->font_name), Qnil);
}
#endif /* HAVE_X_WINDOWS */
@@ -7143,23 +7581,19 @@ realize_named_face (f, symbol, id)
merge_face_vectors (f, symbol_attrs, attrs, 0);
/* Realize the face. */
- new_face = realize_face (c, attrs, 0, NULL, id);
+ new_face = realize_face (c, attrs, id);
}
/* Realize the fully-specified face with attributes ATTRS in face
- cache CACHE for character C. If C is a multibyte character,
- BASE_FACE is a face that has the same attributes. Otherwise,
- BASE_FACE is ignored. If FORMER_FACE_ID is non-negative, it is an
- ID of face to remove before caching the new face. Value is a
- pointer to the newly created realized face. */
+ cache CACHE for ASCII characters. If FORMER_FACE_ID is
+ non-negative, it is an ID of face to remove before caching the new
+ face. Value is a pointer to the newly created realized face. */
static struct face *
-realize_face (cache, attrs, c, base_face, former_face_id)
+realize_face (cache, attrs, former_face_id)
struct face_cache *cache;
Lisp_Object *attrs;
- int c;
- struct face *base_face;
int former_face_id;
{
struct face *face;
@@ -7177,42 +7611,78 @@ realize_face (cache, attrs, c, base_face, former_face_id)
}
if (FRAME_WINDOW_P (cache->f))
- face = realize_x_face (cache, attrs, c, base_face);
+ face = realize_x_face (cache, attrs);
else if (FRAME_TERMCAP_P (cache->f) || FRAME_MSDOS_P (cache->f))
- face = realize_tty_face (cache, attrs, c);
- else if (FRAME_INITIAL_P (cache->f))
- {
- /* Create a dummy face. */
- face = make_realized_face (attrs);
- }
+ face = realize_tty_face (cache, attrs);
else
abort ();
/* Insert the new face. */
cache_face (cache, face, lface_hash (attrs));
+ return face;
+}
+
+
#ifdef HAVE_WINDOW_SYSTEM
- if (FRAME_WINDOW_P (cache->f) && face->font == NULL)
- load_face_font (cache->f, face, c);
-#endif /* HAVE_WINDOW_SYSTEM */
+/* Realize the fully-specified face that has the same attributes as
+ BASE_FACE except for the font on frame F. If FONT_ID is not
+ negative, it is an ID number of an already opened font that should
+ be used by the face. If FONT_ID is negative, the face has no font,
+ i.e., characters are displayed by empty boxes. */
+
+static struct face *
+realize_non_ascii_face (f, font_id, base_face)
+ struct frame *f;
+ int font_id;
+ struct face *base_face;
+{
+ struct face_cache *cache = FRAME_FACE_CACHE (f);
+ struct face *face;
+ struct font_info *font_info;
+
+ face = (struct face *) xmalloc (sizeof *face);
+ *face = *base_face;
+ face->gc = 0;
+#ifdef USE_FONT_BACKEND
+ face->extra = NULL;
+#endif
+
+ /* Don't try to free the colors copied bitwise from BASE_FACE. */
+ face->colors_copied_bitwise_p = 1;
+
+ face->font_info_id = font_id;
+ if (font_id >= 0)
+ {
+ font_info = FONT_INFO_FROM_ID (f, font_id);
+ face->font = font_info->font;
+ face->font_name = font_info->full_name;
+ }
+ else
+ {
+ face->font = NULL;
+ face->font_name = NULL;
+ }
+
+ face->gc = 0;
+
+ cache_face (cache, face, face->hash);
+
return face;
}
+#endif /* HAVE_WINDOW_SYSTEM */
/* Realize the fully-specified face with attributes ATTRS in face
- cache CACHE for character C. Do it for X frame CACHE->f. If C is
- a multibyte character, BASE_FACE is a face that has the same
- attributes. Otherwise, BASE_FACE is ignored. If the new face
- doesn't share font with the default face, a fontname is allocated
- from the heap and set in `font_name' of the new face, but it is not
- yet loaded here. Value is a pointer to the newly created realized
- face. */
+ cache CACHE for ASCII characters. Do it for X frame CACHE->f. If
+ the new face doesn't share font with the default face, a fontname
+ is allocated from the heap and set in `font_name' of the new face,
+ but it is not yet loaded here. Value is a pointer to the newly
+ created realized face. */
static struct face *
-realize_x_face (cache, attrs, c, base_face)
+realize_x_face (cache, attrs)
struct face_cache *cache;
Lisp_Object *attrs;
- int c;
- struct face *base_face;
{
struct face *face = NULL;
#ifdef HAVE_WINDOW_SYSTEM
@@ -7221,50 +7691,27 @@ realize_x_face (cache, attrs, c, base_face)
Lisp_Object stipple, overline, strike_through, box;
xassert (FRAME_WINDOW_P (cache->f));
- xassert (SINGLE_BYTE_CHAR_P (c)
- || base_face);
/* Allocate a new realized face. */
face = make_realized_face (attrs);
+ face->ascii_face = face;
f = cache->f;
- /* If C is a multibyte character, we share all face attirbutes with
- BASE_FACE including the realized fontset. But, we must load a
- different font. */
- if (!SINGLE_BYTE_CHAR_P (c))
- {
- bcopy (base_face, face, sizeof *face);
- face->gc = 0;
-
- /* Don't try to free the colors copied bitwise from BASE_FACE. */
- face->colors_copied_bitwise_p = 1;
-
- /* to force realize_face to load font */
- face->font = NULL;
- return face;
- }
-
- /* Now we are realizing a face for ASCII (and unibyte) characters. */
-
/* Determine the font to use. Most of the time, the font will be
the same as the font of the default face, so try that first. */
default_face = FACE_FROM_ID (f, DEFAULT_FACE_ID);
if (default_face
- && FACE_SUITABLE_FOR_CHAR_P (default_face, c)
&& lface_same_font_attributes_p (default_face->lface, attrs))
{
face->font = default_face->font;
- face->fontset = default_face->fontset;
face->font_info_id = default_face->font_info_id;
+#ifdef USE_FONT_BACKEND
+ face->font_info = default_face->font_info;
+#endif /* USE_FONT_BACKEND */
face->font_name = default_face->font_name;
- face->ascii_face = face;
-
- /* But, as we can't share the fontset, make a new realized
- fontset that has the same base fontset as of the default
- face. */
face->fontset
- = make_fontset_for_ascii_face (f, default_face->fontset);
+ = make_fontset_for_ascii_face (f, default_face->fontset, face);
}
else
{
@@ -7276,10 +7723,24 @@ realize_x_face (cache, attrs, c, base_face)
are constructed from ATTRS. */
int fontset = face_fontset (attrs);
- if ((fontset == -1) && default_face)
+ /* If we are realizing the default face, ATTRS should specify a
+ fontset. In other words, if FONTSET is -1, we are not
+ realizing the default face, thus the default face should have
+ already been realized. */
+ if (fontset == -1)
fontset = default_face->fontset;
- face->fontset = make_fontset_for_ascii_face (f, fontset);
- face->font = NULL; /* to force realize_face to load font */
+ if (fontset == -1)
+ abort ();
+#ifdef USE_FONT_BACKEND
+ if (enable_font_backend)
+ font_load_for_face (f, face);
+ else
+#endif /* USE_FONT_BACKEND */
+ load_face_font (f, face);
+ if (face->font)
+ face->fontset = make_fontset_for_ascii_face (f, fontset, face);
+ else
+ face->fontset = -1;
}
/* Load colors, and set remaining attributes. */
@@ -7410,9 +7871,8 @@ realize_x_face (cache, attrs, c, base_face)
stipple = attrs[LFACE_STIPPLE_INDEX];
if (!NILP (stipple))
face->stipple = load_pixmap (f, stipple, &face->pixmap_w, &face->pixmap_h);
-
- xassert (FACE_SUITABLE_FOR_CHAR_P (face, c));
#endif /* HAVE_WINDOW_SYSTEM */
+
return face;
}
@@ -7504,14 +7964,13 @@ map_tty_color (f, face, idx, defaulted)
/* Realize the fully-specified face with attributes ATTRS in face
- cache CACHE for character C. Do it for TTY frame CACHE->f. Value is a
- pointer to the newly created realized face. */
+ cache CACHE for ASCII characters. Do it for TTY frame CACHE->f.
+ Value is a pointer to the newly created realized face. */
static struct face *
-realize_tty_face (cache, attrs, c)
+realize_tty_face (cache, attrs)
struct face_cache *cache;
Lisp_Object *attrs;
- int c;
{
struct face *face;
int weight, slant;
@@ -7604,7 +8063,7 @@ compute_char_face (f, ch, prop)
if (NILP (prop))
{
struct face *face = FACE_FROM_ID (f, DEFAULT_FACE_ID);
- face_id = FACE_FOR_CHAR (f, face, ch);
+ face_id = FACE_FOR_CHAR (f, face, ch, -1, Qnil);
}
else
{
@@ -7612,7 +8071,7 @@ compute_char_face (f, ch, prop)
struct face *default_face = FACE_FROM_ID (f, DEFAULT_FACE_ID);
bcopy (default_face->lface, attrs, sizeof attrs);
merge_face_ref (f, prop, attrs, 1, 0);
- face_id = lookup_face (f, attrs, ch, NULL);
+ face_id = lookup_face (f, attrs);
}
return face_id;
@@ -7729,7 +8188,7 @@ face_at_buffer_position (w, pos, region_beg, region_end,
/* Look up a realized face with the given face attributes,
or realize a new one for ASCII characters. */
- return lookup_face (f, attrs, 0, NULL);
+ return lookup_face (f, attrs);
}
@@ -7825,7 +8284,7 @@ face_at_string_position (w, string, pos, bufpos, region_beg,
/* Look up a realized face with the given face attributes,
or realize a new one for ASCII characters. */
- return lookup_face (f, attrs, 0, NULL);
+ return lookup_face (f, attrs);
}
@@ -7862,7 +8321,7 @@ merge_faces (f, face_name, face_id, base_face_id)
if (face_id < 0 || face_id >= lface_id_to_name_size)
return base_face_id;
face_name = lface_id_to_name[face_id];
- face_id = lookup_derived_face (f, face_name, 0, base_face_id, 1);
+ face_id = lookup_derived_face (f, face_name, base_face_id, 1);
if (face_id >= 0)
return face_id;
return base_face_id;
@@ -7889,7 +8348,7 @@ merge_faces (f, face_name, face_id, base_face_id)
/* Look up a realized face with the given face attributes,
or realize a new one for ASCII characters. */
- return lookup_face (f, attrs, 0, NULL);
+ return lookup_face (f, attrs);
}
@@ -7927,7 +8386,6 @@ dump_realized_face (face)
face->underline_p,
SDATA (Fsymbol_name (face->lface[LFACE_UNDERLINE_INDEX])));
fprintf (stderr, "hash: %d\n", face->hash);
- fprintf (stderr, "charset: %d\n", face->charset);
}
@@ -8020,6 +8478,8 @@ syms_of_xfaces ()
staticpro (&QCwidth);
QCfont = intern (":font");
staticpro (&QCfont);
+ QCfontset = intern (":fontset");
+ staticpro (&QCfontset);
QCbold = intern (":bold");
staticpro (&QCbold);
QCitalic = intern (":italic");
diff --git a/src/xfns.c b/src/xfns.c
index 764cbbafa7..52cbd758d8 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -41,13 +41,17 @@ Boston, MA 02110-1301, USA. */
#include "keyboard.h"
#include "blockinput.h"
#include <epaths.h>
+#include "character.h"
#include "charset.h"
#include "coding.h"
#include "fontset.h"
#include "systime.h"
#include "termhooks.h"
#include "atimer.h"
-#include "termchar.h"
+
+#ifdef USE_FONT_BACKEND
+#include "font.h"
+#endif /* USE_FONT_BACKEND */
#ifdef HAVE_X_WINDOWS
@@ -256,18 +260,17 @@ check_x_frame (frame)
return f;
}
-/* Let the user specify an X display with a Lisp object.
- OBJECT may be nil, a frame or a terminal id.
+/* Let the user specify an X display with a frame.
nil stands for the selected frame--or, if that is not an X frame,
the first X display on the list. */
struct x_display_info *
-check_x_display_info (object)
- Lisp_Object object;
+check_x_display_info (frame)
+ Lisp_Object frame;
{
struct x_display_info *dpyinfo = NULL;
- if (NILP (object))
+ if (NILP (frame))
{
struct frame *sf = XFRAME (selected_frame);
@@ -278,20 +281,11 @@ check_x_display_info (object)
else
error ("X windows are not in use or not initialized");
}
- else if (INTEGERP (object))
- {
- struct terminal *t = get_terminal (object, 1);
-
- if (t->type != output_x_window)
- error ("Terminal %d is not an X display", XINT (object));
-
- dpyinfo = t->display_info.x;
- }
- else if (STRINGP (object))
- dpyinfo = x_display_info_for_name (object);
+ else if (STRINGP (frame))
+ dpyinfo = x_display_info_for_name (frame);
else
{
- FRAME_PTR f = check_x_frame (object);
+ FRAME_PTR f = check_x_frame (frame);
dpyinfo = FRAME_X_DISPLAY_INFO (f);
}
@@ -314,10 +308,10 @@ x_window_to_frame (dpyinfo, wdesc)
if (wdesc == None) return 0;
- for (tail = Vframe_list; GC_CONSP (tail); tail = XCDR (tail))
+ for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
{
frame = XCAR (tail);
- if (!GC_FRAMEP (frame))
+ if (!FRAMEP (frame))
continue;
f = XFRAME (frame);
if (!FRAME_X_P (f) || FRAME_X_DISPLAY_INFO (f) != dpyinfo)
@@ -366,10 +360,10 @@ x_any_window_to_frame (dpyinfo, wdesc)
if (wdesc == None) return NULL;
found = NULL;
- for (tail = Vframe_list; GC_CONSP (tail) && !found; tail = XCDR (tail))
+ for (tail = Vframe_list; CONSP (tail) && !found; tail = XCDR (tail))
{
frame = XCAR (tail);
- if (!GC_FRAMEP (frame))
+ if (!FRAMEP (frame))
continue;
f = XFRAME (frame);
@@ -421,10 +415,10 @@ x_non_menubar_window_to_frame (dpyinfo, wdesc)
if (wdesc == None) return 0;
- for (tail = Vframe_list; GC_CONSP (tail); tail = XCDR (tail))
+ for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
{
frame = XCAR (tail);
- if (!GC_FRAMEP (frame))
+ if (!FRAMEP (frame))
continue;
f = XFRAME (frame);
if (!FRAME_X_P (f) || FRAME_X_DISPLAY_INFO (f) != dpyinfo)
@@ -469,10 +463,10 @@ x_menubar_window_to_frame (dpyinfo, wdesc)
if (wdesc == None) return 0;
- for (tail = Vframe_list; GC_CONSP (tail); tail = XCDR (tail))
+ for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
{
frame = XCAR (tail);
- if (!GC_FRAMEP (frame))
+ if (!FRAMEP (frame))
continue;
f = XFRAME (frame);
if (!FRAME_X_P (f) || FRAME_X_DISPLAY_INFO (f) != dpyinfo)
@@ -516,10 +510,10 @@ x_top_window_to_frame (dpyinfo, wdesc)
if (wdesc == None) return 0;
- for (tail = Vframe_list; GC_CONSP (tail); tail = XCDR (tail))
+ for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
{
frame = XCAR (tail);
- if (!GC_FRAMEP (frame))
+ if (!FRAMEP (frame))
continue;
f = XFRAME (frame);
if (!FRAME_X_P (f) || FRAME_X_DISPLAY_INFO (f) != dpyinfo)
@@ -556,6 +550,8 @@ x_top_window_to_frame (dpyinfo, wdesc)
+static void x_default_font_parameter P_ ((struct frame *, Lisp_Object));
+
static Lisp_Object unwind_create_frame P_ ((Lisp_Object));
static Lisp_Object unwind_create_tip_frame P_ ((Lisp_Object));
@@ -872,8 +868,8 @@ x_set_foreground_color (f, arg, oldval)
unsigned long fg, old_fg;
fg = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f));
- old_fg = FRAME_FOREGROUND_PIXEL (f);
- FRAME_FOREGROUND_PIXEL (f) = fg;
+ old_fg = x->foreground_pixel;
+ x->foreground_pixel = fg;
if (FRAME_X_WINDOW (f) != 0)
{
@@ -910,8 +906,8 @@ x_set_background_color (f, arg, oldval)
unsigned long bg;
bg = x_decode_color (f, arg, WHITE_PIX_DEFAULT (f));
- unload_color (f, FRAME_BACKGROUND_PIXEL (f));
- FRAME_BACKGROUND_PIXEL (f) = bg;
+ unload_color (f, x->background_pixel);
+ x->background_pixel = bg;
if (FRAME_X_WINDOW (f) != 0)
{
@@ -959,13 +955,13 @@ x_set_mouse_color (f, arg, oldval)
Cursor cursor, nontext_cursor, mode_cursor, hand_cursor;
Cursor hourglass_cursor, horizontal_drag_cursor;
unsigned long pixel = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f));
- unsigned long mask_color = FRAME_BACKGROUND_PIXEL (f);
+ unsigned long mask_color = x->background_pixel;
/* Don't let pointers be invisible. */
if (mask_color == pixel)
{
x_free_colors (f, &pixel, 1);
- pixel = x_copy_color (f, FRAME_FOREGROUND_PIXEL (f));
+ pixel = x_copy_color (f, x->foreground_pixel);
}
unload_color (f, x->mouse_pixel);
@@ -1108,13 +1104,13 @@ x_set_cursor_color (f, arg, oldval)
fore_pixel_allocated_p = 1;
}
else
- fore_pixel = FRAME_BACKGROUND_PIXEL (f);
+ fore_pixel = x->background_pixel;
pixel = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f));
pixel_allocated_p = 1;
/* Make sure that the cursor color differs from the background color. */
- if (pixel == FRAME_BACKGROUND_PIXEL (f))
+ if (pixel == x->background_pixel)
{
if (pixel_allocated_p)
{
@@ -1130,7 +1126,7 @@ x_set_cursor_color (f, arg, oldval)
x_free_colors (f, &fore_pixel, 1);
fore_pixel_allocated_p = 0;
}
- fore_pixel = FRAME_BACKGROUND_PIXEL (f);
+ fore_pixel = x->background_pixel;
}
}
@@ -1415,8 +1411,10 @@ x_set_tool_bar_lines (f, value, oldval)
below the menu bar. */
if (FRAME_X_WINDOW (f) && FRAME_TOOL_BAR_LINES (f) == 0)
{
- clear_frame (f);
+ updating_frame = f;
+ clear_frame ();
clear_current_matrices (f);
+ updating_frame = NULL;
}
/* If the tool bar gets smaller, the internal border below it
@@ -1467,10 +1465,10 @@ x_set_scroll_bar_foreground (f, value, oldval)
if (FRAME_X_WINDOW (f) && FRAME_VISIBLE_P (f))
{
/* Remove all scroll bars because they have wrong colors. */
- if (FRAME_TERMINAL (f)->condemn_scroll_bars_hook)
- (*FRAME_TERMINAL (f)->condemn_scroll_bars_hook) (f);
- if (FRAME_TERMINAL (f)->judge_scroll_bars_hook)
- (*FRAME_TERMINAL (f)->judge_scroll_bars_hook) (f);
+ if (condemn_scroll_bars_hook)
+ (*condemn_scroll_bars_hook) (f);
+ if (judge_scroll_bars_hook)
+ (*judge_scroll_bars_hook) (f);
update_face_from_frame_parameter (f, Qscroll_bar_foreground, value);
redraw_frame (f);
@@ -1516,10 +1514,10 @@ x_set_scroll_bar_background (f, value, oldval)
if (FRAME_X_WINDOW (f) && FRAME_VISIBLE_P (f))
{
/* Remove all scroll bars because they have wrong colors. */
- if (FRAME_TERMINAL (f)->condemn_scroll_bars_hook)
- (*FRAME_TERMINAL (f)->condemn_scroll_bars_hook) (f);
- if (FRAME_TERMINAL (f)->judge_scroll_bars_hook)
- (*FRAME_TERMINAL (f)->judge_scroll_bars_hook) (f);
+ if (condemn_scroll_bars_hook)
+ (*condemn_scroll_bars_hook) (f);
+ if (judge_scroll_bars_hook)
+ (*judge_scroll_bars_hook) (f);
update_face_from_frame_parameter (f, Qscroll_bar_background, value);
redraw_frame (f);
@@ -1555,55 +1553,30 @@ x_encode_text (string, coding_system, selectionp, text_bytes, stringp, freep)
int selectionp;
int *freep;
{
- unsigned char *str = SDATA (string);
- int chars = SCHARS (string);
- int bytes = SBYTES (string);
- int charset_info;
- int bufsize;
- unsigned char *buf;
+ int result = string_xstring_p (string);
struct coding_system coding;
- extern Lisp_Object Qcompound_text_with_extensions;
- charset_info = find_charset_in_text (str, chars, bytes, NULL, Qnil);
- if (charset_info == 0)
+ if (result == 0)
{
/* No multibyte character in OBJ. We need not encode it. */
- *text_bytes = bytes;
+ *text_bytes = SBYTES (string);
*stringp = 1;
*freep = 0;
- return str;
+ return SDATA (string);
}
setup_coding_system (coding_system, &coding);
- if (selectionp
- && SYMBOLP (coding.pre_write_conversion)
- && !NILP (Ffboundp (coding.pre_write_conversion)))
- {
- struct gcpro gcpro1;
- /* We don't need to GCPRO string. */
- GCPRO1 (coding_system);
- string = run_pre_post_conversion_on_str (string, &coding, 1);
- UNGCPRO;
- str = SDATA (string);
- chars = SCHARS (string);
- bytes = SBYTES (string);
- }
- coding.src_multibyte = 1;
- coding.dst_multibyte = 0;
- coding.mode |= CODING_MODE_LAST_BLOCK;
- if (coding.type == coding_type_iso2022)
- coding.flags |= CODING_FLAG_ISO_SAFE;
+ coding.mode |= (CODING_MODE_SAFE_ENCODING | CODING_MODE_LAST_BLOCK);
/* We suppress producing escape sequences for composition. */
- coding.composing = COMPOSITION_DISABLED;
- bufsize = encoding_buffer_size (&coding, bytes);
- buf = (unsigned char *) xmalloc (bufsize);
- encode_coding (&coding, str, buf, bytes, bufsize);
+ coding.common_flags &= ~CODING_ANNOTATION_MASK;
+ coding.dst_bytes = SCHARS (string) * 2;
+ coding.destination = (unsigned char *) xmalloc (coding.dst_bytes);
+ encode_coding_object (&coding, string, 0, 0,
+ SCHARS (string), SBYTES (string), Qnil);
*text_bytes = coding.produced;
- *stringp = (charset_info == 1
- || (!EQ (coding_system, Qcompound_text)
- && !EQ (coding_system, Qcompound_text_with_extensions)));
+ *stringp = (result == 1 || !EQ (coding_system, Qcompound_text));
*freep = 1;
- return buf;
+ return coding.destination;
}
@@ -1982,6 +1955,7 @@ hack_wm_protocols (f, widget)
#ifdef HAVE_X_I18N
static XFontSet xic_create_xfontset P_ ((struct frame *, char *));
+static XFontSet xic_create_xfontset2 P_ ((struct frame *));
static XIMStyle best_xim_style P_ ((XIMStyles *, XIMStyles *));
@@ -2133,6 +2107,29 @@ xic_create_fontsetname (base_fontname, motif)
return fontsetname;
}
+#ifdef DEBUG_XIC_FONTSET
+static void
+print_fontset_result (xfs, name, missing_list, missing_count)
+ XFontSet xfs;
+ char *name;
+ char **missing_list;
+ int missing_count;
+{
+ if (xfs)
+ fprintf (stderr, "XIC Fontset created: %s\n", name);
+ else
+ {
+ fprintf (stderr, "XIC Fontset failed: %s\n", name);
+ while (missing_count-- > 0)
+ {
+ fprintf (stderr, " missing: %s\n", *missing_list);
+ missing_list++;
+ }
+ }
+
+}
+#endif
+
static XFontSet
xic_create_xfontset (f, base_fontname)
struct frame *f;
@@ -2169,6 +2166,9 @@ xic_create_xfontset (f, base_fontname)
xfs = XCreateFontSet (FRAME_X_DISPLAY (f),
fontsetname, &missing_list,
&missing_count, &def_string);
+#ifdef DEBUG_XIC_FONTSET
+ print_fontset_result (xfs, fontsetname, missing_list, missing_count);
+#endif
if (missing_list)
XFreeStringList (missing_list);
if (! xfs)
@@ -2187,6 +2187,9 @@ xic_create_xfontset (f, base_fontname)
xfs = XCreateFontSet (FRAME_X_DISPLAY (f),
p0, &missing_list,
&missing_count, &def_string);
+#ifdef DEBUG_XIC_FONTSET
+ print_fontset_result (xfs, p0, missing_list, missing_count);
+#endif
if (missing_list)
XFreeStringList (missing_list);
if (xfs)
@@ -2195,6 +2198,20 @@ xic_create_xfontset (f, base_fontname)
}
}
xfree (fontsetname);
+ if (! xfs && base_fontname != xic_defaut_fontset)
+ {
+ /* Try the default fontset name at a last resort. */
+ fontsetname = xic_create_fontsetname (xic_defaut_fontset, False);
+ xfs = XCreateFontSet (FRAME_X_DISPLAY (f),
+ fontsetname, &missing_list,
+ &missing_count, &def_string);
+#ifdef DEBUG_XIC_FONTSET
+ print_fontset_result (xfs, fontsetname, missing_list, missing_count);
+#endif
+ if (missing_list)
+ XFreeStringList (missing_list);
+ xfree (fontsetname);
+ }
}
if (FRAME_XIC_BASE_FONTNAME (f))
@@ -2205,6 +2222,107 @@ xic_create_xfontset (f, base_fontname)
return xfs;
}
+#ifdef USE_FONT_BACKEND
+
+static XFontSet
+xic_create_xfontset2 (f)
+ struct frame *f;
+{
+ XFontSet xfs = NULL;
+ struct font *font = FRAME_FONT_OBJECT (f);
+ int pixel_size = font->pixel_size;
+ Lisp_Object rest, frame;
+
+ /* See if there is another frame already using same fontset. */
+ FOR_EACH_FRAME (rest, frame)
+ {
+ struct frame *cf = XFRAME (frame);
+
+ if (cf != f && FRAME_LIVE_P (f) && FRAME_X_P (cf)
+ && FRAME_X_DISPLAY_INFO (cf) == FRAME_X_DISPLAY_INFO (f)
+ && FRAME_FONT_OBJECT (f)
+ && FRAME_FONT_OBJECT (f)->pixel_size == pixel_size)
+ {
+ xfs = FRAME_XIC_FONTSET (cf);
+ break;
+ }
+ }
+
+ if (! xfs)
+ {
+ char buf[256];
+ char **missing_list;
+ int missing_count;
+ char *def_string;
+ char *xlfd_format = "-*-*-medium-r-normal--%d-*-*-*-*-*";
+
+ sprintf (buf, xlfd_format, pixel_size);
+ missing_list = NULL;
+ xfs = XCreateFontSet (FRAME_X_DISPLAY (f), buf,
+ &missing_list, &missing_count, &def_string);
+#ifdef DEBUG_XIC_FONTSET
+ print_fontset_result (xfs, buf, missing_list, missing_count);
+#endif
+ if (missing_list)
+ XFreeStringList (missing_list);
+ if (! xfs)
+ {
+ /* List of pixel sizes most likely available. Find one that
+ is closest to pixel_size. */
+ int sizes[] = {0, 8, 10, 11, 12, 14, 17, 18, 20, 24, 26, 34, 0};
+ int *smaller, *larger;
+
+ for (smaller = sizes; smaller[1]; smaller++)
+ if (smaller[1] >= pixel_size)
+ break;
+ larger = smaller + 1;
+ if (*larger == pixel_size)
+ larger++;
+ while (*smaller || *larger)
+ {
+ int this_size;
+
+ if (! *larger)
+ this_size = *smaller--;
+ else if (! *smaller)
+ this_size = *larger++;
+ else if (pixel_size - *smaller < *larger - pixel_size)
+ this_size = *smaller--;
+ else
+ this_size = *larger++;
+ sprintf (buf, xlfd_format, this_size);
+ missing_list = NULL;
+ xfs = XCreateFontSet (FRAME_X_DISPLAY (f), buf,
+ &missing_list, &missing_count, &def_string);
+#ifdef DEBUG_XIC_FONTSET
+ print_fontset_result (xfs, buf, missing_list, missing_count);
+#endif
+ if (missing_list)
+ XFreeStringList (missing_list);
+ if (xfs)
+ break;
+ }
+ }
+ if (! xfs)
+ {
+ char *last_resort = "-*-*-*-r-normal--*-*-*-*-*-*";
+
+ missing_list = NULL;
+ xfs = XCreateFontSet (FRAME_X_DISPLAY (f), last_resort,
+ &missing_list, &missing_count, &def_string);
+#ifdef DEBUG_XIC_FONTSET
+ print_fontset_result (xfs, last_resort, missing_list, missing_count);
+#endif
+ if (missing_list)
+ XFreeStringList (missing_list);
+ }
+
+ }
+
+ return xfs;
+}
+#endif /* USE_FONT_BACKEND */
+
/* Free the X fontset of frame F if it is the last frame using it. */
void
@@ -2277,6 +2395,11 @@ create_frame_xic (f)
return;
/* Create X fontset. */
+#ifdef USE_FONT_BACKEND
+ if (enable_font_backend)
+ xfs = xic_create_xfontset2 (f);
+ else
+#endif
xfs = xic_create_xfontset
(f, (FRAME_FONTSET (f) < 0) ? NULL
: (char *) SDATA (fontset_ascii (FRAME_FONTSET (f))));
@@ -2435,6 +2558,11 @@ xic_set_xfontset (f, base_fontname)
xic_free_xfontset (f);
+#ifdef USE_FONT_BACKEND
+ if (enable_font_backend)
+ xfs = xic_create_xfontset2 (f);
+ else
+#endif
xfs = xic_create_xfontset (f, base_fontname);
attr = XVaCreateNestedList (0, XNFontSet, xfs, NULL);
@@ -2747,7 +2875,7 @@ x_window (f)
XSetWindowAttributes attributes;
unsigned long attribute_mask;
- attributes.background_pixel = FRAME_BACKGROUND_PIXEL (f);
+ attributes.background_pixel = f->output_data.x->background_pixel;
attributes.border_pixel = f->output_data.x->border_pixel;
attributes.bit_gravity = StaticGravity;
attributes.backing_store = NotUseful;
@@ -2874,9 +3002,7 @@ x_icon (f, parms)
Lisp_Object parms;
{
Lisp_Object icon_x, icon_y;
-#if 0
struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
-#endif
/* Set the position of the icon. Note that twm groups all
icons in an icon window. */
@@ -2937,8 +3063,8 @@ x_make_gc (f)
/* Normal video */
gc_values.font = FRAME_FONT (f)->fid;
- gc_values.foreground = FRAME_FOREGROUND_PIXEL (f);
- gc_values.background = FRAME_BACKGROUND_PIXEL (f);
+ gc_values.foreground = f->output_data.x->foreground_pixel;
+ gc_values.background = f->output_data.x->background_pixel;
gc_values.line_width = 0; /* Means 1 using fast algorithm. */
f->output_data.x->normal_gc
= XCreateGC (FRAME_X_DISPLAY (f),
@@ -2947,8 +3073,8 @@ x_make_gc (f)
&gc_values);
/* Reverse video style. */
- gc_values.foreground = FRAME_BACKGROUND_PIXEL (f);
- gc_values.background = FRAME_FOREGROUND_PIXEL (f);
+ gc_values.foreground = f->output_data.x->background_pixel;
+ gc_values.background = f->output_data.x->foreground_pixel;
f->output_data.x->reverse_gc
= XCreateGC (FRAME_X_DISPLAY (f),
FRAME_X_WINDOW (f),
@@ -2956,7 +3082,7 @@ x_make_gc (f)
&gc_values);
/* Cursor has cursor-color background, background-color foreground. */
- gc_values.foreground = FRAME_BACKGROUND_PIXEL (f);
+ gc_values.foreground = f->output_data.x->background_pixel;
gc_values.background = f->output_data.x->cursor_pixel;
gc_values.fill_style = FillOpaqueStippled;
gc_values.stipple
@@ -2980,8 +3106,8 @@ x_make_gc (f)
= (XCreatePixmapFromBitmapData
(FRAME_X_DISPLAY (f), FRAME_X_DISPLAY_INFO (f)->root_window,
gray_bits, gray_width, gray_height,
- FRAME_FOREGROUND_PIXEL (f),
- FRAME_BACKGROUND_PIXEL (f),
+ f->output_data.x->foreground_pixel,
+ f->output_data.x->background_pixel,
DefaultDepth (FRAME_X_DISPLAY (f), FRAME_X_SCREEN_NUMBER (f))));
UNBLOCK_INPUT;
@@ -3036,12 +3162,6 @@ unwind_create_frame (frame)
{
struct frame *f = XFRAME (frame);
- /* If frame is already dead, nothing to do. This can happen if the
- display is disconnected after the frame has become official, but
- before x_create_frame removes the unwind protect. */
- if (!FRAME_LIVE_P (f))
- return Qnil;
-
/* If frame is ``official'', nothing to do. */
if (!CONSP (Vframe_list) || !EQ (XCAR (Vframe_list), frame))
{
@@ -3062,6 +3182,44 @@ unwind_create_frame (frame)
return Qnil;
}
+#ifdef USE_FONT_BACKEND
+static void
+x_default_font_parameter (f, parms)
+ struct frame *f;
+ Lisp_Object parms;
+{
+ struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
+ Lisp_Object font = x_get_arg (dpyinfo, parms, Qfont, "font", "Font",
+ RES_TYPE_STRING);
+
+ if (! STRINGP (font))
+ {
+ char *names[]
+ = { "-adobe-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-1",
+ "-misc-fixed-medium-r-normal-*-*-140-*-*-c-*-iso8859-1",
+ "-*-*-medium-r-normal-*-*-140-*-*-c-*-iso8859-1",
+ /* This was formerly the first thing tried, but it finds
+ too many fonts and takes too long. */
+ "-*-*-medium-r-*-*-*-*-*-*-c-*-iso8859-1",
+ /* If those didn't work, look for something which will
+ at least work. */
+ "-*-fixed-*-*-*-*-*-140-*-*-c-*-iso8859-1",
+ "fixed",
+ NULL };
+ int i;
+
+ for (i = 0; names[i]; i++)
+ {
+ font = font_open_by_name (f, names[i]);
+ if (! NILP (font))
+ break;
+ }
+ if (NILP (font))
+ error ("No suitable font was found");
+ }
+ x_default_parameter (f, parms, Qfont, font, "font", "Font", RES_TYPE_STRING);
+}
+#endif /* USE_FONT_BACKEND */
DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame,
1, 1, 0,
@@ -3090,27 +3248,24 @@ This function is an internal primitive--use `make-frame' instead. */)
Lisp_Object parent;
struct kboard *kb;
+ check_x ();
+
parms = Fcopy_alist (parms);
/* Use this general default value to start with
until we know if this frame has a specified name. */
Vx_resource_name = Vinvocation_name;
- display = x_get_arg (dpyinfo, parms, Qterminal, 0, 0, RES_TYPE_NUMBER);
- if (EQ (display, Qunbound))
- display = x_get_arg (dpyinfo, parms, Qdisplay, 0, 0, RES_TYPE_STRING);
+ display = x_get_arg (dpyinfo, parms, Qdisplay, 0, 0, RES_TYPE_STRING);
if (EQ (display, Qunbound))
display = Qnil;
dpyinfo = check_x_display_info (display);
#ifdef MULTI_KBOARD
- kb = dpyinfo->terminal->kboard;
+ kb = dpyinfo->kboard;
#else
kb = &the_only_kboard;
#endif
- if (!dpyinfo->terminal->name)
- error ("Terminal is not live, can't create new frames on it");
-
name = x_get_arg (dpyinfo, parms, Qname, "name", "Name", RES_TYPE_STRING);
if (!STRINGP (name)
&& ! EQ (name, Qunbound)
@@ -3151,9 +3306,6 @@ This function is an internal primitive--use `make-frame' instead. */)
/* Note that X Windows does support scroll bars. */
FRAME_CAN_HAVE_SCROLL_BARS (f) = 1;
- f->terminal = dpyinfo->terminal;
- f->terminal->reference_count++;
-
f->output_method = output_x_window;
f->output_data.x = (struct x_output *) xmalloc (sizeof (struct x_output));
bzero (f->output_data.x, sizeof (struct x_output));
@@ -3180,6 +3332,9 @@ This function is an internal primitive--use `make-frame' instead. */)
image_cache_refcount = FRAME_X_IMAGE_CACHE (f)->refcount;
dpyinfo_refcount = dpyinfo->reference_count;
#endif /* GLYPH_DEBUG */
+#ifdef MULTI_KBOARD
+ FRAME_KBOARD (f) = kb;
+#endif
/* These colors will be set anyway later, but it's important
to get the color reference counts right, so initialize them! */
@@ -3190,8 +3345,8 @@ This function is an internal primitive--use `make-frame' instead. */)
/* Function x_decode_color can signal an error. Make
sure to initialize color slots so that we won't try
to free colors we haven't allocated. */
- FRAME_FOREGROUND_PIXEL (f) = -1;
- FRAME_BACKGROUND_PIXEL (f) = -1;
+ f->output_data.x->foreground_pixel = -1;
+ f->output_data.x->background_pixel = -1;
f->output_data.x->cursor_pixel = -1;
f->output_data.x->cursor_foreground_pixel = -1;
f->output_data.x->border_pixel = -1;
@@ -3199,9 +3354,9 @@ This function is an internal primitive--use `make-frame' instead. */)
black = build_string ("black");
GCPRO1 (black);
- FRAME_FOREGROUND_PIXEL (f)
+ f->output_data.x->foreground_pixel
= x_decode_color (f, black, BLACK_PIX_DEFAULT (f));
- FRAME_BACKGROUND_PIXEL (f)
+ f->output_data.x->background_pixel
= x_decode_color (f, black, BLACK_PIX_DEFAULT (f));
f->output_data.x->cursor_pixel
= x_decode_color (f, black, BLACK_PIX_DEFAULT (f));
@@ -3242,43 +3397,75 @@ This function is an internal primitive--use `make-frame' instead. */)
specbind (Qx_resource_name, name);
}
+ f->resx = dpyinfo->resx;
+ f->resy = dpyinfo->resy;
+
+#ifdef USE_FONT_BACKEND
+ if (enable_font_backend)
+ {
+ /* Perhaps, we must allow frame parameter, say `font-backend',
+ to specify which font backends to use. */
+#ifdef HAVE_FREETYPE
+#ifdef HAVE_XFT
+ register_font_driver (&xftfont_driver, f);
+#else /* not HAVE_XFT */
+ register_font_driver (&ftxfont_driver, f);
+#endif /* not HAVE_XFT */
+#endif /* HAVE_FREETYPE */
+ register_font_driver (&xfont_driver, f);
+
+ x_default_parameter (f, parms, Qfont_backend, Qnil,
+ "fontBackend", "FontBackend", RES_TYPE_STRING);
+ }
+#endif /* USE_FONT_BACKEND */
+
/* Extract the window parameters from the supplied values
that are needed to determine window geometry. */
+#ifdef USE_FONT_BACKEND
+ if (enable_font_backend)
+ x_default_font_parameter (f, parms);
+else
+#endif /* USE_FONT_BACKEND */
{
Lisp_Object font;
font = x_get_arg (dpyinfo, parms, Qfont, "font", "Font", RES_TYPE_STRING);
- BLOCK_INPUT;
- /* First, try whatever font the caller has specified. */
- if (STRINGP (font))
- {
- tem = Fquery_fontset (font, Qnil);
- if (STRINGP (tem))
- font = x_new_fontset (f, SDATA (tem));
- else
- font = x_new_font (f, SDATA (font));
- }
-
- /* Try out a font which we hope has bold and italic variations. */
+ /* If the caller has specified no font, try out fonts which we
+ hope have bold and italic variations. */
if (!STRINGP (font))
- font = x_new_font (f, "-adobe-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-1");
- if (!STRINGP (font))
- font = x_new_font (f, "-misc-fixed-medium-r-normal-*-*-140-*-*-c-*-iso8859-1");
- if (! STRINGP (font))
- font = x_new_font (f, "-*-*-medium-r-normal-*-*-140-*-*-c-*-iso8859-1");
- if (! STRINGP (font))
- /* This was formerly the first thing tried, but it finds too many fonts
- and takes too long. */
- font = x_new_font (f, "-*-*-medium-r-*-*-*-*-*-*-c-*-iso8859-1");
- /* If those didn't work, look for something which will at least work. */
- if (! STRINGP (font))
- font = x_new_font (f, "-*-fixed-*-*-*-*-*-140-*-*-c-*-iso8859-1");
- UNBLOCK_INPUT;
- if (! STRINGP (font))
- font = build_string ("fixed");
+ {
+ char *names[]
+ = { "-adobe-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-1",
+ "-misc-fixed-medium-r-normal-*-*-140-*-*-c-*-iso8859-1",
+ "-*-*-medium-r-normal-*-*-140-*-*-c-*-iso8859-1",
+ /* This was formerly the first thing tried, but it finds
+ too many fonts and takes too long. */
+ "-*-*-medium-r-*-*-*-*-*-*-c-*-iso8859-1",
+ /* If those didn't work, look for something which will
+ at least work. */
+ "-*-fixed-*-*-*-*-*-140-*-*-c-*-iso8859-1",
+ NULL };
+ int i;
+
+ BLOCK_INPUT;
+ for (i = 0; names[i]; i++)
+ {
+ Lisp_Object list;
- x_set_frame_parameters (f, Fcons (Fcons (Qfont, font), Qnil));
+ list = x_list_fonts (f, build_string (names[i]), 0, 1);
+ if (CONSP (list))
+ {
+ font = XCAR (list);
+ break;
+ }
+ }
+ UNBLOCK_INPUT;
+ if (! STRINGP (font))
+ font = build_string ("fixed");
+ }
+ x_default_parameter (f, parms, Qfont, font,
+ "font", "Font", RES_TYPE_STRING);
}
#ifdef USE_LUCID
@@ -3468,7 +3655,7 @@ This function is an internal primitive--use `make-frame' instead. */)
}
/* Initialize `default-minibuffer-frame' in case this is the first
- frame on this terminal. */
+ frame on this display device. */
if (FRAME_HAS_MINIBUF_P (f)
&& (!FRAMEP (kb->Vdefault_minibuffer_frame)
|| !FRAME_LIVE_P (XFRAME (kb->Vdefault_minibuffer_frame))))
@@ -3480,8 +3667,6 @@ This function is an internal primitive--use `make-frame' instead. */)
if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem))))
f->param_alist = Fcons (XCAR (tem), f->param_alist);
- store_frame_param (f, Qwindow_system, Qx);
-
UNGCPRO;
/* Make sure windows on this frame appear in calls to next-window
@@ -3576,10 +3761,10 @@ DEFUN ("xw-color-values", Fxw_color_values, Sxw_color_values, 1, 2, 0,
DEFUN ("xw-display-color-p", Fxw_display_color_p, Sxw_display_color_p, 0, 1, 0,
doc: /* Internal function called by `display-color-p', which see. */)
- (terminal)
- Lisp_Object terminal;
+ (display)
+ Lisp_Object display;
{
- struct x_display_info *dpyinfo = check_x_display_info (terminal);
+ struct x_display_info *dpyinfo = check_x_display_info (display);
if (dpyinfo->n_planes <= 2)
return Qnil;
@@ -3601,13 +3786,13 @@ DEFUN ("x-display-grayscale-p", Fx_display_grayscale_p, Sx_display_grayscale_p,
0, 1, 0,
doc: /* Return t if the X display supports shades of gray.
Note that color displays do support shades of gray.
-The optional argument TERMINAL specifies which display to ask about.
-TERMINAL should be a terminal id, a frame or a display name (a string).
+The optional argument DISPLAY specifies which display to ask about.
+DISPLAY should be either a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display. */)
- (terminal)
- Lisp_Object terminal;
+ (display)
+ Lisp_Object display;
{
- struct x_display_info *dpyinfo = check_x_display_info (terminal);
+ struct x_display_info *dpyinfo = check_x_display_info (display);
if (dpyinfo->n_planes <= 1)
return Qnil;
@@ -3629,56 +3814,56 @@ If omitted or nil, that stands for the selected frame's display. */)
DEFUN ("x-display-pixel-width", Fx_display_pixel_width, Sx_display_pixel_width,
0, 1, 0,
- doc: /* Returns the width in pixels of the X display TERMINAL.
-The optional argument TERMINAL specifies which display to ask about.
-TERMINAL should be a terminal id, a frame or a display name (a string).
+ doc: /* Returns the width in pixels of the X display DISPLAY.
+The optional argument DISPLAY specifies which display to ask about.
+DISPLAY should be either a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display. */)
- (terminal)
- Lisp_Object terminal;
+ (display)
+ Lisp_Object display;
{
- struct x_display_info *dpyinfo = check_x_display_info (terminal);
+ struct x_display_info *dpyinfo = check_x_display_info (display);
return make_number (dpyinfo->width);
}
DEFUN ("x-display-pixel-height", Fx_display_pixel_height,
Sx_display_pixel_height, 0, 1, 0,
- doc: /* Returns the height in pixels of the X display TERMINAL.
-The optional argument TERMINAL specifies which display to ask about.
-TERMINAL should be a terminal id, a frame or a display name (a string).
+ doc: /* Returns the height in pixels of the X display DISPLAY.
+The optional argument DISPLAY specifies which display to ask about.
+DISPLAY should be either a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display. */)
- (terminal)
- Lisp_Object terminal;
+ (display)
+ Lisp_Object display;
{
- struct x_display_info *dpyinfo = check_x_display_info (terminal);
+ struct x_display_info *dpyinfo = check_x_display_info (display);
return make_number (dpyinfo->height);
}
DEFUN ("x-display-planes", Fx_display_planes, Sx_display_planes,
0, 1, 0,
- doc: /* Returns the number of bitplanes of the X display TERMINAL.
-The optional argument TERMINAL specifies which display to ask about.
-TERMINAL should be a terminal id, a frame or a display name (a string).
+ doc: /* Returns the number of bitplanes of the X display DISPLAY.
+The optional argument DISPLAY specifies which display to ask about.
+DISPLAY should be either a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display. */)
- (terminal)
- Lisp_Object terminal;
+ (display)
+ Lisp_Object display;
{
- struct x_display_info *dpyinfo = check_x_display_info (terminal);
+ struct x_display_info *dpyinfo = check_x_display_info (display);
return make_number (dpyinfo->n_planes);
}
DEFUN ("x-display-color-cells", Fx_display_color_cells, Sx_display_color_cells,
0, 1, 0,
- doc: /* Returns the number of color cells of the X display TERMINAL.
-The optional argument TERMINAL specifies which display to ask about.
-TERMINAL should be a terminal id, a frame or a display name (a string).
+ doc: /* Returns the number of color cells of the X display DISPLAY.
+The optional argument DISPLAY specifies which display to ask about.
+DISPLAY should be either a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display. */)
- (terminal)
- Lisp_Object terminal;
+ (display)
+ Lisp_Object display;
{
- struct x_display_info *dpyinfo = check_x_display_info (terminal);
+ struct x_display_info *dpyinfo = check_x_display_info (display);
int nr_planes = DisplayPlanes (dpyinfo->display,
XScreenNumberOfScreen (dpyinfo->screen));
@@ -3696,29 +3881,29 @@ If omitted or nil, that stands for the selected frame's display. */)
DEFUN ("x-server-max-request-size", Fx_server_max_request_size,
Sx_server_max_request_size,
0, 1, 0,
- doc: /* Returns the maximum request size of the X server of display TERMINAL.
-The optional argument TERMINAL specifies which display to ask about.
-TERMINAL should be a terminal id, a frame or a display name (a string).
+ doc: /* Returns the maximum request size of the X server of display DISPLAY.
+The optional argument DISPLAY specifies which display to ask about.
+DISPLAY should be either a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display. */)
- (terminal)
- Lisp_Object terminal;
+ (display)
+ Lisp_Object display;
{
- struct x_display_info *dpyinfo = check_x_display_info (terminal);
+ struct x_display_info *dpyinfo = check_x_display_info (display);
return make_number (MAXREQUEST (dpyinfo->display));
}
DEFUN ("x-server-vendor", Fx_server_vendor, Sx_server_vendor, 0, 1, 0,
- doc: /* Returns the "vendor ID" string of the X server of display TERMINAL.
+ doc: /* Returns the "vendor ID" string of the X server of display DISPLAY.
\(Labelling every distributor as a "vendor" embodies the false assumption
that operating systems cannot be developed and distributed noncommercially.)
-The optional argument TERMINAL specifies which display to ask about.
-TERMINAL should be a terminal id, a frame or a display name (a string).
+The optional argument DISPLAY specifies which display to ask about.
+DISPLAY should be either a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display. */)
- (terminal)
- Lisp_Object terminal;
+ (display)
+ Lisp_Object display;
{
- struct x_display_info *dpyinfo = check_x_display_info (terminal);
+ struct x_display_info *dpyinfo = check_x_display_info (display);
char *vendor = ServerVendor (dpyinfo->display);
if (! vendor) vendor = "";
@@ -3726,18 +3911,18 @@ If omitted or nil, that stands for the selected frame's display. */)
}
DEFUN ("x-server-version", Fx_server_version, Sx_server_version, 0, 1, 0,
- doc: /* Returns the version numbers of the X server of display TERMINAL.
+ doc: /* Returns the version numbers of the X server of display DISPLAY.
The value is a list of three integers: the major and minor
version numbers of the X Protocol in use, and the distributor-specific release
number. See also the function `x-server-vendor'.
-The optional argument TERMINAL specifies which display to ask about.
-TERMINAL should be a terminal id, a frame or a display name (a string).
+The optional argument DISPLAY specifies which display to ask about.
+DISPLAY should be either a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display. */)
- (terminal)
- Lisp_Object terminal;
+ (display)
+ Lisp_Object display;
{
- struct x_display_info *dpyinfo = check_x_display_info (terminal);
+ struct x_display_info *dpyinfo = check_x_display_info (display);
Display *dpy = dpyinfo->display;
return Fcons (make_number (ProtocolVersion (dpy)),
@@ -3746,55 +3931,55 @@ If omitted or nil, that stands for the selected frame's display. */)
}
DEFUN ("x-display-screens", Fx_display_screens, Sx_display_screens, 0, 1, 0,
- doc: /* Return the number of screens on the X server of display TERMINAL.
-The optional argument TERMINAL specifies which display to ask about.
-TERMINAL should be a terminal id, a frame or a display name (a string).
+ doc: /* Return the number of screens on the X server of display DISPLAY.
+The optional argument DISPLAY specifies which display to ask about.
+DISPLAY should be either a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display. */)
- (terminal)
- Lisp_Object terminal;
+ (display)
+ Lisp_Object display;
{
- struct x_display_info *dpyinfo = check_x_display_info (terminal);
+ struct x_display_info *dpyinfo = check_x_display_info (display);
return make_number (ScreenCount (dpyinfo->display));
}
DEFUN ("x-display-mm-height", Fx_display_mm_height, Sx_display_mm_height, 0, 1, 0,
- doc: /* Return the height in millimeters of the X display TERMINAL.
-The optional argument TERMINAL specifies which display to ask about.
-TERMINAL should be a terminal id, a frame or a display name (a string).
+ doc: /* Return the height in millimeters of the X display DISPLAY.
+The optional argument DISPLAY specifies which display to ask about.
+DISPLAY should be either a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display. */)
- (terminal)
- Lisp_Object terminal;
+ (display)
+ Lisp_Object display;
{
- struct x_display_info *dpyinfo = check_x_display_info (terminal);
+ struct x_display_info *dpyinfo = check_x_display_info (display);
return make_number (HeightMMOfScreen (dpyinfo->screen));
}
DEFUN ("x-display-mm-width", Fx_display_mm_width, Sx_display_mm_width, 0, 1, 0,
- doc: /* Return the width in millimeters of the X display TERMINAL.
-The optional argument TERMINAL specifies which display to ask about.
-TERMINAL should be a terminal id, a frame or a display name (a string).
+ doc: /* Return the width in millimeters of the X display DISPLAY.
+The optional argument DISPLAY specifies which display to ask about.
+DISPLAY should be either a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display. */)
- (terminal)
- Lisp_Object terminal;
+ (display)
+ Lisp_Object display;
{
- struct x_display_info *dpyinfo = check_x_display_info (terminal);
+ struct x_display_info *dpyinfo = check_x_display_info (display);
return make_number (WidthMMOfScreen (dpyinfo->screen));
}
DEFUN ("x-display-backing-store", Fx_display_backing_store,
Sx_display_backing_store, 0, 1, 0,
- doc: /* Returns an indication of whether X display TERMINAL does backing store.
+ doc: /* Returns an indication of whether X display DISPLAY does backing store.
The value may be `always', `when-mapped', or `not-useful'.
-The optional argument TERMINAL specifies which display to ask about.
-TERMINAL should be a terminal id, a frame or a display name (a string).
+The optional argument DISPLAY specifies which display to ask about.
+DISPLAY should be either a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display. */)
- (terminal)
- Lisp_Object terminal;
+ (display)
+ Lisp_Object display;
{
- struct x_display_info *dpyinfo = check_x_display_info (terminal);
+ struct x_display_info *dpyinfo = check_x_display_info (display);
Lisp_Object result;
switch (DoesBackingStore (dpyinfo->screen))
@@ -3821,17 +4006,17 @@ If omitted or nil, that stands for the selected frame's display. */)
DEFUN ("x-display-visual-class", Fx_display_visual_class,
Sx_display_visual_class, 0, 1, 0,
- doc: /* Return the visual class of the X display TERMINAL.
+ doc: /* Return the visual class of the X display DISPLAY.
The value is one of the symbols `static-gray', `gray-scale',
`static-color', `pseudo-color', `true-color', or `direct-color'.
-The optional argument TERMINAL specifies which display to ask about.
-TERMINAL should a terminal id, a frame or a display name (a string).
+The optional argument DISPLAY specifies which display to ask about.
+DISPLAY should be either a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display. */)
- (terminal)
- Lisp_Object terminal;
+ (display)
+ Lisp_Object display;
{
- struct x_display_info *dpyinfo = check_x_display_info (terminal);
+ struct x_display_info *dpyinfo = check_x_display_info (display);
Lisp_Object result;
switch (dpyinfo->visual->class)
@@ -3864,14 +4049,14 @@ If omitted or nil, that stands for the selected frame's display. */)
DEFUN ("x-display-save-under", Fx_display_save_under,
Sx_display_save_under, 0, 1, 0,
- doc: /* Returns t if the X display TERMINAL supports the save-under feature.
-The optional argument TERMINAL specifies which display to ask about.
-TERMINAL should be a terminal id, a frame or a display name (a string).
+ doc: /* Returns t if the X display DISPLAY supports the save-under feature.
+The optional argument DISPLAY specifies which display to ask about.
+DISPLAY should be either a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display. */)
- (terminal)
- Lisp_Object terminal;
+ (display)
+ Lisp_Object display;
{
- struct x_display_info *dpyinfo = check_x_display_info (terminal);
+ struct x_display_info *dpyinfo = check_x_display_info (display);
if (DoesSaveUnders (dpyinfo->screen) == True)
return Qt;
@@ -4052,10 +4237,8 @@ x_display_info_for_name (name)
CHECK_STRING (name);
-#if 0
- if (! EQ (Vinitial_window_system, intern ("x")))
- error ("Not using X Windows"); /* That doesn't stop us anymore. */
-#endif
+ if (! EQ (Vwindow_system, intern ("x")))
+ error ("Not using X Windows");
for (dpyinfo = x_display_list, names = x_display_name_list;
dpyinfo;
@@ -4102,10 +4285,8 @@ terminate Emacs if we can't open the connection. */)
if (! NILP (xrm_string))
CHECK_STRING (xrm_string);
-#if 0
- if (! EQ (Vinitial_window_system, intern ("x")))
- error ("Not using X Windows"); /* That doesn't stop us anymore. */
-#endif
+ if (! EQ (Vwindow_system, intern ("x")))
+ error ("Not using X Windows");
if (! NILP (xrm_string))
xrm_option = (unsigned char *) SDATA (xrm_string);
@@ -4140,19 +4321,41 @@ An insecure way to solve the problem may be to use `xhost'.\n",
DEFUN ("x-close-connection", Fx_close_connection,
Sx_close_connection, 1, 1, 0,
- doc: /* Close the connection to TERMINAL's X server.
-For TERMINAL, specify a terminal id, a frame or a display name (a
-string). If TERMINAL is nil, that stands for the selected frame's
-terminal. */)
- (terminal)
- Lisp_Object terminal;
+ doc: /* Close the connection to DISPLAY's X server.
+For DISPLAY, specify either a frame or a display name (a string).
+If DISPLAY is nil, that stands for the selected frame's display. */)
+ (display)
+ Lisp_Object display;
{
- struct x_display_info *dpyinfo = check_x_display_info (terminal);
+ struct x_display_info *dpyinfo = check_x_display_info (display);
+ int i;
if (dpyinfo->reference_count > 0)
error ("Display still has frames on it");
- x_delete_terminal (dpyinfo->terminal);
+ BLOCK_INPUT;
+ /* Free the fonts in the font table. */
+ for (i = 0; i < dpyinfo->n_fonts; i++)
+ if (dpyinfo->font_table[i].name)
+ {
+ XFreeFont (dpyinfo->display, dpyinfo->font_table[i].font);
+ }
+
+ x_destroy_all_bitmaps (dpyinfo);
+ XSetCloseDownMode (dpyinfo->display, DestroyAll);
+
+#ifdef USE_GTK
+ xg_display_close (dpyinfo->display);
+#else
+#ifdef USE_X_TOOLKIT
+ XtCloseDisplay (dpyinfo->display);
+#else
+ XCloseDisplay (dpyinfo->display);
+#endif
+#endif /* ! USE_GTK */
+
+ x_delete_display (dpyinfo);
+ UNBLOCK_INPUT;
return Qnil;
}
@@ -4176,13 +4379,13 @@ If ON is nil, allow buffering of requests.
Turning on synchronization prohibits the Xlib routines from buffering
requests and seriously degrades performance, but makes debugging much
easier.
-The optional second argument TERMINAL specifies which display to act on.
-TERMINAL should be a terminal id, a frame or a display name (a string).
-If TERMINAL is omitted or nil, that stands for the selected frame's display. */)
- (on, terminal)
- Lisp_Object terminal, on;
+The optional second argument DISPLAY specifies which display to act on.
+DISPLAY should be either a frame or a display name (a string).
+If DISPLAY is omitted or nil, that stands for the selected frame's display. */)
+ (on, display)
+ Lisp_Object display, on;
{
- struct x_display_info *dpyinfo = check_x_display_info (terminal);
+ struct x_display_info *dpyinfo = check_x_display_info (display);
XSynchronize (dpyinfo->display, !EQ (on, Qnil));
@@ -4486,6 +4689,10 @@ start_hourglass ()
EMACS_TIME delay;
int secs, usecs = 0;
+ /* Don't bother for ttys. */
+ if (NILP (Vwindow_system))
+ return;
+
cancel_hourglass ();
if (INTEGERP (Vhourglass_delay)
@@ -4697,17 +4904,21 @@ x_create_tip_frame (dpyinfo, parms, text)
int width, height;
int count = SPECPDL_INDEX ();
struct gcpro gcpro1, gcpro2, gcpro3;
+ struct kboard *kb;
int face_change_count_before = face_change_count;
Lisp_Object buffer;
struct buffer *old_buffer;
check_x ();
- if (!dpyinfo->terminal->name)
- error ("Terminal is not live, can't create new frames on it");
-
parms = Fcopy_alist (parms);
+#ifdef MULTI_KBOARD
+ kb = dpyinfo->kboard;
+#else
+ kb = &the_only_kboard;
+#endif
+
/* Get the name of the frame to use for resource lookup. */
name = x_get_arg (dpyinfo, parms, Qname, "name", "Name", RES_TYPE_STRING);
if (!STRINGP (name)
@@ -4734,9 +4945,6 @@ x_create_tip_frame (dpyinfo, parms, text)
FRAME_CAN_HAVE_SCROLL_BARS (f) = 0;
record_unwind_protect (unwind_create_tip_frame, frame);
- f->terminal = dpyinfo->terminal;
- f->terminal->reference_count++;
-
/* By setting the output method, we're essentially saying that
the frame is live, as per FRAME_LIVE_P. If we get a signal
from this point on, x_destroy_window might screw up reference
@@ -4758,6 +4966,9 @@ x_create_tip_frame (dpyinfo, parms, text)
image_cache_refcount = FRAME_X_IMAGE_CACHE (f)->refcount;
dpyinfo_refcount = dpyinfo->reference_count;
#endif /* GLYPH_DEBUG */
+#ifdef MULTI_KBOARD
+ FRAME_KBOARD (f) = kb;
+#endif
f->output_data.x->parent_desc = FRAME_X_DISPLAY_INFO (f)->root_window;
f->output_data.x->explicit_parent = 0;
@@ -4767,21 +4978,11 @@ x_create_tip_frame (dpyinfo, parms, text)
Lisp_Object black;
struct gcpro gcpro1;
- /* Function x_decode_color can signal an error. Make
- sure to initialize color slots so that we won't try
- to free colors we haven't allocated. */
- FRAME_FOREGROUND_PIXEL (f) = -1;
- FRAME_BACKGROUND_PIXEL (f) = -1;
- f->output_data.x->cursor_pixel = -1;
- f->output_data.x->cursor_foreground_pixel = -1;
- f->output_data.x->border_pixel = -1;
- f->output_data.x->mouse_pixel = -1;
-
black = build_string ("black");
GCPRO1 (black);
- FRAME_FOREGROUND_PIXEL (f)
+ f->output_data.x->foreground_pixel
= x_decode_color (f, black, BLACK_PIX_DEFAULT (f));
- FRAME_BACKGROUND_PIXEL (f)
+ f->output_data.x->background_pixel
= x_decode_color (f, black, BLACK_PIX_DEFAULT (f));
f->output_data.x->cursor_pixel
= x_decode_color (f, black, BLACK_PIX_DEFAULT (f));
@@ -4809,8 +5010,35 @@ x_create_tip_frame (dpyinfo, parms, text)
specbind (Qx_resource_name, name);
}
+ f->resx = dpyinfo->resx;
+ f->resy = dpyinfo->resy;
+
+#ifdef USE_FONT_BACKEND
+ if (enable_font_backend)
+ {
+ /* Perhaps, we must allow frame parameter, say `font-backend',
+ to specify which font backends to use. */
+#ifdef HAVE_FREETYPE
+#ifdef HAVE_XFT
+ register_font_driver (&xftfont_driver, f);
+#else /* not HAVE_XFT */
+ register_font_driver (&ftxfont_driver, f);
+#endif /* not HAVE_XFT */
+#endif /* HAVE_FREETYPE */
+ register_font_driver (&xfont_driver, f);
+
+ x_default_parameter (f, parms, Qfont_backend, Qnil,
+ "fontBackend", "FontBackend", RES_TYPE_STRING);
+ }
+#endif /* USE_FONT_BACKEND */
+
/* Extract the window parameters from the supplied values that are
needed to determine window geometry. */
+#ifdef USE_FONT_BACKEND
+ if (enable_font_backend)
+ x_default_font_parameter (f, parms);
+else
+#endif /* USE_FONT_BACKEND */
{
Lisp_Object font;
@@ -4822,7 +5050,7 @@ x_create_tip_frame (dpyinfo, parms, text)
{
tem = Fquery_fontset (font, Qnil);
if (STRINGP (tem))
- font = x_new_fontset (f, SDATA (tem));
+ font = x_new_fontset (f, tem);
else
font = x_new_font (f, SDATA (font));
}
@@ -4845,8 +5073,7 @@ x_create_tip_frame (dpyinfo, parms, text)
if (! STRINGP (font))
font = build_string ("fixed");
- x_default_parameter (f, parms, Qfont, font,
- "font", "Font", RES_TYPE_STRING);
+ x_set_frame_parameters (f, Fcons (Fcons (Qfont, font), Qnil));
}
x_default_parameter (f, parms, Qborder_width, make_number (2),
@@ -4967,8 +5194,6 @@ x_create_tip_frame (dpyinfo, parms, text)
Qnil));
}
- Fmodify_frame_parameters (frame, Fcons (Fcons (Qwindow_system, Qx), Qnil));
-
f->no_split = 1;
UNGCPRO;
@@ -5769,6 +5994,9 @@ frame_parm_handler x_frame_parm_handlers[] =
x_set_fringe_width,
x_set_wait_for_wm,
x_set_fullscreen,
+#ifdef USE_FONT_BACKEND
+ x_set_font_backend
+#endif /* USE_FONT_BACKEND */
};
void
@@ -5979,6 +6207,7 @@ the tool bar buttons. */);
find_ccl_program_func = x_find_ccl_program;
query_font_func = x_query_font;
set_frame_fontset_func = x_set_font;
+ get_font_repertory_func = x_get_font_repertory;
check_window_system_func = check_x;
hourglass_atimer = NULL;
diff --git a/src/xfont.c b/src/xfont.c
new file mode 100644
index 0000000000..59cc31d78e
--- /dev/null
+++ b/src/xfont.c
@@ -0,0 +1,915 @@
+/* xfont.c -- X core font driver.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006
+ National Institute of Advanced Industrial Science and Technology (AIST)
+ Registration Number H13PRO009
+
+This file is part of GNU Emacs.
+
+GNU Emacs is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Emacs is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Emacs; see the file COPYING. If not, write to
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+#include <config.h>
+#include <stdio.h>
+#include <X11/Xlib.h>
+
+#include "lisp.h"
+#include "dispextern.h"
+#include "xterm.h"
+#include "frame.h"
+#include "blockinput.h"
+#include "character.h"
+#include "charset.h"
+#include "fontset.h"
+#include "font.h"
+
+
+/* X core font driver. */
+
+Lisp_Object Qx;
+
+/* Alist of font registry symbol and the corresponding charsets
+ information. The information is retrieved from
+ Vfont_encoding_alist on demand.
+
+ Eash element has the form:
+ (REGISTRY . (ENCODING-CHARSET-ID . REPERTORY-CHARSET-ID))
+ or
+ (REGISTRY . nil)
+
+ In the former form, ENCODING-CHARSET-ID is an ID of a charset that
+ encodes a character code to a glyph code of a font, and
+ REPERTORY-CHARSET-ID is an ID of a charset that tells if a
+ character is supported by a font.
+
+ The latter form means that the information for REGISTRY couldn't be
+ retrieved. */
+static Lisp_Object x_font_charset_alist;
+
+/* Prototypes of support functions. */
+extern void x_clear_errors P_ ((Display *));
+
+static char *xfont_query_font P_ ((Display *, char *, Lisp_Object));
+static XCharStruct *xfont_get_pcm P_ ((XFontStruct *, XChar2b *));
+static int xfont_registry_charsets P_ ((Lisp_Object, struct charset **,
+ struct charset **));
+
+static char *
+xfont_query_font (display, name, spec)
+ Display *display;
+ char *name;
+ Lisp_Object spec;
+{
+ XFontStruct *font;
+
+ BLOCK_INPUT;
+ x_catch_errors (display);
+ font = XLoadQueryFont (display, name);
+ name = NULL;
+ if (x_had_errors_p (display))
+ {
+ /* This error is perhaps due to insufficient memory on X
+ server. Let's just ignore it. */
+ x_clear_errors (display);
+ }
+ else if (font)
+ {
+ unsigned long value;
+
+ if (XGetFontProperty (font, XA_FONT, &value))
+ {
+ char *n = (char *) XGetAtomName (display, (Atom) value);
+
+ if (font_parse_xlfd (n, spec) >= 0)
+ name = n;
+ else
+ XFree (n);
+ }
+ XFreeFont (display, font);
+ }
+ x_uncatch_errors ();
+ UNBLOCK_INPUT;
+
+ return name;
+}
+
+
+/* Get metrics of character CHAR2B in XFONT. Value is null if CHAR2B
+ is not contained in the font. */
+
+static XCharStruct *
+xfont_get_pcm (xfont, char2b)
+ XFontStruct *xfont;
+ XChar2b *char2b;
+{
+ /* The result metric information. */
+ XCharStruct *pcm = NULL;
+
+ xassert (xfont && char2b);
+
+ if (xfont->per_char != NULL)
+ {
+ if (xfont->min_byte1 == 0 && xfont->max_byte1 == 0)
+ {
+ /* min_char_or_byte2 specifies the linear character index
+ corresponding to the first element of the per_char array,
+ max_char_or_byte2 is the index of the last character. A
+ character with non-zero CHAR2B->byte1 is not in the font.
+ A character with byte2 less than min_char_or_byte2 or
+ greater max_char_or_byte2 is not in the font. */
+ if (char2b->byte1 == 0
+ && char2b->byte2 >= xfont->min_char_or_byte2
+ && char2b->byte2 <= xfont->max_char_or_byte2)
+ pcm = xfont->per_char + char2b->byte2 - xfont->min_char_or_byte2;
+ }
+ else
+ {
+ /* If either min_byte1 or max_byte1 are nonzero, both
+ min_char_or_byte2 and max_char_or_byte2 are less than
+ 256, and the 2-byte character index values corresponding
+ to the per_char array element N (counting from 0) are:
+
+ byte1 = N/D + min_byte1
+ byte2 = N\D + min_char_or_byte2
+
+ where:
+
+ D = max_char_or_byte2 - min_char_or_byte2 + 1
+ / = integer division
+ \ = integer modulus */
+ if (char2b->byte1 >= xfont->min_byte1
+ && char2b->byte1 <= xfont->max_byte1
+ && char2b->byte2 >= xfont->min_char_or_byte2
+ && char2b->byte2 <= xfont->max_char_or_byte2)
+ pcm = (xfont->per_char
+ + ((xfont->max_char_or_byte2 - xfont->min_char_or_byte2 + 1)
+ * (char2b->byte1 - xfont->min_byte1))
+ + (char2b->byte2 - xfont->min_char_or_byte2));
+ }
+ }
+ else
+ {
+ /* If the per_char pointer is null, all glyphs between the first
+ and last character indexes inclusive have the same
+ information, as given by both min_bounds and max_bounds. */
+ if (char2b->byte2 >= xfont->min_char_or_byte2
+ && char2b->byte2 <= xfont->max_char_or_byte2)
+ pcm = &xfont->max_bounds;
+ }
+
+ return ((pcm == NULL
+ || (pcm->width == 0 && (pcm->rbearing - pcm->lbearing) == 0))
+ ? NULL : pcm);
+}
+
+extern Lisp_Object find_font_encoding P_ ((Lisp_Object));
+
+/* Return encoding charset and repertory charset for REGISTRY in
+ ENCODING and REPERTORY correspondingly. If correct information for
+ REGISTRY is available, return 0. Otherwise return -1. */
+
+static int
+xfont_registry_charsets (registry, encoding, repertory)
+ Lisp_Object registry;
+ struct charset **encoding, **repertory;
+{
+ Lisp_Object val;
+ int encoding_id, repertory_id;
+
+ val = assq_no_quit (registry, x_font_charset_alist);
+ if (! NILP (val))
+ {
+ val = XCDR (val);
+ if (NILP (val))
+ return -1;
+ encoding_id = XINT (XCAR (val));
+ repertory_id = XINT (XCDR (val));
+ }
+ else
+ {
+ val = find_font_encoding (SYMBOL_NAME (registry));
+ if (SYMBOLP (val) && CHARSETP (val))
+ {
+ encoding_id = repertory_id = XINT (CHARSET_SYMBOL_ID (val));
+ }
+ else if (CONSP (val))
+ {
+ if (! CHARSETP (XCAR (val)))
+ goto invalid_entry;
+ encoding_id = XINT (CHARSET_SYMBOL_ID (XCAR (val)));
+ if (NILP (XCDR (val)))
+ repertory_id = -1;
+ else
+ {
+ if (! CHARSETP (XCDR (val)))
+ goto invalid_entry;
+ repertory_id = XINT (CHARSET_SYMBOL_ID (XCDR (val)));
+ }
+ }
+ else
+ goto invalid_entry;
+ val = Fcons (make_number (encoding_id), make_number (repertory_id));
+ x_font_charset_alist
+ = nconc2 (x_font_charset_alist, Fcons (Fcons (registry, val), Qnil));
+ }
+
+ if (encoding)
+ *encoding = CHARSET_FROM_ID (encoding_id);
+ if (repertory)
+ *repertory = repertory_id >= 0 ? CHARSET_FROM_ID (repertory_id) : NULL;
+ return 0;
+
+ invalid_entry:
+ x_font_charset_alist
+ = nconc2 (x_font_charset_alist, Fcons (Fcons (registry, Qnil), Qnil));
+ return -1;
+}
+
+static Lisp_Object xfont_get_cache P_ ((Lisp_Object));
+static Lisp_Object xfont_list P_ ((Lisp_Object, Lisp_Object));
+static Lisp_Object xfont_match P_ ((Lisp_Object, Lisp_Object));
+static Lisp_Object xfont_list_family P_ ((Lisp_Object));
+static struct font *xfont_open P_ ((FRAME_PTR, Lisp_Object, int));
+static void xfont_close P_ ((FRAME_PTR, struct font *));
+static int xfont_prepare_face P_ ((FRAME_PTR, struct face *));
+#if 0
+static void xfont_done_face P_ ((FRAME_PTR, struct face *));
+#endif
+static int xfont_has_char P_ ((Lisp_Object, int));
+static unsigned xfont_encode_char P_ ((struct font *, int));
+static int xfont_text_extents P_ ((struct font *, unsigned *, int,
+ struct font_metrics *));
+static int xfont_draw P_ ((struct glyph_string *, int, int, int, int, int));
+
+struct font_driver xfont_driver =
+ {
+ 0, /* Qx */
+ xfont_get_cache,
+ xfont_list,
+ xfont_match,
+ xfont_list_family,
+ NULL,
+ xfont_open,
+ xfont_close,
+ xfont_prepare_face,
+ NULL /*xfont_done_face*/,
+ xfont_has_char,
+ xfont_encode_char,
+ xfont_text_extents,
+ xfont_draw,
+ };
+
+extern Lisp_Object QCname;
+
+static Lisp_Object
+xfont_get_cache (frame)
+ Lisp_Object frame;
+{
+ Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (XFRAME (frame));
+
+ return (dpyinfo->name_list_element);
+}
+
+extern Lisp_Object Vface_alternative_font_registry_alist;
+
+static Lisp_Object
+xfont_list_pattern (frame, display, pattern)
+ Lisp_Object frame;
+ Display *display;
+ char *pattern;
+{
+ Lisp_Object list = Qnil;
+ int i, limit, num_fonts;
+ char **names;
+
+ BLOCK_INPUT;
+ x_catch_errors (display);
+
+ for (limit = 512; ; limit *= 2)
+ {
+ names = XListFonts (display, pattern, limit, &num_fonts);
+ if (x_had_errors_p (display))
+ {
+ /* This error is perhaps due to insufficient memory on X
+ server. Let's just ignore it. */
+ x_clear_errors (display);
+ num_fonts = 0;
+ break;
+ }
+ if (num_fonts < limit)
+ break;
+ XFreeFontNames (names);
+ }
+
+ for (i = 0; i < num_fonts; i++)
+ {
+ Lisp_Object entity = Fmake_vector (make_number (FONT_ENTITY_MAX), Qnil);
+ int result;
+
+ ASET (entity, FONT_TYPE_INDEX, Qx);
+ ASET (entity, FONT_FRAME_INDEX, frame);
+
+ result = font_parse_xlfd (names[i], entity);
+ if (result < 0)
+ {
+ /* This may be an alias name. Try to get the full XLFD name
+ from XA_FONT property of the font. */
+ XFontStruct *font = XLoadQueryFont (display, names[i]);
+ unsigned long value;
+
+ if (! font)
+ continue;
+ if (XGetFontProperty (font, XA_FONT, &value))
+ {
+ char *name = (char *) XGetAtomName (display, (Atom) value);
+ int len = strlen (name);
+
+ /* If DXPC (a Differential X Protocol Compressor)
+ Ver.3.7 is running, XGetAtomName will return null
+ string. We must avoid such a name. */
+ if (len > 0)
+ result = font_parse_xlfd (name, entity);
+ XFree (name);
+ }
+ XFreeFont (display, font);
+ }
+
+ if (result == 0)
+ {
+ Lisp_Object val = AREF (entity, FONT_EXTRA_INDEX);
+ char *p = (char *) SDATA (SYMBOL_NAME (val));
+
+ /* P == "RESX-RESY-SPACING-AVGWIDTH. We rejust this font if
+ it's an autoscaled one (i.e. RESX > 0 && AVGWIDTH == 0). */
+ if (atoi (p) > 0)
+ {
+ p += SBYTES (SYMBOL_NAME (val));
+ while (p[-1] != '-') p--;
+ if (atoi (p) == 0)
+ continue;
+ }
+ list = Fcons (entity, list);
+ }
+ }
+
+ x_uncatch_errors ();
+ UNBLOCK_INPUT;
+
+ return list;
+}
+
+static Lisp_Object
+xfont_list (frame, spec)
+ Lisp_Object frame, spec;
+{
+ FRAME_PTR f = XFRAME (frame);
+ Display *display = FRAME_X_DISPLAY_INFO (f)->display;
+ Lisp_Object list, val, extra, font_name;
+ int len;
+ char name[256];
+
+ extra = AREF (spec, FONT_EXTRA_INDEX);
+ font_name = Qnil;
+ if (CONSP (extra))
+ {
+ val = assq_no_quit (QCotf, extra);
+ if (! NILP (val))
+ return null_vector;
+ val = assq_no_quit (QCscript, extra);
+ if (! NILP (val))
+ return null_vector;
+ val = assq_no_quit (QClanguage, extra);
+ if (! NILP (val))
+ return null_vector;
+ val = assq_no_quit (QCname, extra);
+ if (CONSP (val))
+ font_name = XCDR (val);
+ }
+
+ if (STRINGP (font_name)
+ && ! strchr ((char *) SDATA (font_name), ':'))
+ list = xfont_list_pattern (frame, display, (char *) SDATA (font_name));
+ else if ((len = font_unparse_xlfd (spec, 0, name, 256)) < 0)
+ return null_vector;
+ else
+ {
+ list = xfont_list_pattern (frame, display, name);
+ if (NILP (list))
+ {
+ Lisp_Object registry = AREF (spec, FONT_REGISTRY_INDEX);
+ Lisp_Object alter;
+
+ if (! NILP (registry)
+ && (alter = Fassoc (SYMBOL_NAME (registry),
+ Vface_alternative_font_registry_alist),
+ CONSP (alter)))
+ {
+ /* Pointer to REGISTRY-ENCODING field. */
+ char *r = name + len - SBYTES (SYMBOL_NAME (registry));
+
+ for (alter = XCDR (alter); CONSP (alter); alter = XCDR (alter))
+ if (STRINGP (XCAR (alter))
+ && ((r - name) + SBYTES (XCAR (alter))) < 255)
+ {
+ strcpy (r, (char *) SDATA (XCAR (alter)));
+ list = xfont_list_pattern (frame, display, name);
+ if (! NILP (list))
+ break;
+ }
+ }
+ }
+ }
+
+ return (NILP (list) ? null_vector : Fvconcat (1, &list));
+}
+
+static Lisp_Object
+xfont_match (frame, spec)
+ Lisp_Object frame, spec;
+{
+ FRAME_PTR f = XFRAME (frame);
+ Display *display = FRAME_X_DISPLAY_INFO (f)->display;
+ Lisp_Object extra, val, entity;
+ char *name;
+ XFontStruct *xfont;
+ unsigned long value;
+
+ extra = AREF (spec, FONT_EXTRA_INDEX);
+ val = assq_no_quit (QCname, extra);
+ if (! CONSP (val) || ! STRINGP (XCDR (val)))
+ return Qnil;
+
+ BLOCK_INPUT;
+ entity = Qnil;
+ name = (char *) SDATA (XCDR (val));
+ xfont = XLoadQueryFont (display, name);
+ if (xfont)
+ {
+ if (XGetFontProperty (xfont, XA_FONT, &value))
+ {
+ int len;
+
+ name = (char *) XGetAtomName (display, (Atom) value);
+ len = strlen (name);
+
+ /* If DXPC (a Differential X Protocol Compressor)
+ Ver.3.7 is running, XGetAtomName will return null
+ string. We must avoid such a name. */
+ if (len > 0)
+ {
+ entity = Fmake_vector (make_number (FONT_ENTITY_MAX), Qnil);
+ ASET (entity, FONT_TYPE_INDEX, Qx);
+ ASET (entity, FONT_FRAME_INDEX, frame);
+ if (font_parse_xlfd (name, entity) < 0)
+ entity = Qnil;
+ }
+ XFree (name);
+ }
+ XFreeFont (display, xfont);
+ }
+ UNBLOCK_INPUT;
+
+ return entity;
+}
+
+static int
+memq_no_quit (elt, list)
+ Lisp_Object elt, list;
+{
+ while (CONSP (list) && ! EQ (XCAR (list), elt))
+ list = XCDR (list);
+ return (CONSP (list));
+}
+
+static Lisp_Object
+xfont_list_family (frame)
+ Lisp_Object frame;
+{
+ FRAME_PTR f = XFRAME (frame);
+ Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
+ char **names;
+ int num_fonts, i;
+ Lisp_Object list;
+ char *last_family;
+ int last_len;
+
+ BLOCK_INPUT;
+ x_catch_errors (dpyinfo->display);
+ names = XListFonts (dpyinfo->display, "-*-*-*-*-*-*-*-*-*-*-*-*-*-*",
+ 0x8000, &num_fonts);
+ if (x_had_errors_p (dpyinfo->display))
+ {
+ /* This error is perhaps due to insufficient memory on X server.
+ Let's just ignore it. */
+ x_clear_errors (dpyinfo->display);
+ num_fonts = 0;
+ }
+
+ list = Qnil;
+ for (i = 0, last_len = 0; i < num_fonts; i++)
+ {
+ char *p0 = names[i], *p1;
+ Lisp_Object family;
+
+ p0++; /* skip the leading '-' */
+ while (*p0 && *p0 != '-') p0++; /* skip foundry */
+ if (! *p0)
+ continue;
+ p1 = ++p0;
+ while (*p1 && *p1 != '-') p1++; /* find the end of family */
+ if (! *p1 || p1 == p0)
+ continue;
+ if (last_len == p1 - p0
+ && bcmp (last_family, p0, last_len) == 0)
+ continue;
+ last_len = p1 - p0;
+ last_family = p0;
+ family = intern_downcase (p0, last_len);
+ if (! memq_no_quit (family, list))
+ list = Fcons (family, list);
+ }
+
+ XFreeFontNames (names);
+ x_uncatch_errors ();
+ UNBLOCK_INPUT;
+
+ return list;
+}
+
+static struct font *
+xfont_open (f, entity, pixel_size)
+ FRAME_PTR f;
+ Lisp_Object entity;
+ int pixel_size;
+{
+ Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
+ Display *display = dpyinfo->display;
+ char name[256];
+ int len;
+ unsigned long value;
+ Lisp_Object registry;
+ struct charset *encoding, *repertory;
+ struct font *font;
+ XFontStruct *xfont;
+
+ /* At first, check if we know how to encode characters for this
+ font. */
+ registry = AREF (entity, FONT_REGISTRY_INDEX);
+ if (xfont_registry_charsets (registry, &encoding, &repertory) < 0)
+ return NULL;
+
+ if (XINT (AREF (entity, FONT_SIZE_INDEX)) != 0)
+ pixel_size = XINT (AREF (entity, FONT_SIZE_INDEX));
+ len = font_unparse_xlfd (entity, pixel_size, name, 256);
+ if (len <= 0)
+ return NULL;
+
+ BLOCK_INPUT;
+ x_catch_errors (display);
+ xfont = XLoadQueryFont (display, name);
+ if (x_had_errors_p (display))
+ {
+ /* This error is perhaps due to insufficient memory on X server.
+ Let's just ignore it. */
+ x_clear_errors (display);
+ xfont = NULL;
+ }
+ x_uncatch_errors ();
+ UNBLOCK_INPUT;
+
+ if (! xfont)
+ return NULL;
+ font = malloc (sizeof (struct font));
+ font->format = Qx;
+ font->font.font = xfont;
+ font->entity = entity;
+ font->pixel_size = pixel_size;
+ font->driver = &xfont_driver;
+ font->font.name = malloc (len + 1);
+ if (! font->font.name)
+ {
+ XFreeFont (display, xfont);
+ free (font);
+ return NULL;
+ }
+ bcopy (name, font->font.name, len + 1);
+ font->font.charset = encoding->id;
+ font->encoding_charset = encoding->id;
+ font->repertory_charset = repertory ? repertory->id : -1;
+ font->ascent = xfont->ascent;
+ font->descent = xfont->descent;
+
+ if (xfont->min_bounds.width == xfont->max_bounds.width)
+ {
+ /* Fixed width font. */
+ font->font.average_width = font->font.space_width
+ = xfont->min_bounds.width;
+ }
+ else
+ {
+ XChar2b char2b;
+ XCharStruct *pcm;
+
+ char2b.byte1 = 0x00, char2b.byte2 = 0x20;
+ pcm = xfont_get_pcm (xfont, &char2b);
+ if (pcm)
+ font->font.space_width = pcm->width;
+ else
+ font->font.space_width = xfont->max_bounds.width;
+
+ font->font.average_width
+ = (XGetFontProperty (xfont, dpyinfo->Xatom_AVERAGE_WIDTH, &value)
+ ? (long) value / 10 : 0);
+ if (font->font.average_width < 0)
+ font->font.average_width = - font->font.average_width;
+ if (font->font.average_width == 0)
+ {
+ if (pcm)
+ {
+ int width = pcm->width;
+ for (char2b.byte2 = 33; char2b.byte2 <= 126; char2b.byte2++)
+ if ((pcm = xfont_get_pcm (xfont, &char2b)) != NULL)
+ width += pcm->width;
+ font->font.average_width = width / 95;
+ }
+ else
+ font->font.average_width = xfont->max_bounds.width;
+ }
+ }
+ font->min_width = xfont->min_bounds.width;
+ if (font->min_width <= 0)
+ font->min_width = font->font.space_width;
+
+ BLOCK_INPUT;
+ /* Try to get the full name of FONT. Put it in FULL_NAME. */
+ if (XGetFontProperty (xfont, XA_FONT, &value))
+ {
+ char *full_name = NULL, *p0, *p;
+ int dashes = 0;
+
+ p0 = p = (char *) XGetAtomName (FRAME_X_DISPLAY (f), (Atom) value);;
+ /* Count the number of dashes in the "full name".
+ If it is too few, this isn't really the font's full name,
+ so don't use it.
+ In X11R4, the fonts did not come with their canonical names
+ stored in them. */
+ while (*p)
+ {
+ if (*p == '-')
+ dashes++;
+ p++;
+ }
+
+ if (dashes >= 13)
+ {
+ full_name = (char *) malloc (p - p0 + 1);
+ if (full_name)
+ bcopy (p0, full_name, p - p0 + 1);
+ }
+ XFree (p0);
+
+ if (full_name)
+ font->font.full_name = full_name;
+ else
+ font->font.full_name = font->font.name;
+ }
+ font->file_name = NULL;
+
+ font->font.size = xfont->max_bounds.width;
+ font->font.height = xfont->ascent + xfont->descent;
+ font->font.baseline_offset
+ = (XGetFontProperty (xfont, dpyinfo->Xatom_MULE_BASELINE_OFFSET, &value)
+ ? (long) value : 0);
+ font->font.relative_compose
+ = (XGetFontProperty (xfont, dpyinfo->Xatom_MULE_RELATIVE_COMPOSE, &value)
+ ? (long) value : 0);
+ font->font.default_ascent
+ = (XGetFontProperty (xfont, dpyinfo->Xatom_MULE_DEFAULT_ASCENT, &value)
+ ? (long) value : 0);
+ font->font.vertical_centering
+ = (STRINGP (Vvertical_centering_font_regexp)
+ && (fast_c_string_match_ignore_case
+ (Vvertical_centering_font_regexp, font->font.full_name) >= 0));
+
+ UNBLOCK_INPUT;
+
+ dpyinfo->n_fonts++;
+
+ /* Set global flag fonts_changed_p to non-zero if the font loaded
+ has a character with a smaller width than any other character
+ before, or if the font loaded has a smaller height than any other
+ font loaded before. If this happens, it will make a glyph matrix
+ reallocation necessary. */
+ if (dpyinfo->n_fonts == 1)
+ {
+ dpyinfo->smallest_font_height = font->font.height;
+ dpyinfo->smallest_char_width = font->min_width;
+ fonts_changed_p = 1;
+ }
+ else
+ {
+ if (dpyinfo->smallest_font_height > font->font.height)
+ dpyinfo->smallest_font_height = font->font.height, fonts_changed_p |= 1;
+ if (dpyinfo->smallest_char_width > font->min_width)
+ dpyinfo->smallest_char_width = font->min_width, fonts_changed_p |= 1;
+ }
+
+ return font;
+}
+
+static void
+xfont_close (f, font)
+ FRAME_PTR f;
+ struct font *font;
+{
+ BLOCK_INPUT;
+ XFreeFont (FRAME_X_DISPLAY (f), font->font.font);
+ UNBLOCK_INPUT;
+
+ if (font->font.name != font->font.full_name)
+ free (font->font.full_name);
+ free (font->font.name);
+ free (font);
+ FRAME_X_DISPLAY_INFO (f)->n_fonts--;
+}
+
+static int
+xfont_prepare_face (f, face)
+ FRAME_PTR f;
+ struct face *face;
+{
+ BLOCK_INPUT;
+ XSetFont (FRAME_X_DISPLAY (f), face->gc, face->font->fid);
+ UNBLOCK_INPUT;
+
+ return 0;
+}
+
+#if 0
+static void
+xfont_done_face (f, face)
+ FRAME_PTR f;
+ struct face *face;
+{
+ if (face->extra)
+ {
+ BLOCK_INPUT;
+ XFreeGC (FRAME_X_DISPLAY (f), (GC) face->extra);
+ UNBLOCK_INPUT;
+ face->extra = NULL;
+ }
+}
+#endif /* 0 */
+
+static int
+xfont_has_char (entity, c)
+ Lisp_Object entity;
+ int c;
+{
+ Lisp_Object registry = AREF (entity, FONT_REGISTRY_INDEX);
+ struct charset *repertory;
+
+ if (xfont_registry_charsets (registry, NULL, &repertory) < 0)
+ return -1;
+ if (! repertory)
+ return -1;
+ return (ENCODE_CHAR (repertory, c) != CHARSET_INVALID_CODE (repertory));
+}
+
+static unsigned
+xfont_encode_char (font, c)
+ struct font *font;
+ int c;
+{
+ struct charset *charset;
+ unsigned code;
+ XChar2b char2b;
+
+ charset = CHARSET_FROM_ID (font->encoding_charset);
+ code = ENCODE_CHAR (charset, c);
+ if (code == CHARSET_INVALID_CODE (charset))
+ return 0xFFFFFFFF;
+ if (font->repertory_charset >= 0)
+ {
+ charset = CHARSET_FROM_ID (font->repertory_charset);
+ return (ENCODE_CHAR (charset, c) != CHARSET_INVALID_CODE (charset)
+ ? code : 0xFFFFFFFF);
+ }
+ char2b.byte1 = code >> 8;
+ char2b.byte2 = code & 0xFF;
+ return (xfont_get_pcm (font->font.font, &char2b) ? code : 0xFFFFFFFF);
+}
+
+static int
+xfont_text_extents (font, code, nglyphs, metrics)
+ struct font *font;
+ unsigned *code;
+ int nglyphs;
+ struct font_metrics *metrics;
+{
+ int width = 0;
+ int i, x;
+
+ if (metrics)
+ bzero (metrics, sizeof (struct font_metrics));
+ for (i = 0, x = 0; i < nglyphs; i++)
+ {
+ XChar2b char2b;
+ static XCharStruct *pcm;
+
+ if (code[i] >= 0x10000)
+ continue;
+ char2b.byte1 = code[i] >> 8, char2b.byte2 = code[i] & 0xFF;
+ pcm = xfont_get_pcm (font->font.font, &char2b);
+ if (! pcm)
+ continue;
+ if (metrics->lbearing > width + pcm->lbearing)
+ metrics->lbearing = width + pcm->lbearing;
+ if (metrics->rbearing < width + pcm->rbearing)
+ metrics->rbearing = width + pcm->rbearing;
+ if (metrics->ascent < pcm->ascent)
+ metrics->ascent = pcm->ascent;
+ if (metrics->descent < pcm->descent)
+ metrics->descent = pcm->descent;
+ width += pcm->width;
+ }
+ if (metrics)
+ metrics->width = width;
+ return width;
+}
+
+static int
+xfont_draw (s, from, to, x, y, with_background)
+ struct glyph_string *s;
+ int from, to, x, y, with_background;
+{
+ XFontStruct *xfont = s->face->font;
+ int len = to - from;
+ GC gc = s->gc;
+
+ if (gc != s->face->gc)
+ {
+ XGCValues xgcv;
+ Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (s->f);
+
+ XGetGCValues (s->display, gc, GCFont, &xgcv);
+ if (xgcv.font != xfont->fid)
+ XSetFont (s->display, gc, xfont->fid);
+ }
+
+ if (xfont->min_byte1 == 0 && xfont->max_byte1 == 0)
+ {
+ char *str;
+ int i;
+ USE_SAFE_ALLOCA;
+
+ SAFE_ALLOCA (str, char *, len);
+ for (i = 0; i < len ; i++)
+ str[i] = XCHAR2B_BYTE2 (s->char2b + from + i);
+ if (with_background > 0)
+ XDrawImageString (FRAME_X_DISPLAY (s->f), FRAME_X_WINDOW (s->f),
+ gc, x, y, str, len);
+ else
+ XDrawString (FRAME_X_DISPLAY (s->f), FRAME_X_WINDOW (s->f),
+ gc, x, y, str, len);
+ SAFE_FREE ();
+ return s->nchars;
+ }
+
+ if (with_background > 0)
+ XDrawImageString16 (FRAME_X_DISPLAY (s->f), FRAME_X_WINDOW (s->f),
+ gc, x, y, s->char2b + from, len);
+ else
+ XDrawString16 (FRAME_X_DISPLAY (s->f), FRAME_X_WINDOW (s->f),
+ gc, x, y, s->char2b + from, len);
+
+ return len;
+}
+
+
+
+void
+syms_of_xfont ()
+{
+ staticpro (&x_font_charset_alist);
+ x_font_charset_alist = Qnil;
+
+ DEFSYM (Qx, "x");
+ xfont_driver.type = Qx;
+ register_font_driver (&xfont_driver, NULL);
+}
+
+/* arch-tag: 23c5f366-a5ee-44b7-a3b7-90d6da7fd749
+ (do not change this comment) */
diff --git a/src/xftfont.c b/src/xftfont.c
new file mode 100644
index 0000000000..75cc06117c
--- /dev/null
+++ b/src/xftfont.c
@@ -0,0 +1,586 @@
+/* xftfont.c -- XFT font driver.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006
+ National Institute of Advanced Industrial Science and Technology (AIST)
+ Registration Number H13PRO009
+
+This file is part of GNU Emacs.
+
+GNU Emacs is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Emacs is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Emacs; see the file COPYING. If not, write to
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+#include <config.h>
+#include <stdio.h>
+#include <X11/Xlib.h>
+#include <X11/Xft/Xft.h>
+
+#include "lisp.h"
+#include "dispextern.h"
+#include "xterm.h"
+#include "frame.h"
+#include "blockinput.h"
+#include "character.h"
+#include "charset.h"
+#include "fontset.h"
+#include "font.h"
+
+/* Xft font driver. */
+
+static Lisp_Object Qxft;
+
+/* The actual structure for Xft font that can be casted to struct
+ font. */
+
+struct xftfont_info
+{
+ struct font font;
+ Display *display;
+ int screen;
+ XftFont *xftfont;
+ FT_Face ft_face; /* set to XftLockFace (xftfont) */
+};
+
+/* Structure pointed by (struct face *)->extra */
+
+struct xftface_info
+{
+ XftColor xft_fg; /* color for face->foreground */
+ XftColor xft_bg; /* color for face->background */
+ XftDraw *xft_draw;
+};
+
+static void xftfont_get_colors P_ ((FRAME_PTR, struct face *, GC gc,
+ struct xftface_info *,
+ XftColor *fg, XftColor *bg));
+static Font xftfont_default_fid P_ ((FRAME_PTR));
+
+
+/* Setup foreground and background colors of GC into FG and BG. If
+ XFTFACE_INFO is not NULL, reuse the colors in it if possible. BG
+ may be NULL. */
+
+static void
+xftfont_get_colors (f, face, gc, xftface_info, fg, bg)
+ FRAME_PTR f;
+ struct face *face;
+ GC gc;
+ struct xftface_info *xftface_info;
+ XftColor *fg, *bg;
+{
+ if (xftface_info && face->gc == gc)
+ {
+ *fg = xftface_info->xft_fg;
+ if (bg)
+ *bg = xftface_info->xft_bg;
+ }
+ else
+ {
+ XGCValues xgcv;
+ int fg_done = 0, bg_done = 0;
+
+ BLOCK_INPUT;
+ XGetGCValues (FRAME_X_DISPLAY (f), gc,
+ GCForeground | GCBackground, &xgcv);
+ if (xftface_info)
+ {
+ if (xgcv.foreground == face->foreground)
+ *fg = xftface_info->xft_fg, fg_done = 1;
+ else if (xgcv.foreground == face->background)
+ *fg = xftface_info->xft_bg, fg_done = 1;
+ if (! bg)
+ bg_done = 1;
+ else if (xgcv.background == face->background)
+ *bg = xftface_info->xft_bg, bg_done = 1;
+ else if (xgcv.background == face->foreground)
+ *bg = xftface_info->xft_fg, bg_done = 1;
+ }
+
+ if (fg_done + bg_done < 2)
+ {
+ XColor colors[2];
+
+ colors[0].pixel = fg->pixel = xgcv.foreground;
+ if (bg)
+ colors[1].pixel = bg->pixel = xgcv.background;
+ XQueryColors (FRAME_X_DISPLAY (f), FRAME_X_COLORMAP (f), colors,
+ bg ? 2 : 1);
+ fg->color.alpha = 0xFFFF;
+ fg->color.red = colors[0].red;
+ fg->color.green = colors[0].green;
+ fg->color.blue = colors[0].blue;
+ if (bg)
+ {
+ bg->color.alpha = 0xFFFF;
+ bg->color.red = colors[1].red;
+ bg->color.green = colors[1].green;
+ bg->color.blue = colors[1].blue;
+ }
+ }
+ UNBLOCK_INPUT;
+ }
+}
+
+/* Return the default Font ID on frame F. The Returned Font ID is
+ stored in the GC of the frame F, but the font is never used. So,
+ any ID is ok as long as it is valid. */
+
+static Font
+xftfont_default_fid (f)
+ FRAME_PTR f;
+{
+ static int fid_known;
+ static Font fid;
+
+ if (! fid_known)
+ {
+ fid = XLoadFont (FRAME_X_DISPLAY (f), "fixed");
+ if (! fid)
+ {
+ fid = XLoadFont (FRAME_X_DISPLAY (f), "*");
+ if (! fid)
+ abort ();
+ }
+ fid_known = 1;
+ }
+ return fid;
+}
+
+
+static Lisp_Object xftfont_list P_ ((Lisp_Object, Lisp_Object));
+static Lisp_Object xftfont_match P_ ((Lisp_Object, Lisp_Object));
+static struct font *xftfont_open P_ ((FRAME_PTR, Lisp_Object, int));
+static void xftfont_close P_ ((FRAME_PTR, struct font *));
+static int xftfont_prepare_face P_ ((FRAME_PTR, struct face *));
+static void xftfont_done_face P_ ((FRAME_PTR, struct face *));
+static unsigned xftfont_encode_char P_ ((struct font *, int));
+static int xftfont_text_extents P_ ((struct font *, unsigned *, int,
+ struct font_metrics *));
+static int xftfont_draw P_ ((struct glyph_string *, int, int, int, int, int));
+
+static int xftfont_anchor_point P_ ((struct font *, unsigned, int,
+ int *, int *));
+
+struct font_driver xftfont_driver;
+
+static Lisp_Object
+xftfont_list (frame, spec)
+ Lisp_Object frame;
+ Lisp_Object spec;
+{
+ Lisp_Object val = ftfont_driver.list (frame, spec);
+ int i;
+
+ if (! NILP (val))
+ for (i = 0; i < ASIZE (val); i++)
+ ASET (AREF (val, i), FONT_TYPE_INDEX, Qxft);
+ return val;
+}
+
+static Lisp_Object
+xftfont_match (frame, spec)
+ Lisp_Object frame;
+ Lisp_Object spec;
+{
+ Lisp_Object entity = ftfont_driver.match (frame, spec);
+
+ if (VECTORP (entity))
+ ASET (entity, FONT_TYPE_INDEX, Qxft);
+ return entity;
+}
+
+extern Lisp_Object ftfont_font_format P_ ((FcPattern *));
+
+static FcChar8 ascii_printable[95];
+
+static struct font *
+xftfont_open (f, entity, pixel_size)
+ FRAME_PTR f;
+ Lisp_Object entity;
+ int pixel_size;
+{
+ Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
+ Display *display = FRAME_X_DISPLAY (f);
+ Lisp_Object val;
+ FcPattern *pattern, *pat = NULL;
+ FcChar8 *file;
+ struct xftfont_info *xftfont_info = NULL;
+ XFontStruct *xfont = NULL;
+ struct font *font;
+ double size = 0;
+ XftFont *xftfont = NULL;
+ int spacing;
+ char *name;
+ int len;
+ XGlyphInfo extents;
+
+ val = AREF (entity, FONT_EXTRA_INDEX);
+ if (XTYPE (val) != Lisp_Misc
+ || XMISCTYPE (val) != Lisp_Misc_Save_Value)
+ return NULL;
+ pattern = XSAVE_VALUE (val)->pointer;
+ if (FcPatternGetString (pattern, FC_FILE, 0, &file) != FcResultMatch)
+ return NULL;
+
+ size = XINT (AREF (entity, FONT_SIZE_INDEX));
+ if (size == 0)
+ size = pixel_size;
+
+ pat = FcPatternCreate ();
+ FcPatternAddString (pat, FC_FILE, file);
+ FcPatternAddDouble (pat, FC_PIXEL_SIZE, pixel_size);
+ /*FcPatternAddBool (pat, FC_ANTIALIAS, FcTrue);*/
+ val = AREF (entity, FONT_FAMILY_INDEX);
+ if (! NILP (val))
+ FcPatternAddString (pat, FC_FAMILY, (FcChar8 *) SDATA (SYMBOL_NAME (val)));
+ FcConfigSubstitute (NULL, pat, FcMatchPattern);
+
+ BLOCK_INPUT;
+ XftDefaultSubstitute (display, FRAME_X_SCREEN_NUMBER (f), pat);
+ xftfont = XftFontOpenPattern (display, pat);
+ /* We should not destroy PAT here because it is kept in XFTFONT and
+ destroyed automatically when XFTFONT is closed. */
+ if (! xftfont)
+ goto err;
+
+ xftfont_info = malloc (sizeof (struct xftfont_info));
+ if (! xftfont_info)
+ goto err;
+ xfont = malloc (sizeof (XFontStruct));
+ if (! xfont)
+ goto err;
+ xftfont_info->display = display;
+ xftfont_info->screen = FRAME_X_SCREEN_NUMBER (f);
+ xftfont_info->xftfont = xftfont;
+ xftfont_info->ft_face = XftLockFace (xftfont);
+
+ font = (struct font *) xftfont_info;
+ font->format = ftfont_font_format (xftfont->pattern);
+ font->entity = entity;
+ font->pixel_size = size;
+ font->driver = &xftfont_driver;
+ len = 96;
+ name = malloc (len);
+ while (name && font_unparse_fcname (entity, pixel_size, name, len) < 0)
+ {
+ char *new = realloc (name, len += 32);
+
+ if (! new)
+ free (name);
+ name = new;
+ }
+ if (! name)
+ goto err;
+ font->font.full_name = font->font.name = name;
+ font->file_name = (char *) file;
+ font->font.size = xftfont->max_advance_width;
+ font->font.charset = font->encoding_charset = font->repertory_charset = -1;
+
+ if (FcPatternGetInteger (xftfont->pattern, FC_SPACING, 0, &spacing)
+ != FcResultMatch)
+ spacing = FC_PROPORTIONAL;
+ if (! ascii_printable[0])
+ {
+ int i;
+ for (i = 0; i < 95; i++)
+ ascii_printable[i] = ' ' + i;
+ }
+ if (spacing != FC_PROPORTIONAL)
+ {
+ font->font.average_width = font->font.space_width
+ = xftfont->max_advance_width;
+ XftTextExtents8 (display, xftfont, ascii_printable + 1, 94, &extents);
+ }
+ else
+ {
+ XftTextExtents8 (display, xftfont, ascii_printable, 1, &extents);
+ font->font.space_width = extents.xOff;
+ if (font->font.space_width <= 0)
+ /* dirty workaround */
+ font->font.space_width = pixel_size;
+ XftTextExtents8 (display, xftfont, ascii_printable + 1, 94, &extents);
+ font->font.average_width = (font->font.space_width + extents.xOff) / 95;
+ }
+ UNBLOCK_INPUT;
+
+ font->ascent = xftfont->ascent;
+ if (font->ascent < extents.y)
+ font->ascent = extents.y;
+ font->descent = xftfont->descent;
+ if (font->descent < extents.height - extents.y)
+ font->descent = extents.height - extents.y;
+ font->font.height = font->ascent + font->descent;
+
+ /* Unfortunately Xft doesn't provide a way to get minimum char
+ width. So, we use space_width instead. */
+ font->min_width = font->font.space_width;
+
+ font->font.baseline_offset = 0;
+ font->font.relative_compose = 0;
+ font->font.default_ascent = 0;
+ font->font.vertical_centering = 0;
+
+ /* Setup pseudo XFontStruct */
+ xfont->fid = xftfont_default_fid (f);
+ xfont->ascent = font->ascent;
+ xfont->descent = font->descent;
+ xfont->max_bounds.descent = font->descent;
+ xfont->max_bounds.width = xftfont->max_advance_width;
+ xfont->min_bounds.width = font->font.space_width;
+ font->font.font = xfont;
+
+ dpyinfo->n_fonts++;
+
+ /* Set global flag fonts_changed_p to non-zero if the font loaded
+ has a character with a smaller width than any other character
+ before, or if the font loaded has a smaller height than any other
+ font loaded before. If this happens, it will make a glyph matrix
+ reallocation necessary. */
+ if (dpyinfo->n_fonts == 1)
+ {
+ dpyinfo->smallest_font_height = font->font.height;
+ dpyinfo->smallest_char_width = font->min_width;
+ fonts_changed_p = 1;
+ }
+ else
+ {
+ if (dpyinfo->smallest_font_height > font->font.height)
+ dpyinfo->smallest_font_height = font->font.height,
+ fonts_changed_p |= 1;
+ if (dpyinfo->smallest_char_width > font->min_width)
+ dpyinfo->smallest_char_width = font->min_width,
+ fonts_changed_p |= 1;
+ }
+
+ return font;
+
+ err:
+ if (xftfont) XftFontClose (display, xftfont);
+ UNBLOCK_INPUT;
+ if (xftfont_info) free (xftfont_info);
+ if (xfont) free (xfont);
+ return NULL;
+}
+
+static void
+xftfont_close (f, font)
+ FRAME_PTR f;
+ struct font *font;
+{
+ struct xftfont_info *xftfont_info = (struct xftfont_info *) font;
+
+ XftUnlockFace (xftfont_info->xftfont);
+ XftFontClose (xftfont_info->display, xftfont_info->xftfont);
+ if (font->font.name)
+ free (font->font.name);
+ free (font);
+ FRAME_X_DISPLAY_INFO (f)->n_fonts--;
+}
+
+static int
+xftfont_prepare_face (f, face)
+ FRAME_PTR f;
+ struct face *face;
+{
+ struct xftface_info *xftface_info;
+
+#if 0
+ /* This doesn't work if face->ascii_face doesn't use an Xft font. */
+ if (face != face->ascii_face)
+ {
+ face->extra = face->ascii_face->extra;
+ return 0;
+ }
+#endif
+
+ xftface_info = malloc (sizeof (struct xftface_info));
+ if (! xftface_info)
+ return -1;
+
+ BLOCK_INPUT;
+ xftface_info->xft_draw = XftDrawCreate (FRAME_X_DISPLAY (f),
+ FRAME_X_WINDOW (f),
+ FRAME_X_VISUAL (f),
+ FRAME_X_COLORMAP (f));
+ xftfont_get_colors (f, face, face->gc, NULL,
+ &xftface_info->xft_fg, &xftface_info->xft_bg);
+ UNBLOCK_INPUT;
+
+ face->extra = xftface_info;
+ return 0;
+}
+
+static void
+xftfont_done_face (f, face)
+ FRAME_PTR f;
+ struct face *face;
+{
+ struct xftface_info *xftface_info;
+
+#if 0
+ /* This doesn't work if face->ascii_face doesn't use an Xft font. */
+ if (face != face->ascii_face
+ || ! face->extra)
+ return;
+#endif
+
+ xftface_info = (struct xftface_info *) face->extra;
+ if (xftface_info)
+ {
+ BLOCK_INPUT;
+ XftDrawDestroy (xftface_info->xft_draw);
+ UNBLOCK_INPUT;
+ free (xftface_info);
+ }
+ face->extra = NULL;
+}
+
+static unsigned
+xftfont_encode_char (font, c)
+ struct font *font;
+ int c;
+{
+ struct xftfont_info *xftfont_info = (struct xftfont_info *) font;
+ unsigned code = XftCharIndex (xftfont_info->display, xftfont_info->xftfont,
+ (FcChar32) c);
+
+ return (code ? code : 0xFFFFFFFF);
+}
+
+static int
+xftfont_text_extents (font, code, nglyphs, metrics)
+ struct font *font;
+ unsigned *code;
+ int nglyphs;
+ struct font_metrics *metrics;
+{
+ struct xftfont_info *xftfont_info = (struct xftfont_info *) font;
+ XGlyphInfo extents;
+
+ BLOCK_INPUT;
+ XftGlyphExtents (xftfont_info->display, xftfont_info->xftfont, code, nglyphs,
+ &extents);
+ UNBLOCK_INPUT;
+ if (metrics)
+ {
+ metrics->lbearing = - extents.x;
+ metrics->rbearing = - extents.x + extents.width;
+ metrics->width = extents.xOff;
+ metrics->ascent = extents.y;
+ metrics->descent = extents.height - extents.y;
+ }
+ return extents.xOff;
+}
+
+static int
+xftfont_draw (s, from, to, x, y, with_background)
+ struct glyph_string *s;
+ int from, to, x, y, with_background;
+{
+ FRAME_PTR f = s->f;
+ struct face *face = s->face;
+ struct xftfont_info *xftfont_info = (struct xftfont_info *) s->font_info;
+ struct xftface_info *xftface_info = NULL;
+ XftDraw *xft_draw = NULL;
+ FT_UInt *code;
+ XftColor fg, bg;
+ XRectangle r;
+ int len = to - from;
+ int i;
+
+ if (s->font_info == face->font_info)
+ {
+ xftface_info = (struct xftface_info *) face->extra;
+ xft_draw = xftface_info->xft_draw;
+ }
+ xftfont_get_colors (f, face, s->gc, xftface_info,
+ &fg, with_background ? &bg : NULL);
+ BLOCK_INPUT;
+ if (! xft_draw)
+ xft_draw = XftDrawCreate (FRAME_X_DISPLAY (f),
+ FRAME_X_WINDOW (f),
+ FRAME_X_VISUAL (f),
+ FRAME_X_COLORMAP (f));
+ if (s->num_clips > 0)
+ XftDrawSetClipRectangles (xft_draw, 0, 0, s->clip, s->num_clips);
+ else
+ XftDrawSetClip (xft_draw, NULL);
+
+ if (with_background)
+ {
+ struct font *font = (struct font *) face->font_info;
+
+ XftDrawRect (xft_draw, &bg,
+ x, y - face->font->ascent, s->width, font->font.height);
+ }
+ code = alloca (sizeof (FT_UInt) * len);
+ for (i = 0; i < len; i++)
+ code[i] = ((XCHAR2B_BYTE1 (s->char2b + from + i) << 8)
+ | XCHAR2B_BYTE2 (s->char2b + from + i));
+
+ XftDrawGlyphs (xft_draw, &fg, xftfont_info->xftfont,
+ x, y, code, len);
+ if (s->font_info != face->font_info)
+ XftDrawDestroy (xft_draw);
+ UNBLOCK_INPUT;
+
+ return len;
+}
+
+static int
+xftfont_anchor_point (font, code, index, x, y)
+ struct font *font;
+ unsigned code;
+ int index;
+ int *x, *y;
+{
+ struct xftfont_info *xftfont_info = (struct xftfont_info *) font;
+ FT_Face ft_face = xftfont_info->ft_face;
+
+ if (FT_Load_Glyph (ft_face, code, FT_LOAD_DEFAULT) != 0)
+ return -1;
+ if (ft_face->glyph->format != FT_GLYPH_FORMAT_OUTLINE)
+ return -1;
+ if (index >= ft_face->glyph->outline.n_points)
+ return -1;
+ *x = ft_face->glyph->outline.points[index].x;
+ *y = ft_face->glyph->outline.points[index].y;
+ return 0;
+}
+
+
+void
+syms_of_xftfont ()
+{
+ DEFSYM (Qxft, "xft");
+
+ xftfont_driver = ftfont_driver;
+ xftfont_driver.type = Qxft;
+ xftfont_driver.get_cache = xfont_driver.get_cache;
+ xftfont_driver.list = xftfont_list;
+ xftfont_driver.match = xftfont_match;
+ xftfont_driver.open = xftfont_open;
+ xftfont_driver.close = xftfont_close;
+ xftfont_driver.prepare_face = xftfont_prepare_face;
+ xftfont_driver.done_face = xftfont_done_face;
+ xftfont_driver.encode_char = xftfont_encode_char;
+ xftfont_driver.text_extents = xftfont_text_extents;
+ xftfont_driver.draw = xftfont_draw;
+ xftfont_driver.anchor_point = xftfont_anchor_point;
+
+ register_font_driver (&xftfont_driver, NULL);
+}
+
+/* arch-tag: 64ec61bf-7c8e-4fe6-b953-c6a85d5e1605
+ (do not change this comment) */
diff --git a/src/xmenu.c b/src/xmenu.c
index 76b316d026..d497324378 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -41,10 +41,10 @@ Boston, MA 02110-1301, USA. */
#include <stdio.h>
#include "lisp.h"
+#include "termhooks.h"
#include "keyboard.h"
#include "keymap.h"
#include "frame.h"
-#include "termhooks.h"
#include "window.h"
#include "blockinput.h"
#include "buffer.h"
@@ -248,10 +248,10 @@ menubar_id_to_frame (id)
Lisp_Object tail, frame;
FRAME_PTR f;
- for (tail = Vframe_list; GC_CONSP (tail); tail = XCDR (tail))
+ for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
{
frame = XCAR (tail);
- if (!GC_FRAMEP (frame))
+ if (!FRAMEP (frame))
continue;
f = XFRAME (frame);
if (!FRAME_WINDOW_P (f))
@@ -745,9 +745,6 @@ mouse_position_for_popup (f, x, y)
Window root, dummy_window;
int dummy;
- if (! FRAME_X_P (f))
- abort ();
-
BLOCK_INPUT;
XQueryPointer (FRAME_X_DISPLAY (f),
@@ -943,9 +940,6 @@ no quit occurs and `x-popup-menu' returns nil. */)
xpos += XINT (x);
ypos += XINT (y);
- if (! FRAME_X_P (f))
- error ("Can not put X menu on non-X terminal");
-
XSETFRAME (Vmenu_updating_frame, f);
}
else
@@ -1134,9 +1128,6 @@ for instance using the window manager, then this produces a quit and
but I don't want to make one now. */
CHECK_WINDOW (window);
- if (! FRAME_X_P (f))
- error ("Can not put X dialog on non-X terminal");
-
#if ! defined (USE_X_TOOLKIT) && ! defined (USE_GTK)
/* Display a menu with these alternatives
in the middle of frame F. */
@@ -1318,7 +1309,7 @@ popup_get_selection (initial_event, dpyinfo, id, do_timers)
}
}
-DEFUN ("x-menu-bar-open-internal", Fx_menu_bar_open_internal, Sx_menu_bar_open_internal, 0, 1, "i",
+DEFUN ("menu-bar-open", Fmenu_bar_open, Smenu_bar_open, 0, 1, "i",
doc: /* Start key navigation of the menu bar in FRAME.
This initially opens the first menu bar item and you can then navigate with the
arrow keys, select a menu entry with the return key or cancel with the
@@ -1397,7 +1388,7 @@ If FRAME is nil or not given, use the selected frame. */)
#ifdef USE_GTK
-DEFUN ("x-menu-bar-open-internal", Fx_menu_bar_open_internal, Sx_menu_bar_open_internal, 0, 1, "i",
+DEFUN ("menu-bar-open", Fmenu_bar_open, Smenu_bar_open, 0, 1, "i",
doc: /* Start key navigation of the menu bar in FRAME.
This initially opens the first menu bar item and you can then navigate with the
arrow keys, select a menu entry with the return key or cancel with the
@@ -1473,9 +1464,6 @@ void
x_activate_menubar (f)
FRAME_PTR f;
{
- if (! FRAME_X_P (f))
- abort ();
-
if (!f->output_data.x->saved_menu_event->type)
return;
@@ -1568,10 +1556,10 @@ show_help_event (f, widget, help)
xt_or_gtk_widget frame_widget = XtParent (widget);
Lisp_Object tail;
- for (tail = Vframe_list; GC_CONSP (tail); tail = XCDR (tail))
+ for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
{
frame = XCAR (tail);
- if (GC_FRAMEP (frame)
+ if (FRAMEP (frame)
&& (f = XFRAME (frame),
FRAME_X_P (f) && f->output_data.x->widget == frame_widget))
break;
@@ -1637,7 +1625,7 @@ menu_highlight_callback (widget, id, call_data)
static void
find_and_call_menu_selection (f, menu_bar_items_used, vector, client_data)
FRAME_PTR f;
- int menu_bar_items_used;
+ EMACS_INT menu_bar_items_used;
Lisp_Object vector;
void *client_data;
{
@@ -2110,14 +2098,9 @@ update_frame_menubar (f)
#ifdef USE_GTK
return xg_update_frame_menubar (f);
#else
- struct x_output *x;
+ struct x_output *x = f->output_data.x;
int columns, rows;
- if (! FRAME_X_P (f))
- abort ();
-
- x = f->output_data.x;
-
if (!x->menubar_widget || XtIsManaged (x->menubar_widget))
return 0;
@@ -2163,7 +2146,7 @@ set_frame_menubar (f, first_time, deep_p)
int first_time;
int deep_p;
{
- xt_or_gtk_widget menubar_widget;
+ xt_or_gtk_widget menubar_widget = f->output_data.x->menubar_widget;
#ifdef USE_X_TOOLKIT
LWLIB_ID id;
#endif
@@ -2173,10 +2156,6 @@ set_frame_menubar (f, first_time, deep_p)
int *submenu_start, *submenu_end;
int *submenu_top_level_items, *submenu_n_panes;
- if (! FRAME_X_P (f))
- abort ();
-
- menubar_widget = f->output_data.x->menubar_widget;
XSETFRAME (Vmenu_updating_frame, f);
@@ -2529,9 +2508,6 @@ free_frame_menubar (f)
{
Widget menubar_widget;
- if (! FRAME_X_P (f))
- abort ();
-
menubar_widget = f->output_data.x->menubar_widget;
f->output_data.x->menubar_height = 0;
@@ -2684,9 +2660,6 @@ create_and_show_popup_menu (f, first_wv, x, y, for_click)
struct next_popup_x_y popup_x_y;
int specpdl_count = SPECPDL_INDEX ();
- if (! FRAME_X_P (f))
- abort ();
-
xg_crazy_callback_abort = 1;
menu = xg_create_widget ("popup", first_wv->name, f, first_wv,
G_CALLBACK (popup_selection_callback),
@@ -2795,9 +2768,6 @@ create_and_show_popup_menu (f, first_wv, x, y, for_click)
LWLIB_ID menu_id;
Widget menu;
- if (! FRAME_X_P (f))
- abort ();
-
menu_id = widget_id_tick++;
menu = lw_create_widget ("popup", first_wv->name, menu_id, first_wv,
f->output_data.x->widget, 1, 0,
@@ -2874,9 +2844,6 @@ xmenu_show (f, x, y, for_click, keymaps, title, error)
int first_pane;
- if (! FRAME_X_P (f))
- abort ();
-
*error = NULL;
if (menu_items_used <= MENU_ITEMS_PANE_LENGTH)
@@ -3159,9 +3126,6 @@ create_and_show_dialog (f, first_wv)
{
GtkWidget *menu;
- if (! FRAME_X_P (f))
- abort ();
-
menu = xg_create_widget ("dialog", first_wv->name, f, first_wv,
G_CALLBACK (dialog_selection_callback),
G_CALLBACK (popup_deactivate_callback),
@@ -3211,9 +3175,6 @@ create_and_show_dialog (f, first_wv)
{
LWLIB_ID dialog_id;
- if (!FRAME_X_P (f))
- abort();
-
dialog_id = widget_id_tick++;
lw_create_widget (first_wv->name, "dialog", dialog_id, first_wv,
f->output_data.x->widget, 1, 0,
@@ -3266,9 +3227,6 @@ xdialog_show (f, keymaps, title, header, error_name)
/* 1 means we've seen the boundary between left-hand elts and right-hand. */
int boundary_seen = 0;
- if (! FRAME_X_P (f))
- abort ();
-
*error_name = NULL;
if (menu_items_n_panes > 1)
@@ -3544,9 +3502,6 @@ xmenu_show (f, x, y, for_click, keymaps, title, error)
unsigned int dummy_uint;
int specpdl_count = SPECPDL_INDEX ();
- if (! FRAME_X_P (f))
- abort ();
-
*error = 0;
if (menu_items_n_panes == 0)
return Qnil;
@@ -3655,6 +3610,13 @@ xmenu_show (f, x, y, for_click, keymaps, title, error)
if (!NILP (descrip))
{
int gap = maxwidth - SBYTES (item_name);
+#ifdef C_ALLOCA
+ Lisp_Object spacer;
+ spacer = Fmake_string (make_number (gap), make_number (' '));
+ item_name = concat2 (item_name, spacer);
+ item_name = concat2 (item_name, descrip);
+ item_data = SDATA (item_name);
+#else
/* if alloca is fast, use that to make the space,
to reduce gc needs. */
item_data
@@ -3667,6 +3629,7 @@ xmenu_show (f, x, y, for_click, keymaps, title, error)
bcopy (SDATA (descrip), item_data + j,
SBYTES (descrip));
item_data[j + SBYTES (descrip)] = 0;
+#endif
}
else
item_data = SDATA (item_name);
@@ -3843,9 +3806,8 @@ syms_of_xmenu ()
defsubr (&Smenu_or_popup_active_p);
#if defined (USE_GTK) || defined (USE_X_TOOLKIT)
- defsubr (&Sx_menu_bar_open_internal);
- Ffset (intern ("accelerate-menu"),
- intern (Sx_menu_bar_open_internal.symbol_name));
+ defsubr (&Smenu_bar_open);
+ Ffset (intern ("accelerate-menu"), intern (Smenu_bar_open.symbol_name));
#endif
#ifdef HAVE_MENUS
diff --git a/src/xrdb.c b/src/xrdb.c
index 79f1da81a4..a1dc47c0b0 100644
--- a/src/xrdb.c
+++ b/src/xrdb.c
@@ -610,6 +610,29 @@ x_load_resources (display, xrm_string, myname, myclass)
#endif /* not USE_MOTIF */
+#ifdef HAVE_X_I18N
+ {
+#ifdef USE_MOTIF
+ Bool motif = True;
+#else /* not USE_MOTIF */
+ Bool motif = False;
+#endif /* not USE_MOTIF */
+ /* Setup the default fontSet resource. */
+ extern char *xic_create_fontsetname P_ ((char *base_fontname, Bool motif));
+ char *fontsetname = xic_create_fontsetname (helv, motif);
+ int len = strlen (fontsetname);
+ char *buf = line;
+
+ /* fontsetname may be very long. */
+ if (len + 16 > 256)
+ buf = alloca (len + 16);
+ sprintf (buf, "Emacs*fontSet: %s", fontsetname);
+ XrmPutLineResource (&rdb, buf);
+ if (fontsetname != helv)
+ xfree (fontsetname);
+ }
+#endif /* HAVE_X_I18N */
+
user_database = get_user_db (display);
/* Figure out what the "customization string" is, so we can use it
diff --git a/src/xselect.c b/src/xselect.c
index d71ac42aa7..33468f0d63 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -398,19 +398,12 @@ x_own_selection (selection_name, selection_value)
Lisp_Object selection_name, selection_value;
{
struct frame *sf = SELECTED_FRAME ();
- Window selecting_window;
- Display *display;
+ Window selecting_window = FRAME_X_WINDOW (sf);
+ Display *display = FRAME_X_DISPLAY (sf);
Time time = last_event_timestamp;
Atom selection_atom;
- struct x_display_info *dpyinfo;
-
- if (! FRAME_X_P (sf))
- return;
+ struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (sf);
- selecting_window = FRAME_X_WINDOW (sf);
- display = FRAME_X_DISPLAY (sf);
- dpyinfo = FRAME_X_DISPLAY_INFO (sf);
-
CHECK_SYMBOL (selection_name);
selection_atom = symbol_to_x_atom (dpyinfo, display, selection_name);
@@ -678,8 +671,7 @@ some_frame_on_display (dpyinfo)
FOR_EACH_FRAME (list, frame)
{
- if (FRAME_X_P (XFRAME (frame))
- && FRAME_X_DISPLAY_INFO (XFRAME (frame)) == dpyinfo)
+ if (FRAME_X_DISPLAY_INFO (XFRAME (frame)) == dpyinfo)
return frame;
}
@@ -691,10 +683,6 @@ some_frame_on_display (dpyinfo)
DATA and SIZE describe the data to send, already converted.
FORMAT is the unit-size (in bits) of the data to be transmitted. */
-#ifdef TRACE_SELECTION
-static int x_reply_selection_request_cnt;
-#endif /* TRACE_SELECTION */
-
static void
x_reply_selection_request (event, format, data, size, type)
struct input_event *event;
@@ -733,9 +721,10 @@ x_reply_selection_request (event, format, data, size, type)
#ifdef TRACE_SELECTION
{
+ static int cnt;
char *sel = XGetAtomName (display, reply.selection);
char *tgt = XGetAtomName (display, reply.target);
- TRACE3 ("%s, target %s (%d)", sel, tgt, ++x_reply_selection_request_cnt);
+ TRACE3 ("%s, target %s (%d)", sel, tgt, ++cnt);
if (sel) XFree (sel);
if (tgt) XFree (tgt);
}
@@ -1025,7 +1014,6 @@ x_handle_selection_clear (event)
TRACE0 ("x_handle_selection_clear");
-#ifdef MULTI_KBOARD
/* If the new selection owner is also Emacs,
don't clear the new selection. */
BLOCK_INPUT;
@@ -1033,7 +1021,7 @@ x_handle_selection_clear (event)
to see if this Emacs job now owns the selection
through that display. */
for (t_dpyinfo = x_display_list; t_dpyinfo; t_dpyinfo = t_dpyinfo->next)
- if (t_dpyinfo->terminal->kboard == dpyinfo->terminal->kboard)
+ if (t_dpyinfo->kboard == dpyinfo->kboard)
{
Window owner_window
= XGetSelectionOwner (t_dpyinfo->display, selection);
@@ -1044,8 +1032,7 @@ x_handle_selection_clear (event)
}
}
UNBLOCK_INPUT;
-#endif
-
+
selection_symbol = x_atom_to_symbol (display, selection);
local_selection_data = assq_no_quit (selection_symbol, Vselection_alist);
@@ -1393,26 +1380,17 @@ x_get_foreign_selection (selection_symbol, target_type, time_stamp)
Lisp_Object selection_symbol, target_type, time_stamp;
{
struct frame *sf = SELECTED_FRAME ();
- Window requestor_window;
- Display *display;
- struct x_display_info *dpyinfo;
+ Window requestor_window = FRAME_X_WINDOW (sf);
+ Display *display = FRAME_X_DISPLAY (sf);
+ struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (sf);
Time requestor_time = last_event_timestamp;
- Atom target_property;
- Atom selection_atom;
+ Atom target_property = dpyinfo->Xatom_EMACS_TMP;
+ Atom selection_atom = symbol_to_x_atom (dpyinfo, display, selection_symbol);
Atom type_atom;
int secs, usecs;
int count = SPECPDL_INDEX ();
Lisp_Object frame;
- if (! FRAME_X_P (sf))
- return Qnil;
-
- requestor_window = FRAME_X_WINDOW (sf);
- display = FRAME_X_DISPLAY (sf);
- dpyinfo = FRAME_X_DISPLAY_INFO (sf);
- target_property = dpyinfo->Xatom_EMACS_TMP;
- selection_atom = symbol_to_x_atom (dpyinfo, display, selection_symbol);
-
if (CONSP (target_type))
type_atom = symbol_to_x_atom (dpyinfo, display, XCAR (target_type));
else
@@ -2228,9 +2206,6 @@ Disowning it means there is no such selection. */)
struct frame *sf = SELECTED_FRAME ();
check_x ();
- if (! FRAME_X_P (sf))
- return Qnil;
-
display = FRAME_X_DISPLAY (sf);
dpyinfo = FRAME_X_DISPLAY_INFO (sf);
CHECK_SYMBOL (selection);
@@ -2392,10 +2367,6 @@ DEFUN ("x-get-cut-buffer-internal", Fx_get_cut_buffer_internal,
struct frame *sf = SELECTED_FRAME ();
check_x ();
-
- if (! FRAME_X_P (sf))
- return Qnil;
-
display = FRAME_X_DISPLAY (sf);
dpyinfo = FRAME_X_DISPLAY_INFO (sf);
window = RootWindow (display, 0); /* Cut buffers are on screen 0 */
@@ -2436,10 +2407,6 @@ DEFUN ("x-store-cut-buffer-internal", Fx_store_cut_buffer_internal,
struct frame *sf = SELECTED_FRAME ();
check_x ();
-
- if (! FRAME_X_P (sf))
- return Qnil;
-
display = FRAME_X_DISPLAY (sf);
window = RootWindow (display, 0); /* Cut buffers are on screen 0 */
@@ -2496,12 +2463,8 @@ Positive means shift the values forward, negative means backward. */)
Atom props[8];
Display *display;
struct frame *sf = SELECTED_FRAME ();
-
- check_x ();
-
- if (! FRAME_X_P (sf))
- return Qnil;
+ check_x ();
display = FRAME_X_DISPLAY (sf);
window = RootWindow (display, 0); /* Cut buffers are on screen 0 */
CHECK_NUMBER (n);
diff --git a/src/xsmfns.c b/src/xsmfns.c
index 77abf3b507..1211c55eb0 100644
--- a/src/xsmfns.c
+++ b/src/xsmfns.c
@@ -48,7 +48,6 @@ Boston, MA 02110-1301, USA. */
#include "lisp.h"
#include "systime.h"
#include "sysselect.h"
-#include "frame.h"
#include "termhooks.h"
#include "termopts.h"
#include "xterm.h"
@@ -511,14 +510,6 @@ x_session_initialize (dpyinfo)
}
}
-/* Ensure that the session manager is not contacted again. */
-
-void
-x_session_close ()
-{
- ice_fd = -1;
-}
-
DEFUN ("handle-save-session", Fhandle_save_session,
Shandle_save_session, 1, 1, "e",
diff --git a/src/xterm.c b/src/xterm.c
index 5a5d4e42d8..ca2e16398d 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -54,6 +54,7 @@ Boston, MA 02110-1301, USA. */
#include <sys/ioctl.h>
#endif /* ! defined (BSD_SYSTEM) */
+#include "systty.h"
#include "systime.h"
#ifndef INCLUDED_FCNTL
@@ -67,6 +68,7 @@ Boston, MA 02110-1301, USA. */
/* #include <sys/param.h> */
#include "charset.h"
+#include "character.h"
#include "coding.h"
#include "ccl.h"
#include "frame.h"
@@ -100,6 +102,10 @@ Boston, MA 02110-1301, USA. */
#include "gtkutil.h"
#endif
+#ifdef USE_FONT_BACKEND
+#include "font.h"
+#endif /* USE_FONT_BACKEND */
+
#ifdef USE_LUCID
extern int xlwmenu_window_p P_ ((Widget w, Window window));
extern void xlwmenu_redisplay P_ ((Widget));
@@ -154,6 +160,8 @@ extern void _XEditResCheckMessages ();
#endif
#endif
+#define abs(x) ((x) < 0 ? -(x) : (x))
+
/* Default to using XIM if available. */
#ifdef USE_XIM
int use_xim = 1;
@@ -319,10 +327,6 @@ static Lisp_Object Qalt, Qhyper, Qmeta, Qsuper, Qmodifier_value;
static Lisp_Object Qvendor_specific_keysyms;
static Lisp_Object Qlatin_1;
-/* Used in x_flush. */
-
-extern Lisp_Object Vinhibit_redisplay;
-
extern XrmDatabase x_load_resources P_ ((Display *, char *, char *, char *));
extern int x_bitmap_mask P_ ((FRAME_PTR, int));
@@ -332,15 +336,13 @@ static const XColor *x_color_cells P_ ((Display *, int *));
static void x_update_window_end P_ ((struct window *, int, int));
static int x_io_error_quitter P_ ((Display *));
-static struct terminal *x_create_terminal P_ ((struct x_display_info *));
-void x_delete_terminal P_ ((struct terminal *));
static void x_font_min_bounds P_ ((XFontStruct *, int *, int *));
static int x_compute_min_glyph_bounds P_ ((struct frame *));
static void x_update_end P_ ((struct frame *));
static void XTframe_up_to_date P_ ((struct frame *));
-static void XTset_terminal_modes P_ ((struct terminal *));
-static void XTreset_terminal_modes P_ ((struct terminal *));
-static void x_clear_frame P_ ((struct frame *));
+static void XTset_terminal_modes P_ ((void));
+static void XTreset_terminal_modes P_ ((void));
+static void x_clear_frame P_ ((void));
static void frame_highlight P_ ((struct frame *));
static void frame_unhighlight P_ ((struct frame *));
static void x_new_focus_frame P_ ((struct x_display_info *, struct frame *));
@@ -380,18 +382,12 @@ static void
x_flush (f)
struct frame *f;
{
- /* Don't call XFlush when it is not safe to redisplay; the X
- connection may be broken. */
- if (!NILP (Vinhibit_redisplay))
- return;
-
BLOCK_INPUT;
if (f == NULL)
{
Lisp_Object rest, frame;
FOR_EACH_FRAME (rest, frame)
- if (FRAME_X_P (XFRAME (frame)))
- x_flush (XFRAME (frame));
+ x_flush (XFRAME (frame));
}
else if (FRAME_X_P (f))
XFlush (FRAME_X_DISPLAY (f));
@@ -852,7 +848,7 @@ x_draw_fringe_bitmap (w, row, p)
rarely happens). */
static void
-XTset_terminal_modes (struct terminal *terminal)
+XTset_terminal_modes ()
{
}
@@ -860,7 +856,7 @@ XTset_terminal_modes (struct terminal *terminal)
the X-windows go away, and suspending requires no action. */
static void
-XTreset_terminal_modes (struct terminal *terminal)
+XTreset_terminal_modes ()
{
}
@@ -872,7 +868,8 @@ XTreset_terminal_modes (struct terminal *terminal)
/* Function prototypes of this page. */
-static int x_encode_char P_ ((int, XChar2b *, struct font_info *, int *));
+static int x_encode_char P_ ((int, XChar2b *, struct font_info *,
+ struct charset *, int *));
/* Get metrics of character CHAR2B in FONT. Value is null if CHAR2B
@@ -951,13 +948,13 @@ x_per_char_metric (font, char2b, font_type)
the two-byte form of C. Encoding is returned in *CHAR2B. */
static int
-x_encode_char (c, char2b, font_info, two_byte_p)
+x_encode_char (c, char2b, font_info, charset, two_byte_p)
int c;
XChar2b *char2b;
struct font_info *font_info;
+ struct charset *charset;
int *two_byte_p;
{
- int charset = CHAR_CHARSET (c);
XFontStruct *font = font_info->font;
/* FONT_INFO may define a scheme by which to encode byte1 and byte2.
@@ -971,31 +968,31 @@ x_encode_char (c, char2b, font_info, two_byte_p)
check_ccl_update (ccl);
if (CHARSET_DIMENSION (charset) == 1)
{
- ccl->reg[0] = charset;
+ ccl->reg[0] = CHARSET_ID (charset);
ccl->reg[1] = char2b->byte2;
ccl->reg[2] = -1;
}
else
{
- ccl->reg[0] = charset;
+ ccl->reg[0] = CHARSET_ID (charset);
ccl->reg[1] = char2b->byte1;
ccl->reg[2] = char2b->byte2;
}
- ccl_driver (ccl, NULL, NULL, 0, 0, NULL);
+ ccl_driver (ccl, NULL, NULL, 0, 0, Qnil);
/* We assume that MSBs are appropriately set/reset by CCL
program. */
if (font->max_byte1 == 0) /* 1-byte font */
- char2b->byte1 = 0, char2b->byte2 = ccl->reg[1];
+ STORE_XCHAR2B (char2b, 0, ccl->reg[1]);
else
- char2b->byte1 = ccl->reg[1], char2b->byte2 = ccl->reg[2];
+ STORE_XCHAR2B (char2b, ccl->reg[1], ccl->reg[2]);
}
- else if (font_info->encoding[charset])
+ else if (font_info->encoding_type)
{
/* Fixed encoding scheme. See fontset.h for the meaning of the
encoding numbers. */
- int enc = font_info->encoding[charset];
+ unsigned char enc = font_info->encoding_type;
if ((enc == 1 || enc == 2)
&& CHARSET_DIMENSION (charset) == 2)
@@ -1123,15 +1120,20 @@ x_set_mouse_face_gc (s)
face = FACE_FROM_ID (s->f, MOUSE_FACE_ID);
if (s->first_glyph->type == CHAR_GLYPH)
- face_id = FACE_FOR_CHAR (s->f, face, s->first_glyph->u.ch);
+ face_id = FACE_FOR_CHAR (s->f, face, s->first_glyph->u.ch, -1, Qnil);
else
- face_id = FACE_FOR_CHAR (s->f, face, 0);
+ face_id = FACE_FOR_CHAR (s->f, face, 0, -1, Qnil);
s->face = FACE_FROM_ID (s->f, face_id);
PREPARE_FACE_FOR_DISPLAY (s->f, s->face);
/* If font in this face is same as S->font, use it. */
if (s->font == s->face->font)
s->gc = s->face->gc;
+#ifdef USE_FONT_BACKEND
+ else if (enable_font_backend)
+ /* No need of setting a font for s->gc. */
+ s->gc = s->face->gc;
+#endif /* USE_FONT_BACKEND */
else
{
/* Otherwise construct scratch_cursor_gc with values from FACE
@@ -1226,15 +1228,60 @@ static INLINE void
x_set_glyph_string_clipping (s)
struct glyph_string *s;
{
+#ifdef USE_FONT_BACKEND
+ XRectangle *r = s->clip;
+#else
+ XRectangle r[2];
+#endif
+ int n = get_glyph_string_clip_rects (s, r, 2);
+
+ if (n > 0)
+ XSetClipRectangles (s->display, s->gc, 0, 0, r, n, Unsorted);
+#ifdef USE_FONT_BACKEND
+ s->num_clips = n;
+#endif
+}
+
+
+/* Set SRC's clipping for output of glyph string DST. This is called
+ when we are drawing DST's left_overhang or right_overhang only in
+ the area of SRC. */
+
+static void
+x_set_glyph_string_clipping_exactly (src, dst)
+ struct glyph_string *src, *dst;
+{
XRectangle r;
- get_glyph_string_clip_rect (s, &r);
- XSetClipRectangles (s->display, s->gc, 0, 0, &r, 1, Unsorted);
+
+#ifdef USE_FONT_BACKEND
+ if (enable_font_backend)
+ {
+ r.x = src->x;
+ r.width = src->width;
+ r.y = src->y;
+ r.height = src->height;
+ dst->clip[0] = r;
+ dst->num_clips = 1;
+ }
+ else
+ {
+#endif /* USE_FONT_BACKEND */
+ struct glyph_string *clip_head = src->clip_head;
+ struct glyph_string *clip_tail = src->clip_tail;
+
+ /* This foces clipping just this glyph string. */
+ src->clip_head = src->clip_tail = src;
+ get_glyph_string_clip_rect (src, &r);
+ src->clip_head = clip_head, src->clip_tail = clip_tail;
+#ifdef USE_FONT_BACKEND
+ }
+#endif /* USE_FONT_BACKEND */
+ XSetClipRectangles (dst->display, dst->gc, 0, 0, &r, 1, Unsorted);
}
/* RIF:
- Compute left and right overhang of glyph string S. If S is a glyph
- string for a composition, assume overhangs don't exist. */
+ Compute left and right overhang of glyph string S. */
static void
x_compute_glyph_string_overhangs (s)
@@ -1245,11 +1292,34 @@ x_compute_glyph_string_overhangs (s)
{
XCharStruct cs;
int direction, font_ascent, font_descent;
+
+#ifdef USE_FONT_BACKEND
+ if (enable_font_backend)
+ {
+ unsigned *code = alloca (sizeof (unsigned) * s->nchars);
+ struct font *font = (struct font *) s->font_info;
+ struct font_metrics metrics;
+ int i;
+
+ for (i = 0; i < s->nchars; i++)
+ code[i] = (s->char2b[i].byte1 << 8) | s->char2b[i].byte2;
+ font->driver->text_extents (font, code, s->nchars, &metrics);
+ cs.rbearing = metrics.rbearing;
+ cs.lbearing = metrics.lbearing;
+ cs.width = metrics.width;
+ }
+ else
+#endif /* USE_FONT_BACKEND */
XTextExtents16 (s->font, s->char2b, s->nchars, &direction,
&font_ascent, &font_descent, &cs);
s->right_overhang = cs.rbearing > cs.width ? cs.rbearing - cs.width : 0;
s->left_overhang = cs.lbearing < 0 ? -cs.lbearing : 0;
}
+ else if (s->cmp)
+ {
+ s->right_overhang = s->cmp->rbearing - s->cmp->pixel_width;
+ s->left_overhang = - s->cmp->lbearing;
+ }
}
@@ -1339,6 +1409,26 @@ x_draw_glyph_string_foreground (s)
x += g->pixel_width;
}
}
+#ifdef USE_FONT_BACKEND
+ else if (enable_font_backend)
+ {
+ int boff = s->font_info->baseline_offset;
+ struct font *font = (struct font *) s->font_info;
+ int y;
+
+ if (s->font_info->vertical_centering)
+ boff = VCENTER_BASELINE_OFFSET (s->font, s->f) - boff;
+
+ y = s->ybase - boff;
+ if (s->for_overlaps
+ || (s->background_filled_p && s->hl != DRAW_CURSOR))
+ font->driver->draw (s, 0, s->nchars, x, y, 0);
+ else
+ font->driver->draw (s, 0, s->nchars, x, y, 1);
+ if (s->face->overstrike)
+ font->driver->draw (s, 0, s->nchars, x + 1, y, 0);
+ }
+#endif /* USE_FONT_BACKEND */
else
{
char *char1b = (char *) s->char2b;
@@ -1398,11 +1488,11 @@ static void
x_draw_composite_glyph_string_foreground (s)
struct glyph_string *s;
{
- int i, x;
+ int i, j, x;
/* If first glyph of S has a left box line, start drawing the text
of S to the right of that box line. */
- if (s->face->box != FACE_NO_BOX
+ if (s->face && s->face->box != FACE_NO_BOX
&& s->first_glyph->left_box_line_p)
x = s->x + abs (s->face->box_line_width);
else
@@ -1421,21 +1511,79 @@ x_draw_composite_glyph_string_foreground (s)
XDrawRectangle (s->display, s->window, s->gc, x, s->y,
s->width - 1, s->height - 1);
}
- else
+#ifdef USE_FONT_BACKEND
+ else if (enable_font_backend)
{
- for (i = 0; i < s->nchars; i++, ++s->gidx)
+ struct font *font = (struct font *) s->font_info;
+ int y = s->ybase;
+ int width = 0;
+
+ if (s->cmp->method == COMPOSITION_WITH_GLYPH_STRING)
{
- XDrawString16 (s->display, s->window, s->gc,
- x + s->cmp->offsets[s->gidx * 2],
- s->ybase - s->cmp->offsets[s->gidx * 2 + 1],
- s->char2b + i, 1);
- if (s->face->overstrike)
- XDrawString16 (s->display, s->window, s->gc,
- x + s->cmp->offsets[s->gidx * 2] + 1,
- s->ybase - s->cmp->offsets[s->gidx * 2 + 1],
- s->char2b + i, 1);
+ Lisp_Object gstring = AREF (XHASH_TABLE (composition_hash_table)
+ ->key_and_value,
+ s->cmp->hash_index * 2);
+ int from;
+
+ for (i = from = 0; i < s->nchars; i++)
+ {
+ Lisp_Object g = LGSTRING_GLYPH (gstring, i);
+ Lisp_Object adjustment = LGLYPH_ADJUSTMENT (g);
+ int xoff, yoff, wadjust;
+
+ if (! VECTORP (adjustment))
+ {
+ width += XINT (LGLYPH_WIDTH (g));
+ continue;
+ }
+ if (from < i)
+ {
+ font->driver->draw (s, from, i, x, y, 0);
+ x += width;
+ }
+ xoff = XINT (AREF (adjustment, 0));
+ yoff = XINT (AREF (adjustment, 1));
+ wadjust = XINT (AREF (adjustment, 2));
+
+ font->driver->draw (s, i, i + 1, x + xoff, y + yoff, 0);
+ x += XINT (LGLYPH_WIDTH (g)) + wadjust;
+ from = i + 1;
+ width = 0;
+ }
+ if (from < i)
+ font->driver->draw (s, from, i, x, y, 0);
+ }
+ else
+ {
+ for (i = 0, j = s->gidx; i < s->nchars; i++, j++)
+ if (COMPOSITION_GLYPH (s->cmp, j) != '\t')
+ {
+ int xx = x + s->cmp->offsets[j * 2];
+ int yy = y - s->cmp->offsets[j * 2 + 1];
+
+ font->driver->draw (s, j, j + 1, xx, yy, 0);
+ if (s->face->overstrike)
+ font->driver->draw (s, j, j + 1, xx + 1, yy, 0);
+ }
}
}
+#endif /* USE_FONT_BACKEND */
+ else
+ {
+ for (i = 0, j = s->gidx; i < s->nchars; i++, j++)
+ if (s->face)
+ {
+ XDrawString16 (s->display, s->window, s->gc,
+ x + s->cmp->offsets[j * 2],
+ s->ybase - s->cmp->offsets[j * 2 + 1],
+ s->char2b + j, 1);
+ if (s->face->overstrike)
+ XDrawString16 (s->display, s->window, s->gc,
+ x + s->cmp->offsets[j * 2] + 1,
+ s->ybase - s->cmp->offsets[j * 2 + 1],
+ s->char2b + j, 1);
+ }
+ }
}
@@ -1470,11 +1618,10 @@ x_frame_of_widget (widget)
/* Look for a frame with that top-level widget. Allocate the color
on that frame to get the right gamma correction value. */
- for (tail = Vframe_list; GC_CONSP (tail); tail = XCDR (tail))
- if (GC_FRAMEP (XCAR (tail))
+ for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
+ if (FRAMEP (XCAR (tail))
&& (f = XFRAME (XCAR (tail)),
- (FRAME_X_P (f)
- && f->output_data.nothing != 1
+ (f->output_data.nothing != 1
&& FRAME_X_DISPLAY_INFO (f) == dpyinfo))
&& f->output_data.x->widget == widget)
return f;
@@ -2683,15 +2830,25 @@ x_draw_glyph_string (s)
{
int relief_drawn_p = 0;
- /* If S draws into the background of its successor, draw the
- background of the successor first so that S can draw into it.
+ /* If S draws into the background of its successors, draw the
+ background of the successors first so that S can draw into it.
This makes S->next use XDrawString instead of XDrawImageString. */
if (s->next && s->right_overhang && !s->for_overlaps)
{
- xassert (s->next->img == NULL);
- x_set_glyph_string_gc (s->next);
- x_set_glyph_string_clipping (s->next);
- x_draw_glyph_string_background (s->next, 1);
+ int width;
+ struct glyph_string *next;
+
+ for (width = 0, next = s->next; next;
+ width += next->width, next = next->next)
+ if (next->first_glyph->type != IMAGE_GLYPH)
+ {
+ x_set_glyph_string_gc (next);
+ x_set_glyph_string_clipping (next);
+ x_draw_glyph_string_background (next, 1);
+#ifdef USE_FONT_BACKEND
+ next->num_clips = 0;
+#endif /* USE_FONT_BACKEND */
+ }
}
/* Set up S->gc, set clipping and draw S. */
@@ -2711,6 +2868,12 @@ x_draw_glyph_string (s)
x_set_glyph_string_clipping (s);
relief_drawn_p = 1;
}
+ else if ((s->prev && s->prev->hl != s->hl && s->left_overhang)
+ || (s->next && s->next->hl != s->hl && s->right_overhang))
+ /* We must clip just this glyph. left_overhang part has already
+ drawn when s->prev was drawn, and right_overhang part will be
+ drawn later when s->next is drawn. */
+ x_set_glyph_string_clipping_exactly (s, s);
else
x_set_glyph_string_clipping (s);
@@ -2753,26 +2916,45 @@ x_draw_glyph_string (s)
int y;
/* Get the underline thickness. Default is 1 pixel. */
+#ifdef USE_FONT_BACKEND
+ if (enable_font_backend)
+ /* In the future, we must use information of font. */
+ h = 1;
+ else
+#endif /* USE_FONT_BACKEND */
if (!XGetFontProperty (s->font, XA_UNDERLINE_THICKNESS, &h))
h = 1;
- y = s->y + s->height - h;
- if (!x_underline_at_descent_line)
- {
- /* Get the underline position. This is the recommended
- vertical offset in pixels from the baseline to the top of
- the underline. This is a signed value according to the
- specs, and its default is
-
- ROUND ((maximum descent) / 2), with
- ROUND(x) = floor (x + 0.5) */
-
- if (x_use_underline_position_properties
- && XGetFontProperty (s->font, XA_UNDERLINE_POSITION, &tem))
- y = s->ybase + (long) tem;
- else if (s->face->font)
- y = s->ybase + (s->face->font->max_bounds.descent + 1) / 2;
- }
+#ifdef USE_FONT_BACKEND
+ if (enable_font_backend)
+ {
+ if (s->face->font)
+ /* In the future, we must use information of font. */
+ y = s->ybase + (s->face->font->max_bounds.descent + 1) / 2;
+ else
+ y = s->y + s->height - h;
+ }
+ else
+#endif
+ {
+ y = s->y + s->height - h;
+ if (!x_underline_at_descent_line)
+ {
+ /* Get the underline position. This is the recommended
+ vertical offset in pixels from the baseline to the top of
+ the underline. This is a signed value according to the
+ specs, and its default is
+
+ ROUND ((maximum descent) / 2), with
+ ROUND(x) = floor (x + 0.5) */
+
+ if (x_use_underline_position_properties
+ && XGetFontProperty (s->font, XA_UNDERLINE_POSITION, &tem))
+ y = s->ybase + (long) tem;
+ else if (s->face->font)
+ y = s->ybase + (s->face->font->max_bounds.descent + 1) / 2;
+ }
+ }
if (s->face->underline_defaulted_p)
XFillRectangle (s->display, s->window, s->gc,
@@ -2830,10 +3012,67 @@ x_draw_glyph_string (s)
/* Draw relief if not yet drawn. */
if (!relief_drawn_p && s->face->box != FACE_NO_BOX)
x_draw_glyph_string_box (s);
+
+ if (s->prev)
+ {
+ struct glyph_string *prev;
+
+ for (prev = s->prev; prev; prev = prev->prev)
+ if (prev->hl != s->hl
+ && prev->x + prev->width + prev->right_overhang > s->x)
+ {
+ /* As prev was drawn while clipped to its own area, we
+ must draw the right_overhang part using s->hl now. */
+ enum draw_glyphs_face save = prev->hl;
+
+ prev->hl = s->hl;
+ x_set_glyph_string_gc (prev);
+ x_set_glyph_string_clipping_exactly (s, prev);
+ if (prev->first_glyph->type == CHAR_GLYPH)
+ x_draw_glyph_string_foreground (prev);
+ else
+ x_draw_composite_glyph_string_foreground (prev);
+ XSetClipMask (prev->display, prev->gc, None);
+ prev->hl = save;
+#ifdef USE_FONT_BACKEND
+ prev->num_clips = 0;
+#endif /* USE_FONT_BACKEND */
+ }
+ }
+
+ if (s->next)
+ {
+ struct glyph_string *next;
+
+ for (next = s->next; next; next = next->next)
+ if (next->hl != s->hl
+ && next->x - next->left_overhang < s->x + s->width)
+ {
+ /* As next will be drawn while clipped to its own area,
+ we must draw the left_overhang part using s->hl now. */
+ enum draw_glyphs_face save = next->hl;
+
+ next->hl = s->hl;
+ x_set_glyph_string_gc (next);
+ x_set_glyph_string_clipping_exactly (s, next);
+ if (next->first_glyph->type == CHAR_GLYPH)
+ x_draw_glyph_string_foreground (next);
+ else
+ x_draw_composite_glyph_string_foreground (next);
+ XSetClipMask (next->display, next->gc, None);
+ next->hl = save;
+#ifdef USE_FONT_BACKEND
+ next->num_clips = 0;
+#endif /* USE_FONT_BACKEND */
+ }
+ }
}
/* Reset clipping. */
XSetClipMask (s->display, s->gc, None);
+#ifdef USE_FONT_BACKEND
+ s->num_clips = 0;
+#endif /* USE_FONT_BACKEND */
}
/* Shift display to make room for inserted glyphs. */
@@ -2853,8 +3092,7 @@ x_shift_glyphs_for_insert (f, x, y, width, height, shift_by)
for X frames. */
static void
-x_delete_glyphs (f, n)
- struct frame *f;
+x_delete_glyphs (n)
register int n;
{
abort ();
@@ -2877,11 +3115,19 @@ x_clear_area (dpy, window, x, y, width, height, exposures)
}
-/* Clear an entire frame. */
+/* Clear entire frame. If updating_frame is non-null, clear that
+ frame. Otherwise clear the selected frame. */
static void
-x_clear_frame (struct frame *f)
+x_clear_frame ()
{
+ struct frame *f;
+
+ if (updating_frame)
+ f = updating_frame;
+ else
+ f = SELECTED_FRAME ();
+
/* Clearing the frame will erase any cursor, so mark them all as no
longer visible. */
mark_window_cursors_off (XWINDOW (FRAME_ROOT_WINDOW (f)));
@@ -2960,8 +3206,8 @@ XTflash (f)
XGCValues values;
values.function = GXxor;
- values.foreground = (FRAME_FOREGROUND_PIXEL (f)
- ^ FRAME_BACKGROUND_PIXEL (f));
+ values.foreground = (f->output_data.x->foreground_pixel
+ ^ f->output_data.x->background_pixel);
gc = XCreateGC (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
GCFunction | GCForeground, &values);
@@ -3127,8 +3373,7 @@ XTset_terminal_window (n)
lines or deleting -N lines at vertical position VPOS. */
static void
-x_ins_del_lines (f, vpos, n)
- struct frame *f;
+x_ins_del_lines (vpos, n)
int vpos, n;
{
abort ();
@@ -3286,9 +3531,9 @@ x_focus_changed (type, state, dpyinfo, frame, bufp)
/* Don't stop displaying the initial startup message
for a switch-frame event we don't need. */
- if (GC_NILP (Vterminal_frame)
- && GC_CONSP (Vframe_list)
- && !GC_NILP (XCDR (Vframe_list)))
+ if (NILP (Vterminal_frame)
+ && CONSP (Vframe_list)
+ && !NILP (XCDR (Vframe_list)))
{
bufp->kind = FOCUS_IN_EVENT;
XSETFRAME (bufp->frame_or_window, frame);
@@ -3398,7 +3643,7 @@ x_frame_rehighlight (dpyinfo)
if (dpyinfo->x_focus_frame)
{
dpyinfo->x_highlight_frame
- = ((GC_FRAMEP (FRAME_FOCUS_FRAME (dpyinfo->x_focus_frame)))
+ = ((FRAMEP (FRAME_FOCUS_FRAME (dpyinfo->x_focus_frame)))
? XFRAME (FRAME_FOCUS_FRAME (dpyinfo->x_focus_frame))
: dpyinfo->x_focus_frame);
if (! FRAME_LIVE_P (dpyinfo->x_highlight_frame))
@@ -3765,8 +4010,7 @@ XTmouse_position (fp, insist, bar_window, part, x, y, time)
/* Clear the mouse-moved flag for every frame on this display. */
FOR_EACH_FRAME (tail, frame)
- if (FRAME_X_P (XFRAME (frame))
- && FRAME_X_DISPLAY (XFRAME (frame)) == FRAME_X_DISPLAY (*fp))
+ if (FRAME_X_DISPLAY (XFRAME (frame)) == FRAME_X_DISPLAY (*fp))
XFRAME (frame)->mouse_moved = 0;
last_mouse_scroll_bar = Qnil;
@@ -3944,29 +4188,24 @@ x_window_to_scroll_bar (display, window_id)
window_id = (Window) xg_get_scroll_id_for_window (display, window_id);
#endif /* USE_GTK && USE_TOOLKIT_SCROLL_BARS */
- for (tail = Vframe_list;
- XGCTYPE (tail) == Lisp_Cons;
- tail = XCDR (tail))
+ for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
{
Lisp_Object frame, bar, condemned;
frame = XCAR (tail);
/* All elements of Vframe_list should be frames. */
- if (! GC_FRAMEP (frame))
+ if (! FRAMEP (frame))
abort ();
- if (! FRAME_X_P (XFRAME (frame)))
- continue;
-
/* Scan this frame's scroll bar list for a scroll bar with the
right window ID. */
condemned = FRAME_CONDEMNED_SCROLL_BARS (XFRAME (frame));
for (bar = FRAME_SCROLL_BARS (XFRAME (frame));
/* This trick allows us to search both the ordinary and
condemned scroll bar lists with one loop. */
- ! GC_NILP (bar) || (bar = condemned,
+ ! NILP (bar) || (bar = condemned,
condemned = Qnil,
- ! GC_NILP (bar));
+ ! NILP (bar));
bar = XSCROLL_BAR (bar)->next)
if (SCROLL_BAR_X_WINDOW (XSCROLL_BAR (bar)) == window_id &&
FRAME_X_DISPLAY (XFRAME (frame)) == display)
@@ -3988,18 +4227,13 @@ x_window_to_menu_bar (window)
{
Lisp_Object tail;
- for (tail = Vframe_list;
- XGCTYPE (tail) == Lisp_Cons;
- tail = XCDR (tail))
+ for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
{
- if (FRAME_X_P (XFRAME (XCAR (tail))))
- {
- Lisp_Object frame = XCAR (tail);
- Widget menu_bar = XFRAME (frame)->output_data.x->menubar_widget;
+ Lisp_Object frame = XCAR (tail);
+ Widget menu_bar = XFRAME (frame)->output_data.x->menubar_widget;
- if (menu_bar && xlwmenu_window_p (menu_bar, window))
- return menu_bar;
- }
+ if (menu_bar && xlwmenu_window_p (menu_bar, window))
+ return menu_bar;
}
return NULL;
@@ -4807,7 +5041,7 @@ x_scroll_bar_create (w, top, left, width, height)
a.background_pixel = f->output_data.x->scroll_bar_background_pixel;
if (a.background_pixel == -1)
- a.background_pixel = FRAME_BACKGROUND_PIXEL (f);
+ a.background_pixel = f->output_data.x->background_pixel;
a.event_mask = (ButtonPressMask | ButtonReleaseMask
| ButtonMotionMask | PointerMotionHintMask
@@ -4984,7 +5218,7 @@ x_scroll_bar_set_handle (bar, start, end, rebuild)
/* Restore the foreground color of the GC if we changed it above. */
if (f->output_data.x->scroll_bar_foreground_pixel != -1)
XSetForeground (FRAME_X_DISPLAY (f), gc,
- FRAME_FOREGROUND_PIXEL (f));
+ f->output_data.x->foreground_pixel);
/* Draw the empty space below the handle. Note that we can't
clear zero-height areas; that means "clear to end of window." */
@@ -5386,7 +5620,7 @@ x_scroll_bar_expose (bar, event)
/* Restore the foreground color of the GC if we changed it above. */
if (f->output_data.x->scroll_bar_foreground_pixel != -1)
XSetForeground (FRAME_X_DISPLAY (f), gc,
- FRAME_FOREGROUND_PIXEL (f));
+ f->output_data.x->foreground_pixel);
UNBLOCK_INPUT;
@@ -5406,7 +5640,7 @@ x_scroll_bar_handle_click (bar, event, emacs_event)
XEvent *event;
struct input_event *emacs_event;
{
- if (! GC_WINDOWP (bar->window))
+ if (! WINDOWP (bar->window))
abort ();
emacs_event->kind = SCROLL_BAR_CLICK_EVENT;
@@ -5501,7 +5735,7 @@ x_scroll_bar_note_movement (bar, event)
XSETVECTOR (last_mouse_scroll_bar, bar);
/* If we're dragging the bar, display it. */
- if (! GC_NILP (bar->dragging))
+ if (! NILP (bar->dragging))
{
/* Where should the handle be now? */
int new_start = event->xmotion.y - XINT (bar->dragging);
@@ -5786,7 +6020,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
int count = 0;
int do_help = 0;
int nbytes = 0;
- struct frame *f = NULL;
+ struct frame *f;
struct coding_system coding;
XEvent event = *eventp;
@@ -6362,75 +6596,48 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
bzero (&compose_status, sizeof (compose_status));
orig_keysym = keysym;
- /* Common for all keysym input events. */
- XSETFRAME (inev.ie.frame_or_window, f);
- inev.ie.modifiers
- = x_x_to_emacs_modifiers (FRAME_X_DISPLAY_INFO (f), modifiers);
- inev.ie.timestamp = event.xkey.time;
-
- /* First deal with keysyms which have defined
- translations to characters. */
- if (keysym >= 32 && keysym < 128)
- /* Avoid explicitly decoding each ASCII character. */
- {
- inev.ie.kind = ASCII_KEYSTROKE_EVENT;
- inev.ie.code = keysym;
+ /* Common for all keysym input events. */
+ XSETFRAME (inev.ie.frame_or_window, f);
+ inev.ie.modifiers
+ = x_x_to_emacs_modifiers (FRAME_X_DISPLAY_INFO (f), modifiers);
+ inev.ie.timestamp = event.xkey.time;
+
+ /* First deal with keysyms which have defined
+ translations to characters. */
+ if (keysym >= 32 && keysym < 128)
+ /* Avoid explicitly decoding each ASCII character. */
+ {
+ inev.ie.kind = ASCII_KEYSTROKE_EVENT;
+ inev.ie.code = keysym;
goto done_keysym;
}
- /* Keysyms directly mapped to supported Unicode characters. */
- if ((keysym >= 0x01000000 && keysym <= 0x010033ff)
- || (keysym >= 0x0100e000 && keysym <= 0x0100ffff))
+ /* Keysyms directly mapped to Unicode characters. */
+ if (keysym >= 0x01000000 && keysym <= 0x0110FFFF)
{
- int code = keysym & 0xFFFF, charset_id, c1, c2;
-
- if (code < 0x80)
- {
- inev.ie.kind = ASCII_KEYSTROKE_EVENT;
- inev.ie.code = code;
- }
- else if (code < 0x100)
- {
- if (code < 0xA0)
- charset_id = CHARSET_8_BIT_CONTROL;
- else
- charset_id = charset_latin_iso8859_1;
- inev.ie.kind = MULTIBYTE_CHAR_KEYSTROKE_EVENT;
- inev.ie.code = MAKE_CHAR (charset_id, code, 0);
- }
+ if (keysym < 0x01000080)
+ inev.ie.kind = ASCII_KEYSTROKE_EVENT;
else
- {
- if (code < 0x2500)
- charset_id = charset_mule_unicode_0100_24ff,
- code -= 0x100;
- else if (code < 0xE000)
- charset_id = charset_mule_unicode_2500_33ff,
- code -= 0x2500;
- else
- charset_id = charset_mule_unicode_e000_ffff,
- code -= 0xE000;
- c1 = (code / 96) + 32, c2 = (code % 96) + 32;
- inev.ie.kind = MULTIBYTE_CHAR_KEYSTROKE_EVENT;
- inev.ie.code = MAKE_CHAR (charset_id, c1, c2);
- }
+ inev.ie.kind = MULTIBYTE_CHAR_KEYSTROKE_EVENT;
+ inev.ie.code = keysym & 0xFFFFFF;
goto done_keysym;
}
/* Now non-ASCII. */
if (HASH_TABLE_P (Vx_keysym_table)
&& (NATNUMP (c = Fgethash (make_number (keysym),
- Vx_keysym_table,
- Qnil))))
- {
- inev.ie.kind = (SINGLE_BYTE_CHAR_P (XFASTINT (c))
- ? ASCII_KEYSTROKE_EVENT
- : MULTIBYTE_CHAR_KEYSTROKE_EVENT);
- inev.ie.code = XFASTINT (c);
- goto done_keysym;
- }
-
- /* Random non-modifier sorts of keysyms. */
- if (((keysym >= XK_BackSpace && keysym <= XK_Escape)
+ Vx_keysym_table,
+ Qnil))))
+ {
+ inev.ie.kind = (SINGLE_BYTE_CHAR_P (XFASTINT (c))
+ ? ASCII_KEYSTROKE_EVENT
+ : MULTIBYTE_CHAR_KEYSTROKE_EVENT);
+ inev.ie.code = XFASTINT (c);
+ goto done_keysym;
+ }
+
+ /* Random non-modifier sorts of keysyms. */
+ if (((keysym >= XK_BackSpace && keysym <= XK_Escape)
|| keysym == XK_Delete
#ifdef XK_ISO_Left_Tab
|| (keysym >= XK_ISO_Left_Tab
@@ -6525,54 +6732,54 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
register int c;
int nchars, len;
- /* The input should be decoded with `coding_system'
- which depends on which X*LookupString function
- we used just above and the locale. */
- setup_coding_system (coding_system, &coding);
- coding.src_multibyte = 0;
- coding.dst_multibyte = 1;
- /* The input is converted to events, thus we can't
- handle composition. Anyway, there's no XIM that
- gives us composition information. */
- coding.composing = COMPOSITION_DISABLED;
-
- if (nbytes > 0)
+ for (i = 0, nchars = 0; i < nbytes; i++)
+ {
+ if (ASCII_BYTE_P (copy_bufptr[i]))
+ nchars++;
+ STORE_KEYSYM_FOR_DEBUG (copy_bufptr[i]);
+ }
+
+ if (nchars < nbytes)
{
/* Decode the input data. */
int require;
unsigned char *p;
- for (i = 0; i < nbytes; i++)
- {
- STORE_KEYSYM_FOR_DEBUG (copy_bufptr[i]);
- }
-
- require = decoding_buffer_size (&coding, nbytes);
- p = (unsigned char *) alloca (require);
+ /* The input should be decoded with `coding_system'
+ which depends on which X*LookupString function
+ we used just above and the locale. */
+ setup_coding_system (coding_system, &coding);
+ coding.src_multibyte = 0;
+ coding.dst_multibyte = 1;
+ /* The input is converted to events, thus we can't
+ handle composition. Anyway, there's no XIM that
+ gives us composition information. */
+ coding.common_flags &= ~CODING_ANNOTATION_MASK;
+
+ require = MAX_MULTIBYTE_LENGTH * nbytes;
+ coding.destination = alloca (require);
+ coding.dst_bytes = require;
coding.mode |= CODING_MODE_LAST_BLOCK;
- /* We explicitly disable composition handling because
- key data should not contain any composition sequence. */
- coding.composing = COMPOSITION_DISABLED;
- decode_coding (&coding, copy_bufptr, p, nbytes, require);
+ decode_coding_c_string (&coding, copy_bufptr, nbytes, Qnil);
nbytes = coding.produced;
nchars = coding.produced_char;
- copy_bufptr = p;
+ copy_bufptr = coding.destination;
+ }
- /* Convert the input data to a sequence of
- character events. */
- for (i = 0; i < nbytes; i += len)
- {
- if (nchars == nbytes)
- c = copy_bufptr[i], len = 1;
- else
- c = STRING_CHAR_AND_LENGTH (copy_bufptr + i,
- nbytes - i, len);
- inev.ie.kind = (SINGLE_BYTE_CHAR_P (c)
- ? ASCII_KEYSTROKE_EVENT
- : MULTIBYTE_CHAR_KEYSTROKE_EVENT);
- inev.ie.code = c;
- kbd_buffer_store_event_hold (&inev.ie, hold_quit);
- }
+ /* Convert the input data to a sequence of
+ character events. */
+ for (i = 0; i < nbytes; i += len)
+ {
+ if (nchars == nbytes)
+ c = copy_bufptr[i], len = 1;
+ else
+ c = STRING_CHAR_AND_LENGTH (copy_bufptr + i,
+ nbytes - i, len);
+ inev.ie.kind = (SINGLE_BYTE_CHAR_P (c)
+ ? ASCII_KEYSTROKE_EVENT
+ : MULTIBYTE_CHAR_KEYSTROKE_EVENT);
+ inev.ie.code = c;
+ kbd_buffer_store_event_hold (&inev.ie, hold_quit);
}
/* Previous code updated count by nchars rather than nbytes,
@@ -6639,7 +6846,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
/* We may get an EnterNotify on the buttons in the toolbar. In that
case we moved out of any highlighted area and need to note this. */
if (!f && last_mouse_glyph_frame)
- note_mouse_movement (last_mouse_glyph_frame, &event.xmotion);
+ note_mouse_movement (last_mouse_glyph_frame, &event);
#endif
goto OTHER;
@@ -6672,7 +6879,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
#ifdef USE_GTK
/* See comment in EnterNotify above */
else if (last_mouse_glyph_frame)
- note_mouse_movement (last_mouse_glyph_frame, &event.xmotion);
+ note_mouse_movement (last_mouse_glyph_frame, &event);
#endif
goto OTHER;
@@ -6715,13 +6922,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
will be selected only when it is active. */
if (WINDOWP (window)
&& !EQ (window, last_window)
- && !EQ (window, selected_window)
- /* For click-to-focus window managers
- create event iff we don't leave the
- selected frame. */
- && (focus_follows_mouse
- || (EQ (XWINDOW (window)->frame,
- XWINDOW (selected_window)->frame))))
+ && !EQ (window, selected_window))
{
inev.ie.kind = SELECT_WINDOW_EVENT;
inev.ie.frame_or_window = window;
@@ -7081,8 +7282,8 @@ x_dispatch_event (event, display)
EXPECTED is nonzero if the caller knows input is available. */
static int
-XTread_socket (terminal, expected, hold_quit)
- struct terminal *terminal;
+XTread_socket (sd, expected, hold_quit)
+ register int sd;
int expected;
struct input_event *hold_quit;
{
@@ -7105,31 +7306,6 @@ XTread_socket (terminal, expected, hold_quit)
++handling_signal;
-#ifdef HAVE_X_SM
- /* Only check session manager input for the primary display. */
- if (terminal->id == 1 && x_session_have_connection ())
- {
- struct input_event inev;
- BLOCK_INPUT;
- /* We don't need to EVENT_INIT (inev) here, as
- x_session_check_input copies an entire input_event. */
- if (x_session_check_input (&inev))
- {
- kbd_buffer_store_event_hold (&inev, hold_quit);
- count++;
- }
- UNBLOCK_INPUT;
- }
-#endif
-
- /* For debugging, this gives a way to fake an I/O error. */
- if (terminal->display_info.x == XTread_socket_fake_io_error)
- {
- XTread_socket_fake_io_error = 0;
- x_io_error_quitter (dpyinfo->display);
- }
-
-#if 0 /* This loop is a noop now. */
/* Find the display we are supposed to read input for.
It's the one communicating on descriptor SD. */
for (dpyinfo = x_display_list; dpyinfo; dpyinfo = dpyinfo->next)
@@ -7160,31 +7336,52 @@ XTread_socket (terminal, expected, hold_quit)
#endif /* HAVE_SELECT */
#endif /* SIGIO */
#endif
- }
+
+ /* For debugging, this gives a way to fake an I/O error. */
+ if (dpyinfo == XTread_socket_fake_io_error)
+ {
+ XTread_socket_fake_io_error = 0;
+ x_io_error_quitter (dpyinfo->display);
+ }
+
+#ifdef HAVE_X_SM
+ {
+ struct input_event inev;
+ BLOCK_INPUT;
+ /* We don't need to EVENT_INIT (inev) here, as
+ x_session_check_input copies an entire input_event. */
+ if (x_session_check_input (&inev))
+ {
+ kbd_buffer_store_event_hold (&inev, hold_quit);
+ count++;
+ }
+ UNBLOCK_INPUT;
+ }
#endif
#ifndef USE_GTK
- while (XPending (terminal->display_info.x->display))
- {
- int finish;
+ while (XPending (dpyinfo->display))
+ {
+ int finish;
- XNextEvent (terminal->display_info.x->display, &event);
+ XNextEvent (dpyinfo->display, &event);
#ifdef HAVE_X_I18N
- /* Filter events for the current X input method. */
- if (x_filter_event (terminal->display_info.x, &event))
- break;
+ /* Filter events for the current X input method. */
+ if (x_filter_event (dpyinfo, &event))
+ break;
#endif
- event_found = 1;
+ event_found = 1;
- count += handle_one_xevent (terminal->display_info.x,
- &event, &finish, hold_quit);
+ count += handle_one_xevent (dpyinfo, &event, &finish, hold_quit);
- if (finish == X_EVENT_GOTO_OUT)
- goto out;
+ if (finish == X_EVENT_GOTO_OUT)
+ goto out;
+ }
+#endif /* not USE_GTK */
}
-#else /* USE_GTK */
+#ifdef USE_GTK
/* For GTK we must use the GTK event loop. But XEvents gets passed
to our filter function above, and then to the big event switch.
@@ -7495,7 +7692,8 @@ x_draw_window_cursor (w, glyph_row, x, y, cursor_type, cursor_width, on_p, activ
}
#ifndef XFlush
- XFlush (FRAME_X_DISPLAY (f));
+ if (updating_frame != f)
+ XFlush (FRAME_X_DISPLAY (f));
#endif
}
@@ -7733,8 +7931,6 @@ x_clear_errors (dpy)
x_error_message->string[0] = 0;
}
-#if 0 /* See comment in unwind_to_catch why calling this is a bad
- * idea. --lorentey */
/* Close off all unclosed x_catch_errors calls. */
void
@@ -7743,7 +7939,6 @@ x_fully_uncatch_errors ()
while (x_error_message)
x_uncatch_errors ();
}
-#endif
/* Nonzero if x_catch_errors has been done and not yet canceled. */
@@ -7809,7 +8004,6 @@ x_connection_closed (dpy, error_message)
{
struct x_display_info *dpyinfo = x_display_info_for_display (dpy);
Lisp_Object frame, tail;
- int index = SPECPDL_INDEX ();
error_msg = (char *) alloca (strlen (error_message) + 1);
strcpy (error_msg, error_message);
@@ -7821,44 +8015,6 @@ x_connection_closed (dpy, error_message)
the original message here. */
x_catch_errors (dpy);
- /* Inhibit redisplay while frames are being deleted. */
- specbind (Qinhibit_redisplay, Qt);
-
- if (dpyinfo)
- {
- /* Protect display from being closed when we delete the last
- frame on it. */
- dpyinfo->reference_count++;
- dpyinfo->terminal->reference_count++;
- }
-
- /* First delete frames whose mini-buffers are on frames
- that are on the dead display. */
- FOR_EACH_FRAME (tail, frame)
- {
- Lisp_Object minibuf_frame;
- minibuf_frame
- = WINDOW_FRAME (XWINDOW (FRAME_MINIBUF_WINDOW (XFRAME (frame))));
- if (FRAME_X_P (XFRAME (frame))
- && FRAME_X_P (XFRAME (minibuf_frame))
- && ! EQ (frame, minibuf_frame)
- && FRAME_X_DISPLAY_INFO (XFRAME (minibuf_frame)) == dpyinfo)
- Fdelete_frame (frame, Qt);
- }
-
- /* Now delete all remaining frames on the dead display.
- We are now sure none of these is used as the mini-buffer
- for another frame that we need to delete. */
- FOR_EACH_FRAME (tail, frame)
- if (FRAME_X_P (XFRAME (frame))
- && FRAME_X_DISPLAY_INFO (XFRAME (frame)) == dpyinfo)
- {
- /* Set this to t so that Fdelete_frame won't get confused
- trying to find a replacement. */
- FRAME_KBOARD (XFRAME (frame))->Vdefault_minibuffer_frame = Qt;
- Fdelete_frame (frame, Qt);
- }
-
/* We have to close the display to inform Xt that it doesn't
exist anymore. If we don't, Xt will continue to wait for
events from the display. As a consequence, a sequence of
@@ -7891,23 +8047,43 @@ x_connection_closed (dpy, error_message)
xg_display_close (dpyinfo->display);
#endif
+ /* Indicate that this display is dead. */
if (dpyinfo)
+ dpyinfo->display = 0;
+
+ /* First delete frames whose mini-buffers are on frames
+ that are on the dead display. */
+ FOR_EACH_FRAME (tail, frame)
{
- /* Indicate that this display is dead. */
- dpyinfo->display = 0;
+ Lisp_Object minibuf_frame;
+ minibuf_frame
+ = WINDOW_FRAME (XWINDOW (FRAME_MINIBUF_WINDOW (XFRAME (frame))));
+ if (FRAME_X_P (XFRAME (frame))
+ && FRAME_X_P (XFRAME (minibuf_frame))
+ && ! EQ (frame, minibuf_frame)
+ && FRAME_X_DISPLAY_INFO (XFRAME (minibuf_frame)) == dpyinfo)
+ Fdelete_frame (frame, Qt);
+ }
- dpyinfo->reference_count--;
- dpyinfo->terminal->reference_count--;
- if (dpyinfo->reference_count != 0)
- /* We have just closed all frames on this display. */
- abort ();
+ /* Now delete all remaining frames on the dead display.
+ We are now sure none of these is used as the mini-buffer
+ for another frame that we need to delete. */
+ FOR_EACH_FRAME (tail, frame)
+ if (FRAME_X_P (XFRAME (frame))
+ && FRAME_X_DISPLAY_INFO (XFRAME (frame)) == dpyinfo)
+ {
+ /* Set this to t so that Fdelete_frame won't get confused
+ trying to find a replacement. */
+ FRAME_KBOARD (XFRAME (frame))->Vdefault_minibuffer_frame = Qt;
+ Fdelete_frame (frame, Qt);
+ }
- x_delete_display (dpyinfo);
- }
+ if (dpyinfo)
+ x_delete_display (dpyinfo);
x_uncatch_errors ();
- if (terminal_list == 0)
+ if (x_display_list == 0)
{
fprintf (stderr, "%s\n", error_msg);
shut_down_emacs (0, 0, Qnil);
@@ -7921,7 +8097,6 @@ x_connection_closed (dpy, error_message)
sigunblock (sigmask (SIGALRM));
TOTALLY_UNBLOCK_INPUT;
- unbind_to (index, Qnil);
clear_waiting_for_input ();
error ("%s", error_msg);
}
@@ -8017,11 +8192,16 @@ x_new_font (f, fontname)
register char *fontname;
{
struct font_info *fontp
- = FS_LOAD_FONT (f, 0, fontname, -1);
+ = FS_LOAD_FONT (f, fontname);
if (!fontp)
return Qnil;
+ if (FRAME_FONT (f) == (XFontStruct *) (fontp->font))
+ /* This font is already set in frame F. There's nothing more to
+ do. */
+ return build_string (fontp->full_name);
+
FRAME_FONT (f) = (XFontStruct *) (fontp->font);
FRAME_BASELINE_OFFSET (f) = fontp->baseline_offset;
FRAME_FONTSET (f) = -1;
@@ -8065,33 +8245,45 @@ x_new_font (f, fontname)
return build_string (fontp->full_name);
}
-/* Give frame F the fontset named FONTSETNAME as its default font, and
- return the full name of that fontset. FONTSETNAME may be a wildcard
- pattern; in that case, we choose some fontset that fits the pattern.
- The return value shows which fontset we chose. */
+/* Give frame F the fontset named FONTSETNAME as its default fontset,
+ and return the full name of that fontset. FONTSETNAME may be a
+ wildcard pattern; in that case, we choose some fontset that fits
+ the pattern. FONTSETNAME may be a font name for ASCII characters;
+ in that case, we create a fontset from that font name.
+
+ The return value shows which fontset we chose.
+ If FONTSETNAME specifies the default fontset, return Qt.
+ If an ASCII font in the specified fontset can't be loaded, return
+ Qnil. */
Lisp_Object
x_new_fontset (f, fontsetname)
struct frame *f;
- char *fontsetname;
+ Lisp_Object fontsetname;
{
- int fontset = fs_query_fontset (build_string (fontsetname), 0);
+ int fontset = fs_query_fontset (fontsetname, 0);
Lisp_Object result;
- if (fontset < 0)
- return Qnil;
-
- if (FRAME_FONTSET (f) == fontset)
+ if (fontset > 0 && f->output_data.x->fontset == fontset)
/* This fontset is already set in frame F. There's nothing more
to do. */
return fontset_name (fontset);
+ else if (fontset == 0)
+ /* The default fontset can't be the default font. */
+ return Qt;
- result = x_new_font (f, (SDATA (fontset_ascii (fontset))));
+ if (fontset > 0)
+ result = x_new_font (f, (SDATA (fontset_ascii (fontset))));
+ else
+ result = x_new_font (f, SDATA (fontsetname));
if (!STRINGP (result))
/* Can't load ASCII font. */
return Qnil;
+ if (fontset < 0)
+ fontset = new_fontset_from_font_name (result);
+
/* Since x_new_font doesn't update any fontset information, do it now. */
FRAME_FONTSET (f) = fontset;
@@ -8101,8 +8293,70 @@ x_new_fontset (f, fontsetname)
xic_set_xfontset (f, SDATA (fontset_ascii (fontset)));
#endif
- return build_string (fontsetname);
+ return fontset_name (fontset);
+}
+
+#ifdef USE_FONT_BACKEND
+Lisp_Object
+x_new_fontset2 (f, fontset, font_object)
+ struct frame *f;
+ int fontset;
+ Lisp_Object font_object;
+{
+ struct font *font = XSAVE_VALUE (font_object)->pointer;
+
+ if (FRAME_FONT_OBJECT (f) == font)
+ /* This font is already set in frame F. There's nothing more to
+ do. */
+ return fontset_name (fontset);
+
+ BLOCK_INPUT;
+
+ FRAME_FONT_OBJECT (f) = font;
+ FRAME_FONT (f) = font->font.font;
+ FRAME_BASELINE_OFFSET (f) = font->font.baseline_offset;
+ FRAME_FONTSET (f) = fontset;
+
+ FRAME_COLUMN_WIDTH (f) = font->font.average_width;
+ FRAME_SPACE_WIDTH (f) = font->font.space_width;
+ FRAME_LINE_HEIGHT (f) = font->font.height;
+
+ compute_fringe_widths (f, 1);
+
+ /* Compute the scroll bar width in character columns. */
+ if (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) > 0)
+ {
+ int wid = FRAME_COLUMN_WIDTH (f);
+ FRAME_CONFIG_SCROLL_BAR_COLS (f)
+ = (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) + wid - 1) / wid;
+ }
+ else
+ {
+ int wid = FRAME_COLUMN_WIDTH (f);
+ FRAME_CONFIG_SCROLL_BAR_COLS (f) = (14 + wid - 1) / wid;
+ }
+
+ /* Now make the frame display the given font. */
+ if (FRAME_X_WINDOW (f) != 0)
+ {
+ /* Don't change the size of a tip frame; there's no point in
+ doing it because it's done in Fx_show_tip, and it leads to
+ problems because the tip frame has no widget. */
+ if (NILP (tip_frame) || XFRAME (tip_frame) != f)
+ x_set_window_size (f, 0, FRAME_COLS (f), FRAME_LINES (f));
+ }
+
+#ifdef HAVE_X_I18N
+ if (FRAME_XIC (f)
+ && (FRAME_XIC_STYLE (f) & (XIMPreeditPosition | XIMStatusArea)))
+ xic_set_xfontset (f, SDATA (fontset_ascii (fontset)));
+#endif
+
+ UNBLOCK_INPUT;
+
+ return fontset_name (fontset);
}
+#endif /* USE_FONT_BACKEND */
/***********************************************************************
@@ -8132,7 +8386,7 @@ xim_destroy_callback (xim, client_data, call_data)
FOR_EACH_FRAME (tail, frame)
{
struct frame *f = XFRAME (frame);
- if (FRAME_X_P (f) && FRAME_X_DISPLAY_INFO (f) == dpyinfo)
+ if (FRAME_X_DISPLAY_INFO (f) == dpyinfo)
{
FRAME_XIC (f) = NULL;
xic_free_xfontset (f);
@@ -8231,8 +8485,7 @@ xim_instantiate_callback (display, client_data, call_data)
{
struct frame *f = XFRAME (frame);
- if (FRAME_X_P (f)
- && FRAME_X_DISPLAY_INFO (f) == xim_inst->dpyinfo)
+ if (FRAME_X_DISPLAY_INFO (f) == xim_inst->dpyinfo)
if (FRAME_XIC (f) == NULL)
{
create_frame_xic (f);
@@ -9398,6 +9651,15 @@ x_free_frame_resources (f)
commands to the X server. */
if (dpyinfo->display)
{
+#ifdef USE_FONT_BACKEND
+ /* We must free faces before destroying windows because some
+ font-driver (e.g. xft) access a window while finishing a
+ face. */
+ if (enable_font_backend
+ && FRAME_FACE_CACHE (f))
+ free_frame_faces (f);
+#endif /* USE_FONT_BACKEND */
+
if (f->output_data.x->icon_desc)
XDestroyWindow (FRAME_X_DISPLAY (f), f->output_data.x->icon_desc);
@@ -9447,8 +9709,8 @@ x_free_frame_resources (f)
XDestroyWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f));
#endif /* !USE_X_TOOLKIT */
- unload_color (f, FRAME_FOREGROUND_PIXEL (f));
- unload_color (f, FRAME_BACKGROUND_PIXEL (f));
+ unload_color (f, f->output_data.x->foreground_pixel);
+ unload_color (f, f->output_data.x->background_pixel);
unload_color (f, f->output_data.x->cursor_pixel);
unload_color (f, f->output_data.x->cursor_foreground_pixel);
unload_color (f, f->output_data.x->border_pixel);
@@ -9792,7 +10054,7 @@ x_get_font_info (f, font_idx)
If SIZE is > 0, it is the size (maximum bounds width) of fonts
to be listed.
- SIZE < 0 means include scalable fonts.
+ SIZE < 0 means include auto scaled fonts.
Frame F null means we have not yet created any frame on X, and
consult the first display in x_display_list. MAXNAMES sets a limit
@@ -10265,6 +10527,7 @@ x_load_font (f, fontname, size)
bzero (fontp, sizeof (*fontp));
fontp->font = font;
fontp->font_idx = i;
+ fontp->charset = -1; /* fs_load_font sets it. */
fontp->name = (char *) xmalloc (strlen (fontname) + 1);
bcopy (fontname, fontp->name, strlen (fontname) + 1);
@@ -10376,10 +10639,10 @@ x_load_font (f, fontname, size)
the font code-points (0:0x20..0x7F, 1:0xA0..0xFF), or
(0:0x2020..0x7F7F, 1:0xA0A0..0xFFFF, 3:0x20A0..0x7FFF,
2:0xA020..0xFF7F). For the moment, we don't know which charset
- uses this font. So, we set information in fontp->encoding[1]
+ uses this font. So, we set information in fontp->encoding_type
which is never used by any charset. If mapping can't be
decided, set FONT_ENCODING_NOT_DECIDED. */
- fontp->encoding[1]
+ fontp->encoding_type
= (font->max_byte1 == 0
/* 1-byte font */
? (font->min_char_or_byte2 < 0x80
@@ -10479,6 +10742,160 @@ x_find_ccl_program (fontp)
}
+/* Return a char-table whose elements are t if the font FONT_INFO
+ contains a glyph for the corresponding character, and nil if
+ not. */
+
+Lisp_Object
+x_get_font_repertory (f, font_info)
+ FRAME_PTR f;
+ struct font_info *font_info;
+{
+ XFontStruct *font = (XFontStruct *) font_info->font;
+ Lisp_Object table;
+ int min_byte1, max_byte1, min_byte2, max_byte2;
+ int c;
+ struct charset *charset = CHARSET_FROM_ID (font_info->charset);
+ int offset = CHARSET_OFFSET (charset);
+
+ table = Fmake_char_table (Qnil, Qnil);
+
+ min_byte1 = font->min_byte1;
+ max_byte1 = font->max_byte1;
+ min_byte2 = font->min_char_or_byte2;
+ max_byte2 = font->max_char_or_byte2;
+ if (min_byte1 == 0 && max_byte1 == 0)
+ {
+ if (! font->per_char || font->all_chars_exist == True)
+ {
+ if (offset >= 0)
+ char_table_set_range (table, offset + min_byte2,
+ offset + max_byte2, Qt);
+ else
+ for (; min_byte2 <= max_byte2; min_byte2++)
+ {
+ c = DECODE_CHAR (charset, min_byte2);
+ CHAR_TABLE_SET (table, c, Qt);
+ }
+ }
+ else
+ {
+ XCharStruct *pcm = font->per_char;
+ int from = -1;
+ int i;
+
+ for (i = min_byte2; i <= max_byte2; i++, pcm++)
+ {
+ if (pcm->width == 0 && pcm->rbearing == pcm->lbearing)
+ {
+ if (from >= 0)
+ {
+ if (offset >= 0)
+ char_table_set_range (table, offset + from,
+ offset + i - 1, Qt);
+ else
+ for (; from < i; from++)
+ {
+ c = DECODE_CHAR (charset, from);
+ CHAR_TABLE_SET (table, c, Qt);
+ }
+ from = -1;
+ }
+ }
+ else if (from < 0)
+ from = i;
+ }
+ if (from >= 0)
+ {
+ if (offset >= 0)
+ char_table_set_range (table, offset + from, offset + i - 1,
+ Qt);
+ else
+ for (; from < i; from++)
+ {
+ c = DECODE_CHAR (charset, from);
+ CHAR_TABLE_SET (table, c, Qt);
+ }
+ }
+ }
+ }
+ else
+ {
+ if (! font->per_char || font->all_chars_exist == True)
+ {
+ int i, j;
+
+ if (offset >= 0)
+ for (i = min_byte1; i <= max_byte1; i++)
+ char_table_set_range
+ (table, offset + ((i << 8) | min_byte2),
+ offset + ((i << 8) | max_byte2), Qt);
+ else
+ for (i = min_byte1; i <= max_byte1; i++)
+ for (j = min_byte2; j <= max_byte2; j++)
+ {
+ unsigned code = (i << 8) | j;
+ c = DECODE_CHAR (charset, code);
+ CHAR_TABLE_SET (table, c, Qt);
+ }
+ }
+ else
+ {
+ XCharStruct *pcm = font->per_char;
+ int i;
+
+ for (i = min_byte1; i <= max_byte1; i++)
+ {
+ int from = -1;
+ int j;
+
+ for (j = min_byte2; j <= max_byte2; j++, pcm++)
+ {
+ if (pcm->width == 0 && pcm->rbearing == pcm->lbearing)
+ {
+ if (from >= 0)
+ {
+ if (offset >= 0)
+ char_table_set_range
+ (table, offset + ((i << 8) | from),
+ offset + ((i << 8) | (j - 1)), Qt);
+ else
+ {
+ for (; from < j; from++)
+ {
+ unsigned code = (i << 8) | from;
+ c = ENCODE_CHAR (charset, code);
+ CHAR_TABLE_SET (table, c, Qt);
+ }
+ }
+ from = -1;
+ }
+ }
+ else if (from < 0)
+ from = j;
+ }
+ if (from >= 0)
+ {
+ if (offset >= 0)
+ char_table_set_range
+ (table, offset + ((i << 8) | from),
+ offset + ((i << 8) | (j - 1)), Qt);
+ else
+ {
+ for (; from < j; from++)
+ {
+ unsigned code = (i << 8) | from;
+ c = DECODE_CHAR (charset, code);
+ CHAR_TABLE_SET (table, c, Qt);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return table;
+}
/***********************************************************************
Initialization
@@ -10591,12 +11008,9 @@ get_bits_and_offset (mask, bits, offset)
*bits = nr;
}
-/* Return 1 if display DISPLAY is available for use, 0 otherwise.
- But don't permanently open it, just test its availability. */
-
int
x_display_ok (display)
- const char *display;
+ const char * display;
{
int dpy_ok = 1;
Display *dpy;
@@ -10609,10 +11023,6 @@ x_display_ok (display)
return dpy_ok;
}
-/* Open a connection to X display DISPLAY_NAME, and return
- the structure that describes the open display.
- If we cannot contact the display, return null. */
-
struct x_display_info *
x_term_init (display_name, xrm_option, resource_name)
Lisp_Object display_name;
@@ -10621,7 +11031,6 @@ x_term_init (display_name, xrm_option, resource_name)
{
int connection;
Display *dpy;
- struct terminal *terminal;
struct x_display_info *dpyinfo;
XrmDatabase xrdb;
@@ -10633,9 +11042,6 @@ x_term_init (display_name, xrm_option, resource_name)
++x_initialized;
}
- if (! x_display_ok (SDATA (display_name)))
- error ("Display %s can't be opened", SDATA (display_name));
-
#ifdef USE_GTK
{
#define NUM_ARGV 10
@@ -10644,21 +11050,14 @@ x_term_init (display_name, xrm_option, resource_name)
char **argv2 = argv;
GdkAtom atom;
-#ifndef HAVE_GTK_MULTIDISPLAY
- if (!EQ (Vinitial_window_system, intern ("x")))
- error ("Sorry, you cannot connect to X servers with the GTK toolkit");
-#endif
-
if (x_initialized++ > 1)
{
-#ifdef HAVE_GTK_MULTIDISPLAY
/* Opening another display. If xg_display_open returns less
than zero, we are probably on GTK 2.0, which can only handle
one display. GTK 2.2 or later can handle more than one. */
if (xg_display_open (SDATA (display_name), &dpy) < 0)
-#endif
error ("Sorry, this version of GTK can only handle one display");
- }
+ }
else
{
for (argc = 0; argc < NUM_ARGV; ++argc)
@@ -10762,8 +11161,6 @@ x_term_init (display_name, xrm_option, resource_name)
dpyinfo = (struct x_display_info *) xmalloc (sizeof (struct x_display_info));
bzero (dpyinfo, sizeof *dpyinfo);
- terminal = x_create_terminal (dpyinfo);
-
#ifdef MULTI_KBOARD
{
struct x_display_info *share;
@@ -10775,30 +11172,30 @@ x_term_init (display_name, xrm_option, resource_name)
SDATA (display_name)))
break;
if (share)
- terminal->kboard = share->terminal->kboard;
+ dpyinfo->kboard = share->kboard;
else
{
- terminal->kboard = (KBOARD *) xmalloc (sizeof (KBOARD));
- init_kboard (terminal->kboard);
+ dpyinfo->kboard = (KBOARD *) xmalloc (sizeof (KBOARD));
+ init_kboard (dpyinfo->kboard);
if (!EQ (XSYMBOL (Qvendor_specific_keysyms)->function, Qunbound))
{
char *vendor = ServerVendor (dpy);
UNBLOCK_INPUT;
- terminal->kboard->Vsystem_key_alist
+ dpyinfo->kboard->Vsystem_key_alist
= call1 (Qvendor_specific_keysyms,
vendor ? build_string (vendor) : empty_unibyte_string);
BLOCK_INPUT;
}
- terminal->kboard->next_kboard = all_kboards;
- all_kboards = terminal->kboard;
+ dpyinfo->kboard->next_kboard = all_kboards;
+ all_kboards = dpyinfo->kboard;
/* Don't let the initial kboard remain current longer than necessary.
That would cause problems if a file loaded on startup tries to
prompt in the mini-buffer. */
if (current_kboard == initial_kboard)
- current_kboard = terminal->kboard;
+ current_kboard = dpyinfo->kboard;
}
- terminal->kboard->reference_count++;
+ dpyinfo->kboard->reference_count++;
}
#endif
@@ -10813,11 +11210,6 @@ x_term_init (display_name, xrm_option, resource_name)
dpyinfo->display = dpy;
- /* Set the name of the terminal. */
- terminal->name = (char *) xmalloc (SBYTES (display_name) + 1);
- strncpy (terminal->name, SDATA (display_name), SBYTES (display_name));
- terminal->name[SBYTES (display_name)] = 0;
-
#if 0
XSetAfterFunction (x_current_display, x_trace_wire);
#endif /* ! 0 */
@@ -11113,10 +11505,8 @@ x_term_init (display_name, xrm_option, resource_name)
}
#ifdef HAVE_X_SM
- /* Only do this for the very first display in the Emacs session.
- Ignore X session management when Emacs was first started on a
- tty. */
- if (terminal->id == 1)
+ /* Only do this for the first display. */
+ if (!x_session_initialized++)
x_session_initialize (dpyinfo);
#endif
@@ -11125,7 +11515,7 @@ x_term_init (display_name, xrm_option, resource_name)
return dpyinfo;
}
-/* Get rid of display DPYINFO, deleting all frames on it,
+/* Get rid of display DPYINFO, assuming all frames are already gone,
and without sending any more commands to the X server. */
void
@@ -11133,21 +11523,6 @@ x_delete_display (dpyinfo)
struct x_display_info *dpyinfo;
{
int i;
- struct terminal *t;
-
- /* Close all frames and delete the generic struct terminal for this
- X display. */
- for (t = terminal_list; t; t = t->next_terminal)
- if (t->type == output_x_window && t->display_info.x == dpyinfo)
- {
-#ifdef HAVE_X_SM
- /* Close X session management when we close its display. */
- if (t->id == 1 && x_session_have_connection ())
- x_session_close();
-#endif
- delete_terminal (t);
- break;
- }
delete_keyboard_wait_descriptor (dpyinfo->connection);
@@ -11191,6 +11566,10 @@ x_delete_display (dpyinfo)
XrmDestroyDatabase (dpyinfo->xrdb);
#endif
#endif
+#ifdef MULTI_KBOARD
+ if (--dpyinfo->kboard->reference_count == 0)
+ delete_kboard (dpyinfo->kboard);
+#endif
#ifdef HAVE_X_I18N
if (dpyinfo->xim)
xim_close_dpy (dpyinfo);
@@ -11272,131 +11651,71 @@ x_activate_timeout_atimer ()
extern frame_parm_handler x_frame_parm_handlers[];
static struct redisplay_interface x_redisplay_interface =
- {
- x_frame_parm_handlers,
- x_produce_glyphs,
- x_write_glyphs,
- x_insert_glyphs,
- x_clear_end_of_line,
- x_scroll_run,
- x_after_update_window_line,
- x_update_window_begin,
- x_update_window_end,
- x_cursor_to,
- x_flush,
-#ifdef XFlush
- x_flush,
-#else
- 0, /* flush_display_optional */
-#endif
- x_clear_window_mouse_face,
- x_get_glyph_overhangs,
- x_fix_overlapping_area,
- x_draw_fringe_bitmap,
- 0, /* define_fringe_bitmap */
- 0, /* destroy_fringe_bitmap */
- x_per_char_metric,
- x_encode_char,
- x_compute_glyph_string_overhangs,
- x_draw_glyph_string,
- x_define_frame_cursor,
- x_clear_frame_area,
- x_draw_window_cursor,
- x_draw_vertical_window_border,
- x_shift_glyphs_for_insert
- };
-
-
-/* This function is called when the last frame on a display is deleted. */
-void
-x_delete_terminal (struct terminal *terminal)
{
- struct x_display_info *dpyinfo = terminal->display_info.x;
- int i;
-
- /* Protect against recursive calls. Fdelete_frame in
- delete_terminal calls us back when it deletes our last frame. */
- if (!terminal->name)
- return;
-
- BLOCK_INPUT;
- /* Free the fonts in the font table. */
- for (i = 0; i < dpyinfo->n_fonts; i++)
- if (dpyinfo->font_table[i].name)
- {
- XFreeFont (dpyinfo->display, dpyinfo->font_table[i].font);
- }
-
- x_destroy_all_bitmaps (dpyinfo);
- XSetCloseDownMode (dpyinfo->display, DestroyAll);
-
-#ifdef USE_GTK
- xg_display_close (dpyinfo->display);
-#else
-#ifdef USE_X_TOOLKIT
- XtCloseDisplay (dpyinfo->display);
+ x_frame_parm_handlers,
+ x_produce_glyphs,
+ x_write_glyphs,
+ x_insert_glyphs,
+ x_clear_end_of_line,
+ x_scroll_run,
+ x_after_update_window_line,
+ x_update_window_begin,
+ x_update_window_end,
+ x_cursor_to,
+ x_flush,
+#ifdef XFlush
+ x_flush,
#else
- XCloseDisplay (dpyinfo->display);
-#endif
-#endif /* ! USE_GTK */
-
- x_delete_display (dpyinfo);
- UNBLOCK_INPUT;
-}
-
-/* Create a struct terminal, initialize it with the X11 specific
- functions and make DISPLAY->TERMINAL point to it. */
-
-static struct terminal *
-x_create_terminal (struct x_display_info *dpyinfo)
-{
- struct terminal *terminal;
-
- terminal = create_terminal ();
-
- terminal->type = output_x_window;
- terminal->display_info.x = dpyinfo;
- dpyinfo->terminal = terminal;
-
- /* kboard is initialized in x_term_init. */
-
- terminal->clear_frame_hook = x_clear_frame;
- terminal->ins_del_lines_hook = x_ins_del_lines;
- terminal->delete_glyphs_hook = x_delete_glyphs;
- terminal->ring_bell_hook = XTring_bell;
- terminal->reset_terminal_modes_hook = XTreset_terminal_modes;
- terminal->set_terminal_modes_hook = XTset_terminal_modes;
- terminal->update_begin_hook = x_update_begin;
- terminal->update_end_hook = x_update_end;
- terminal->set_terminal_window_hook = XTset_terminal_window;
- terminal->read_socket_hook = XTread_socket;
- terminal->frame_up_to_date_hook = XTframe_up_to_date;
- terminal->mouse_position_hook = XTmouse_position;
- terminal->frame_rehighlight_hook = XTframe_rehighlight;
- terminal->frame_raise_lower_hook = XTframe_raise_lower;
- terminal->fullscreen_hook = XTfullscreen_hook;
- terminal->set_vertical_scroll_bar_hook = XTset_vertical_scroll_bar;
- terminal->condemn_scroll_bars_hook = XTcondemn_scroll_bars;
- terminal->redeem_scroll_bar_hook = XTredeem_scroll_bar;
- terminal->judge_scroll_bars_hook = XTjudge_scroll_bars;
-
- terminal->delete_frame_hook = x_destroy_window;
- terminal->delete_terminal_hook = x_delete_terminal;
-
- terminal->rif = &x_redisplay_interface;
- terminal->scroll_region_ok = 1; /* We'll scroll partial frames. */
- terminal->char_ins_del_ok = 1;
- terminal->line_ins_del_ok = 1; /* We'll just blt 'em. */
- terminal->fast_clear_end_of_line = 1; /* X does this well. */
- terminal->memory_below_frame = 0; /* We don't remember what scrolls
- off the bottom. */
-
- return terminal;
-}
+ 0, /* flush_display_optional */
+#endif
+ x_clear_window_mouse_face,
+ x_get_glyph_overhangs,
+ x_fix_overlapping_area,
+ x_draw_fringe_bitmap,
+ 0, /* define_fringe_bitmap */
+ 0, /* destroy_fringe_bitmap */
+ x_per_char_metric,
+ x_encode_char,
+ x_compute_glyph_string_overhangs,
+ x_draw_glyph_string,
+ x_define_frame_cursor,
+ x_clear_frame_area,
+ x_draw_window_cursor,
+ x_draw_vertical_window_border,
+ x_shift_glyphs_for_insert
+};
void
x_initialize ()
{
+ rif = &x_redisplay_interface;
+
+ clear_frame_hook = x_clear_frame;
+ ins_del_lines_hook = x_ins_del_lines;
+ delete_glyphs_hook = x_delete_glyphs;
+ ring_bell_hook = XTring_bell;
+ reset_terminal_modes_hook = XTreset_terminal_modes;
+ set_terminal_modes_hook = XTset_terminal_modes;
+ update_begin_hook = x_update_begin;
+ update_end_hook = x_update_end;
+ set_terminal_window_hook = XTset_terminal_window;
+ read_socket_hook = XTread_socket;
+ frame_up_to_date_hook = XTframe_up_to_date;
+ mouse_position_hook = XTmouse_position;
+ frame_rehighlight_hook = XTframe_rehighlight;
+ frame_raise_lower_hook = XTframe_raise_lower;
+ set_vertical_scroll_bar_hook = XTset_vertical_scroll_bar;
+ condemn_scroll_bars_hook = XTcondemn_scroll_bars;
+ redeem_scroll_bar_hook = XTredeem_scroll_bar;
+ judge_scroll_bars_hook = XTjudge_scroll_bars;
+ fullscreen_hook = XTfullscreen_hook;
+
+ scroll_region_ok = 1; /* we'll scroll partial frames */
+ char_ins_del_ok = 1;
+ line_ins_del_ok = 1; /* we'll just blt 'em */
+ fast_clear_end_of_line = 1; /* X does this well */
+ memory_below_frame = 0; /* we don't remember what scrolls
+ off the bottom */
baud_rate = 19200;
x_noop_count = 0;
@@ -11412,7 +11731,7 @@ x_initialize ()
#endif
/* Try to use interrupt input; if we can't, then start polling. */
- Fset_input_interrupt_mode (Qt);
+ Fset_input_mode (Qt, Qnil, Qt, Qnil);
#ifdef USE_X_TOOLKIT
XtToolkitInitialize ();
@@ -11443,11 +11762,9 @@ x_initialize ()
XSetIOErrorHandler (x_io_error_quitter);
/* Disable Window Change signals; they are handled by X events. */
-#if 0 /* Don't. We may want to open tty frames later. */
#ifdef SIGWINCH
signal (SIGWINCH, SIG_DFL);
#endif /* SIGWINCH */
-#endif
signal (SIGPIPE, x_connection_signal);
}
@@ -11467,8 +11784,6 @@ syms_of_xterm ()
staticpro (&Qvendor_specific_keysyms);
Qvendor_specific_keysyms = intern ("vendor-specific-keysyms");
- staticpro (&Qutf_8);
- Qutf_8 = intern ("utf-8");
staticpro (&Qlatin_1);
Qlatin_1 = intern ("latin-1");
diff --git a/src/xterm.h b/src/xterm.h
index c8b768f618..0480b0c805 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -149,9 +149,6 @@ struct x_display_info
/* Chain of all x_display_info structures. */
struct x_display_info *next;
- /* The generic display parameters corresponding to this X display. */
- struct terminal *terminal;
-
/* Connection number (normally a file descriptor number). */
int connection;
@@ -330,6 +327,9 @@ struct x_display_info
/* Atom used in toolkit scroll bar client messages. */
Atom Xatom_Scrollbar;
+#ifdef MULTI_KBOARD
+ struct kboard *kboard;
+#endif
int cut_buffers_initialized; /* Whether we're sure they all exist */
/* The frame (if any) which has the X window that has keyboard focus.
@@ -442,6 +442,9 @@ extern struct font_info *x_get_font_info P_ ((struct frame *f, int));
extern struct font_info *x_load_font P_ ((struct frame *, char *, int));
extern struct font_info *x_query_font P_ ((struct frame *, char *));
extern void x_find_ccl_program P_ ((struct font_info *));
+extern Lisp_Object x_get_font_repertory P_ ((struct frame *,
+ struct font_info *));
+
/* Each X frame object points to its own struct x_output object
in the output_data.x field. The x_output structure contains
@@ -523,6 +526,10 @@ struct x_output
/* Default ASCII font of this frame. */
XFontStruct *font;
+#ifdef USE_FONT_BACKEND
+ struct font *fontp;
+#endif /* USE_FONT_BACKEND */
+
/* The baseline offset of the default ASCII font. */
int baseline_offset;
@@ -532,10 +539,8 @@ struct x_output
/* Pixel values used for various purposes.
border_pixel may be -1 meaning use a gray tile. */
-#if 0 /* These are also defined in struct frame. Use that instead. */
unsigned long background_pixel;
unsigned long foreground_pixel;
-#endif
unsigned long cursor_pixel;
unsigned long border_pixel;
unsigned long mouse_pixel;
@@ -710,6 +715,10 @@ enum
#define FRAME_TOOLBAR_HEIGHT(f) ((f)->output_data.x->toolbar_height)
#define FRAME_BASELINE_OFFSET(f) ((f)->output_data.x->baseline_offset)
+#ifdef USE_FONT_BACKEND
+#define FRAME_FONT_OBJECT(f) ((f)->output_data.x->fontp)
+#endif /* USE_FONT_BACKEND */
+
/* This gives the x_display_info structure for the display F is on. */
#define FRAME_X_DISPLAY_INFO(f) ((f)->output_data.x->display_info)
@@ -992,6 +1001,7 @@ extern int x_had_errors_p P_ ((Display *));
extern int x_catching_errors P_ ((void));
extern void x_uncatch_errors P_ ((void));
extern void x_clear_errors P_ ((Display *));
+extern void x_fully_uncatch_errors P_ ((void));
extern void x_set_window_size P_ ((struct frame *, int, int, int));
extern void x_set_mouse_position P_ ((struct frame *, int, int));
extern void x_set_mouse_pixel_position P_ ((struct frame *, int, int));
@@ -1007,7 +1017,6 @@ extern void x_wm_set_size_hint P_ ((struct frame *, long, int));
extern void x_wm_set_window_state P_ ((struct frame *, int));
extern void x_wm_set_icon_pixmap P_ ((struct frame *, int));
extern void x_delete_display P_ ((struct x_display_info *));
-extern void x_delete_terminal P_ ((struct terminal *terminal));
extern void x_initialize P_ ((void));
extern unsigned long x_copy_color P_ ((struct frame *, unsigned long));
#ifdef USE_X_TOOLKIT
@@ -1108,7 +1117,6 @@ extern void widget_store_internal_border P_ ((Widget));
extern void x_session_initialize P_ ((struct x_display_info *dpyinfo));
extern int x_session_check_input P_ ((struct input_event *bufp));
extern int x_session_have_connection P_ ((void));
-extern void x_session_close P_ ((void));
#endif
#define FONT_TYPE_FOR_UNIBYTE(font, ch) 0