Function: custom-unlispify-menu-entry

custom-unlispify-menu-entry is a byte-compiled function defined in cus-edit.el.gz.

Signature

(custom-unlispify-menu-entry SYMBOL &optional NO-SUFFIX)

Documentation

Convert SYMBOL into a menu entry.

Source Code

;; Defined in /usr/src/emacs/lisp/cus-edit.el.gz
(defun custom-unlispify-menu-entry (symbol &optional no-suffix)
  "Convert SYMBOL into a menu entry."
  (cond ((not custom-unlispify-menu-entries)
	 (symbol-name symbol))
	((get symbol 'custom-tag)
	 (if no-suffix
	     (get symbol 'custom-tag)
	   (concat (get symbol 'custom-tag) "...")))
	(t
	 (with-current-buffer (get-buffer-create " *Custom-Work*")
	   (erase-buffer)
	   (princ symbol (current-buffer))
	   (goto-char (point-min))
	   (if custom-unlispify-remove-prefixes
	       (let ((prefixes custom-prefix-list)
		     prefix)
		 (while prefixes
		   (setq prefix (car prefixes))
		   (if (search-forward prefix (+ (point) (length prefix)) t)
		       (progn
			 (setq prefixes nil)
			 (delete-region (point-min) (point)))
		     (setq prefixes (cdr prefixes))))))
	   (goto-char (point-min))
           ;; Translate characters commonly used as delimiters between
           ;; words in symbols into space; e.g. foo:bar-zot/thing.
	   (while (re-search-forward "[-:/]+" nil t)
	     (replace-match " "))
	   (capitalize-region (point-min) (point-max))
	   (unless no-suffix
	     (goto-char (point-max))
	     (insert "..."))
	   (propertize (buffer-string) 'custom-data symbol)))))