Function: tmm--shorten-space-width

tmm--shorten-space-width is a byte-compiled function defined in tmm.el.gz.

Signature

(tmm--shorten-space-width STR)

Documentation

Shorten the width between the menu entry and the keybinding by 2 spaces.

Source Code

;; Defined in /usr/src/emacs/lisp/tmm.el.gz
(defun tmm--shorten-space-width (str)
  "Shorten the width between the menu entry and the keybinding by 2 spaces."
  (let* ((start (next-single-property-change 0 'display str))
         (n (length str))
         (end (previous-single-property-change n 'display str))
         (curr-width (and start
                          (plist-get (get-display-property start 'space str) :width))))
    (when curr-width
      (put-text-property start end 'display (cons 'space (list :width (- curr-width 2))) str))
    str))