doomemacs/modules/feature/workspaces/autoload/evil.el
Henrik Lissner c7254e7bdc
Major optimization refactor, across the board
+ enable lexical-scope everywhere (lexical-binding = t): ~5-10% faster
  startup; ~5-20% general boost
+ reduce consing, function calls & garbage collection by preferring
  cl-loop & dolist over lambda closures (for mapc[ar], add-hook, and
  various cl-lib filter/map/reduce functions) -- where possible
+ prefer functions with dedicated opcodes, like assq (see byte-defop's
  in bytecomp.el for more)
+ prefer pcase & cond (faster) over cl-case
+ general refactor for code readability
+ ensure naming & style conventions are adhered to
+ appease byte-compiler by marking unused variables with underscore
+ defer minor mode activation to after-init, emacs-startup or
  window-setup hooks; a customization opportunity for users + ensures
  custom functionality won't interfere with startup.
2017-06-09 00:47:45 +02:00

52 lines
2.7 KiB
EmacsLisp

;;; feature/workspaces/autoload/evil.el -*- lexical-binding: t; -*-
;;;###autoload (autoload '+workspace:save-session "feature/workspaces/autoload/evil" nil t)
(evil-define-command +workspace:save-session (&optional bang name)
"Ex wrapper around `+workspace/save-session'. If BANG, then autosave
(pointless if autosaving/loading is off). If NAME is nil, default to 'last'."
(interactive "<!><a>")
(+workspace/save-session (if bang persp-auto-save-fname name)))
;;;###autoload (autoload '+workspace:load-session "feature/workspaces/autoload/evil" nil t)
(evil-define-command +workspace:load-session (&optional bang name)
"Ex wrapper around `+workspace/load-session'. If BANG, then load last autosave
(pointless if autosaving/loading is off). If NAME is nil, defaults to 'last'."
(interactive "<!><a>")
(+workspace/load-session (if bang persp-auto-save-fname name)))
;;;###autoload (autoload '+workspace:save "feature/workspaces/autoload/evil" nil t)
(evil-define-command +workspace:save (&optional name)
"Ex wrapper around `+workspace/save-session'."
(interactive "<a>") (+workspace/save name))
;;;###autoload (autoload '+workspace:load "feature/workspaces/autoload/evil" nil t)
(evil-define-command +workspace:load (&optional name)
"Ex wrapper around `+workspace/load-session'."
(interactive "<a>") (+workspace/load name))
;;;###autoload (autoload '+workspace:new "feature/workspaces/autoload/evil" nil t)
(evil-define-command +workspace:new (bang name)
"Ex wrapper around `+workspace/new'. If BANG, clone the current workspace."
(interactive "<!><a>") (+workspace/new name bang))
;;;###autoload (autoload '+workspace:rename "feature/workspaces/autoload/evil" nil t)
(evil-define-command +workspace:rename (new-name)
"Ex wrapper around `+workspace/rename'."
(interactive "<a>") (+workspace/rename new-name))
;;;###autoload (autoload '+workspace:delete "feature/workspaces/autoload/evil" nil t)
(evil-define-command +workspace:delete ()
"Ex wrapper around `+workspace/delete'."
(interactive "<a>") (+workspace/delete (+workspace-current-name)))
;;;###autoload (autoload '+workspace:switch-next "feature/workspaces/autoload/evil" nil t)
(evil-define-command +workspace:switch-next (&optional count)
"Switch to next workspace. If COUNT, switch to COUNT-th workspace."
(interactive "<c>")
(if count (+workspace/switch-to count) (+workspace/cycle +1)))
;;;###autoload (autoload '+workspace:switch-previous "feature/workspaces/autoload/evil" nil t)
(evil-define-command +workspace:switch-previous (&optional count)
"Switch to previous workspace. If COUNT, switch to COUNT-th workspace."
(interactive "<c>")
(if count (+workspace/switch-to count) (+workspace/cycle -1)))