diff options
author | Andrea Corallo <akrl@sdf.org> | 2020-10-04 19:45:05 +0200 |
---|---|---|
committer | Andrea Corallo <akrl@sdf.org> | 2020-10-04 19:45:05 +0200 |
commit | 44ef24342fd8a2ac876212124ebf38673acda35a (patch) | |
tree | 793dc4ba4197559b4bc65339d713c0807a7b2ca9 /src | |
parent | afb765ab3cab7b6582d0def543b23603cd076445 (diff) | |
parent | d8665e6d3473403c90a0831e83439a013d0012d3 (diff) | |
download | emacs-44ef24342fd8a2ac876212124ebf38673acda35a.tar.gz emacs-44ef24342fd8a2ac876212124ebf38673acda35a.tar.bz2 emacs-44ef24342fd8a2ac876212124ebf38673acda35a.zip |
Merge remote-tracking branch 'savannah/master' into HEAD
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog.10 | 14 | ||||
-rw-r--r-- | src/ChangeLog.11 | 20 | ||||
-rw-r--r-- | src/ChangeLog.12 | 10 | ||||
-rw-r--r-- | src/ChangeLog.13 | 32 | ||||
-rw-r--r-- | src/ChangeLog.3 | 6 | ||||
-rw-r--r-- | src/ChangeLog.8 | 10 | ||||
-rw-r--r-- | src/ChangeLog.9 | 2 | ||||
-rw-r--r-- | src/dbusbind.c | 17 | ||||
-rw-r--r-- | src/image.c | 10 | ||||
-rw-r--r-- | src/indent.c | 30 | ||||
-rw-r--r-- | src/w16select.c | 2 | ||||
-rw-r--r-- | src/w32.c | 9 | ||||
-rw-r--r-- | src/w32select.c | 2 | ||||
-rw-r--r-- | src/xdisp.c | 95 |
14 files changed, 167 insertions, 92 deletions
diff --git a/src/ChangeLog.10 b/src/ChangeLog.10 index 1c954b20eec..fbbd3608909 100644 --- a/src/ChangeLog.10 +++ b/src/ChangeLog.10 @@ -9344,7 +9344,7 @@ * 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. + Remove member overlay_arrow_p, superseded by overlay_arrow_bitmap. * dispnew.c (row_equal_p, update_window_line, scrolling_window): Compare overlay_arrow_bitmap than overlay_arrow_p members. @@ -11141,7 +11141,7 @@ * 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. + (syms_of_eval): Don't initialize it. * lread.c (syms_of_lread) <load-history>: Doc fix. @@ -18716,7 +18716,7 @@ 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. + superseded 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. @@ -19145,7 +19145,7 @@ (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. + argument is in ASCII range. 2003-04-08 Richard M. Stallman <rms@gnu.org> @@ -19945,7 +19945,7 @@ 2003-03-09 David Kastrup <dak@gnu.org> * process.c (read_process_output): We have allocated enough space - for readmax and carryover, so actually use the alloted space. + for readmax and carryover, so actually use the allotted space. 2003-03-09 Jan Djärv <jan.h.d@swipnet.se> @@ -24638,7 +24638,7 @@ * w32gui.h (struct XImage): Define. * w32term.c (w32_read_socket) <WM_XBUTTONUP>: Use XFASTINT to - extract mouse co-ordinates. + extract mouse coordinates. 2002-03-20 Jason Rumney <jasonr@gnu.org> @@ -25377,7 +25377,7 @@ 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 + (syms_of_xdisp): Initialize and staticpro QCpropertize and mode_line_proptrans_alist. 2002-02-11 Kim F. Storm <storm@cua.dk> diff --git a/src/ChangeLog.11 b/src/ChangeLog.11 index 2942d35561a..1086d1183a2 100644 --- a/src/ChangeLog.11 +++ b/src/ChangeLog.11 @@ -947,7 +947,7 @@ (c_string_pos, number_of_chars, message_dolog): (message_log_check_duplicate, set_message_1, store_mode_line_noprop): (display_mode_element, display_string): - Switch between char * and unsigned char * to stay compatible wth + Switch between char * and unsigned char * to stay compatible with C89 pointer rules. * regex.c: Conform to C89 pointer rules. @@ -9492,7 +9492,7 @@ * coding.c (decode_coding_ccl): Fix previous change for the multibyte case. (encode_coding_ccl): Don't setup ccl program here. Fix for the - case that the output buffer is fullfilled. + case that the output buffer is fulfilled. (encode_coding): Setup ccl program here. 2010-03-23 Dan Nicolaescu <dann@ics.uci.edu> @@ -9772,10 +9772,10 @@ 2010-02-17 Kenichi Handa <handa@m17n.org> * coding.c (decode_coding_ccl): Don't setup ccl program here. - Fix for the case that the output buffer is fullfilled. + Fix for the case that the output buffer is fulfilled. (decode_coding): Setup ccl program here. Keep looping when the decoder stopped because the output buffer is - fullfilled (bug#5534). + fulfilled (bug#5534). * ccl.c (ccl_driver): Never reset ic to CCL_HEADER_MAIN. @@ -23923,7 +23923,7 @@ 2008-02-01 Kenichi Handa <handa@m17n.org> - * alloc.c (NSTATICS): Increas to 0x600. + * alloc.c (NSTATICS): Increase to 0x600. 2008-02-01 Kenichi Handa <handa@m17n.org> @@ -25309,12 +25309,12 @@ * coding.c (enum iso_code_class_type): Delete ISO_carriage_return. (CODING_GET_INFO): Delete argument eol_type. Change callers. - (decode_coding_utf_8): Don't do eol converion. + (decode_coding_utf_8): Don't do eol conversion. (detect_coding_utf_16): Check coding->src_chars, not coding->src_bytes. Add heuristics for those that have no signature. (decode_coding_emacs_mule, decode_coding_iso_2022) (decode_coding_sjis, decode_coding_big5, decode_coding_charset): - Don't do eol converion. + Don't do eol conversion. (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 @@ -25952,7 +25952,7 @@ (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. + list of registry names. * xfns.c (x_set_font, x_create_tip_frame): Adjust for the change of x_new_fontset. @@ -26647,7 +26647,7 @@ (fontset_set): Delete. (fontset_face): New arg FACE. Return face ID, not face. Complete re-write to handle new fontset structure. Change caller. - (free_face_fontset): Use ASET istead of AREF (X) = Y. + (free_face_fontset): Use ASET instead 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 @@ -31141,7 +31141,7 @@ * term.c (term_mouse_highlight): Remove unused variables. (Fterm_open_connection): Set gpm_zerobased to 1. (term_mouse_movement, term_mouse_click, handle_one_term_event): - Use zero based co-ordinates. + Use zero based coordinates. (handle_one_term_event): Report a drag as mouse movement too. * Makefile.in (MOUSE_SUPPORT): Define for HAVE_GPM. diff --git a/src/ChangeLog.12 b/src/ChangeLog.12 index 0397a495212..04983fe03e6 100644 --- a/src/ChangeLog.12 +++ b/src/ChangeLog.12 @@ -239,7 +239,7 @@ * lisp.h (find_next_newline_no_quit): Rename to find_next_newline. * xdisp.c (back_to_previous_line_start, forward_to_next_line_start) - (get_visually_first_element, move_it_vertically_backward): Ajust users. + (get_visually_first_element, move_it_vertically_backward): Adjust users. * bidi.c (bidi_find_paragraph_start): Likewise. * indent.c (vmotion): Likewise. @@ -7335,7 +7335,7 @@ 2012-08-17 Chong Yidong <cyd@gnu.org> - * xfaces.c (merge_face_vectors): If the target font specfies a + * xfaces.c (merge_face_vectors): If the target font specifies a font spec, make the font's attributes take precedence over directly-specified attributes. (merge_face_ref): Recognize :font. @@ -9265,7 +9265,7 @@ * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog) (initFromContents): Use SSDATA where appropriate. - (ns_update_menubar): Add braces to ambigous if-else. + (ns_update_menubar): Add braces to ambiguous if-else. (initWithTitle): Put () around assignment in if statement. (ns_menu_show): Remove unused variables window and keymap. (update_frame_tool_bar): Remove unused variable selected_p. @@ -14333,7 +14333,7 @@ 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org> - * process.c (wait_reading_process_output): Fix asynchrounous + * process.c (wait_reading_process_output): Fix asynchronous GnuTLS socket handling on some versions of the GnuTLS library. (wait_reading_process_output): Add comment and URL. @@ -21271,7 +21271,7 @@ not the number of arguments given. This is simpler and lets GCC 4.6.0 generate slightly better code. - * ftfont.c: Distingish more carefully between FcChar8 and char. + * ftfont.c: Distinguish more carefully between FcChar8 and char. The previous code passed unsigned char * to a functions like strlen and xstrcasecmp that expect char *, which does not conform to the C standard. diff --git a/src/ChangeLog.13 b/src/ChangeLog.13 index 791de9a6a8b..87055d70315 100644 --- a/src/ChangeLog.13 +++ b/src/ChangeLog.13 @@ -580,7 +580,7 @@ (x_intersect_rectangles, clear_mouse_face, display_tty_menu_item): * lisp.h (setup_echo_area_for_printing, message_with_string) (pos_visible_p): Use bool for boolean. - * xdisp.c: Use bool, true, false intstead of int, 1, 0. + * xdisp.c: Use bool, true, false instead of int, 1, 0. Remove unnecessary forward decls. (trace_move) [DEBUG_TRACE_MOVE]: Now static. (CHECK_IT, CHECK_WINDOW_END): @@ -685,7 +685,7 @@ Inhibit resizing fullwidth-/height frames in one direction only. Update frame_size_history. (adjust_frame_size): Call frame_size_history_add. - (make_frame): Initalize after_make_frame slot. + (make_frame): Initialize after_make_frame slot. (Fmake_terminal_frame): Adjust adjust_frame_size call. (Fcan_run_window_configuration_change_hook): Rename to Fframe_after_make_frame. Set after_make_frame slot. @@ -1419,7 +1419,7 @@ 2015-01-12 Paul Eggert <eggert@cs.ucla.edu> - Port to 32-bit MingGW --with-wide-int + Port to 32-bit MinGW --with-wide-int Problem reported by Eli Zaretskii in: https://lists.gnu.org/r/emacs-devel/2015-01/msg00265.html * lisp.h (struct Lisp_Sub_Char_Table): Check that offset matches @@ -1635,7 +1635,7 @@ 2015-01-06 Jan Djärv <jan.h.d@swipnet.se> * nsterm.m (x_set_window_size): Call updateFrameSize to get real - size instead of using widht/height. The frame may be + size instead of using width/height. The frame may be constrained (Bug#19482). 2015-01-05 Paul Eggert <eggert@cs.ucla.edu> @@ -2102,7 +2102,7 @@ Partially disabled previous change. * image.c (svg_load): Temporarily disabled filename thing for - not-a-file case as it can cause crashs. + not-a-file case as it can cause crashes. 2014-12-17 Ulf Jasper <ulf.jasper@web.de> @@ -2807,7 +2807,7 @@ * nsselect.m (QCLIPBOARD, QSECONDARY, QTEXT, QFILE_NAME) (NXPrimaryPboard, NXSecondaryPboard): Declare static. (Qforeign_selection): Remove. - (ns_get_local_selection): Identation fix. + (ns_get_local_selection): Indentation fix. (syms_of_nsselect): Remove Qforeign_selection, ns-lost-selection-hooks * nsselect.m (ns_get_local_selection): Remove calling of @@ -5162,7 +5162,7 @@ 2014-07-27 Jan Djärv <jan.h.d@swipnet.se> * nsterm.m (applicationDidFinishLaunching antialiasThresholdDidChange): - Reinstate code removed by the prevoius commit to this file. + Reinstate code removed by the previous commit to this file. 2014-07-27 Martin Rudalics <rudalics@gmx.at> @@ -7847,11 +7847,11 @@ * w32.c (unsetenv): Remove unused var `retval'. (emacs_gnutls_pull): Remove unused vars `fdset' and `timeout'. - * w32notify.c (watch_worker): Remove unnecesary var sleep_result. + * w32notify.c (watch_worker): Remove unnecessary var sleep_result. (start_watching): Remove unused var `thr'. * w32proc.c (sys_spawnve): Comment out unused vars `first', `last'. - (find_child_console): Remove unnecesary var `thread_id'. + (find_child_console): Remove unnecessary var `thread_id'. * w32term.c (w32_read_socket): Comment out unused vars `row', `columns'. (x_focus_frame): #ifdef 0 unused variable `dpyinfo'. @@ -9004,7 +9004,7 @@ * widget.c (pixel_to_text_size): New function. (update_wm_hints): Have size hints respect value of frame_resize_pixelwise. - (EmacsFrameResize): Alway process resize requests pixelwise. + (EmacsFrameResize): Always process resize requests pixelwise. * window.c (grow_mini_window): Make sure mini window is at least one line tall. * xdisp.c (display_menu_bar): Make sure menubar extends till @@ -10768,7 +10768,7 @@ * search.c (find_newline): Rewrite to prefer offsets to pointers. This avoids undefined behavior when subtracting pointers into - different aways. On my platform it also makes the code a tad + different always. On my platform it also makes the code a tad smaller and presumably faster. 2013-11-11 Stefan Monnier <monnier@iro.umontreal.ca> @@ -13849,7 +13849,7 @@ 2013-08-13 Jan Djärv <jan.h.d@swipnet.se> - * nsterm.m (ns_set_vertical_scroll_bar): Fix breakage intruduced by + * nsterm.m (ns_set_vertical_scroll_bar): Fix breakage introduced by 2013-08-13 checkin below. Change bool to BOOL, rule is: All Obj-C code uses BOOL, except for interfaces callable from C. @@ -14041,7 +14041,7 @@ the caller. Do not lock the temp file. Unwind-protect the file and the file-descriptor. (Fcall_process_region): If the input is /dev/null, unwind-protect it. - If an asynchrounous process, record it here, not in call_process. + If an asynchronous process, record it here, not in call_process. (syms_of_callproc) [MSDOS]: Initialize synch_process_tempfile. * eval.c (set_unwind_protect): New function. * fileio.c (write_region): New function, generalized from the @@ -14764,7 +14764,7 @@ All callers changed. (create_process): Recover pty_flag from process, not from volatile local. (create_pty): Stay inside array even when pty allocation fails. - (Fmake_serial_process): Omit unnecessary initializaiton of pty_flag. + (Fmake_serial_process): Omit unnecessary initialization of pty_flag. * lread.c (Fload): Avoid initialization only when lint checking. Mention that it's needed only for older GCCs. @@ -17372,7 +17372,7 @@ 2013-03-31 Dmitry Antipov <dmantipov@yandex.ru> * frame.h (struct frame): Drop scroll_bottom_vpos - member becaue all real users are dead long ago. + member because all real users are dead long ago. (FRAME_SCROLL_BOTTOM_VPOS): Remove. * xdisp.c (redisplay_internal): Adjust user. @@ -17394,7 +17394,7 @@ (menuNeedsUpdate:): Add check for ! COCOA || OSX < 10.5 (Bug#12698). * nsterm.m (menu_will_open_state, menu_mouse_point) - (menu_pending_title): New varaibles. + (menu_pending_title): New variables. (ns_get_pending_menu_title, ns_check_menu_open) (ns_check_pending_open_menu): New functions. diff --git a/src/ChangeLog.3 b/src/ChangeLog.3 index 973251859c1..4e403058837 100644 --- a/src/ChangeLog.3 +++ b/src/ChangeLog.3 @@ -11656,8 +11656,8 @@ pixel_to_glyph_translation, and rewritten. Just get coordinates, don't return anything. (buffer_posn_from_coords): New function - given a window and - co-ordinates on the screen, find the buffer position at those - co-ordinates. + coordinates on the screen, find the buffer position at those + coordinates. 1991-01-08 Jim Blandy (jimb@geech.ai.mit.edu) @@ -16140,7 +16140,7 @@ New format %S converts everything (even strings) with prin1. * doprnt.c (doprnt): Treat %s like %S. - * print.c (Fprin1_to_string): Opt 3nd arg non-nil does princ. + * print.c (Fprin1_to_string): Opt 3rd arg non-nil does princ. 1988-12-31 Richard Stallman (rms@sugar-bombs.ai.mit.edu) diff --git a/src/ChangeLog.8 b/src/ChangeLog.8 index 17522e450f0..c7b99a443d5 100644 --- a/src/ChangeLog.8 +++ b/src/ChangeLog.8 @@ -1572,7 +1572,7 @@ (wait_reading_process_input): Use emacs_strerror, not strerror. * process.c (status_message, sigchld_handler): Synchronize locale, - then use strsignal istead of sys_siglist. + then use strsignal instead of sys_siglist. * w32proc.c (sys_wait): Likewise. * s/aix3-1.h, s/bsd4-1.h, s/dgux.h, s/gnu-linux.h, s/hiuxmpp.h: @@ -7560,7 +7560,7 @@ (recompute_basic_faces): Realize basic faces only if face cache is allocated, i.e. after init_frame_faces has been called. - * frame.c (make_frame): Initialze face cache with null. + * frame.c (make_frame): Initialize face cache with null. * xfaces.c (same_size_fonts): Remove. @@ -9810,7 +9810,7 @@ 1997-10-13 Gerd Moellmann <gerd@acm.org> * xdisp.c (redisplay_window): Use available current matrix to - skip faster when only point is moved withing the window. + skip faster when only point is moved within the window. * intervals.c: Include stdio.h. (find_interval): Trace to stderr to catch some nasty error @@ -9859,7 +9859,7 @@ * emacs.c: FreeBSD headers for profiling removed. * dispnew.c (direct_output_for_insert): Don't use PT-1 for - display cursor, use DEC_POS instread. + display cursor, use DEC_POS instead. * xfaces.c (load_font): Use x_load_font to load fonts so that all fonts are in the font table. @@ -11940,7 +11940,7 @@ This avoids a conflict with a system header file paths.h on GNU/Linux. * callproc.c, lread.c, w32fns.c, xfns.c, xrdb.c: - Use epaths.h istead of paths.h. + Use epaths.h instead of paths.h. 1999-02-26 Andreas Schwab <schwab@gnu.org> diff --git a/src/ChangeLog.9 b/src/ChangeLog.9 index 9f12748fbeb..0c1f72a6787 100644 --- a/src/ChangeLog.9 +++ b/src/ChangeLog.9 @@ -10388,7 +10388,7 @@ ISO_control_0 and ISO_control_1. * coding.h (enum iso_code_class_type): Member ISO_control_code is - devided into ISO_control_0 and ISO_control_1. + divided into ISO_control_0 and ISO_control_1. (struct coding_system): New members src_multibyte, dst_multibyte, errors, and result. Delete member fake_multibyte. (CODING_REQUIRE_DECODING): Return 1 if coding->dst_multibyte is diff --git a/src/dbusbind.c b/src/dbusbind.c index b06077d3b58..cca5f13907d 100644 --- a/src/dbusbind.c +++ b/src/dbusbind.c @@ -209,9 +209,12 @@ xd_dbus_type_to_symbol (int type) : Qnil; } +#define XD_KEYWORDP(object) !NILP (Fkeywordp (object)) + /* Check whether a Lisp symbol is a predefined D-Bus type symbol. */ #define XD_DBUS_TYPE_P(object) \ - (SYMBOLP (object) && ((xd_symbol_to_dbus_type (object) != DBUS_TYPE_INVALID))) + XD_KEYWORDP (object) && \ + ((xd_symbol_to_dbus_type (object) != DBUS_TYPE_INVALID)) /* Determine the DBusType of a given Lisp OBJECT. It is used to convert Lisp objects, being arguments of `dbus-call-method' or @@ -463,6 +466,7 @@ xd_signature (char *signature, int dtype, int parent_type, Lisp_Object object) CHECK_CONS (object); elt = XD_NEXT_VALUE (elt); + CHECK_CONS (elt); subtype = XD_OBJECT_TO_DBUS_TYPE (CAR_SAFE (elt)); xd_signature (x, subtype, dtype, CAR_SAFE (XD_NEXT_VALUE (elt))); @@ -474,11 +478,12 @@ xd_signature (char *signature, int dtype, int parent_type, Lisp_Object object) break; case DBUS_TYPE_STRUCT: - /* A struct list might contain any number of elements with - different types. No further check needed. */ + /* A struct list might contain any (but zero) number of elements + with different types. No further check needed. */ CHECK_CONS (object); elt = XD_NEXT_VALUE (elt); + CHECK_CONS (elt); /* Compose the signature from the elements. It is enclosed by parentheses. */ @@ -509,6 +514,7 @@ xd_signature (char *signature, int dtype, int parent_type, Lisp_Object object) /* First element. */ elt = XD_NEXT_VALUE (elt); + CHECK_CONS (elt); subtype = XD_OBJECT_TO_DBUS_TYPE (CAR_SAFE (elt)); xd_signature (x, subtype, dtype, CAR_SAFE (XD_NEXT_VALUE (elt))); xd_signature_cat (signature, x); @@ -518,6 +524,7 @@ xd_signature (char *signature, int dtype, int parent_type, Lisp_Object object) /* Second element. */ elt = CDR_SAFE (XD_NEXT_VALUE (elt)); + CHECK_CONS (elt); subtype = XD_OBJECT_TO_DBUS_TYPE (CAR_SAFE (elt)); xd_signature (x, subtype, dtype, CAR_SAFE (XD_NEXT_VALUE (elt))); xd_signature_cat (signature, x); @@ -1227,7 +1234,7 @@ this connection to those buses. */) xd_add_watch, xd_remove_watch, xd_toggle_watch, - SYMBOLP (bus) + XD_KEYWORDP (bus) ? (void *) XSYMBOL (bus) : (void *) XSTRING (bus), NULL)) @@ -1793,7 +1800,7 @@ xd_read_queued_messages (int fd, void *data) while (!NILP (busp)) { key = CAR_SAFE (CAR_SAFE (busp)); - if ((SYMBOLP (key) && XSYMBOL (key) == data) + if ((XD_KEYWORDP (key) && XSYMBOL (key) == data) || (STRINGP (key) && XSTRING (key) == data)) bus = key; busp = CDR_SAFE (busp); diff --git a/src/image.c b/src/image.c index 6ecf6a70fe2..25d5af8a8d5 100644 --- a/src/image.c +++ b/src/image.c @@ -2329,8 +2329,14 @@ lookup_image (struct frame *f, Lisp_Object spec, int face_id) struct image *img; EMACS_UINT hash; - struct face *face = (face_id >= 0) ? FACE_FROM_ID (f, face_id) - : FACE_FROM_ID (f, DEFAULT_FACE_ID); + if (FRAME_FACE_CACHE (f) == NULL) + init_frame_faces (f); + if (FRAME_FACE_CACHE (f)->used == 0) + recompute_basic_faces (f); + if (face_id < 0 || face_id >= FRAME_FACE_CACHE (f)->used) + face_id = DEFAULT_FACE_ID; + + struct face *face = FACE_FROM_ID (f, face_id); unsigned long foreground = FACE_COLOR_TO_PIXEL (face->foreground, f); unsigned long background = FACE_COLOR_TO_PIXEL (face->background, f); diff --git a/src/indent.c b/src/indent.c index 581323b91ee..4ecf02b6b96 100644 --- a/src/indent.c +++ b/src/indent.c @@ -524,9 +524,11 @@ check_display_width (ptrdiff_t pos, ptrdiff_t col, ptrdiff_t *endpos) comes first. Return the resulting buffer position and column in ENDPOS and GOALCOL. PREVCOL gets set to the column of the previous position (it's always - strictly smaller than the goal column). */ + strictly smaller than the goal column), and PREVPOS and PREVBPOS get set + to the corresponding buffer character and byte positions. */ static void -scan_for_column (ptrdiff_t *endpos, EMACS_INT *goalcol, ptrdiff_t *prevcol) +scan_for_column (ptrdiff_t *endpos, EMACS_INT *goalcol, + ptrdiff_t *prevpos, ptrdiff_t *prevbpos, ptrdiff_t *prevcol) { int tab_width = SANE_TAB_WIDTH (current_buffer); bool ctl_arrow = !NILP (BVAR (current_buffer, ctl_arrow)); @@ -540,10 +542,12 @@ scan_for_column (ptrdiff_t *endpos, EMACS_INT *goalcol, ptrdiff_t *prevcol) register ptrdiff_t col = 0, prev_col = 0; EMACS_INT goal = goalcol ? *goalcol : MOST_POSITIVE_FIXNUM; ptrdiff_t end = endpos ? *endpos : PT; - ptrdiff_t scan, scan_byte, next_boundary; + ptrdiff_t scan, scan_byte, next_boundary, prev_pos, prev_bpos; scan = find_newline (PT, PT_BYTE, BEGV, BEGV_BYTE, -1, NULL, &scan_byte, 1); next_boundary = scan; + prev_pos = scan; + prev_bpos = scan_byte; window = Fget_buffer_window (Fcurrent_buffer (), Qnil); w = ! NILP (window) ? XWINDOW (window) : NULL; @@ -576,6 +580,8 @@ scan_for_column (ptrdiff_t *endpos, EMACS_INT *goalcol, ptrdiff_t *prevcol) if (col >= goal) break; prev_col = col; + prev_pos = scan; + prev_bpos = scan_byte; { /* Check display property. */ ptrdiff_t endp; @@ -705,6 +711,10 @@ scan_for_column (ptrdiff_t *endpos, EMACS_INT *goalcol, ptrdiff_t *prevcol) *goalcol = col; if (endpos) *endpos = scan; + if (prevpos) + *prevpos = prev_pos; + if (prevbpos) + *prevbpos = prev_bpos; if (prevcol) *prevcol = prev_col; } @@ -720,7 +730,7 @@ current_column_1 (void) EMACS_INT col = MOST_POSITIVE_FIXNUM; ptrdiff_t opoint = PT; - scan_for_column (&opoint, &col, NULL); + scan_for_column (&opoint, &col, NULL, NULL, NULL); return col; } @@ -988,7 +998,7 @@ to reach COLUMN, add spaces/tabs to get there. The return value is the current column. */) (Lisp_Object column, Lisp_Object force) { - ptrdiff_t pos, prev_col; + ptrdiff_t pos, prev_pos, prev_bpos, prev_col; EMACS_INT col; EMACS_INT goal; @@ -997,7 +1007,7 @@ The return value is the current column. */) col = goal; pos = ZV; - scan_for_column (&pos, &col, &prev_col); + scan_for_column (&pos, &col, &prev_pos, &prev_bpos, &prev_col); SET_PT (pos); @@ -1006,18 +1016,16 @@ The return value is the current column. */) if (!NILP (force) && col > goal) { int c; - ptrdiff_t pos_byte = PT_BYTE; - pos_byte -= prev_char_len (pos_byte); - c = FETCH_CHAR (pos_byte); - if (c == '\t' && prev_col < goal) + c = FETCH_CHAR (prev_bpos); + if (c == '\t' && prev_col < goal && prev_bpos < PT_BYTE) { ptrdiff_t 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 adjusted. */ - SET_PT_BOTH (PT - 1, PT_BYTE - 1); + SET_PT_BOTH (prev_pos, prev_bpos); Finsert_char (make_fixnum (' '), make_fixnum (goal - prev_col), Qt); /* Now delete the tab, and indent to COL. */ diff --git a/src/w16select.c b/src/w16select.c index 5a68162e25c..b56ced4f2e5 100644 --- a/src/w16select.c +++ b/src/w16select.c @@ -224,7 +224,7 @@ set_clipboard_data (unsigned Format, void *Data, unsigned Size, int Raw) if (!Raw) { - /* avoid using strchr because it recomputes the length everytime */ + /* avoid using strchr because it recomputes the length every time */ while ((dp = memchr (dp, '\n', Size - (dp - dstart))) != 0) { truelen++; diff --git a/src/w32.c b/src/w32.c index 38bbc496563..d4a8d2e6ffb 100644 --- a/src/w32.c +++ b/src/w32.c @@ -6520,7 +6520,8 @@ acl_get_file (const char *fname, acl_type_t type) { xfree (psd); err = GetLastError (); - if (err == ERROR_NOT_SUPPORTED) + if (err == ERROR_NOT_SUPPORTED + || err == ERROR_ACCESS_DENIED) errno = ENOTSUP; else if (err == ERROR_FILE_NOT_FOUND || err == ERROR_PATH_NOT_FOUND @@ -6538,7 +6539,11 @@ acl_get_file (const char *fname, acl_type_t type) be encoded in the current ANSI codepage. */ || err == ERROR_INVALID_NAME) errno = ENOENT; - else if (err == ERROR_NOT_SUPPORTED) + else if (err == ERROR_NOT_SUPPORTED + /* ERROR_ACCESS_DENIED is what we get for a volume + mounted by WebDAV, which evidently doesn't + support ACLs. */ + || err == ERROR_ACCESS_DENIED) errno = ENOTSUP; else errno = EIO; diff --git a/src/w32select.c b/src/w32select.c index 9a4b43bc69a..4e5bd6a00f0 100644 --- a/src/w32select.c +++ b/src/w32select.c @@ -956,7 +956,7 @@ DEFUN ("w32-get-clipboard-data", Fw32_get_clipboard_data, truelen = nbytes; dst = src; - /* avoid using strchr because it recomputes the length everytime */ + /* avoid using strchr because it recomputes the length every time */ while ((dst = memchr (dst, '\r', nbytes - (dst - src))) != NULL) { if (dst[1] == '\n') /* safe because of trailing '\0' */ diff --git a/src/xdisp.c b/src/xdisp.c index 152946363ed..d9101592b2a 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -12400,12 +12400,12 @@ unwind_format_mode_line (Lisp_Object vector) mode_line_string_face_prop = AREF (vector, 5); /* Select window before buffer, since it may change the buffer. */ - if (!NILP (old_window)) + if (WINDOW_LIVE_P (old_window)) { /* If the operation that we are unwinding had selected a window on a different frame, reset its frame-selected-window. For a text terminal, reset its top-frame if necessary. */ - if (!NILP (target_frame_window)) + if (WINDOW_LIVE_P (target_frame_window)) { Lisp_Object frame = WINDOW_FRAME (XWINDOW (target_frame_window)); @@ -12422,7 +12422,7 @@ unwind_format_mode_line (Lisp_Object vector) /* Restore point of target_frame_window's buffer (Bug#32777). But do this only after old_window has been reselected to avoid that the window point of target_frame_window moves. */ - if (!NILP (target_frame_window)) + if (WINDOW_LIVE_P (target_frame_window)) { Lisp_Object buffer = AREF (vector, 10); @@ -12850,23 +12850,68 @@ update_menu_bar (struct frame *f, bool save_match_data, bool hooks_run) Tab-bars ***********************************************************************/ -#ifdef HAVE_WINDOW_SYSTEM - -/* Select `frame' temporarily without running all the code in - do_switch_frame. - FIXME: Maybe do_switch_frame should be trimmed down similarly - when `norecord' is set. */ +/* Restore WINDOW as the selected window and its frame as the selected + frame. If WINDOW is dead but the selected frame is live, make the + latter's selected window the selected window. If both, WINDOW and + the selected frame, are dead, assign selected frame and window from + some arbitrary live frame. Abort if no such frame can be found. */ static void -fast_set_selected_frame (Lisp_Object frame) +restore_selected_window (Lisp_Object window) { - if (!EQ (selected_frame, frame)) + if (WINDOW_LIVE_P (window)) + /* If WINDOW is live, make it the selected window and its frame's + selected window and set the selected frame to its frame. */ { - selected_frame = frame; - selected_window = XFRAME (frame)->selected_window; + selected_window = window; + selected_frame = XWINDOW (window)->frame; + FRAME_SELECTED_WINDOW (XFRAME (selected_frame)) = window; + } + else if (FRAMEP (selected_frame) && FRAME_LIVE_P (XFRAME (selected_frame))) + /* If WINDOW is dead but the selected frame is still live, make the + latter's selected window the selected one. */ + selected_window = FRAME_SELECTED_WINDOW (XFRAME (selected_frame)); + else + /* If WINDOW and the selected frame are dead, choose some live, + non-child and non-tooltip frame as the new selected frame and + make its selected window the selected window. */ + { + Lisp_Object tail; + Lisp_Object frame UNINIT; + + FOR_EACH_FRAME (tail, frame) + { + struct frame *f = XFRAME (frame); + + if (!FRAME_PARENT_FRAME (f) && !FRAME_TOOLTIP_P (f)) + { + selected_frame = frame; + selected_window = FRAME_SELECTED_WINDOW (f); + + return; + } + } + + /* Abort if we cannot find a live frame. */ + emacs_abort (); } } -#endif /* HAVE_WINDOW_SYSTEM */ +/* Restore WINDOW, if live, as its frame's selected window. */ +static void +restore_frame_selected_window (Lisp_Object window) +{ + if (WINDOW_LIVE_P (window)) + /* If WINDOW is live, make it its frame's selected window. If that + frame is the selected frame, make WINDOW the selected window as + well. */ + { + Lisp_Object frame = XWINDOW (window)->frame; + + FRAME_SELECTED_WINDOW (XFRAME (frame)) = window; + if (EQ (frame, selected_frame)) + selected_window = window; + } +} /* Update the tab-bar item list for frame F. This has to be done before we start to fill in any display lines. Called from @@ -12939,9 +12984,10 @@ update_tab_bar (struct frame *f, bool save_match_data) XFRAME (selected_frame)->selected_window)); #ifdef HAVE_WINDOW_SYSTEM Lisp_Object frame; - record_unwind_protect (fast_set_selected_frame, selected_frame); + record_unwind_protect (restore_selected_window, selected_window); XSETFRAME (frame, f); - fast_set_selected_frame (frame); + selected_frame = frame; + selected_window = FRAME_SELECTED_WINDOW (f); #endif /* Build desired tab-bar items from keymaps. */ @@ -13873,9 +13919,10 @@ update_tool_bar (struct frame *f, bool save_match_data) /* Since we only explicitly preserve selected_frame, check that selected_window would be redundant. */ XFRAME (selected_frame)->selected_window)); - record_unwind_protect (fast_set_selected_frame, selected_frame); + record_unwind_protect (restore_selected_window, selected_window); XSETFRAME (frame, f); - fast_set_selected_frame (frame); + selected_frame = frame; + selected_window = FRAME_SELECTED_WINDOW (f); /* Build desired tool-bar items from keymaps. */ new_tool_bar @@ -25217,11 +25264,14 @@ static int display_mode_lines (struct window *w) { Lisp_Object old_selected_window = selected_window; - Lisp_Object old_selected_frame = selected_frame; Lisp_Object new_frame = w->frame; - Lisp_Object old_frame_selected_window = XFRAME (new_frame)->selected_window; + ptrdiff_t count = SPECPDL_INDEX (); int n = 0; + record_unwind_protect (restore_selected_window, selected_window); + record_unwind_protect + (restore_frame_selected_window, XFRAME (new_frame)->selected_window); + if (window_wants_mode_line (w)) { Lisp_Object window; @@ -25287,9 +25337,8 @@ display_mode_lines (struct window *w) ++n; } - XFRAME (new_frame)->selected_window = old_frame_selected_window; - selected_frame = old_selected_frame; - selected_window = old_selected_window; + unbind_to (count, Qnil); + if (n > 0) w->must_be_updated_p = true; return n; |