branch: elpa/git-commit commit a37b2066dd88be92d80cd9221347ed43525e979f Author: Jonas Bernoulli <jo...@bernoul.li> Commit: Jonas Bernoulli <jo...@bernoul.li>
Use pcase's quote upattern I though that wasn't added until much later but actually this is supported since Emacs 25.1. --- lisp/git-rebase.el | 4 +-- lisp/magit-apply.el | 52 +++++++++++++++--------------- lisp/magit-base.el | 6 ++-- lisp/magit-bookmark.el | 8 ++--- lisp/magit-diff.el | 86 +++++++++++++++++++++++++------------------------- lisp/magit-ediff.el | 14 ++++---- lisp/magit-log.el | 24 +++++++------- lisp/magit-margin.el | 20 ++++++------ lisp/magit-merge.el | 4 +-- lisp/magit-mode.el | 8 ++--- lisp/magit-remote.el | 2 +- lisp/magit-section.el | 12 +++---- lisp/magit-sequence.el | 8 ++--- 13 files changed, 124 insertions(+), 124 deletions(-) diff --git a/lisp/git-rebase.el b/lisp/git-rebase.el index f33328e565..e02378ae5c 100644 --- a/lisp/git-rebase.el +++ b/lisp/git-rebase.el @@ -646,8 +646,8 @@ Like `undo' but works in read-only buffers." (and (eq action-type 'commit) target)) (pcase scroll - (`up (magit-diff-show-or-scroll-up)) - (`down (magit-diff-show-or-scroll-down)) + ('up (magit-diff-show-or-scroll-up)) + ('down (magit-diff-show-or-scroll-down)) (_ (apply #'magit-show-commit it (magit-diff-arguments 'magit-revision-mode)))) (ding))))) diff --git a/lisp/magit-apply.el b/lisp/magit-apply.el index 8230c2d4a0..fa77908357 100644 --- a/lisp/magit-apply.el +++ b/lisp/magit-apply.el @@ -133,9 +133,9 @@ so causes the change to be applied to the index as well." (interactive (and current-prefix-arg (list "--3way"))) (--when-let (magit-apply--get-selection) (pcase (list (magit-diff-type) (magit-diff-scope)) - (`(,(or `unstaged `staged) ,_) + (`(,(or 'unstaged 'staged) ,_) (user-error "Change is already in the working tree")) - (`(untracked ,(or `file `files)) + (`(untracked ,(or 'file 'files)) (call-interactively #'magit-am)) (`(,_ region) (magit-apply-region it args)) (`(,_ hunk) (magit-apply-hunk it args)) @@ -258,9 +258,9 @@ adjusted as \"@@ -10,6 +10,7 @@\" and \"@@ -18,6 +19,7 @@\"." (or (magit-region-sections '(hunk file module) t) (let ((section (magit-current-section))) (pcase (oref section type) - ((or `hunk `file `module) section) - ((or `staged `unstaged `untracked - `stashed-index `stashed-worktree `stashed-untracked) + ((or 'hunk 'file 'module) section) + ((or 'staged 'unstaged 'untracked + 'stashed-index 'stashed-worktree 'stashed-untracked) (oref section children)) (_ (user-error "Cannot apply this, it's not a change")))))) @@ -298,12 +298,12 @@ at point, stage the file but not its content." (`(unstaged region ,_) (magit-apply-region it "--cached")) (`(unstaged hunk ,_) (magit-apply-hunk it "--cached")) (`(unstaged hunks ,_) (magit-apply-hunks it "--cached")) - (`(unstaged file t) (magit-apply-diff it "--cached")) - (`(unstaged files t) (magit-apply-diffs it "--cached")) - (`(unstaged list t) (magit-apply-diffs it "--cached")) - (`(unstaged file nil) (magit-stage-1 "-u" (list (oref it value)))) - (`(unstaged files nil) (magit-stage-1 "-u" (magit-region-values nil t))) - (`(unstaged list nil) (magit-stage-modified)) + ('(unstaged file t) (magit-apply-diff it "--cached")) + ('(unstaged files t) (magit-apply-diffs it "--cached")) + ('(unstaged list t) (magit-apply-diffs it "--cached")) + ('(unstaged file nil) (magit-stage-1 "-u" (list (oref it value)))) + ('(unstaged files nil) (magit-stage-1 "-u" (magit-region-values nil t))) + ('(unstaged list nil) (magit-stage-modified)) (`(staged ,_ ,_) (user-error "Already staged")) (`(committed ,_ ,_) (user-error "Cannot stage committed changes")) (`(undefined ,_ ,_) (user-error "Cannot stage this change"))) @@ -351,9 +351,9 @@ ignored) files." (defun magit-stage-untracked (&optional intent) (let* ((section (magit-current-section)) (files (pcase (magit-diff-scope) - (`file (list (oref section value))) - (`files (magit-region-values nil t)) - (`list (magit-untracked-files)))) + ('file (list (oref section value))) + ('files (magit-region-values nil t)) + ('list (magit-untracked-files)))) plain repos) (dolist (file files) (if (and (not (file-symlink-p file)) @@ -408,12 +408,12 @@ ignored) files." (`(staged region ,_) (magit-apply-region it "--reverse" "--cached")) (`(staged hunk ,_) (magit-apply-hunk it "--reverse" "--cached")) (`(staged hunks ,_) (magit-apply-hunks it "--reverse" "--cached")) - (`(staged file t) (magit-apply-diff it "--reverse" "--cached")) - (`(staged files t) (magit-apply-diffs it "--reverse" "--cached")) - (`(staged list t) (magit-apply-diffs it "--reverse" "--cached")) - (`(staged file nil) (magit-unstage-1 (list (oref it value)))) - (`(staged files nil) (magit-unstage-1 (magit-region-values nil t))) - (`(staged list nil) (magit-unstage-all)) + ('(staged file t) (magit-apply-diff it "--reverse" "--cached")) + ('(staged files t) (magit-apply-diffs it "--reverse" "--cached")) + ('(staged list t) (magit-apply-diffs it "--reverse" "--cached")) + ('(staged file nil) (magit-unstage-1 (list (oref it value)))) + ('(staged files nil) (magit-unstage-1 (magit-region-values nil t))) + ('(staged list nil) (magit-unstage-all)) (`(committed ,_ ,_) (if magit-unstage-committed (magit-reverse-in-index) (user-error "Cannot unstage committed changes"))) @@ -491,7 +491,7 @@ of a side, then keep that side without prompting." (magit-confirm 'discard "Discard hunk") (let ((file (magit-section-parent-value section))) (pcase (cddr (car (magit-file-status file))) - (`(?U ?U) (magit-smerge-keep-current)) + ('(?U ?U) (magit-smerge-keep-current)) (_ (magit-discard-apply section #'magit-apply-hunk))))) (defun magit-discard-apply (section apply) @@ -543,17 +543,17 @@ of a side, then keep that side without prompting." (`unstaged ?Y) (`untracked ?Z)) (cddr (assoc file status))) - (`(?Z) (dolist (f (magit-untracked-files nil file)) + ('(?Z) (dolist (f (magit-untracked-files nil file)) (push f delete))) - ((or `(?Z ?? ??) `(?Z ?! ?!)) (push file delete)) - (`(?Z ?D ? ) (push file delete)) + ((or '(?Z ?? ??) '(?Z ?! ?!)) (push file delete)) + ('(?Z ?D ? ) (push file delete)) (`(,_ ?D ?D) (push file resolve)) ((or `(,_ ?U ,_) `(,_ ,_ ?U)) (push file resolve)) (`(,_ ?A ?A) (push file resolve)) (`(?X ?M ,(or ? ?M ?D)) (push section discard)) (`(?Y ,_ ?M ) (push section discard)) - (`(?X ?A ?M ) (push file discard-new)) - (`(?X ?C ?M ) (push file discard-new)) + ('(?X ?A ?M ) (push file discard-new)) + ('(?X ?C ?M ) (push file discard-new)) (`(?X ?A ,(or ? ?D)) (push file delete)) (`(?X ?C ,(or ? ?D)) (push file delete)) (`(?X ?D ,(or ? ?M )) (push file resurrect)) diff --git a/lisp/magit-base.el b/lisp/magit-base.el index 4bbf76f8ef..4d5966889a 100644 --- a/lisp/magit-base.el +++ b/lisp/magit-base.el @@ -1168,10 +1168,10 @@ or (last of all) the value of EXP." "\\*note[ \n\t]+\\([^:]*\\):\\(:\\|[ \n\t]*(\\)?"))) (if (and node (string-match "^(gitman)\\(.+\\)" node)) (pcase magit-view-git-manual-method - (`info (funcall fn fork)) - (`man (require 'man) + ('info (funcall fn fork)) + ('man (require 'man) (man (match-string 1 node))) - (`woman (require 'woman) + ('woman (require 'woman) (woman (match-string 1 node))) (_ (user-error "Invalid value for `magit-view-git-manual-method'"))) diff --git a/lisp/magit-bookmark.el b/lisp/magit-bookmark.el index 0d958178f1..52e9e0b4ef 100644 --- a/lisp/magit-bookmark.el +++ b/lisp/magit-bookmark.el @@ -119,10 +119,10 @@ with the variables' values as arguments, which were recorded by (cl-defmethod magit-bookmark-name (&context (major-mode magit-diff-mode)) (format "magit-diff(%s%s)" (pcase (magit-diff-type) - (`staged "staged") - (`unstaged "unstaged") - (`committed magit-buffer-range) - (`undefined + ('staged "staged") + ('unstaged "unstaged") + ('committed magit-buffer-range) + ('undefined (delq nil (list magit-buffer-typearg magit-buffer-range-hashed)))) (if magit-buffer-diff-files (concat " -- " (mapconcat #'identity magit-buffer-diff-files " ")) diff --git a/lisp/magit-diff.el b/lisp/magit-diff.el index 82fa150061..e1e36b4226 100644 --- a/lisp/magit-diff.el +++ b/lisp/magit-diff.el @@ -1056,9 +1056,9 @@ and `:slant'." (expand-file-name (file-name-as-directory (magit-section-parent-value section))))) (pcase (magit-diff--dwim) - (`unmerged (magit-diff-unmerged args files)) - (`unstaged (magit-diff-unstaged args files)) - (`staged + ('unmerged (magit-diff-unmerged args files)) + ('unstaged (magit-diff-unstaged args files)) + ('staged (let ((file (magit-file-at-point))) (if (and file (equal (cddr (car (magit-file-status file))) '(?D ?U))) ;; File was deleted by us and modified by them. Show the latter. @@ -1844,8 +1844,8 @@ commit or stash at point, then prompt for a commit." (funcall fn) (error (goto-char (pcase fn - (`scroll-up (point-min)) - (`scroll-down (point-max))))))) + ('scroll-up (point-min)) + ('scroll-down (point-max))))))) (let ((magit-display-buffer-noselect t)) (if (eq cmd #'magit-show-commit) (apply #'magit-show-commit rev (magit-show-commit--arguments)) @@ -2228,13 +2228,13 @@ section or a child thereof." (insert (propertize (format "unmerged %s%s" file (pcase (cddr (car (magit-file-status file))) - (`(?D ?D) " (both deleted)") - (`(?D ?U) " (deleted by us)") - (`(?U ?D) " (deleted by them)") - (`(?A ?A) " (both added)") - (`(?A ?U) " (added by us)") - (`(?U ?A) " (added by them)") - (`(?U ?U) ""))) + ('(?D ?D) " (both deleted)") + ('(?D ?U) " (deleted by us)") + ('(?U ?D) " (deleted by them)") + ('(?A ?A) " (both added)") + ('(?A ?U) " (added by us)") + ('(?U ?A) " (added by them)") + ('(?U ?U) ""))) 'font-lock-face 'magit-diff-file-heading)) (insert ?\n)))) t) @@ -2600,18 +2600,18 @@ or a ref which is not a branch, then it inserts nothing." (when (> (point) beg) (let ((text (buffer-substring-no-properties beg (point)))) (when (pcase magit-revision-use-hash-sections - (`quickest ; false negatives and positives + ('quickest ; false negatives and positives (and (>= (length text) 7) (string-match-p "[0-9]" text) (string-match-p "[a-z]" text))) - (`quicker ; false negatives (number-less hashes) + ('quicker ; false negatives (number-less hashes) (and (>= (length text) 7) (string-match-p "[0-9]" text) (magit-commit-p text))) - (`quick ; false negatives (short hashes) + ('quick ; false negatives (short hashes) (and (>= (length text) 7) (magit-commit-p text))) - (`slow + ('slow (magit-commit-p text))) (put-text-property beg (point) 'font-lock-face 'magit-hash) @@ -2741,9 +2741,9 @@ or a ref which is not a branch, then it inserts nothing." (require 'gravatar) (pcase-let ((`(,author . ,committer) (pcase magit-revision-show-gravatars - (`t '("^Author: " . "^Commit: ")) - (`author '("^Author: " . nil)) - (`committer '(nil . "^Commit: ")) + ('t '("^Author: " . "^Commit: ")) + ('author '("^Author: " . nil)) + ('committer '(nil . "^Commit: ")) (_ magit-revision-show-gravatars)))) (--when-let (and author (magit-rev-format "%aE" rev)) (magit-insert-revision-gravatar beg rev it author)) @@ -2949,13 +2949,13 @@ Do not confuse this with `magit-diff-scope' (which see)." (if (memq stype '(staged unstaged tracked untracked)) stype (pcase stype - ((or `file `module) + ((or 'file 'module) (let* ((parent (oref it parent)) (type (oref parent type))) (if (memq type '(file module)) (magit-diff-type parent) type))) - (`hunk (thread-first it + ('hunk (thread-first it (oref parent) (oref parent) (oref type))))))) @@ -3002,13 +3002,13 @@ actually a `diff' but a `diffstat' section." ssection) (`(hunk nil t ,_) (if (magit-section-internal-region-p section) 'region 'hunk)) - (`(hunk t t nil) 'hunks) + ('(hunk t t nil) 'hunks) (`(hunk ,_ ,_ ,_) 'hunk) - (`(file t t nil) 'files) + ('(file t t nil) 'files) (`(file ,_ ,_ ,_) 'file) - (`(module t t nil) 'files) + ('(module t t nil) 'files) (`(module ,_ ,_ ,_) 'file) - (`(,(or `staged `unstaged `untracked) nil ,_ ,_) 'list))))) + (`(,(or 'staged 'unstaged 'untracked) nil ,_ ,_) 'list))))) (defun magit-diff-use-hunk-region-p () (and (region-active-p) @@ -3058,9 +3058,9 @@ are highlighted." (defun magit-diff-highlight-recursive (section &optional selection) (pcase (magit-diff-scope section) - (`list (magit-diff-highlight-list section selection)) - (`file (magit-diff-highlight-file section selection)) - (`hunk (magit-diff-highlight-heading section selection) + ('list (magit-diff-highlight-list section selection)) + ('file (magit-diff-highlight-file section selection)) + ('hunk (magit-diff-highlight-heading section selection) (magit-diff-paint-hunk section selection t)) (_ (magit-section-highlight section nil)))) @@ -3099,12 +3099,12 @@ are highlighted." (pcase (list (oref section type) (and (member section selection) (not (eq this-command #'mouse-drag-region)))) - (`(file t) 'magit-diff-file-heading-selection) - (`(file nil) 'magit-diff-file-heading-highlight) - (`(module t) 'magit-diff-file-heading-selection) - (`(module nil) 'magit-diff-file-heading-highlight) - (`(hunk t) 'magit-diff-hunk-heading-selection) - (`(hunk nil) 'magit-diff-hunk-heading-highlight)))) + ('(file t) 'magit-diff-file-heading-selection) + ('(file nil) 'magit-diff-file-heading-highlight) + ('(module t) 'magit-diff-file-heading-selection) + ('(module nil) 'magit-diff-file-heading-highlight) + ('(hunk t) 'magit-diff-hunk-heading-selection) + ('(hunk nil) 'magit-diff-hunk-heading-highlight)))) ;;; Hunk Paint @@ -3150,13 +3150,13 @@ are highlighted." (cond ((looking-at "^\\+\\+?\\([<=|>]\\)\\{7\\}") (setq stage (pcase (list (match-string 1) highlight) - (`("<" nil) 'magit-diff-our) - (`("<" t) 'magit-diff-our-highlight) - (`("|" nil) 'magit-diff-base) - (`("|" t) 'magit-diff-base-highlight) - (`("=" nil) 'magit-diff-their) - (`("=" t) 'magit-diff-their-highlight) - (`(">" nil) nil))) + ('("<" nil) 'magit-diff-our) + ('("<" t) 'magit-diff-our-highlight) + ('("|" nil) 'magit-diff-base) + ('("|" t) 'magit-diff-base-highlight) + ('("=" nil) 'magit-diff-their) + ('("=" t) 'magit-diff-their-highlight) + ('(">" nil) nil))) 'magit-diff-conflict-heading) ((looking-at (if merging "^\\(\\+\\| \\+\\)" "^\\+")) (magit-diff-paint-tab merging tab-width) @@ -3251,7 +3251,7 @@ are highlighted." (pcase (list magit-diff-refine-hunk (oref section refined) (eq section (magit-current-section))) - ((or `(all nil ,_) `(t nil t)) + ((or `(all nil ,_) '(t nil t)) (oset section refined t) (save-excursion (goto-char (oref section start)) @@ -3262,7 +3262,7 @@ are highlighted." ;; Avoid fsyncing many small temp files (write-region-inhibit-fsync t)) (diff-refine-hunk))))) - ((or `(nil t ,_) `(t t nil)) + ((or `(nil t ,_) '(t t nil)) (oset section refined nil) (remove-overlays (oref section start) (oref section end) diff --git a/lisp/magit-ediff.el b/lisp/magit-ediff.el index 0012c2cd04..83247954ec 100644 --- a/lisp/magit-ediff.el +++ b/lisp/magit-ediff.el @@ -318,12 +318,12 @@ mind at all, then it asks the user for a command to run." command revA revB) (pcase range ((and (guard (not magit-ediff-dwim-show-on-hunks)) - (or `unstaged `staged)) + (or 'unstaged 'staged)) (setq command (if (magit-anything-unmerged-p) #'magit-ediff-resolve #'magit-ediff-stage))) - (`unstaged (setq command #'magit-ediff-show-unstaged)) - (`staged (setq command #'magit-ediff-show-staged)) + ('unstaged (setq command #'magit-ediff-show-unstaged)) + ('staged (setq command #'magit-ediff-show-staged)) (`(commit . ,value) (setq command #'magit-ediff-show-commit) (setq revB value)) @@ -338,16 +338,16 @@ mind at all, then it asks the user for a command to run." (_ (when (derived-mode-p 'magit-diff-mode) (pcase (magit-diff-type) - (`committed (pcase-let ((`(,a ,b) + ('committed (pcase-let ((`(,a ,b) (magit-ediff-compare--read-revisions magit-buffer-range))) (setq revA a) (setq revB b))) ((guard (not magit-ediff-dwim-show-on-hunks)) (setq command #'magit-ediff-stage)) - (`unstaged (setq command #'magit-ediff-show-unstaged)) - (`staged (setq command #'magit-ediff-show-staged)) - (`undefined (setq command nil)) + ('unstaged (setq command #'magit-ediff-show-unstaged)) + ('staged (setq command #'magit-ediff-show-staged)) + ('undefined (setq command nil)) (_ (setq command nil)))))) (cond ((not command) (call-interactively diff --git a/lisp/magit-log.el b/lisp/magit-log.el index 2763a1d949..2c995cc51c 100644 --- a/lisp/magit-log.el +++ b/lisp/magit-log.el @@ -523,9 +523,9 @@ the upstream isn't ahead of the current branch) show." (cond ((not (eq transient-current-command 'magit-log-refresh)) (pcase major-mode - (`magit-reflog-mode + ('magit-reflog-mode (user-error "Cannot change log arguments in reflog buffers")) - (`magit-cherry-mode + ('magit-cherry-mode (user-error "Cannot change log arguments in cherry buffers"))) (transient-setup 'magit-log-refresh)) (t @@ -1264,13 +1264,13 @@ Do not add this to a hook variable." (when (derived-mode-p 'magit-log-mode 'magit-reflog-mode) (cl-incf magit-log-count)) (looking-at (pcase style - (`log magit-log-heading-re) - (`cherry magit-log-cherry-re) - (`module magit-log-module-re) - (`reflog magit-log-reflog-re) - (`stash magit-log-stash-re) - (`bisect-vis magit-log-bisect-vis-re) - (`bisect-log magit-log-bisect-log-re))) + ('log magit-log-heading-re) + ('cherry magit-log-cherry-re) + ('module magit-log-module-re) + ('reflog magit-log-reflog-re) + ('stash magit-log-stash-re) + ('bisect-vis magit-log-bisect-vis-re) + ('bisect-log magit-log-bisect-log-re))) (magit-bind-match-strings (hash msg refs graph author date gpg cherry _ refsub side) nil (setq msg (substring-no-properties msg)) @@ -1289,9 +1289,9 @@ Do not add this to a hook variable." (cl-return-from magit-log-wash-rev t)) (magit-insert-section section (commit hash) (pcase style - (`stash (oset section type 'stash)) - (`module (oset section type 'module-commit)) - (`bisect-log (setq hash (magit-rev-parse "--short" hash)))) + ('stash (oset section type 'stash)) + ('module (oset section type 'module-commit)) + ('bisect-log (setq hash (magit-rev-parse "--short" hash)))) (setq hash (propertize hash 'font-lock-face (pcase (and gpg (aref gpg 0)) (?G 'magit-signature-good) diff --git a/lisp/magit-margin.el b/lisp/magit-margin.el index 5f092da362..454d068bcc 100644 --- a/lisp/magit-margin.el +++ b/lisp/magit-margin.el @@ -88,8 +88,8 @@ does not carry to other options." ;; This is only suitable for commit margins (there are not others). (setf (cadr magit-buffer-margin) (pcase (cadr magit-buffer-margin) - (`age 'age-abbreviated) - (`age-abbreviated + ('age 'age-abbreviated) + ('age-abbreviated (let ((default (or magit-margin-default-time-format (cadr (symbol-value (magit-margin-option)))))) (if (stringp default) default "%Y-%m-%d %H:%M "))) @@ -112,14 +112,14 @@ does not carry to other options." (defun magit-margin-option () (pcase major-mode - (`magit-cherry-mode 'magit-cherry-margin) - (`magit-log-mode 'magit-log-margin) - (`magit-log-select-mode 'magit-log-select-margin) - (`magit-reflog-mode 'magit-reflog-margin) - (`magit-refs-mode 'magit-refs-margin) - (`magit-stashes-mode 'magit-stashes-margin) - (`magit-status-mode 'magit-status-margin) - (`forge-notifications-mode 'magit-status-margin))) + ('magit-cherry-mode 'magit-cherry-margin) + ('magit-log-mode 'magit-log-margin) + ('magit-log-select-mode 'magit-log-select-margin) + ('magit-reflog-mode 'magit-reflog-margin) + ('magit-refs-mode 'magit-refs-margin) + ('magit-stashes-mode 'magit-stashes-margin) + ('magit-status-mode 'magit-status-margin) + ('forge-notifications-mode 'magit-status-margin))) (defun magit-set-buffer-margin (&optional reset refresh) (when-let ((option (magit-margin-option))) diff --git a/lisp/magit-merge.el b/lisp/magit-merge.el index fc93d4615c..abf6e06e51 100644 --- a/lisp/magit-merge.el +++ b/lisp/magit-merge.el @@ -255,9 +255,9 @@ then also remove the respective remote branch." (user-error "Quit"))))) (pcase (cons arg (cddr (car (magit-file-status file)))) ((or `("--ours" ?D ,_) - `("--ours" ?U ?A) + '("--ours" ?U ?A) `("--theirs" ,_ ?D) - `("--theirs" ?A ?U)) + '("--theirs" ?A ?U)) (magit-run-git "rm" "--" file)) (_ (if (equal arg "--merge") ;; This fails if the file was deleted on one diff --git a/lisp/magit-mode.el b/lisp/magit-mode.el index 639762ba29..d421beb8f6 100644 --- a/lisp/magit-mode.el +++ b/lisp/magit-mode.el @@ -879,10 +879,10 @@ If a frame, then only consider buffers on that frame." (f (frame) (seq-some #'w (window-list frame 'no-minibuf)))) (pcase-exhaustive frame - (`nil (seq-some #'b (buffer-list))) - (`all (seq-some #'f (frame-list))) - (`visible (seq-some #'f (visible-frame-list))) - ((or `selected `t) (seq-some #'w (window-list (selected-frame)))) + ('nil (seq-some #'b (buffer-list))) + ('all (seq-some #'f (frame-list))) + ('visible (seq-some #'f (visible-frame-list))) + ((or 'selected 't) (seq-some #'w (window-list (selected-frame)))) ((guard (framep frame)) (seq-some #'w (window-list frame))))) (magit--not-inside-repository-error))) diff --git a/lisp/magit-remote.el b/lisp/magit-remote.el index 38efe2e45e..4f70c1a4b9 100644 --- a/lisp/magit-remote.el +++ b/lisp/magit-remote.el @@ -114,7 +114,7 @@ has to be used to view and change remote related variables." (if (pcase (list magit-remote-add-set-remote.pushDefault (magit-get "remote.pushDefault")) (`(,(pred stringp) ,_) t) - ((or `(ask ,_) `(ask-if-unset nil)) + ((or `(ask ,_) '(ask-if-unset nil)) (y-or-n-p (format "Set `remote.pushDefault' to \"%s\"? " remote)))) (progn (magit-call-git "remote" "add" args remote url) (setf (magit-get "remote.pushDefault") remote) diff --git a/lisp/magit-section.el b/lisp/magit-section.el index 09e87beb72..6bd20f23f1 100644 --- a/lisp/magit-section.el +++ b/lisp/magit-section.el @@ -1703,10 +1703,10 @@ invisible." (defun magit-section-goto-successor-1 (section) (or (and-let* ((alt (pcase (oref section type) - (`staged 'unstaged) - (`unstaged 'staged) - (`unpushed 'unpulled) - (`unpulled 'unpushed)))) + ('staged 'unstaged) + ('unstaged 'staged) + ('unpushed 'unpulled) + ('unpulled 'unpushed)))) (magit-get-section `((,alt) (status)))) (and-let* ((next (car (magit-section-siblings section 'next)))) (magit-get-section (magit-section-ident next))) @@ -1904,8 +1904,8 @@ excluding SECTION itself." (and-let* ((parent (oref section parent)) (siblings (oref parent children))) (pcase direction - (`prev (cdr (member section (reverse siblings)))) - (`next (cdr (member section siblings))) + ('prev (cdr (member section (reverse siblings)))) + ('next (cdr (member section siblings))) (_ (remq section siblings))))) (defun magit-region-values (&optional condition multiple) diff --git a/lisp/magit-sequence.el b/lisp/magit-sequence.el index 9aabfcf578..e7036ab648 100644 --- a/lisp/magit-sequence.el +++ b/lisp/magit-sequence.el @@ -186,8 +186,8 @@ This discards all changes made since the sequence started." (let ((reachable (magit-rev-ancestor-p (car commits) current)) (msg "Cannot %s cherries that %s reachable from HEAD")) (pcase (list away reachable) - (`(nil t) (user-error msg verb "are")) - (`(t nil) (user-error msg verb "are not")))) + ('(nil t) (user-error msg verb "are")) + ('(t nil) (user-error msg verb "are not")))) `(,commits ,@(funcall fn commits) ,(transient-args 'magit-cherry-pick)))) @@ -979,13 +979,13 @@ status buffer (i.e. the reverse of how they will be applied)." (dolist (line (magit-rebase--todo)) (with-slots (action-type action action-options target) line (pcase action-type - (`commit + ('commit (magit-sequence-insert-commit action target 'magit-sequence-pick)) ((or (or `exec `label) (and `merge (guard (not action-options)))) (insert (propertize action 'font-lock-face 'magit-sequence-onto) "\s" (propertize target 'font-lock-face 'git-rebase-label) "\n")) - (`merge + ('merge (if-let ((hash (and (string-match "-[cC] \\([^ ]+\\)" action-options) (match-string 1 action-options)))) (magit-insert-section (commit hash)