[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/vc-fossil 1d46c62 027/111: eschew some redundancy, and use
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/vc-fossil 1d46c62 027/111: eschew some redundancy, and use modern apply syntax |
Date: |
Wed, 29 Sep 2021 08:59:14 -0400 (EDT) |
branch: elpa/vc-fossil
commit 1d46c622544c520a4b214499e8bf68a29ca86dd2
Author: barak <barak>
Commit: barak <barak>
eschew some redundancy, and use modern apply syntax
---
vc/el/vc-fossil.el | 39 +++++++++++++++++++--------------------
1 file changed, 19 insertions(+), 20 deletions(-)
diff --git a/vc/el/vc-fossil.el b/vc/el/vc-fossil.el
index 5928657..4c14dda 100644
--- a/vc/el/vc-fossil.el
+++ b/vc/el/vc-fossil.el
@@ -47,17 +47,17 @@
;; Internal Commands
(defun vc-fossil--call (buffer &rest args)
- (apply 'process-file "fossil" nil buffer nil args))
+ (apply #'process-file "fossil" nil buffer nil args))
(defun vc-fossil--out-ok (&rest args)
- (zerop (apply 'vc-fossil--call '(t nil) args)))
+ (zerop (apply #'vc-fossil--call '(t nil) args)))
(defun vc-fossil--run (&rest args)
"Run a fossil command and return its output as a string"
(let* ((ok t)
(str (with-output-to-string
(with-current-buffer standard-output
- (unless (apply 'vc-fossil--out-ok args)
+ (unless (apply #'vc-fossil--out-ok args)
(setq ok nil))))))
(and ok str)))
@@ -67,7 +67,7 @@
(defun vc-fossil-command (buffer okstatus file-or-list &rest flags)
"A wrapper around `vc-do-command' for use in vc-fossil.el.
The difference to vc-do-command is that this function always invokes
`fossil'."
- (apply 'vc-do-command (or buffer "*vc*") okstatus "fossil" file-or-list
flags))
+ (apply #'vc-do-command (or buffer "*vc*") okstatus "fossil" file-or-list
flags))
(defun vc-fossil-get-id (dir)
(let* ((default-directory dir)
@@ -116,7 +116,7 @@
"Fossil Specific version of `vc-working-revision'."
(let ((line (vc-fossil--run "finfo" "-s" file)))
(and line
- (car (cdr (split-string line))))))
+ (cadr (split-string line)))))
(defun vc-fossil-workfile-unchanged-p (file)
(eq 'up-to-date (vc-fossil-state file)))
@@ -200,15 +200,14 @@
(vc-fossil-command nil 0 files "commit" "-m" comment))
(defun vc-fossil-find-revision (file rev buffer)
- (if (string= rev "")
- (vc-fossil-command buffer 0 file "finfo" "-p")
- (vc-fossil-command buffer 0 file "finfo" "-r" rev "-p")))
+ (apply #'vc-fossil-command buffer 0 file
+ "finfo" `(,@(if (string= rev "")
+ '()
+ `("-r" ,rev)) "-p")))
(defun vc-fossil-checkout (file &optional editable rev)
- (cond ((eq rev t)
- (vc-fossil-command nil 0 nil "update"))
- (t
- (vc-fossil-command nil 0 nil "update" rev))))
+ (apply #'vc-fossil-command nil 0 nil
+ "update" `(,@(if (eq rev t) '() `(,rev)))))
(defun vc-fossil-revert (file &optional contents-done)
"Revert FILE to the version stored in the fossil repository."
@@ -232,11 +231,10 @@
"Get Differences for a file"
;; (message (format "Get diffs between rev <%s> and <%s> for file <%s>" rev1
rev2 file))
(let ((buf (or buffer "*vc-diff*")))
- (cond ((and rev1 rev2)
- (vc-fossil-command buf 0 file "diff" "-i" "--from" rev1 "--to" rev2))
- (rev1 (vc-fossil-command buf 0 file "diff" "-i" "--from" rev1))
- (rev2 (vc-fossil-command buf 0 file "diff" "-i" "--to" rev2))
- (t (vc-fossil-command buf 0 file "diff" "-i")))))
+ (apply #'vc-fossil-command
+ buf 0 file "diff" "-i"
+ `(,@(if rev1 `("--from" ,rev1) '())
+ ,@(if rev2 `("--to" ,rev2) '())))))
;;; TAG SYSTEM
@@ -246,9 +244,10 @@
(defun vc-fossil-create-tag (file name branchp)
(let* ((dir (if (file-directory-p file) file (file-name-directory file)))
(default-directory dir))
- (if branchp
- (vc-fossil-command nil 0 nil "branch" "new" name (vc-fossil-get-id dir))
- (vc-fossil-command nil 0 nil "tag" "add" name (vc-fossil-get-id dir)))))
+ (apply #'vc-fossil-command nil 0 nil `(,@(if branchp
+ '("branch" "new")
+ '("tag" "add"))
+ ,name ,(vc-fossil-get-id dir)))))
;; FIXME: we should update buffers if update is non-nill
- [nongnu] elpa/vc-fossil fe3e0d3 035/111: Enable vc-ediff to work. Thanks to folks who contributed in [8521322bc9], (continued)
- [nongnu] elpa/vc-fossil fe3e0d3 035/111: Enable vc-ediff to work. Thanks to folks who contributed in [8521322bc9], ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil c642a01 042/111: Pass `vc-checkin-switches` on checkin., ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil d844871 026/111: typo in emacs keystroke in documentation, ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil 419877b 030/111: squelch dead computation; clarify logic, ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil 403712d 032/111: Fossil gets confused traversing through symlinks. Use file-truename in multiple places to get past that., ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil 9d2d9f8 038/111: Refactoring of `vc-fossil-dir-status`., ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil c1585fc 040/111: Remove `vc-fossil-after-dir-status`., ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil 54df12a 045/111: Fix parameter passing in `vc-fossil-find-revision`., ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil 3c8fae8 016/111: Mulitple changes to allow 23.2 integration and to fix fossil-state-code incorrectly still using --file to update -n -v, ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil 9856860 021/111: appropriate autoload, and consistent "add fossil" expression in docs, ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil 1d46c62 027/111: eschew some redundancy, and use modern apply syntax,
ELPA Syncer <=
- [nongnu] elpa/vc-fossil 0497f8f 037/111: Remove some old debug messages., ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil f69eac0 047/111: Add end-of-file comment., ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil 3455e4a 049/111: Access command switches by `vc-switches`., ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil 4ce0039 052/111: Enable word-wrap with indentation in log view., ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil 03282dc 063/111: Implement next-revision command for whole repository., ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil f68c80a 077/111: Merged enhanced vc-dir buffer header capability., ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil 6174102 078/111: Create README.md, ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil b43a7e2 073/111: Added Emacs 25 compatibility., ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil 0aceef3 071/111: Add GPLv3 as the default license, ELPA Syncer, 2021/09/29
- [nongnu] elpa/vc-fossil 6029bc2 082/111: Updates from pdo, ELPA Syncer, 2021/09/29