[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/detached 84154f8a6c: Update indentation and add style t
From: |
ELPA Syncer |
Subject: |
[elpa] externals/detached 84154f8a6c: Update indentation and add style target to Make |
Date: |
Mon, 7 Nov 2022 11:57:34 -0500 (EST) |
branch: externals/detached
commit 84154f8a6cfac56a4abb5ccd2b3ff236e86b6eed
Author: Niklas Eklund <niklas.eklund@posteo.net>
Commit: Niklas Eklund <niklas.eklund@posteo.net>
Update indentation and add style target to Make
---
.dir-locals.el | 1 -
Makefile | 3 ++
detached-eshell.el | 4 +--
detached-init.el | 2 +-
detached-list.el | 86 +++++++++++++++++++++++++++---------------------------
detached.el | 76 +++++++++++++++++++++++------------------------
6 files changed, 87 insertions(+), 85 deletions(-)
diff --git a/.dir-locals.el b/.dir-locals.el
index b7ef2fcc84..5383306d6c 100644
--- a/.dir-locals.el
+++ b/.dir-locals.el
@@ -1,3 +1,2 @@
((nil . ((compile-command . "guix shell bash emacs-minimal git texinfo -- make
all")))
- (prog-mode (eval flymake-mode))
(magit-status-mode (magit-todos-exclude-globs)))
diff --git a/Makefile b/Makefile
index a066eaa06f..3eaa55fc31 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,9 @@
byte-compile:
emacs --batch --load=detached.el --eval='(progn (setq
byte-compile-error-on-warn t) (batch-byte-compile))' ./*.el
+style:
+ emacs --batch --eval="(let ((make-backup-files nil) (files
(directory-files-recursively default-directory \"detached.*\.el\"))) (seq-do
(lambda (it) (find-file it) (indent-region (point-min) (point-max))
(save-buffer)) files))"
+
autoloads:
emacs --batch --eval='(progn (setq make-backup-files nil)
(make-directory-autoloads default-directory "detached-autoloads.el"))'
diff --git a/detached-eshell.el b/detached-eshell.el
index 7c3b22ce32..75209de39d 100644
--- a/detached-eshell.el
+++ b/detached-eshell.el
@@ -98,8 +98,8 @@ If prefix-argument directly DETACH from the session."
(defun detached-eshell--get-dtach-process ()
"Return `eshell' process if `detached' is running."
(when-let* ((process (and eshell-process-list (caar eshell-process-list))))
- (and (string= (process-name process) "dtach")
- process)))
+ (and (string= (process-name process) "dtach")
+ process)))
(defun detached-eshell--select-session ()
"Return selected session."
diff --git a/detached-init.el b/detached-init.el
index f7b6d47897..9a45019764 100644
--- a/detached-init.el
+++ b/detached-init.el
@@ -182,7 +182,7 @@
;; Trigger initialization of sessions upon load of `detached-list'
(with-eval-after-load 'detached-list
(detached-list--apply-filter
- (cdr (car detached-list-filters)))
+ (cdr (car detached-list-filters)))
(add-hook 'detached-update-db-hooks #'detached-list--db-update)))
(defun detached-init--detached ()
diff --git a/detached-list.el b/detached-list.el
index e206dcd383..ba6ab5e357 100644
--- a/detached-list.el
+++ b/detached-list.el
@@ -129,26 +129,26 @@ detached list implements."
Optionally initialize ALL session-directories."
(interactive "P")
(if-let* ((uninitialized-directories
- (thread-last (detached-get-sessions)
- (seq-filter #'detached--uninitialized-session-p)
- (seq-map #'detached--session-directory)
- (seq-uniq))))
- (if all
- (seq-do #'detached-list--initialize-directory
uninitialized-directories)
- (when-let ((directory (completing-read "Initialize directory: "
uninitialized-directories)))
- (detached-list--initialize-directory directory)))
- (message "All session directories have been initialized")))
+ (thread-last (detached-get-sessions)
+ (seq-filter #'detached--uninitialized-session-p)
+ (seq-map #'detached--session-directory)
+ (seq-uniq))))
+ (if all
+ (seq-do #'detached-list--initialize-directory
uninitialized-directories)
+ (when-let ((directory (completing-read "Initialize directory: "
uninitialized-directories)))
+ (detached-list--initialize-directory directory)))
+ (message "All session directories have been initialized")))
(defun detached-list-edit-annotation (session)
"Edit SESSION's annotation."
(interactive
(list (tabulated-list-get-id)))
(when-let* ((initial-value (or
- (detached--session-annotation session)
- ""))
+ (detached--session-annotation session)
+ ""))
(annotation (read-string "Annotation: " initial-value)))
- (setf (detached--session-annotation session) annotation)
- (detached--db-update-entry session)))
+ (setf (detached--session-annotation session) annotation)
+ (detached--db-update-entry session)))
(defun detached-list-quit ()
"Quit command."
@@ -176,10 +176,10 @@ Optionally initialize ALL session-directories."
(interactive
(list (tabulated-list-get-id)))
(when-let* ((buffer (detached-list--attached-p session)))
- (unless (get-buffer-window buffer)
- (pop-to-buffer buffer))
- (with-selected-window (get-buffer-window buffer)
- (detached-detach-session))))
+ (unless (get-buffer-window buffer)
+ (pop-to-buffer buffer))
+ (with-selected-window (get-buffer-window buffer)
+ (detached-detach-session))))
(defun detached-list-jump-to-directory (session)
"Jump to SESSION at point's directory."
@@ -268,9 +268,9 @@ Optionally TOGGLE-SUPPRESS-OUTPUT."
(if (= (length detached-list--marked-sessions) 2)
(progn
(when-let ((single-window (> (length (window-list)) 1))
- (buffer (current-buffer)))
- (delete-window (get-buffer-window))
- (bury-buffer buffer))
+ (buffer (current-buffer)))
+ (delete-window (get-buffer-window))
+ (bury-buffer buffer))
(apply #'detached-diff-session detached-list--marked-sessions))
(message "Mark two sessions")))
@@ -330,16 +330,16 @@ Optionally TOGGLE-SUPPRESS-OUTPUT."
(read-string "Enter time: ")))
(when time-threshold
(if-let ((parsed-threshold (detached--list-parse-time time-threshold)))
- (detached-list-narrow-sessions
- `(,@detached-list--narrow-criteria
- (,(format "-%s" time-threshold) .
- ,(lambda (sessions)
- (let ((current-time (time-to-seconds (current-time))))
- (seq-filter (lambda (it)
- (> (- current-time
- (plist-get (detached--session-time it)
:start))
- parsed-threshold))
- sessions))))))
+ (detached-list-narrow-sessions
+ `(,@detached-list--narrow-criteria
+ (,(format "-%s" time-threshold) .
+ ,(lambda (sessions)
+ (let ((current-time (time-to-seconds (current-time))))
+ (seq-filter (lambda (it)
+ (> (- current-time
+ (plist-get (detached--session-time it)
:start))
+ parsed-threshold))
+ sessions))))))
(message "Cannot parse time"))))
(defun detached-list-narrow-host (hostname)
@@ -351,9 +351,9 @@ Optionally TOGGLE-SUPPRESS-OUTPUT."
(seq-map #'detached--session-host)
(seq-map #'car)
(seq-uniq))))
- (completing-read
- "Select host: "
- hostnames))))
+ (completing-read
+ "Select host: "
+ hostnames))))
(when hostname
(detached-list-narrow-sessions
`(,@detached-list--narrow-criteria
@@ -384,8 +384,8 @@ Optionally TOGGLE-SUPPRESS-OUTPUT."
(regexp-quote
(detached--session-command
(detached--get-session major-mode)))
- (read-regexp
- "Filter session commands containing (regexp): "))))
+ (read-regexp
+ "Filter session commands containing (regexp): "))))
(when regexp
(detached-list-narrow-sessions
`(,@detached-list--narrow-criteria
@@ -404,8 +404,8 @@ Optionally TOGGLE-SUPPRESS-OUTPUT."
(regexp-quote
(detached--session-working-directory
(detached--get-session major-mode)))
- (read-regexp
- "Filter session working directories containing (regexp): "))))
+ (read-regexp
+ "Filter session working directories containing (regexp): "))))
(when regexp
(detached-list-narrow-sessions
`(,@detached-list--narrow-criteria
@@ -424,9 +424,9 @@ Optionally TOGGLE-SUPPRESS-OUTPUT."
(thread-last (detached-list--get-narrowed-sessions)
(seq-map #'detached--session-directory)
(seq-uniq))))
- (completing-read
- "Select session directory: "
- directories))))
+ (completing-read
+ "Select session directory: "
+ directories))))
(when session-directory
(detached-list-narrow-sessions
`(,@detached-list--narrow-criteria
@@ -482,8 +482,8 @@ Optionally TOGGLE-SUPPRESS-OUTPUT."
(complete-with-action action
detached-list-filters string predicate))))
(filter-name
(completing-read "Select filter: " collection nil t)))
- (detached-list--apply-filter
- (alist-get filter-name detached-list-filters nil nil #'string=))))
+ (detached-list--apply-filter
+ (alist-get filter-name detached-list-filters nil nil #'string=))))
(defun detached-list-narrow-origin (origin)
"Narrow to sessions with a specific ORIGIN."
@@ -507,7 +507,7 @@ Optionally TOGGLE-SUPPRESS-OUTPUT."
(lambda (it)
(string-match origin
(symbol-name (detached--session-origin it))))
- sessions)))))))
+ sessions)))))))
(defun detached-list-narrow-active ()
"Narrow to active sessions."
diff --git a/detached.el b/detached.el
index 33732b8998..60ce2152b4 100644
--- a/detached.el
+++ b/detached.el
@@ -207,8 +207,8 @@ If set to a non nil value the latest entry to
(defcustom detached-session-info-buffer-action
'(display-buffer-in-side-window
- (side . bottom)
- (dedicated . t))
+ (side . bottom)
+ (dedicated . t))
"The action used to display a information about a detached session."
:group 'detached
:type 'sexp)
@@ -413,7 +413,7 @@ Optionally SUPPRESS-OUTPUT if prefix-argument is provided."
(detached-session-action (or detached-session-action
detached-shell-command-session-action))
(detached-session-mode (or detached-session-mode
- (if suppress-output 'create
'create-and-attach)))
+ (if suppress-output 'create
'create-and-attach)))
(detached--current-session (detached-create-session command)))
(detached-start-session command suppress-output)))
@@ -507,13 +507,13 @@ The session is compiled by opening its output and enabling
(when-let* ((session (detached--get-session major-mode))
(buffer (get-buffer-create "*detached-session-info*"))
(window (display-buffer buffer
detached-session-info-buffer-action)))
- (select-window window)
- (with-current-buffer buffer
- (erase-buffer)
- (insert
- (string-trim
- (detached--session-header session)))
- (goto-char (point-min)))))
+ (select-window window)
+ (with-current-buffer buffer
+ (erase-buffer)
+ (insert
+ (string-trim
+ (detached--session-header session)))
+ (goto-char (point-min)))))
;;;###autoload
(defun detached-attach-session (session)
@@ -577,7 +577,7 @@ Optionally DELETE the session if prefix-argument is
provided."
(when (detached-valid-session session)
(when-let* ((default-directory (detached--session-directory session))
(pid (detached--session-pid session)))
- (detached--kill-processes pid))
+ (detached--kill-processes pid))
(when delete
(detached--db-remove-entry session))))
@@ -878,7 +878,7 @@ This function uses the `notifications' library."
(thread-last (detached--uninitialized-sessions)
(seq-filter #'detached--session-accessible-p)
(seq-do #'detached--initialize-session))))
- (detached--db-update-sessions))
+ (detached--db-update-sessions))
(detached--db-get-sessions))
(defun detached-shell-command-attach-session (session)
@@ -1291,8 +1291,8 @@ Optionally make the path LOCAL to host."
(insert-file-contents db)
(cl-assert (bobp))
(if (detached--verify-db-compatibility)
- (setq detached--sessions
- (read (current-buffer)))
+ (setq detached--sessions
+ (read (current-buffer)))
(warn "Detached database has version %s while minimum version is %s"
(detached--db-session-version)
detached-minimum-session-version))))))
@@ -1435,9 +1435,9 @@ Optionally make the path LOCAL to host."
(group (one-or-more digit)))))
(when (string-match version-regexp version)
`(:major ,(string-to-number (match-string 1 version))
- :minor ,(string-to-number (match-string 2 version))
- :patch ,(string-to-number (match-string 3 version))
- :revision ,(string-to-number (match-string 4 version))))))
+ :minor ,(string-to-number (match-string 2 version))
+ :patch ,(string-to-number (match-string 3 version))
+ :revision ,(string-to-number (match-string 4 version))))))
(defun detached--dtach-arg ()
"Return dtach argument based on `detached-session-mode'."
@@ -1531,7 +1531,7 @@ If SESSION is degraded fallback to a command that doesn't
rely on tee."
"Return a cons with (host . type)."
(let ((remote
(and (file-remote-p default-directory)
- (not detached-local-session))))
+ (not detached-local-session))))
`(,(if remote (file-remote-p default-directory 'host) (system-name)) .
,(if remote 'remote 'local))))
(defun detached--update-session-time (session &optional approximate)
@@ -1594,25 +1594,25 @@ session and trigger a state transition."
(is-primary
(detached--primary-detached-emacs-p session)))
- ;; Remove from unvalidated sessions
- (setq detached--unvalidated-sessions
- (assq-delete-all id detached--unvalidated-sessions))
-
- ;; Update session
- (detached--session-state-transition-update session)
-
- ;; Remove session directory from `detached--watch-session-directory'
- ;; if there is no active session associated with the directory
- (unless
- (thread-last (detached--db-get-sessions)
- (seq-filter (lambda (it) (eq 'active
(detached--session-state it))))
- (seq-map #'detached--session-directory)
- (seq-uniq)
- (seq-filter (lambda (it) (string= it
session-directory))))
- (file-notify-rm-watch
- (alist-get session-directory detached--watched-session-directories
nil nil #'string=))
- (setq detached--watched-session-directories
- (assoc-delete-all session-directory
detached--watched-session-directories)))))))
+ ;; Remove from unvalidated sessions
+ (setq detached--unvalidated-sessions
+ (assq-delete-all id detached--unvalidated-sessions))
+
+ ;; Update session
+ (detached--session-state-transition-update session)
+
+ ;; Remove session directory from
`detached--watch-session-directory'
+ ;; if there is no active session associated with the directory
+ (unless
+ (thread-last (detached--db-get-sessions)
+ (seq-filter (lambda (it) (eq 'active
(detached--session-state it))))
+ (seq-map #'detached--session-directory)
+ (seq-uniq)
+ (seq-filter (lambda (it) (string= it
session-directory))))
+ (file-notify-rm-watch
+ (alist-get session-directory
detached--watched-session-directories nil nil #'string=))
+ (setq detached--watched-session-directories
+ (assoc-delete-all session-directory
detached--watched-session-directories)))))))
(defun detached--initialize-session (session)
"Initialize SESSION."
@@ -1637,7 +1637,7 @@ session and trigger a state transition."
(defun detached--uninitialized-sessions ()
"Return a list of uninitialized sessions."
(seq-filter #'detached--uninitialized-session-p
- (detached--db-get-sessions)))
+ (detached--db-get-sessions)))
(defun detached--uninitialized-session-p (session)
"Return t if SESSION is uninitialized."
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [elpa] externals/detached 84154f8a6c: Update indentation and add style target to Make,
ELPA Syncer <=