[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/satchel a6f72c3e1c 6/9: Do the fanny dance
From: |
ELPA Syncer |
Subject: |
[elpa] externals/satchel a6f72c3e1c 6/9: Do the fanny dance |
Date: |
Tue, 22 Feb 2022 16:57:52 -0500 (EST) |
branch: externals/satchel
commit a6f72c3e1c993f3898476a818d5025146053ac8f
Author: Theodor Thornhill <theo@thornhill.no>
Commit: Theodor Thornhill <theo@thornhill.no>
Do the fanny dance
---
fannypack.el | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/fannypack.el b/fannypack.el
index 45bc07e40b..3a640532d9 100644
--- a/fannypack.el
+++ b/fannypack.el
@@ -48,13 +48,17 @@
"Where the fannypacks will be saved."
:type 'string)
+(defvar fannypack--default-directory nil
+ "Default directory override.")
+
(defun fannypack--ensure-directory ()
(make-directory (file-truename fannypack-directory) t))
(defun fannypack--name ()
(cl-flet ((normalize (file-name)
(string-replace "/" "---" file-name)))
- (let ((default-directory (project-root (project-current t))))
+ (let ((default-directory (or fannypack--default-directory
+ (project-root (project-current t)))))
(file-truename
(concat fannypack-directory
(concat
@@ -114,8 +118,11 @@
;;;###autoload
(defun fannypack-feeling-lucky (fannypack)
- (interactive (list (caar (fannypack--read))))
- (find-file fannypack))
+ (interactive
+ (list (caar (remove (list buffer-file-name) (fannypack--read)))))
+ (if fannypack
+ (find-file fannypack)
+ (user-error "Fannypack is empty!")))
;;;###autoload
(defun fannypack-burn ()
@@ -164,5 +171,15 @@
(message "Demoted %s to bottom in fannypack"
(file-name-nondirectory (car entry)))))
+;;;###autoload
+(defun fannypack-default-directory (arg)
+ (interactive "P")
+ (setq fannypack--default-directory
+ (cond
+ ((equal arg '(4))
+ (project-root (project-current t)))
+ ((equal arg '(16))
+ (read-file-name "Default fannypack: " nil default-directory
'mustmatch)))))
+
(provide 'fannypack)
;;; fannypack.el ends here
- [elpa] branch externals/satchel created (now d27a006d33), ELPA Syncer, 2022/02/22
- [elpa] externals/satchel 2514ae9c2b 3/9: Cleaning the fannypack, ELPA Syncer, 2022/02/22
- [elpa] externals/satchel e9f5146e79 2/9: Feelin' lucky, ELPA Syncer, 2022/02/22
- [elpa] externals/satchel 8481917960 4/9: Fanny the default-directory, ELPA Syncer, 2022/02/22
- [elpa] externals/satchel 2f14e833a6 5/9: Require project.el, ELPA Syncer, 2022/02/22
- [elpa] externals/satchel a6f72c3e1c 6/9: Do the fanny dance,
ELPA Syncer <=
- [elpa] externals/satchel 26a5ef383a 8/9: Rename to satchel, ELPA Syncer, 2022/02/22
- [elpa] externals/satchel 3ad0a7968d 1/9: Fannypack, go!, ELPA Syncer, 2022/02/22
- [elpa] externals/satchel 90d2ad1deb 7/9: Add some docs to the defuns, ELPA Syncer, 2022/02/22
- [elpa] externals/satchel d27a006d33 9/9: Flesh out the readme a little more, ELPA Syncer, 2022/02/22