diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 82 | ||||
-rw-r--r-- | src/abbrev.c | 74 | ||||
-rw-r--r-- | src/buffer.c | 2 | ||||
-rw-r--r-- | src/coding.c | 2 | ||||
-rw-r--r-- | src/data.c | 6 | ||||
-rw-r--r-- | src/eval.c | 6 | ||||
-rw-r--r-- | src/makefile.w32-in | 4 | ||||
-rw-r--r-- | src/process.c | 6 | ||||
-rw-r--r-- | src/w32proc.c | 82 | ||||
-rw-r--r-- | src/window.c | 107 | ||||
-rw-r--r-- | src/xdisp.c | 10 | ||||
-rw-r--r-- | src/xfns.c | 1 | ||||
-rw-r--r-- | src/xterm.c | 50 | ||||
-rw-r--r-- | src/xterm.h | 1 |
14 files changed, 320 insertions, 113 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index a707d884454..ac6b24aaffa 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,83 @@ +2007-07-22 Nick Roberts <nickrob@snap.net.nz> + + * xdisp.c (decode_mode_spec): Add case 'R' for to test for + remote default-directory. + + * buffer.c (mode-line-format): Describe above case in doc string. + +2007-07-20 Eli Zaretskii <eliz@gnu.org> + + * w32proc.c (IMAGE_NT_OPTIONAL_HDR32_MAGIC, IMAGE_OPTIONAL_HEADER32): + Define if not defined. + +2007-07-18 Jason Rumney <jasonr@gnu.org> + + * w32proc.c (w32_executable_type): Handle 64 bit executables. + +2007-07-18 Richard Stallman <rms@gnu.org> + + * data.c (Fsetq_default): Doc fix. + + * eval.c (Fsetq): Doc fix. + +2007-07-18 Juanma Barranquero <lekktu@gmail.com> + + * coding.c (Ffind_operation_coding_system): + * eval.c (For, Fand): Doc fixes. + Reported by Johan Bockg,Ae(Brd. + +2007-07-18 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xfns.c (Fx_focus_frame): Call x_ewmh_activate_frame. + + * xterm.h: Declare x_ewmh_activate_frame. + + * xterm.c (x_ewmh_activate_frame): New function. + (XTframe_raise_lower): Move code to x_ewmh_activate_frame. + +2007-07-17 Martin Rudalics <rudalics@gmx.at> + + * window.c (Fdisplay_buffer): If largest or LRU window is the + only window, split it even if it is not eligible for splitting. + This restores the original behavior broken by the 2007-07-15 + change. + +2007-07-17 Glenn Morris <rgm@gnu.org> + + * abbrev.c (abbrev_check_chars): New function. + (Fdefine_global_abbrev, Fdefine_mode_abbrev): Call + abbrev_check_chars to check abbrev characters are word + constituents. Doc fix. + +2007-07-17 Stefan Monnier <monnier@iro.umontreal.ca> + + * process.c (Fstart_process, Fmake_network_process) + (read_process_output): Fix up last changes. + +2007-07-16 Eli Zaretskii <eliz@gnu.org> + + * makefile.w32-in (clean): Don't delete *~. + +2007-07-16 Andreas Schwab <schwab@suse.de> + + * window.c (Fdisplay_buffer): Use NILP. + (Fset_window_scroll_bars): Likewise. + +2007-07-15 Martin Rudalics <rudalics@gmx.at> + + * 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. + 2007-07-14 Jason Rumney <jasonr@gnu.org> * process.c [WINDOWSNT]: Don't undefine AF_INET6. @@ -8054,7 +8134,7 @@ 2005-09-19 Kim F. Storm <storm@cua.dk> * editfns.c (Fformat): Don't scan past end of format string that - ends in %. Reported by: Johan Bockg,Ae(Brd. + ends in %. Reported by Johan Bockg,Ae(Brd. 2005-09-18 Andreas Schwab <schwab@suse.de> diff --git a/src/abbrev.c b/src/abbrev.c index 40cad1832fc..6447c450056 100644 --- a/src/abbrev.c +++ b/src/abbrev.c @@ -172,12 +172,79 @@ overwrite a non-system abbreviation of the same name. */) return name; } +/* Check if the characters in ABBREV have word syntax in either the + * current (if global == 0) or standard syntax table. */ +static void +abbrev_check_chars (abbrev, global) + Lisp_Object abbrev; + int global; +{ + int i, i_byte, len, nbad = 0; + int j, found, nuniq = 0; + char *badchars, *baduniq; + + CHECK_STRING (abbrev); + len = SCHARS (abbrev); + + badchars = (char *) alloca (len + 1); + + for (i = 0, i_byte = 0; i < len; ) + { + int c; + + FETCH_STRING_CHAR_ADVANCE (c, abbrev, i, i_byte); + + if (global) + { + /* Copied from SYNTAX in syntax.h, except using FOLLOW_PARENT. */ + Lisp_Object syntax_temp + = SYNTAX_ENTRY_FOLLOW_PARENT (Vstandard_syntax_table, c); + if ( (CONSP (syntax_temp) + ? (enum syntaxcode) (XINT (XCAR (syntax_temp)) & 0xff) + : Swhitespace) != Sword ) badchars[nbad++] = c; + } + else if (SYNTAX (c) != Sword) + badchars[nbad++] = c; + } + + if (nbad == 0) return; + + baduniq = (char *) alloca (nbad + 1); + + for (i = 0; i < nbad; i++) + { + found = 0; + + for (j = 0; j < nuniq; j++) + { + if (badchars[i] == baduniq[j]) + { + found = 1; + break; + } + } + + if (found) continue ; + + baduniq[nuniq++] = badchars[i]; + } + + baduniq[nuniq] = '\0'; + + error ("Some abbrev characters (%s) are not word constituents %s", + baduniq, global ? "in the standard syntax" : "in this mode" ); +} + DEFUN ("define-global-abbrev", Fdefine_global_abbrev, Sdefine_global_abbrev, 2, 2, "sDefine global abbrev: \nsExpansion for %s: ", - doc: /* Define ABBREV as a global abbreviation for EXPANSION. */) + doc: /* Define ABBREV as a global abbreviation for EXPANSION. +The characters in ABBREV must all be word constituents in the standard +syntax table. */) (abbrev, expansion) Lisp_Object abbrev, expansion; { + abbrev_check_chars (abbrev, 1); + Fdefine_abbrev (Vglobal_abbrev_table, Fdowncase (abbrev), expansion, Qnil, make_number (0), Qnil); return abbrev; @@ -185,13 +252,16 @@ DEFUN ("define-global-abbrev", Fdefine_global_abbrev, Sdefine_global_abbrev, 2, DEFUN ("define-mode-abbrev", Fdefine_mode_abbrev, Sdefine_mode_abbrev, 2, 2, "sDefine mode abbrev: \nsExpansion for %s: ", - doc: /* Define ABBREV as a mode-specific abbreviation for EXPANSION. */) + doc: /* Define ABBREV as a mode-specific abbreviation for EXPANSION. +The characters in ABBREV must all be word-constituents in the current mode. */) (abbrev, expansion) Lisp_Object abbrev, expansion; { if (NILP (current_buffer->abbrev_table)) error ("Major mode has no abbrev table"); + abbrev_check_chars (abbrev, 0); + Fdefine_abbrev (current_buffer->abbrev_table, Fdowncase (abbrev), expansion, Qnil, make_number (0), Qnil); return abbrev; diff --git a/src/buffer.c b/src/buffer.c index c74a6cbc2a5..3c46bdc6981 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -5531,6 +5531,8 @@ A string is printed verbatim in the mode line except for %-constructs: %P -- print percent of buffer above bottom of window, perhaps plus Top, or print Bottom or All. %n -- print Narrow if appropriate. + %R -- print R or hyphen. R means that default-directory is on a + remote machine. %t -- visited file is text or binary (if OS supports this distinction). %z -- print mnemonics of keyboard, terminal, and buffer coding systems. %Z -- like %z, but including the end-of-line format. diff --git a/src/coding.c b/src/coding.c index 2b7a7422d5c..52fe696b23d 100644 --- a/src/coding.c +++ b/src/coding.c @@ -7482,7 +7482,7 @@ contents (not yet decoded). If `file-coding-system-alist' specifies a function to call for FILENAME, that function should examine the contents of BUFFER instead of reading the file. -usage: (find-operation-coding-system OPERATION ARGUMENTS ...) */) +usage: (find-operation-coding-system OPERATION ARGUMENTS...) */) (nargs, args) int nargs; Lisp_Object *args; diff --git a/src/data.c b/src/data.c index b31900f9c0c..3e58fb00c3d 100644 --- a/src/data.c +++ b/src/data.c @@ -1452,7 +1452,7 @@ More generally, you can use multiple variables and values, as in This sets each VAR's default value to the corresponding VALUE. The VALUE for the Nth VAR can refer to the new default values of previous VARs. -usage: (setq-default [VAR VALUE...]) */) +usage: (setq-default [VAR VALUE]...) */) (args) Lisp_Object args; { @@ -2406,7 +2406,9 @@ DEFUN ("zerop", Fzerop, Szerop, 1, 1, 0, return Qnil; } -/* Convert between long values and pairs of Lisp integers. */ +/* Convert between long values and pairs of Lisp integers. + Note that long_to_cons returns a single Lisp integer + when the value fits in one. */ Lisp_Object long_to_cons (i) diff --git a/src/eval.c b/src/eval.c index 6de9a5acc99..16661378e82 100644 --- a/src/eval.c +++ b/src/eval.c @@ -330,7 +330,7 @@ DEFUN ("or", For, Sor, 0, UNEVALLED, 0, doc: /* Eval args until one of them yields non-nil, then return that value. The remaining args are not evalled at all. If all args return nil, return nil. -usage: (or CONDITIONS ...) */) +usage: (or CONDITIONS...) */) (args) Lisp_Object args; { @@ -355,7 +355,7 @@ DEFUN ("and", Fand, Sand, 0, UNEVALLED, 0, doc: /* Eval args until one of them yields nil, then return nil. The remaining args are not evalled at all. If no arg yields nil, return the last arg's value. -usage: (and CONDITIONS ...) */) +usage: (and CONDITIONS...) */) (args) Lisp_Object args; { @@ -531,7 +531,7 @@ Thus, (setq x (1+ y)) sets `x' to the value of `(1+ y)'. The second VAL is not computed until after the first SYM is set, and so on; each VAL can use the new value of variables set earlier in the `setq'. The return value of the `setq' form is the value of the last VAL. -usage: (setq SYM VAL SYM VAL ...) */) +usage: (setq [SYM VAL]...) */) (args) Lisp_Object args; { diff --git a/src/makefile.w32-in b/src/makefile.w32-in index d9986fb8368..a896675ab6e 100644 --- a/src/makefile.w32-in +++ b/src/makefile.w32-in @@ -248,8 +248,10 @@ install: $(ALL) # # Maintenance # +# We used to delete *~, s/*~, m/*~ here, but that might inadvertently +# remove precious files if it happens to match their short 8+3 aliases. clean: - - $(DEL) *~ "s/*~" "m/*~" + - $(DEL) "s/*.h~" "m/*.h~" - $(DEL) $(COMPILER_TEMP_FILES) - $(DEL_TREE) $(OBJDIR) - $(DEL) stamp_BLD diff --git a/src/process.c b/src/process.c index b63edbe0b6d..f6e936105f3 100644 --- a/src/process.c +++ b/src/process.c @@ -1776,7 +1776,7 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */) XPROCESS (proc)->encoding_buf = make_uninit_string (0); XPROCESS (proc)->inherit_coding_system_flag - = (NILP (buffer) || !inherit_process_coding_system); + = !(NILP (buffer) || !inherit_process_coding_system); create_process (proc, (char **) new_argv, current_dir); @@ -3553,7 +3553,7 @@ usage: (make-network-process &rest ARGS) */) p->encoding_buf = make_uninit_string (0); p->inherit_coding_system_flag - = (!NILP (tem) || NILP (buffer) || !inherit_process_coding_system); + = !(!NILP (tem) || NILP (buffer) || !inherit_process_coding_system); UNGCPRO; return proc; @@ -5186,7 +5186,7 @@ read_process_output (proc, channel) carryover); p->decoding_carryover = carryover; /* Adjust the multibyteness of TEXT to that of the filter. */ - if (p->filter_multibyte != STRING_MULTIBYTE (text)) + if (!p->filter_multibyte != !STRING_MULTIBYTE (text)) text = (STRING_MULTIBYTE (text) ? Fstring_as_unibyte (text) : Fstring_to_multibyte (text)); diff --git a/src/w32proc.c b/src/w32proc.c index 2120a51fb89..8c99a0a1dff 100644 --- a/src/w32proc.c +++ b/src/w32proc.c @@ -590,6 +590,13 @@ get_result: return pid; } +/* Old versions of w32api headers don't have separate 32-bit and + 64-bit defines, but the one they have matches the 32-bit variety. */ +#ifndef IMAGE_NT_OPTIONAL_HDR32_MAGIC +# define IMAGE_NT_OPTIONAL_HDR32_MAGIC IMAGE_NT_OPTIONAL_HDR_MAGIC +# define IMAGE_OPTIONAL_HEADER32 IMAGE_OPTIONAL_HEADER +#endif + void w32_executable_type (char * filename, int * is_dos_app, int * is_cygnus_app, int * is_gui_app) { @@ -650,33 +657,54 @@ w32_executable_type (char * filename, int * is_dos_app, int * is_cygnus_app, int } else if (nt_header->Signature == IMAGE_NT_SIGNATURE) { - /* Look for cygwin.dll in DLL import list. */ - IMAGE_DATA_DIRECTORY import_dir = - nt_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT]; - IMAGE_IMPORT_DESCRIPTOR * imports; - IMAGE_SECTION_HEADER * section; - - section = rva_to_section (import_dir.VirtualAddress, nt_header); - imports = RVA_TO_PTR (import_dir.VirtualAddress, section, executable); - - for ( ; imports->Name; imports++) - { - char * dllname = RVA_TO_PTR (imports->Name, section, executable); - - /* The exact name of the cygwin dll has changed with - various releases, but hopefully this will be reasonably - future proof. */ - if (strncmp (dllname, "cygwin", 6) == 0) - { - *is_cygnus_app = TRUE; - break; - } - } - - /* Check whether app is marked as a console or windowed (aka - GUI) app. Accept Posix and OS2 subsytem apps as console - apps. */ - *is_gui_app = (nt_header->OptionalHeader.Subsystem == IMAGE_SUBSYSTEM_WINDOWS_GUI); + IMAGE_DATA_DIRECTORY *data_dir = NULL; + if (nt_header->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR32_MAGIC) + { + /* Ensure we are using the 32 bit structure. */ + IMAGE_OPTIONAL_HEADER32 *opt + = (IMAGE_OPTIONAL_HEADER32*) &(nt_header->OptionalHeader); + data_dir = opt->DataDirectory; + *is_gui_app = (opt->Subsystem == IMAGE_SUBSYSTEM_WINDOWS_GUI); + } + /* MingW 3.12 has the required 64 bit structs, but in case older + versions don't, only check 64 bit exes if we know how. */ +#ifdef IMAGE_NT_OPTIONAL_HDR64_MAGIC + else if (nt_header->OptionalHeader.Magic + == IMAGE_NT_OPTIONAL_HDR64_MAGIC) + { + IMAGE_OPTIONAL_HEADER64 *opt + = (IMAGE_OPTIONAL_HEADER64*) &(nt_header->OptionalHeader); + data_dir = opt->DataDirectory; + *is_gui_app = (opt->Subsystem == IMAGE_SUBSYSTEM_WINDOWS_GUI); + } +#endif + if (data_dir) + { + /* Look for cygwin.dll in DLL import list. */ + IMAGE_DATA_DIRECTORY import_dir = + data_dir[IMAGE_DIRECTORY_ENTRY_IMPORT]; + IMAGE_IMPORT_DESCRIPTOR * imports; + IMAGE_SECTION_HEADER * section; + + section = rva_to_section (import_dir.VirtualAddress, nt_header); + imports = RVA_TO_PTR (import_dir.VirtualAddress, section, + executable); + + for ( ; imports->Name; imports++) + { + char * dllname = RVA_TO_PTR (imports->Name, section, + executable); + + /* The exact name of the cygwin dll has changed with + various releases, but hopefully this will be reasonably + future proof. */ + if (strncmp (dllname, "cygwin", 6) == 0) + { + *is_cygnus_app = TRUE; + break; + } + } + } } } diff --git a/src/window.c b/src/window.c index e5dd9b030d9..3fa1e7cff0e 100644 --- a/src/window.c +++ b/src/window.c @@ -64,6 +64,7 @@ static void window_scroll P_ ((Lisp_Object, int, int, int)); static void window_scroll_pixel_based P_ ((Lisp_Object, int, int, int)); static void window_scroll_line_based P_ ((Lisp_Object, int, int, int)); static int window_min_size_1 P_ ((struct window *, int)); +static int window_min_size_2 P_ ((struct window *, int)); static int window_min_size P_ ((struct window *, int, int, int *)); static void size_window P_ ((Lisp_Object, int, int, int, int, int)); static int freeze_window_start P_ ((struct window *, void *)); @@ -2555,7 +2556,6 @@ check_frame_size (frame, rows, cols) *cols = MIN_SAFE_WINDOW_WIDTH; } - /* Value is non-zero if window W is fixed-size. WIDTH_P non-zero means check if W's width can be changed, otherwise check W's height. CHECK_SIBLINGS_P non-zero means check resizablity of WINDOW's @@ -2657,6 +2657,33 @@ window_fixed_size_p (w, width_p, check_siblings_p) return fixed_p; } +/* Return the minimum size for leaf window W. WIDTH_P non-zero means + take into account fringes and the scrollbar of W. WIDTH_P zero + means take into account mode-line and header-line of W. Return 1 + for the minibuffer. */ + +static int +window_min_size_2 (w, width_p) + struct window *w; + int width_p; +{ + int size; + + if (width_p) + size = max (window_min_width, + (MIN_SAFE_WINDOW_WIDTH + + WINDOW_FRINGE_COLS (w) + + WINDOW_SCROLL_BAR_COLS (w))); + else if (MINI_WINDOW_P (w)) + size = 1; + else + size = max (window_min_height, + (MIN_SAFE_WINDOW_HEIGHT + + (WINDOW_WANTS_MODELINE_P (w) ? 1 : 0) + + (WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0 ))); + + return size; +} /* Return the minimum size of window W, not taking fixed-width windows into account. WIDTH_P non-zero means return the minimum width, @@ -2726,22 +2753,7 @@ window_min_size_1 (w, width_p) } } else - { - if (width_p) - size = max (window_min_width, - (MIN_SAFE_WINDOW_WIDTH - + WINDOW_FRINGE_COLS (w) - + WINDOW_SCROLL_BAR_COLS (w))); - else - { - if (MINI_WINDOW_P (w) - || (!WINDOW_WANTS_MODELINE_P (w) - && !WINDOW_WANTS_HEADER_LINE_P (w))) - size = 1; - else - size = window_min_height; - } - } + size = window_min_size_2 (w, width_p); return size; } @@ -2983,11 +2995,6 @@ size_window (window, size, width_p, nodelete_p, first_only, last_only) Lisp_Object child, *forward, *sideward; int old_size, min_size, safe_min_size; - /* We test nodelete_p != 2 and nodelete_p != 1 below, so it - seems like it's too soon to do this here. ++KFS. */ - if (nodelete_p == 2) - nodelete_p = 0; - check_min_window_sizes (); size = max (0, size); @@ -2998,22 +3005,23 @@ size_window (window, size, width_p, nodelete_p, first_only, last_only) { old_size = WINDOW_TOTAL_COLS (w); min_size = window_min_width; - /* Ensure that there is room for the scroll bar and fringes! - We may reduce display margins though. */ - safe_min_size = (MIN_SAFE_WINDOW_WIDTH - + WINDOW_FRINGE_COLS (w) - + WINDOW_SCROLL_BAR_COLS (w)); + safe_min_size = window_min_size_2 (w, 1); } else { old_size = XINT (w->total_lines); min_size = window_min_height; - safe_min_size = MIN_SAFE_WINDOW_HEIGHT; + safe_min_size = window_min_size_2 (w, 0); } if (old_size < min_size && nodelete_p != 2) w->too_small_ok = Qt; + /* Move the following test here since otherwise the + preceding test doesn't make sense. martin. */ + if (nodelete_p == 2) + nodelete_p = 0; + /* Maybe delete WINDOW if it's too small. */ if (nodelete_p != 1 && !NILP (w->parent)) { @@ -3710,9 +3718,6 @@ displayed. */) frames = Qnil; if (FRAME_MINIBUF_ONLY_P (f)) XSETFRAME (frames, last_nonminibuf_frame); - /* Don't try to create a window if we would get an error. */ - if (split_height_threshold < window_min_height << 1) - split_height_threshold = window_min_height << 1; /* Note that both Fget_largest_window and Fget_lru_window ignore minibuffers and dedicated windows. @@ -3735,25 +3740,30 @@ displayed. */) else window = Fget_largest_window (frames, Qt); - /* If we got a tall enough full-width window that can be split, - split it. */ + /* If the largest window is tall enough, full-width, and either eligible + for splitting or the only window, split it. */ if (!NILP (window) && ! FRAME_NO_SPLIT_P (XFRAME (XWINDOW (window)->frame)) - && window_height (window) >= split_height_threshold - && WINDOW_FULL_WIDTH_P (XWINDOW (window))) + && WINDOW_FULL_WIDTH_P (XWINDOW (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 { Lisp_Object upper, lower, other; window = Fget_lru_window (frames, Qt); - /* If the LRU window is selected, and big enough, - and can be split, 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) - || EQ (XWINDOW (window)->parent, Qnil)) - && window_height (window) >= window_min_height << 1) + && ((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); @@ -4002,9 +4012,11 @@ See Info node `(elisp)Splitting Windows' for more details and examples.*/) if (NILP (horflag)) { - if (size_int < window_min_height) + int window_safe_height = window_min_size_2 (o, 0); + + if (size_int < window_safe_height) error ("Window height %d too small (after splitting)", size_int); - if (size_int + window_min_height > XFASTINT (o->total_lines)) + if (size_int + window_safe_height > XFASTINT (o->total_lines)) error ("Window height %d too small (after splitting)", XFASTINT (o->total_lines) - size_int); if (NILP (o->parent) @@ -4017,10 +4029,11 @@ See Info node `(elisp)Splitting Windows' for more details and examples.*/) } else { - if (size_int < window_min_width) + int window_safe_width = window_min_size_2 (o, 1); + + if (size_int < window_safe_width) error ("Window width %d too small (after splitting)", size_int); - - if (size_int + window_min_width > XFASTINT (o->total_cols)) + if (size_int + window_safe_width > XFASTINT (o->total_cols)) error ("Window width %d too small (after splitting)", XFASTINT (o->total_cols) - size_int); if (NILP (o->parent) @@ -4501,7 +4514,7 @@ adjust_window_trailing_edge (window, delta, horiz_flag) /* Don't make this window too small. */ if (XINT (CURSIZE (window)) + delta - < (horiz_flag ? window_min_width : window_min_height)) + < window_min_size_2 (XWINDOW (window), horiz_flag)) { Fset_window_configuration (old_config); error ("Cannot adjust window size as specified"); @@ -6899,7 +6912,7 @@ Fourth parameter HORIZONTAL-TYPE is currently unused. */) vertical_type = Qnil; } - if (!(EQ (vertical_type, Qnil) + if (!(NILP (vertical_type) || EQ (vertical_type, Qleft) || EQ (vertical_type, Qright) || EQ (vertical_type, Qt))) diff --git a/src/xdisp.c b/src/xdisp.c index ca6939109a9..d35d92cfc26 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -18006,6 +18006,16 @@ decode_mode_spec (w, c, field_width, precision, multibyte) #endif break; + case 'R': + { + Lisp_Object val; + val = call1 (intern ("file-remote-p"), current_buffer->directory); + if (NILP (val)) + return "-"; + else + return "@"; + } + case 't': /* indicate TEXT or BINARY */ #ifdef MODE_LINE_BINARY_TEXT return MODE_LINE_BINARY_TEXT (b); diff --git a/src/xfns.c b/src/xfns.c index 0dab5d9dd64..46acd4a77e5 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -3530,6 +3530,7 @@ FRAME nil means use the selected frame. */) x_catch_errors (dpy); XSetInputFocus (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), RevertToParent, CurrentTime); + x_ewmh_activate_frame (f); x_uncatch_errors (); UNBLOCK_INPUT; diff --git a/src/xterm.c b/src/xterm.c index 9f392710270..2873a2a76c9 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -8893,38 +8893,36 @@ x_lower_frame (f) } } +/* Activate frame with Extended Window Manager Hints */ + +void +x_ewmh_activate_frame (f) + FRAME_PTR f; +{ + /* See Window Manager Specification/Extended Window Manager Hints at + http://freedesktop.org/wiki/Standards_2fwm_2dspec */ + + const char *atom = "_NET_ACTIVE_WINDOW"; + if (f->async_visible && wm_supports (f, atom)) + { + Lisp_Object frame; + XSETFRAME (frame, f); + Fx_send_client_event (frame, make_number (0), frame, + make_unibyte_string (atom, strlen (atom)), + make_number (32), + Fcons (make_number (1), + Fcons (make_number (last_user_time), + Qnil))); + } +} + static void XTframe_raise_lower (f, raise_flag) FRAME_PTR f; int raise_flag; { if (raise_flag) - { - /* The following code is needed for `raise-frame' to work on - some versions of metacity; see Window Manager - Specification/Extended Window Manager Hints at - http://freedesktop.org/wiki/Standards_2fwm_2dspec */ - -#if 0 - /* However, on other versions (metacity 2.17.2-1.fc7), it - reportedly causes hangs when resizing frames. */ - - const char *atom = "_NET_ACTIVE_WINDOW"; - if (f->async_visible && wm_supports (f, atom)) - { - Lisp_Object frame; - XSETFRAME (frame, f); - Fx_send_client_event (frame, make_number (0), frame, - make_unibyte_string (atom, strlen (atom)), - make_number (32), - Fcons (make_number (1), - Fcons (make_number (last_user_time), - Qnil))); - } - else -#endif - x_raise_frame (f); - } + x_raise_frame (f); else x_lower_frame (f); } diff --git a/src/xterm.h b/src/xterm.h index 34583221ad3..acfa2cf0d9e 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -989,6 +989,7 @@ extern void x_clear_errors P_ ((Display *)); 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)); +extern void x_ewmh_activate_frame P_ ((struct frame *)); extern void x_raise_frame P_ ((struct frame *)); extern void x_lower_frame P_ ((struct frame *)); extern void x_make_frame_visible P_ ((struct frame *)); |