[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/satchel e9f5146e79 2/9: Feelin' lucky
From: |
ELPA Syncer |
Subject: |
[elpa] externals/satchel e9f5146e79 2/9: Feelin' lucky |
Date: |
Tue, 22 Feb 2022 16:57:52 -0500 (EST) |
branch: externals/satchel
commit e9f5146e794e9965a7cf1266389ddb1066cc62f6
Author: Theodor Thornhill <theo@thornhill.no>
Commit: Theodor Thornhill <theo@thornhill.no>
Feelin' lucky
---
fannypack.el | 69 ++++++++++++++++++++++++++++++------------------------------
1 file changed, 35 insertions(+), 34 deletions(-)
diff --git a/fannypack.el b/fannypack.el
index 19959f03c3..26a99744d7 100644
--- a/fannypack.el
+++ b/fannypack.el
@@ -51,8 +51,8 @@
(make-directory (file-truename fannypack-directory) t))
(defun fannypack--name ()
- (cl-flet* ((normalize (file-name)
- (string-replace "/" "---" file-name)))
+ (cl-flet ((normalize (file-name)
+ (string-replace "/" "---" file-name)))
(file-truename
(concat fannypack-directory
(concat
@@ -61,13 +61,13 @@
(normalize (car (vc-git-branches))))))))
(defun fannypack--read-fannypack ()
- (let* ((filename (fannypack--name)))
+ (let ((filename (fannypack--name)))
(when (file-exists-p filename)
(with-temp-buffer
(insert-file-contents filename)
(read (current-buffer))))))
-(defun fannypack--write-fannypack (fannypack)
+(defun fannypack--persist (fannypack)
(let ((filename (fannypack--name)))
(with-temp-buffer
(insert ";;; -*- lisp-data -*-\n")
@@ -91,62 +91,63 @@
(let ((fannypack (fannypack--read-fannypack)))
(unless (member (list buffer-file-name) fannypack)
(push (list buffer-file-name) fannypack)
- (fannypack--write-fannypack fannypack)
+ (fannypack--persist fannypack)
(message "Placed in fannypack!"))))
;;;###autoload
(defun fannypack-pick ()
(interactive)
- (when-let ((choice
- (fannypack--completing-read
- "Fannypack pick [%s]: "
- (remove (list buffer-file-name)
- (fannypack--read-fannypack)))))
- (find-file choice)))
+ (find-file
+ (fannypack--completing-read
+ "Fannypack pick [%s]: "
+ (remove (list buffer-file-name)
+ (fannypack--read-fannypack)))))
;;;###autoload
-(defun fannypack-drop ()
- (interactive)
- (when-let* ((fannypack (fannypack--read-fannypack))
- (element
+(defun fannypack-feeling-lucky (fannypack)
+ (interactive (list (caar (fannypack--read-fannypack))))
+ (find-file fannypack))
+
+;;;###autoload
+(defun fannypack-drop (fannypack)
+ (interactive (list (fannypack--read-fannypack)))
+ (when-let* ((entry
(list
(fannypack--completing-read
"Fannypack drop [%s]: "
fannypack))))
- (setq fannypack (remove element fannypack))
- (fannypack--write-fannypack fannypack)
+ (setq fannypack (remove entry fannypack))
+ (fannypack--persist fannypack)
(message "Dropped %s from fannypack"
- (file-name-nondirectory (car element)))))
+ (file-name-nondirectory (car entry)))))
;;;###autoload
-(defun fannypack-promote ()
- (interactive)
- (let* ((fannypack (fannypack--read-fannypack))
- (element-to-move
+(defun fannypack-promote (fannypack)
+ (interactive (list (fannypack--read-fannypack)))
+ (let* ((entry
(list
(fannypack--completing-read
"Fannypack promote [%s]: "
fannypack))))
- (setq fannypack (remove element-to-move fannypack))
- (push element-to-move fannypack)
- (fannypack--write-fannypack fannypack)
+ (setq fannypack (remove entry fannypack))
+ (push entry fannypack)
+ (fannypack--persist fannypack)
(message "Promoted %s to top in fannypack"
- (file-name-nondirectory (car element-to-move)))))
+ (file-name-nondirectory (car entry)))))
;;;###autoload
-(defun fannypack-demote ()
- (interactive)
- (let* ((fannypack (fannypack--read-fannypack))
- (element-to-move
+(defun fannypack-demote (fannypack)
+ (interactive (list (fannypack--read-fannypack)))
+ (let* ((entry
(list
(fannypack--completing-read
"Fannypack demote [%s]: "
fannypack))))
- (setq fannypack (remove element-to-move fannypack))
- (setq fannypack (append fannypack (list element-to-move)))
- (fannypack--write-fannypack fannypack)
+ (setq fannypack (remove entry fannypack))
+ (setq fannypack (append fannypack (list entry)))
+ (fannypack--persist fannypack)
(message "Demoted %s to bottom in fannypack"
- (file-name-nondirectory (car element-to-move)))))
+ (file-name-nondirectory (car entry)))))
(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 <=
- [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, 2022/02/22
- [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