[Pkg-jed-commit] r407 - jed/branches/0.99.19/patches
Jörg Sommer
jo-guest at costa.debian.org
Wed Aug 23 23:48:01 UTC 2006
Author: jo-guest
Date: 2006-08-23 23:47:55 +0000 (Wed, 23 Aug 2006)
New Revision: 407
Added:
jed/branches/0.99.19/patches/fix-menu-utf8.dpatch
jed/branches/0.99.19/patches/fix-multi-key.dpatch
jed/branches/0.99.19/patches/help.dpatch
Modified:
jed/branches/0.99.19/patches/00list
Log:
* help.dpatch fix-multi-key.dpatch fix-menu-utf8.dpatch
+ Added some experimental patches and fixes.
Modified: jed/branches/0.99.19/patches/00list
===================================================================
--- jed/branches/0.99.19/patches/00list 2006-08-23 08:36:19 UTC (rev 406)
+++ jed/branches/0.99.19/patches/00list 2006-08-23 23:47:55 UTC (rev 407)
@@ -17,3 +17,6 @@
fix-pymode-block-end
doc
pymode-python2-keywords
+help
+fix-multi-key
+fix-menu-utf8
Added: jed/branches/0.99.19/patches/fix-menu-utf8.dpatch
===================================================================
--- jed/branches/0.99.19/patches/fix-menu-utf8.dpatch 2006-08-23 08:36:19 UTC (rev 406)
+++ jed/branches/0.99.19/patches/fix-menu-utf8.dpatch 2006-08-23 23:47:55 UTC (rev 407)
@@ -0,0 +1,79 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## fix-menu-utf8.dpatch by Jörg Sommer <joerg at alea.gnuu.de>
+##
+## DP: The handling of UTF‐8 strings for menu entries is not correct. This
+## DP: causes problems if the hotkey is an UTF‐8 character.
+
+ at DPATCH@
+diff -urNad trunk~/lib/xterm.sl trunk/lib/xterm.sl
+--- trunk~/src/menu.c (Revision 35)
++++ trunk/src/menu.c (Arbeitskopie)
+@@ -968,41 +968,39 @@
+
+ static void draw_name (char *name, int color0, int color1, unsigned int field_width)
+ {
+- char *s;
+- unsigned int n;
++ const size_t name_len = strlen(name);
++ SLuchar_Type *s = name, *next_s;
++ SLuchar_Type * const name_end = name + name_len;
+
+- s = name;
++ while (s != name_end && (*s != '&'))
++ s = SLutf8_skip_char(s, name_end);
+
+- while (*s && (*s != '&'))
+- s++;
++ SLsmg_set_color (color0);
++ if (s == name_end)
++ {
++ if (field_width < name_len)
++ SLsmg_write_string(name);
++ else
++ SLsmg_write_nstring(name, field_width);
+
+- n = (unsigned int) (s - name);
+- if (n)
+- {
+- SLsmg_set_color (color0);
+- SLsmg_write_nchars (name, n);
+- }
++ return;
++ }
+
+- if (*s != 0)
+- {
+- unsigned int dn;
++ SLsmg_write_chars (name, s);
++ SLsmg_set_color (color1);
+
+- s++;
+- SLsmg_set_color (color1);
+- SLsmg_write_nchars (s, 1);
+- n++;
+- SLsmg_set_color (color0);
+- if (*s != 0)
+- {
+- s++;
+- dn = strlen (s);
+- SLsmg_write_nchars (s, dn);
+- n += dn;
+- }
+- }
++ ++s; /* skip the ampersand */
++ next_s = SLutf8_skip_char(s, name_end);
++ SLsmg_write_chars (s, next_s);
++ SLsmg_set_color (color0);
+
+- if (n < field_width)
+- SLsmg_write_nstring ("", field_width - n);
++ if (field_width < name_len)
++ SLsmg_write_string(next_s);
++ else
++ {
++ field_width -= (SLutf8_strlen(name, 0)-1) - SLutf8_strlen(next_s, 0);
++ SLsmg_write_nstring(next_s, field_width);
++ }
+ }
+
+
Added: jed/branches/0.99.19/patches/fix-multi-key.dpatch
===================================================================
--- jed/branches/0.99.19/patches/fix-multi-key.dpatch 2006-08-23 08:36:19 UTC (rev 406)
+++ jed/branches/0.99.19/patches/fix-multi-key.dpatch 2006-08-23 23:47:55 UTC (rev 407)
@@ -0,0 +1,38 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## fix-multi-key.dpatch by Jörg Sommer <joerg at alea.gnuu.de>
+##
+## DP: The multi key does not work in Jed.
+
+ at DPATCH@
+diff -urNad trunk~/src/xterm.sl trunk/src/xterm.c
+--- trunk~/src/xterm.c (Revision 35)
++++ trunk/src/xterm.c (Arbeitskopie)
+@@ -1490,21 +1490,15 @@
+ static int X_input_pending (void) /*{{{*/
+ {
+ XEvent ev;
+- int n;
+-
+ if (No_XEvents) return 0;
+
+- n = XPending (This_XDisplay);
+- if (!n) return (0);
+-
+- /* I need some way of getting only kbd events. */
+- while (n--)
+- {
+- XPeekEvent(This_XDisplay, &ev);
+- if (0 == x_handle_harmless_events (&ev)) return 1;
+- XNextEvent(This_XDisplay, &ev);
+- }
+- return 0;
++ if ( XCheckMaskEvent(This_XDisplay, KeyPressMask, &ev) )
++ {
++ XPutBackEvent(This_XDisplay, &ev);
++ return 1;
++ }
++ else
++ return 0;
+ }
+
+ /*}}}*/
Added: jed/branches/0.99.19/patches/help.dpatch
===================================================================
--- jed/branches/0.99.19/patches/help.dpatch 2006-08-23 08:36:19 UTC (rev 406)
+++ jed/branches/0.99.19/patches/help.dpatch 2006-08-23 23:47:55 UTC (rev 407)
@@ -0,0 +1,117 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## lib.dpatch by Jörg Sommer <joerg at alea.gnuu.de>
+##
+## DP: This patch improves the describe_bindings() function.
+## DP: * It makes all key descriptions are aligned among each other,
+## DP: * it splits the listing into two sections: one with the keys defined in
+## DP: the global mode and one with the key special to this mode
+## DP: * it prints the description of the function bound to the key behind the
+## DP: function
+
+ at DPATCH@
+diff -urNad trunk~/lib/help.sl trunk/lib/help.sl
+--- trunk~/lib/help.sl (Revision 35)
++++ trunk/lib/help.sl (Arbeitskopie)
+@@ -347,12 +347,97 @@
+ pop2buf("*KeyBindings*");
+ erase_buffer ();
+ dump_bindings (map);
+- bob(); replace ("ESC [ A", "UP");
+- bob(); replace ("ESC [ B", "DOWN");
+- bob(); replace ("ESC [ C", "RIGHT");
+- bob(); replace ("ESC [ D", "LEFT");
+- bob(); replace ("ESC O P", "GOLD");
++
++ if (map != "global")
++ {
++ insert("\nInherited from the global keymap:\n");
++ push_spot();
++ dump_bindings("global");
++ pop_spot();
++
++ variable global_map = Assoc_Type[String_Type];
++ while ( not eobp() )
++ {
++ push_mark();
++ () = ffind("\t\t\t");
++ variable key = bufsubstr();
++ () = right(3);
++ push_mark();
++ eol();
++ global_map[key] = bufsubstr();
++ delete_line();
++ }
++
++ bob();
++ forever
++ {
++ push_mark();
++ () = ffind("\t\t\t");
++ key = bufsubstr();
++ if (key == "")
++ break;
++
++ if ( assoc_key_exists(global_map, key) )
++ {
++ () = right(3);
++ push_mark();
++ eol();
++ if (bufsubstr() == global_map[key])
++ {
++ delete_line();
++ push_spot();
++ eob();
++ insert(key + "\t\t\t" + global_map[key] + "\n");
++ pop_spot();
++ }
++ else
++ () = down(1);
++ }
++ else
++ () = down(1);
++ }
++ }
+ bob();
++
++ replace ("ESC [ A", "UP");
++ replace ("ESC [ B", "DOWN");
++ replace ("ESC [ C", "RIGHT");
++ replace ("ESC [ D", "LEFT");
++ replace ("ESC O P", "GOLD");
++
++ do
++ if (ffind("\t\t\t") and what_column() > TAB)
++ {
++ if ( what_column() <= TAB*3 )
++ deln( (what_column()-1)/TAB );
++ else
++ deln(3);
++ }
++ while ( down(1) );
++ bob();
++
++ do
++ if ( ffind("\t\t\t") )
++ {
++ () = right(3);
++ push_mark();
++ !if ( ffind_char('(') )
++ eol();
++ variable fun = bufsubstr();
++ variable dsc = help_get_doc_string(fun);
++ pop;
++ if (dsc != NULL)
++ {
++ eol();
++ dsc = substr(dsc, is_substr(dsc, "\n SYNOPSIS\n ")+12,
++ strlen(dsc) );
++ whitespace( 48 - what_column() );
++ insert(substr(dsc, 1, is_substr(dsc, "\n")-1) );
++ }
++ }
++ while ( down(1) );
++ bob();
++
+ CASE_SEARCH = cse;
+ set_buffer_modified_flag(0);
+ pop2buf (buf);
More information about the Pkg-jed-commit
mailing list