+2014-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * international/mule-util.el (truncate-string-ellipsis): New var.
+ (truncate-string-to-width): Use it.
+
2014-06-19 Robert Brown <robert.brown@gmail.com> (tiny change)
* emacs-lisp/lisp-mode.el (lisp-string-after-doc-keyword-p): New fun.
(setq i (1+ i)))))
string)
+(defvar truncate-string-ellipsis "..." ;"…"
+ "String to use to indicate truncation.")
+
;;;###autoload
(defun truncate-string-to-width (str end-column
&optional start-column padding ellipsis)
end of STR (including any padding) if it extends beyond END-COLUMN,
unless the display width of STR is equal to or less than the display
width of ELLIPSIS. If it is non-nil and not a string, then ELLIPSIS
-defaults to \"...\"."
+defaults to `truncate-string-ellipsis'."
(or start-column
(setq start-column 0))
(when (and ellipsis (not (stringp ellipsis)))
- (setq ellipsis "..."))
+ (setq ellipsis truncate-string-ellipsis))
(let ((str-len (length str))
(str-width (string-width str))
(ellipsis-len (if ellipsis (length ellipsis) 0))