Date: Fri, 5 Apr 2019 20:11:33 +0200
From: Ergus <address@hidden>
Cc: address@hidden
> (if (eq (aref (car (internal-char-font nil ?│)) 0)
> w(face-font 'default))
> ;; can use the default font for U+2502
>
>(But we should use the actual value of
>display-fill-column-indicator-char instead of the literal character.)
>
>WDYT?
Actually this is what we have now:
(define-minor-mode display-fill-column-indicator-mode
"Toggle display fill column indicator.
This uses `display-fill-column-indicator' internally.
To change the position of the column displayed by default,
customize `display-fill-column-indicator-column' you can change the
character for the indicator setting `display-fill-column-indicator-character'."
:lighter nil
(if display-fill-column-indicator-mode
(progn
(setq display-fill-column-indicator t)
(unless display-fill-column-indicator-character
(if (char-displayable-p ?\u2502)
(setq display-fill-column-indicator-character ?\u2502)
(setq display-fill-column-indicator-character ?|))))
(setq display-fill-column-indicator nil)))
I think we only need to extend the inner if with your condition, but I
got an error because (internal-char-font nil ?│) always return nil in a
terminal and aref has issues with that.
For terminal frames, char-displayable-p is okay and should be left
alone as the only test there. The test I proposed is only needed for
GUI frames.
In a gui I get this error:
Debugger entered--Lisp error: (wrong-type-argument arrayp #<font-object
"-1ASC-Liberation Mono-normal-normal-normal-*-15-*-*-*-*-0-iso10646-1">)
aref(#<font-object "-1ASC-Liberation
Mono-normal-normal-normal-*-15-*-*-*-*-0-iso10646-1"> 0)
eval((aref (car (internal-char-font nil 9474)) 0) nil)
Oops, sorry, I copied the wrong expression. This is the correct one:
(aref (query-font (car (internal-char-font nil ?│))) 0)
Btw, there could be a problem when the mode is turned on on a GUI
frame, where '│' can be displayed OK, and then a TTY frame is created
in the same session, where that character cannot be displayed. I
wonder how to deal with this issue.