From 2aa46d6cce6773a0c56c93ca64750caea6ed3bba Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Mon, 14 Mar 2011 12:18:25 -0400 Subject: * src/buffer.c (Fmake_indirect_buffer): Fix incorrect assertion. --- src/ChangeLog | 4 ++++ src/buffer.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index bad9b8dd4b..8e5c9564f5 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2011-03-14 Chong Yidong + + * buffer.c (Fmake_indirect_buffer): Fix incorrect assertion. + 2011-03-13 Chong Yidong * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT) diff --git a/src/buffer.c b/src/buffer.c index 0194072827..c0485c10a9 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -611,8 +611,8 @@ CLONE nil means the indirect buffer's state is reset to default values. */) /* Make sure the base buffer has markers for its narrowing. */ if (NILP (BVAR (b->base_buffer, pt_marker))) { - eassert (NILP (BVAR (b, begv_marker))); - eassert (NILP (BVAR (b, zv_marker))); + eassert (NILP (BVAR (b->base_buffer, begv_marker))); + eassert (NILP (BVAR (b->base_buffer, zv_marker))); BVAR (b->base_buffer, pt_marker) = Fmake_marker (); set_marker_both (BVAR (b->base_buffer, pt_marker), base_buffer, -- cgit v1.2.3 From 7684e57b24092dbfbbe7fc62a1a544e40e2ce88a Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Mon, 14 Mar 2011 18:07:53 +0100 Subject: src/w32*.c: Clean up extern declarations. * w32select.c: Don't #include "keyboard.h". (run_protected): Add extern declaration for waiting_for_input. * lisp.h (VWindow_system, Qfile_name_history): * keyboard.h (lispy_function_keys) [WINDOWSNT]: * w32term.h (w32_system_caret_hwnd, w32_system_caret_height) (w32_system_caret_x, w32_system_caret_y): Declare extern. * w32.c (Qlocal, noninteractive1, inhibit_window_system): * w32console.c (detect_input_pending, read_input_pending) (encode_terminal_code): * w32fns.c (quit_char, lispy_function_keys, Qtooltip) (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x) (w32_system_caret_y, Qfile_name_history): * w32font.c (w32font_driver, QCantialias, QCotf, QClang): * w32inevt.c (reinvoke_input_signal, lispy_function_keys): * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map) (Qoverriding_terminal_local_map, Qmenu_bar_update_hook): * w32proc.c (Qlocal, report_file_error): * w32term.c (Vwindow_system, updating_frame): * w32uniscribe.c (initialized, uniscribe_font_driver): Remove unneeded extern declarations. --- src/ChangeLog | 25 +++++++++++++++++++++++++ src/keyboard.h | 9 ++++++--- src/lisp.h | 2 ++ src/w32.c | 5 ----- src/w32console.c | 9 --------- src/w32fns.c | 15 +-------------- src/w32font.c | 3 --- src/w32inevt.c | 9 ++------- src/w32menu.c | 8 -------- src/w32proc.c | 8 ++------ src/w32select.c | 2 +- src/w32term.c | 14 ++------------ src/w32term.h | 6 +++++- src/w32uniscribe.c | 4 ---- 14 files changed, 46 insertions(+), 73 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 8e5c9564f5..09413b2648 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,28 @@ +2011-03-14 Juanma Barranquero + + * lisp.h (VWindow_system, Qfile_name_history): + * keyboard.h (lispy_function_keys) [WINDOWSNT]: + * w32term.h (w32_system_caret_hwnd, w32_system_caret_height) + (w32_system_caret_x, w32_system_caret_y): Declare extern. + + * w32select.c: Don't #include "keyboard.h". + (run_protected): Add extern declaration for waiting_for_input. + + * w32.c (Qlocal, noninteractive1, inhibit_window_system): + * w32console.c (detect_input_pending, read_input_pending) + (encode_terminal_code): + * w32fns.c (quit_char, lispy_function_keys, Qtooltip) + (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x) + (w32_system_caret_y, Qfile_name_history): + * w32font.c (w32font_driver, QCantialias, QCotf, QClang): + * w32inevt.c (reinvoke_input_signal, lispy_function_keys): + * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map) + (Qoverriding_terminal_local_map, Qmenu_bar_update_hook): + * w32proc.c (Qlocal, report_file_error): + * w32term.c (Vwindow_system, updating_frame): + * w32uniscribe.c (initialized, uniscribe_font_driver): + Remove unneeded extern declarations. + 2011-03-14 Chong Yidong * buffer.c (Fmake_indirect_buffer): Fix incorrect assertion. diff --git a/src/keyboard.h b/src/keyboard.h index 10bf16d5c5..f2000a4464 100644 --- a/src/keyboard.h +++ b/src/keyboard.h @@ -90,7 +90,7 @@ struct kboard /* User-supplied table to translate input characters through. */ Lisp_Object KBOARD_INTERNAL_FIELD (Vkeyboard_translate_table); - + /* Last command that may be repeated by `repeat'. */ Lisp_Object KBOARD_INTERNAL_FIELD (Vlast_repeatable_command); @@ -140,12 +140,12 @@ struct kboard /* Keymap mapping keys to alternative preferred forms. See the DEFVAR for more documentation. */ Lisp_Object KBOARD_INTERNAL_FIELD (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 KBOARD_INTERNAL_FIELD (Vinput_decode_map); - + /* Minibufferless frames on this display use this frame's minibuffer. */ Lisp_Object KBOARD_INTERNAL_FIELD (Vdefault_minibuffer_frame); @@ -518,3 +518,6 @@ extern int tty_read_avail_input (struct terminal *, int, struct input_event *); extern EMACS_TIME timer_check (int); +#ifdef WINDOWSNT +extern const char *const lispy_function_keys[]; +#endif diff --git a/src/lisp.h b/src/lisp.h index 113585320a..0f55da317c 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -2607,6 +2607,7 @@ extern void syms_of_insdel (void); /* Defined in dispnew.c */ extern Lisp_Object selected_frame; +extern Lisp_Object Vwindow_system; EXFUN (Fding, 1); EXFUN (Fredraw_frame, 1); EXFUN (Fsleep_for, 2); @@ -3009,6 +3010,7 @@ extern Lisp_Object Qfile_error; extern Lisp_Object Qfile_exists_p; extern Lisp_Object Qfile_directory_p; extern Lisp_Object Qinsert_file_contents; +extern Lisp_Object Qfile_name_history; EXFUN (Ffind_file_name_handler, 2); EXFUN (Ffile_name_as_directory, 1); EXFUN (Fexpand_file_name, 2); diff --git a/src/w32.c b/src/w32.c index ae2373be46..721cea07d2 100644 --- a/src/w32.c +++ b/src/w32.c @@ -147,9 +147,6 @@ typedef HRESULT (WINAPI * ShGetFolderPath_fn) void globals_of_w32 (void); static DWORD get_rid (PSID); -/* Defined in process.c for its own purpose. */ -extern Lisp_Object Qlocal; - /* Initialization states. @@ -5666,8 +5663,6 @@ sys_write (int fd, const void * buffer, unsigned int count) static void check_windows_init_file (void) { - extern int noninteractive, inhibit_window_system; - /* A common indication that Emacs is not installed properly is when it cannot find the Windows installation file. If this file does not exist in the expected place, tell the user. */ diff --git a/src/w32console.c b/src/w32console.c index 31c4a7c4e5..3c200405cb 100644 --- a/src/w32console.c +++ b/src/w32console.c @@ -41,12 +41,6 @@ along with GNU Emacs. If not, see . */ /* from window.c */ extern Lisp_Object Frecenter (Lisp_Object); -/* from keyboard.c */ -extern int detect_input_pending (void); - -/* from sysdep.c */ -extern int read_input_pending (void); - 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); @@ -277,9 +271,6 @@ w32con_insert_glyphs (struct frame *f, register struct glyph *start, } } -extern unsigned char *encode_terminal_code (struct glyph *, int, - struct coding_system *); - static void w32con_write_glyphs (struct frame *f, register struct glyph *string, register int len) diff --git a/src/w32fns.c b/src/w32fns.c index 09442d41e1..0c899cdcef 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -80,10 +80,6 @@ extern void w32_menu_display_help (HWND, HMENU, UINT, UINT); extern void w32_free_menu_strings (HWND); extern const char *map_w32_filename (const char *, const char **); -extern int quit_char; - -extern const char *const lispy_function_keys[]; - /* If non-zero, a w32 timer that, when it expires, displays an hourglass cursor on all frames. */ static unsigned hourglass_timer = 0; @@ -187,18 +183,10 @@ unsigned int msh_mousewheel = 0; #define MENU_FREE_DELAY 1000 static unsigned menu_free_timer = 0; -extern Lisp_Object Qtooltip; - #ifdef GLYPH_DEBUG int image_cache_refcount, dpyinfo_refcount; #endif - -extern HWND w32_system_caret_hwnd; - -extern int w32_system_caret_height; -extern int w32_system_caret_x; -extern int w32_system_caret_y; static HWND w32_visible_system_caret_hwnd; /* From w32menu.c */ @@ -5851,7 +5839,6 @@ Value is t if tooltip was open, nil otherwise. */) /*********************************************************************** File selection dialog ***********************************************************************/ -extern Lisp_Object Qfile_name_history; /* Callback for altering the behavior of the Open File dialog. Makes the Filename text field contain "Current Directory" and be @@ -5899,7 +5886,7 @@ file_dialog_callback (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) no man's land and the user will be unable to tab through the dialog box (pressing tab will only result in a beep). Avoid that problem by setting focus to the list here. */ - if (CDN_INITDONE == notify->hdr.code) + if (notify->hdr.code == CDN_INITDONE) SetFocus (list); } else diff --git a/src/w32font.c b/src/w32font.c index aef62f61a3..40ff0782b8 100644 --- a/src/w32font.c +++ b/src/w32font.c @@ -54,8 +54,6 @@ along with GNU Emacs. If not, see . */ #define JOHAB_CHARSET 130 #endif -extern struct font_driver w32font_driver; - Lisp_Object Qgdi; Lisp_Object Quniscribe; static Lisp_Object QCformat; @@ -64,7 +62,6 @@ static Lisp_Object Qserif, Qscript, Qdecorative; static Lisp_Object Qraster, Qoutline, Qunknown; /* antialiasing */ -extern Lisp_Object QCantialias, QCotf, QClang; /* defined in font.c */ extern Lisp_Object Qnone; /* reuse from w32fns.c */ static Lisp_Object Qstandard, Qsubpixel, Qnatural; diff --git a/src/w32inevt.c b/src/w32inevt.c index d0b097100f..c4858dea90 100644 --- a/src/w32inevt.c +++ b/src/w32inevt.c @@ -40,18 +40,15 @@ along with GNU Emacs. If not, see . */ #include "w32heap.h" #include "w32term.h" -/* stdin, from ntterm */ +/* stdin, from w32console.c */ extern HANDLE keyboard_handle; /* Info for last mouse motion */ static COORD movement_pos; static DWORD movement_time; -/* from keyboard.c */ -extern void reinvoke_input_signal (void); - +/* from w32fns.c */ extern unsigned int map_keypad_keys (unsigned int, unsigned int); - extern unsigned int w32_key_to_modifier (int key); /* Event queue */ @@ -261,8 +258,6 @@ w32_kbd_patch_key (KEY_EVENT_RECORD *event) } -extern const char *const lispy_function_keys[]; - static int faked_key = 0; /* return code -1 means that event_queue_ptr won't be incremented. diff --git a/src/w32menu.c b/src/w32menu.c index 92447eb9fa..a2e62f24f6 100644 --- a/src/w32menu.c +++ b/src/w32menu.c @@ -84,14 +84,6 @@ MessageBoxW_Proc unicode_message_box = NULL; Lisp_Object Qdebug_on_next_call; -extern Lisp_Object Qmenu_bar; - -extern Lisp_Object QCtoggle, QCradio; - -extern Lisp_Object Qoverriding_local_map, Qoverriding_terminal_local_map; - -extern Lisp_Object Qmenu_bar_update_hook; - void set_frame_menubar (FRAME_PTR, int, int); #ifdef HAVE_DIALOGS diff --git a/src/w32proc.c b/src/w32proc.c index bb8b428ffe..e94d9aa325 100644 --- a/src/w32proc.c +++ b/src/w32proc.c @@ -67,8 +67,6 @@ extern BOOL WINAPI IsValidLocale (LCID, DWORD); + ((DWORD)(var) - (section)->VirtualAddress) \ + (filedata).file_base)) -extern Lisp_Object Qlocal; - Lisp_Object Qhigh, Qlow; #ifdef EMACSDEBUG @@ -1053,7 +1051,7 @@ sys_spawnve (int mode, char *cmdname, char **argv, char **envp) detect that we were woken up by C-g, we return -1 with errno set to EINTR as on Unix. */ -/* From ntterm.c */ +/* From w32console.c */ extern HANDLE keyboard_handle; /* From w32xfns.c */ @@ -1559,8 +1557,6 @@ sys_kill (int pid, int sig) return rc; } -/* extern int report_file_error (char *, Lisp_Object); */ - /* The following two routines are used to manipulate stdin, stdout, and stderr of our child processes. @@ -1660,7 +1656,7 @@ set_process_dir (char * dir) dial-up users to only be connected when they actually need to use socket services. */ -/* From nt.c */ +/* From w32.c */ extern HANDLE winsock_lib; extern BOOL term_winsock (void); extern BOOL init_winsock (int load_now); diff --git a/src/w32select.c b/src/w32select.c index 23d5fb68c7..ef0cb3adc2 100644 --- a/src/w32select.c +++ b/src/w32select.c @@ -78,7 +78,6 @@ along with GNU Emacs. If not, see . */ #include "w32term.h" /* for all of the w32 includes */ #include "w32heap.h" /* os_subtype */ #include "blockinput.h" -#include "keyboard.h" /* cmd_error_internal() */ #include "charset.h" #include "coding.h" #include "character.h" @@ -391,6 +390,7 @@ run_protected (Lisp_Object (*code) (Lisp_Object), Lisp_Object arg) with global variables and calling strange looking functions. Is this really the right way to run Lisp callbacks? */ + extern int waiting_for_input; /* from keyboard.c */ int owfi; BLOCK_INPUT; diff --git a/src/w32term.c b/src/w32term.c index 67e853f21f..f31c4e90e7 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -88,8 +88,6 @@ extern void free_frame_menubar (struct frame *); extern int w32_codepage_for_font (char *fontname); extern Cursor w32_load_cursor (LPCTSTR name); -extern Lisp_Object Vwindow_system; - #define x_any_window_to_frame x_window_to_frame #define x_top_window_to_frame x_window_to_frame @@ -138,13 +136,6 @@ BOOL (WINAPI *pfnSetLayeredWindowAttributes) (HWND, COLORREF, BYTE, DWORD); #define WS_EX_LAYERED 0x80000 #endif -/* 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. - In that case, the w32 functions assume that `SELECTED_FRAME ()' - is the frame to apply to. */ -extern struct frame *updating_frame; - /* This is a frame waiting to be autoraised, within w32_read_socket. */ struct frame *pending_autoraise_frame; @@ -2536,8 +2527,7 @@ x_delete_glyphs (struct frame *f, register int n) } -/* Clear entire frame. If updating_frame is non-null, clear that - frame. Otherwise clear the selected frame. */ +/* Clear entire frame. */ static void x_clear_frame (struct frame *f) @@ -6060,7 +6050,7 @@ w32_create_terminal (struct w32_display_info *dpyinfo) 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->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; diff --git a/src/w32term.h b/src/w32term.h index c79352a8db..cf6751b7d6 100644 --- a/src/w32term.h +++ b/src/w32term.h @@ -547,7 +547,7 @@ do { \ #define WM_APPCOMMAND 0x319 #define GET_APPCOMMAND_LPARAM(lParam) (HIWORD(lParam) & 0x7fff) #endif -#ifndef WM_UNICHAR +#ifndef WM_UNICHAR #define WM_UNICHAR 0x109 #endif #ifndef UNICODE_NOCHAR @@ -697,3 +697,7 @@ typedef BOOL (WINAPI * AppendMenuW_Proc) ( IN UINT_PTR, IN LPCWSTR); +extern HWND w32_system_caret_hwnd; +extern int w32_system_caret_height; +extern int w32_system_caret_x; +extern int w32_system_caret_y; diff --git a/src/w32uniscribe.c b/src/w32uniscribe.c index 319f934e3b..39d1ee5c85 100644 --- a/src/w32uniscribe.c +++ b/src/w32uniscribe.c @@ -52,10 +52,6 @@ int uniscribe_available = 0; extern Lisp_Object Quniscribe; extern Lisp_Object Qopentype; -extern int initialized; - -extern struct font_driver uniscribe_font_driver; - /* EnumFontFamiliesEx callback. */ static int CALLBACK add_opentype_font_name_to_list (ENUMLOGFONTEX *, NEWTEXTMETRICEX *, -- cgit v1.2.3 From c96bbc66c6ce2554a0c5336110d5fd9a72ae371a Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Mon, 14 Mar 2011 18:22:53 +0100 Subject: src/ChangeLog: Fix typos. --- src/ChangeLog | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 09413b2648..a1538d8f3f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -6,7 +6,7 @@ (w32_system_caret_x, w32_system_caret_y): Declare extern. * w32select.c: Don't #include "keyboard.h". - (run_protected): Add extern declaration for waiting_for_input. + (run_protected): Add extern declaration for waiting_for_input. * w32.c (Qlocal, noninteractive1, inhibit_window_system): * w32console.c (detect_input_pending, read_input_pending) @@ -25,7 +25,7 @@ 2011-03-14 Chong Yidong - * buffer.c (Fmake_indirect_buffer): Fix incorrect assertion. + * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions. 2011-03-13 Chong Yidong @@ -130,7 +130,7 @@ 2011-03-12 Eli Zaretskii - * termcap.c [MSDOS]: Include "msdos.h. + * termcap.c [MSDOS]: Include "msdos.h". (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent): Constify `char *' arguments and their references according to prototypes in tparam.h. -- cgit v1.2.3 From 0e48bb227a5b9cdabeb845422de33d62ccb1edc5 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Tue, 15 Mar 2011 19:38:57 +0100 Subject: * src/coding.c (detect_coding_iso_2022): Reorganize code to clarify structure. --- src/ChangeLog | 5 ++ src/coding.c | 159 +++++++++++++++++++++++++++++----------------------------- 2 files changed, 85 insertions(+), 79 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index a1538d8f3f..72585209c2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2011-03-15 Andreas Schwab + + * coding.c (detect_coding_iso_2022): Reorganize code to clarify + structure. + 2011-03-14 Juanma Barranquero * lisp.h (VWindow_system, Qfile_name_history): diff --git a/src/coding.c b/src/coding.c index 9a6a4484e5..0c2836c19f 100644 --- a/src/coding.c +++ b/src/coding.c @@ -2954,12 +2954,7 @@ detect_coding_iso_2022 (struct coding_system *coding, const unsigned char *src_end = coding->source + coding->src_bytes; int multibytep = coding->src_multibyte; int single_shifting = 0; - - /* FIXME: Does ID need to be initialized here? The "End of composition" - code below does not initialize ID even though ID is used - afterwards, and perhaps that is a bug. */ - int id = 0; - + int id; int c, c1; int consumed_chars = 0; int i; @@ -2999,40 +2994,11 @@ detect_coding_iso_2022 (struct coding_system *coding, break; single_shifting = 0; ONE_MORE_BYTE (c); - if (c >= '(' && c <= '/') - { - /* Designation sequence for a charset of dimension 1. */ - ONE_MORE_BYTE (c1); - if (c1 < ' ' || c1 >= 0x80 - || (id = iso_charset_table[0][c >= ','][c1]) < 0) - /* Invalid designation sequence. Just ignore. */ - break; - } - else if (c == '$') - { - /* Designation sequence for a charset of dimension 2. */ - ONE_MORE_BYTE (c); - if (c >= '@' && c <= 'B') - /* Designation for JISX0208.1978, GB2312, or JISX0208. */ - id = iso_charset_table[1][0][c]; - else if (c >= '(' && c <= '/') - { - ONE_MORE_BYTE (c1); - if (c1 < ' ' || c1 >= 0x80 - || (id = iso_charset_table[1][c >= ','][c1]) < 0) - /* Invalid designation sequence. Just ignore. */ - break; - } - else - /* Invalid designation sequence. Just ignore it. */ - break; - } - else if (c == 'N' || c == 'O') + if (c == 'N' || c == 'O') { /* ESC for SS2 or SS3. */ single_shifting = 1; rejected |= CATEGORY_MASK_ISO_7BIT | CATEGORY_MASK_ISO_8BIT; - break; } else if (c == '1') { @@ -3048,36 +3014,66 @@ detect_coding_iso_2022 (struct coding_system *coding, { /* ESC for start/end composition. */ composition_count = 0; - break; } else { - /* Invalid escape sequence. Just ignore it. */ - break; - } + if (c >= '(' && c <= '/') + { + /* Designation sequence for a charset of dimension 1. */ + ONE_MORE_BYTE (c1); + if (c1 < ' ' || c1 >= 0x80 + || (id = iso_charset_table[0][c >= ','][c1]) < 0) + /* Invalid designation sequence. Just ignore. */ + break; + } + else if (c == '$') + { + /* Designation sequence for a charset of dimension 2. */ + ONE_MORE_BYTE (c); + if (c >= '@' && c <= 'B') + /* Designation for JISX0208.1978, GB2312, or JISX0208. */ + id = iso_charset_table[1][0][c]; + else if (c >= '(' && c <= '/') + { + ONE_MORE_BYTE (c1); + if (c1 < ' ' || c1 >= 0x80 + || (id = iso_charset_table[1][c >= ','][c1]) < 0) + /* Invalid designation sequence. Just ignore. */ + break; + } + else + /* Invalid designation sequence. Just ignore it. */ + break; + } + else + { + /* Invalid escape sequence. Just ignore it. */ + break; + } - /* We found a valid designation sequence for CHARSET. */ - rejected |= CATEGORY_MASK_ISO_8BIT; - if (SAFE_CHARSET_P (&coding_categories[coding_category_iso_7], - id)) - found |= CATEGORY_MASK_ISO_7; - else - rejected |= CATEGORY_MASK_ISO_7; - if (SAFE_CHARSET_P (&coding_categories[coding_category_iso_7_tight], - id)) - found |= CATEGORY_MASK_ISO_7_TIGHT; - 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 - 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 - rejected |= CATEGORY_MASK_ISO_8_ELSE; + /* We found a valid designation sequence for CHARSET. */ + rejected |= CATEGORY_MASK_ISO_8BIT; + if (SAFE_CHARSET_P (&coding_categories[coding_category_iso_7], + id)) + found |= CATEGORY_MASK_ISO_7; + else + rejected |= CATEGORY_MASK_ISO_7; + if (SAFE_CHARSET_P (&coding_categories[coding_category_iso_7_tight], + id)) + found |= CATEGORY_MASK_ISO_7_TIGHT; + 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 + 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 + rejected |= CATEGORY_MASK_ISO_8_ELSE; + } break; case ISO_CODE_SO: @@ -3105,13 +3101,32 @@ detect_coding_iso_2022 (struct coding_system *coding, 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; + { + 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; + { + found |= CATEGORY_MASK_ISO_8_2; + single_shifting = 1; + } if (single_shifting) break; - goto check_extra_latin; + check_extra_latin: + 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; + break; default: if (c < 0) @@ -3162,20 +3177,6 @@ detect_coding_iso_2022 (struct coding_system *coding, } 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; } } detect_info->rejected |= CATEGORY_MASK_ISO; -- cgit v1.2.3 From 62973b416261f9b43e9026807651554e3cf2c9c3 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Wed, 16 Mar 2011 01:53:19 +0100 Subject: src/emacs.c (USAGE3): Doc fixes. --- src/ChangeLog | 4 ++++ src/emacs.c | 12 ++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 72585209c2..44e4494d79 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2011-03-16 Juanma Barranquero + + * emacs.c (USAGE3): Doc fixes. + 2011-03-15 Andreas Schwab * coding.c (detect_coding_iso_2022): Reorganize code to clarify diff --git a/src/emacs.c b/src/emacs.c index 4455e6b4d9..84092e18b8 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -141,7 +141,7 @@ Lisp_Object Qfile_name_handler_alist; Lisp_Object Qrisky_local_variable; -/* If non-zero, emacs should not attempt to use a window-specific code, +/* If non-zero, Emacs should not attempt to use a window-specific code, but instead should use the virtual terminal under which it was started. */ int inhibit_window_system; @@ -169,7 +169,6 @@ static unsigned long heap_bss_diff; #define MAX_HEAP_BSS_DIFF (1024*1024) /* Nonzero means running Emacs without interactive terminal. */ - int noninteractive; /* Nonzero means remove site-lisp directories from load-path. */ @@ -249,14 +248,14 @@ Display options:\n\ --border-color, -bd COLOR main border color\n\ --border-width, -bw WIDTH width of main border\n\ --color, --color=MODE override color mode for character terminals;\n\ - MODE defaults to `auto', and can also\n\ - be `never', `auto', `always',\n\ + MODE defaults to `auto', and\n\ + can also be `never', `always',\n\ or a mode name like `ansi8'\n\ --cursor-color, -cr COLOR color of the Emacs cursor indicating point\n\ --font, -fn FONT default font; must be fixed-width\n\ --foreground-color, -fg COLOR window foreground color\n\ --fullheight, -fh make the first frame high as the screen\n\ ---fullscreen, -fs make first frame fullscreen\n\ +--fullscreen, -fs make the first frame fullscreen\n\ --fullwidth, -fw make the first frame wide as the screen\n\ --maximized, -mm make the first frame maximized\n\ --geometry, -g GEOMETRY window geometry\n\ @@ -576,7 +575,8 @@ void __main (void) enough information to do it right. */ static int -argmatch (char **argv, int argc, const char *sstr, const char *lstr, int minlen, char **valptr, int *skipptr) +argmatch (char **argv, int argc, const char *sstr, const char *lstr, + int minlen, char **valptr, int *skipptr) { char *p = NULL; int arglen; -- cgit v1.2.3 From 35ac2a97f505a3c0de5cc2d4cf40b5b2f22529d0 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 16 Mar 2011 10:23:26 -0400 Subject: * src/print.c (print_preprocess): Don't forget font objects. --- src/ChangeLog | 4 ++++ src/print.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 44e4494d79..e25ed31f45 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2011-03-16 Stefan Monnier + + * print.c (print_preprocess): Don't forget font objects. + 2011-03-16 Juanma Barranquero * emacs.c (USAGE3): Doc fixes. diff --git a/src/print.c b/src/print.c index 29a4bfab79..f48ba57b57 100644 --- a/src/print.c +++ b/src/print.c @@ -1209,7 +1209,7 @@ print_preprocess (Lisp_Object obj) loop: if (STRINGP (obj) || CONSP (obj) || VECTORP (obj) || COMPILEDP (obj) || CHAR_TABLE_P (obj) || SUB_CHAR_TABLE_P (obj) - || HASH_TABLE_P (obj) + || HASH_TABLE_P (obj) || FONTP (obj) || (! NILP (Vprint_gensym) && SYMBOLP (obj) && !SYMBOL_INTERNED_P (obj))) -- cgit v1.2.3 From fb103ca9a72ab9ddeeea1a9cfef85b0492ab9651 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 16 Mar 2011 13:34:26 -0400 Subject: * src/print.c (PRINT_CIRCLE_CANDIDATE_P): New macro. (print_preprocess, print_object): New macro to fix last change. --- src/ChangeLog | 3 +++ src/print.c | 24 ++++++++++++------------ 2 files changed, 15 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index e25ed31f45..c43d3ba95e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2011-03-16 Stefan Monnier + * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro. + (print_preprocess, print_object): New macro to fix last change. + * print.c (print_preprocess): Don't forget font objects. 2011-03-16 Juanma Barranquero diff --git a/src/print.c b/src/print.c index f48ba57b57..c701164264 100644 --- a/src/print.c +++ b/src/print.c @@ -1173,6 +1173,16 @@ print (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag) print_object (obj, printcharfun, escapeflag); } +#define PRINT_CIRCLE_CANDIDATE_P(obj) \ + (STRINGP (obj) || CONSP (obj) \ + || (VECTORLIKEP (obj) \ + && (VECTORP (obj) || COMPILEDP (obj) \ + || CHAR_TABLE_P (obj) || SUB_CHAR_TABLE_P (obj) \ + || HASH_TABLE_P (obj) || FONTP (obj))) \ + || (! NILP (Vprint_gensym) \ + && SYMBOLP (obj) \ + && !SYMBOL_INTERNED_P (obj))) + /* Construct Vprint_number_table according to the structure of OBJ. OBJ itself and all its elements will be added to Vprint_number_table recursively if it is a list, vector, compiled function, char-table, @@ -1207,12 +1217,7 @@ print_preprocess (Lisp_Object obj) halftail = obj; loop: - if (STRINGP (obj) || CONSP (obj) || VECTORP (obj) - || COMPILEDP (obj) || CHAR_TABLE_P (obj) || SUB_CHAR_TABLE_P (obj) - || HASH_TABLE_P (obj) || FONTP (obj) - || (! NILP (Vprint_gensym) - && SYMBOLP (obj) - && !SYMBOL_INTERNED_P (obj))) + if (PRINT_CIRCLE_CANDIDATE_P (obj)) { if (!HASH_TABLE_P (Vprint_number_table)) { @@ -1389,12 +1394,7 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag error ("Apparently circular structure being printed"); /* Detect circularities and truncate them. */ - if (STRINGP (obj) || CONSP (obj) || VECTORP (obj) - || COMPILEDP (obj) || CHAR_TABLE_P (obj) || SUB_CHAR_TABLE_P (obj) - || HASH_TABLE_P (obj) - || (! NILP (Vprint_gensym) - && SYMBOLP (obj) - && !SYMBOL_INTERNED_P (obj))) + if (PRINT_CIRCLE_CANDIDATE_P (obj)) { if (NILP (Vprint_circle) && NILP (Vprint_gensym)) { -- cgit v1.2.3