Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
d10a551d
Commit
d10a551d
authored
Jun 19, 2014
by
Stefan Monnier
Browse files
* lisp/international/mule-util.el (truncate-string-ellipsis): New var.
(truncate-string-to-width): Use it.
parent
96db0055
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
2 deletions
+12
-2
etc/NEWS
etc/NEWS
+2
-0
lisp/ChangeLog
lisp/ChangeLog
+5
-0
lisp/international/mule-util.el
lisp/international/mule-util.el
+5
-2
No files found.
etc/NEWS
View file @
d10a551d
...
...
@@ -46,6 +46,8 @@ Use './configure PKG_CONFIG=/full/name/of/pkg-config' if you need to.
*
Changes
in
Emacs
24.5
**
New
var
`
truncate
-
string
-
ellipsis
' to choose how to indicate truncation.
---
** The default value of `history-length'
has
increased
to
100.
...
...
lisp/ChangeLog
View file @
d10a551d
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.
...
...
lisp/international/mule-util.el
View file @
d10a551d
...
...
@@ -56,6 +56,9 @@
(
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
)
...
...
@@ -80,11 +83,11 @@ If ELLIPSIS is non-nil, it should be a string which will replace the
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
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment