Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge 0891022 into f6262e6
  • Loading branch information
Ergus committed Oct 15, 2020
2 parents f6262e6 + 0891022 commit 189362f
Show file tree
Hide file tree
Showing 4 changed files with 181 additions and 131 deletions.
10 changes: 9 additions & 1 deletion .travis.yml
@@ -1,10 +1,18 @@
dist: trusty

language: generic

before_install:
- curl -fsSkL https://gist.github.com/rejeep/ebcd57c3af83b049833b/raw > x.sh && source ./x.sh
- evm install $EVM_EMACS --use --skip
- cask

env:
- EVM_EMACS=emacs-24.5-travis
matrix:
- EVM_EMACS=emacs-24.5-travis
- EVM_EMACS=emacs-26.3-travis
- EVM_EMACS=emacs-git-snapshot-travis

script:
- emacs --version
- make test
37 changes: 13 additions & 24 deletions composable-mark.el
Expand Up @@ -31,10 +31,7 @@

(defun composable--direction (arg)
"Direction of ARG."
(let ((n (prefix-numeric-value arg)))
(if n
(/ n (abs n))
1)))
(let ((n (prefix-numeric-value arg))) (/ n (abs n))))

(defun composable-mark-join (arg)
"Mark the whitespace separating lines.
Expand All @@ -51,28 +48,20 @@ Between the line above if ARG is negative otherwise below."
(push-mark nil nil t)
(move (- arg))))

(defun composable--mark-with-forward (forward arg)
(defmacro composable--mark-with-forward (forward arg)
"Mark a region based on a FORWARD movement and ARG.
The movement must mark backwards with negative arguments."
(let* ((amount (if arg
(prefix-numeric-value arg)
(if (< (mark t) (point)) -1 1)))
(dir (/ amount (abs amount))))
(when (= composable--count 1)
(progn
(funcall forward dir)
(funcall forward (- dir))
(setq composable--border-point (point-marker))
(set-mark (point))

(if (< 0 amount)
(goto-char (min (mark t) (point)))
(goto-char (max (mark t) (point))))
)
)

(funcall forward amount)
))
`(let* ((amount (prefix-numeric-value ,arg))
(dir (/ amount (abs amount))))
(when (= composable--count 1)
(funcall ,forward dir)
(funcall ,forward (- dir))
(setq composable--border-point (point-marker))
(set-mark (point))
(if (< 0 amount)
(goto-char (min (mark t) (point)))
(goto-char (max (mark t) (point)))))
(funcall ,forward amount)))

(defun composable-mark-line (arg)
"Mark ARG lines.
Expand Down

0 comments on commit 189362f

Please sign in to comment.