commit df2f6fb7fc4b79834ae40db8be2ccdc1e4a273f1 (HEAD, refs/remotes/origin/master) Author: Eli Zaretskii Date: Sun Aug 28 08:57:13 2022 +0300 ; Autoload 'latin1-display-ucs-per-lynx' * lisp/international/latin1-disp.el (latin1-display-ucs-per-lynx): Autoload it, since we autoload 'latin1-display'. diff --git a/lisp/international/latin1-disp.el b/lisp/international/latin1-disp.el index af75192793..4de1d6084f 100644 --- a/lisp/international/latin1-disp.el +++ b/lisp/international/latin1-disp.el @@ -756,6 +756,7 @@ use either \\[customize] or the function `latin1-display'." (latin1-display-ucs-per-lynx 1) (latin1-display-ucs-per-lynx -1)))) +;;;###autoload (defun latin1-display-ucs-per-lynx (arg) "Set up Latin-1/ASCII display for Unicode characters. This uses the transliterations of the Lynx browser. commit d704c61e25b5498fb7971187789956b9646b94f5 Author: Po Lu Date: Sun Aug 28 12:02:43 2022 +0800 Fix two issues in xterm.c * src/xterm.c (x_atom_refs): Make EMACS_SERVER_TIME_PROP atom have a vendor-specific prefix. (x_query_pointer_1): Fix leak of button mask. diff --git a/src/xterm.c b/src/xterm.c index e7f5525502..7a0a21b136 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -952,7 +952,7 @@ static const struct x_atom_ref x_atom_refs[] = ATOM_REFS_INIT ("MULTIPLE", Xatom_MULTIPLE) ATOM_REFS_INIT ("INCR", Xatom_INCR) ATOM_REFS_INIT ("_EMACS_TMP_", Xatom_EMACS_TMP) - ATOM_REFS_INIT ("EMACS_SERVER_TIME_PROP", Xatom_EMACS_SERVER_TIME_PROP) + ATOM_REFS_INIT ("_EMACS_SERVER_TIME_PROP", Xatom_EMACS_SERVER_TIME_PROP) ATOM_REFS_INIT ("TARGETS", Xatom_TARGETS) ATOM_REFS_INIT ("NULL", Xatom_NULL) ATOM_REFS_INIT ("ATOM", Xatom_ATOM) @@ -13520,6 +13520,8 @@ x_query_pointer_1 (struct x_display_info *dpyinfo, xi_convert_button_state (&buttons, &state); *mask_return = state | modifiers.effective; + XFree (buttons.mask); + *root_x_return = lrint (root_x); *root_y_return = lrint (root_y); *win_x_return = lrint (win_x); commit 3f076a8e44b652691ffd4a2a07b04ab956ed4668 Author: Juri Linkov Date: Sat Aug 27 22:52:03 2022 +0300 Use truncated-partial-width-window-p in more places (bug#56815) * lisp/simple.el (line-move, line-move-finish): Use truncated-partial-width-window-p. * lisp/window.el (count-screen-lines, scroll-command--goto-goal-column): Use truncated-partial-width-window-p. (truncated-partial-width-window-p): Replace window-width with window-total-width. * src/indent.c (scan_for_column): Bring the logic of using truncated-partial-width-window-p closer to what the display engine does. diff --git a/lisp/simple.el b/lisp/simple.el index d18d54ce16..ceb29b1e30 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -7700,13 +7700,7 @@ not vscroll." ;; Lines are not truncated... (not (and - (or truncate-lines - (and (integerp truncate-partial-width-windows) - (< (window-total-width) - truncate-partial-width-windows)) - (and truncate-partial-width-windows - (not (integerp truncate-partial-width-windows)) - (not (window-full-width-p)))) + (or truncate-lines (truncated-partial-width-window-p)) ;; ...or if lines are truncated, this buffer ;; doesn't have very long lines. (long-line-optimizations-p))) @@ -7718,13 +7712,7 @@ not vscroll." ;; Lines aren't truncated. (not (and - (or truncate-lines - (and (integerp truncate-partial-width-windows) - (< (window-total-width) - truncate-partial-width-windows)) - (and truncate-partial-width-windows - (not (integerp truncate-partial-width-windows)) - (not (window-full-width-p)))) + (or truncate-lines (truncated-partial-width-window-p)) (long-line-optimizations-p))) ;; When the text in the window is scrolled to the left, ;; display-based motion doesn't make sense (because each @@ -7985,7 +7973,7 @@ If NOERROR, don't signal an error if we can't move that many lines." ;; Move to the desired column. (if (and line-move-visual - (not (or truncate-lines truncate-partial-width-windows))) + (not (or truncate-lines (truncated-partial-width-window-p)))) ;; Under line-move-visual, goal-column should be ;; interpreted in units of the frame's canonical character ;; width, which is exactly what vertical-motion does. diff --git a/lisp/window.el b/lisp/window.el index 4d88ffa903..db69379e69 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -9044,10 +9044,7 @@ in some window." ;; vertical-motion returns a number that is 1 larger than it ;; should. We need to fix that. (setq end-invisible-p - (and (or truncate-lines - (and (natnump truncate-partial-width-windows) - (< (window-total-width window) - truncate-partial-width-windows))) + (and (or truncate-lines (truncated-partial-width-window-p window)) (save-excursion (goto-char finish) (> (- (current-column) (window-hscroll window)) @@ -10140,7 +10137,7 @@ semipermanent goal column for this command." (when goal-column ;; Move to the desired column. (if (and line-move-visual - (not (or truncate-lines truncate-partial-width-windows))) + (not (or truncate-lines (truncated-partial-width-window-p)))) ;; Under line-move-visual, goal-column should be ;; interpreted in units of the frame's canonical character ;; width, which is exactly what vertical-motion does. @@ -10449,7 +10446,7 @@ Otherwise, consult the value of `truncate-partial-width-windows' (let ((t-p-w-w (buffer-local-value 'truncate-partial-width-windows (window-buffer window)))) (if (integerp t-p-w-w) - (< (window-width window) t-p-w-w) + (< (window-total-width window) t-p-w-w) t-p-w-w)))) diff --git a/src/indent.c b/src/indent.c index cb368024d9..aa905f387b 100644 --- a/src/indent.c +++ b/src/indent.c @@ -577,12 +577,15 @@ scan_for_column (ptrdiff_t *endpos, EMACS_INT *goalcol, if (!NILP (BVAR (current_buffer, truncate_lines))) lines_truncated = true; - else if (w && FIXNUMP (Vtruncate_partial_width_windows)) - lines_truncated = - w->total_cols < XFIXNAT (Vtruncate_partial_width_windows); - else if (w && !NILP (Vtruncate_partial_width_windows)) - lines_truncated = - w->total_cols < FRAME_COLS (XFRAME (WINDOW_FRAME (w))); + else if (!NILP (Vtruncate_partial_width_windows) && w + && w->total_cols < FRAME_COLS (XFRAME (WINDOW_FRAME (w)))) + { + if (FIXNUMP (Vtruncate_partial_width_windows)) + lines_truncated = + w->total_cols < XFIXNAT (Vtruncate_partial_width_windows); + else + lines_truncated = true; + } /* Special optimization for buffers with long and truncated lines: assumes that each character is a single column. */ if (lines_truncated) commit 0ab49d46ddbe27970c62a56597de000bc1c3232c Author: Juri Linkov Date: Sat Aug 27 22:43:40 2022 +0300 Use a list of text properties to search in symlink filenames in Wdired * lisp/dired-aux.el (dired-isearch-search-filenames): Use text properties 'dired-filename' and 'dired-symlink-filename'. * lisp/dired.el (dired-font-lock-keywords): Add text property 'dired-symlink-filename' on symlinks. * lisp/isearch.el (isearch-search-fun-in-text-property): Support a list of text properties (bug#57293). diff --git a/etc/NEWS b/etc/NEWS index 1fd05d7dcc..1317cd0128 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2023,7 +2023,10 @@ the buffer will take you to that directory. *** Search and replace in Dired/Wdired supports more regexps. For example, the regexp ".*" will match only characters that are part of the file name. Also "^.*$" can be used to match at the beginning -of the file name and at the end of the file name. +of the file name and at the end of the file name. This is used only +when searching on file names. In Wdired this can be used when the new +user option 'wdired-search-replace-filenames' is non-nil (which is the +default). ** Bookmarks diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 94b2baf72d..06f0b86fc4 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -3544,7 +3544,8 @@ Intended to be added to `isearch-mode-hook'." The returned function narrows the search to match the search string only as part of a file name enclosed by the text property `dired-filename'. It's intended to override the default search function." - (isearch-search-fun-in-text-property (funcall orig-fun) 'dired-filename)) + (isearch-search-fun-in-text-property + (funcall orig-fun) '(dired-filename dired-symlink-filename))) ;;;###autoload (defun dired-isearch-filenames () diff --git a/lisp/dired.el b/lisp/dired.el index f45d215ed6..fa06c8fd44 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -786,7 +786,7 @@ Subexpression 2 must end right before the \\n.") nil '(1 'dired-broken-symlink) '(2 dired-symlink-face) - '(3 'dired-broken-symlink))) + '(3 '(face dired-broken-symlink dired-symlink-filename t)))) ;; ;; Symbolic link to a directory. (list dired-re-sym @@ -798,7 +798,7 @@ Subexpression 2 must end right before the \\n.") '(dired-move-to-filename) nil '(1 dired-symlink-face) - '(2 dired-directory-face))) + '(2 '(face dired-directory-face dired-symlink-filename t)))) ;; ;; Symbolic link to a non-directory. (list dired-re-sym @@ -812,7 +812,7 @@ Subexpression 2 must end right before the \\n.") '(dired-move-to-filename) nil '(1 dired-symlink-face) - '(2 'default))) + '(2 '(face default dired-symlink-filename t)))) ;; ;; Sockets, pipes, block devices, char devices. (list dired-re-special diff --git a/lisp/isearch.el b/lisp/isearch.el index 31fcf01949..9f1fbb14a4 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -4512,21 +4512,35 @@ is a list of cons cells of the form (START . END)." (setq bounds (cdr bounds)))) found)))) -(defun isearch-search-fun-in-text-property (search-fun property) - "Return the function to search inside text that has the specified PROPERTY. +(defun isearch-search-fun-in-text-property (search-fun properties) + "Return the function to search inside text that has the specified PROPERTIES. The function will limit the search for matches only inside text which has -this property in the current buffer. +at least one of the text PROPERTIES. The argument SEARCH-FUN provides the function to search text, and defaults to the value of `isearch-search-fun-default' when nil." + (setq properties (ensure-list properties)) (apply-partially #'search-within-boundaries search-fun - (lambda (pos) (get-text-property (if isearch-forward pos - (max (1- pos) (point-min))) - property)) - (lambda (pos) (if isearch-forward - (next-single-property-change pos property) - (previous-single-property-change pos property))))) + (lambda (pos) + (let ((pos (if isearch-forward pos (max (1- pos) (point-min))))) + (seq-some (lambda (property) + (get-text-property pos property)) + properties))) + (lambda (pos) + (let ((pos-list (if isearch-forward + (mapcar (lambda (property) + (next-single-property-change + pos property)) + properties) + (mapcar (lambda (property) + (previous-single-property-change + pos property)) + properties)))) + (setq pos-list (delq nil pos-list)) + (when pos-list (if isearch-forward + (seq-min pos-list) + (seq-max pos-list))))))) (defun search-within-boundaries ( search-fun get-fun next-fun string &optional bound noerror count) commit f427b985a1857523412a846fcaa9082c87c0bbd1 Author: Lars Ingebrigtsen Date: Sat Aug 27 15:44:12 2022 +0200 Make dynamic info-lookup more backwards-compatible * lisp/info-look.el (info-lookup--expand-info): Don't try to expand elements that aren't functions (bug#57446). diff --git a/lisp/info-look.el b/lisp/info-look.el index 7f45f976a2..ce0a08dcbe 100644 --- a/lisp/info-look.el +++ b/lisp/info-look.el @@ -130,7 +130,8 @@ OTHER-MODES is a list of cross references to other help modes.") (defun info-lookup--expand-info (info) ;; We have a dynamic doc-spec function. (when (and (null (nth 3 info)) - (nth 6 info)) + (nth 6 info) + (functionp (nth 6 info))) (setf (nth 3 info) (funcall (nth 6 info)) (nth 6 info) nil)) info) commit 716441a069541ad4efe5eca773e2a41f04f540d1 Author: Daniel Martín Date: Sat Aug 27 15:28:34 2022 +0200 Fix webp detection on some Macos systems * configure.ac (HAVE_RSVG): Make webp detection work with Macos 10.3/Homebrew (bug#57420). diff --git a/configure.ac b/configure.ac index 6ca3052ea3..4590ed3506 100644 --- a/configure.ac +++ b/configure.ac @@ -2773,12 +2773,9 @@ if test "${with_webp}" != "no"; then || test "${HAVE_W32}" = "yes" || test "${HAVE_NS}" = "yes" \ || test "${HAVE_BE_APP}" = "yes" || test "${HAVE_PGTK}" = "yes"; then WEBP_REQUIRED=0.6.0 - WEBP_MODULE="libwebp >= $WEBP_REQUIRED" + WEBP_MODULE="libwebpdemux >= $WEBP_REQUIRED" EMACS_CHECK_MODULES([WEBP], [$WEBP_MODULE]) - if test "$HAVE_WEBP" = "yes"; then - WEBP_LIBS="-lwebp -lwebpdemux" - fi AC_SUBST([WEBP_CFLAGS]) AC_SUBST([WEBP_LIBS]) fi commit a2d62456a7b8da27fb9b64f71b6ce588f2d73287 Author: Eli Zaretskii Date: Sat Aug 27 14:06:15 2022 +0300 Fix regression with cursor motion in Magit buffers * lisp/simple.el (line-move): Condition movement optimizations on presence of very long lines. (Bug#57433) diff --git a/lisp/simple.el b/lisp/simple.el index ee765c8a57..d18d54ce16 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -7717,13 +7717,15 @@ not vscroll." (not goal-column) ;; Lines aren't truncated. (not - (or truncate-lines - (and (integerp truncate-partial-width-windows) - (< (window-width) - truncate-partial-width-windows)) - (and truncate-partial-width-windows - (not (integerp truncate-partial-width-windows)) - (not (window-full-width-p))))) + (and + (or truncate-lines + (and (integerp truncate-partial-width-windows) + (< (window-total-width) + truncate-partial-width-windows)) + (and truncate-partial-width-windows + (not (integerp truncate-partial-width-windows)) + (not (window-full-width-p)))) + (long-line-optimizations-p))) ;; When the text in the window is scrolled to the left, ;; display-based motion doesn't make sense (because each ;; logical line occupies exactly one screen line). commit 6b1ed2f2c99a1c2da56c5f434570c438cad6576d Author: Eli Zaretskii Date: Sat Aug 27 13:13:48 2022 +0300 Fix antialias face attribute when text is scaled This restores the code we had in realize_gui_face before commit bf0d3f7. The problem described in bug#17973, which led to that commit, only happens if one uses a specific (misc-fixed) font family, not for the usual default fonts used by Emacs, and I'm not sure what's described there is a bug at all. At least for the purposes of text-scale-adjust, it makes no sense to ignore the foundry/family/adstyle of the original font, because we _want_ the same (or very similar) font, just of a different size. And likely in other use cases: if the :font attribute of a face specifies some font properties, we want to keep them all, not arbitrarily to ignore some of them. And definitely catering to an obscure use case such as the one cited in bug#17973 is NOT a good reason to make such radical changes in face-realization behavior. So I think backing out that part of commit bf0d3f7 is TRT, and if we decide that this causes bug#17973 in too many situations we care about, I'd rather find a kludge for that specific case than do that for every face realization. * src/xfaces.c (realize_gui_face): Preserve face attributes when text is scaled. This reverts part of the changes installed in commit bf0d3f7. (Bug#37473) diff --git a/src/xfaces.c b/src/xfaces.c index bbc1d352c6..70d5cbeb4c 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -6012,8 +6012,7 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE] #ifdef HAVE_WINDOW_SYSTEM struct face *default_face; struct frame *f; - Lisp_Object stipple, underline, overline, strike_through, box, temp_spec; - Lisp_Object temp_extra, antialias; + Lisp_Object stipple, underline, overline, strike_through, box; eassert (FRAME_WINDOW_P (cache->f)); @@ -6055,28 +6054,8 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE] emacs_abort (); } if (! FONT_OBJECT_P (attrs[LFACE_FONT_INDEX])) - { - /* We want attrs to allow overriding most elements in the - spec (IOW, to start out as an empty font spec), but - preserve the antialiasing attribute. (bug#17973, - bug#37473). */ - temp_spec = Ffont_spec (0, NULL); - temp_extra = AREF (attrs[LFACE_FONT_INDEX], - FONT_EXTRA_INDEX); - /* If `:antialias' wasn't specified, keep it unspecified - instead of changing it to nil. */ - - if (CONSP (temp_extra)) - antialias = Fassq (QCantialias, temp_extra); - else - antialias = Qnil; - - if (FONTP (attrs[LFACE_FONT_INDEX]) && !NILP (antialias)) - Ffont_put (temp_spec, QCantialias, Fcdr (antialias)); - - attrs[LFACE_FONT_INDEX] - = font_load_for_lface (f, attrs, temp_spec); - } + attrs[LFACE_FONT_INDEX] + = font_load_for_lface (f, attrs, attrs[LFACE_FONT_INDEX]); if (FONT_OBJECT_P (attrs[LFACE_FONT_INDEX])) { face->font = XFONT_OBJECT (attrs[LFACE_FONT_INDEX]); commit d19c7042b21c6b1ba47cd4ecfb3f1938a6faabb7 Author: Mattias Engdegård Date: Sat Aug 27 12:00:31 2022 +0200 ; * etc/NEWS: typo diff --git a/etc/NEWS b/etc/NEWS index a2537235eb..1fd05d7dcc 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1512,7 +1512,7 @@ non-nil, the text will now be added to the Isearch instead. *** Changes for values 'no' and 'no-ding' of 'isearch-wrap-pause'. Now with these values the search will wrap around not only on repeating with 'C-s C-s', but also after typing a character. -1 + +++ *** New user option 'char-fold-override'. Non-nil means that the default definitions of equivalent characters commit 0f3780819558e12d121bc8cb5acac313909562ab Author: Alan Mackenzie Date: Sat Aug 27 09:33:52 2022 +0000 CC Mode: Remove double evaluation of self-quoting function in cc-langs.el This is a followup to Stefan Monnier's fix for bug #57065 from 2022-08-25. * lisp/progmodes/cc-langs.el (c-init-language-vars): Add a #' after the funcall. diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index 120949a5bc..068b4a65b2 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el @@ -4278,7 +4278,7 @@ This macro is expanded at compile time to a form tailored for the mode in question, so MODE must be a constant. Therefore MODE is not evaluated and should not be quoted." (declare (debug nil)) - `(funcall ,(c-make-init-lang-vars-fun mode))) + `(funcall #',(c-make-init-lang-vars-fun mode))) (cc-provide 'cc-langs) commit 56aa52c346d5317a9f228ca12d52d4c860c458b0 Author: Eli Zaretskii Date: Sat Aug 27 11:56:00 2022 +0300 Support "replacement characters" on TTY frames * src/nsterm.m (ns_draw_glyphless_glyph_string_foreground): * src/pgtkterm.c (pgtk_draw_glyphless_glyph_string_foreground): * src/haikuterm.c (haiku_draw_glyphless_glyph_string_foreground): * src/xterm.c (x_draw_glyphless_glyph_string_foreground): * src/w32term.c (w32_draw_glyphless_glyph_string_foreground): * src/xdisp.c (lookup_glyphless_char_display): Handle extra-slot of 'glyphless-char-display' that is a cons cell. (syms_of_xdisp) : Update doc string. * etc/NEWS: * doc/lispref/display.texi (Glyphless Chars): Document the new feature. * lisp/faces.el (glyphless-char): Make the face stand out on TTY frames that don't support the underline attribute. diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index bb2b2d98a3..a56f467e0b 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -8542,7 +8542,11 @@ hexadecimal notation. @item an @acronym{ASCII} string Display a box containing that string. The string should contain at -most 6 @acronym{ASCII} characters. +most 6 @acronym{ASCII} characters. As an exception, if the string +includes just one character, on text-mode terminals that character +will be displayed without a box; this allows to handle such +``acronyms'' as a replacement character for characters that cannot be +displayed by the terminal. @item a cons cell @code{(@var{graphical} . @var{text})} Display with @var{graphical} on graphical displays, and with diff --git a/etc/NEWS b/etc/NEWS index 9eeab7bb9a..a2537235eb 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1512,7 +1512,7 @@ non-nil, the text will now be added to the Isearch instead. *** Changes for values 'no' and 'no-ding' of 'isearch-wrap-pause'. Now with these values the search will wrap around not only on repeating with 'C-s C-s', but also after typing a character. - +1 +++ *** New user option 'char-fold-override'. Non-nil means that the default definitions of equivalent characters @@ -1525,11 +1525,24 @@ command accepts the Unicode name of an Emoji (for example, "smiling face" or "heart with arrow"), like 'C-x 8 e e', with minibuffer completion, and adds the Emoji into the search string. +** Glyphless characters + +++ -** New minor mode 'glyphless-display-mode'. +*** New minor mode 'glyphless-display-mode'. This allows an easy way to toggle seeing all glyphless characters in the current buffer. +*** The extra slot of 'glyphless-char-display' can now have cons values. +The extra slot of the 'glyphless-char-display' char-table can now have +values that are cons cells, specifying separate values for text-mode +and GUI terminals. + +*** "Replacement character" feature for undisplayable characters on TTYs. +The 'acronym' method of displaying glyphless characters on text-mode +frames treats single-character acronyms specially: they are displayed +without the surrounding [..] "box", thus in effect treating such +"acronyms" as replacement characters. + ** Registers +++ diff --git a/lisp/faces.el b/lisp/faces.el index 0246e038dd..336078b040 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -2978,7 +2978,7 @@ bindings. See also the face `tooltip'." :group 'help) (defface glyphless-char - '((((type tty)) :inherit underline) + '((((type tty)) :inherit escape-glyph :underline t) (((type pc)) :inherit escape-glyph) (t :height 0.6)) "Face for displaying non-graphic characters (e.g. U+202A (LRE)). diff --git a/src/haikuterm.c b/src/haikuterm.c index c2d4e34ba2..df1c39974f 100644 --- a/src/haikuterm.c +++ b/src/haikuterm.c @@ -1252,6 +1252,8 @@ haiku_draw_glyphless_glyph_string_foreground (struct glyph_string *s) ? CHAR_TABLE_REF (Vglyphless_char_display, glyph->u.glyphless.ch) : XCHAR_TABLE (Vglyphless_char_display)->extras[0]); + if (CONSP (acronym)) + acronym = XCAR (acronym); if (STRINGP (acronym)) str = SSDATA (acronym); } diff --git a/src/nsterm.m b/src/nsterm.m index e3f47eb905..6c6151701b 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -4241,6 +4241,8 @@ Function modeled after x_draw_glyph_string_box (). ? CHAR_TABLE_REF (Vglyphless_char_display, glyph->u.glyphless.ch) : XCHAR_TABLE (Vglyphless_char_display)->extras[0]); + if (CONSP (acronym)) + acronym = XCAR (acronym); if (STRINGP (acronym)) str = SSDATA (acronym); } diff --git a/src/pgtkterm.c b/src/pgtkterm.c index b283cef7cd..491ba33882 100644 --- a/src/pgtkterm.c +++ b/src/pgtkterm.c @@ -1584,6 +1584,8 @@ pgtk_draw_glyphless_glyph_string_foreground (struct glyph_string *s) ? CHAR_TABLE_REF (Vglyphless_char_display, glyph->u.glyphless.ch) : XCHAR_TABLE (Vglyphless_char_display)->extras[0]); + if (CONSP (acronym)) + acronym = XCAR (acronym); if (STRINGP (acronym)) str = SSDATA (acronym); } diff --git a/src/term.c b/src/term.c index 3bea621dbd..2e43d89232 100644 --- a/src/term.c +++ b/src/term.c @@ -1862,12 +1862,24 @@ produce_glyphless_glyph (struct it *it, Lisp_Object acronym) acronym = CHAR_TABLE_REF (Vglyphless_char_display, it->c); if (CONSP (acronym)) acronym = XCDR (acronym); - buf[0] = '['; str = STRINGP (acronym) ? SSDATA (acronym) : ""; - for (len = 0; len < 6 && str[len] && ASCII_CHAR_P (str[len]); len++) - buf[1 + len] = str[len]; - buf[1 + len] = ']'; - len += 2; + /* A special kludgey feature for single-character acronyms: + don't put them in a box, effectively treating them as a + replacement character. */ + if (STRINGP (acronym) && SCHARS (acronym) == 1) + { + buf[0] = str[0]; + len = 1; + } + else + { + buf[0] = '['; + for (len = 0; + len < 6 && str[len] && ASCII_CHAR_P (str[len]); len++) + buf[1 + len] = str[len]; + buf[1 + len] = ']'; + len += 2; + } } else { diff --git a/src/w32term.c b/src/w32term.c index d0577efccc..dff21489e5 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -1490,6 +1490,8 @@ w32_draw_glyphless_glyph_string_foreground (struct glyph_string *s) ? CHAR_TABLE_REF (Vglyphless_char_display, glyph->u.glyphless.ch) : XCHAR_TABLE (Vglyphless_char_display)->extras[0]); + if (CONSP (acronym)) + acronym = XCAR (acronym); if (STRINGP (acronym)) str = SSDATA (acronym); } diff --git a/src/xdisp.c b/src/xdisp.c index 86a119c0f6..70f6936dd0 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -7842,15 +7842,14 @@ lookup_glyphless_char_display (int c, struct it *it) && CHAR_TABLE_EXTRA_SLOTS (XCHAR_TABLE (Vglyphless_char_display)) >= 1) { if (c >= 0) - { - glyphless_method = CHAR_TABLE_REF (Vglyphless_char_display, c); - if (CONSP (glyphless_method)) - glyphless_method = FRAME_WINDOW_P (it->f) - ? XCAR (glyphless_method) - : XCDR (glyphless_method); - } + glyphless_method = CHAR_TABLE_REF (Vglyphless_char_display, c); else glyphless_method = XCHAR_TABLE (Vglyphless_char_display)->extras[0]; + + if (CONSP (glyphless_method)) + glyphless_method = FRAME_WINDOW_P (it->f) + ? XCAR (glyphless_method) + : XCDR (glyphless_method); } retry: @@ -37117,7 +37116,9 @@ GRAPHICAL and TEXT should each have one of the values listed above. The char-table has one extra slot to control the display of a character for which no font is found. This slot only takes effect on graphical terminals. Its value should be an ASCII acronym string, `hex-code', `empty-box', or -`thin-space'. The default is `empty-box'. +`thin-space'. It could also be a cons cell of any two of these, to specify +separate values for graphical and text terminals. +The default is `empty-box'. If a character has a non-nil entry in an active display table, the display table takes effect; in this case, Emacs does not consult diff --git a/src/xterm.c b/src/xterm.c index c716d07ada..e7f5525502 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -8316,6 +8316,8 @@ x_draw_glyphless_glyph_string_foreground (struct glyph_string *s) ? CHAR_TABLE_REF (Vglyphless_char_display, glyph->u.glyphless.ch) : XCHAR_TABLE (Vglyphless_char_display)->extras[0]); + if (CONSP (acronym)) + acronym = XCAR (acronym); if (STRINGP (acronym)) str = SSDATA (acronym); }