Initial commit - pkgsrc-localpatches - leot's pkgsrc LOCALPATCHES
 (HTM) hg clone https://bitbucket.org/iamleot/pkgsrc-localpatches
 (DIR) Log
 (DIR) Files
 (DIR) Refs
       ---
 (DIR) changeset 7981c5f981fdbbec116d1d88d87dcb4bd13d17e1
 (HTM) Author: Leonardo Taccari <iamleot@gmail.com>
       Date:   Fri, 17 Aug 2018 20:05:23 
       
       Initial commit
       
       Diffstat:
        chat/py-hangups/patch-hangups_ui_main_.py  |    15 +
        graphics/sxiv/patch-config.h               |   163 ++
        graphics/sxiv/patch-main.c                 |    16 +
        mail/nmh/patch-sbr_mts.c                   |    17 +
        mail/rss2email/patch-config.py             |    39 +
        mail/rss2email/patch-feed.py               |    27 +
        misc/dvtm/patch-config.h                   |   220 +++
        misc/fzy/patch-config.h                    |    13 +
        misc/fzy/patch-src_choices.c               |    21 +
        misc/fzy/patch-src_tty_interface.c         |    34 +
        misc/tmux/patch-osdep-netbsd.c             |    43 +
        misc/tmux/patch-window-copy.c.patch        |    14 +
        net/sacc/patch-config.h                    |    29 +
        net/sacc/patch-ui_ti.c                     |    53 +
        print/mupdf/patch-platform_x11_x11__main.c |    27 +
        print/zathura/patch-zathura_config.c       |    22 +
        print/zathura/patch-zathura_shortcuts.c    |    17 +
        shells/tcsh/patch-ed.chared.c.patch        |    23 +
        shells/tcsh/patch-ed.inputl.c.patch        |    14 +
        shells/tcsh/patch-tc.const.c.patch         |    16 +
        shells/tcsh/patch-tcsh.man                 |    17 +
        shells/tcsh/patch-tcsh.man.new             |    18 +
        sysutils/noice/patch-config.h              |    82 +
        sysutils/noice/patch-noice.c               |    48 +
        textproc/par/par-1.52-i18n.4.patch         |  1879 ++++++++++++++++++++++++++++
        wm/dwm/patch-config.h                      |   224 +++
        x11/dmenu/patch-config.h                   |    26 +
        x11/st-term/patch-co                       |   466 ++++++
        x11/tabbed/patch-config.h                  |    75 +
        x11/unclutter/patch-unclutter.c            |    40 +
        30 files changed, 3698 insertions(+), 0 deletions(-)
       ---
       diff -r 000000000000 -r 7981c5f981fd chat/py-hangups/patch-hangups_ui_main_.py
       --- /dev/null   Thu Jan 01 00:00:00 1970 +0000
       +++ b/chat/py-hangups/patch-hangups_ui_main_.py Fri Aug 17 20:05:23 2018 +0200
       @@ -0,0 +1,15 @@
       +$NetBSD$
       +
       +Reduce some noise for the prompt.
       +
       +--- hangups/ui/__main__.py.orig        2017-01-11 04:02:37.000000000 +0000
       ++++ hangups/ui/__main__.py
       +@@ -728,7 +728,7 @@ class ConversationWidget(urwid.WidgetWra
       +             ('weight', 1, self._list_box),
       +             ('pack', self._status_widget),
       +             ('pack', ReturnableEdit(self._on_return, keybindings,
       +-                                    caption='Send message: ')),
       ++                                    caption='> ')),
       +         ])
       +         # focus the edit widget by default
       +         self._widget.focus_position = 2
       diff -r 000000000000 -r 7981c5f981fd graphics/sxiv/patch-config.h
       --- /dev/null   Thu Jan 01 00:00:00 1970 +0000
       +++ b/graphics/sxiv/patch-config.h      Fri Aug 17 20:05:23 2018 +0200
       @@ -0,0 +1,163 @@
       +--- /dev/null  2017-10-28 17:06:36.969087391 +0200
       ++++ config.h   2017-10-28 17:04:52.844052093 +0200
       +@@ -0,0 +1,160 @@
       ++#ifdef _WINDOW_CONFIG
       ++
       ++/* default window dimensions (overwritten via -g option): */
       ++enum {
       ++      WIN_WIDTH  = 800,
       ++      WIN_HEIGHT = 600
       ++};
       ++
       ++/* bar font:
       ++ * (see fonts-conf(5) subsection "FONT NAMES" for valid values)
       ++ */
       ++static const char * const BAR_FONT = "monospace:size=8";
       ++
       ++/* colors:
       ++ * (see X(7) section "COLOR NAMES" for valid values)
       ++ */
       ++static const char * const WIN_BG_COLOR = "#000000";
       ++static const char * const WIN_FS_COLOR = "#000000";
       ++static const char * const SEL_COLOR    = "#FFFFFF";
       ++static const char * const BAR_BG_COLOR = "#000000";
       ++static const char * const BAR_FG_COLOR = "#FFFFFF";
       ++
       ++#endif
       ++#ifdef _IMAGE_CONFIG
       ++
       ++/* levels (in percent) to use when zooming via '-' and '+':
       ++ * (first/last value is used as min/max zoom level)
       ++ */
       ++static const float zoom_levels[] = {
       ++       12.5,  25.0,  50.0,  75.0,
       ++      100.0, 150.0, 200.0, 400.0, 800.0
       ++};
       ++
       ++/* default slideshow delay (in sec, overwritten via -S option): */
       ++enum { SLIDESHOW_DELAY = 5 };
       ++
       ++/* gamma correction: the user-visible ranges [-GAMMA_RANGE, 0] and
       ++ * (0, GAMMA_RANGE] are mapped to the ranges [0, 1], and (1, GAMMA_MAX].
       ++ * */
       ++static const double GAMMA_MAX   = 10.0;
       ++static const int    GAMMA_RANGE = 32;
       ++
       ++/* command i_scroll pans image 1/PAN_FRACTION of screen width/height */
       ++static const int PAN_FRACTION = 5;
       ++
       ++/* if false, pixelate images at zoom level != 100%,
       ++ * toggled with 'a' key binding
       ++ */
       ++static const bool ANTI_ALIAS = true;
       ++
       ++/* if true, use a checkerboard background for alpha layer,
       ++ * toggled with 'A' key binding
       ++ */
       ++static const bool ALPHA_LAYER = false;
       ++
       ++#endif
       ++#ifdef _THUMBS_CONFIG
       ++
       ++/* thumbnail sizes in pixels (width == height): */
       ++static const int thumb_sizes[] = { 32, 64, 96, 128, 160 };
       ++
       ++/* thumbnail size at startup, index into thumb_sizes[]: */
       ++static const int THUMB_SIZE = 3;
       ++
       ++#endif
       ++#ifdef _MAPPINGS_CONFIG
       ++
       ++/* keyboard mappings for image and thumbnail mode: */
       ++static const keymap_t keys[] = {
       ++      /* modifiers    key               function              argument */
       ++      { 0,            XK_q,             g_quit,               None },
       ++      { 0,            XK_Return,        g_switch_mode,        None },
       ++      { 0,            XK_f,             g_toggle_fullscreen,  None },
       ++      { 0,            XK_b,             g_toggle_bar,         None },
       ++      { ControlMask,  XK_x,             g_prefix_external,    None },
       ++      { 0,            XK_g,             g_first,              None },
       ++      { 0,            XK_G,             g_n_or_last,          None },
       ++      { 0,            XK_r,             g_reload_image,       None },
       ++      { 0,            XK_D,             g_remove_image,       None },
       ++      { ControlMask,  XK_h,             g_scroll_screen,      DIR_LEFT },
       ++      { ControlMask,  XK_Left,          g_scroll_screen,      DIR_LEFT },
       ++      { ControlMask,  XK_j,             g_scroll_screen,      DIR_DOWN },
       ++      { ControlMask,  XK_Down,          g_scroll_screen,      DIR_DOWN },
       ++      { ControlMask,  XK_k,             g_scroll_screen,      DIR_UP },
       ++      { ControlMask,  XK_Up,            g_scroll_screen,      DIR_UP },
       ++      { ControlMask,  XK_l,             g_scroll_screen,      DIR_RIGHT },
       ++      { ControlMask,  XK_Right,         g_scroll_screen,      DIR_RIGHT },
       ++      { 0,            XK_plus,          g_zoom,               +1 },
       ++      { 0,            XK_KP_Add,        g_zoom,               +1 },
       ++      { 0,            XK_minus,         g_zoom,               -1 },
       ++      { 0,            XK_KP_Subtract,   g_zoom,               -1 },
       ++      { 0,            XK_m,             g_toggle_image_mark,  None },
       ++      { 0,            XK_M,             g_reverse_marks,      None },
       ++      { ControlMask,  XK_m,             g_unmark_all,         None },
       ++      { 0,            XK_N,             g_navigate_marked,    +1 },
       ++      { 0,            XK_P,             g_navigate_marked,    -1 },
       ++      { 0,            XK_braceleft,     g_change_gamma,       -1 },
       ++      { 0,            XK_braceright,    g_change_gamma,       +1 },
       ++      { ControlMask,  XK_g,             g_change_gamma,        0 },
       ++
       ++      { 0,            XK_h,             t_move_sel,           DIR_LEFT },
       ++      { 0,            XK_Left,          t_move_sel,           DIR_LEFT },
       ++      { 0,            XK_j,             t_move_sel,           DIR_DOWN },
       ++      { 0,            XK_Down,          t_move_sel,           DIR_DOWN },
       ++      { 0,            XK_k,             t_move_sel,           DIR_UP },
       ++      { 0,            XK_Up,            t_move_sel,           DIR_UP },
       ++      { 0,            XK_l,             t_move_sel,           DIR_RIGHT },
       ++      { 0,            XK_Right,         t_move_sel,           DIR_RIGHT },
       ++      { 0,            XK_R,             t_reload_all,         None },
       ++
       ++      { 0,            XK_n,             i_navigate,           +1 },
       ++      { 0,            XK_n,             i_scroll_to_edge,     DIR_LEFT | DIR_UP },
       ++      { 0,            XK_space,         i_navigate,           +1 },
       ++      { 0,            XK_p,             i_navigate,           -1 },
       ++      { 0,            XK_p,             i_scroll_to_edge,     DIR_LEFT | DIR_UP },
       ++      { 0,            XK_BackSpace,     i_navigate,           -1 },
       ++      { 0,            XK_bracketright,  i_navigate,           +10 },
       ++      { 0,            XK_bracketleft,   i_navigate,           -10 },
       ++      { ControlMask,  XK_6,             i_alternate,          None },
       ++      { ControlMask,  XK_n,             i_navigate_frame,     +1 },
       ++      { ControlMask,  XK_p,             i_navigate_frame,     -1 },
       ++      { ControlMask,  XK_space,         i_toggle_animation,   None },
       ++      { 0,            XK_h,             i_scroll,             DIR_LEFT },
       ++      { 0,            XK_Left,          i_scroll,             DIR_LEFT },
       ++      { 0,            XK_j,             i_scroll,             DIR_DOWN },
       ++      { 0,            XK_Down,          i_scroll,             DIR_DOWN },
       ++      { 0,            XK_k,             i_scroll,             DIR_UP },
       ++      { 0,            XK_Up,            i_scroll,             DIR_UP },
       ++      { 0,            XK_l,             i_scroll,             DIR_RIGHT },
       ++      { 0,            XK_Right,         i_scroll,             DIR_RIGHT },
       ++      { 0,            XK_H,             i_scroll_to_edge,     DIR_LEFT },
       ++      { 0,            XK_J,             i_scroll_to_edge,     DIR_DOWN },
       ++      { 0,            XK_K,             i_scroll_to_edge,     DIR_UP },
       ++      { 0,            XK_L,             i_scroll_to_edge,     DIR_RIGHT },
       ++      { 0,            XK_equal,         i_set_zoom,           100 },
       ++      { 0,            XK_w,             i_fit_to_win,         SCALE_DOWN },
       ++      { 0,            XK_W,             i_fit_to_win,         SCALE_FIT },
       ++      { 0,            XK_e,             i_fit_to_win,         SCALE_WIDTH },
       ++      { 0,            XK_E,             i_fit_to_win,         SCALE_HEIGHT },
       ++      { 0,            XK_less,          i_rotate,             DEGREE_270 },
       ++      { 0,            XK_greater,       i_rotate,             DEGREE_90 },
       ++      { 0,            XK_question,      i_rotate,             DEGREE_180 },
       ++      { 0,            XK_bar,           i_flip,               FLIP_HORIZONTAL },
       ++      { 0,            XK_underscore,    i_flip,               FLIP_VERTICAL },
       ++      { 0,            XK_a,             i_toggle_antialias,   None },
       ++      { 0,            XK_A,             i_toggle_alpha,       None },
       ++      { 0,            XK_s,             i_slideshow,          None },
       ++};
       ++
       ++/* mouse button mappings for image mode: */
       ++static const button_t buttons[] = {
       ++      /* modifiers    button            function              argument */
       ++      { 0,            1,                i_cursor_navigate,    None },
       ++      { 0,            2,                i_drag,               None },
       ++      { 0,            3,                g_switch_mode,        None },
       ++      { 0,            4,                g_zoom,               +1 },
       ++      { 0,            5,                g_zoom,               -1 },
       ++};
       ++
       ++#endif
       diff -r 000000000000 -r 7981c5f981fd graphics/sxiv/patch-main.c
       --- /dev/null   Thu Jan 01 00:00:00 1970 +0000
       +++ b/graphics/sxiv/patch-main.c        Fri Aug 17 20:05:23 2018 +0200
       @@ -0,0 +1,16 @@
       +$NetBSD$
       +
       +Put more information in the window title, similar to the ones in the bar.
       +
       +--- main.c.orig        2015-12-20 12:21:25.000000000 +0000
       ++++ main.c
       +@@ -344,7 +344,8 @@ void update_info(void)
       +       if (mode == MODE_THUMB) {
       +               win_set_title(&win, "sxiv");
       +       } else {
       +-              snprintf(title, sizeof(title), "sxiv - %s", files[fileidx].name);
       ++              snprintf(title, sizeof(title), "%s - %d/%d (%d%%)",
       ++                  files[fileidx].name, fileidx + 1, filecnt, (int) (img.zoom * 100.0));
       +               win_set_title(&win, title);
       +       }
       + 
       diff -r 000000000000 -r 7981c5f981fd mail/nmh/patch-sbr_mts.c
       --- /dev/null   Thu Jan 01 00:00:00 1970 +0000
       +++ b/mail/nmh/patch-sbr_mts.c  Fri Aug 17 20:05:23 2018 +0200
       @@ -0,0 +1,17 @@
       +$NetBSD$
       +
       +Honors possible LOCALMAILBOX environment variable and treat it like the
       +Local-Mailbox profile entry.
       +
       +--- sbr/mts.c.orig     2018-03-06 19:05:55.000000000 +0000
       ++++ sbr/mts.c
       +@@ -371,6 +371,9 @@ getuserinfo (void)
       +       }
       +     }
       + 
       ++    if ((cp = getenv ("LOCALMAILBOX")) && *cp)
       ++      strncpy (localmbox, cp, sizeof(localmbox));
       ++
       +     if (username[0] == '\0') {
       +       strncpy (username, pw->pw_name, sizeof(username));
       +     }
       diff -r 000000000000 -r 7981c5f981fd mail/rss2email/patch-config.py
       --- /dev/null   Thu Jan 01 00:00:00 1970 +0000
       +++ b/mail/rss2email/patch-config.py    Fri Aug 17 20:05:23 2018 +0200
       @@ -0,0 +1,39 @@
       +$NetBSD$
       +
       +Add support for inline-links and wrap-links options.
       +
       +--- rss2email/config.py.orig   2017-05-22 14:13:37.595465747 +0000
       ++++ rss2email/config.py
       +@@ -51,11 +51,15 @@ class Config (_configparser.ConfigParser
       +         """
       +         if section not in self:
       +             section = 'DEFAULT'
       ++        _html2text.config.INLINE_LINKS = self.getboolean(
       ++            section, 'inline-links')
       +         _html2text.config.UNICODE_SNOB = self.getboolean(
       +             section, 'unicode-snob')
       +         _html2text.config.LINKS_EACH_PARAGRAPH = self.getboolean(
       +             section, 'links-after-each-paragraph')
       +         _html2text.config.BODY_WIDTH = self.getint(section, 'body-width')
       ++        _html2text.config.WRAP_LINKS = self.getboolean(
       ++            section, 'wrap-links')
       + 
       + 
       + CONFIG = Config()
       +@@ -174,12 +178,16 @@ CONFIG['DEFAULT'] = _collections.Ordered
       +                 '  margin-right: 5px;\n'
       +                 '}\n')),
       +         ## html2text options
       ++        # Put the links inline instead at the end as a reference
       ++        ('inline-links', str(True)),
       +         # Use Unicode characters instead of their ascii psuedo-replacements
       +         ('unicode-snob', str(False)),
       +         # Put the links after each paragraph instead of at the end.
       +         ('links-after-each-paragraph', str(False)),
       +         # Wrap long lines at position. 0 for no wrapping.
       +         ('body-width', str(0)),
       ++        # Wrap links during conversion
       ++        ('wrap-links', str(True)),
       + 
       +         ### Mailing
       +         # Select protocol from: sendmail, smtp, imap
       diff -r 000000000000 -r 7981c5f981fd mail/rss2email/patch-feed.py
       --- /dev/null   Thu Jan 01 00:00:00 1970 +0000
       +++ b/mail/rss2email/patch-feed.py      Fri Aug 17 20:05:23 2018 +0200
       @@ -0,0 +1,27 @@
       +$NetBSD$
       +
       +- Change default _USER_AGENT string (problematic with some feeds)
       +- Add support for inline-links and wrap-links options.
       +
       +--- rss2email/feed.py.orig     2014-09-01 23:21:01.000000000 +0000
       ++++ rss2email/feed.py
       +@@ -58,7 +58,7 @@ from . import error as _error
       + from . import util as _util
       + 
       + 
       +-_USER_AGENT = 'rss2email/{} ({})'.format(__version__, __url__)
       ++_USER_AGENT = 'rss2email/{}'.format(__version__)
       + _feedparser.USER_AGENT = _USER_AGENT
       + _urllib_request.install_opener(_urllib_request.build_opener())
       + _SOCKET_ERRORS = []
       +@@ -184,8 +184,10 @@ class Feed (object):
       +         'trust_link',
       +         'html_mail',
       +         'use_css',
       ++        'inline_links',
       +         'unicode_snob',
       +         'links_after_each_paragraph',
       ++        'wrap_links',
       +         'use_smtp',
       +         'smtp_ssl',
       +         ]
       diff -r 000000000000 -r 7981c5f981fd misc/dvtm/patch-config.h
       --- /dev/null   Thu Jan 01 00:00:00 1970 +0000
       +++ b/misc/dvtm/patch-config.h  Fri Aug 17 20:05:23 2018 +0200
       @@ -0,0 +1,220 @@
       +--- /dev/null  2016-01-17 23:22:00.000000000 +0100
       ++++ config.h   2016-01-17 23:21:46.000000000 +0100
       +@@ -0,0 +1,217 @@
       ++/* valid curses attributes are listed below they can be ORed
       ++ *
       ++ * A_NORMAL        Normal display (no highlight)
       ++ * A_STANDOUT      Best highlighting mode of the terminal.
       ++ * A_UNDERLINE     Underlining
       ++ * A_REVERSE       Reverse video
       ++ * A_BLINK         Blinking
       ++ * A_DIM           Half bright
       ++ * A_BOLD          Extra bright or bold
       ++ * A_PROTECT       Protected mode
       ++ * A_INVIS         Invisible or blank mode
       ++ */
       ++
       ++enum {
       ++      DEFAULT,
       ++      WHITE,
       ++};
       ++
       ++static Color colors[] = {
       ++      [DEFAULT] = { .fg = -1,         .bg = -1, .fg256 = -1, .bg256 = -1, },
       ++      [WHITE]    = { .fg = COLOR_WHITE, .bg = -1, .fg256 = 68, .bg256 = -1, },
       ++};
       ++
       ++#define COLOR(c)        COLOR_PAIR(colors[c].pair)
       ++/* curses attributes for the currently focused window */
       ++#define SELECTED_ATTR   (COLOR(WHITE) | A_NORMAL)
       ++/* curses attributes for normal (not selected) windows */
       ++#define NORMAL_ATTR     (COLOR(DEFAULT) | A_NORMAL)
       ++/* curses attributes for a window with pending urgent flag */
       ++#define URGENT_ATTR     NORMAL_ATTR
       ++/* curses attributes for the status bar */
       ++#define BAR_ATTR        (COLOR(WHITE) | A_NORMAL)
       ++/* characters for beginning and end of status bar message */
       ++#define BAR_BEGIN       '['
       ++#define BAR_END         ']'
       ++/* status bar (command line option -s) position */
       ++#define BAR_POS         BAR_TOP /* BAR_BOTTOM, BAR_OFF */
       ++/* whether status bar should be hidden if only one client exists */
       ++#define BAR_AUTOHIDE    false
       ++/* master width factor [0.1 .. 0.9] */
       ++#define MFACT 0.55
       ++/* number of clients in master area */
       ++#define NMASTER 1
       ++/* scroll back buffer size in lines */
       ++#define SCROLL_HISTORY 1000
       ++/* printf format string for the tag in the status bar */
       ++#define TAG_SYMBOL   "[%s]"
       ++/* curses attributes for the currently selected tags */
       ++#define TAG_SEL      (COLOR(DEFAULT) | A_BOLD)
       ++/* curses attributes for not selected tags which contain no windows */
       ++#define TAG_NORMAL   (COLOR(DEFAULT) | A_NORMAL)
       ++/* curses attributes for not selected tags which contain windows */
       ++#define TAG_OCCUPIED (COLOR(WHITE) | A_NORMAL)
       ++/* curses attributes for not selected tags which with urgent windows */
       ++#define TAG_URGENT (COLOR(DEFAULT) | A_NORMAL | A_REVERSE)
       ++
       ++const char tags[][8] = { "1", "2", "3", "4", "5" };
       ++
       ++#include "tile.c"
       ++#include "grid.c"
       ++#include "bstack.c"
       ++#include "fullscreen.c"
       ++
       ++/* by default the first layout entry is used */
       ++static Layout layouts[] = {
       ++      { "[ ]", fullscreen },
       ++      { "[]=", tile },
       ++      { "+++", grid },
       ++      { "TTT", bstack },
       ++};
       ++
       ++#define MOD  CTRL('b')
       ++#define TAGKEYS(KEY,TAG) \
       ++      { { MOD, 'v', KEY,     }, { view,           { tags[TAG] }               } }, \
       ++      { { MOD, 't', KEY,     }, { tag,            { tags[TAG] }               } }, \
       ++      { { MOD, 'V', KEY,     }, { toggleview,     { tags[TAG] }               } }, \
       ++      { { MOD, 'T', KEY,     }, { toggletag,      { tags[TAG] }               } },
       ++
       ++/* you can at most specifiy MAX_ARGS (3) number of arguments */
       ++static KeyBinding bindings[] = {
       ++      { { MOD, 'c',          }, { create,         { NULL }                    } },
       ++      { { MOD, 'C',          }, { create,         { NULL, NULL, "$CWD" }      } },
       ++      { { MOD, 'x', 'x',     }, { killclient,     { NULL }                    } },
       ++      { { MOD, 'j',          }, { focusnext,      { NULL }                    } },
       ++      { { MOD, 'J',          }, { focusnextnm,    { NULL }                    } },
       ++      { { MOD, 'K',          }, { focusprevnm,    { NULL }                    } },
       ++      { { MOD, 'k',          }, { focusprev,      { NULL }                    } },
       ++      { { MOD, 'f',          }, { setlayout,      { "[]=" }                   } },
       ++      { { MOD, 'g',          }, { setlayout,      { "+++" }                   } },
       ++      { { MOD, 'b',          }, { setlayout,      { "TTT" }                   } },
       ++      { { MOD, 'm',          }, { setlayout,      { "[ ]" }                   } },
       ++      { { MOD, ' ',          }, { setlayout,      { NULL }                    } },
       ++      { { MOD, 'i',          }, { incnmaster,     { "+1" }                    } },
       ++      { { MOD, 'd',          }, { incnmaster,     { "-1" }                    } },
       ++      { { MOD, 'h',          }, { setmfact,       { "-0.05" }                 } },
       ++      { { MOD, 'l',          }, { setmfact,       { "+0.05" }                 } },
       ++      { { MOD, '.',          }, { toggleminimize, { NULL }                    } },
       ++      { { MOD, 's',          }, { togglebar,      { NULL }                    } },
       ++      { { MOD, 'S',          }, { togglebarpos,   { NULL }                    } },
       ++      { { MOD, 'M',          }, { togglemouse,    { NULL }                    } },
       ++      { { MOD, '\n',         }, { zoom ,          { NULL }                    } },
       ++      { { MOD, '\r',         }, { zoom ,          { NULL }                    } },
       ++      { { MOD, '1',          }, { focusn,         { "1" }                     } },
       ++      { { MOD, '2',          }, { focusn,         { "2" }                     } },
       ++      { { MOD, '3',          }, { focusn,         { "3" }                     } },
       ++      { { MOD, '4',          }, { focusn,         { "4" }                     } },
       ++      { { MOD, '5',          }, { focusn,         { "5" }                     } },
       ++      { { MOD, '6',          }, { focusn,         { "6" }                     } },
       ++      { { MOD, '7',          }, { focusn,         { "7" }                     } },
       ++      { { MOD, '8',          }, { focusn,         { "8" }                     } },
       ++      { { MOD, '9',          }, { focusn,         { "9" }                     } },
       ++      { { MOD, '\t',         }, { focuslast,      { NULL }                    } },
       ++      { { MOD, 'q', 'q',     }, { quit,           { NULL }                    } },
       ++      { { MOD, 'a',          }, { togglerunall,   { NULL }                    } },
       ++      { { MOD, CTRL('L'),    }, { redraw,         { NULL }                    } },
       ++      { { MOD, 'r',          }, { redraw,         { NULL }                    } },
       ++      { { MOD, 'e',          }, { copymode,       { NULL }                    } },
       ++      { { MOD, '/',          }, { copymode,       { "/" }                     } },
       ++      { { MOD, 'p',          }, { paste,          { NULL }                    } },
       ++      { { MOD, KEY_PPAGE,    }, { scrollback,     { "-1" }                    } },
       ++      { { MOD, KEY_NPAGE,    }, { scrollback,     { "1"  }                    } },
       ++      { { MOD, '?',          }, { create,         { "man dvtm", "dvtm help" } } },
       ++      { { MOD, MOD,          }, { send,           { (const char []){MOD, 0} } } },
       ++      { { KEY_SPREVIOUS,     }, { scrollback,     { "-1" }                    } },
       ++      { { KEY_SNEXT,         }, { scrollback,     { "1"  }                    } },
       ++      { { MOD, '0',          }, { view,           { NULL }                    } },
       ++      { { MOD, KEY_F(1),     }, { view,           { tags[0] }                 } },
       ++      { { MOD, KEY_F(2),     }, { view,           { tags[1] }                 } },
       ++      { { MOD, KEY_F(3),     }, { view,           { tags[2] }                 } },
       ++      { { MOD, KEY_F(4),     }, { view,           { tags[3] }                 } },
       ++      { { MOD, KEY_F(5),     }, { view,           { tags[4] }                 } },
       ++      { { MOD, 'v', '0'      }, { view,           { NULL }                    } },
       ++      { { MOD, 'v', '\t',    }, { viewprevtag,    { NULL }                    } },
       ++      { { MOD, 't', '0'      }, { tag,            { NULL }                    } },
       ++      TAGKEYS( '1',                              0)
       ++      TAGKEYS( '2',                              1)
       ++      TAGKEYS( '3',                              2)
       ++      TAGKEYS( '4',                              3)
       ++      TAGKEYS( '5',                              4)
       ++};
       ++
       ++static const ColorRule colorrules[] = {
       ++      { "", A_NORMAL, &colors[DEFAULT] }, /* default */
       ++};
       ++
       ++/* possible values for the mouse buttons are listed below:
       ++ *
       ++ * BUTTON1_PRESSED          mouse button 1 down
       ++ * BUTTON1_RELEASED         mouse button 1 up
       ++ * BUTTON1_CLICKED          mouse button 1 clicked
       ++ * BUTTON1_DOUBLE_CLICKED   mouse button 1 double clicked
       ++ * BUTTON1_TRIPLE_CLICKED   mouse button 1 triple clicked
       ++ * BUTTON2_PRESSED          mouse button 2 down
       ++ * BUTTON2_RELEASED         mouse button 2 up
       ++ * BUTTON2_CLICKED          mouse button 2 clicked
       ++ * BUTTON2_DOUBLE_CLICKED   mouse button 2 double clicked
       ++ * BUTTON2_TRIPLE_CLICKED   mouse button 2 triple clicked
       ++ * BUTTON3_PRESSED          mouse button 3 down
       ++ * BUTTON3_RELEASED         mouse button 3 up
       ++ * BUTTON3_CLICKED          mouse button 3 clicked
       ++ * BUTTON3_DOUBLE_CLICKED   mouse button 3 double clicked
       ++ * BUTTON3_TRIPLE_CLICKED   mouse button 3 triple clicked
       ++ * BUTTON4_PRESSED          mouse button 4 down
       ++ * BUTTON4_RELEASED         mouse button 4 up
       ++ * BUTTON4_CLICKED          mouse button 4 clicked
       ++ * BUTTON4_DOUBLE_CLICKED   mouse button 4 double clicked
       ++ * BUTTON4_TRIPLE_CLICKED   mouse button 4 triple clicked
       ++ * BUTTON_SHIFT             shift was down during button state change
       ++ * BUTTON_CTRL              control was down during button state change
       ++ * BUTTON_ALT               alt was down during button state change
       ++ * ALL_MOUSE_EVENTS         report all button state changes
       ++ * REPORT_MOUSE_POSITION    report mouse movement
       ++ */
       ++
       ++#ifdef NCURSES_MOUSE_VERSION
       ++# define CONFIG_MOUSE /* compile in mouse support if we build against ncurses */
       ++#endif
       ++
       ++#define ENABLE_MOUSE true /* whether to enable mouse events by default */
       ++
       ++#ifdef CONFIG_MOUSE
       ++static Button buttons[] = {
       ++      { BUTTON1_CLICKED,        { mouse_focus,      { NULL  } } },
       ++      { BUTTON1_DOUBLE_CLICKED, { mouse_fullscreen, { "[ ]" } } },
       ++      { BUTTON2_CLICKED,        { mouse_zoom,       { NULL  } } },
       ++      { BUTTON3_CLICKED,        { mouse_minimize,   { NULL  } } },
       ++};
       ++#endif /* CONFIG_MOUSE */
       ++
       ++static Cmd commands[] = {
       ++      { "create", { create,   { NULL } } },
       ++};
       ++
       ++/* gets executed when dvtm is started */
       ++static Action actions[] = {
       ++      { create, { NULL } },
       ++};
       ++
       ++static char const * const keytable[] = {
       ++      /* add your custom key escape sequences */
       ++};
       ++
       ++/* editor to use for copy mode. If neither of DVTM_EDITOR, EDITOR and PAGER is
       ++ * set the first entry is chosen. Otherwise the array is consulted for supported
       ++ * options. A %d in argv is replaced by the line number at which the file should
       ++ * be opened. If filter is true the editor is expected to work even if stdout is
       ++ * redirected (i.e. not a terminal). If color is true then color escape sequences
       ++ * are generated in the output.
       ++ */
       ++static Editor editors[] = {
       ++      { .name = "vis",         .argv = { "vis", "+%d", "-", NULL   }, .filter = true,  .color = false },
       ++      { .name = "sandy",       .argv = { "sandy", "-d", "-", NULL  }, .filter = true,  .color = false },
       ++      { .name = "dvtm-editor", .argv = { "dvtm-editor", "-", NULL  }, .filter = true,  .color = false },
       ++      { .name = "vim",         .argv = { "vim", "+%d", "-", NULL   }, .filter = false, .color = false },
       ++      { .name = "less",        .argv = { "less", "-R", "+%d", NULL }, .filter = false, .color = true  },
       ++      { .name = "more",        .argv = { "more", "+%d", NULL       }, .filter = false, .color = false },
       ++};
       diff -r 000000000000 -r 7981c5f981fd misc/fzy/patch-config.h
       --- /dev/null   Thu Jan 01 00:00:00 1970 +0000
       +++ b/misc/fzy/patch-config.h   Fri Aug 17 20:05:23 2018 +0200
       @@ -0,0 +1,13 @@
       +--- /dev/null  2016-08-12 00:34:04.402861959 +0200
       ++++ config.h   2016-08-12 00:37:16.495787458 +0200
       +@@ -0,0 +1,10 @@
       ++#define TTY_COLOR_HIGHLIGHT TTY_COLOR_NORMAL
       ++
       ++#define SCORE_GAP_LEADING -0.005
       ++#define SCORE_GAP_TRAILING -0.005
       ++#define SCORE_GAP_INNER -0.01
       ++#define SCORE_MATCH_CONSECUTIVE 1.0
       ++#define SCORE_MATCH_SLASH 0.9
       ++#define SCORE_MATCH_WORD 0.8
       ++#define SCORE_MATCH_CAPITAL 0.7
       ++#define SCORE_MATCH_DOT 0.6
       diff -r 000000000000 -r 7981c5f981fd misc/fzy/patch-src_choices.c
       --- /dev/null   Thu Jan 01 00:00:00 1970 +0000
       +++ b/misc/fzy/patch-src_choices.c      Fri Aug 17 20:05:23 2018 +0200
       @@ -0,0 +1,21 @@
       +$NetBSD$
       +
       +Do not skip empty lines.
       +
       +--- src/choices.c.orig 2016-08-04 06:54:51.000000000 +0000
       ++++ src/choices.c
       +@@ -73,12 +73,10 @@ void choices_fread(choices_t *c, FILE *f
       +       char *line = c->buffer + buffer_start;
       +       do {
       +               char *nl = strchr(line, '\n');
       +-              if (nl)
       ++              if (nl) {
       +                       *nl++ = '\0';
       +-
       +-              /* Skip empty lines */
       +-              if (*line)
       +                       choices_add(c, line);
       ++              }
       + 
       +               line = nl;
       +       } while (line);
       diff -r 000000000000 -r 7981c5f981fd misc/fzy/patch-src_tty_interface.c
       --- /dev/null   Thu Jan 01 00:00:00 1970 +0000
       +++ b/misc/fzy/patch-src_tty_interface.c        Fri Aug 17 20:05:23 2018 +0200
       @@ -0,0 +1,34 @@
       +$NetBSD$
       +
       +Add support to go to the top and bottom like dmenu.
       +
       +--- src/tty_interface.c.orig   2017-04-17 07:55:42.000000000 +0000
       ++++ src/tty_interface.c
       +@@ -169,6 +169,18 @@ static void action_pagedown(tty_interfac
       +               choices_next(state->choices);
       + }
       + 
       ++static void action_top(tty_interface_t *state) {
       ++      update_state(state);
       ++      while(state->choices->selection > 0)
       ++              choices_prev(state->choices);
       ++}
       ++
       ++static void action_bottom(tty_interface_t *state) {
       ++      update_state(state);
       ++      while(state->choices->selection < state->choices->available-1)
       ++              choices_next(state->choices);
       ++}
       ++
       + static void action_autocomplete(tty_interface_t *state) {
       +       update_state(state);
       +       const char *current_selection = choices_get(state->choices, state->choices->selection);
       +@@ -229,6 +241,8 @@ static const keybinding_t keybindings[] 
       +                                          {KEY_CTRL('N'), action_next},         /* C-N */
       +                                          {KEY_CTRL('K'), action_prev},         /* C-J */
       +                                          {KEY_CTRL('J'), action_next},         /* C-K */
       ++                                         {KEY_CTRL('A'), action_top},          /* C-A */
       ++                                         {KEY_CTRL('E'), action_bottom},       /* C-E */
       + 
       +                                          {"\x1b[A", action_prev}, /* UP */
       +                                          {"\x1bOA", action_prev}, /* UP */
       diff -r 000000000000 -r 7981c5f981fd misc/tmux/patch-osdep-netbsd.c
       --- /dev/null   Thu Jan 01 00:00:00 1970 +0000
       +++ b/misc/tmux/patch-osdep-netbsd.c    Fri Aug 17 20:05:23 2018 +0200
       @@ -0,0 +1,43 @@
       +$NetBSD$
       +
       +Implement osdep_get_cwd() via mount_procfs(8) (inspired by osdep-sunos.c).
       +
       +--- osdep-netbsd.c.orig        2016-01-21 00:00:28.000000000 +0000
       ++++ osdep-netbsd.c
       +@@ -23,10 +23,13 @@
       + 
       + #include <errno.h>
       + #include <event.h>
       ++#include <limits.h>
       + #include <stdlib.h>
       + #include <string.h>
       + #include <unistd.h>
       + 
       ++#include "tmux.h"
       ++
       + #define is_runnable(p) \
       +         ((p)->p_stat == LSRUN || (p)->p_stat == SIDL)
       + #define is_stopped(p) \
       +@@ -127,6 +130,22 @@ error:
       + char *
       + osdep_get_cwd(int fd)
       + {
       ++      static char     target[PATH_MAX + 1];
       ++      char            *path;
       ++      pid_t           pgrp;
       ++      ssize_t         n;
       ++
       ++      if ((pgrp = tcgetpgrp(fd)) == -1)
       ++              return (NULL);
       ++
       ++      xasprintf(&path, "/proc/%u/cwd", (u_int) pgrp);
       ++      n = readlink(path, target, sizeof(target) - 1);
       ++      free(path);
       ++      if (n > 0) {
       ++              target[n] = '\0';
       ++              return (target);
       ++      }
       ++
       +       return (NULL);
       + }
       + 
       diff -r 000000000000 -r 7981c5f981fd misc/tmux/patch-window-copy.c.patch
       --- /dev/null   Thu Jan 01 00:00:00 1970 +0000
       +++ b/misc/tmux/patch-window-copy.c.patch       Fri Aug 17 20:05:23 2018 +0200
       @@ -0,0 +1,14 @@
       +$NetBSD$
       +
       +Do not show the `$' at the end of the lines (like it was in tmux<2.3).
       +
       +--- window-copy.c.orig 2016-09-25 21:24:32.000000000 +0000
       ++++ window-copy.c
       +@@ -1306,7 +1306,6 @@ window_copy_write_line(struct window_pan
       +       if (py == data->cy && data->cx == screen_size_x(s)) {
       +               memcpy(&gc, &grid_default_cell, sizeof gc);
       +               screen_write_cursormove(ctx, screen_size_x(s) - 1, py);
       +-              screen_write_putc(ctx, &gc, '$');
       +       }
       + }
       + 
       diff -r 000000000000 -r 7981c5f981fd net/sacc/patch-config.h
       --- /dev/null   Thu Jan 01 00:00:00 1970 +0000
       +++ b/net/sacc/patch-config.h   Fri Aug 17 20:05:23 2018 +0200
       @@ -0,0 +1,29 @@
       +--- /dev/null  2018-02-25 12:15:26.521513477 +0100
       ++++ config.h   2018-02-25 12:14:26.218483032 +0100
       +@@ -0,0 +1,26 @@
       ++/* See LICENSE file for copyright and license details. */
       ++
       ++/* Screen UI navigation keys */
       ++#define _key_lndown   'j' /* move one line down */
       ++#define _key_entrydown        '\t' /* move to next link */
       ++#define _key_lnup     'k' /* move one line up */
       ++#define _key_entryup  'K' /* move to previous link */
       ++#define _key_pgdown   ' ' /* move one screen down */
       ++#define _key_pgup     'b' /* move one screen up */
       ++#define _key_home     'g' /* move to the top of page */
       ++#define _key_end      'G' /* move to the bottom of page */
       ++#define _key_pgnext   'l' /* view highlighted item */
       ++#define _key_pgprev   'h' /* view previous item */
       ++#define _key_uri      'u' /* print item uri */
       ++#define _key_fetch    'L' /* refetch current item */
       ++#define _key_help     '?' /* display help */
       ++#define _key_quit     'q' /* exit sacc */
       ++#define _key_search   '/' /* search */
       ++#define _key_searchnext       'n' /* search same string forward */
       ++#define _key_searchprev       'N' /* search same string backward */
       ++
       ++/* default plumber */
       ++static char *plumber = "plumb";
       ++
       ++/* temporary directory */
       ++static char *tmpdir = "/tmp/sacc";
       diff -r 000000000000 -r 7981c5f981fd net/sacc/patch-ui_ti.c
       --- /dev/null   Thu Jan 01 00:00:00 1970 +0000
       +++ b/net/sacc/patch-ui_ti.c    Fri Aug 17 20:05:23 2018 +0200
       @@ -0,0 +1,53 @@
       +$NetBSD$
       +
       +- Fix help() message
       +- Do case insensitive search
       +- Add support for Shift+Tab (^[[Z) to go to the previous entry.
       +
       +--- ui_ti.c.orig       2018-02-24 15:24:43.000000000 +0000
       ++++ ui_ti.c
       +@@ -120,8 +120,8 @@ help(Item *entry)
       +                      "Right, " S(_key_pgnext) ": view highlighted item.\n"
       +                      "Left, " S(_key_pgprev) ": view previous item.\n"
       +                      S(_key_search) ": search current page.\n"
       +-                     S(_key_search_next) ": search string forward.\n"
       +-                     S(_key_search_prev) ": search string backward.\n"
       ++                     S(_key_searchnext) ": search string forward.\n"
       ++                     S(_key_searchprev) ": search string backward.\n"
       +                      S(_key_uri) ": print item uri.\n"
       +                      S(_key_help) ": show this help.\n"
       +                      "^D, " S(_key_quit) ": exit sacc.\n"
       +@@ -392,14 +392,14 @@ searchinline(const char *searchstr, Item
       + 
       +       if (pos > 0) {
       +               for (i = dir->curline + 1; i < dir->nitems; ++i) {
       +-                      if (strstr(dir->items[i].username, searchstr)) {
       ++                      if (strcasestr(dir->items[i].username, searchstr)) {
       +                               jumptoline(entry, i, 1);
       +                               break;
       +                       }
       +               }
       +       } else {
       +               for (i = dir->curline - 1; i > -1; --i) {
       +-                      if (strstr(dir->items[i].username, searchstr)) {
       ++                      if (strcasestr(dir->items[i].username, searchstr)) {
       +                               jumptoline(entry, i, 1);
       +                               break;
       +                       }
       +@@ -470,6 +470,8 @@ uiselectitem(Item *entry)
       +                               goto pgprev;
       +                       case 'H':
       +                               goto home;
       ++                      case 'Z':
       ++                              goto entryup;
       +                       case 0x1b:
       +                               goto quit;
       +                       }
       +@@ -503,6 +505,7 @@ uiselectitem(Item *entry)
       +                       movecurline(entry, -1);
       +                       continue;
       +               case _key_entryup:
       ++              entryup:
       +                       jumptoline(entry, nearentry(entry, -1), 1);
       +                       continue;
       +               case _key_pgup:
       diff -r 000000000000 -r 7981c5f981fd print/mupdf/patch-platform_x11_x11__main.c
       --- /dev/null   Thu Jan 01 00:00:00 1970 +0000
       +++ b/print/mupdf/patch-platform_x11_x11__main.c        Fri Aug 17 20:05:23 2018 +0200
       @@ -0,0 +1,27 @@
       +$NetBSD$
       +
       +Adjust colors.
       +
       +--- platform/x11/x11_main.c.orig       2016-11-28 13:34:04.000000000 +0000
       ++++ platform/x11/x11_main.c
       +@@ -218,13 +218,13 @@ static void winopen(void)
       +       xcwait = XCreateFontCursor(xdpy, XC_watch);
       +       xccaret = XCreateFontCursor(xdpy, XC_xterm);
       + 
       +-      xbgcolor.red = 0x7000;
       +-      xbgcolor.green = 0x7000;
       +-      xbgcolor.blue = 0x7000;
       +-
       +-      xshcolor.red = 0x4000;
       +-      xshcolor.green = 0x4000;
       +-      xshcolor.blue = 0x4000;
       ++      xbgcolor.red = 0x0000;
       ++      xbgcolor.green = 0x0000;
       ++      xbgcolor.blue = 0x0000;
       ++
       ++      xshcolor.red = 0x0000;
       ++      xshcolor.green = 0x0000;
       ++      xshcolor.blue = 0x0000;
       + 
       +       XAllocColor(xdpy, DefaultColormap(xdpy, xscr), &xbgcolor);
       +       XAllocColor(xdpy, DefaultColormap(xdpy, xscr), &xshcolor);
       diff -r 000000000000 -r 7981c5f981fd print/zathura/patch-zathura_config.c
       --- /dev/null   Thu Jan 01 00:00:00 1970 +0000
       +++ b/print/zathura/patch-zathura_config.c      Fri Aug 17 20:05:23 2018 +0200
       @@ -0,0 +1,22 @@
       +$NetBSD$
       +
       +--- zathura/config.c.orig      2015-04-03 09:38:50.000000000 +0000
       ++++ zathura/config.c
       +@@ -350,7 +350,7 @@ config_load_default(zathura_t* zathura)
       +   }
       + 
       +   /* Normal mode */
       +-  girara_shortcut_add(gsession, 0, GDK_KEY_F5,  NULL, sc_toggle_presentation, NORMAL, 0, NULL);
       ++  girara_shortcut_add(gsession, 0, GDK_KEY_F10, NULL, sc_toggle_presentation, NORMAL, 0, NULL);
       +   girara_shortcut_add(gsession, 0, GDK_KEY_F11, NULL, sc_toggle_fullscreen,   NORMAL, 0, NULL);
       + 
       +   DEFAULT_SHORTCUTS(NORMAL)
       +@@ -398,7 +398,7 @@ config_load_default(zathura_t* zathura)
       +   girara_shortcut_add(gsession, GDK_SHIFT_MASK, GDK_KEY_space,     NULL, sc_navigate,            PRESENTATION, PREVIOUS,     NULL);
       +   girara_shortcut_add(gsession, 0,              GDK_KEY_BackSpace, NULL, sc_navigate,            PRESENTATION, PREVIOUS,     NULL);
       + 
       +-  girara_shortcut_add(gsession, 0,              GDK_KEY_F5,        NULL, sc_toggle_presentation, PRESENTATION, 0,            NULL);
       ++  girara_shortcut_add(gsession, 0,              GDK_KEY_F10,       NULL, sc_toggle_presentation, PRESENTATION, 0,            NULL);
       + 
       +   girara_shortcut_add(gsession, 0,              GDK_KEY_q,         NULL, sc_quit,                PRESENTATION, 0,            NULL);
       + 
       diff -r 000000000000 -r 7981c5f981fd print/zathura/patch-zathura_shortcuts.c
       --- /dev/null   Thu Jan 01 00:00:00 1970 +0000
       +++ b/print/zathura/patch-zathura_shortcuts.c   Fri Aug 17 20:05:23 2018 +0200
       @@ -0,0 +1,17 @@
       +$NetBSD$
       +
       +--- zathura/shortcuts.c.orig   2017-01-11 21:05:00.000000000 +0000
       ++++ zathura/shortcuts.c
       +@@ -180,10 +180,8 @@ sc_focus_inputbar(girara_session_t* sess
       +         return false;
       +       }
       + 
       +-      char* path = g_path_get_dirname(file_path);
       +-      char* escaped = girara_escape_string(path);
       +-      char* tmp  = g_strdup_printf("%s%s/", (char*) argument->data, (g_strcmp0(path, "/") == 0) ? "" : escaped);
       +-      g_free(path);
       ++      char* escaped = girara_escape_string(file_path);
       ++      char* tmp  = g_strdup_printf("%s%s", (char*) argument->data, (g_strcmp0(file_path, "/") == 0) ? "" : escaped);
       +       g_free(escaped);
       + 
       +       gtk_entry_set_text(session->gtk.inputbar_entry, tmp);
       diff -r 000000000000 -r 7981c5f981fd shells/tcsh/patch-ed.chared.c.patch
       --- /dev/null   Thu Jan 01 00:00:00 1970 +0000
       +++ b/shells/tcsh/patch-ed.chared.c.patch       Fri Aug 17 20:05:23 2018 +0200
       @@ -0,0 +1,23 @@
       +$NetBSD$
       +
       +Add support for `vimoveback' in order to move the cursor back for
       +vi-cmd-mode (like vi(1), editline(3), etc.)
       +
       +--- ed.chared.c.orig   2015-08-19 14:29:55.000000000 +0000
       ++++ ed.chared.c
       +@@ -1404,14 +1404,8 @@ v_cmd_mode(Char c)
       + 
       +     inputmode = MODE_INSERT;
       +     c_alternativ_key_map(1);
       +-#ifdef notdef
       +-    /*
       +-     * We don't want to move the cursor, because all the editing
       +-     * commands don't include the character under the cursor.
       +-     */
       +-    if (Cursor > InputBuf)
       ++    if (adrof(STRvimoveback) && Cursor > InputBuf)
       +       Cursor--;
       +-#endif
       +     RefCursor();
       +     return(CC_NORM);
       + }
       diff -r 000000000000 -r 7981c5f981fd shells/tcsh/patch-ed.inputl.c.patch
       --- /dev/null   Thu Jan 01 00:00:00 1970 +0000
       +++ b/shells/tcsh/patch-ed.inputl.c.patch       Fri Aug 17 20:05:23 2018 +0200
       @@ -0,0 +1,14 @@
       +$NetBSD$
       +
       +Do not add a '\n' on top of the run-help command.
       +
       +--- ed.inputl.c.orig   2012-10-19 15:23:32.000000000 +0000
       ++++ ed.inputl.c
       +@@ -533,7 +533,6 @@ Inputl(void)
       +           break;
       + 
       +       case CC_HELPME:
       +-          xputchar('\n');
       +           /* should catch ^C here... */
       +           (void) tenematch(InputBuf, LastChar - InputBuf, PRINT_HELP);
       +           Refresh();
       diff -r 000000000000 -r 7981c5f981fd shells/tcsh/patch-tc.const.c.patch
       --- /dev/null   Thu Jan 01 00:00:00 1970 +0000
       +++ b/shells/tcsh/patch-tc.const.c.patch        Fri Aug 17 20:05:23 2018 +0200
       @@ -0,0 +1,16 @@
       +$NetBSD$
       +
       +Add support for `vimoveback' in order to move the cursor back for
       +vi-cmd-mode (like vi(1), editline(3), etc.)
       +
       +--- tc.const.c.orig    2015-09-08 15:49:53.000000000 +0000
       ++++ tc.const.c
       +@@ -87,6 +87,8 @@ Char STROSTYPE[]     = { 'O', 'S', 'T', 'Y',
       + Char STRedit[]                = { 'e', 'd', 'i', 't', '\0' };
       + Char STReditors[]     = { 'e', 'd', 'i', 't', 'o', 'r', 's', '\0' };
       + Char STRvimode[]      = { 'v', 'i', 'm', 'o', 'd', 'e', '\0' };
       ++Char STRvimoveback[]  = { 'v', 'i', 'm', 'o', 'v', 'e', 'b', 'a', 'c', 'k',
       ++                          '\0' };
       + Char STRaddsuffix[]   = { 'a', 'd', 'd', 's', 'u', 'f', 'f', 'i', 'x',
       +                           '\0' };
       + Char STRcsubstnonl[]  = { 'c', 's', 'u', 'b', 's', 't', 'n', 'o', 'n', 'l',
       diff -r 000000000000 -r 7981c5f981fd shells/tcsh/patch-tcsh.man
       --- /dev/null   Thu Jan 01 00:00:00 1970 +0000
       +++ b/shells/tcsh/patch-tcsh.man        Fri Aug 17 20:05:23 2018 +0200
       @@ -0,0 +1,17 @@
       +$NetBSD$
       +
       +Document `vimoveback' option.
       +
       +--- tcsh.man.orig      2016-11-24 15:04:52.000000000 +0000
       ++++ tcsh.man
       +@@ -4795,6 +4795,10 @@ may be explicitly set or unset by the us
       + operations if required.
       + .RE
       + .TP 8
       ++.B vimoveback \fR(+)
       ++If set, move the cursor back when entering vi command mode.
       ++See also \fBvimode\fR.
       ++.TP 8
       + .B visiblebell \fR(+)
       + If set, a screen flash is used rather than the audible bell.
       + See also \fBnobeep\fR.
       diff -r 000000000000 -r 7981c5f981fd shells/tcsh/patch-tcsh.man.new
       --- /dev/null   Thu Jan 01 00:00:00 1970 +0000
       +++ b/shells/tcsh/patch-tcsh.man.new    Fri Aug 17 20:05:23 2018 +0200
       @@ -0,0 +1,18 @@
       +$NetBSD$
       +
       +Document `vimoveback' option.
       +
       +--- tcsh.man.new.orig  2016-11-24 15:06:09.000000000 +0000
       ++++ tcsh.man.new
       +@@ -8706,6 +8706,11 @@ may be explicitly set or unset by the us
       + operations if required.
       + .RE
       + .TP 8
       ++.B vimoveback \fR(+)
       ++If set, move the cursor back when entering vi command mode.
       ++See also
       ++.Va vimode
       ++.TP 8
       + .B visiblebell \fR(+)
       + If set, a screen flash is used rather than the audible bell.
       + See also
       diff -r 000000000000 -r 7981c5f981fd sysutils/noice/patch-config.h
       --- /dev/null   Thu Jan 01 00:00:00 1970 +0000
       +++ b/sysutils/noice/patch-config.h     Fri Aug 17 20:05:23 2018 +0200
       @@ -0,0 +1,82 @@
       +--- /dev/null  2017-08-03 19:16:31.068436057 +0200
       ++++ config.h   2017-08-03 19:16:58.313077649 +0200
       +@@ -0,0 +1,79 @@
       ++/* See LICENSE file for copyright and license details. */
       ++#define CWD   "cwd: "
       ++#define CURSR " > "
       ++#define EMPTY "   "
       ++
       ++int mtimeorder  = 0; /* Set to 1 to sort by time modified */
       ++int idletimeout = 0; /* Screensaver timeout in seconds, 0 to disable */
       ++int showhidden  = 0; /* Set to 1 to show hidden files by default */
       ++char *idlecmd   = "rain"; /* The screensaver program */
       ++
       ++struct assoc assocs[] = {
       ++      { "\\.(avi|mp4|mkv|mp3|ogg|flac|mov|m4a)$", "mpv" },
       ++      { "\\.(bmp|gif|jpg|jpeg|png|pnm|tiff)$", "sxiv" },
       ++      { "\\.(htm|html)$", "w3m" },
       ++      { "\\.(svg)$", "open" },
       ++      { "\\.pdf$", "mupdf" },
       ++      { "\\.epub$", "mupdf" },
       ++      { "\\.sh$", "less" },
       ++      { ".", "less" },
       ++};
       ++
       ++struct key bindings[] = {
       ++      /* Quit */
       ++      { 'q',            SEL_QUIT },
       ++      { CONTROL('D'),   SEL_QUIT },
       ++      /* Back */
       ++      { KEY_BACKSPACE,  SEL_BACK },
       ++      { KEY_LEFT,       SEL_BACK },
       ++      { 'h',            SEL_BACK },
       ++      { CONTROL('H'),   SEL_BACK },
       ++      /* Inside */
       ++      { KEY_ENTER,      SEL_GOIN },
       ++      { '\r',           SEL_GOIN },
       ++      { KEY_RIGHT,      SEL_GOIN },
       ++      { 'l',            SEL_GOIN },
       ++      /* Filter */
       ++      { '/',            SEL_FLTR },
       ++      { '&',            SEL_FLTR },
       ++      { '?',            SEL_FLTR },
       ++      /* Next */
       ++      { 'j',            SEL_NEXT },
       ++      { KEY_DOWN,       SEL_NEXT },
       ++      { CONTROL('N'),   SEL_NEXT },
       ++      /* Previous */
       ++      { 'k',            SEL_PREV },
       ++      { KEY_UP,         SEL_PREV },
       ++      { CONTROL('P'),   SEL_PREV },
       ++      /* Page down */
       ++      { KEY_NPAGE,      SEL_PGDN },
       ++      { ' ',            SEL_PGDN },
       ++      /* Page up */
       ++      { KEY_PPAGE,      SEL_PGUP },
       ++      { CONTROL('U'),   SEL_PGUP },
       ++      /* Home */
       ++      { KEY_HOME,       SEL_HOME },
       ++      { CONTROL('A'),   SEL_HOME },
       ++      { '^',            SEL_HOME },
       ++      { 'g',            SEL_HOME },
       ++      /* End */
       ++      { KEY_END,        SEL_END },
       ++      { CONTROL('E'),   SEL_END },
       ++      { '$',            SEL_END },
       ++      { 'G',            SEL_END },
       ++      /* Change dir */
       ++      { 'c',            SEL_CD },
       ++      { '~',            SEL_CDHOME },
       ++      /* Toggle hide .dot files */
       ++      { '.',            SEL_TOGGLEDOT },
       ++      /* Toggle sort by time */
       ++      { 't',            SEL_MTIME },
       ++      { CONTROL('L'),   SEL_REDRAW },
       ++      /* Run command */
       ++      { 'z',            SEL_RUN, "top" },
       ++      { '!',            SEL_RUN, "sh", "SHELL" },
       ++      /* Run command with argument */
       ++      { 'e',            SEL_RUNARG, "vi", "EDITOR" },
       ++      { 'o',            SEL_RUNARG, "plumb" },
       ++      { 'p',            SEL_RUNARG, "less", "PAGER" },
       ++};
       diff -r 000000000000 -r 7981c5f981fd sysutils/noice/patch-noice.c
       --- /dev/null   Thu Jan 01 00:00:00 1970 +0000
       +++ b/sysutils/noice/patch-noice.c      Fri Aug 17 20:05:23 2018 +0200
       @@ -0,0 +1,48 @@
       +$NetBSD$
       +
       +Directly use addstr() instead of printw() in order to output every
       +bytes without any transformation (and hence also correctly displaying
       +Unicode characters).
       +
       +--- noice.c.orig       2018-08-10 18:55:47.299592935 +0200
       ++++ noice.c    2018-08-10 19:01:15.778111428 +0200
       +@@ -293,7 +293,8 @@
       + printmsg(char *msg)
       + {
       +       move(LINES - 1, 0);
       +-      printw("%s\n", msg);
       ++      addstr(msg);
       ++      addstr("\n");
       + }
       + 
       + /* Display warning as a message */
       +@@ -324,7 +325,7 @@
       + printprompt(char *str)
       + {
       +       clearprompt();
       +-      printw(str);
       ++      addstr(str);
       + }
       + 
       + /* Returns SEL_* if key is bound and 0 otherwise.
       +@@ -428,10 +429,16 @@
       +       if (strlen(name) > maxlen)
       +               name[maxlen] = '\0';
       + 
       +-      if (cm == 0)
       +-              printw("%s%s\n", active ? CURSR : EMPTY, name);
       +-      else
       +-              printw("%s%s%c\n", active ? CURSR : EMPTY, name, cm);
       ++      if (cm == 0) {
       ++              addstr(active ? CURSR : EMPTY );
       ++              addstr(name);
       ++              addstr("\n");
       ++      } else {
       ++              addstr(active ? CURSR : EMPTY);
       ++              addstr(name);
       ++              addch(cm);
       ++              addstr("\n");
       ++      }
       + }
       + 
       + int
       diff -r 000000000000 -r 7981c5f981fd textproc/par/par-1.52-i18n.4.patch
       --- /dev/null   Thu Jan 01 00:00:00 1970 +0000
       +++ b/textproc/par/par-1.52-i18n.4.patch        Fri Aug 17 20:05:23 2018 +0200
       @@ -0,0 +1,1879 @@
       +$NetBSD$
       +
       +Downloaded from:
       +
       + <http://sysmic.org/dl/par/par-1.52-i18n.4.patch>
       +
       +...and only adjusted for the `---' and `+++' parts.
       +
       +diff -ur par-1.52.orig/buffer.c par-1.52-i18n.4/buffer.c
       +--- buffer.c.orig      2001-03-09 00:51:11.000000000 +0100
       ++++ buffer.c   2009-05-29 21:09:45.000000000 +0200
       +@@ -1,9 +1,11 @@
       +-/*********************/
       +-/* buffer.c          */
       +-/* for Par 1.52      */
       +-/* Copyright 2001 by */
       +-/* Adam M. Costello  */
       +-/*********************/
       ++/***********************/
       ++/* buffer.c            */
       ++/* for Par 1.52-i18n.4 */
       ++/* Copyright 2001 by   */
       ++/* Adam M. Costello    */
       ++/* Modified by         */
       ++/* Jérôme Pouiller     */
       ++/***********************/
       + 
       + /* This is ANSI C code (C89). */
       + 
       +@@ -18,6 +20,7 @@
       + 
       + #include <stdlib.h>
       + #include <string.h>
       ++#include <wchar.h>
       + 
       + #undef NULL
       + #define NULL ((void *) 0)
       +@@ -60,7 +63,7 @@
       +   blk = malloc(sizeof (block));
       +   items = malloc(maxhere * itemsize);
       +   if (!buf || !blk || !items) {
       +-    strcpy(errmsg,outofmem);
       ++    wcscpy(errmsg,outofmem);
       +     goto nberror;
       +   }
       + 
       +@@ -127,7 +130,7 @@
       +       new = malloc(sizeof (block));
       +       items = malloc(maxhere * itemsize);
       +       if (!new || !items) {
       +-        strcpy(errmsg,outofmem);
       ++        wcscpy(errmsg,outofmem);
       +         goto aierror;
       +       }
       +       blk->next = new;
       +@@ -174,7 +177,7 @@
       + 
       +   r = malloc(n * itemsize);
       +   if (!r) {
       +-    strcpy(errmsg,outofmem);
       ++    wcscpy(errmsg,outofmem);
       +     return NULL;
       +   }
       + 
       +diff -ur par-1.52.orig/buffer.h par-1.52-i18n.4/buffer.h
       +--- buffer.h.orig      2001-03-09 00:51:25.000000000 +0100
       ++++ buffer.h   2009-05-29 21:12:39.000000000 +0200
       +@@ -1,9 +1,11 @@
       +-/*********************/
       +-/* buffer.h          */
       +-/* for Par 1.52      */
       +-/* Copyright 2001 by */
       +-/* Adam M. Costello  */
       +-/*********************/
       ++/***********************/
       ++/* buffer.h            */
       ++/* for Par 1.52-i18n.4 */
       ++/* Copyright 2001 by   */
       ++/* Adam M. Costello    */
       ++/* Modified by         */
       ++/* Jérôme Pouiller     */
       ++/***********************/
       + 
       + /* This is ANSI C code (C89). */
       + 
       +diff -ur par-1.52.orig/charset.c par-1.52-i18n.4/charset.c
       +--- charset.c.orig     2001-04-02 23:51:48.000000000 +0200
       ++++ charset.c  2009-05-29 21:09:23.000000000 +0200
       +@@ -1,9 +1,11 @@
       +-/*********************/
       +-/* charset.c         */
       +-/* for Par 1.52      */
       +-/* Copyright 2001 by */
       +-/* Adam M. Costello  */
       +-/*********************/
       ++/***********************/
       ++/* charset.c           */
       ++/* for Par 1.52-i18n.4 */
       ++/* Copyright 2001 by   */
       ++/* Adam M. Costello    */
       ++/* Modified by         */
       ++/* Jérôme Pouiller     */
       ++/***********************/
       + 
       + /* This is ANSI C code (C89). */
       + 
       +@@ -18,8 +20,9 @@
       +                       /* prototypes.  Also includes "errmsg.h". */
       + #include "buffer.h"   /* Also includes <stddef.h>.              */
       + 
       +-#include <ctype.h>
       + #include <stdio.h>
       ++#include <wchar.h>
       ++#include <wctype.h>
       + #include <stdlib.h>
       + #include <string.h>
       + 
       +@@ -39,8 +42,8 @@
       + typedef unsigned char csflag_t;
       + 
       + struct charset {
       +-  char *inlist;    /* Characters in inlist are in the set.                */
       +-  char *outlist;   /* Characters in outlist are not in the set.           */
       ++  wchar_t *inlist;    /* Characters in inlist are in the set.                */
       ++  wchar_t *outlist;   /* Characters in outlist are not in the set.           */
       +                    /* inlist and outlist must have no common characters.  */
       +                    /* inlist and outlist may be NULL, which acts like "". */
       +   csflag_t flags;  /* Characters in neither list are in the set if they   */
       +@@ -56,25 +59,25 @@
       +                       CS_NUL   = 8;  /* Includes the NUL character.      */
       + 
       + 
       +-static int appearsin(char c, const char *str)
       ++static int appearsin(wchar_t c, const wchar_t *str)
       + 
       + /* Returns 0 if c is '\0' or str is NULL or c     */
       + /* does not appear in *str.  Otherwise returns 1. */
       + {
       +-  return c && str && strchr(str,c);
       ++  return c && str && wcschr(str,c);
       + }
       + 
       + 
       +-static int hexdigtoint(char c)
       ++static int hexdigtoint(wchar_t c)
       + 
       + /* Returns the value represented by the hexadecimal */
       + /* digit c, or -1 if c is not a hexadecimal digit.  */
       + {
       +-  const char *p, * const hexdigits = "0123456789ABCDEFabcdef";
       ++  const wchar_t *p, * const hexdigits = L"0123456789ABCDEFabcdef";
       +   int n;
       + 
       +   if (!c) return -1;
       +-  p = strchr(hexdigits, *(unsigned char *)&c);
       ++  p = wcschr(hexdigits, c);
       +   if (!p) return -1;
       +   n = p - hexdigits;
       +   if (n >= 16) n -= 6;
       +@@ -87,39 +90,40 @@
       + }
       + 
       + 
       +-charset *parsecharset(const char *str, errmsg_t errmsg)
       ++charset *parsecharset(const wchar_t *str, errmsg_t errmsg)
       + {
       +   charset *cset = NULL;
       +   buffer *cbuf = NULL;
       +-  const char *p, * const singleescapes = "_sbqQx";
       ++  const wchar_t *p, * const singleescapes = L"_sbqQx";
       +   int hex1, hex2;
       +-  char ch;
       +-
       ++  wchar_t ch;
       ++      
       +   cset = malloc(sizeof (charset));
       +   if (!cset) {
       +-    strcpy(errmsg,outofmem);
       ++    wcscpy(errmsg,outofmem);
       +     goto pcserror;
       +   }
       +   cset->inlist = cset->outlist = NULL;
       +   cset->flags = 0;
       + 
       +-  cbuf = newbuffer(sizeof (char), errmsg);
       ++  cbuf = newbuffer(sizeof (wchar_t), errmsg);
       +   if (*errmsg) goto pcserror;
       + 
       +   for (p = str;  *p;  ++p)
       +-    if (*p == '_') {
       ++    if (*p == L'_') {
       +       ++p;
       +       if (appearsin(*p, singleescapes)) {
       +-        if      (*p == '_') ch = '_' ;
       +-        else if (*p == 's') ch = ' ' ;
       +-        else if (*p == 'b') ch = '\\';
       +-        else if (*p == 'q') ch = '\'';
       +-        else if (*p == 'Q') ch = '\"';
       ++        if      (*p == L'_') ch = L'_' ;
       ++        else if (*p == L's') ch = L' ' ;
       ++        else if (*p == L'b') ch = L'\\';
       ++        else if (*p == L'q') ch = L'\'';
       ++        else if (*p == L'Q') ch = L'\"';
       +         else /*  *p == 'x'  */ {
       ++          /* FIXME _x metacharacter should allow wide characters input.*/
       +           hex1 = hexdigtoint(p[1]);
       +           hex2 = hexdigtoint(p[2]);
       +           if (hex1 < 0  ||  hex2 < 0) goto pcsbadstr;
       +-          *(unsigned char *)&ch = 16 * hex1 + hex2;
       ++          ch = 16 * hex1 + hex2;
       +           p += 2;
       +         }
       +         if (!ch)
       +@@ -130,14 +134,14 @@
       +         }
       +       }
       +       else {
       +-        if      (*p == 'A') cset->flags |= CS_UCASE;
       +-        else if (*p == 'a') cset->flags |= CS_LCASE;
       +-        else if (*p == '0') cset->flags |= CS_DIGIT;
       ++        if      (*p == L'A') cset->flags |= CS_UCASE;
       ++        else if (*p == L'a') cset->flags |= CS_LCASE;
       ++        else if (*p == L'0') cset->flags |= CS_DIGIT;
       +         else goto pcsbadstr;
       +       }
       +     }
       +     else {
       +-      additem(cbuf,p,errmsg);
       ++      additem(cbuf, p,errmsg);
       +       if (*errmsg) goto pcserror;
       +     }
       +   ch = '\0';
       +@@ -149,11 +153,12 @@
       + pcscleanup:
       + 
       +   if (cbuf) freebuffer(cbuf);
       ++  //if (wstr) free(wstr);
       +   return cset;
       + 
       + pcsbadstr:
       + 
       +-  sprintf(errmsg, "Bad charset syntax: %.*s\n", errmsg_size - 22, str);
       ++  swprintf(errmsg, errmsg_size, L"Bad charset syntax: %.*s\n", errmsg_size - 22, str);
       + 
       + pcserror:
       + 
       +@@ -171,14 +176,14 @@
       + }
       + 
       + 
       +-int csmember(char c, const charset *cset)
       ++int csmember(wchar_t c, const charset *cset)
       + {
       +   return
       +     appearsin(c, cset->inlist) ||
       +     ( !appearsin(c, cset->outlist) &&
       +-      ( (cset->flags & CS_LCASE && islower(*(unsigned char *)&c)) ||
       +-        (cset->flags & CS_UCASE && isupper(*(unsigned char *)&c)) ||
       +-        (cset->flags & CS_DIGIT && isdigit(*(unsigned char *)&c)) ||
       ++        ( (cset->flags & CS_LCASE && iswlower(*(wint_t *)&c)) ||
       ++          (cset->flags & CS_UCASE && iswupper(*(wint_t *)&c)) ||
       ++          (cset->flags & CS_DIGIT && iswdigit(*(wint_t *)&c)) ||
       +         (cset->flags & CS_NUL   && !c                           )   ) );
       + }
       + 
       +@@ -191,16 +196,16 @@
       + {
       +   charset *csu;
       +   buffer *inbuf = NULL, *outbuf = NULL;
       +-  char *lists[4], **list, *p, nullchar = '\0';
       ++  wchar_t *lists[4], **list, *p, nullchar = L'\0';
       + 
       +   csu = malloc(sizeof (charset));
       +   if (!csu) {
       +-    strcpy(errmsg,outofmem);
       ++    wcscpy(errmsg,outofmem);
       +     goto csuderror;
       +   }
       +-  inbuf = newbuffer(sizeof (char), errmsg);
       ++  inbuf = newbuffer(sizeof (wchar_t), errmsg);
       +   if (*errmsg) goto csuderror;
       +-  outbuf = newbuffer(sizeof (char), errmsg);
       ++  outbuf = newbuffer(sizeof (wchar_t), errmsg);
       +   if (*errmsg) goto csuderror;
       +   csu->inlist = csu->outlist = NULL;
       +   csu->flags =  u  ?  cset1->flags |  cset2->flags
       +diff -ur par-1.52.orig/charset.h par-1.52-i18n.4/charset.h
       +--- charset.h.orig     2001-03-09 01:50:35.000000000 +0100
       ++++ charset.h  2009-05-29 21:12:21.000000000 +0200
       +@@ -1,9 +1,11 @@
       +-/*********************/
       +-/* charset.h         */
       +-/* for Par 1.52      */
       +-/* Copyright 2001 by */
       +-/* Adam M. Costello  */
       +-/*********************/
       ++/***********************/
       ++/* charset.h           */
       ++/* for Par 1.52-i18n.4 */
       ++/* Copyright 2001 by   */
       ++/* Adam M. Costello    */
       ++/* Modified by         */
       ++/* Jérôme Pouiller     */
       ++/***********************/
       + 
       + /* This is ANSI C code (C89). */
       + 
       +@@ -11,14 +13,14 @@
       + /* Note: Those functions declared here which do not use errmsg    */
       + /* always succeed, provided that they are passed valid arguments. */
       + 
       +-
       ++#include <wchar.h>
       + #include "errmsg.h"
       + 
       + 
       + typedef struct charset charset;
       + 
       + 
       +-charset *parsecharset(const char *str, errmsg_t errmsg);
       ++charset *parsecharset(const wchar_t *str, errmsg_t errmsg);
       + 
       +   /* parsecharset(str,errmsg) returns the set of characters defined by */
       +   /* str using charset syntax (see par.doc).  Returns NULL on failure. */
       +@@ -30,7 +32,7 @@
       +   /* *cset.  cset may not be used after this call.      */
       + 
       + 
       +-int csmember(char c, const charset *cset);
       ++int csmember(wchar_t c, const charset *cset);
       + 
       +   /* csmember(c,cset) returns 1 if c is a member of *cset, 0 otherwise. */
       + 
       +diff -ur par-1.52.orig/errmsg.c par-1.52-i18n.4/errmsg.c
       +--- errmsg.c.orig      2001-03-09 01:50:46.000000000 +0100
       ++++ errmsg.c   2009-05-29 21:11:43.000000000 +0200
       +@@ -1,9 +1,11 @@
       +-/*********************/
       +-/* errmsg.c          */
       +-/* for Par 1.52      */
       +-/* Copyright 2001 by */
       +-/* Adam M. Costello  */
       +-/*********************/
       ++/***********************/
       ++/* errmsg.c            */
       ++/* for Par 1.52-i18n.4 */
       ++/* Copyright 2001 by   */
       ++/* Adam M. Costello    */
       ++/* Modified by         */
       ++/* Jérôme Pouiller     */
       ++/***********************/
       + 
       + /* This is ANSI C code (C89). */
       + 
       +@@ -11,8 +13,11 @@
       + #include "errmsg.h"  /* Makes sure we're consistent with the declarations. */
       + 
       + 
       +-const char * const outofmem =
       +-  "Out of memory.\n";
       ++const wchar_t * const outofmem =
       ++  L"Out of memory.\n";
       + 
       +-const char * const impossibility =
       +-  "Impossibility #%d has occurred.  Please report it.\n";
       ++const wchar_t * const mbserror =
       ++  L"Error in input multibyte string.\n";
       ++
       ++const wchar_t * const impossibility =
       ++  L"Impossibility #%d has occurred.  Please report it.\n";
       +diff -ur par-1.52.orig/errmsg.h par-1.52-i18n.4/errmsg.h
       +--- errmsg.h.orig      2001-03-09 01:50:56.000000000 +0100
       ++++ errmsg.h   2009-05-29 21:12:10.000000000 +0200
       +@@ -1,9 +1,11 @@
       +-/*********************/
       +-/* errmsg.h          */
       +-/* for Par 1.52      */
       +-/* Copyright 2001 by */
       +-/* Adam M. Costello  */
       +-/*********************/
       ++/***********************/
       ++/* errmsg.h            */
       ++/* for Par 1.52-i18n.4 */
       ++/* Copyright 2001 by   */
       ++/* Adam M. Costello    */
       ++/* Modified by         */
       ++/* Jérôme Pouiller     */
       ++/***********************/
       + 
       + /* This is ANSI C code (C89). */
       + 
       +@@ -11,7 +13,7 @@
       + #ifndef ERRMSG_H
       + #define ERRMSG_H
       + 
       +-
       ++#include <wchar.h>
       + #define errmsg_size 163
       + 
       + /* This is the maximum number of characters that will  */
       +@@ -20,7 +22,7 @@
       + /* versions of this header file.                       */
       + 
       + 
       +-typedef char errmsg_t[errmsg_size];
       ++typedef wchar_t errmsg_t[errmsg_size];
       + 
       + /* Any function which takes the argument errmsg_t errmsg must, before */
       + /* returning, either set errmsg[0] to '\0' (indicating success), or   */
       +@@ -28,10 +30,13 @@
       + /* being careful not to overrun the space.                            */
       + 
       + 
       +-extern const char * const outofmem;
       ++extern const wchar_t * const outofmem;
       +   /* "Out of memory.\n" */
       + 
       +-extern const char * const impossibility;
       ++extern const wchar_t * const mbserror;
       ++  /* "Error in input multibyte string.\n" */
       ++  
       ++extern const wchar_t * const impossibility;
       +   /* "Impossibility #%d has occurred.  Please report it.\n" */
       + 
       + 
       +diff -ur par-1.52.orig/par.1 par-1.52-i18n.4/par.1
       +--- par.1.orig 2001-04-29 23:16:22.000000000 +0200
       ++++ par.1      2009-05-06 14:54:22.000000000 +0200
       +@@ -1,6 +1,6 @@
       + .\"*********************
       + .\"* par.1             *
       +-.\"* for Par 1.52      *
       ++.\"* for Par 1.52 i18n *
       + .\"* Copyright 2001 by *
       + .\"* Adam M. Costello  *
       + .\"*********************
       +diff -ur par-1.52.orig/par.c par-1.52-i18n.4/par.c
       +--- par.c.orig 2001-04-02 06:25:57.000000000 +0200
       ++++ par.c      2009-05-29 21:13:35.000000000 +0200
       +@@ -1,9 +1,11 @@
       +-/*********************/
       +-/* par.c             */
       +-/* for Par 1.52      */
       +-/* Copyright 2001 by */
       +-/* Adam M. Costello  */
       +-/*********************/
       ++/***********************/
       ++/* par.c               */
       ++/* for Par 1.52-i18n.4 */
       ++/* Copyright 2001 by   */
       ++/* Adam M. Costello    */
       ++/* Modified by         */
       ++/* Jérôme Pouiller     */
       ++/***********************/
       + 
       + /* This is ANSI C code (C89). */
       + 
       +@@ -12,11 +14,14 @@
       + #include "buffer.h"    /* Also includes <stddef.h>. */
       + #include "reformat.h"
       + 
       +-#include <ctype.h>
       ++#include <langinfo.h>
       ++#include <wchar.h>
       ++#include <wctype.h>
       + #include <locale.h>
       + #include <stdio.h>
       + #include <stdlib.h>
       + #include <string.h>
       ++#include <errno.h>
       + 
       + #undef NULL
       + #define NULL ((void *) 0)
       +@@ -25,56 +30,6 @@
       + #define free(ptr)
       + #endif
       + 
       +-
       +-/*===
       +-
       +-Regarding char and unsigned char:  ANSI C is a nightmare in this
       +-respect.  Some functions, like puts(), strchr(), and getenv(), use char
       +-or char*, so they work well with character constants like 'a', which
       +-are char, and with argv, which is char**.  But several other functions,
       +-like getchar(), putchar(), and isdigit(), use unsigned char (converted
       +-to/from int).  Therefore innocent-looking code can be wrong, for
       +-example:
       +-
       +-    int c = getchar();
       +-    if (c == 'a') ...
       +-
       +-This is wrong because 'a' is char (converted to int) and could be
       +-negative, but getchar() returns unsigned char (converted to int), so c
       +-is always nonnegative or EOF.  For similar reasons, it is wrong to pass
       +-a char to a function that expects an unsigned char:
       +-
       +-    putchar('\n');
       +-    if (isdigit(argv[1][0])) ...
       +-
       +-Inevitably, we need to convert between char and unsigned char.  This can
       +-be done by integral conversion (casting or assigning a char to unsigned
       +-char or vice versa), or by aliasing (converting a pointer to char to
       +-a pointer to unsigned char (or vice versa) and then dereferencing
       +-it).  ANSI C requires that integral conversion alters the bits when the
       +-unsigned value is not representable in the signed type and the signed
       +-type does not use two's complement representation.  Aliasing, on the
       +-other hand, preserves the bits.  Although the C standard is not at all
       +-clear about which sort of conversion is appropriate for making the
       +-standard library functions interoperate, I think preserving the bits
       +-is what is needed.  Under that assumption, here are some examples of
       +-correct code:
       +-
       +-    int c = getchar();
       +-    char ch;
       +-
       +-    if (c != EOF) {
       +-      *(unsigned char *)&ch = c;
       +-      if (ch == 'a') ...
       +-      if (isdigit(c)) ...
       +-    }
       +-
       +-    char *s = ...
       +-    if (isdigit(*(unsigned char *)s)) ...
       +-
       +-===*/
       +-
       +-
       + static const char * const usagemsg =
       + "\n"
       + "Options for par:\n"
       +@@ -126,7 +81,7 @@
       +                   /* line, or the fallback prelen and suflen       */
       +                   /* of the IP containing a non-bodiless line.     */
       +   lflag_t flags;  /* Boolean properties (see below).               */
       +-  char rc;        /* The repeated character of a bodiless line.    */
       ++  wchar_t rc;     /* The repeated character of a bodiless line.    */
       + } lineprop;
       + 
       + /* Flags for marking boolean properties: */
       +@@ -143,14 +98,14 @@
       + #define   isvacant(prop) (isbodiless(prop) && (prop)->rc == ' ')
       + 
       + 
       +-static int digtoint(char c)
       ++static int digtoint(wchar_t c)
       + 
       + /* Returns the value represented by the digit c, or -1 if c is not a digit. */
       + {
       +-  const char *p, * const digits = "0123456789";
       ++  const wchar_t *p, * const digits = L"0123456789";
       + 
       +   if (!c) return -1;
       +-  p = strchr(digits,c);
       ++  p = wcschr(digits,c);
       +   return  p  ?  p - digits  :  -1;
       + 
       +   /* We can't simply return c - '0' because this is ANSI C code,  */
       +@@ -161,7 +116,7 @@
       + }
       + 
       + 
       +-static int strtoudec(const char *s, int *pn)
       ++static int strtoudec(const wchar_t *s, int *pn)
       + 
       + /* Converts the longest prefix of string s consisting of decimal   */
       + /* digits to an integer, which is stored in *pn.  Normally returns */
       +@@ -187,7 +142,7 @@
       + 
       + 
       + static void parsearg(
       +-  const char *arg, int *phelp, int *pversion, charset *bodychars, charset
       ++  const wchar_t *arg, int *phelp, int *pversion, charset *bodychars, charset
       +   *protectchars, charset *quotechars, int *phang, int *pprefix, int *prepeat,
       +   int *psuffix, int *pTab, int *pwidth, int *pbody, int *pcap, int *pdiv, int
       +   *pErr, int *pexpel, int *pfit, int *pguess, int *pinvis, int *pjust, int
       +@@ -197,78 +152,78 @@
       + /* by the other pointers as appropriate.  *phelp and *pversion are boolean  */
       + /* flags indicating whether the help and version options were supplied.     */
       + {
       +-  const char *savearg = arg;
       ++  const wchar_t *savearg = arg;
       +   charset *chars, *change;
       +-  char oc;
       ++  wchar_t oc;
       +   int n;
       + 
       +   *errmsg = '\0';
       ++  
       ++  if (*arg == L'-') ++arg;
       + 
       +-  if (*arg == '-') ++arg;
       +-
       +-  if (!strcmp(arg, "help")) {
       ++  if (!wcscmp(arg, L"help")) {
       +     *phelp = 1;
       +     return;
       +   }
       + 
       +-  if (!strcmp(arg, "version")) {
       ++  if (!wcscmp(arg, L"version")) {
       +     *pversion = 1;
       +     return;
       +   }
       + 
       +-  if (*arg == 'B' || *arg == 'P' || *arg == 'Q' ) {
       +-    chars =  *arg == 'B'  ?  bodychars    :
       +-             *arg == 'P'  ?  protectchars :
       +-          /* *arg == 'Q' */  quotechars   ;
       ++  if (*arg == L'B' || *arg == L'P' || *arg == L'Q' ) {
       ++    chars =  *arg == L'B'  ?  bodychars    :
       ++             *arg == L'P'  ?  protectchars :
       ++          /* *arg == L'Q' */  quotechars   ;
       +     ++arg;
       +-    if (*arg != '='  &&  *arg != '+'  &&  *arg != '-') goto badarg;
       ++    if (*arg != L'='  &&  *arg != L'+'  &&  *arg != L'-') goto badarg;
       +     change = parsecharset(arg + 1, errmsg);
       +     if (change) {
       +-      if      (*arg == '=')   csswap(chars,change);
       +-      else if (*arg == '+')   csadd(chars,change,errmsg);
       +-      else  /* *arg == '-' */ csremove(chars,change,errmsg);
       ++      if      (*arg == L'=')   csswap(chars,change);
       ++      else if (*arg == L'+')   csadd(chars,change,errmsg);
       ++      else  /* *arg == L'-' */ csremove(chars,change,errmsg);
       +       freecharset(change);
       +     }
       +     return;
       +   }
       + 
       +-  if (isdigit(*(unsigned char *)arg)) {
       ++  if (iswdigit(*arg)) {
       +     if (!strtoudec(arg, &n)) goto badarg;
       +     if (n <= 8) *pprefix = n;
       +     else *pwidth = n;
       +   }
       + 
       +   for (;;) {
       +-    while (isdigit(*(unsigned char *)arg)) ++arg;
       ++    while (iswdigit(*arg)) ++arg;
       +     oc = *arg;
       +     if (!oc) break;
       +     n = -1;
       +     if (!strtoudec(++arg, &n)) goto badarg;
       +-    if (   oc == 'h' || oc == 'p' || oc == 'r'
       +-        || oc == 's' || oc == 'T' || oc == 'w') {
       +-      if      (oc == 'h')   *phang   =  n >= 0 ? n :  1;
       +-      else if (oc == 'p')   *pprefix =  n;
       +-      else if (oc == 'r')   *prepeat =  n >= 0 ? n :  3;
       +-      else if (oc == 's')   *psuffix =  n;
       +-      else if (oc == 'T')   *pTab    =  n >= 0 ? n :  8;
       +-      else  /* oc == 'w' */ *pwidth  =  n >= 0 ? n : 79;
       ++    if (   oc == L'h' || oc == L'p' || oc == L'r'
       ++        || oc == L's' || oc == L'T' || oc == L'w') {
       ++      if      (oc == L'h')   *phang   =  n >= 0 ? n :  1;
       ++      else if (oc == L'p')   *pprefix =  n;
       ++      else if (oc == L'r')   *prepeat =  n >= 0 ? n :  3;
       ++      else if (oc == L's')   *psuffix =  n;
       ++      else if (oc == L'T')   *pTab    =  n >= 0 ? n :  8;
       ++      else  /* oc == L'w' */ *pwidth  =  n >= 0 ? n : 79;
       +     }
       +     else {
       +       if (n < 0) n = 1;
       +       if (n > 1) goto badarg;
       +-      if      (oc == 'b') *pbody   = n;
       +-      else if (oc == 'c') *pcap    = n;
       +-      else if (oc == 'd') *pdiv    = n;
       +-      else if (oc == 'E') *pErr    = n;
       +-      else if (oc == 'e') *pexpel  = n;
       +-      else if (oc == 'f') *pfit    = n;
       +-      else if (oc == 'g') *pguess  = n;
       +-      else if (oc == 'i') *pinvis  = n;
       +-      else if (oc == 'j') *pjust   = n;
       +-      else if (oc == 'l') *plast   = n;
       +-      else if (oc == 'q') *pquote  = n;
       +-      else if (oc == 'R') *pReport = n;
       +-      else if (oc == 't') *ptouch  = n;
       ++      if      (oc == L'b') *pbody   = n;
       ++      else if (oc == L'c') *pcap    = n;
       ++      else if (oc == L'd') *pdiv    = n;
       ++      else if (oc == L'E') *pErr    = n;
       ++      else if (oc == L'e') *pexpel  = n;
       ++      else if (oc == L'f') *pfit    = n;
       ++      else if (oc == L'g') *pguess  = n;
       ++      else if (oc == L'i') *pinvis  = n;
       ++      else if (oc == L'j') *pjust   = n;
       ++      else if (oc == L'l') *plast   = n;
       ++      else if (oc == L'q') *pquote  = n;
       ++      else if (oc == L'R') *pReport = n;
       ++      else if (oc == L't') *ptouch  = n;
       +       else goto badarg;
       +     }
       +   }
       +@@ -277,12 +232,12 @@
       + 
       + badarg:
       + 
       +-  sprintf(errmsg, "Bad argument: %.*s\n", errmsg_size - 16, savearg);
       ++  swprintf(errmsg, errmsg_size, L"Bad argument: %.*s\n", errmsg_size - 16, savearg);
       +   *phelp = 1;
       + }
       + 
       + 
       +-static char **readlines(
       ++static wchar_t **readlines(
       +   lineprop **pprops, const charset *protectchars,
       +   const charset *quotechars, int Tab, int invis, int quote, errmsg_t errmsg
       + )
       +@@ -302,9 +257,10 @@
       + /* it's not NULL.  On failure, returns NULL and sets *pprops to NULL.   */
       + {
       +   buffer *cbuf = NULL, *lbuf = NULL, *lpbuf = NULL;
       +-  int c, empty, blank, firstline, qsonly, oldqsonly = 0, vlnlen, i;
       +-  char ch, *ln = NULL, nullchar = '\0', *nullline = NULL, *qpend,
       +-       *oldln = NULL, *oldqpend = NULL, *p, *op, *vln = NULL, **lines = NULL;
       ++  wint_t c;
       ++  int empty, blank, firstline, qsonly, oldqsonly = 0, vlnlen, i;
       ++  wchar_t *ln = NULL, nullchar = L'\0', *nullline = NULL, *qpend, 
       ++    *oldln = NULL, *oldqpend = NULL, *p, *op, *vln = NULL, **lines = NULL;
       +   lineprop vprop = { 0, 0, 0, '\0' }, iprop = { 0, 0, 0, '\0' };
       + 
       +   /* oldqsonly, oldln, and oldquend don't really need to be initialized.   */
       +@@ -316,20 +272,25 @@
       + 
       +   *pprops = NULL;
       + 
       +-  cbuf = newbuffer(sizeof (char), errmsg);
       ++  cbuf = newbuffer(sizeof (wchar_t), errmsg);
       +   if (*errmsg) goto rlcleanup;
       +-  lbuf = newbuffer(sizeof (char *), errmsg);
       ++  lbuf = newbuffer(sizeof (wchar_t *), errmsg);
       +   if (*errmsg) goto rlcleanup;
       +   lpbuf = newbuffer(sizeof (lineprop), errmsg);
       +   if (*errmsg) goto rlcleanup;
       + 
       +   for (empty = blank = firstline = 1;  ;  ) {
       +-    c = getchar();
       +-    if (c == EOF) break;
       +-    *(unsigned char *)&ch = c;
       +-    if (ch == '\n') {
       ++    c = getwchar();
       ++    if (c == WEOF) {
       ++      if (errno == EILSEQ) {
       ++              wcscpy(errmsg, L"Invalid multibyte sequence in input\n");
       ++      goto rlcleanup;
       ++      }
       ++      break;
       ++    }
       ++    if (c == L'\n') {
       +       if (blank) {
       +-        ungetc(c,stdin);
       ++        ungetwc(c,stdin);
       +         break;
       +       }
       +       additem(cbuf, &nullchar, errmsg);
       +@@ -338,9 +299,9 @@
       +       if (*errmsg) goto rlcleanup;
       +       if (quote) {
       +         for (qpend = ln;  *qpend && csmember(*qpend, quotechars);  ++qpend);
       +-        for (p = qpend;  *p == ' ' || csmember(*p, quotechars);  ++p);
       +-        qsonly =  *p == '\0';
       +-        while (qpend > ln && qpend[-1] == ' ') --qpend;
       ++        for (p = qpend;  *p == L' ' || csmember(*p, quotechars);  ++p);
       ++        qsonly =  (*p == L'\0');
       ++        while (qpend > ln && qpend[-1] == L' ') --qpend;
       +         if (!firstline) {
       +           for (p = ln, op = oldln;
       +                p < qpend && op < oldqpend && *p == *op;
       +@@ -348,23 +309,23 @@
       +           if (!(p == qpend && op == oldqpend)) {
       +             if (!invis && (oldqsonly || qsonly)) {
       +               if (oldqsonly) {
       +-                *op = '\0';
       ++                *op = L'\0';
       +                 oldqpend = op;
       +               }
       +               if (qsonly) {
       +-                *p = '\0';
       ++                *p = L'\0';
       +                 qpend = p;
       +               }
       +             }
       +             else {
       +               vlnlen = p - ln;
       +-              vln = malloc((vlnlen + 1) * sizeof (char));
       ++              vln = malloc((vlnlen + 1) * sizeof (wchar_t));
       +               if (!vln) {
       +-                strcpy(errmsg,outofmem);
       ++                wcscpy(errmsg,outofmem);
       +                 goto rlcleanup;
       +               }
       +-              strncpy(vln,ln,vlnlen);
       +-              vln[vlnlen] = '\0';
       ++              wcsncpy(vln, ln, vlnlen);
       ++              vln[vlnlen] = L'\0';
       +               additem(lbuf, &vln, errmsg);
       +               if (*errmsg) goto rlcleanup;
       +               additem(lpbuf,  invis ? &iprop : &vprop,  errmsg);
       +@@ -388,28 +349,31 @@
       +     }
       +     else {
       +       if (empty) {
       +-        if (csmember(ch, protectchars)) {
       +-          ungetc(c,stdin);
       ++        if (csmember(c, protectchars)) {
       ++          ungetwc(c,stdin);
       +           break;
       +         }
       +         empty = 0;
       +       }
       +-      if (!ch) continue;
       +-      if (ch == '\t') {
       +-        ch = ' ';
       ++      if (!c) continue;
       ++      if (c == L'\t') {
       ++        c = L' ';
       +         for (i = Tab - numitems(cbuf) % Tab;  i > 0;  --i) {
       +-          additem(cbuf, &ch, errmsg);
       ++          additem(cbuf, &c, errmsg);
       +           if (*errmsg) goto rlcleanup;
       +         }
       +         continue;
       +       }
       +-      if (isspace(c)) ch = ' ';
       +-      else blank = 0;
       +-      additem(cbuf, &ch, errmsg);
       +-      if (*errmsg) goto rlcleanup;
       ++      if (iswspace(c)) 
       ++        c = L' ';
       ++      else 
       ++        blank = 0;
       ++      additem(cbuf, &c, errmsg);
       ++      if (*errmsg) 
       ++        goto rlcleanup;
       +     }
       +   }
       +-
       ++  
       +   if (!blank) {
       +     additem(cbuf, &nullchar, errmsg);
       +     if (*errmsg) goto rlcleanup;
       +@@ -449,7 +413,7 @@
       + 
       + 
       + static void compresuflen(
       +-  const char * const *lines, const char * const *endline,
       ++  const wchar_t * const *lines, const wchar_t * const *endline,
       +   const charset *bodychars, int body, int pre, int suf, int *ppre, int *psuf
       + )
       + /* lines is an array of strings, up to but not including endline.  */
       +@@ -457,9 +421,9 @@
       + /* lines in lines.  Assumes that they have already been determined */
       + /* to be at least pre and suf.  endline must not equal lines.      */
       + {
       +-  const char *start, *end, *knownstart, * const *line, *p1, *p2, *knownend,
       ++  const wchar_t *start, *end, *knownstart, * const *line, *p1, *p2, *knownend,
       +              *knownstart2;
       +-
       ++           
       +   start = *lines;
       +   end = knownstart = start + pre;
       +   if (body)
       +@@ -474,7 +438,7 @@
       +   }
       +   if (body)
       +     for (p1 = end;  p1 > knownstart;  )
       +-      if (*--p1 != ' ') {
       ++      if (*--p1 != L' ') {
       +         if (csmember(*p1, bodychars))
       +           end = p1;
       +         else
       +@@ -501,18 +465,18 @@
       +   }
       +   if (body) {
       +     for (p1 = start;
       +-         start < knownend && (*start == ' ' || csmember(*start, bodychars));
       ++         start < knownend && (*start == L' ' || csmember(*start, bodychars));
       +          ++start);
       +-    if (start > p1 && start[-1] == ' ') --start;
       ++    if (start > p1 && start[-1] == L' ') --start;
       +   }
       +   else
       +-    while (end - start >= 2 && *start == ' ' && start[1] == ' ') ++start;
       ++    while (end - start >= 2 && *start == L' ' && start[1] == L' ') ++start;
       +   *psuf = end - start;
       + }
       + 
       + 
       + static void delimit(
       +-  const char * const *lines, const char * const *endline,
       ++  const wchar_t * const *lines, const wchar_t * const *endline,
       +   const charset *bodychars, int repeat, int body, int div,
       +   int pre, int suf, lineprop *props
       + )
       +@@ -523,8 +487,8 @@
       + /* and comsuflen of the lines in lines have already been     */
       + /* determined to be at least pre and suf, respectively.      */
       + {
       +-  const char * const *line, *end, *p, * const *nextline;
       +-  char rc;
       ++  const wchar_t * const *line, *end, *p, * const *nextline;
       ++  wchar_t rc;
       +   lineprop *prop, *nextprop;
       +   int anybodiless = 0, status;
       + 
       +@@ -545,8 +509,8 @@
       +     for (end = *line;  *end;  ++end);
       +     end -= suf;
       +     p = *line + pre;
       +-    rc =  p < end  ?  *p  :  ' ';
       +-    if (rc != ' ' && (!repeat || end - p < repeat))
       ++    rc =  p < end  ?  *p  :  L' ';
       ++    if (rc != L' ' && (!repeat || end - p < repeat))
       +       prop->flags &= ~L_BODILESS;
       +     else
       +       while (p < end) {
       +@@ -589,9 +553,9 @@
       +   }
       + 
       +   line = lines, prop = props;
       +-  status = ((*lines)[pre] == ' ');
       ++  status = ((*lines)[pre] == L' ');
       +   do {
       +-    if (((*line)[pre] == ' ') == status)
       ++    if (((*line)[pre] == L' ') == status)
       +       prop->flags |= L_FIRST;
       +     ++line, ++prop;
       +   } while (line < endline);
       +@@ -599,14 +563,14 @@
       + 
       + 
       + static void marksuperf(
       +-  const char * const * lines, const char * const * endline, lineprop *props
       ++  const wchar_t * const * lines, const wchar_t * const * endline, lineprop *props
       + )
       + /* lines points to the first line of a segment, and endline to one  */
       + /* line beyond the last line in the segment.  Sets L_SUPERF bits in */
       + /* the flags fields of the props array whenever the corresponding   */
       + /* line is superfluous.  L_BODILESS bits must already be set.       */
       + {
       +-  const char * const *line, *p;
       ++  const wchar_t * const *line, *p;
       +   lineprop *prop, *mprop, dummy;
       +   int inbody, num, mnum;
       + 
       +@@ -619,7 +583,7 @@
       +   for (line = lines, prop = props;  line < endline;  ++line, ++prop)
       +     if (isvacant(prop)) {
       +       for (num = 0, p = *line;  *p;  ++p)
       +-        if (*p != ' ') ++num;
       ++        if (*p != L' ') ++num;
       +       if (inbody || num < mnum)
       +         mnum = num, mprop = prop;
       +       inbody = 0;
       +@@ -631,7 +595,7 @@
       + 
       + 
       + static void setaffixes(
       +-  const char * const *inlines, const char * const *endline,
       ++  const wchar_t * const *inlines, const wchar_t * const *endline,
       +   const lineprop *props, const charset *bodychars,
       +   const charset *quotechars, int hang, int body, int quote,
       +   int *pafp, int *pfs, int *pprefix, int *psuffix
       +@@ -644,7 +608,7 @@
       + /* default value as specified in "par.doc".                            */
       + {
       +   int numin, pre, suf;
       +-  const char *p;
       ++  const wchar_t *p;
       + 
       +   numin = endline - inlines;
       + 
       +@@ -666,11 +630,11 @@
       + }
       + 
       + 
       +-static void freelines(char **lines)
       ++static void freelines(wchar_t **lines)
       + /* Frees the elements of lines, and lines itself. */
       + /* lines is a NULL-terminated array of strings.   */
       + {
       +-  char **line;
       ++  wchar_t **line;
       + 
       +   for (line = lines;  *line;  ++line)
       +     free(*line);
       +@@ -678,68 +642,116 @@
       +   free(lines);
       + }
       + 
       +-
       + int main(int argc, const char * const *argv)
       + {
       +   int help = 0, version = 0, hang = 0, prefix = -1, repeat = 0, suffix = -1,
       +       Tab = 1, width = 72, body = 0, cap = 0, div = 0, Err = 0, expel = 0,
       +       fit = 0, guess = 0, invis = 0, just = 0, last = 0, quote = 0, Report = 0,
       +       touch = -1;
       +-  int prefixbak, suffixbak, c, sawnonblank, oweblank, n, i, afp, fs;
       ++  int prefixbak, suffixbak, sawnonblank, oweblank, n, i, afp, fs;
       +   charset *bodychars = NULL, *protectchars = NULL, *quotechars = NULL;
       +-  char *parinit = NULL, *arg, **inlines = NULL, **endline, **firstline, *end,
       +-       **nextline, **outlines = NULL, **line, ch;
       +-  const char *env, * const whitechars = " \f\n\r\t\v";
       ++  wint_t c;
       ++  wchar_t *state;
       ++  wchar_t *parinit = NULL, *arg, **inlines = NULL, **endline, **firstline, *end,
       ++    **nextline, **outlines = NULL, **line;
       ++  const char *env;
       ++  wchar_t *wenv = NULL;
       ++  const wchar_t * const whitechars = L" \f\n\r\t\v";
       +   errmsg_t errmsg = { '\0' };
       +   lineprop *props = NULL, *firstprop, *nextprop;
       +   FILE *errout;
       ++  char *langinfo;
       + 
       + /* Set the current locale from the environment: */
       + 
       +   setlocale(LC_ALL,"");
       ++  langinfo = nl_langinfo(CODESET);
       ++  if (!strcmp(langinfo, "ANSI_X3.4-1968")) {
       ++    // We would like to fallback in an 8 bits encoding, but it is not easily possible.
       ++    //setlocale(LC_CTYPE, "C");
       ++    //langinfo = nl_langinfo(CODESET);
       ++    fwprintf( Err ? stderr : stdout, 
       ++        L"Warning: Locale seems not configured\n");
       ++  }
       + 
       + /* Process environment variables: */
       + 
       +   env = getenv("PARBODY");
       +   if (!env) env = "";
       +-  bodychars = parsecharset(env,errmsg);
       ++  wenv = malloc((strlen(env) + 1) * sizeof (wchar_t));
       ++  if (!wenv) {
       ++    wcscpy(errmsg,outofmem);
       ++    goto parcleanup;
       ++  }
       ++  if (0 > mbstowcs(wenv,env, strlen(env) + 1)) {
       ++    wcscpy(errmsg, L"Invalid multibyte sequence in PARBODY\n");
       ++    goto parcleanup;
       ++  }
       ++  bodychars = parsecharset(wenv,errmsg);
       +   if (*errmsg) {
       +     help = 1;
       +     goto parcleanup;
       +   }
       ++  free(wenv);
       ++  wenv = NULL;
       + 
       +   env = getenv("PARPROTECT");
       +   if (!env) env = "";
       +-  protectchars = parsecharset(env,errmsg);
       ++  wenv = malloc((strlen(env) + 1) * sizeof (wchar_t));
       ++  if (!wenv) {
       ++    wcscpy(errmsg,outofmem);
       ++    goto parcleanup;
       ++  }
       ++  if (0 > mbstowcs(wenv,env, strlen(env) + 1)) {
       ++    wcscpy(errmsg, L"Invalid multibyte sequence in PARPROTECT\n");
       ++    goto parcleanup;
       ++  }
       ++  protectchars = parsecharset(wenv,errmsg);
       +   if (*errmsg) {
       +     help = 1;
       +     goto parcleanup;
       +   }
       ++  free(wenv);
       ++  wenv = NULL;
       + 
       +   env = getenv("PARQUOTE");
       +   if (!env) env = "> ";
       +-  quotechars = parsecharset(env,errmsg);
       ++  wenv = malloc((strlen(env) + 1) * sizeof (wchar_t));
       ++  if (!wenv) {
       ++    wcscpy(errmsg,outofmem);
       ++    goto parcleanup;
       ++  }
       ++  if (0 > mbstowcs(wenv,env, strlen(env) + 1)) {
       ++    wcscpy(errmsg, L"Invalid multibyte sequence in PARQUOTE\n");
       ++    goto parcleanup;
       ++  }
       ++  quotechars = parsecharset(wenv,errmsg);
       +   if (*errmsg) {
       +     help = 1;
       +     goto parcleanup;
       +   }
       ++  free(wenv);
       ++  wenv = NULL;
       + 
       +   env = getenv("PARINIT");
       +   if (env) {
       +-    parinit = malloc((strlen(env) + 1) * sizeof (char));
       ++    parinit = malloc((strlen(env) + 1) * sizeof (wchar_t));
       +     if (!parinit) {
       +-      strcpy(errmsg,outofmem);
       ++      wcscpy(errmsg,outofmem);
       +       goto parcleanup;
       +     }
       +-    strcpy(parinit,env);
       +-    arg = strtok(parinit,whitechars);
       ++    if (0 > mbstowcs(parinit,env, strlen(env) + 1)) {
       ++      wcscpy(errmsg, L"Invalid multibyte sequence in PARINIT\n");
       ++      goto parcleanup;
       ++    }    
       ++    arg = wcstok(parinit, whitechars, &state);
       +     while (arg) {
       +       parsearg(arg, &help, &version, bodychars, protectchars,
       +                quotechars, &hang, &prefix, &repeat, &suffix, &Tab,
       +                &width, &body, &cap, &div, &Err, &expel, &fit, &guess,
       +                &invis, &just, &last, &quote, &Report, &touch, errmsg );
       +       if (*errmsg || help || version) goto parcleanup;
       +-      arg = strtok(NULL,whitechars);
       ++      arg = wcstok(NULL, whitechars, &state);
       +     }
       +     free(parinit);
       +     parinit = NULL;
       +@@ -748,57 +760,71 @@
       + /* Process command line arguments: */
       + 
       +   while (*++argv) {
       +-    parsearg(*argv, &help, &version, bodychars, protectchars,
       ++    arg = malloc((strlen(*argv) + 1) * sizeof (wchar_t));
       ++    if (0 > mbstowcs(arg, *argv, strlen(*argv) + 1)) {
       ++      wcscpy(errmsg, L"Invalid multibyte sequence in argument\n");
       ++      goto parcleanup;
       ++    }
       ++    parsearg(arg, &help, &version, bodychars, protectchars,
       +              quotechars, &hang, &prefix, &repeat, &suffix, &Tab,
       +              &width, &body, &cap, &div, &Err, &expel, &fit, &guess,
       +              &invis, &just, &last, &quote, &Report, &touch, errmsg );
       ++    free(arg);
       +     if (*errmsg || help || version) goto parcleanup;
       +   }
       + 
       +   if (Tab == 0) {
       +-    strcpy(errmsg, "<Tab> must not be 0.\n");
       ++    wcscpy(errmsg, L"<Tab> must not be 0.\n");
       +     goto parcleanup;
       +   }
       + 
       +   if (touch < 0) touch = fit || last;
       +   prefixbak = prefix;
       +   suffixbak = suffix;
       +-
       +-/* Main loop: */
       +-
       ++  
       ++  /* Main loop: */
       +   for (sawnonblank = oweblank = 0;  ;  ) {
       +     for (;;) {
       +-      c = getchar();
       +-      if (c == EOF) break;
       +-      *(unsigned char *)&ch = c;
       +-      if (expel && ch == '\n') {
       ++      c = getwchar();
       ++      if (c == WEOF) {
       ++        if (errno == EILSEQ) {
       ++          wcscpy(errmsg, L"Invalid multibyte sequence in input\n");
       ++          goto parcleanup;
       ++        }
       ++        break;
       ++      }
       ++      if (expel && c == L'\n') {
       +         oweblank = sawnonblank;
       +         continue;
       +       }
       +-      if (csmember(ch, protectchars)) {
       ++      if (csmember(c, protectchars)) {
       +         sawnonblank = 1;
       +         if (oweblank) {
       +-          puts("");
       ++          fputwc(L'\n', stdout);
       +           oweblank = 0;
       +         }
       +-        while (ch != '\n') {
       +-          putchar(c);
       +-          c = getchar();
       +-          if (c == EOF) break;
       +-          *(unsigned char *)&ch = c;
       ++        while (c != L'\n') {
       ++          putwchar(c);
       ++          c = getwchar();
       ++          if (c == WEOF) {
       ++            if (errno == EILSEQ) {
       ++              wcscpy(errmsg, L"Invalid multibyte sequence in input\n");
       ++              goto parcleanup;
       ++            }
       ++            break;
       ++          }
       +         }
       +       }
       +-      if (ch != '\n') break;  /* subsumes the case that c == EOF */
       +-      putchar(c);
       ++      if (c != L'\n') break;  /* subsumes the case that c == EOF */
       ++      putwchar(c);
       +     }
       +-    if (c == EOF) break;
       +-    ungetc(c,stdin);
       ++    if (c == WEOF) break;
       ++    ungetwc(c,stdin);
       + 
       +     inlines =
       +       readlines(&props, protectchars, quotechars, Tab, invis, quote, errmsg);
       +     if (*errmsg) goto parcleanup;
       +-
       +-    for (endline = inlines;  *endline;  ++endline);
       ++    for (endline = inlines;  *endline;  ++endline) ;
       +     if (endline == inlines) {
       +       free(inlines);
       +       inlines = NULL;
       +@@ -807,38 +833,39 @@
       + 
       +     sawnonblank = 1;
       +     if (oweblank) {
       +-      puts("");
       ++      fputwc(L'\n', stdout);
       +       oweblank = 0;
       +     }
       + 
       +-    delimit((const char * const *) inlines,
       +-            (const char * const *) endline,
       ++    delimit((const wchar_t * const *) inlines,
       ++            (const wchar_t * const *) endline,
       +             bodychars, repeat, body, div, 0, 0, props);
       + 
       +     if (expel)
       +-      marksuperf((const char * const *) inlines,
       +-                 (const char * const *) endline, props);
       ++      marksuperf((const wchar_t * const *) inlines,
       ++                 (const wchar_t * const *) endline, props);
       + 
       +     firstline = inlines, firstprop = props;
       ++
       +     do {
       +       if (isbodiless(firstprop)) {
       +         if (!isinvis(firstprop) && !(expel && issuperf(firstprop))) {
       +           for (end = *firstline;  *end;  ++end);
       +-          if (!repeat || (firstprop->rc == ' ' && !firstprop->s)) {
       +-            while (end > *firstline && end[-1] == ' ') --end;
       +-            *end = '\0';
       +-            puts(*firstline);
       ++          if (!repeat || (firstprop->rc == L' ' && !firstprop->s)) {
       ++            while (end > *firstline && end[-1] == L' ') --end;
       ++            *end = L'\0';
       ++            fwprintf(stdout, L"%ls\n", *firstline);
       +           }
       +           else {
       +             n = width - firstprop->p - firstprop->s;
       +             if (n < 0) {
       +-              sprintf(errmsg,impossibility,5);
       ++              swprintf(errmsg,errmsg_size,impossibility,5);
       +               goto parcleanup;
       +             }
       +-            printf("%.*s", firstprop->p, *firstline);
       ++            fwprintf(stdout, L"%.*ls", firstprop->p, *firstline);
       +             for (i = n;  i;  --i)
       +-              putchar(*(unsigned char *)&firstprop->rc);
       +-            puts(end - firstprop->s);
       ++              fputwc(firstprop->rc, stdout);
       ++            fwprintf(stdout, L"%ls\n", end - firstprop->s);
       +           }
       +         }
       +         ++firstline, ++firstprop;
       +@@ -848,28 +875,26 @@
       +       for (nextline = firstline + 1, nextprop = firstprop + 1;
       +            nextline < endline && !isbodiless(nextprop) && !isfirst(nextprop);
       +            ++nextline, ++nextprop);
       +-
       ++      
       +       prefix = prefixbak, suffix = suffixbak;
       +-      setaffixes((const char * const *) firstline,
       +-                 (const char * const *) nextline, firstprop, bodychars,
       ++      setaffixes((const wchar_t * const *) firstline,
       ++                 (const wchar_t * const *) nextline, firstprop, bodychars,
       +                  quotechars, hang, body, quote, &afp, &fs, &prefix, &suffix);
       +       if (width <= prefix + suffix) {
       +-        sprintf(errmsg,
       +-                "<width> (%d) <= <prefix> (%d) + <suffix> (%d)\n",
       ++        swprintf(errmsg,errmsg_size,
       ++                L"<width> (%d) <= <prefix> (%d) + <suffix> (%d)\n",
       +                 width, prefix, suffix);
       +         goto parcleanup;
       +       }
       + 
       +       outlines =
       +-        reformat((const char * const *) firstline,
       +-                 (const char * const *) nextline,
       ++        reformat((const wchar_t * const *) firstline,
       ++                 (const wchar_t * const *) nextline,
       +                  afp, fs, hang, prefix, suffix, width, cap,
       +                  fit, guess, just, last, Report, touch, errmsg);
       +       if (*errmsg) goto parcleanup;
       +-
       +       for (line = outlines;  *line;  ++line)
       +-        puts(*line);
       +-
       ++        fwprintf(stdout, L"%ls\n", *line);
       +       freelines(outlines);
       +       outlines = NULL;
       + 
       +@@ -884,7 +909,7 @@
       +   }
       + 
       + parcleanup:
       +-
       ++  if (wenv) free(wenv);
       +   if (bodychars) freecharset(bodychars);
       +   if (protectchars) freecharset(protectchars);
       +   if (quotechars) freecharset(quotechars);
       +@@ -892,10 +917,14 @@
       +   if (inlines) freelines(inlines);
       +   if (props) free(props);
       +   if (outlines) freelines(outlines);
       + 
       +   errout = Err ? stderr : stdout;
       +-  if (*errmsg) fprintf(errout, "par error:\n%.*s", errmsg_size, errmsg);
       +-  if (version) fputs("par 1.52\n",errout);
       ++  if (*errmsg) fwprintf(errout, L"par error:\n%.*ls", errmsg_size, errmsg);
       ++#ifdef NOWIDTH
       ++  if (version) fputws(L"par 1.52-i18n.4 (without wcwidth() support)\n",errout);
       ++#else
       ++  if (version) fputws(L"par 1.52-i18n.4\n",errout);
       ++#endif
       +   if (help)    fputs(usagemsg,errout);
       + 
       +   return *errmsg ? EXIT_FAILURE : EXIT_SUCCESS;
       +diff -ur par-1.52.orig/par.doc par-1.52-i18n.4/par.doc
       +--- par.doc.orig       2001-04-29 23:17:28.000000000 +0200
       ++++ par.doc    2009-05-06 14:54:22.000000000 +0200
       +@@ -1,6 +1,6 @@
       +   *********************
       +   * par.doc           *
       +-  * for Par 1.52      *
       ++  * for Par 1.52 i18n *
       +   * Copyright 2001 by *
       +   * Adam M. Costello  *
       +   *********************
       +diff -ur par-1.52.orig/protoMakefile par-1.52-i18n.4/protoMakefile
       +--- protoMakefile.orig 2001-03-09 01:53:25.000000000 +0100
       ++++ protoMakefile      2009-05-06 18:00:20.000000000 +0200
       +@@ -47,7 +47,7 @@
       + # Example (for Solaris 2.x with SPARCompiler C):
       + # CC = cc -c -O -s -Xc -DDONTFREE
       + 
       +-CC = cc -c
       ++CC = cc -std=c99 -c
       + 
       + # Define LINK1 and LINK2 so that the command
       + #
       +diff -ur par-1.52.orig/reformat.c par-1.52-i18n.4/reformat.c
       +--- reformat.c.orig    2001-03-22 05:17:15.000000000 +0100
       ++++ reformat.c 2009-05-29 21:09:56.000000000 +0200
       +@@ -1,9 +1,11 @@
       +-/*********************/
       +-/* reformat.c        */
       +-/* for Par 1.52      */
       +-/* Copyright 2001 by */
       +-/* Adam M. Costello  */
       +-/*********************/
       ++/***********************/
       ++/* reformat.c          */
       ++/* for Par 1.52-i18n.4 */
       ++/* Copyright 2001 by   */
       ++/* Adam M. Costello    */
       ++/* Modified by         */
       ++/* Jérôme Pouiller     */
       ++/***********************/
       + 
       + /* This is ANSI C code (C89). */
       + 
       +@@ -16,6 +18,7 @@
       + #include <stdio.h>
       + #include <stdlib.h>
       + #include <string.h>
       ++#include <wctype.h>
       + 
       + #undef NULL
       + #define NULL ((void *) 0)
       +@@ -33,14 +36,15 @@
       + typedef unsigned char wflag_t;
       + 
       + typedef struct word {
       +-  const char *chrs;       /* Pointer to the characters in the word */
       ++  const wchar_t *chrs;    /* Pointer to the characters in the word */
       +                           /* (NOT terminated by '\0').             */
       +   struct word *prev,      /* Pointer to previous word.             */
       +               *next,      /* Pointer to next word.                 */
       +                           /* Supposing this word were the first... */
       +               *nextline;  /*   Pointer to first word in next line. */
       +   int score,              /*   Value of the objective function.    */
       +-      length;             /* Length of this word.                  */
       ++      length,             /* Length (in widechar) of this word.    */
       ++      width;              /* Visual width of this word.            */
       +   wflag_t flags;          /* Notable properties of this word.      */
       + } word;
       + 
       +@@ -57,17 +61,39 @@
       + #define iscurious(w) (((w)->flags & 2) != 0)
       + #define iscapital(w) (((w)->flags & 4) != 0)
       + 
       ++static int getWidth(const wchar_t *beg, const wchar_t *end)
       ++/* Compute (visual) width of a  word. This function is aware */
       ++/* about double-width characters used in oriental langages.  */
       ++{
       ++  int ret, tmp;
       ++  
       ++  for (ret = 0; beg != end; beg++) {
       ++#ifdef NOWIDTH
       ++    tmp = 1;
       ++#else
       ++    tmp = wcwidth(*beg);
       ++#endif
       ++    // BUG: It is not really easy to handle case of zero width characters.
       ++    // If we don't do this, size mallloc for q1 will be less than real 
       ++    // size and program will segfault. So I prefer to have a bug than a segfault.
       ++    if (tmp <= 0)
       ++      tmp = 1;
       ++    ret += tmp;
       ++  }
       ++  
       ++  return ret;
       ++}
       + 
       + static int checkcapital(word *w)
       + /* Returns 1 if *w is capitalized according to the definition */
       + /* in par.doc (assuming <cap> is 0), or 0 if not.             */
       + {
       +-  const char *p, *end;
       ++  const wchar_t *p, *end;
       + 
       +   for (p = w->chrs, end = p + w->length;
       +-       p < end && !isalnum(*(unsigned char *)p);
       ++       p < end && !iswalnum(*p);
       +        ++p);
       +-  return p < end && !islower(*(unsigned char *)p);
       ++  return p < end && !iswlower(*p);
       + }
       + 
       + 
       +@@ -75,19 +101,19 @@
       + /* Returns 1 if *w is curious according to */
       + /* the definition in par.doc, or 0 if not. */
       + {
       +-  const char *start, *p;
       +-  char ch;
       ++  const wchar_t *start, *p;
       ++  wchar_t ch;
       + 
       +   for (start = w->chrs, p = start + w->length;  p > start;  --p) {
       +     ch = p[-1];
       +-    if (isalnum(*(unsigned char *)&ch)) return 0;
       +-    if (ch == '.' || ch == '?' || ch == '!' || ch == ':') break;
       ++    if (iswalnum(*(wchar_t *)&ch)) return 0;
       ++    if (ch == L'.' || ch == L'?' || ch == L'!' || ch == L':') break;
       +   }
       + 
       +   if (p <= start + 1) return 0;
       + 
       +   --p;
       +-  do if (isalnum(*(unsigned char *)--p)) return 1;
       ++  do if (iswalnum(*(wchar_t *)--p)) return 1;
       +   while (p > start);
       + 
       +   return 0;
       +@@ -95,31 +121,32 @@
       + 
       + 
       + static int simplebreaks(word *head, word *tail, int L, int last)
       +-
       +-/* Chooses line breaks in a list of words which maximize the length of the   */
       +-/* shortest line.  L is the maximum line length.  The last line counts as a  */
       +-/* line only if last is non-zero. _head must point to a dummy word, and tail */
       +-/* must point to the last word, whose next field must be NULL.  Returns the  */
       +-/* length of the shortest line on success, -1 if there is a word of length   */
       +-/* greater than L, or L if there are no lines.                               */
       ++/* Chooses line  breaks in a  list of words  which maximize */
       ++/* the length of  the shortest line. L is  the maximum line */
       ++/* length. The last  line counts as a line only  if last is */
       ++/* non-zero. _head  must point  to a  dummy word,  and tail */
       ++/* must point  to the last  word, whose next field  must be */
       ++/* NULL.  Returns  the  length  of  the  shortest  line  on */
       ++/* success, -1 if there is a word of length greater than L, */
       ++/* or L if there are no lines.                              */
       + {
       +   word *w1, *w2;
       +   int linelen, score;
       + 
       +   if (!head->next) return L;
       + 
       +-  for (w1 = tail, linelen = w1->length;
       ++  for (w1 = tail, linelen = w1->width;
       +        w1 != head && linelen <= L;
       +-       linelen += isshifted(w1), w1 = w1->prev, linelen += 1 + w1->length) {
       ++       linelen += isshifted(w1), w1 = w1->prev, linelen += 1 + w1->width) {
       +     w1->score = last ? linelen : L;
       +     w1->nextline = NULL;
       +   }
       + 
       +   for ( ;  w1 != head;  w1 = w1->prev) {
       +     w1->score = -1;
       +-    for (linelen = w1->length,  w2 = w1->next;
       ++    for (linelen = w1->width,  w2 = w1->next;
       +          linelen <= L;
       +-         linelen += 1 + isshifted(w2) + w2->length,  w2 = w2->next) {
       ++         linelen += 1 + isshifted(w2) + w2->width,  w2 = w2->next) {
       +       score = w2->score;
       +       if (linelen < score) score = linelen;
       +       if (score >= w1->score) {
       +@@ -168,7 +195,7 @@
       + 
       +   shortest = simplebreaks(head,tail,target,last);
       +   if (shortest < 0) {
       +-    sprintf(errmsg,impossibility,1);
       ++    swprintf(errmsg,errmsg_size,impossibility,1);
       +     return;
       +   }
       + 
       +@@ -178,9 +205,9 @@
       +   w1 = tail;
       +   do {
       +     w1->score = -1;
       +-    for (linelen = w1->length,  w2 = w1->next;
       ++    for (linelen = w1->width,  w2 = w1->next;
       +          linelen <= target;
       +-         linelen += 1 + isshifted(w2) + w2->length,  w2 = w2->next) {
       ++         linelen += 1 + isshifted(w2) + w2->width,  w2 = w2->next) {
       +       extra = target - linelen;
       +       minlen = shortest;
       +       if (w2)
       +@@ -202,7 +229,7 @@
       +   } while (w1 != head);
       + 
       +   if (head->next->score < 0)
       +-    sprintf(errmsg,impossibility,2);
       ++    swprintf(errmsg,errmsg_size,impossibility,2);
       + }
       + 
       + 
       +@@ -225,9 +252,9 @@
       +   w1 = tail;
       +   do {
       +     w1->score = L;
       +-    for (numgaps = 0, extra = L - w1->length, w2 = w1->next;
       ++    for (numgaps = 0, extra = L - w1->width, w2 = w1->next;
       +          extra >= 0;
       +-         ++numgaps, extra -= 1 + isshifted(w2) + w2->length, w2 = w2->next) {
       ++         ++numgaps, extra -= 1 + isshifted(w2) + w2->width, w2 = w2->next) {
       +       gap = numgaps ? (extra + numgaps - 1) / numgaps : L;
       +       if (w2)
       +         score = w2->score;
       +@@ -247,7 +274,7 @@
       + 
       +   maxgap = head->next->score;
       +   if (maxgap >= L) {
       +-    strcpy(errmsg, "Cannot justify.\n");
       ++    wcscpy(errmsg, L"Cannot justify.\n");
       +     return;
       +   }
       + 
       +@@ -257,9 +284,9 @@
       +   w1 = tail;
       +   do {
       +     w1->score = -1;
       +-    for (numgaps = 0, extra = L - w1->length, w2 = w1->next;
       ++    for (numgaps = 0, extra = L - w1->width, w2 = w1->next;
       +          extra >= 0;
       +-         ++numgaps, extra -= 1 + isshifted(w2) + w2->length, w2 = w2->next) {
       ++         ++numgaps, extra -= 1 + isshifted(w2) + w2->width, w2 = w2->next) {
       +       gap = numgaps ? (extra + numgaps - 1) / numgaps : L;
       +       if (w2)
       +         score = w2->score;
       +@@ -288,40 +315,39 @@
       +   } while (w1 != head);
       + 
       +   if (head->next->score < 0)
       +-    sprintf(errmsg,impossibility,3);
       ++    swprintf(errmsg,errmsg_size,impossibility,3);
       + }
       + 
       + 
       +-char **reformat(
       +-  const char * const *inlines, const char * const *endline, int afp, int fs,
       ++wchar_t **reformat(
       ++  const wchar_t * const *inlines, const wchar_t * const *endline, int afp, int fs,
       +   int hang, int prefix, int suffix, int width, int cap, int fit, int guess,
       +   int just, int last, int Report, int touch, errmsg_t errmsg
       + )
       + {
       +   int numin, affix, L, onfirstword = 1, linelen, numout, numgaps, extra, phase;
       +-  const char * const *line, **suffixes = NULL, **suf, *end, *p1, *p2;
       +-  char *q1, *q2, **outlines = NULL;
       ++  const wchar_t * const *line, **suffixes = NULL, **suf, *end, *p1, *p2;
       ++  wchar_t *q1, *q2, **outlines = NULL;
       +   word dummy, *head, *tail, *w1, *w2;
       +   buffer *pbuf = NULL;
       + 
       + /* Initialization: */
       +-
       +   *errmsg = '\0';
       +   dummy.next = dummy.prev = NULL;
       +   dummy.flags = 0;
       +   head = tail = &dummy;
       +   numin = endline - inlines;
       +   if (numin <= 0) {
       +-    sprintf(errmsg,impossibility,4);
       ++    swprintf(errmsg,errmsg_size,impossibility,4);
       +     goto rfcleanup;
       +   }
       +   numgaps = extra = 0;  /* unnecessary, but quiets compiler warnings */
       + 
       + /* Allocate space for pointers to the suffixes: */
       + 
       +-  suffixes = malloc(numin * sizeof (const char *));
       ++  suffixes = malloc(numin * sizeof (const wchar_t *));
       +   if (!suffixes) {
       +-    strcpy(errmsg,outofmem);
       ++    wcscpy(errmsg,outofmem);
       +     goto rfcleanup;
       +   }
       + 
       +@@ -334,8 +360,8 @@
       +   do {
       +     for (end = *line;  *end;  ++end);
       +     if (end - *line < affix) {
       +-      sprintf(errmsg,
       +-              "Line %d shorter than <prefix> + <suffix> = %d + %d = %d\n",
       ++      swprintf(errmsg,errmsg_size,
       ++              L"Line %d shorter than <prefix> + <suffix> = %d + %d = %d\n",
       +               line - inlines + 1, prefix, suffix, affix);
       +       goto rfcleanup;
       +     }
       +@@ -343,17 +369,17 @@
       +     *suf = end;
       +     p1 = *line + prefix;
       +     for (;;) {
       +-      while (p1 < end && *p1 == ' ') ++p1;
       ++      while (p1 < end && *p1 == L' ') ++p1;
       +       if (p1 == end) break;
       +       p2 = p1;
       +       if (onfirstword) {
       +         p1 = *line + prefix;
       +         onfirstword = 0;
       +       }
       +-      while (p2 < end && *p2 != ' ') ++p2;
       ++      while (p2 < end && *p2 != L' ') ++p2;
       +       w1 = malloc(sizeof (word));
       +       if (!w1) {
       +-        strcpy(errmsg,outofmem);
       ++        wcscpy(errmsg,outofmem);
       +         goto rfcleanup;
       +       }
       +       w1->next = NULL;
       +@@ -361,6 +387,7 @@
       +       tail = tail->next = w1;
       +       w1->chrs = p1;
       +       w1->length = p2 - p1;
       ++      w1->width = getWidth(p1, p2);
       +       w1->flags = 0;
       +       p1 = p2;
       +     }
       +@@ -377,6 +404,7 @@
       +         if (iscurious(w1)) {
       +           if (w1->chrs[w1->length] && w1->chrs + w1->length + 1 == w2->chrs) {
       +             w2->length += w1->length + 1;
       ++            w2->width += w1->width + 1;
       +             w2->chrs = w1->chrs;
       +             w2->prev = w1->prev;
       +             w2->prev->next = w2;
       +@@ -397,20 +425,20 @@
       + 
       +   if (Report)
       +     for (w2 = head->next;  w2;  w2 = w2->next) {
       +-      if (w2->length > L) {
       +-        linelen = w2->length;
       ++      if (w2->width > L) {
       ++        linelen = w2->width;
       +         if (linelen > errmsg_size - 17)
       +           linelen = errmsg_size - 17;
       +-        sprintf(errmsg, "Word too long: %.*s\n", linelen, w2->chrs);
       ++        swprintf(errmsg,errmsg_size, L"Word too long: %.*ls\n", linelen, w2->chrs);
       +         goto rfcleanup;
       +       }
       +     }
       +   else
       +     for (w2 = head->next;  w2;  w2 = w2->next)
       +-      while (w2->length > L) {
       ++      while (w2->width > L) {
       +         w1 = malloc(sizeof (word));
       +         if (!w1) {
       +-          strcpy(errmsg,outofmem);
       ++          wcscpy(errmsg,outofmem);
       +           goto rfcleanup;
       +         }
       +         w1->next = w2;
       +@@ -420,7 +448,9 @@
       +         w1->chrs = w2->chrs;
       +         w2->chrs += L;
       +         w1->length = L;
       ++        w1->width = getWidth(w1->chrs, w1->chrs + L);
       +         w2->length -= L;
       ++        w2->width -= w1->width;
       +         w1->flags = 0;
       +         if (iscapital(w2)) {
       +           w1->flags |= W_CAPITAL;
       +@@ -444,9 +474,9 @@
       +     L = 0;
       +     w1 = head->next;
       +     while (w1) {
       +-      for (linelen = w1->length, w2 = w1->next;
       ++      for (linelen = w1->width, w2 = w1->next;
       +            w2 != w1->nextline;
       +-           linelen += 1 + isshifted(w2) + w2->length, w2 = w2->next);
       ++           linelen += 1 + isshifted(w2) + w2->width, w2 = w2->next);
       +       if (linelen > L) L = linelen;
       +       w1 = w2;
       +     }
       +@@ -454,67 +484,67 @@
       + 
       + /* Construct the lines: */
       + 
       +-  pbuf = newbuffer(sizeof (char *), errmsg);
       ++  pbuf = newbuffer(sizeof (wchar_t *), errmsg);
       +   if (*errmsg) goto rfcleanup;
       + 
       +   numout = 0;
       +   w1 = head->next;
       +   while (numout < hang || w1) {
       +     if (w1)
       +-      for (w2 = w1->next, numgaps = 0, extra = L - w1->length;
       ++      for (w2 = w1->next, numgaps = 0, extra = L - w1->width;
       +            w2 != w1->nextline;
       +-           ++numgaps, extra -= 1 + isshifted(w2) + w2->length, w2 = w2->next);
       ++           ++numgaps, extra -= 1 + isshifted(w2) + w2->width, w2 = w2->next);
       +     linelen = suffix || (just && (w2 || last)) ?
       +                 L + affix :
       +                 w1 ? prefix + L - extra : prefix;
       +-    q1 = malloc((linelen + 1) * sizeof (char));
       ++    q1 = malloc((linelen + 1) * sizeof (wchar_t));
       +     if (!q1) {
       +-      strcpy(errmsg,outofmem);
       ++      wcscpy(errmsg,outofmem);
       +       goto rfcleanup;
       +     }
       +     additem(pbuf, &q1, errmsg);
       +     if (*errmsg) goto rfcleanup;
       +     ++numout;
       +     q2 = q1 + prefix;
       +-    if      (numout <= numin) memcpy(q1, inlines[numout - 1], prefix);
       +-    else if (numin  >  hang ) memcpy(q1, endline[-1],         prefix);
       ++    if      (numout <= numin) memcpy(q1, inlines[numout - 1], prefix * sizeof(wchar_t));
       ++    else if (numin  >  hang ) memcpy(q1, endline[-1],         prefix * sizeof(wchar_t));
       +     else {
       +       if (afp > prefix) afp = prefix;
       +-      memcpy(q1, endline[-1], afp);
       ++      memcpy(q1, endline[-1], afp * sizeof(wchar_t));
       +       q1 += afp;
       +-      while (q1 < q2) *q1++ = ' ';
       ++      while (q1 < q2) *q1++ = L' ';
       +     }
       +     q1 = q2;
       +     if (w1) {
       +       phase = numgaps / 2;
       +       for (w2 = w1;  ;  ) {
       +-        memcpy(q1, w2->chrs, w2->length);
       ++        memcpy(q1, w2->chrs, w2->length * sizeof(wchar_t));
       +         q1 += w2->length;
       +         w2 = w2->next;
       +         if (w2 == w1->nextline) break;
       +-        *q1++ = ' ';
       ++        *q1++ = L' ';
       +         if (just && (w1->nextline || last)) {
       +           phase += extra;
       +           while (phase >= numgaps) {
       +-            *q1++ = ' ';
       ++            *q1++ = L' ';
       +             phase -= numgaps;
       +           }
       +         }
       +-        if (isshifted(w2)) *q1++ = ' ';
       ++        if (isshifted(w2)) *q1++ = L' ';
       +       }
       +     }
       +     q2 += linelen - affix;
       +-    while (q1 < q2) *q1++ = ' ';
       ++    while (q1 < q2) *q1++ = L' ';
       +     q2 = q1 + suffix;
       +-    if      (numout <= numin) memcpy(q1, suffixes[numout - 1], suffix);
       +-    else if (numin  >  hang ) memcpy(q1, suffixes[numin  - 1], suffix);
       ++    if      (numout <= numin) memcpy(q1, suffixes[numout - 1], suffix * sizeof(wchar_t));
       ++    else if (numin  >  hang ) memcpy(q1, suffixes[numin  - 1], suffix * sizeof(wchar_t));
       +     else {
       +       if (fs > suffix) fs = suffix;
       +-      memcpy(q1, suffixes[numin - 1], fs);
       ++      memcpy(q1, suffixes[numin - 1], fs * sizeof(wchar_t));
       +       q1 += fs;
       +-      while(q1 < q2) *q1++ = ' ';
       ++      while(q1 < q2) *q1++ = L' ';
       +     }
       +-    *q2 = '\0';
       ++    *q2 = L'\0';
       +     if (w1) w1 = w1->nextline;
       +   }
       + 
       +@@ -543,5 +573,6 @@
       +     freebuffer(pbuf);
       +   }
       + 
       ++  
       +   return outlines;
       + }
       +diff -ur par-1.52.orig/reformat.h par-1.52-i18n.4/reformat.h
       +--- reformat.h.orig    2001-03-09 01:53:43.000000000 +0100
       ++++ reformat.h 2009-05-29 21:12:57.000000000 +0200
       +@@ -1,18 +1,20 @@
       +-/*********************/
       +-/* reformat.h        */
       +-/* for Par 1.52      */
       +-/* Copyright 2001 by */
       +-/* Adam M. Costello  */
       +-/*********************/
       ++/***********************/
       ++/* reformat.h          */
       ++/* for Par 1.52-i18n.4 */
       ++/* Copyright 2001 by   */
       ++/* Adam M. Costello    */
       ++/* Modified by         */
       ++/* Jérôme Pouiller     */
       ++/***********************/
       + 
       + /* This is ANSI C code (C89). */
       + 
       + 
       + #include "errmsg.h"
       ++#include <wchar.h>
       + 
       +-
       +-char **reformat(
       +-  const char * const *inlines, const char * const *endline, int afp, int fs,
       ++wchar_t **reformat(
       ++  const wchar_t * const *inlines, const wchar_t * const *endline, int afp, int fs,
       +   int hang, int prefix, int suffix, int width, int cap, int fit, int guess,
       +   int just, int last, int Report, int touch, errmsg_t errmsg
       + );
       +diff -ur par-1.52.orig/releasenotes par-1.52-i18n.4/releasenotes
       +--- releasenotes.orig  2001-04-29 23:12:05.000000000 +0200
       ++++ releasenotes       2009-05-29 21:02:37.000000000 +0200
       +@@ -1,12 +1,28 @@
       +-  *********************
       +-  * releasenotes      *
       +-  * for Par 1.52      *
       +-  * Copyright 2001 by *
       +-  * Adam M. Costello  *
       +-  *********************
       ++  ***********************
       ++  * releasenotes        *
       ++  * for Par 1.52-i18n.4 *
       ++  * Copyright 2001 by   *
       ++  * Adam M. Costello    *
       ++  * Modified by         *
       ++  * Jérôme Pouiller     *
       ++  ***********************
       + 
       + 
       + Each entry below describes changes since the previous version.
       ++Par 1.52-i18n.4 released 2009-May-05
       ++    Change nearly all char in wchar_t remove nightmare of unsigned char vs signed char
       ++    Fix bugs with option 'q'
       ++    Fix bugs with '\n'
       ++
       ++Par 1.52-i18n.3 released 2006-Oct-03
       ++    Fix bug with option 'g'
       ++
       ++Par 1.52-i18n.2 released 2006-Aug-03
       ++    Fix bug debian #310495.
       ++
       ++Par 1.52-i18n.1 released 2006-Jun-22
       ++    Changed char in wchar_t. Allow support of multibytes characters.
       ++    Added support for double-width characters.
       + 
       + Par 1.52 released 2001-Apr-29
       +     Fixed a portability problem regarding unsigned char versus char.
       diff -r 000000000000 -r 7981c5f981fd wm/dwm/patch-config.h
       --- /dev/null   Thu Jan 01 00:00:00 1970 +0000
       +++ b/wm/dwm/patch-config.h     Fri Aug 17 20:05:23 2018 +0200
       @@ -0,0 +1,224 @@
       +--- /dev/null  2015-11-09 10:41:47.000000000 +0100
       ++++ config.h   2015-11-09 10:40:39.000000000 +0100
       +@@ -0,0 +1,221 @@
       ++/* See LICENSE file for copyright and license details. */
       ++
       ++/* appearance */
       ++static const char *fonts[] = {
       ++      "Droid Sans Mono:size=9"
       ++};
       ++static const char dmenufont[]       = "Droid Sans Mono:size=9";
       ++static const char normbordercolor[] = "#777777";
       ++static const char normbgcolor[]     = "#000000";
       ++static const char normfgcolor[]     = "#777777";
       ++static const char selbordercolor[]  = "#ffffff";
       ++static const char selbgcolor[]      = "#000000";
       ++static const char selfgcolor[]      = "#ffffff";
       ++static const unsigned int borderpx  = 1;        /* border pixel of windows */
       ++static const unsigned int snap      = 32;       /* snap pixel */
       ++static const int showbar            = 1;        /* 0 means no bar */
       ++static const int topbar             = 1;        /* 0 means bottom bar */
       ++
       ++/* tagging */
       ++static const char *tags[] = { "F1", "F2", "F3", "F4", "F5" };
       ++
       ++static const Rule rules[] = {
       ++      /* xprop(1):
       ++       *      WM_CLASS(STRING) = instance, class
       ++       *      WM_NAME(STRING) = title
       ++       */
       ++      /* class      instance    title       tags mask     isfloating   monitor */
       ++      { "mpv",          NULL,       NULL,       0,            1,       -1 },
       ++      { "xterm-float",  NULL,       NULL,       0,            1,       -1 },
       ++      { "Firefox",      NULL,       NULL,       1 << 1,       0,       -1 },
       ++      { "Vimb",         NULL,       NULL,       1 << 1,       0,       -1 },
       ++      { "Surf",         NULL,       NULL,       1 << 1,       0,       -1 },
       ++      { "Luakit",       NULL,       NULL,       1 << 1,       0,       -1 },
       ++      { "tabbed",       NULL,       NULL,       1 << 1,       0,       -1 },
       ++      { "MuPDF",        NULL,       NULL,       1 << 2,       0,       -1 },
       ++      { "Zathura",      NULL,       NULL,       1 << 2,       0,       -1 },
       ++      { "Emacs",        NULL,       NULL,       1 << 3,       0,       -1 },
       ++      { "Gimp",         NULL,       NULL,       1 << 3,       0,       -1 },
       ++      { "SDL_App",      "SDL_App",  "PrBoom",   1 << 4,       1,       -1 },
       ++      { "SDL_App",      "SDL_App",  "QEMU",     0,            1,       -1 },
       ++};
       ++
       ++/* layout(s) */
       ++static const float mfact     = 0.55; /* factor of master area size [0.05..0.95] */
       ++static const int nmaster     = 1;    /* number of clients in master area */
       ++static const int resizehints = 1;    /* 1 means respect size hints in tiled resizals */
       ++
       ++static void
       ++bstack(Monitor *m) {
       ++      int w, h, mh, mx, tx, ty, tw;
       ++      unsigned int i, n;
       ++      Client *c;
       ++
       ++      for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
       ++      if(n == 0)
       ++              return;
       ++      if(n > m->nmaster) {
       ++              mh = m->nmaster ? m->mfact * m->wh : 0;
       ++              tw = m->ww / (n - m->nmaster);
       ++              ty = m->wy + mh;
       ++      } 
       ++      else {
       ++              mh = m->wh;
       ++              tw = m->ww;
       ++              ty = m->wy;
       ++      }
       ++      for(i = mx = 0, tx = m->wx, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) {
       ++              if(i < m->nmaster) {
       ++                      w = (m->ww - mx) / (MIN(n, m->nmaster) - i);
       ++                      resize(c, m->wx + mx, m->wy, w - (2 * c->bw), mh - (2 * c->bw), False);
       ++                      mx += WIDTH(c);
       ++              } 
       ++              else {
       ++                      h = m->wh - mh;
       ++                      resize(c, tx, ty, tw - (2 * c->bw), h - (2 * c->bw), False);
       ++                      if(tw != m->ww)
       ++                              tx += WIDTH(c);
       ++              }
       ++      }
       ++}
       ++
       ++static void
       ++bstackhoriz(Monitor *m) {
       ++      int w, mh, mx, tx, ty, th;
       ++      unsigned int i, n;
       ++      Client *c;
       ++
       ++      for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
       ++      if(n == 0)
       ++              return;
       ++      if(n > m->nmaster) {
       ++              mh = m->nmaster ? m->mfact * m->wh : 0;
       ++              th = (m->wh - mh) / (n - m->nmaster);
       ++              ty = m->wy + mh;
       ++      } 
       ++      else {
       ++              th = mh = m->wh;
       ++              ty = m->wy;
       ++      }
       ++      for(i = mx = 0, tx = m->wx, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) {
       ++              if(i < m->nmaster) {
       ++                      w = (m->ww - mx) / (MIN(n, m->nmaster) - i);
       ++                      resize(c, m->wx + mx, m->wy, w - (2 * c->bw), mh - (2 * c->bw), False);
       ++                      mx += WIDTH(c);
       ++              } 
       ++              else {
       ++                      resize(c, tx, ty, m->ww - (2 * c->bw), th - (2 * c->bw), False);
       ++                      if(th != m->wh)
       ++                              ty += HEIGHT(c);
       ++              }
       ++      }
       ++}
       ++
       ++static const Layout layouts[] = {
       ++      /* symbol     arrange function */
       ++      { "[M]",      monocle }, /* first entry is default */
       ++      { "[]=",      tile },
       ++      { "><>",      NULL },    /* no layout function means floating behavior */
       ++      { "TTT",      bstack },
       ++      { "===",      bstackhoriz },
       ++};
       ++
       ++static void
       ++moveresize(const Arg *arg) {
       ++      XEvent ev;
       ++      Monitor *m = selmon;
       ++
       ++      if(!(m->sel && arg && arg->v && m->sel->isfloating))
       ++              return;
       ++
       ++      resize(m->sel, m->sel->x + ((int *)arg->v)[0],
       ++          m->sel->y + ((int *)arg->v)[1],
       ++          m->sel->w + ((int *)arg->v)[2],
       ++          m->sel->h + ((int *)arg->v)[3],
       ++          True);
       ++
       ++      while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
       ++}
       ++
       ++/* key definitions */
       ++#define MODKEY Mod5Mask
       ++#define TAGKEYS(KEY,TAG) \
       ++      { 0,                     KEY,      view,           {.ui = 1 << TAG} }, \
       ++      { ControlMask,           KEY,      toggleview,     {.ui = 1 << TAG} }, \
       ++      { ShiftMask,             KEY,      tag,            {.ui = 1 << TAG} }, \
       ++      { ControlMask|ShiftMask, KEY,      toggletag,      {.ui = 1 << TAG} },
       ++
       ++/* helper for spawning shell commands in the pre dwm-5.0 fashion */
       ++#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
       ++
       ++/* commands */
       ++static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
       ++static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
       ++static const char *lockcmd[]  = { "slock", NULL };
       ++static const char *xplumbcmd[]  = { "xplumb", NULL };
       ++static const char *termcmd[]  = { "xterm", NULL };
       ++static const char *termfloatcmd[]  = { "xterm-float", NULL };
       ++static const char *tmuxtermcmd[]  = { "mxterm", NULL };
       ++static const char *srmenucmd[]  = { "srmenu", NULL };
       ++static const char *webbrowsercmd[]  = { "webbrowser", NULL };
       ++
       ++static Key keys[] = {
       ++      /* modifier                     key           function        argument */
       ++      { 0,                            XK_Menu,      spawn,          {.v = dmenucmd } },
       ++      { MODKEY,                       XK_e,         spawn,          {.v = dmenucmd } },
       ++      { MODKEY|ShiftMask,             XK_Return,    spawn,          {.v = termcmd } },
       ++      { MODKEY|Mod1Mask,              XK_Return,    spawn,          {.v = termfloatcmd } },
       ++      { MODKEY,                       XK_a,         spawn,          {.v = tmuxtermcmd } },
       ++      { 0,                            XK_Multi_key, spawn,          {.v = webbrowsercmd} },
       ++      { MODKEY,                       XK_w,         spawn,          {.v = webbrowsercmd} },
       ++      { MODKEY,                       XK_Multi_key, spawn,          {.v = srmenucmd} },
       ++      { MODKEY,                       XK_p,         spawn,          {.v = xplumbcmd } },
       ++      { MODKEY,                       XK_s,         spawn,          {.v = lockcmd } },
       ++      { MODKEY,                       XK_b,         togglebar,      {0} },
       ++      { MODKEY,                       XK_j,         focusstack,     {.i = +1 } },
       ++      { MODKEY,                       XK_k,         focusstack,     {.i = -1 } },
       ++      { MODKEY,                       XK_i,         incnmaster,     {.i = +1 } },
       ++      { MODKEY,                       XK_d,         incnmaster,     {.i = -1 } },
       ++      { MODKEY,                       XK_h,         setmfact,       {.f = -0.05} },
       ++      { MODKEY,                       XK_l,         setmfact,       {.f = +0.05} },
       ++      { MODKEY,                       XK_Return,    zoom,           {0} },
       ++      { MODKEY,                       XK_Tab,       view,           {0} },
       ++      { MODKEY|ShiftMask,             XK_c,         killclient,     {0} },
       ++      { MODKEY,                       XK_m,         setlayout,      {.v = &layouts[0]} },
       ++      { MODKEY,                       XK_t,         setlayout,      {.v = &layouts[1]} },
       ++      { MODKEY,                       XK_f,         setlayout,      {.v = &layouts[2]} },
       ++      { MODKEY,                       XK_o,         setlayout,      {.v = &layouts[3]} },
       ++      { MODKEY|ShiftMask,             XK_o,         setlayout,      {.v = &layouts[4]} },
       ++      { MODKEY,                       XK_space,     setlayout,      {0} },
       ++      { MODKEY|ShiftMask,             XK_space,     togglefloating, {0} },
       ++      { MODKEY,                       XK_0,         view,           {.ui = ~0 } },
       ++      { MODKEY|ShiftMask,             XK_0,         tag,            {.ui = ~0 } },
       ++      { MODKEY,                       XK_comma,     focusmon,       {.i = -1 } },
       ++      { MODKEY,                       XK_period,    focusmon,       {.i = +1 } },
       ++      { MODKEY|ShiftMask,             XK_comma,     tagmon,         {.i = -1 } },
       ++      { MODKEY|ShiftMask,             XK_period,    tagmon,         {.i = +1 } },
       ++      TAGKEYS(                        XK_F1,                        0)
       ++      TAGKEYS(                        XK_F2,                        1)
       ++      TAGKEYS(                        XK_F3,                        2)
       ++      TAGKEYS(                        XK_F4,                        3)
       ++      TAGKEYS(                        XK_F5,                        4)
       ++      { MODKEY|ShiftMask,             XK_q,         quit,           {0} },
       ++      { MODKEY,                       XK_Down,      moveresize,     {.v = (int []){0, 25, 0, 0}}},
       ++      { MODKEY,                       XK_Up,        moveresize,     {.v = (int []){0, -25, 0, 0}}},
       ++      { MODKEY,                       XK_Right,     moveresize,     {.v = (int []){25, 0, 0, 0}}},
       ++      { MODKEY,                       XK_Left,      moveresize,     {.v = (int []){-25, 0, 0, 0}}},
       ++      { MODKEY|ShiftMask,             XK_Down,      moveresize,     {.v = (int []){0, 0, 0, 25}}},
       ++      { MODKEY|ShiftMask,             XK_Up,        moveresize,     {.v = (int []){0, 0, 0, -25}}},
       ++      { MODKEY|ShiftMask,             XK_Right,     moveresize,     {.v = (int []){0, 0, 25, 0}}},
       ++      { MODKEY|ShiftMask,             XK_Left,      moveresize,     {.v = (int []){0, 0, -25, 0}}},
       ++};
       ++
       ++/* button definitions */
       ++/* click can be ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
       ++static Button buttons[] = {
       ++      /* click                event mask      button          function        argument */
       ++      { ClkWinTitle,          0,              Button2,        zoom,           {0} },
       ++      { ClkClientWin,         MODKEY,         Button1,        movemouse,      {0} },
       ++      { ClkClientWin,         MODKEY,         Button2,        togglefloating, {0} },
       ++      { ClkClientWin,         MODKEY,         Button3,        resizemouse,    {0} },
       ++};
       diff -r 000000000000 -r 7981c5f981fd x11/dmenu/patch-config.h
       --- /dev/null   Thu Jan 01 00:00:00 1970 +0000
       +++ b/x11/dmenu/patch-config.h  Fri Aug 17 20:05:23 2018 +0200
       @@ -0,0 +1,26 @@
       +--- /dev/null  2018-03-15 11:53:32.363610266 +0100
       ++++ config.h   2018-03-15 11:54:21.317951591 +0100
       +@@ -0,0 +1,23 @@
       ++/* See LICENSE file for copyright and license details. */
       ++/* Default settings; can be overriden by command line. */
       ++
       ++static int topbar = 1;                      /* -b  option; if 0, dmenu appears at bottom     */
       ++/* -fn option overrides fonts[0]; default X11 font or font set */
       ++static const char *fonts[] = {
       ++      "Droid Sans Mono:size=9"
       ++};
       ++static const char *prompt      = NULL;      /* -p  option; prompt to the left of input field */
       ++static const char *colors[SchemeLast][2] = {
       ++      /*     fg         bg       */
       ++      [SchemeNorm] = { "#777777", "#000000" },
       ++      [SchemeSel] =  { "#ffffff", "#000000" },
       ++      [SchemeOut] =  { "#aaaaaa", "#000000" },
       ++};
       ++/* -l option; if nonzero, dmenu uses vertical list with given number of lines */
       ++static unsigned int lines      = 0;
       ++
       ++/*
       ++ * Characters not considered part of a word while deleting words
       ++ * for example: " /?\"&[]"
       ++ */
       ++static const char worddelimiters[] = " ";
       diff -r 000000000000 -r 7981c5f981fd x11/st-term/patch-co
       --- /dev/null   Thu Jan 01 00:00:00 1970 +0000
       +++ b/x11/st-term/patch-co      Fri Aug 17 20:05:23 2018 +0200
       @@ -0,0 +1,466 @@
       +--- /dev/null  2018-03-15 11:44:42.305684300 +0100
       ++++ config.h   2018-03-15 11:45:52.641324882 +0100
       +@@ -0,0 +1,463 @@
       ++/* See LICENSE file for copyright and license details. */
       ++
       ++/*
       ++ * appearance
       ++ *
       ++ * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html
       ++ */
       ++static char *font = "Droid Sans Mono:size=13";
       ++static int borderpx = 2;
       ++
       ++/*
       ++ * What program is execed by st depends of these precedence rules:
       ++ * 1: program passed with -e
       ++ * 2: utmp option
       ++ * 3: SHELL environment variable
       ++ * 4: value of shell in /etc/passwd
       ++ * 5: value of shell in config.h
       ++ */
       ++static char *shell = "/bin/sh";
       ++char *utmp = NULL;
       ++char *stty_args = "stty raw pass8 nl -echo -iexten -cstopb 38400";
       ++
       ++/* identification sequence returned in DA and DECID */
       ++char *vtiden = "\033[?6c";
       ++
       ++/* Kerning / character bounding-box multipliers */
       ++static float cwscale = 1.0;
       ++static float chscale = 1.0;
       ++
       ++/*
       ++ * word delimiter string
       ++ *
       ++ * More advanced example: " `'\"()[]{}"
       ++ */
       ++char *worddelimiters = " ";
       ++
       ++/* selection timeouts (in milliseconds) */
       ++static unsigned int doubleclicktimeout = 300;
       ++static unsigned int tripleclicktimeout = 600;
       ++
       ++/* alt screens */
       ++int allowaltscreen = 1;
       ++
       ++/* frames per second st should at maximum draw to the screen */
       ++static unsigned int xfps = 120;
       ++static unsigned int actionfps = 30;
       ++
       ++/*
       ++ * blinking timeout (set to 0 to disable blinking) for the terminal blinking
       ++ * attribute.
       ++ */
       ++static unsigned int blinktimeout = 800;
       ++
       ++/*
       ++ * thickness of underline and bar cursors
       ++ */
       ++static unsigned int cursorthickness = 2;
       ++
       ++/*
       ++ * bell volume. It must be a value between -100 and 100. Use 0 for disabling
       ++ * it
       ++ */
       ++static int bellvolume = 0;
       ++
       ++/* default TERM value */
       ++char *termname = "xterm";
       ++
       ++/*
       ++ * spaces per tab
       ++ *
       ++ * When you are changing this value, don't forget to adapt the »it« value in
       ++ * the st.info and appropriately install the st.info in the environment where
       ++ * you use this st version.
       ++ *
       ++ *    it#$tabspaces,
       ++ *
       ++ * Secondly make sure your kernel is not expanding tabs. When running `stty
       ++ * -a` »tab0« should appear. You can tell the terminal to not expand tabs by
       ++ *  running following command:
       ++ *
       ++ *    stty tabs
       ++ */
       ++unsigned int tabspaces = 8;
       ++
       ++/* Terminal colors (16 first used in escape sequence) */
       ++static const char *colorname[] = {
       ++      /* 8 normal colors */
       ++      "black",
       ++      "red3",
       ++      "green3",
       ++      "yellow3",
       ++      "blue2",
       ++      "magenta3",
       ++      "cyan3",
       ++      "gray90",
       ++
       ++      /* 8 bright colors */
       ++      "gray50",
       ++      "red",
       ++      "green",
       ++      "yellow",
       ++      "#5c5cff",
       ++      "magenta",
       ++      "cyan",
       ++      "white",
       ++
       ++      [255] = 0,
       ++
       ++      /* more colors can be added after 255 to use with DefaultXX */
       ++      "#cccccc",
       ++      "#555555",
       ++};
       ++
       ++
       ++/*
       ++ * Default colors (colorname index)
       ++ * foreground, background, cursor, reverse cursor
       ++ */
       ++unsigned int defaultfg = 7;
       ++unsigned int defaultbg = 0;
       ++static unsigned int defaultcs = 256;
       ++static unsigned int defaultrcs = 257;
       ++
       ++/*
       ++ * Default shape of cursor
       ++ * 2: Block ("█")
       ++ * 4: Underline ("_")
       ++ * 6: Bar ("|")
       ++ * 7: Snowman ("☃")
       ++ */
       ++static unsigned int cursorshape = 2;
       ++
       ++/*
       ++ * Default columns and rows numbers
       ++ */
       ++
       ++static unsigned int cols = 80;
       ++static unsigned int rows = 24;
       ++
       ++/*
       ++ * Default colour and shape of the mouse cursor
       ++ */
       ++static unsigned int mouseshape = XC_xterm;
       ++static unsigned int mousefg = 7;
       ++static unsigned int mousebg = 0;
       ++
       ++/*
       ++ * Color used to display font attributes when fontconfig selected a font which
       ++ * doesn't match the ones requested.
       ++ */
       ++static unsigned int defaultattr = 11;
       ++
       ++/*
       ++ * Internal mouse shortcuts.
       ++ * Beware that overloading Button1 will disable the selection.
       ++ */
       ++static MouseShortcut mshortcuts[] = {
       ++      /* button               mask            string */
       ++      { Button4,              XK_ANY_MOD,     "\031" },
       ++      { Button5,              XK_ANY_MOD,     "\005" },
       ++};
       ++
       ++/* Internal keyboard shortcuts. */
       ++#define MODKEY Mod1Mask
       ++#define TERMMOD (ControlMask|ShiftMask)
       ++
       ++static Shortcut shortcuts[] = {
       ++      /* mask                 keysym          function        argument */
       ++      { XK_ANY_MOD,           XK_Break,       sendbreak,      {.i =  0} },
       ++      { ControlMask,          XK_Print,       toggleprinter,  {.i =  0} },
       ++      { ShiftMask,            XK_Print,       printscreen,    {.i =  0} },
       ++      { XK_ANY_MOD,           XK_Print,       printsel,       {.i =  0} },
       ++      { TERMMOD,              XK_Prior,       zoom,           {.f = +1} },
       ++      { TERMMOD,              XK_Next,        zoom,           {.f = -1} },
       ++      { TERMMOD,              XK_Home,        zoomreset,      {.f =  0} },
       ++      { TERMMOD,              XK_C,           clipcopy,       {.i =  0} },
       ++      { TERMMOD,              XK_V,           clippaste,      {.i =  0} },
       ++      { TERMMOD,              XK_Y,           selpaste,       {.i =  0} },
       ++      { ShiftMask,            XK_Insert,      selpaste,       {.i =  0} },
       ++      { TERMMOD,              XK_Num_Lock,    numlock,        {.i =  0} },
       ++      { TERMMOD,              XK_I,           iso14755,       {.i =  0} },
       ++};
       ++
       ++/*
       ++ * Special keys (change & recompile st.info accordingly)
       ++ *
       ++ * Mask value:
       ++ * * Use XK_ANY_MOD to match the key no matter modifiers state
       ++ * * Use XK_NO_MOD to match the key alone (no modifiers)
       ++ * appkey value:
       ++ * * 0: no value
       ++ * * > 0: keypad application mode enabled
       ++ * *   = 2: term.numlock = 1
       ++ * * < 0: keypad application mode disabled
       ++ * appcursor value:
       ++ * * 0: no value
       ++ * * > 0: cursor application mode enabled
       ++ * * < 0: cursor application mode disabled
       ++ * crlf value
       ++ * * 0: no value
       ++ * * > 0: crlf mode is enabled
       ++ * * < 0: crlf mode is disabled
       ++ *
       ++ * Be careful with the order of the definitions because st searches in
       ++ * this table sequentially, so any XK_ANY_MOD must be in the last
       ++ * position for a key.
       ++ */
       ++
       ++/*
       ++ * If you want keys other than the X11 function keys (0xFD00 - 0xFFFF)
       ++ * to be mapped below, add them to this array.
       ++ */
       ++static KeySym mappedkeys[] = { -1 };
       ++
       ++/*
       ++ * State bits to ignore when matching key or button events.  By default,
       ++ * numlock (Mod2Mask) and keyboard layout (XK_SWITCH_MOD) are ignored.
       ++ */
       ++static uint ignoremod = Mod2Mask|XK_SWITCH_MOD;
       ++
       ++/*
       ++ * Override mouse-select while mask is active (when MODE_MOUSE is set).
       ++ * Note that if you want to use ShiftMask with selmasks, set this to an other
       ++ * modifier, set to 0 to not use it.
       ++ */
       ++static uint forceselmod = ShiftMask;
       ++
       ++/*
       ++ * This is the huge key array which defines all compatibility to the Linux
       ++ * world. Please decide about changes wisely.
       ++ */
       ++static Key key[] = {
       ++      /* keysym           mask            string      appkey appcursor */
       ++      { XK_KP_Home,       ShiftMask,      "\033[2J",       0,   -1},
       ++      { XK_KP_Home,       ShiftMask,      "\033[1;2H",     0,   +1},
       ++      { XK_KP_Home,       XK_ANY_MOD,     "\033[H",        0,   -1},
       ++      { XK_KP_Home,       XK_ANY_MOD,     "\033[1~",       0,   +1},
       ++      { XK_KP_Up,         XK_ANY_MOD,     "\033Ox",       +1,    0},
       ++      { XK_KP_Up,         XK_ANY_MOD,     "\033[A",        0,   -1},
       ++      { XK_KP_Up,         XK_ANY_MOD,     "\033OA",        0,   +1},
       ++      { XK_KP_Down,       XK_ANY_MOD,     "\033Or",       +1,    0},
       ++      { XK_KP_Down,       XK_ANY_MOD,     "\033[B",        0,   -1},
       ++      { XK_KP_Down,       XK_ANY_MOD,     "\033OB",        0,   +1},
       ++      { XK_KP_Left,       XK_ANY_MOD,     "\033Ot",       +1,    0},
       ++      { XK_KP_Left,       XK_ANY_MOD,     "\033[D",        0,   -1},
       ++      { XK_KP_Left,       XK_ANY_MOD,     "\033OD",        0,   +1},
       ++      { XK_KP_Right,      XK_ANY_MOD,     "\033Ov",       +1,    0},
       ++      { XK_KP_Right,      XK_ANY_MOD,     "\033[C",        0,   -1},
       ++      { XK_KP_Right,      XK_ANY_MOD,     "\033OC",        0,   +1},
       ++      { XK_KP_Prior,      ShiftMask,      "\033[5;2~",     0,    0},
       ++      { XK_KP_Prior,      XK_ANY_MOD,     "\033[5~",       0,    0},
       ++      { XK_KP_Begin,      XK_ANY_MOD,     "\033[E",        0,    0},
       ++      { XK_KP_End,        ControlMask,    "\033[J",       -1,    0},
       ++      { XK_KP_End,        ControlMask,    "\033[1;5F",    +1,    0},
       ++      { XK_KP_End,        ShiftMask,      "\033[K",       -1,    0},
       ++      { XK_KP_End,        ShiftMask,      "\033[1;2F",    +1,    0},
       ++      { XK_KP_End,        XK_ANY_MOD,     "\033[4~",       0,    0},
       ++      { XK_KP_Next,       ShiftMask,      "\033[6;2~",     0,    0},
       ++      { XK_KP_Next,       XK_ANY_MOD,     "\033[6~",       0,    0},
       ++      { XK_KP_Insert,     ShiftMask,      "\033[2;2~",    +1,    0},
       ++      { XK_KP_Insert,     ShiftMask,      "\033[4l",      -1,    0},
       ++      { XK_KP_Insert,     ControlMask,    "\033[L",       -1,    0},
       ++      { XK_KP_Insert,     ControlMask,    "\033[2;5~",    +1,    0},
       ++      { XK_KP_Insert,     XK_ANY_MOD,     "\033[4h",      -1,    0},
       ++      { XK_KP_Insert,     XK_ANY_MOD,     "\033[2~",      +1,    0},
       ++      { XK_KP_Delete,     ControlMask,    "\033[M",       -1,    0},
       ++      { XK_KP_Delete,     ControlMask,    "\033[3;5~",    +1,    0},
       ++      { XK_KP_Delete,     ShiftMask,      "\033[2K",      -1,    0},
       ++      { XK_KP_Delete,     ShiftMask,      "\033[3;2~",    +1,    0},
       ++      { XK_KP_Delete,     XK_ANY_MOD,     "\033[P",       -1,    0},
       ++      { XK_KP_Delete,     XK_ANY_MOD,     "\033[3~",      +1,    0},
       ++      { XK_KP_Multiply,   XK_ANY_MOD,     "\033Oj",       +2,    0},
       ++      { XK_KP_Add,        XK_ANY_MOD,     "\033Ok",       +2,    0},
       ++      { XK_KP_Enter,      XK_ANY_MOD,     "\033OM",       +2,    0},
       ++      { XK_KP_Enter,      XK_ANY_MOD,     "\r",           -1,    0},
       ++      { XK_KP_Subtract,   XK_ANY_MOD,     "\033Om",       +2,    0},
       ++      { XK_KP_Decimal,    XK_ANY_MOD,     "\033On",       +2,    0},
       ++      { XK_KP_Divide,     XK_ANY_MOD,     "\033Oo",       +2,    0},
       ++      { XK_KP_0,          XK_ANY_MOD,     "\033Op",       +2,    0},
       ++      { XK_KP_1,          XK_ANY_MOD,     "\033Oq",       +2,    0},
       ++      { XK_KP_2,          XK_ANY_MOD,     "\033Or",       +2,    0},
       ++      { XK_KP_3,          XK_ANY_MOD,     "\033Os",       +2,    0},
       ++      { XK_KP_4,          XK_ANY_MOD,     "\033Ot",       +2,    0},
       ++      { XK_KP_5,          XK_ANY_MOD,     "\033Ou",       +2,    0},
       ++      { XK_KP_6,          XK_ANY_MOD,     "\033Ov",       +2,    0},
       ++      { XK_KP_7,          XK_ANY_MOD,     "\033Ow",       +2,    0},
       ++      { XK_KP_8,          XK_ANY_MOD,     "\033Ox",       +2,    0},
       ++      { XK_KP_9,          XK_ANY_MOD,     "\033Oy",       +2,    0},
       ++      { XK_Up,            ShiftMask,      "\033[1;2A",     0,    0},
       ++      { XK_Up,            Mod1Mask,       "\033[1;3A",     0,    0},
       ++      { XK_Up,         ShiftMask|Mod1Mask,"\033[1;4A",     0,    0},
       ++      { XK_Up,            ControlMask,    "\033[1;5A",     0,    0},
       ++      { XK_Up,      ShiftMask|ControlMask,"\033[1;6A",     0,    0},
       ++      { XK_Up,       ControlMask|Mod1Mask,"\033[1;7A",     0,    0},
       ++      { XK_Up,ShiftMask|ControlMask|Mod1Mask,"\033[1;8A",  0,    0},
       ++      { XK_Up,            XK_ANY_MOD,     "\033[A",        0,   -1},
       ++      { XK_Up,            XK_ANY_MOD,     "\033OA",        0,   +1},
       ++      { XK_Down,          ShiftMask,      "\033[1;2B",     0,    0},
       ++      { XK_Down,          Mod1Mask,       "\033[1;3B",     0,    0},
       ++      { XK_Down,       ShiftMask|Mod1Mask,"\033[1;4B",     0,    0},
       ++      { XK_Down,          ControlMask,    "\033[1;5B",     0,    0},
       ++      { XK_Down,    ShiftMask|ControlMask,"\033[1;6B",     0,    0},
       ++      { XK_Down,     ControlMask|Mod1Mask,"\033[1;7B",     0,    0},
       ++      { XK_Down,ShiftMask|ControlMask|Mod1Mask,"\033[1;8B",0,    0},
       ++      { XK_Down,          XK_ANY_MOD,     "\033[B",        0,   -1},
       ++      { XK_Down,          XK_ANY_MOD,     "\033OB",        0,   +1},
       ++      { XK_Left,          ShiftMask,      "\033[1;2D",     0,    0},
       ++      { XK_Left,          Mod1Mask,       "\033[1;3D",     0,    0},
       ++      { XK_Left,       ShiftMask|Mod1Mask,"\033[1;4D",     0,    0},
       ++      { XK_Left,          ControlMask,    "\033[1;5D",     0,    0},
       ++      { XK_Left,    ShiftMask|ControlMask,"\033[1;6D",     0,    0},
       ++      { XK_Left,     ControlMask|Mod1Mask,"\033[1;7D",     0,    0},
       ++      { XK_Left,ShiftMask|ControlMask|Mod1Mask,"\033[1;8D",0,    0},
       ++      { XK_Left,          XK_ANY_MOD,     "\033[D",        0,   -1},
       ++      { XK_Left,          XK_ANY_MOD,     "\033OD",        0,   +1},
       ++      { XK_Right,         ShiftMask,      "\033[1;2C",     0,    0},
       ++      { XK_Right,         Mod1Mask,       "\033[1;3C",     0,    0},
       ++      { XK_Right,      ShiftMask|Mod1Mask,"\033[1;4C",     0,    0},
       ++      { XK_Right,         ControlMask,    "\033[1;5C",     0,    0},
       ++      { XK_Right,   ShiftMask|ControlMask,"\033[1;6C",     0,    0},
       ++      { XK_Right,    ControlMask|Mod1Mask,"\033[1;7C",     0,    0},
       ++      { XK_Right,ShiftMask|ControlMask|Mod1Mask,"\033[1;8C",0,   0},
       ++      { XK_Right,         XK_ANY_MOD,     "\033[C",        0,   -1},
       ++      { XK_Right,         XK_ANY_MOD,     "\033OC",        0,   +1},
       ++      { XK_ISO_Left_Tab,  ShiftMask,      "\033[Z",        0,    0},
       ++      { XK_Return,        Mod1Mask,       "\033\r",        0,    0},
       ++      { XK_Return,        XK_ANY_MOD,     "\r",            0,    0},
       ++      { XK_Insert,        ShiftMask,      "\033[4l",      -1,    0},
       ++      { XK_Insert,        ShiftMask,      "\033[2;2~",    +1,    0},
       ++      { XK_Insert,        ControlMask,    "\033[L",       -1,    0},
       ++      { XK_Insert,        ControlMask,    "\033[2;5~",    +1,    0},
       ++      { XK_Insert,        XK_ANY_MOD,     "\033[4h",      -1,    0},
       ++      { XK_Insert,        XK_ANY_MOD,     "\033[2~",      +1,    0},
       ++      { XK_Delete,        ControlMask,    "\033[M",       -1,    0},
       ++      { XK_Delete,        ControlMask,    "\033[3;5~",    +1,    0},
       ++      { XK_Delete,        ShiftMask,      "\033[2K",      -1,    0},
       ++      { XK_Delete,        ShiftMask,      "\033[3;2~",    +1,    0},
       ++      { XK_Delete,        XK_ANY_MOD,     "\033[P",       -1,    0},
       ++      { XK_Delete,        XK_ANY_MOD,     "\033[3~",      +1,    0},
       ++      { XK_BackSpace,     XK_NO_MOD,      "\177",          0,    0},
       ++      { XK_BackSpace,     Mod1Mask,       "\033\177",      0,    0},
       ++      { XK_Home,          ShiftMask,      "\033[2J",       0,   -1},
       ++      { XK_Home,          ShiftMask,      "\033[1;2H",     0,   +1},
       ++      { XK_Home,          XK_ANY_MOD,     "\033[H",        0,   -1},
       ++      { XK_Home,          XK_ANY_MOD,     "\033[1~",       0,   +1},
       ++      { XK_End,           ControlMask,    "\033[J",       -1,    0},
       ++      { XK_End,           ControlMask,    "\033[1;5F",    +1,    0},
       ++      { XK_End,           ShiftMask,      "\033[K",       -1,    0},
       ++      { XK_End,           ShiftMask,      "\033[1;2F",    +1,    0},
       ++      { XK_End,           XK_ANY_MOD,     "\033[4~",       0,    0},
       ++      { XK_Prior,         ControlMask,    "\033[5;5~",     0,    0},
       ++      { XK_Prior,         ShiftMask,      "\033[5;2~",     0,    0},
       ++      { XK_Prior,         XK_ANY_MOD,     "\033[5~",       0,    0},
       ++      { XK_Next,          ControlMask,    "\033[6;5~",     0,    0},
       ++      { XK_Next,          ShiftMask,      "\033[6;2~",     0,    0},
       ++      { XK_Next,          XK_ANY_MOD,     "\033[6~",       0,    0},
       ++      { XK_F1,            XK_NO_MOD,      "\033OP" ,       0,    0},
       ++      { XK_F1, /* F13 */  ShiftMask,      "\033[1;2P",     0,    0},
       ++      { XK_F1, /* F25 */  ControlMask,    "\033[1;5P",     0,    0},
       ++      { XK_F1, /* F37 */  Mod4Mask,       "\033[1;6P",     0,    0},
       ++      { XK_F1, /* F49 */  Mod1Mask,       "\033[1;3P",     0,    0},
       ++      { XK_F1, /* F61 */  Mod3Mask,       "\033[1;4P",     0,    0},
       ++      { XK_F2,            XK_NO_MOD,      "\033OQ" ,       0,    0},
       ++      { XK_F2, /* F14 */  ShiftMask,      "\033[1;2Q",     0,    0},
       ++      { XK_F2, /* F26 */  ControlMask,    "\033[1;5Q",     0,    0},
       ++      { XK_F2, /* F38 */  Mod4Mask,       "\033[1;6Q",     0,    0},
       ++      { XK_F2, /* F50 */  Mod1Mask,       "\033[1;3Q",     0,    0},
       ++      { XK_F2, /* F62 */  Mod3Mask,       "\033[1;4Q",     0,    0},
       ++      { XK_F3,            XK_NO_MOD,      "\033OR" ,       0,    0},
       ++      { XK_F3, /* F15 */  ShiftMask,      "\033[1;2R",     0,    0},
       ++      { XK_F3, /* F27 */  ControlMask,    "\033[1;5R",     0,    0},
       ++      { XK_F3, /* F39 */  Mod4Mask,       "\033[1;6R",     0,    0},
       ++      { XK_F3, /* F51 */  Mod1Mask,       "\033[1;3R",     0,    0},
       ++      { XK_F3, /* F63 */  Mod3Mask,       "\033[1;4R",     0,    0},
       ++      { XK_F4,            XK_NO_MOD,      "\033OS" ,       0,    0},
       ++      { XK_F4, /* F16 */  ShiftMask,      "\033[1;2S",     0,    0},
       ++      { XK_F4, /* F28 */  ControlMask,    "\033[1;5S",     0,    0},
       ++      { XK_F4, /* F40 */  Mod4Mask,       "\033[1;6S",     0,    0},
       ++      { XK_F4, /* F52 */  Mod1Mask,       "\033[1;3S",     0,    0},
       ++      { XK_F5,            XK_NO_MOD,      "\033[15~",      0,    0},
       ++      { XK_F5, /* F17 */  ShiftMask,      "\033[15;2~",    0,    0},
       ++      { XK_F5, /* F29 */  ControlMask,    "\033[15;5~",    0,    0},
       ++      { XK_F5, /* F41 */  Mod4Mask,       "\033[15;6~",    0,    0},
       ++      { XK_F5, /* F53 */  Mod1Mask,       "\033[15;3~",    0,    0},
       ++      { XK_F6,            XK_NO_MOD,      "\033[17~",      0,    0},
       ++      { XK_F6, /* F18 */  ShiftMask,      "\033[17;2~",    0,    0},
       ++      { XK_F6, /* F30 */  ControlMask,    "\033[17;5~",    0,    0},
       ++      { XK_F6, /* F42 */  Mod4Mask,       "\033[17;6~",    0,    0},
       ++      { XK_F6, /* F54 */  Mod1Mask,       "\033[17;3~",    0,    0},
       ++      { XK_F7,            XK_NO_MOD,      "\033[18~",      0,    0},
       ++      { XK_F7, /* F19 */  ShiftMask,      "\033[18;2~",    0,    0},
       ++      { XK_F7, /* F31 */  ControlMask,    "\033[18;5~",    0,    0},
       ++      { XK_F7, /* F43 */  Mod4Mask,       "\033[18;6~",    0,    0},
       ++      { XK_F7, /* F55 */  Mod1Mask,       "\033[18;3~",    0,    0},
       ++      { XK_F8,            XK_NO_MOD,      "\033[19~",      0,    0},
       ++      { XK_F8, /* F20 */  ShiftMask,      "\033[19;2~",    0,    0},
       ++      { XK_F8, /* F32 */  ControlMask,    "\033[19;5~",    0,    0},
       ++      { XK_F8, /* F44 */  Mod4Mask,       "\033[19;6~",    0,    0},
       ++      { XK_F8, /* F56 */  Mod1Mask,       "\033[19;3~",    0,    0},
       ++      { XK_F9,            XK_NO_MOD,      "\033[20~",      0,    0},
       ++      { XK_F9, /* F21 */  ShiftMask,      "\033[20;2~",    0,    0},
       ++      { XK_F9, /* F33 */  ControlMask,    "\033[20;5~",    0,    0},
       ++      { XK_F9, /* F45 */  Mod4Mask,       "\033[20;6~",    0,    0},
       ++      { XK_F9, /* F57 */  Mod1Mask,       "\033[20;3~",    0,    0},
       ++      { XK_F10,           XK_NO_MOD,      "\033[21~",      0,    0},
       ++      { XK_F10, /* F22 */ ShiftMask,      "\033[21;2~",    0,    0},
       ++      { XK_F10, /* F34 */ ControlMask,    "\033[21;5~",    0,    0},
       ++      { XK_F10, /* F46 */ Mod4Mask,       "\033[21;6~",    0,    0},
       ++      { XK_F10, /* F58 */ Mod1Mask,       "\033[21;3~",    0,    0},
       ++      { XK_F11,           XK_NO_MOD,      "\033[23~",      0,    0},
       ++      { XK_F11, /* F23 */ ShiftMask,      "\033[23;2~",    0,    0},
       ++      { XK_F11, /* F35 */ ControlMask,    "\033[23;5~",    0,    0},
       ++      { XK_F11, /* F47 */ Mod4Mask,       "\033[23;6~",    0,    0},
       ++      { XK_F11, /* F59 */ Mod1Mask,       "\033[23;3~",    0,    0},
       ++      { XK_F12,           XK_NO_MOD,      "\033[24~",      0,    0},
       ++      { XK_F12, /* F24 */ ShiftMask,      "\033[24;2~",    0,    0},
       ++      { XK_F12, /* F36 */ ControlMask,    "\033[24;5~",    0,    0},
       ++      { XK_F12, /* F48 */ Mod4Mask,       "\033[24;6~",    0,    0},
       ++      { XK_F12, /* F60 */ Mod1Mask,       "\033[24;3~",    0,    0},
       ++      { XK_F13,           XK_NO_MOD,      "\033[1;2P",     0,    0},
       ++      { XK_F14,           XK_NO_MOD,      "\033[1;2Q",     0,    0},
       ++      { XK_F15,           XK_NO_MOD,      "\033[1;2R",     0,    0},
       ++      { XK_F16,           XK_NO_MOD,      "\033[1;2S",     0,    0},
       ++      { XK_F17,           XK_NO_MOD,      "\033[15;2~",    0,    0},
       ++      { XK_F18,           XK_NO_MOD,      "\033[17;2~",    0,    0},
       ++      { XK_F19,           XK_NO_MOD,      "\033[18;2~",    0,    0},
       ++      { XK_F20,           XK_NO_MOD,      "\033[19;2~",    0,    0},
       ++      { XK_F21,           XK_NO_MOD,      "\033[20;2~",    0,    0},
       ++      { XK_F22,           XK_NO_MOD,      "\033[21;2~",    0,    0},
       ++      { XK_F23,           XK_NO_MOD,      "\033[23;2~",    0,    0},
       ++      { XK_F24,           XK_NO_MOD,      "\033[24;2~",    0,    0},
       ++      { XK_F25,           XK_NO_MOD,      "\033[1;5P",     0,    0},
       ++      { XK_F26,           XK_NO_MOD,      "\033[1;5Q",     0,    0},
       ++      { XK_F27,           XK_NO_MOD,      "\033[1;5R",     0,    0},
       ++      { XK_F28,           XK_NO_MOD,      "\033[1;5S",     0,    0},
       ++      { XK_F29,           XK_NO_MOD,      "\033[15;5~",    0,    0},
       ++      { XK_F30,           XK_NO_MOD,      "\033[17;5~",    0,    0},
       ++      { XK_F31,           XK_NO_MOD,      "\033[18;5~",    0,    0},
       ++      { XK_F32,           XK_NO_MOD,      "\033[19;5~",    0,    0},
       ++      { XK_F33,           XK_NO_MOD,      "\033[20;5~",    0,    0},
       ++      { XK_F34,           XK_NO_MOD,      "\033[21;5~",    0,    0},
       ++      { XK_F35,           XK_NO_MOD,      "\033[23;5~",    0,    0},
       ++};
       ++
       ++/*
       ++ * Selection types' masks.
       ++ * Use the same masks as usual.
       ++ * Button1Mask is always unset, to make masks match between ButtonPress.
       ++ * ButtonRelease and MotionNotify.
       ++ * If no match is found, regular selection is used.
       ++ */
       ++static uint selmasks[] = {
       ++      [SEL_RECTANGULAR] = Mod1Mask,
       ++};
       ++
       ++/*
       ++ * Printable characters in ASCII, used to estimate the advance width
       ++ * of single wide characters.
       ++ */
       ++static char ascii_printable[] =
       ++      " !\"#$%&'()*+,-./0123456789:;<=>?"
       ++      "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"
       ++      "`abcdefghijklmnopqrstuvwxyz{|}~";
       diff -r 000000000000 -r 7981c5f981fd x11/tabbed/patch-config.h
       --- /dev/null   Thu Jan 01 00:00:00 1970 +0000
       +++ b/x11/tabbed/patch-config.h Fri Aug 17 20:05:23 2018 +0200
       @@ -0,0 +1,75 @@
       +--- /dev/null  2015-01-23 02:13:12.000000000 +0100
       ++++ config.h   2015-01-23 02:22:07.000000000 +0100
       +@@ -0,0 +1,72 @@
       ++/* See LICENSE file for copyright and license details. */
       ++
       ++/* appearance */
       ++static const char font[]        = "-*-*-medium-r-*-*-13-*-*-*-*-*-*-*";
       ++static const char* normbgcolor  = "#000000";
       ++static const char* normfgcolor  = "#777777";
       ++static const char* selbgcolor   = "#000000";
       ++static const char* selfgcolor   = "#ffffff";
       ++static const char before[]      = "<";
       ++static const char after[]       = ">";
       ++static const int  tabwidth      = 200;
       ++static const Bool foreground    = False;
       ++
       ++/*
       ++ * Where to place a new tab when it is opened. When npisrelative is True,
       ++ * then the current position is changed + newposition. If npisrelative
       ++ * is False, then newposition is an absolute position.
       ++ */
       ++static int  newposition   = 1;
       ++static Bool npisrelative  = True;
       ++
       ++#define SETPROP(p) { \
       ++      .v = (char *[]){ "/bin/sh", "-c", \
       ++              "prop=\"`xwininfo -children -id $1 | grep '^     0x' | sed -e's@^ *\\(0x[0-9a-f]*\\) \"\\([^\"]*\\)\".*@\\1 \\2@' | xargs -0 printf %b | dmenu -l 10`\" &&" \
       ++              "xprop -id $1 -f $0 8s -set $0 \"$prop\"", \
       ++              p, winid, NULL \
       ++      } \
       ++}
       ++
       ++#define MODKEY ControlMask
       ++static Key keys[] = { \
       ++      /* modifier                     key        function        argument */
       ++      { MODKEY|ShiftMask,             XK_Return, focusonce,      { 0 } },
       ++      { MODKEY|ShiftMask,             XK_Return, spawn,          { 0 } },
       ++      { MODKEY,                       XK_t,      spawn,          SETPROP("_TABBED_SELECT_TAB") },
       ++
       ++      { MODKEY,                       XK_Left,   rotate,         { .i = -1 } },
       ++      { MODKEY,                       XK_Right,  rotate,         { .i = +1 } },
       ++      { MODKEY|ShiftMask,             XK_h,      rotate,         { .i = -1 } },
       ++      { MODKEY|ShiftMask,             XK_l,      rotate,         { .i = +1 } },
       ++      { MODKEY|ShiftMask,             XK_Left,   movetab,        { .i = -1 } },
       ++      { MODKEY|ShiftMask,             XK_Right,  movetab,        { .i = +1 } },
       ++      { MODKEY|ShiftMask,             XK_j,      movetab,        { .i = -1 } },
       ++      { MODKEY|ShiftMask,             XK_k,      movetab,        { .i = +1 } },
       ++      { MODKEY,                       XK_Tab,    rotate,         { .i = 0 } },
       ++
       ++      { MODKEY,                       XK_1,      move,           { .i = 0 } },
       ++      { MODKEY,                       XK_2,      move,           { .i = 1 } },
       ++      { MODKEY,                       XK_3,      move,           { .i = 2 } },
       ++      { MODKEY,                       XK_4,      move,           { .i = 3 } },
       ++      { MODKEY,                       XK_5,      move,           { .i = 4 } },
       ++      { MODKEY,                       XK_6,      move,           { .i = 5 } },
       ++      { MODKEY,                       XK_7,      move,           { .i = 6 } },
       ++      { MODKEY,                       XK_8,      move,           { .i = 7 } },
       ++      { MODKEY,                       XK_9,      move,           { .i = 8 } },
       ++      { MODKEY,                       XK_0,      move,           { .i = 9 } },
       ++
       ++      { MODKEY|ShiftMask,             XK_1,      movetab,           { .i = 0 } },
       ++      { MODKEY|ShiftMask,             XK_2,      movetab,           { .i = 1 } },
       ++      { MODKEY|ShiftMask,             XK_3,      movetab,           { .i = 2 } },
       ++      { MODKEY|ShiftMask,             XK_4,      movetab,           { .i = 3 } },
       ++      { MODKEY|ShiftMask,             XK_5,      movetab,           { .i = 4 } },
       ++      { MODKEY|ShiftMask,             XK_6,      movetab,           { .i = 5 } },
       ++      { MODKEY|ShiftMask,             XK_7,      movetab,           { .i = 6 } },
       ++      { MODKEY|ShiftMask,             XK_8,      movetab,           { .i = 7 } },
       ++      { MODKEY|ShiftMask,             XK_9,      movetab,           { .i = 8 } },
       ++      { MODKEY|ShiftMask,             XK_0,      movetab,           { .i = 9 } },
       ++
       ++      { MODKEY,                       XK_q,      killclient,     { 0 } },
       ++
       ++      { MODKEY,                       XK_F11,    fullscreen,     { 0 } },
       ++};
       diff -r 000000000000 -r 7981c5f981fd x11/unclutter/patch-unclutter.c
       --- /dev/null   Thu Jan 01 00:00:00 1970 +0000
       +++ b/x11/unclutter/patch-unclutter.c   Fri Aug 17 20:05:23 2018 +0200
       @@ -0,0 +1,40 @@
       +
       +Use WM_CLASS instead of WM_NAME for -not argument.
       +
       +--- unclutter.c.orig   1994-04-11 17:40:47.000000000 +0200
       ++++ unclutter.c        2015-02-23 11:09:35.000000000 +0100
       +@@ -69,7 +69,7 @@
       + char **names; /* -> argv list of names to avoid */
       + 
       + /*
       +- * return true if window has a wm_name and the start of it matches
       ++ * return true if window has a wm_class and the start of it matches
       +  * one of the given names to avoid
       +  */
       + nameinlist(display,window)
       +@@ -77,15 +77,20 @@
       + Window window;
       + {
       +     char **cpp;
       +-    char *name;
       ++    char *class;
       ++    XClassHint *ch;
       + 
       +-    if(names==0)return 0;
       +-    if(XFetchName (display, window, &name)){
       ++    ch = XAllocClassHint();
       ++
       ++    if( names==0 || ch == NULL) return 0;
       ++    if(XGetClassHint (display, window, ch)){
       ++      XFree(ch->res_name);
       ++      class = ch->res_class;
       +       for(cpp = names;*cpp!=0;cpp++){
       +-          if(strncmp(*cpp,name,strlen(*cpp))==0)
       ++          if(strncmp(*cpp,class,strlen(*cpp))==0)
       +               break;
       +       }
       +-      XFree(name);
       ++      XFree(class);
       +       return(*cpp!=0);
       +     }
       +     return 0;