Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use external dash library #1242

Merged
merged 1 commit into from Feb 22, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -26,7 +26,7 @@ RMDIR ?= rm -rf
MAKEINFO ?= makeinfo
INSTALL_INFO ?= install-info

EFLAGS ?= -L ../git-modes -L ../cl-lib
EFLAGS ?= -L ../git-modes -L ../cl-lib -L ../dash
EMACS ?= emacs
BATCH = $(EMACS) $(EFLAGS) -batch -Q -L .
BATCHE = $(BATCH) -eval
Expand Down
57 changes: 28 additions & 29 deletions magit-popup.el
Expand Up @@ -52,6 +52,7 @@

(require 'button)
(require 'cl-lib)
(require 'dash)
(require 'format-spec)

;;;; Declarations
Expand Down Expand Up @@ -428,41 +429,39 @@ that without users being aware of it could lead to tears.

(defun magit-invoke-popup-switch (event)
(interactive (list last-command-event))
(let ((ev (magit-popup-lookup event :switches)))
(if ev
(progn (setf (magit-popup-event-use ev)
(not (magit-popup-event-use ev)))
(magit-refresh-popup-buffer))
(error "%c isn't bound to any switch" event))))
(--if-let (magit-popup-lookup event :switches)
(progn
(setf (magit-popup-event-use it)
(not (magit-popup-event-use it)))
(magit-refresh-popup-buffer))
(error "%c isn't bound to any switch" event)))

(defun magit-invoke-popup-option (event)
(interactive (list last-command-event))
(let ((ev (magit-popup-lookup event :options)))
(if ev
(progn
(if (magit-popup-event-use ev)
(setf (magit-popup-event-use ev) nil)
(let* ((arg (magit-popup-event-arg ev))
(val (funcall
(magit-popup-event-fun ev)
(concat arg (unless (string-match-p "=$" arg) ": "))
(magit-popup-event-val ev))))
(setf (magit-popup-event-use ev) t)
(setf (magit-popup-event-val ev) val)))
(magit-refresh-popup-buffer))
(error "%c isn't bound to any option" event))))
(--if-let (magit-popup-lookup event :options)
(progn
(if (magit-popup-event-use it)
(setf (magit-popup-event-use it) nil)
(let* ((arg (magit-popup-event-arg it))
(val (funcall
(magit-popup-event-fun it)
(concat arg (unless (string-match-p "=$" arg) ": "))
(magit-popup-event-val it))))
(setf (magit-popup-event-use it) t)
(setf (magit-popup-event-val it) val)))
(magit-refresh-popup-buffer))
(error "%c isn't bound to any option" event)))

(defun magit-invoke-popup-action (event)
(interactive (list last-command-event))
(let ((ev (magit-popup-lookup event :actions)))
(if ev
(let ((magit-current-popup magit-this-popup)
(magit-current-popup-args (magit-popup-get-args)))
(magit-popup-quit)
(call-interactively (magit-popup-event-fun ev)))
(if (eq event ?q)
(magit-popup-quit)
(error "%c isn't bound to any action" event)))))
(--if-let (magit-popup-lookup event :actions)
(let ((magit-current-popup magit-this-popup)
(magit-current-popup-args (magit-popup-get-args)))
(magit-popup-quit)
(call-interactively (magit-popup-event-fun it)))
(if (eq event ?q)
(magit-popup-quit)
(error "%c isn't bound to any action" event))))

(defun magit-popup-quit ()
(interactive)
Expand Down