Skip to content

Commit 092ebf0

Browse files
committed
Removed dependence on company-auctex for car-or.
Redefined as `cart--car-or'.
1 parent 6eeaf99 commit 092ebf0

4 files changed

Lines changed: 828 additions & 610 deletions

File tree

cart.el

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
;; Author: Nidish Narayanaa Balaji <nidbid@gmail.com>
66
;; Keywords: tex, mouse
77
;; Version: 0.0.1
8-
;; Package-Requires: ((emacs "25.1") (company-auctex "20200529.1835"))
8+
;; Package-Requires: ((emacs "25.1"))
99
;; URL: https://github.com/Nidish96/cart.el
1010

1111
;; This program is free software; you can redistribute it and/or modify
@@ -72,6 +72,10 @@ The behavior will be identical across sessions if these are saved."
7272
(cons (cart--key "t") #'cart-translate-tikz)
7373
(cons (cart--key "r") #'cart-rotate-tikz)))
7474

75+
(defun cart--car-or (ARG)
76+
"Return car of ARG if ARG is a cons, ARG otherwise."
77+
(if (consp ARG) (car ARG) ARG))
78+
7579
(defun cart--gmc (&optional prompt)
7680
"Prompt to click on frame and return the xy coordinates.
7781
Two behaviors are possible: (if clicked) single point returned as a
@@ -80,7 +84,8 @@ dragged region returned as a list of two point-lists (as above).
8084
8185
The optional parameter PROMPT allows one to specify a user-facing
8286
prompt. The prompt defaults to 'Click anywhere' if not provided."
83-
(if (string-equal (car-or (read-event (or prompt "Click anywhere")))
87+
(if (string-equal (cart--car-or (read-event
88+
(or prompt "Click anywhere")))
8489
"down-mouse-1")
8590
(let* ((event (read-event)) ;; read the mouse up/drag event
8691
(pos (event-start event))

cart.org

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
;; Author: Nidish Narayanaa Balaji <nidbid@gmail.com>
1313
;; Keywords: tex, mouse
1414
;; Version: 0.0.1
15-
;; Package-Requires: ((emacs "25.1") (company-auctex "20200529.1835"))
15+
;; Package-Requires: ((emacs "25.1"))
1616
;; URL: https://github.com/Nidish96/cart.el
1717

1818
;; This program is free software; you can redistribute it and/or modify
@@ -86,6 +86,10 @@
8686

8787
** Define functions for getting coordinates on screen
8888
#+begin_src emacs-lisp :tangle yes :results none
89+
(defun cart--car-or (ARG)
90+
"Return car of ARG if ARG is a cons, ARG otherwise."
91+
(if (consp ARG) (car ARG) ARG))
92+
8993
(defun cart--gmc (&optional prompt)
9094
"Prompt to click on frame and return the xy coordinates.
9195
Two behaviors are possible: (if clicked) single point returned as a
@@ -94,7 +98,8 @@
9498

9599
The optional parameter PROMPT allows one to specify a user-facing
96100
prompt. The prompt defaults to 'Click anywhere' if not provided."
97-
(if (string-equal (car-or (read-event (or prompt "Click anywhere")))
101+
(if (string-equal (cart--car-or (read-event
102+
(or prompt "Click anywhere")))
98103
"down-mouse-1")
99104
(let* ((event (read-event)) ;; read the mouse up/drag event
100105
(pos (event-start event))

test/test.pdf

-334 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)