Function: toolbarx-make-string-from-symbol

toolbarx-make-string-from-symbol is a byte-compiled function defined in toolbar-x.el.

Signature

(toolbarx-make-string-from-symbol SYMBOL)

Documentation

Return a string from the name of a SYMBOL.

Upcase initials and replace dashes by spaces.

Source Code

;; Defined in ~/.emacs.d/elpa/auctex-14.1.2/toolbar-x.el
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; First engine: Parsing buttons

;; it obtains button information, process it and stores result in
;; `toolbarx-internal-button-switches', which is a list with 1st
;; element the symbol `:switches', the 2nd element as a list of
;; processed buttons, and the 3rd element is used for Emacs to store
;; the keys used in ``constant'' buttons.

;; The 2nd element of `toolbarx-internal-button-switches' is a list
;; where each element is either:
;;  * a button-list, that is, a list with elements to define a button.
;;  * a list where 1st elem is `:insert' and 2nd is a form, and the
;; following elements are in the same format of the 2nd element of
;; `toolbarx-internal-button-switches'.

(defun toolbarx-make-string-from-symbol (symbol)
  "Return a string from the name of a SYMBOL.
Upcase initials and replace dashes by spaces."
  (let* ((str (upcase-initials (symbol-name symbol)))
         (str2))
    (dolist (i (append str nil))
      (if (eq i 45)                     ; if dash, push space
          (push 32 str2)
        (push i str2)))                 ; else push identical
    (concat (nreverse str2))))