Function: majutsu-workspace--read-add-destination

majutsu-workspace--read-add-destination is a natively compiled function defined in majutsu-workspace.el.

Signature

(majutsu-workspace--read-add-destination ROOT NAME)

Documentation

Read a sibling destination for a new workspace named NAME at ROOT.

The initial input is "PREFIX_NAME", where PREFIX is the basename of ROOT up to its first underscore. Slashes in NAME are replaced with dashes.

Source Code

;; Defined in /nix/store/jagqw3nms546pad0gxi5f3wsckk6pji7-emacs-packages-deps/share/emacs/site-lisp/majutsu-workspace.el
(defun majutsu-workspace--read-add-destination (root name)
  "Read a sibling destination for a new workspace named NAME at ROOT.
The initial input is \"PREFIX_NAME\", where PREFIX is the basename of
ROOT up to its first underscore.  Slashes in NAME are replaced with dashes."
  (let* ((path (directory-file-name root))
         (basename (file-name-nondirectory path))
         (prefix (if (string-match "_" basename)
                     (substring basename 0 (match-beginning 0))
                   basename)))
    (read-directory-name
     "Create workspace at: " (file-name-directory path) nil nil
     (concat prefix "_"
             (unless (string-empty-p name)
               (string-replace "/" "-" name))))))