[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master ea5ed74 1/4: Avoid trailing whitespace in snippet tables
From: |
Noam Postavsky |
Subject: |
[elpa] master ea5ed74 1/4: Avoid trailing whitespace in snippet tables |
Date: |
Sun, 03 Apr 2016 16:10:13 +0000 |
branch: master
commit ea5ed74fb2844a71f15885db415a6205572f0c07
Author: USAMI Kenta <address@hidden>
Commit: Noam Postavsky <address@hidden>
Avoid trailing whitespace in snippet tables
* yasnippet.el (yas-describe-tables, yas--describe-pretty-table): Remove
redundant tail spaces from output.
Copyright-paperwork-exempt: yes
---
yasnippet.el | 37 ++++++++++++++++++++-----------------
1 files changed, 20 insertions(+), 17 deletions(-)
diff --git a/yasnippet.el b/yasnippet.el
index b68389f..428770c 100644
--- a/yasnippet.el
+++ b/yasnippet.el
@@ -2660,7 +2660,7 @@ and `kill-buffer' instead."
(setq buffer-read-only nil)
(erase-buffer)
(cond ((not by-name-hash)
- (insert "YASnippet tables: \n")
+ (insert "YASnippet tables:\n")
(while (and table-lists
continue)
(dolist (table (car table-lists))
@@ -2716,19 +2716,21 @@ and `kill-buffer' instead."
(setq group (truncate-string-to-width group 25 0 ? "..."))
(insert (make-string 100 ?-) "\n")
(dolist (p templates)
- (let ((name (truncate-string-to-width (propertize (format
"\\\\snippet `%s'" (yas--template-name p))
- 'yasnippet p)
- 50 0 ? "..."))
- (group (prog1 group
- (setq group (make-string (length group) ? ))))
- (condition-string (let ((condition (yas--template-condition
p)))
- (if (and condition
- original-buffer)
- (with-current-buffer original-buffer
- (if (yas--eval-condition condition)
- "(y)"
- "(s)"))
- "(a)"))))
+ (let* ((name (truncate-string-to-width (propertize (format
"\\\\snippet `%s'" (yas--template-name p))
+ 'yasnippet p)
+ 50 0 ? "..."))
+ (group (prog1 group
+ (setq group (make-string (length group) ? ))))
+ (condition-string (let ((condition (yas--template-condition
p)))
+ (if (and condition
+ original-buffer)
+ (with-current-buffer original-buffer
+ (if (yas--eval-condition condition)
+ "(y)"
+ "(s)"))
+ "(a)")))
+ (key-description-string (key-description
(yas--template-keybinding p)))
+ (template-key-padding (if (string= key-description-string
"") nil ? )))
(insert group " ")
(insert condition-string " ")
(insert name
@@ -2737,9 +2739,10 @@ and `kill-buffer' instead."
" ")
" ")
(insert (truncate-string-to-width (or (yas--template-key p) "")
- 15 0 ? "...") " ")
- (insert (truncate-string-to-width (key-description
(yas--template-keybinding p))
- 15 0 ? "...") " ")
+ 15 0 template-key-padding "...")
+ (if template-key-padding (byte-to-string
template-key-padding) ""))
+ (insert (truncate-string-to-width key-description-string
+ 15 0 nil "..."))
(insert "\n"))))
groups-hash)))