commit/XEmacs: 2 new changesets
6 years, 9 months
Bitbucket
2 new commits in XEmacs:
https://bitbucket.org/xemacs/xemacs/commits/46efc7173def/
Changeset: 46efc7173def
User: kehoea
Date: 2017-12-22 12:48:38+00:00
Summary: Remove the last of the X11-specific code, compose.el
2017-12-22 Aidan Kehoe <kehoea(a)parhasard.net>
* compose.el:
[...]
(decide-on-bindings):
Remove the last of the X11-specific code, don't use the UABCD
keysyms for some exotic composed base characters.
Affected #: 2 files
diff -r 3de111a0da7b7880bb1473598b14a4cd84a97200 -r 46efc7173defd0f4f41bd8f3819970c4876c551a lisp/ChangeLog
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -2,6 +2,9 @@
* compose.el: Rename from x-compose.el, it's not
platform-specific.
+ (decide-on-bindings):
+ Remove the last of the X11-specific code, don't use the UABCD
+ keysyms for some exotic composed base characters.
* gtk-compose.el (gtk-compose): Require the new feature.
* isearch-mode.el (isearch-pre-command-hook):
* keymap.el (for):
diff -r 3de111a0da7b7880bb1473598b14a4cd84a97200 -r 46efc7173defd0f4f41bd8f3819970c4876c551a lisp/compose.el
--- a/lisp/compose.el
+++ b/lisp/compose.el
@@ -406,9 +406,9 @@
(compose-caron-map [?A] #x01CD) ;; CAPITAL A WITH CARON
(compose-caron-map [?C] #x010C) ;; CAPITAL C WITH CARON
(compose-caron-map [?D] #x010E) ;; CAPITAL D WITH CARON
- (compose-caron-map [U01F1] #x01C4) ;; CAPITAL DZ WITH CARON
+ (compose-caron-map (decode-char 'ucs #x01f1) #x01C4) ;; CAPITAL DZ WITH CARON
(compose-caron-map [?E] #x011A) ;; CAPITAL E WITH CARON
- (compose-caron-map [U01B7] #x01EE) ;; CAPITAL EZH WITH CARON
+ (compose-caron-map (decode-char 'ucs #x01b7) #x01EE) ;; CAPITAL EZH WITH CARON
(compose-caron-map [?G] #x01E6) ;; CAPITAL G WITH CARON
(compose-caron-map [?H] #x021E) ;; CAPITAL H WITH CARON
(compose-caron-map [?I] #x01CF) ;; CAPITAL I WITH CARON
@@ -424,9 +424,9 @@
(compose-caron-map [?a] #x01CE) ;; SMALL A WITH CARON
(compose-caron-map [?c] #x010D) ;; SMALL C WITH CARON
(compose-caron-map [?d] #x010F) ;; SMALL D WITH CARON
- (compose-caron-map [U01F3] #x01C6) ;; SMALL DZ WITH CARON
+ (compose-caron-map (decode-char 'ucs #x01F3) #x01C6) ;; SMALL DZ WITH CARON
(compose-caron-map [?e] #x011B) ;; SMALL E WITH CARON
- (compose-caron-map [U0292] #x01EF) ;; SMALL EZH WITH CARON
+ (compose-caron-map (decode-char 'ucs #x0292) #x01EF) ;; SMALL EZH WITH CARON
(compose-caron-map [?g] #x01E7) ;; SMALL G WITH CARON
(compose-caron-map [?h] #x021F) ;; SMALL H WITH CARON
(compose-caron-map [?i] #x01D0) ;; SMALL I WITH CARON
@@ -515,7 +515,7 @@
(compose-dot-map [?f] #x1E1F) ;; SMALL F WITH DOT ABOVE
(compose-dot-map [?g] #x0121) ;; SMALL G WITH DOT ABOVE
(compose-dot-map [?h] #x1E23) ;; SMALL H WITH DOT ABOVE
- (compose-dot-map [U017F] #x1E9B) ;; SMALL LONG S WITH DOT ABOVE
+ (compose-dot-map (decode-char 'ucs #x017F) #x1E9B) ;; SMALL LONG S WITH DOT ABOVE
(compose-dot-map [?m] #x1E41) ;; SMALL M WITH DOT ABOVE
(compose-dot-map [?n] #x1E45) ;; SMALL N WITH DOT ABOVE
(compose-dot-map [?o] #x022F) ;; SMALL O WITH DOT ABOVE
@@ -543,23 +543,23 @@
(compose-hook-map [?V] #x01B2) ;; CAPITAL V WITH HOOK
(compose-hook-map [?Y] #x01B3) ;; CAPITAL Y WITH HOOK
(compose-hook-map [?Z] #x0224) ;; CAPITAL Z WITH HOOK
- (compose-hook-map [U0262] #x029B) ;; SMALL CAPITAL G WITH HOOK
+ (compose-hook-map (decode-char 'ucs #x0262) #x029B) ;; SMALL CAPITAL G WITH HOOK
(compose-hook-map [?b] #x0253) ;; SMALL B WITH HOOK
(compose-hook-map [?c] #x0188) ;; SMALL C WITH HOOK
(compose-hook-map [?d] #x0257) ;; SMALL D WITH HOOK
(compose-hook-map [?f] #x0192) ;; SMALL F WITH HOOK
(compose-hook-map [?g] #x0260) ;; SMALL G WITH HOOK
(compose-hook-map [?h] #x0266) ;; SMALL H WITH HOOK
- (compose-hook-map [U0266] #x0267) ;; SMALL HENG WITH HOOK
+ (compose-hook-map (decode-char 'ucs #x0266) #x0267) ;; SMALL HENG WITH HOOK
(compose-hook-map [?k] #x0199) ;; SMALL K WITH HOOK
(compose-hook-map [?m] #x0271) ;; SMALL M WITH HOOK
(compose-hook-map [?p] #x01A5) ;; SMALL P WITH HOOK
(compose-hook-map [?q] #x02A0) ;; SMALL Q WITH HOOK
- (compose-hook-map [U025C] #x025D) ;; SMALL REVERSED OPEN E WITH HOOK
+ (compose-hook-map (decode-char 'ucs #x025C) #x025D) ;; SMALL REVERSED OPEN E WITH HOOK
(compose-hook-map [?s] #x0282) ;; SMALL S WITH HOOK
- (compose-hook-map [U0259] #x025A) ;; SMALL SCHWA WITH HOOK
+ (compose-hook-map (decode-char 'ucs #x0259) #x025A) ;; SMALL SCHWA WITH HOOK
(compose-hook-map [?t] #x01AD) ;; SMALL T WITH HOOK
- (compose-hook-map [U0279] #x027B) ;; SMALL TURNED R WITH HOOK
+ (compose-hook-map (decode-char 'ucs #x0279) #x027B) ;; SMALL TURNED R WITH HOOK
(compose-hook-map [?v] #x028B) ;; SMALL V WITH HOOK
(compose-hook-map [?y] #x01B4) ;; SMALL Y WITH HOOK
(compose-hook-map [?z] #x0225) ;; SMALL Z WITH HOOK
Repository URL: https://bitbucket.org/xemacs/xemacs/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
commit/XEmacs: 2 new changesets
6 years, 9 months
Bitbucket
2 new commits in XEmacs:
https://bitbucket.org/xemacs/xemacs/commits/268f55c89b5c/
Changeset: 268f55c89b5c
User: kehoea
Date: 2017-12-20 00:04:36+00:00
Summary: Correct the placement of some #ifdefs, redisplay-gtk.c
src/ChangeLog addition:
2017-12-20 Aidan Kehoe <kehoea(a)parhasard.net>
* redisplay-gtk.c (XLIKE_bevel_area):
* redisplay-gtk.c (gtk_text_attributes):
Correct the placement of some #ifdefs here, get the code building
under GTK2 again.
Affected #: 2 files
diff -r a5b21ebab055b2b74f16e61d09c57d88d268a74c -r 268f55c89b5c4bd6e5fe72eef1be8a2d6856a844 src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
+2017-12-20 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * redisplay-gtk.c (XLIKE_bevel_area):
+ * redisplay-gtk.c (gtk_text_attributes):
+ Correct the placement of some #ifdefs here, get the code building
+ under GTK2 again.
+
2017-12-18 Aidan Kehoe <kehoea(a)parhasard.net>
* event-Xt.c:
@@ -8,7 +15,7 @@
* event-Xt.c (x_keysym_to_character):
As above.
* event-xlike-inc.c:
- Move the Hangule, Armenian, Georgian, Azeri, Vietnamese support in
+ Move the Hangul, Armenian, Georgian, Azeri, Vietnamese support from
here.
* redisplay-gtk.c:
* redisplay-x.c:
diff -r a5b21ebab055b2b74f16e61d09c57d88d268a74c -r 268f55c89b5c4bd6e5fe72eef1be8a2d6856a844 src/redisplay-gtk.c
--- a/src/redisplay-gtk.c
+++ b/src/redisplay-gtk.c
@@ -182,6 +182,7 @@
#ifdef HAVE_GTK3
GtkStyleContext *gstyle = gtk_widget_get_style_context (widget);
GdkWindow *window = gtk_widget_get_window (widget);
+#endif
#if GTK_CHECK_VERSION(3, 22, 0)
cairo_region_t *region = gdk_window_get_visible_region (window);
/* We should be able to avoid the next call, but the GTK documentation
@@ -192,7 +193,6 @@
#else
cairo_t *cr = gdk_cairo_create (gtk_widget_get_window (widget));
#endif
-#endif
GtkShadowType stype;
if (shadow_thickness == 0)
@@ -604,7 +604,7 @@
bg->blue));
#endif
-#if HAVE_GTK3
+#ifdef HAVE_GTK3
GdkRGBA *fg = XCOLOR_INSTANCE_GTK_COLOR (cachel->foreground);
GdkRGBA *bg = XCOLOR_INSTANCE_GTK_COLOR (cachel->background);
https://bitbucket.org/xemacs/xemacs/commits/a69c6e871607/
Changeset: a69c6e871607
User: kehoea
Date: 2017-12-20 00:13:53+00:00
Summary: Use non-ASCII Lisp characters as keysyms under X11 too, thank you Ben
src/ChangeLog addition:
2017-12-20 Aidan Kehoe <kehoea(a)parhasard.net>
Use Lisp characters as the keysym for event objects reflecting
keys with character mappings on X11, as we do on every other
platform, and as Ben suggests.
* event-Xt.c:
* event-Xt.c (USE_UNICODE_MAP):
Don't use the current buffer for the Unicode conversion precedence
list, use the language-specific default in
Vdefault_unicode_precedence_array.
* event-Xt.c (x_keysym_to_character):
Give useful values for ASCII values too.
* event-Xt.c (maybe_define_x_key_as_self_inserting_character):
Don't mess around with the character-of-keysym property here, now
we no longer use symbol keysyms for X11 keys with character
mappings.
* event-Xt.c (x_has_keysym):
Call m_d_x_k_a_s_i_c() with its new simpler calling convention.
* event-Xt.c (x_keysym_to_emacs_keysym):
Call x_keysym_to_character() early.
* event-Xt.c (x_to_emacs_keysym):
Drop the SIMPLE_P argument, not used.
* event-Xt.c (x_event_to_emacs_event):
Update calls to x_to_emacs_keysym() correspondingly in this function.
Affected #: 2 files
diff -r 268f55c89b5c4bd6e5fe72eef1be8a2d6856a844 -r a69c6e871607eee0c429c827c5e0be49ede0bb17 src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,28 @@
+2017-12-20 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ Use Lisp characters as the keysym for event objects reflecting
+ keys with character mappings on X11, as we do on every other
+ platform, and as Ben suggests.
+ * event-Xt.c:
+ * event-Xt.c (USE_UNICODE_MAP):
+ Don't use the current buffer for the Unicode conversion precedence
+ list, use the language-specific default in
+ Vdefault_unicode_precedence_array.
+ * event-Xt.c (x_keysym_to_character):
+ Give useful values for ASCII values too.
+ * event-Xt.c (maybe_define_x_key_as_self_inserting_character):
+ Don't mess around with the character-of-keysym property here, now
+ we no longer use symbol keysyms for X11 keys with character
+ mappings.
+ * event-Xt.c (x_has_keysym):
+ Call m_d_x_k_a_s_i_c() with its new simpler calling convention.
+ * event-Xt.c (x_keysym_to_emacs_keysym):
+ Call x_keysym_to_character() early.
+ * event-Xt.c (x_to_emacs_keysym):
+ Drop the SIMPLE_P argument, not used.
+ * event-Xt.c (x_event_to_emacs_event):
+ Update calls to x_to_emacs_keysym() correspondingly in this function.
+
2017-12-20 Aidan Kehoe <kehoea(a)parhasard.net>
* redisplay-gtk.c (XLIKE_bevel_area):
diff -r 268f55c89b5c4bd6e5fe72eef1be8a2d6856a844 -r a69c6e871607eee0c429c827c5e0be49ede0bb17 src/event-Xt.c
--- a/src/event-Xt.c
+++ b/src/event-Xt.c
@@ -125,7 +125,7 @@
0
};
-static Lisp_Object x_keysym_to_emacs_keysym (KeySym keysym, int simple_p);
+static Lisp_Object x_keysym_to_emacs_keysym (KeySym keysym);
void emacs_Xt_mapping_action (Widget w, XEvent *event);
void debug_process_finalization (Lisp_Process *p);
void emacs_Xt_event_handler (Widget wid, XtPointer closure, XEvent *event,
@@ -147,13 +147,12 @@
&& map[keysym - FIRST_KNOWN_##map ]) do \
{ \
keysym -= FIRST_KNOWN_##map ; \
- return make_char (buffer_unicode_to_ichar ((int) map[keysym], \
- /* @@#### need to get some sort \
- of buffer to compute this off; \
- only applies in the old-Mule \
- world */ \
- current_buffer, \
- CONVERR_SUCCEED)); \
+ /* Use the language-environment precedence list, not that of */ \
+ /* the current buffer. */ \
+ return make_char (filtered_unicode_to_ichar \
+ ((int) map[keysym], \
+ Vdefault_unicode_precedence_array, NULL, \
+ CONVERR_SUCCEED)); \
} while (0)
/* Maps to Unicode for X11 KeySyms, where we don't have a direct internal
@@ -1004,8 +1003,12 @@
int code = 0;
#endif /* MULE */
+ if (keysym < 0x100)
+ {
+ return make_char ((Ichar) keysym);
+ }
+
/* @@#### Add support for 0xFE?? and 0xFF?? keysyms
- Add support for KOI8-U extensions in the 0x06?? range
See http://www.cl.cam.ac.uk/~mgk25/ucs/keysyms.txt
*/
@@ -1021,11 +1024,12 @@
return make_char (keysym & 0xFFFFFF);
#else
if (keysym >= 0x01000000 && keysym <= 0x0110FFFF)
- return make_char (buffer_unicode_to_ichar
- ((int) (keysym & 0xFFFFFF),
- /* @@#### need to get some sort of buffer to compute
- this off; only applies in the old-Mule world */
- current_buffer, CONVERR_SUCCEED));
+ /* Use the language-environment precedence list, not that of
+ the current buffer. */
+ return make_char (filtered_unicode_to_ichar
+ ((int)(keysym & 0xFFFFFF),
+ Vdefault_unicode_precedence_array, NULL,
+ CONVERR_SUCCEED));
#endif /* not MULE */
if ((keysym & 0xff) < 0xa0)
@@ -1131,12 +1135,10 @@
case 32: /* Currency. The lower sixteen bits of these keysyms happily
correspond exactly to the Unicode code points of the
associated characters */
- return make_char (buffer_unicode_to_ichar
- ((int) (keysym & 0xffff),
- /* @@#### need to get some sort of buffer to
- compute this off; only applies in the old-Mule
- world */
- current_buffer, CONVERR_SUCCEED));
+ return make_char (filtered_unicode_to_ichar
+ ((int) (keysym & 0xffff),
+ Vdefault_unicode_precedence_array, NULL,
+ CONVERR_SUCCEED));
/* @@#### Support me!
@@ -1204,11 +1206,16 @@
break;
}
- if (code == 0)
- return Qnil;
-
- /* #### Is this check on !NILP (charset) needed? Maybe should be assert? */
- if (!NILP (charset))
+ assert (!NILP (charset));
+
+ if (code == 0 || EQ (charset, Qzero))
+ {
+ /* CHARSET being zero is unlikely, but we shouldn't crash, even with
+ error-checking turned on, if X11 gives us a keysym we don't
+ understand. Don't make it an assertion. */
+ return Qnil;
+ }
+ else
{
/* First try to generate a unified character by converting through
Unicode, then try converting directly to an Ichar (only matters
@@ -1216,16 +1223,21 @@
int ucs = charset_codepoint_to_unicode (charset, 0, code, CONVERR_FAIL);
if (ucs >= 0)
{
- /* @@#### current_buffer dependency */
- Ichar ich = buffer_unicode_to_ichar (ucs, current_buffer,
- CONVERR_FAIL);
+ Ichar ich
+ /* Use the language-environment precedence list, not that of the
+ current buffer. */
+ = filtered_unicode_to_ichar (ucs,
+ Vdefault_unicode_precedence_array,
+ NULL, CONVERR_SUCCEED);
if (ich >= 0)
- return make_char (ich);
+ {
+ return make_char (ich);
+ }
}
else
{
- Ichar ich =
- charset_codepoint_to_ichar (charset, 0, code, CONVERR_FAIL);
+ Ichar ich
+ = charset_codepoint_to_ichar (charset, 0, code, CONVERR_FAIL);
if (ich >= 0)
return make_char (ich);
}
@@ -1242,29 +1254,18 @@
/* keymap handling */
/************************************************************************/
-/* @@#### This is the wrong approach, I think. We should not be exposing the
- name of the keysym anywhere, or forcing the user to use this name.
- At the Lisp level, the user should simply see the character itself, and
- should be able to bind the actual character. Furthermore, introducing
- the symbol introduces an X-specific dependency; I can't expect to set
- a binding for a particular Unicode character and have it work on both
- Windows and X. --ben */
+extern Lisp_Object Vcurrent_global_map;
/* See comment near character_to_event(). */
static void
-maybe_define_x_key_as_self_inserting_character (KeySym keysym,
- Lisp_Object symbol)
+maybe_define_x_key_as_self_inserting_character (Lisp_Object emacs_keysym)
{
- Lisp_Object character = x_keysym_to_character (keysym);
-
- if (CHARP (character))
+ if (CHARP (emacs_keysym))
{
- extern Lisp_Object Vcurrent_global_map;
- extern Lisp_Object Qcharacter_of_keysym;
- if (NILP (Flookup_key (Vcurrent_global_map, symbol, Qnil)))
+ if (NILP (Flookup_key (Vcurrent_global_map, emacs_keysym, Qnil)))
{
- Fput (symbol, Qcharacter_of_keysym, character);
- Fdefine_key (Vcurrent_global_map, symbol, Qself_insert_command);
+ Fdefine_key (Vcurrent_global_map, emacs_keysym,
+ Qself_insert_command);
}
}
}
@@ -1275,7 +1276,7 @@
KeySym upper_lower[2];
int j;
- if (keysym < 0x80) /* Optimize for ASCII keysyms */
+ if (keysym < 0x80) /* ASCII keysyms have default bindings anyway. */
return;
/* If you execute:
@@ -1292,7 +1293,7 @@
for (j = 0; j < (upper_lower[0] == upper_lower[1] ? 1 : 2); j++)
{
KeySym ks = upper_lower[j];
- Lisp_Object sym = x_keysym_to_emacs_keysym (ks, 0);
+ Lisp_Object sym = x_keysym_to_emacs_keysym (ks);
Lisp_Object new_value = with_modifiers ? Qt : Qsans_modifiers;
Lisp_Object old_value = Fgethash (sym, hash_table, Qnil);
@@ -1300,7 +1301,7 @@
&& ! (EQ (old_value, Qsans_modifiers) &&
EQ (new_value, Qt)))
{
- maybe_define_x_key_as_self_inserting_character (ks, sym);
+ maybe_define_x_key_as_self_inserting_character (sym);
Fputhash (sym, new_value, hash_table);
}
}
@@ -1846,32 +1847,19 @@
/************************************************************************/
static Lisp_Object
-x_keysym_to_emacs_keysym (KeySym keysym, int simple_p)
+x_keysym_to_emacs_keysym (KeySym keysym)
{
Extbyte *name;
DECLARE_EISTRING(einame);
+ Lisp_Object character;
if (keysym >= XK_exclam && keysym <= XK_asciitilde)
/* We must assume that the X keysym numbers for the ASCII graphic
characters are the same as their ASCII codes. */
return make_char (keysym);
- if (keysym >= 0x01000000 && keysym <= 0x0110FFFF)
- {
- /* These keysyms malloc with XKeysymToString(), *every time the
- function is called.* Avoid leaking, construct the keysym string
- ourselves. */
- Ascbyte buf [10];
- qxesprintf ((Ibyte *) buf, keysym & 0xff0000 ? "U%06X" : "U%04X",
- (unsigned int) (keysym & 0xffffff));
- return KEYSYM (buf);
- }
-
switch (keysym)
{
- /* These would be handled correctly by the default case, but by
- special-casing them here we don't garbage a string or call
- intern(). */
case XK_BackSpace: return QKbackspace;
case XK_Tab: return QKtab;
case XK_Linefeed: return QKlinefeed;
@@ -1881,8 +1869,15 @@
case XK_Delete: return QKdelete;
case 0: return Qnil;
default:
- if (simple_p) return Qnil;
+ character = x_keysym_to_character (keysym);
+
+ if (CHARP (character))
+ {
+ return character;
+ }
+
name = XKeysymToString (keysym);
+
if (!name || !name[0])
/* This happens if there is a mismatch between the Xlib of
XEmacs and the Xlib of the X server...
@@ -1947,8 +1942,7 @@
}
static Lisp_Object
-x_to_emacs_keysym (XKeyPressedEvent *event, int simple_p, KeySym *x_keysym_out)
- /* simple_p means don't try too hard (ASCII only) */
+x_to_emacs_keysym (XKeyPressedEvent *event, KeySym *x_keysym_out)
{
KeySym keysym = NoSymbol;
@@ -1984,7 +1978,7 @@
XLookupString (event, dummy, 200, &keysym, 0);
*x_keysym_out = keysym;
return (IsModifierKey (keysym) || keysym == XK_Mode_switch )
- ? Qnil : x_keysym_to_emacs_keysym (keysym, simple_p);
+ ? Qnil : x_keysym_to_emacs_keysym (keysym);
}
#endif /* ! XIM_MOTIF */
@@ -2045,7 +2039,7 @@
case XLookupBoth:
*x_keysym_out = keysym;
return (IsModifierKey (keysym) || keysym == XK_Mode_switch )
- ? Qnil : x_keysym_to_emacs_keysym (keysym, simple_p);
+ ? Qnil : x_keysym_to_emacs_keysym (keysym);
case XLookupChars:
{
@@ -2229,7 +2223,7 @@
/* This used to compute the frame from the given X window and
store it here, but we really don't care about the frame. */
SET_EVENT_CHANNEL (emacs_event, DEVICE_CONSOLE (d));
- keysym = x_to_emacs_keysym (&x_event->xkey, 0, &x_keysym);
+ keysym = x_to_emacs_keysym (&x_event->xkey, &x_keysym);
/* If the emacs keysym is nil, then that means that the X
keysym was either a Modifier or NoSymbol, which
Repository URL: https://bitbucket.org/xemacs/xemacs/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
commit/cc-mode: acm: Fontify a CPP construct correctly when a comment
follows without spaces
6 years, 9 months
Bitbucket
1 new commit in cc-mode:
https://bitbucket.org/xemacs/cc-mode/commits/d8e0dfbe0ba2/
Changeset: d8e0dfbe0ba2
User: acm
Date: 2017-12-19 18:47:58+00:00
Summary: Fontify a CPP construct correctly when a comment follows without spaces
Do this by removing a broken optimization in the state cache which put
category text properties on a character between the end of the CPP construct
and the beginning of the comment. This can't work when there's no such
character.
* cc-defs.el (c-cpp-delimiter, c-set-cpp-delimiters, c-clear-cpp-delimiters)
(c-comment-out-cpps, c-with-cpps-commented-out)
(c-with-all-but-one-cpps-commented-out): Remove.
* cc-engine.el (c-no-comment-end-of-macro): Return the comment start position
rather than one character before it.
(c-invalidate-state-cache, c-parse-state): Remove the invocations of
c-with-all-but-one-cpps-commented-out and c-with-cpps-commented-out.
* cc-mode.el (c-neutralize-syntax-in-and-mark-CPP): Rename to
c-neutralize-syntax-in-CPP and remove the bits which applied category
properties.
* cc-langs.el (c-before-font-lock-functions): Incorporate the new name of the
function c-neutralize-syntax-in-CPP.
Affected #: 4 files
diff -r 8cd5f9d0c1bd6c994ffca85187003ff53c554280 -r d8e0dfbe0ba20868860033443d02de5ddd248e33 cc-defs.el
--- a/cc-defs.el
+++ b/cc-defs.el
@@ -1416,59 +1416,6 @@
;;;;;;;;;;;;;;;
-(defconst c-cpp-delimiter '(14)) ; generic comment syntax
-;; This is the value of the `category' text property placed on every #
-;; which introduces a CPP construct and every EOL (or EOB, or character
-;; preceding //, etc.) which terminates it. We can instantly "comment
-;; out" all CPP constructs by giving `c-cpp-delimiter' a syntax-table
-;; property '(14) (generic comment delimiter).
-(defmacro c-set-cpp-delimiters (beg end)
- ;; This macro does a hidden buffer change.
- `(progn
- (c-put-char-property ,beg 'category 'c-cpp-delimiter)
- (if (< ,end (point-max))
- (c-put-char-property ,end 'category 'c-cpp-delimiter))))
-(defmacro c-clear-cpp-delimiters (beg end)
- ;; This macro does a hidden buffer change.
- `(progn
- (c-clear-char-property ,beg 'category)
- (if (< ,end (point-max))
- (c-clear-char-property ,end 'category))))
-
-(defsubst c-comment-out-cpps ()
- ;; Render all preprocessor constructs syntactically commented out.
- (put 'c-cpp-delimiter 'syntax-table c-cpp-delimiter))
-(defsubst c-uncomment-out-cpps ()
- ;; Restore the syntactic visibility of preprocessor constructs.
- (put 'c-cpp-delimiter 'syntax-table nil))
-
-(defmacro c-with-cpps-commented-out (&rest forms)
- ;; Execute FORMS... whilst the syntactic effect of all characters in
- ;; all CPP regions is suppressed. In particular, this is to suppress
- ;; the syntactic significance of parens/braces/brackets to functions
- ;; such as `scan-lists' and `parse-partial-sexp'.
- `(unwind-protect
- (c-save-buffer-state ()
- (c-comment-out-cpps)
- ,@forms)
- (c-save-buffer-state ()
- (c-uncomment-out-cpps))))
-
-(defmacro c-with-all-but-one-cpps-commented-out (beg end &rest forms)
- ;; Execute FORMS... whilst the syntactic effect of all characters in
- ;; every CPP region APART FROM THE ONE BETWEEN BEG and END is
- ;; suppressed.
- `(unwind-protect
- (c-save-buffer-state ()
- (save-restriction
- (widen)
- (c-clear-cpp-delimiters ,beg ,end))
- ,`(c-with-cpps-commented-out ,@forms))
- (c-save-buffer-state ()
- (save-restriction
- (widen)
- (c-set-cpp-delimiters ,beg ,end)))))
-
(defmacro c-self-bind-state-cache (&rest forms)
;; Bind the state cache to itself and execute the FORMS. Return the result
;; of the last FORM executed. It is assumed that no buffer changes will
diff -r 8cd5f9d0c1bd6c994ffca85187003ff53c554280 -r d8e0dfbe0ba20868860033443d02de5ddd248e33 cc-engine.el
--- a/cc-engine.el
+++ b/cc-engine.el
@@ -243,8 +243,8 @@
;; `c-macro-cache'.
(defvar c-macro-cache-no-comment nil)
(make-variable-buffer-local 'c-macro-cache-no-comment)
-;; Either nil, or the last character of the macro currently represented by
-;; `c-macro-cache' which isn't in a comment. */
+;; Either nil, or the position of a comment which is open at the end of the
+;; macro represented by `c-macro-cache'.
(defun c-invalidate-macro-cache (beg end)
;; Called from a before-change function. If the change region is before or
@@ -387,8 +387,9 @@
(point)))
(defun c-no-comment-end-of-macro ()
- ;; Go to the end of a CPP directive, or a pos just before which isn't in a
- ;; comment. For this purpose, open strings are ignored.
+ ;; Go to the start of the comment which is open at the end of the current
+ ;; CPP directive, or to the end of that directive. For this purpose, open
+ ;; strings are ignored.
;;
;; This function must only be called from the beginning of a CPP construct.
;;
@@ -406,7 +407,7 @@
(setq s (parse-partial-sexp here there)))
(when (and (nth 4 s)
(not (eq (nth 7 s) 'syntax-table))) ; no pseudo comments.
- (goto-char (1- (nth 8 s))))
+ (goto-char (nth 8 s)))
(setq c-macro-cache-no-comment (point)))
(point)))
@@ -3864,14 +3865,7 @@
(if (memq 'category-properties c-emacs-features)
;; Emacs
(c-with-<->-as-parens-suppressed
- (if (and c-state-old-cpp-beg
- (< c-state-old-cpp-beg here))
- (c-with-all-but-one-cpps-commented-out
- c-state-old-cpp-beg
- c-state-old-cpp-end
- (c-invalidate-state-cache-1 here))
- (c-with-cpps-commented-out
- (c-invalidate-state-cache-1 here))))
+ (c-invalidate-state-cache-1 here))
;; XEmacs
(c-invalidate-state-cache-1 here)))
@@ -3905,12 +3899,7 @@
(if (memq 'category-properties c-emacs-features)
;; Emacs
(c-with-<->-as-parens-suppressed
- (if (and here-cpp-beg (> here-cpp-end here-cpp-beg))
- (c-with-all-but-one-cpps-commented-out
- here-cpp-beg here-cpp-end
- (c-parse-state-1))
- (c-with-cpps-commented-out
- (c-parse-state-1))))
+ (c-parse-state-1))
;; XEmacs
(c-parse-state-1))
(setq c-state-old-cpp-beg
diff -r 8cd5f9d0c1bd6c994ffca85187003ff53c554280 -r d8e0dfbe0ba20868860033443d02de5ddd248e33 cc-langs.el
--- a/cc-langs.el
+++ b/cc-langs.el
@@ -501,13 +501,13 @@
(c objc) '(c-depropertize-new-text
c-parse-quotes-after-change
c-extend-font-lock-region-for-macros
- c-neutralize-syntax-in-and-mark-CPP
+ c-neutralize-syntax-in-CPP
c-change-expand-fl-region)
c++ '(c-depropertize-new-text
c-parse-quotes-after-change
c-extend-font-lock-region-for-macros
c-after-change-re-mark-raw-strings
- c-neutralize-syntax-in-and-mark-CPP
+ c-neutralize-syntax-in-CPP
c-restore-<>-properties
c-change-expand-fl-region)
java '(c-depropertize-new-text
diff -r 8cd5f9d0c1bd6c994ffca85187003ff53c554280 -r d8e0dfbe0ba20868860033443d02de5ddd248e33 cc-mode.el
--- a/cc-mode.el
+++ b/cc-mode.el
@@ -1002,15 +1002,10 @@
t)
(t nil)))))))
-(defun c-neutralize-syntax-in-and-mark-CPP (begg endd old-len)
- ;; (i) "Neutralize" every preprocessor line wholly or partially in the
- ;; changed region. "Restore" lines which were CPP lines before the change
- ;; and are no longer so.
- ;;
- ;; (ii) Mark each CPP construct by placing a `category' property value
- ;; `c-cpp-delimiter' at its start and end. The marked characters are the
- ;; opening # and usually the terminating EOL, but sometimes the character
- ;; before a comment delimiter.
+(defun c-neutralize-syntax-in-CPP (begg endd old-len)
+ ;; "Neutralize" every preprocessor line wholly or partially in the changed
+ ;; region. "Restore" lines which were CPP lines before the change and are
+ ;; no longer so.
;;
;; That is, set syntax-table properties on characters that would otherwise
;; interact syntactically with those outside the CPP line(s).
@@ -1030,11 +1025,7 @@
(c-save-buffer-state (limits)
;; Clear 'syntax-table properties "punctuation":
;; (c-clear-char-property-with-value c-new-BEG c-new-END 'syntax-table '(1))
-
- ;; CPP "comment" markers:
- (if (memq 'category-properties c-emacs-features) ; GNU Emacs.
- (c-clear-char-property-with-value
- c-new-BEG c-new-END 'category 'c-cpp-delimiter))
+ ;; The above is now done in `c-depropertize-CPP'.
;; Add needed properties to each CPP construct in the region.
(goto-char c-new-BEG)
@@ -1061,10 +1052,7 @@
(goto-char (match-beginning 1))
(setq mbeg (point))
(if (> (c-no-comment-end-of-macro) mbeg)
- (progn
- (c-neutralize-CPP-line mbeg (point)) ; "punctuation" properties
- (if (memq 'category-properties c-emacs-features) ; GNU Emacs.
- (c-set-cpp-delimiters mbeg (point)))) ; "comment" markers
+ (c-neutralize-CPP-line mbeg (point)) ; "punctuation" properties
(forward-line)) ; no infinite loop with, e.g., "#//"
)))))
Repository URL: https://bitbucket.org/xemacs/cc-mode/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
commit/cc-mode: acm: Fix loss of documentation face in certain CC
Mode doc comment situations
6 years, 9 months
Bitbucket
1 new commit in cc-mode:
https://bitbucket.org/xemacs/cc-mode/commits/8cd5f9d0c1bd/
Changeset: 8cd5f9d0c1bd
User: acm
Date: 2017-12-19 17:57:25+00:00
Summary: Fix loss of documentation face in certain CC Mode doc comment situations
* cc-fonts.el (c-font-lock-doc-comments): Take into account the possibility of
font-lock-comment-delimiter-face. Test rigorously for "/**" (etc.) being
itself inside a literal, rather than just depending on the face of the
previous character.
Affected #: 1 file
diff -r 125218d347ca602b4f09318fb79c8ca6fb895fc9 -r 8cd5f9d0c1bd6c994ffca85187003ff53c554280 cc-fonts.el
--- a/cc-fonts.el
+++ b/cc-fonts.el
@@ -2666,8 +2666,8 @@
;; This function might do hidden buffer changes.
(let (comment-beg region-beg)
- (if (eq (get-text-property (point) 'face)
- 'font-lock-comment-face)
+ (if (memq (get-text-property (point) 'face)
+ '(font-lock-comment-face font-lock-comment-delimiter-face))
;; Handle the case when the fontified region starts inside a
;; comment.
(let ((start (c-literal-start)))
@@ -2687,8 +2687,15 @@
(or (not (c-got-face-at comment-beg
c-literal-faces))
(and (/= comment-beg (point-min))
+ ;; Cheap check which is unreliable (the previous
+ ;; character could be the end of a previous
+ ;; comment).
(c-got-face-at (1- comment-beg)
- c-literal-faces))))
+ c-literal-faces)
+ ;; Expensive reliable check.
+ (save-excursion
+ (goto-char comment-beg)
+ (c-in-literal)))))
(setq comment-beg nil))
(setq region-beg comment-beg))
Repository URL: https://bitbucket.org/xemacs/cc-mode/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
commit/cc-mode: acm: Fix fontification of first declaration within a
C++ lambda form.
6 years, 9 months
Bitbucket
1 new commit in cc-mode:
https://bitbucket.org/xemacs/cc-mode/commits/125218d347ca/
Changeset: 125218d347ca
User: acm
Date: 2017-12-14 20:55:10+00:00
Summary: Fix fontification of first declaration within a C++ lambda form.
* cc-engine.el (c-looking-at-or-maybe-in-bracelist): Cease spuriously
recognizing the braces of a lambda form as a brace list when there is an "="
preceding the introductory brackets.
Affected #: 1 file
diff -r f403d0ee1451d89f9bc647ae8c73dc96c7551952 -r 125218d347ca602b4f09318fb79c8ca6fb895fc9 cc-engine.el
--- a/cc-engine.el
+++ b/cc-engine.el
@@ -10449,7 +10449,7 @@
c-decl-block-key))
(braceassignp 'dontknow)
inexpr-brace-list bufpos macro-start res pos after-type-id-pos
- in-paren)
+ in-paren parens-before-brace)
(setq res (c-backward-token-2 1 t lim))
;; Checks to do only on the first sexp before the brace.
@@ -10467,6 +10467,9 @@
((and (looking-at c-symbol-start)
(not (looking-at c-keywords-regexp)))
(setq after-type-id-pos (point)))
+ ((eq (char-after) ?\()
+ (setq parens-before-brace t)
+ nil)
(t nil))
(save-excursion
(cond
@@ -10515,6 +10518,14 @@
;; Single identifier between '(' and '{'. We have a bracelist.
(cons after-type-id-pos 'in-paren))
+ ;; Are we at the parens of a C++ lambda expression?
+ ((and parens-before-brace
+ (save-excursion
+ (and
+ (zerop (c-backward-token-2 1 t lim))
+ (c-looking-at-c++-lambda-capture-list))))
+ nil) ; a lambda expression isn't a brace list.
+
(t
(goto-char pos)
;; Checks to do on all sexps before the brace, up to the
Repository URL: https://bitbucket.org/xemacs/cc-mode/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
commit/cc-mode: acm: Fix misfontification of C++ member
initialization list after "throw"
6 years, 9 months
Bitbucket
1 new commit in cc-mode:
https://bitbucket.org/xemacs/cc-mode/commits/f403d0ee1451/
Changeset: f403d0ee1451
User: acm
Date: 2017-12-14 17:43:41+00:00
Summary: Fix misfontification of C++ member initialization list after "throw"
* cc-engine.el (c-forward-type): Stop recognizing a "type" starting with
"throw", by using c-opt-type-modifier-prefix-key.
* cc-langs.el (c-type-modifier-prefix-kwds): New lang const which, in C++,
doesn't contain "throw", otherwise like c-type-modifier-kwds.
(c-opt-type-modifier-prefix-key): New lang const and var, a regexp matching
any keyword in the previous lang const.
Affected #: 2 files
diff -r f317d82b1010097a2b092dd010c6d0ec5b45a85d -r f403d0ee1451d89f9bc647ae8c73dc96c7551952 cc-engine.el
--- a/cc-engine.el
+++ b/cc-engine.el
@@ -7583,8 +7583,8 @@
;; Skip leading type modifiers. If any are found we know it's a
;; prefix of a type.
- (when c-opt-type-modifier-key ; e.g. "const" "volatile", but NOT "typedef"
- (while (looking-at c-opt-type-modifier-key)
+ (when c-opt-type-modifier-prefix-key ; e.g. "const" "volatile", but NOT "typedef"
+ (while (looking-at c-opt-type-modifier-prefix-key)
(goto-char (match-end 1))
(c-forward-syntactic-ws)
(setq res 'prefix)))
diff -r f317d82b1010097a2b092dd010c6d0ec5b45a85d -r f403d0ee1451d89f9bc647ae8c73dc96c7551952 cc-langs.el
--- a/cc-langs.el
+++ b/cc-langs.el
@@ -1908,16 +1908,32 @@
t (c-make-keywords-re t (c-lang-const c-type-prefix-kwds)))
(c-lang-defvar c-type-prefix-key (c-lang-const c-type-prefix-key))
-(c-lang-defconst c-type-modifier-kwds
- "Type modifier keywords. These can occur almost anywhere in types
-but they don't build a type of themselves. Unlike the keywords on
-`c-primitive-type-kwds', they are fontified with the keyword face and
-not the type face."
+(c-lang-defconst c-type-modifier-prefix-kwds
+ "Type modifier keywords which can appear in front of a type. These can
+also occur almost anywhere in types but they don't build a type of
+themselves. Unlike the keywords on `c-primitive-type-kwds', they are
+fontified with the keyword face and not the type face."
t nil
c '("const" "restrict" "volatile")
- c++ '("const" "noexcept" "volatile" "throw")
+ c++ '("const" "noexcept" "volatile")
objc '("const" "volatile"))
+(c-lang-defconst c-opt-type-modifier-prefix-key
+ ;; Adorned regexp matching `c-type-modifier-prefix-kwds', or nil in
+ ;; languages without such keywords.
+ t (and (c-lang-const c-type-modifier-prefix-kwds)
+ (c-make-keywords-re t (c-lang-const c-type-modifier-prefix-kwds))))
+(c-lang-defvar c-opt-type-modifier-prefix-key
+ (c-lang-const c-opt-type-modifier-prefix-key))
+
+(c-lang-defconst c-type-modifier-kwds
+ "Type modifier keywords. These can occur almost anywhere in types except
+at the start, but they don't build a type of themselves. Unlike the keywords
+on `c-primitive-type-kwds', they are fontified with the keyword face and not
+the type face."
+ t (c-lang-const c-type-modifier-prefix-kwds)
+ c++ (append (c-lang-const c-type-modifier-prefix-kwds) '("throw")))
+
(c-lang-defconst c-opt-type-modifier-key
;; Adorned regexp matching `c-type-modifier-kwds', or nil in
;; languages without such keywords.
Repository URL: https://bitbucket.org/xemacs/cc-mode/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
commit/cc-mode: acm: Don't misfontify "foo ()" inside C++
initialization parentheses as a type
6 years, 9 months
Bitbucket
1 new commit in cc-mode:
https://bitbucket.org/xemacs/cc-mode/commits/f317d82b1010/
Changeset: f317d82b1010
User: acm
Date: 2017-12-13 20:28:28+00:00
Summary: Don't misfontify "foo ()" inside C++ initialization parentheses as a type
Also recognize and handle function names introduced by "extern" inside a
function.
* cc-engine.el (c-forward-decl-or-cast-1): Add a new element to the result
list which is t when our declaration is, or is to be treated as, being at top
level.
* cc-fonts.el (c-get-fontification-context): Detect being inside a C++ uniform
initialization and return (not-decl nil) for this case.
(c-font-lock-declarations): Use the new element 4 of the result of
c-forward-decl-or-cast-1.
* cc-langs.el (c-make-top-level-kwds, c-make-top-level-key): New lang
consts/vars.
Affected #: 3 files
diff -r 73e4dec237e8ae7a2ce08cc9f788c141e90e13db -r f317d82b1010097a2b092dd010c6d0ec5b45a85d cc-engine.el
--- a/cc-engine.el
+++ b/cc-engine.el
@@ -8178,9 +8178,9 @@
;; If a declaration is parsed:
;;
;; The point is left at the first token after the first complete
- ;; declarator, if there is one. The return value is a list of 4 elements,
+ ;; declarator, if there is one. The return value is a list of 5 elements,
;; where the first is the position of the first token in the declarator.
- ;; (See below for the other three.)
+ ;; (See below for the other four.)
;; Some examples:
;;
;; void foo (int a, char *b) stuff ...
@@ -8219,7 +8219,9 @@
;;
;; The third element of the return value is non-nil when the declaration
;; parsed might be an expression. The fourth element is the position of
- ;; the start of the type identifier.
+ ;; the start of the type identifier. The fifth element is t if either
+ ;; CONTEXT was 'top, or the declaration is detected to be treated as top
+ ;; level (e.g. with the keyword "extern").
;;
;; If a cast is parsed:
;;
@@ -8317,6 +8319,9 @@
;; Set when the symbol before `preceding-token-end' is known to
;; terminate the previous construct, or when we're at point-min.
at-decl-start
+ ;; Set when we have encountered a keyword (e.g. "extern") which
+ ;; causes the following declaration to be treated as though top-level.
+ make-top
;; Save `c-record-type-identifiers' and
;; `c-record-ref-identifiers' since ranges are recorded
;; speculatively and should be thrown away if it turns out
@@ -8348,7 +8353,9 @@
(cond
;; Look for a specifier keyword clause.
- ((or (looking-at c-prefix-spec-kwds-re)
+ ((or (and (looking-at c-make-top-level-key)
+ (setq make-top t))
+ (looking-at c-prefix-spec-kwds-re)
(and (c-major-mode-is 'java-mode)
(looking-at "@[A-Za-z0-9]+")))
(save-match-data
@@ -8618,7 +8625,7 @@
;; construct here in C, since we want to recognize this as a
;; typeless function declaration.
(not (and (c-major-mode-is 'c-mode)
- (eq context 'top)
+ (or (eq context 'top) make-top)
(eq (char-after) ?\)))))
(if (eq (char-after) ?\))
(when (> paren-depth 0)
@@ -8666,7 +8673,7 @@
;; Recognize a top-level typeless
;; function declaration in C.
(and (c-major-mode-is 'c-mode)
- (eq context 'top)
+ (or (eq context 'top) make-top)
(eq (char-after) ?\))))))))
(setq pos (c-up-list-forward (point)))
(eq (char-before pos) ?\)))
@@ -8923,6 +8930,7 @@
(when (and got-identifier
(looking-at c-after-suffixed-type-decl-key)
(or (eq context 'top)
+ make-top
(and (eq context nil)
(match-beginning 1)))
(if (and got-parens
@@ -9089,7 +9097,7 @@
;; CASE 19
(or (eq context 'decl)
(and (c-major-mode-is 'c-mode)
- (eq context 'top))))))
+ (or (eq context 'top) make-top))))))
;; The point is now after the type decl expression.
@@ -9194,7 +9202,8 @@
(and (or at-type-decl at-typedef)
(cons at-type-decl at-typedef))
maybe-expression
- type-start))
+ type-start
+ (or (eq context 'top) make-top)))
(t
;; False alarm. Restore the recorded ranges.
diff -r 73e4dec237e8ae7a2ce08cc9f788c141e90e13db -r f317d82b1010097a2b092dd010c6d0ec5b45a85d cc-fonts.el
--- a/cc-fonts.el
+++ b/cc-fonts.el
@@ -1251,6 +1251,17 @@
;; Got a cached hit in some other type of arglist.
(type
(cons 'arglist t))
+ ;; We're at a C++ uniform initialization.
+ ((and (c-major-mode-is 'c++-mode)
+ (eq (char-before match-pos) ?\()
+ (save-excursion
+ (goto-char match-pos)
+ (and
+ (zerop (c-backward-token-2 2))
+ (looking-at c-identifier-start)
+ (c-got-face-at (point)
+ '(font-lock-variable-name-face)))))
+ (cons 'not-decl nil))
((and not-front-decl
;; The point is within the range of a previously
;; encountered type decl expression, so the arglist
@@ -1589,7 +1600,8 @@
(setq max-type-decl-end (point))))
(goto-char start-pos)
(c-font-lock-single-decl limit decl-or-cast match-pos
- context toplev))
+ context
+ (or toplev (nth 4 decl-or-cast))))
(t t))))
diff -r 73e4dec237e8ae7a2ce08cc9f788c141e90e13db -r f317d82b1010097a2b092dd010c6d0ec5b45a85d cc-langs.el
--- a/cc-langs.el
+++ b/cc-langs.el
@@ -2338,6 +2338,16 @@
t nil
(c c++ objc) '("extern"))
+(c-lang-defconst c-make-top-level-kwds
+ "Keywords which make declarations they introduce be handled as top-level."
+ t nil
+ (c c++ objc) '("extern"))
+
+(c-lang-defconst c-make-top-level-key
+ ;; A regexp which matches any `c-make-top-level-kwds' keyword.
+ t (c-make-keywords-re t (c-lang-const c-make-top-level-kwds)))
+(c-lang-defvar c-make-top-level-key (c-lang-const c-make-top-level-key))
+
(c-lang-defconst c-type-list-kwds
"Keywords that may be followed by a comma separated list of type
identifiers, where each optionally can be prefixed by keywords. (Can
Repository URL: https://bitbucket.org/xemacs/cc-mode/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
commit/XEmacs: kehoea: Set input FDs to non-blocking unconditionally,
thank you Myrkraverk
6 years, 10 months
Bitbucket
1 new commit in XEmacs:
https://bitbucket.org/xemacs/xemacs/commits/affc195870d6/
Changeset: affc195870d6
User: kehoea
Date: 2017-12-12 08:27:11+00:00
Summary: Set input FDs to non-blocking unconditionally, thank you Myrkraverk
src/ChangeLog addition:
2017-12-12 Aidan Kehoe <kehoea(a)parhasard.net>
* process-unix.c (unix_init_process_io_handles):
Set input FDs to non-blocking unconditionally, see recent patch
posted to xemacs-beta from Johann "Myrkraverk" Oskarsson.
Affected #: 2 files
diff -r 0f7f0274157b50c71683368d0614b8912e2b70d7 -r affc195870d60c7f3f61d304cc01f205f63432d8 src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
+2017-12-12 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * process-unix.c (unix_init_process_io_handles):
+ Set input FDs to non-blocking unconditionally, see recent patch
+ posted to xemacs-beta from Johann "Myrkraverk" Oskarsson.
+
2017-12-02 Aidan Kehoe <kehoea(a)parhasard.net>
* bytecode.c (set_compiled_function_arglist):
diff -r 0f7f0274157b50c71683368d0614b8912e2b70d7 -r affc195870d60c7f3f61d304cc01f205f63432d8 src/process-unix.c
--- a/src/process-unix.c
+++ b/src/process-unix.c
@@ -831,6 +831,25 @@
/* if sizeof(EMACS_INT) > sizeof(int) this truncates the value */
UNIX_DATA(p)->infd = (EMACS_INT) in;
UNIX_DATA(p)->errfd = (EMACS_INT) err;
+
+ /* In the event where the input file descriptor is a pipe, XEmacs as of
+ * 21.4.24 will hang on the read() system call when the pipe doesn't
+ * have enough to fill the incoming buffer.
+ *
+ * This will likely affect other kinds of blocking file descriptors also, so
+ * we unconditionally set the input fd to non-blocking mode. See:
+ * http://mid.xemacs.org/CAA_SOw__WYNiUO=4hHhiwg0LXq7++9Xr=tnBMgN5Uc8iAa+mvg...
+ * and the related thread.
+ */
+ {
+ int f = fcntl (UNIX_DATA(p)->infd, F_SETFL, O_NONBLOCK);
+ if (f == -1)
+ {
+ warn_when_safe (Qio_error, lisp_strerror (errno),
+ "failed setting pipe (fd %ld) to nonblocking mode",
+ (EMACS_INT) in);
+ }
+ }
}
/* Move the file descriptor FD so that its number is not less than MIN. *
Repository URL: https://bitbucket.org/xemacs/xemacs/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
commit/XEmacs: kehoea: Get X11 redisplay working again for the
just-in-time Unicode characters.
6 years, 10 months
Bitbucket
1 new commit in XEmacs:
https://bitbucket.org/xemacs/xemacs/commits/0f7f0274157b/
Changeset: 0f7f0274157b
User: kehoea
Date: 2017-12-06 20:52:28+00:00
Summary: Get X11 redisplay working again for the just-in-time Unicode characters.
src/ChangeLog addition:
2017-12-06 Aidan Kehoe <kehoea(a)parhasard.net>
* unicode.c (allocate_jit_ucs_charset):
Ben removed the ccl-encode-to-ucs-2 CCL program even from the
non-unicode-internal build, and this meant that redisplay of the
just-in-time characters failed on X11.
Address this and simplify the code by leaving charset-registries
as nil for the just in time charsets, meaning the second-stage
code always gets invoked, and we don't need the CCL program.
Affected #: 2 files
diff -r 1f54a2879725779c7da8c8a3b22de821a595e049 -r 0f7f0274157b50c71683368d0614b8912e2b70d7 src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -13,6 +13,16 @@
If KEY is a cons, loop using EXTERNAL_LIST_LOOP_3(), giving us
type and circularity checking.
+2017-12-06 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * unicode.c (allocate_jit_ucs_charset):
+ Ben removed the ccl-encode-to-ucs-2 CCL program even from the
+ non-unicode-internal build, and this meant that redisplay of the
+ just-in-time characters failed on X11.
+ Address this and simplify the code by leaving charset-registries
+ as nil for the just in time charsets, meaning the second-stage
+ code always gets invoked, and we don't need the CCL program.
+
2017-11-30 Aidan Kehoe <kehoea(a)parhasard.net>
* keymap.c (describe_command):
diff -r 1f54a2879725779c7da8c8a3b22de821a595e049 -r 0f7f0274157b50c71683368d0614b8912e2b70d7 src/unicode.c
--- a/src/unicode.c
+++ b/src/unicode.c
@@ -1301,17 +1301,17 @@
sprintf (setname, "jit-ucs-charset-%d", number_of_jit_charsets);
- Vcurrent_jit_charset = Fmake_charset
- (intern (setname), Vcharset_descr,
- nconc2 (list6 (Qcolumns, Qone, Qchars,
- make_fixnum (96),
- Qdimension, make_fixnum (2)),
- list4 (Qregistries, Qunicode_registries,
- /* not allowed to set non-nil tags when not yet
- initialized, for bootstrapping reasons; these
- get set in mule-charset.el */
- Qtags, initialized ? list2 (intern ("jit"), Qinternal)
- : Qnil)));
+ Vcurrent_jit_charset
+ = Fmake_charset (intern (setname), Vcharset_descr,
+ listu (Qcolumns, Qone, Qchars, make_fixnum (96),
+ Qdimension, make_fixnum (2),
+ /* not allowed to set non-nil tags when not yet
+ initialized, for bootstrapping reasons; these
+ get set in mule-charset.el */
+ Qtags, initialized ? list2 (intern ("jit"),
+ Qinternal) : Qnil,
+ Qunbound));
+
XCHARSET (Vcurrent_jit_charset)->jit_charset_p = 1;
last_allocated_jit_c1 = last_allocated_jit_c2 = 32;
Repository URL: https://bitbucket.org/xemacs/xemacs/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.