completions-detailed nil
completion-styles '(orderless partial-completion basic)
completion-show-help nil
- completions-header-format (propertize "%s candidates:\n" 'face 'shadow)
+ completions-header-format nil
completion-auto-help 'visual
completions-max-height 16
completion-auto-wrap t
;; use relative line numbers
display-line-numbers-type 'relative
;; persist Git commit message history
- savehist-additional-variables '(log-edit-comment-ring
- esy/project-name-history)
+ savehist-additional-variables '(log-edit-comment-ring)
;; IRC stuff
rcirc-default-nick "eshel"
rcirc-server-alist '(("irc.libera.chat"
(defvar esy/projects-directory "~/checkouts/")
- (defun esy/project-names ()
- "Return an alist of known project names and their root directories."
- (mapcar (lambda (dir)
- (cons (project-name (project-current nil dir)) dir))
- (project-known-project-roots)))
-
(defun esy/read-project-by-name ()
- "Read a known project name and return its root directory."
- (let* ((name-dir-alist (esy/project-names))
+ "Read a project name and return its root directory.
+
+If no known project matches the selected name, prompt for a
+sub-directory of `esy/projects-directory' using the selected name
+as the initial input for completion, and return that directory."
+ (let* ((name-dir-alist
+ (mapcar (lambda (dir)
+ (cons (project-name (project-current nil dir))
+ dir))
+ (project-known-project-roots)))
(current (project-current))
(default (and current (project-name current)))
(name (completing-read (format-prompt "Project" default)
(let* ((dir (read-directory-name "Project root directory: "
esy/projects-directory
nil t name))
- (dir-project (project-current nil dir)))
- (when dir-project
- (project-remember-project dir-project))
+ (project (project-current nil dir)))
+ (when project (project-remember-project project))
dir))))))
(esy/init-step sql