summaryrefslogtreecommitdiff
path: root/lisp/ruler-mode.el
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2017-11-04 15:00:25 +0200
committerEli Zaretskii <eliz@gnu.org>2017-11-04 15:00:25 +0200
commitbd886c6f566cb1e79e388305f8be05e55753b730 (patch)
tree7e5f7161a7f0e6398de42b94b79385d5b183be1a /lisp/ruler-mode.el
parente973c5f5f43ad4d6c98995eea269509b8a258781 (diff)
downloademacs-bd886c6f566cb1e79e388305f8be05e55753b730.tar.gz
Allow 'make-string' callers force creation of multibyte strings
* src/alloc.c (Fmake_string): Accept additional argument MULTIBYTE, and produce a multibyte string if it is non-nil. (make_event_array): * src/lread.c (read0): * src/editfns.c (Ftranslate_region_internal): * src/coding.c (Fdefine_coding_system_internal): * src/cmds.c (internal_self_insert): * src/xdisp.c (build_desired_tool_bar_string) (store_mode_line_string): All C callers changed. * doc/lispref/strings.texi (Creating Strings): Document the new optional argument. * etc/NEWS: Mention the new optional argument. * lisp/ruler-mode.el (ruler-mode-ruler): Call make-string with the 3rd argument non-nil.
Diffstat (limited to 'lisp/ruler-mode.el')
-rw-r--r--lisp/ruler-mode.el26
1 files changed, 12 insertions, 14 deletions
diff --git a/lisp/ruler-mode.el b/lisp/ruler-mode.el
index 3d27858d0fe..cac91e421e0 100644
--- a/lisp/ruler-mode.el
+++ b/lisp/ruler-mode.el
@@ -709,20 +709,18 @@ Optional argument PROPS specifies other text properties to apply."
;; Create an "clean" ruler.
(ruler
(propertize
- ;; FIXME: `make-string' returns a unibyte string if it's ASCII-only,
- ;; which prevents further `aset' from inserting non-ASCII chars,
- ;; hence the need for `string-to-multibyte'.
- ;; https://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00841.html
- (string-to-multibyte
- ;; Make the part of header-line corresponding to the
- ;; line-number display be blank, not filled with
- ;; ruler-mode-basic-graduation-char.
- (if display-line-numbers
- (let* ((lndw (round (line-number-display-width 'columns)))
- (s (make-string lndw ?\s)))
- (concat s (make-string (- w lndw)
- ruler-mode-basic-graduation-char)))
- (make-string w ruler-mode-basic-graduation-char)))
+ ;; Make the part of header-line corresponding to the
+ ;; line-number display be blank, not filled with
+ ;; ruler-mode-basic-graduation-char.
+ (if display-line-numbers
+ (let* ((lndw (round (line-number-display-width 'columns)))
+ ;; We need a multibyte string here so we could
+ ;; later use aset to insert multibyte characters
+ ;; into that string.
+ (s (make-string lndw ?\s t)))
+ (concat s (make-string (- w lndw)
+ ruler-mode-basic-graduation-char t)))
+ (make-string w ruler-mode-basic-graduation-char t))
'face 'ruler-mode-default
'local-map ruler-mode-map
'help-echo (cond