From ceea647c72cac582126688c71e19e4c9f9137a63 Mon Sep 17 00:00:00 2001 From: Alex Kost Date: Tue, 17 Nov 2015 22:19:14 +0300 Subject: emacs: Simplify defining parameter titles. * emacs/guix-utils.el (guix-symbol-title): New procedure. * emacs/guix-base.el (guix-get-param-title): Use it. (guix-param-titles): Remove most titles as they are automatically defined by 'guix-symbol-title'. --- emacs/guix-utils.el | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'emacs/guix-utils.el') diff --git a/emacs/guix-utils.el b/emacs/guix-utils.el index 5a0cad4f2a..e24b58fb17 100644 --- a/emacs/guix-utils.el +++ b/emacs/guix-utils.el @@ -165,6 +165,15 @@ This function is similar to `shell-quote-argument', but less strict." (replace-regexp-in-string (rx (not (any alnum "-=,./\n"))) "\\\\\\&" argument)))) +(defun guix-symbol-title (symbol) + "Return SYMBOL's name, a string. +This is like `symbol-name', but fancier." + (if (eq symbol 'id) + "ID" + (let ((str (replace-regexp-in-string "-" " " (symbol-name symbol)))) + (concat (capitalize (substring str 0 1)) + (substring str 1))))) + (defun guix-command-symbol (&optional args) "Return symbol by concatenating 'guix' and ARGS (strings)." (intern (guix-concat-strings (cons "guix" args) "-"))) -- cgit v1.2.3