]> git.eshelyaron.com Git - emacs.git/commitdiff
stop describe-personal-keybindings adding trailing space
authorAdam Spiers <emacs@adamspiers.org>
Wed, 5 Feb 2014 16:19:56 +0000 (16:19 +0000)
committerAdam Spiers <emacs@adamspiers.org>
Wed, 5 Feb 2014 16:19:56 +0000 (16:19 +0000)
When emacs is configured to highlight trailing whitespace,
the *Personal Keybindings* buffer looked pretty ugly.
This fixes that.

lisp/use-package/bind-key.el

index 68146c05c2ac7e6aaa5161b42edf5eeb875b078f..36de06023dc4fd83ddb5394f3e8c75cc3d14b10f 100644 (file)
                                       (get-binding-description was-command)))
                (at-present-desc (get-binding-description at-present))
                )
-          (princ
-           (format
-            "%-18s%-40s%s\n"
-            key-name (format "`%s\'" command-desc)
-            (if (string= command-desc at-present-desc)
-                (if (or (null was-command)
-                        (string= command-desc was-command-desc))
-                    ""
-                  (format "was `%s\'" was-command-desc))
-              (format "[now: `%s\']" at-present)))))
+          (let ((line
+                 (format
+                  "%-18s%-40s%s\n"
+                  key-name (format "`%s\'" command-desc)
+                  (if (string= command-desc at-present-desc)
+                      (if (or (null was-command)
+                              (string= command-desc was-command-desc))
+                          ""
+                        (format "was `%s\'" was-command-desc))
+                    (format "[now: `%s\']" at-present)))))
+            (princ (if (string-match "[ \t]+\n" line)
+                       (replace-match "\n" t t line)
+                     line))))
 
         (setq last-binding binding)))))