From 9845044fb659735251269213e6e4e6debdd08eee Mon Sep 17 00:00:00 2001 From: Leo Liu Date: Tue, 8 Jan 2019 05:15:24 +0800 Subject: [PATCH 01/10] Speed up loading css-mode lisp/textmodes/css-mode.el: Remove (require 'eww) which is redundant and slow. (Bug#33939) --- lisp/textmodes/css-mode.el | 1 - 1 file changed, 1 deletion(-) diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index 016f0e8fc8c..67a0c9f7a57 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el @@ -32,7 +32,6 @@ ;;; Code: -(require 'eww) (require 'cl-lib) (require 'color) (require 'seq) From 0f716557c529479a7d86d751e972ebdae1bec5e1 Mon Sep 17 00:00:00 2001 From: Philip K Date: Wed, 9 Jan 2019 00:37:48 +0100 Subject: [PATCH 02/10] Reinitialize ispell-really-enchant when changing the speller * lisp/textmodes/ispell.el (ispell-check-version): Reset also ispell-really-enchant. (Bug#34019) Copyright-paperwork-exempt: yes --- lisp/textmodes/ispell.el | 1 + 1 file changed, 1 insertion(+) diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index c5d8e4f78c3..656c9fad932 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -723,6 +723,7 @@ Otherwise returns the library directory name, if that is defined." ;; Make sure these variables are (re-)initialized to the default value (setq ispell-really-aspell nil ispell-really-hunspell nil + ispell-really-enchant nil ispell-encoding8-command nil) (goto-char (point-min)) From d223727a7a15048b9963ebeb83b15962454aff0f Mon Sep 17 00:00:00 2001 From: Devon Sean McCullough Date: Sat, 5 Jan 2019 10:36:22 -0500 Subject: [PATCH 03/10] Fix UI of Buffer-menu * lisp/buff-menu.el (Buffer-menu-execute): Don't remove entries of buffers whose killing the user didn't confirm. (Bug#33669) --- lisp/buff-menu.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el index f0b96b0c5ea..5f889866361 100644 --- a/lisp/buff-menu.el +++ b/lisp/buff-menu.el @@ -475,10 +475,10 @@ Buffers marked with \\`\\[Buffer-menu-delete]' are deleted (save-buffer)) (tabulated-list-set-col 2 " " t)) (error (warn "Error saving %s" buffer)))) - (if delete - (unless (eq buffer (current-buffer)) - (kill-buffer buffer) - (tabulated-list-delete-entry)) + (if (and delete + (not (eq buffer (current-buffer))) + (kill-buffer buffer)) + (tabulated-list-delete-entry) (forward-line 1))))))))) (defun Buffer-menu-select () From 21b902692828d25bae492c42167281bf1b178bd1 Mon Sep 17 00:00:00 2001 From: Stephen Berman Date: Sat, 12 Jan 2019 16:14:49 +0100 Subject: [PATCH 04/10] * etc/tutorials/TUTORIAL: Fix typo (bug#34049) --- etc/tutorials/TUTORIAL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/tutorials/TUTORIAL b/etc/tutorials/TUTORIAL index 48ba5dbc07e..3f5f116648b 100644 --- a/etc/tutorials/TUTORIAL +++ b/etc/tutorials/TUTORIAL @@ -704,7 +704,7 @@ Emacs deletes its auto save file. If the computer crashes, you can recover your auto-saved editing by finding the file normally (the file you were editing, not the auto save file) and then typing M-x recover-this-file . When it -asks fo confirmation, type yes to go ahead and recover the +asks for confirmation, type yes to go ahead and recover the auto-save data. From 6ac5985418e5e6e164ff7cbf3fdc5778c30da5e3 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 12 Jan 2019 14:47:33 -0800 Subject: [PATCH 05/10] ; Fix some trivial doc typos --- doc/emacs/ChangeLog.1 | 2 +- lisp/ChangeLog.12 | 2 +- lisp/ChangeLog.7 | 2 +- lisp/dired.el | 2 +- lisp/erc/ChangeLog.1 | 2 +- src/ChangeLog.11 | 2 +- src/ChangeLog.4 | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/emacs/ChangeLog.1 b/doc/emacs/ChangeLog.1 index 439ef51acb8..99faff1623c 100644 --- a/doc/emacs/ChangeLog.1 +++ b/doc/emacs/ChangeLog.1 @@ -83,7 +83,7 @@ 2014-12-08 Eric S. Raymond - * maintaining.texi: Suopport fo Arch has been moved to obosolete, + * maintaining.texi: Support for Arch has been moved to obsolete, remove references that imply otherwise. 2014-11-29 Paul Eggert diff --git a/lisp/ChangeLog.12 b/lisp/ChangeLog.12 index 3b72cb680ca..0c0349c9d99 100644 --- a/lisp/ChangeLog.12 +++ b/lisp/ChangeLog.12 @@ -8873,7 +8873,7 @@ 2006-06-06 Nick Roberts * progmodes/gud.el (gud-running): Fix doc string. - (gud-menu-map): Use :visible instead fo :enable for debugger test. + (gud-menu-map): Use :visible instead of :enable for debugger test. (gud-tooltip-modes): Add python-mode. (gud-tooltip-print-command): Add pdb. Remove perldb. diff --git a/lisp/ChangeLog.7 b/lisp/ChangeLog.7 index f4b96ec909f..b3686af0d07 100644 --- a/lisp/ChangeLog.7 +++ b/lisp/ChangeLog.7 @@ -12376,7 +12376,7 @@ when turning on Encoded-kbd mode, and recover it when turning off Encoded-kbd mode. Set encoded-kbd-iso2022-designations correctly. (encoded-kbd-self-insert-iso2022-7bit): Call charset-dimension - instead fo charset-bytes. + instead of charset-bytes. (encoded-kbd-self-insert-iso2022-8bit): Likewise. * language/china-util.el (setup-chinese-gb-environment): Do not diff --git a/lisp/dired.el b/lisp/dired.el index bfbb87ec2c1..c831c5e93da 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -1694,7 +1694,7 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST." ;; Make menu bar items. - ;; No need to fo this, now that top-level items are fewer. + ;; No need to do this, now that top-level items are fewer. ;;;; ;; Get rid of the Edit menu bar item to save space. ;(define-key map [menu-bar edit] 'undefined) diff --git a/lisp/erc/ChangeLog.1 b/lisp/erc/ChangeLog.1 index fbb64ea06e2..97b5d3f97be 100644 --- a/lisp/erc/ChangeLog.1 +++ b/lisp/erc/ChangeLog.1 @@ -11443,7 +11443,7 @@ * erc.el: * Added command-names to completion (erc-command-table) * New variable erc-auto-query. When set, every arriving message to you will open a query buffer for that sender if not already open. - * Compatibility function fo non-existing line-beginning|end-position functions in XEmacs. + * Compatibility function for non-existing line-beginning|end-position functions in XEmacs. 2001-10-03 Mario Lang diff --git a/src/ChangeLog.11 b/src/ChangeLog.11 index cdc119ede78..46ab8b9f328 100644 --- a/src/ChangeLog.11 +++ b/src/ChangeLog.11 @@ -23186,7 +23186,7 @@ Delete argument prop_index. (font_property_table): Change arguments to validator. Change Callers. (font_lispy_object): Delete. - (font_at): Use font_find_object instead fo font_lispy_object. + (font_at): Use font_find_object instead of font_lispy_object. 2008-02-01 Kenichi Handa diff --git a/src/ChangeLog.4 b/src/ChangeLog.4 index 02da8c0caf5..ab2807c1257 100644 --- a/src/ChangeLog.4 +++ b/src/ChangeLog.4 @@ -5135,7 +5135,7 @@ (BSTRING): Deleted because they are stubs to the memory funcs. (memmove): Defined as safe_bcopy since memcpy is not safe. (HAVE_X_WINDOWS): Does not conditionally define anything any more. - Added support fo the GNU C compiler bundled with R3V7. + Added support for the GNU C compiler bundled with R3V7. 1993-07-26 Richard Stallman (rms@mole.gnu.ai.mit.edu) From 03818b0a9509e5e54aaee8a40c25f7da099fb7df Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 13 Jan 2019 17:40:50 +0200 Subject: [PATCH 06/10] Fix a minor mistake in ELisp manual * doc/lispref/buffers.texi (Modification Time): Fix documentation of 'visited-file-modtime'. (Bug#34055) --- doc/lispref/buffers.texi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/lispref/buffers.texi b/doc/lispref/buffers.texi index 8d8fc97a60f..d97a095f686 100644 --- a/doc/lispref/buffers.texi +++ b/doc/lispref/buffers.texi @@ -661,7 +661,8 @@ visiting a file or if the time has been explicitly cleared by too. For instance, in a Dired buffer listing a directory, it returns the last modification time of that directory, as recorded by Dired. -If the buffer is not visiting a file, this function returns @minus{}1. +If the buffer is visiting a file that doesn't exist, this function +returns @minus{}1. @end defun @defun set-visited-file-modtime &optional time From b26d6373c48ca26a7cfc81fd03ec8d7f50c13962 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 13 Jan 2019 17:50:16 +0200 Subject: [PATCH 07/10] Fix Calc graph output on MS-Windows The previous code relied on "pgnuplot" executable, which is no longer provided with Gnuplot 5.x. * lisp/calc/calc.el (calc-gnuplot-name): Set to "pgnuplot" on MS-Windows only if such an executable exists. * lisp/calc/calc-graph.el (calc-graph-w32-p): New defsubst. (calc-graph-plot, calc-graph-command, calc-gnuplot-command) (calc-graph-init): Call calc-graph-w32-p wherever we need to do something special for invoking gnuplot on MS-Windows, instead of comparing against calc-gnuplot-name. (calc-graph-plot): Set the terminal to "qt" on MS-Windows when pgnuplot.exe is not available. (calc-graph-kill): Delete the temporary files only after killing the gnuplot process, otherwise the deletion might fail on MS-Windows because the files are still in use. --- lisp/calc/calc-graph.el | 35 ++++++++++++++++++++++------------- lisp/calc/calc.el | 11 +++++++++-- 2 files changed, 31 insertions(+), 15 deletions(-) diff --git a/lisp/calc/calc-graph.el b/lisp/calc/calc-graph.el index ff7f12d9faf..317f403ead6 100644 --- a/lisp/calc/calc-graph.el +++ b/lisp/calc/calc-graph.el @@ -65,6 +65,9 @@ (defvar calc-graph-no-wait nil) (defvar calc-gnuplot-trail-mark) +(defsubst calc-graph-w32-p () + (eq system-type 'windows-nt)) + (defun calc-graph-fast (many) (interactive "P") (let ((calc-graph-no-auto-view t)) @@ -376,8 +379,13 @@ ;; Check MS-Windows before X, in case they have ;; $DISPLAY set for some reason (e.g., Cygwin or ;; whatever) - ((string= calc-gnuplot-name "pgnuplot") - "windows") + ((string= calc-gnuplot-name "pgnuplot") + "windows") + ;; Versions of gnuplot that come without pgnuplot + ;; only work on MS-Windows with "qt" as the + ;; terminal, for some reason. + ((calc-graph-w32-p) + "qt") ((or (eq window-system 'x) (getenv "DISPLAY")) "x11") ((>= calc-gnuplot-version 3) @@ -1321,14 +1329,13 @@ This \"dumb\" driver will be present in Gnuplot 3.0." (calc-graph-init) (calc-graph-view-trail) (calc-gnuplot-command cmd) - (or (string= calc-gnuplot-name "pgnuplot") + (or (calc-graph-w32-p) (progn (accept-process-output) (calc-graph-view-trail))))) (defun calc-graph-kill (&optional no-view) (interactive) - (calc-graph-delete-temps) (if (calc-gnuplot-alive) (calc-wrapper (or no-view (calc-graph-view-trail)) @@ -1337,7 +1344,8 @@ This \"dumb\" driver will be present in Gnuplot 3.0." (sit-for 1) (if (process-status calc-gnuplot-process) (delete-process calc-gnuplot-process)) - (setq calc-gnuplot-process nil)))) + (setq calc-gnuplot-process nil))) + (calc-graph-delete-temps)) (defun calc-graph-quit () (interactive) @@ -1404,7 +1412,7 @@ This \"dumb\" driver will be present in Gnuplot 3.0." (defun calc-gnuplot-command (&rest args) (calc-graph-init) (let ((cmd (concat (mapconcat 'identity args " ") "\n"))) - (or (string= calc-gnuplot-name "pgnuplot") + (or (calc-graph-w32-p) (accept-process-output)) (with-current-buffer calc-gnuplot-buffer (calc-gnuplot-check-for-errors) @@ -1416,7 +1424,7 @@ This \"dumb\" driver will be present in Gnuplot 3.0." (process-send-string calc-gnuplot-process cmd) (if (get-buffer-window calc-gnuplot-buffer) (calc-graph-view-trail)) - (or (string= calc-gnuplot-name "pgnuplot") + (or (calc-graph-w32-p) (accept-process-output (and (not calc-graph-no-wait) calc-gnuplot-process))) (calc-gnuplot-check-for-errors) @@ -1445,8 +1453,9 @@ This \"dumb\" driver will be present in Gnuplot 3.0." (setq origin (point))) (setq calc-graph-last-device nil) (setq calc-graph-last-output nil) - (if (string= calc-gnuplot-name "pgnuplot") - (let ((version-str (shell-command-to-string "pgnuplot -V"))) + (if (calc-graph-w32-p) + (let ((version-str + (shell-command-to-string (concat calc-gnuplot-name " -V")))) (if (string-match "gnuplot \\([0-9]+\\)\\." version-str) (setq calc-gnuplot-version (string-to-number (substring version-str @@ -1457,11 +1466,11 @@ This \"dumb\" driver will be present in Gnuplot 3.0." (let ((args (append (and calc-gnuplot-display (not (equal calc-gnuplot-display (getenv "DISPLAY"))) - (not (string= calc-gnuplot-name "pgnuplot")) + (not (calc-graph-w32-p)) (list "-display" calc-gnuplot-display)) (and calc-gnuplot-geometry - (not (string= calc-gnuplot-name "pgnuplot")) + (not (calc-graph-w32-p)) (list "-geometry" calc-gnuplot-geometry))))) (setq calc-gnuplot-process @@ -1475,7 +1484,7 @@ This \"dumb\" driver will be present in Gnuplot 3.0." (error "Sorry, can't find \"%s\" on your system" calc-gnuplot-name))) (with-current-buffer calc-gnuplot-buffer - (while (and (not (string= calc-gnuplot-name "pgnuplot")) + (while (and (not (calc-graph-w32-p)) (not (save-excursion (goto-char origin) (search-forward "gnuplot> " nil t))) @@ -1483,7 +1492,7 @@ This \"dumb\" driver will be present in Gnuplot 3.0." (accept-process-output calc-gnuplot-process)) (or (memq (process-status calc-gnuplot-process) '(run stop)) (error "Unable to start GNUPLOT process")) - (if (not (string= calc-gnuplot-name "pgnuplot")) + (if (not (calc-graph-w32-p)) (if (save-excursion (goto-char origin) (re-search-forward diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index ef850a44fe6..1d403b73943 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el @@ -395,10 +395,17 @@ This is not required to be present for user-written mode annotations." (string :tag "Closing annotation delimiter")))) (defcustom calc-gnuplot-name - (if (eq system-type 'windows-nt) "pgnuplot" "gnuplot") + (if (and (eq system-type 'windows-nt) + ;; Gnuplot v4.x on MS-Windows came with a special + ;; pipe-enabled gnuplot executable for batch-mode + ;; execution; newer versions allow using gnuplot.exe. + (executable-find "pgnuplot")) + "pgnuplot" + "gnuplot") "Name of GNUPLOT program, for calc-graph features." :group 'calc - :type '(string)) + :type '(string) + :version "26.2") (defcustom calc-gnuplot-plot-command nil From 00ba2267ede311da0cd53261780fb0b781ca42dd Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 14 Jan 2019 17:36:04 +0200 Subject: [PATCH 08/10] Attempt to fix hangs on MS-Windows due to C-g * src/w32uniscribe.c (uniscribe_otf_capability): Set inhibit-quit around calls to otf_features, because the latter cons Lisp data structures while we are in a critical section. * src/xdisp.c (ALLOCATE_HDC) [HAVE_NTGUI]: Set inhibit-quit. (RELEASE_HDC) [HAVE_NTGUI]: Restore inhibit-quit. (OPTIONAL_HDC, DECLARE_HDC): Remove macros, their job is now done by ALLOCATE_HDC and by a single #ifdef. (draw_glyphs): Adapt to the above changes in macros. (Bug#34059) --- src/w32uniscribe.c | 6 ++++++ src/xdisp.c | 31 ++++++++++++++++++------------- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/src/w32uniscribe.c b/src/w32uniscribe.c index 33959cd05c8..28050d6ac76 100644 --- a/src/w32uniscribe.c +++ b/src/w32uniscribe.c @@ -176,6 +176,11 @@ uniscribe_otf_capability (struct font *font) Lisp_Object features; f = XFRAME (selected_frame); + /* Prevent quitting while we cons the lists in otf_features. + That's because get_frame_dc acquires the critical section, so we + cannot quit before we release it in release_frame_dc. */ + Lisp_Object prev_quit = Vinhibit_quit; + Vinhibit_quit = Qt; context = get_frame_dc (f); old_font = SelectObject (context, FONT_HANDLE (font)); @@ -186,6 +191,7 @@ uniscribe_otf_capability (struct font *font) SelectObject (context, old_font); release_frame_dc (f, context); + Vinhibit_quit = prev_quit; return capability; } diff --git a/src/xdisp.c b/src/xdisp.c index 274ab8ddf51..94ce1c29a0c 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -25619,22 +25619,28 @@ dump_glyph_string (struct glyph_string *s) face-override for drawing S. */ #ifdef HAVE_NTGUI -#define OPTIONAL_HDC(hdc) HDC hdc, -#define DECLARE_HDC(hdc) HDC hdc; -#define ALLOCATE_HDC(hdc, f) hdc = get_frame_dc ((f)) -#define RELEASE_HDC(hdc, f) release_frame_dc ((f), (hdc)) -#endif - -#ifndef OPTIONAL_HDC -#define OPTIONAL_HDC(hdc) -#define DECLARE_HDC(hdc) -#define ALLOCATE_HDC(hdc, f) -#define RELEASE_HDC(hdc, f) +/* We set inhibit-quit here due to paranoia: get_frame_dc acquires the + critical section, and we cannot QUIT while we hold the critical + section. If any of the code run by callers of ALLOCATE_HDC happens + to call Lisp (might be possible due to all the hooks lying around), + we must prevent it from quitting. */ +# define ALLOCATE_HDC(hdc, f) \ + Lisp_Object prev_quit = Vinhibit_quit; \ + Vinhibit_quit = Qt; \ + HDC hdc = get_frame_dc ((f)) +# define RELEASE_HDC(hdc, f) \ + release_frame_dc ((f), (hdc)); \ + Vinhibit_quit = prev_quit +#else +# define ALLOCATE_HDC(hdc, f) +# define RELEASE_HDC(hdc, f) #endif static void init_glyph_string (struct glyph_string *s, - OPTIONAL_HDC (hdc) +#ifdef HAVE_NTGUI + HDC hdc, +#endif XChar2b *char2b, struct window *w, struct glyph_row *row, enum glyph_row_area area, int start, enum draw_glyphs_face hl) { @@ -26674,7 +26680,6 @@ draw_glyphs (struct window *w, int x, struct glyph_row *row, struct glyph_string *clip_head = NULL, *clip_tail = NULL; int i, j, x_reached, last_x, area_left = 0; struct frame *f = XFRAME (WINDOW_FRAME (w)); - DECLARE_HDC (hdc); ALLOCATE_HDC (hdc, f); From c9f6f86814165ae277fe1618135151d0cdf84b8e Mon Sep 17 00:00:00 2001 From: Alan Third Date: Fri, 11 Jan 2019 16:52:59 +0000 Subject: [PATCH 09/10] Prevent redrawing if frame is garbaged * src/nsterm.m ([EmacsView viewWillDraw]): Cancel drawing if the frame has been garbaged. * src/xdisp.c (expose_window_tree, expose_frame): Remove NS only exceptions. --- src/nsterm.m | 8 ++++++++ src/xdisp.c | 14 +------------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/nsterm.m b/src/nsterm.m index c09f684daf4..bbd2c84214c 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -8077,6 +8077,14 @@ - (instancetype)toggleToolbar: (id)sender } +- (void)viewWillDraw +{ + /* If the frame has been garbaged there's no point in redrawing + anything. */ + if (FRAME_GARBAGED_P (emacsframe)) + [self setNeedsDisplay:NO]; +} + - (void)drawRect: (NSRect)rect { const NSRect *rectList; diff --git a/src/xdisp.c b/src/xdisp.c index 94ce1c29a0c..0c3754a338f 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -32266,14 +32266,7 @@ expose_window_tree (struct window *w, XRectangle *r) struct frame *f = XFRAME (w->frame); bool mouse_face_overwritten_p = false; - /* NS toolkits may have aleady modified the frame in expectation of - a successful redraw, so don't bail out here if the frame is - garbaged. */ - while (w -#if !defined (HAVE_NS) - && !FRAME_GARBAGED_P (f) -#endif - ) + while (w && !FRAME_GARBAGED_P (f)) { mouse_face_overwritten_p |= (WINDOWP (w->contents) @@ -32301,16 +32294,11 @@ expose_frame (struct frame *f, int x, int y, int w, int h) TRACE ((stderr, "expose_frame ")); -#if !defined (HAVE_NS) - /* No need to redraw if frame will be redrawn soon except under NS - where the toolkit may have already modified the frame in - expectation of us redrawing it. */ if (FRAME_GARBAGED_P (f)) { TRACE ((stderr, " garbaged\n")); return; } -#endif /* If basic faces haven't been realized yet, there is no point in trying to redraw anything. This can happen when we get an expose From b6d78a0d8019a92f94ce3fc41ddb0886f8b70d85 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 18 Jan 2019 10:51:57 +0200 Subject: [PATCH 10/10] Fix a typo in ELisp manual * doc/lispref/nonascii.texi (Converting Representations): Fix inconsistency between @defun and the argument description of 'byte-to-string'. (Bug#34119) --- doc/lispref/nonascii.texi | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/doc/lispref/nonascii.texi b/doc/lispref/nonascii.texi index ab15ea7d9b2..66d12033d82 100644 --- a/doc/lispref/nonascii.texi +++ b/doc/lispref/nonascii.texi @@ -287,12 +287,11 @@ unibyte string, it is returned unchanged. Use this function for characters. @end defun -@c FIXME: Should '@var{character}' be '@var{byte}'? @defun byte-to-string byte @cindex byte to string This function returns a unibyte string containing a single byte of -character data, @var{character}. It signals an error if -@var{character} is not an integer between 0 and 255. +character data, @var{byte}. It signals an error if @var{byte} is not +an integer between 0 and 255. @end defun @defun multibyte-char-to-unibyte char