From 073ca75ba32d3b14aace7ad51c85f83be09376bd Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Wed, 9 Jan 2013 01:50:40 +0200 Subject: * lisp/textmodes/flyspell.el (flyspell-incorrect, flyspell-duplicate): * lisp/progmodes/flymake.el (flymake-errline, flymake-warnline): Use underline style wave on terminals that support it. * src/xfaces.c (tty_supports_face_attributes_p): Return 0 for the case of (supports :underline (:style wave)). Fixes: debbugs:13000 --- src/ChangeLog | 5 +++++ src/xfaces.c | 2 ++ 2 files changed, 7 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 9ab201c8be4..c60fa701385 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2013-01-08 Juri Linkov + + * xfaces.c (tty_supports_face_attributes_p): Return 0 for the case + of (supports :underline (:style wave)). (Bug#13000) + 2013-01-08 Aaron S. Hawley * undo.c (Fprimitive_undo): Move to simple.el. diff --git a/src/xfaces.c b/src/xfaces.c index ed2895c014c..43535b9ea0c 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -4877,6 +4877,8 @@ tty_supports_face_attributes_p (struct frame *f, { if (STRINGP (val)) return 0; /* ttys can't use colored underlines */ + else if (EQ (CAR_SAFE (val), QCstyle) && EQ (CAR_SAFE (CDR_SAFE (val)), Qwave)) + return 0; /* ttys can't use wave underlines */ else if (face_attr_equal_p (val, def_attrs[LFACE_UNDERLINE_INDEX])) return 0; /* same as default */ else -- cgit v1.2.1 From 677d5c928c0da0fd0b3172d2ea023bc73777a06c Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 9 Jan 2013 00:17:47 -0800 Subject: Spelling fixes. * lisp/net/tramp-adb.el (tramp-adb-get-toolbox): Fix misspelling of 'unknown'. --- src/nsfns.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/nsfns.m b/src/nsfns.m index 1750eb62cdf..fac61d2ab53 100644 --- a/src/nsfns.m +++ b/src/nsfns.m @@ -1503,12 +1503,12 @@ Optional arg DIR_ONLY_P, if non-nil, means choose only directories. */) [panel setDelegate: fileDelegate]; panelOK = 0; - if (! NILP (dir_only_p)) + if (! NILP (dir_only_p)) { [panel setCanChooseDirectories: YES]; [panel setCanChooseFiles: NO]; } - + block_input (); #if defined (NS_IMPL_COCOA) && \ MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 @@ -1519,7 +1519,7 @@ Optional arg DIR_ONLY_P, if non-nil, means choose only directories. */) [panel setNameFieldStringValue: [initS lastPathComponent]]; else [panel setNameFieldStringValue: @""]; - + ret = [panel runModal]; #else if (NILP (mustmatch) && NILP (dir_only_p)) @@ -2147,7 +2147,7 @@ In case the execution fails, an error is signaled. */) [NSApp postEvent: nxev atStart: NO]; // If there are other events, the event loop may exit. Keep running - // until the script has been handeled. */ + // until the script has been handled. */ while (! NILP (as_script)) [NSApp run]; -- cgit v1.2.1 From eefd727851555237c7bc205b7ad255c50ba3fff9 Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Wed, 9 Jan 2013 17:50:22 +0400 Subject: * lisp.h (make_gap_1): New prototype. * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special gap size values. * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common naming convention. (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code. * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment. (make_gap_1): New function to adjust the gap of any buffer. * coding.c (coding_alloc_by_making_gap): Use it. * buffer.c (compact_buffer): Likewise. Use BUF_Z_BYTE, BUF_GAP_SIZE, GAP_BYTES_DFL and GAP_BYTES_MIN. Adjust comment. --- src/ChangeLog | 15 +++++++++++++++ src/buffer.c | 18 +++++++----------- src/buffer.h | 10 ++++++++++ src/coding.c | 9 +-------- src/editfns.c | 6 ++---- src/insdel.c | 24 ++++++++++++++++++------ src/lisp.h | 1 + 7 files changed, 54 insertions(+), 29 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index c60fa701385..b2a4845c336 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,18 @@ +2013-01-09 Dmitry Antipov + + * lisp.h (make_gap_1): New prototype. + * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special + gap size values. + * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common + naming convention. + (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code. + * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. + (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment. + (make_gap_1): New function to adjust the gap of any buffer. + * coding.c (coding_alloc_by_making_gap): Use it. + * buffer.c (compact_buffer): Likewise. Use BUF_Z_BYTE, BUF_GAP_SIZE, + GAP_BYTES_DFL and GAP_BYTES_MIN. Adjust comment. + 2013-01-08 Juri Linkov * xfaces.c (tty_supports_face_attributes_p): Return 0 for the case diff --git a/src/buffer.c b/src/buffer.c index 5999fcb7e7d..51c4d9c71da 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -1682,17 +1682,13 @@ compact_buffer (struct buffer *buffer) if (!buffer->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 - accordingly. Keep a minimum size of 20 bytes. */ - int size = min (2000, max (20, (buffer->text->z_byte / 10))); - - if (buffer->text->gap_size > size) - { - struct buffer *save_current = current_buffer; - current_buffer = buffer; - make_gap (-(buffer->text->gap_size - size)); - current_buffer = save_current; - } + size, or larger than GAP_BYTES_DFL bytes, then shrink it + accordingly. Keep a minimum size of GAP_BYTES_MIN bytes. */ + ptrdiff_t size = clip_to_bounds (GAP_BYTES_MIN, + BUF_Z_BYTE (buffer) / 10, + GAP_BYTES_DFL); + if (BUF_GAP_SIZE (buffer) > size) + make_gap_1 (buffer, -(BUF_GAP_SIZE (buffer) - size)); } BUF_COMPACT (buffer) = BUF_MODIFF (buffer); } diff --git a/src/buffer.h b/src/buffer.h index eb6a9d4d3e1..ec9c34b3eb3 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -320,6 +320,16 @@ while (0) #define BUF_BYTES_MAX \ (ptrdiff_t) min (MOST_POSITIVE_FIXNUM - 1, min (SIZE_MAX, PTRDIFF_MAX)) +/* Maximum gap size after compact_buffer, in bytes. Also + used in make_gap_larger to get some extra reserved space. */ + +#define GAP_BYTES_DFL 2000 + +/* Minimum gap size after compact_buffer, in bytes. Also + used in make_gap_smaller to avoid too small gap size. */ + +#define GAP_BYTES_MIN 20 + /* Return the address of byte position N in current buffer. */ #define BYTE_POS_ADDR(n) \ diff --git a/src/coding.c b/src/coding.c index 5285a906823..a9bf9032a69 100644 --- a/src/coding.c +++ b/src/coding.c @@ -1049,14 +1049,7 @@ coding_alloc_by_making_gap (struct coding_system *coding, GPT -= gap_head_used, GPT_BYTE -= gap_head_used; } 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)); - } + make_gap_1 (XBUFFER (coding->dst_object), bytes); } diff --git a/src/editfns.c b/src/editfns.c index df0dad0669d..26dfdac3ba8 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -968,7 +968,7 @@ usage: (save-current-buffer &rest BODY) */) return unbind_to (count, Fprogn (args)); } -DEFUN ("buffer-size", Fbufsize, Sbufsize, 0, 1, 0, +DEFUN ("buffer-size", Fbuffer_size, Sbuffer_size, 0, 1, 0, doc: /* Return the number of characters in the current buffer. If BUFFER, return the number of characters in that buffer instead. */) (Lisp_Object buffer) @@ -4883,12 +4883,10 @@ functions if all the text being accessed has this property. */); defsubr (&Sline_beginning_position); defsubr (&Sline_end_position); -/* defsubr (&Smark); */ -/* defsubr (&Sset_mark); */ defsubr (&Ssave_excursion); defsubr (&Ssave_current_buffer); - defsubr (&Sbufsize); + defsubr (&Sbuffer_size); defsubr (&Spoint_max); defsubr (&Spoint_min); defsubr (&Spoint_min_marker); diff --git a/src/insdel.c b/src/insdel.c index 52a017a62a2..68b3eddb30b 100644 --- a/src/insdel.c +++ b/src/insdel.c @@ -388,14 +388,13 @@ make_gap_larger (ptrdiff_t nbytes_added) ptrdiff_t real_gap_loc_byte; ptrdiff_t old_gap_size; ptrdiff_t current_size = Z_BYTE - BEG_BYTE + GAP_SIZE; - enum { enough_for_a_while = 2000 }; if (BUF_BYTES_MAX - current_size < nbytes_added) buffer_overflow (); /* If we have to get more space, get enough to last a while; but do not exceed the maximum buffer size. */ - nbytes_added = min (nbytes_added + enough_for_a_while, + nbytes_added = min (nbytes_added + GAP_BYTES_DFL, BUF_BYTES_MAX - current_size); enlarge_buffer_text (current_buffer, nbytes_added); @@ -443,9 +442,9 @@ make_gap_smaller (ptrdiff_t nbytes_removed) ptrdiff_t real_beg_unchanged; ptrdiff_t new_gap_size; - /* Make sure the gap is at least 20 bytes. */ - if (GAP_SIZE - nbytes_removed < 20) - nbytes_removed = GAP_SIZE - 20; + /* Make sure the gap is at least GAP_BYTES_MIN bytes. */ + if (GAP_SIZE - nbytes_removed < GAP_BYTES_MIN) + nbytes_removed = GAP_SIZE - GAP_BYTES_MIN; /* Prevent quitting in move_gap. */ tem = Vinhibit_quit; @@ -500,7 +499,20 @@ make_gap (ptrdiff_t nbytes_added) make_gap_smaller (-nbytes_added); #endif } - + +/* Add NBYTES to B's gap. It's enough to temporarily + fake current_buffer and avoid real switch to B. */ + +void +make_gap_1 (struct buffer *b, ptrdiff_t nbytes) +{ + struct buffer *oldb = current_buffer; + + current_buffer = b; + make_gap (nbytes); + current_buffer = oldb; +} + /* Copy NBYTES bytes of text from FROM_ADDR to TO_ADDR. FROM_MULTIBYTE says whether the incoming text is multibyte. TO_MULTIBYTE says whether to store the text as multibyte. diff --git a/src/lisp.h b/src/lisp.h index e22241f6b2c..a0dcc9ab5f3 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -2778,6 +2778,7 @@ extern void move_gap (ptrdiff_t); extern void move_gap_both (ptrdiff_t, ptrdiff_t); extern _Noreturn void buffer_overflow (void); extern void make_gap (ptrdiff_t); +extern void make_gap_1 (struct buffer *, ptrdiff_t); extern ptrdiff_t copy_text (const unsigned char *, unsigned char *, ptrdiff_t, bool, bool); extern int count_combining_before (const unsigned char *, -- cgit v1.2.1 From 2eae9ccc2a057def22f9f06198aa5aefafd69550 Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Wed, 9 Jan 2013 18:08:49 +0400 Subject: * insdel.c (make_gap_larger): Fix comment because gap_left doesn't adjust markers. (make_gap_smaller): Likewise for gap_right. --- src/ChangeLog | 2 +- src/insdel.c | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index b2a4845c336..c6418ddcfac 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -6,7 +6,7 @@ * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common naming convention. (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code. - * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. + * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. Adjust comment. (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment. (make_gap_1): New function to adjust the gap of any buffer. * coding.c (coding_alloc_by_making_gap): Use it. diff --git a/src/insdel.c b/src/insdel.c index 68b3eddb30b..905249d6714 100644 --- a/src/insdel.c +++ b/src/insdel.c @@ -412,8 +412,7 @@ make_gap_larger (ptrdiff_t nbytes_added) GPT_BYTE = Z_BYTE + GAP_SIZE; GAP_SIZE = nbytes_added; - /* Move the new gap down to be consecutive with the end of the old one. - This adjusts the markers properly too. */ + /* Move the new gap down to be consecutive with the end of the old one. */ gap_left (real_gap_loc + old_gap_size, real_gap_loc_byte + old_gap_size, 1); /* Now combine the two into one large gap. */ @@ -467,8 +466,7 @@ make_gap_smaller (ptrdiff_t nbytes_removed) Z_BYTE += new_gap_size; GAP_SIZE = nbytes_removed; - /* Move the unwanted pretend gap to the end of the buffer. This - adjusts the markers properly too. */ + /* Move the unwanted pretend gap to the end of the buffer. */ gap_right (Z, Z_BYTE); enlarge_buffer_text (current_buffer, -nbytes_removed); -- cgit v1.2.1 From 5104861e85b05ce9fc38bf92f5f5973538da6c5c Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Wed, 9 Jan 2013 16:07:01 +0100 Subject: src/w32.c, src/w32term.c: Remove unused local variables. --- src/ChangeLog | 5 +++++ src/w32.c | 2 -- src/w32term.c | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index c6418ddcfac..6ce141331ec 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2013-01-09 Juanma Barranquero + + * w32.c (get_name_and_id, acl_set_file): + * w32term.c (w32fullscreen_hook): Remove unused local variables. + 2013-01-09 Dmitry Antipov * lisp.h (make_gap_1): New prototype. diff --git a/src/w32.c b/src/w32.c index 55581a17de5..812003e96c0 100644 --- a/src/w32.c +++ b/src/w32.c @@ -3648,7 +3648,6 @@ static int get_name_and_id (PSECURITY_DESCRIPTOR psd, unsigned *id, char *nm, int what) { PSID sid = NULL; - char machine[MAX_COMPUTERNAME_LENGTH+1]; BOOL dflt; SID_NAME_USE ignore; char name[UNLEN+1]; @@ -4800,7 +4799,6 @@ acl_set_file (const char *fname, acl_type_t type, acl_t acl) { TOKEN_PRIVILEGES old1, old2; DWORD err; - BOOL res; int st = 0, retval = -1; SECURITY_INFORMATION flags = 0; PSID psid; diff --git a/src/w32term.c b/src/w32term.c index 36ae4d7797f..16c7bd415a5 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -5652,7 +5652,7 @@ x_check_fullscreen (struct frame *f) static void w32fullscreen_hook (FRAME_PTR f) { - static int normal_width, normal_height, normal_top, normal_left; + static int normal_width, normal_height; if (f->async_visible) { -- cgit v1.2.1