General minor refactor + cleanup

This commit is contained in:
Henrik Lissner 2017-09-28 18:08:20 +02:00
parent dd58479a18
commit a4ddb1bc9b
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
11 changed files with 35 additions and 39 deletions

View file

@ -87,7 +87,8 @@ Returns t if popups were restored, nil otherwise."
;;;###autoload
(defun doom/popup-toggle ()
"Toggle popups."
"Toggle popups on and off. If used outside of popups (and popups are
available), it will select the nearest popup window."
(interactive)
(when (doom-popup-p)
(if doom-popup-other-window

View file

@ -55,9 +55,9 @@ recognized by DOOM's popup system. They are:
:noesc If non-nil, the popup won't be closed if you press ESC from *inside*
its window. Used by `doom/popup-close-maybe'.
:modeline By default, mode-lines are hidden in popups unless this is non-nil. If
it is a symbol, it'll use `doom-modeline' to fetch a modeline config
(in `doom-popup-mode').
:modeline By default, mode-lines are hidden in popups unless this is non-nil.
If it is a symbol, it'll use `doom-modeline' to fetch a modeline
config (in `doom-popup-mode').
:autokill If non-nil, the popup's buffer will be killed when the popup is
closed. Used by `doom*delete-popup-window'. NOTE
@ -274,20 +274,18 @@ properties."
;;
(progn ; hacks for built-in functions
(defun doom*buffer-menu (&optional arg)
"Open `buffer-menu' in a popup window."
(interactive "P")
(let ((buf (list-buffers-noselect arg)))
(doom-popup-buffer buf)
(with-current-buffer buf
(setq mode-line-format "Commands: d, s, x, u; f, o, 1, 2, m, v; ~, %; q to quit; ? for help."))))
(advice-add #'buffer-menu :override #'doom*buffer-menu)
(defun doom*suppress-pop-to-buffer-same-window (orig-fn &rest args)
(cl-letf (((symbol-function 'pop-to-buffer-same-window)
(symbol-function 'pop-to-buffer)))
(apply orig-fn args)))
(advice-add #'info :around #'doom*suppress-pop-to-buffer-same-window))
(advice-add #'info :around #'doom*suppress-pop-to-buffer-same-window)
(defun doom*buffer-menu (&optional arg)
"Open `buffer-menu' in a popup window."
(interactive "P")
(with-selected-window (doom-popup-buffer (list-buffers-noselect arg))
(setq mode-line-format "Commands: d, s, x, u; f, o, 1, 2, m, v; ~, %; q to quit; ? for help.")))
(advice-add #'buffer-menu :override #'doom*buffer-menu))
(after! comint

View file

@ -63,8 +63,7 @@ problems.")
(defvar doom-packages-dir (concat doom-local-dir "packages/")
"Where package.el and quelpa plugins (and their caches) are stored.")
(defvar doom-autoload-file
(concat doom-local-dir "autoloads.el")
(defvar doom-autoload-file (concat doom-local-dir "autoloads.el")
"Location of the autoloads file generated by `doom/reload-autoloads'.")
(defgroup doom nil

View file

@ -143,6 +143,8 @@ across windows."
(evil-define-interactive-code "<//g>"
:ex-arg global-match (list (when (evil-ex-p) evil-ex-argument)))
;; Forward declare these so that ex completion works, even if the autoloaded
;; functions aren't loaded yet.
(evil-set-command-properties
'+evil:align :move-point t :ex-arg 'buffer-match :ex-bang t :evil-mc t :keep-visual t :suppress-operator t)
(evil-set-command-properties

View file

@ -33,10 +33,12 @@ produces an url. Used by `+jump/online'.")
"Function to use to open search urls.")
(defvar +jump-function-alist nil
"TODO")
"An alist mapping major modes to jump function plists, describing what to do
with `+jump/definition', `+jump/references' and `+jump/documentation' are
called.")
(defvar-local +jump-current-functions nil
"TODO")
"The enabled jump functions for the current buffer.")
(def-setting! :jump (modes &rest plist)
"Definies a jump target for major MODES. PLIST accepts the following

View file

@ -1,10 +1,7 @@
;;; feature/version-control/config.el -*- lexical-binding: t; -*-
(unless (featurep! -git)
(load! +git))
;; TODO hg support
;; (unless (featurep! -hg)
;; (load! +hg))
(or (featurep! -git) (load! +git))
;; TODO (or (featurep! -hg) (load! +hg))
;;
(setq vc-make-backup-files nil)

View file

@ -7,13 +7,13 @@
(set! :eval 'emacs-lisp-mode #'+emacs-lisp-eval)
(set! :jump 'emacs-lisp-mode :documentation #'describe-symbol)
(set! :rotate 'emacs-lisp-mode
:symbols '(("t" "nil")
("let" "let*")
("when" "unless")
("append" "prepend")
("advice-add" "advice-remove")
("add-hook" "remove-hook")
("add-hook!" "remove-hook!")))
:symbols '(("t" "nil")
("let" "let*")
("when" "unless")
("append" "prepend")
("advice-add" "advice-remove")
("add-hook" "remove-hook")
("add-hook!" "remove-hook!")))
(add-hook! 'emacs-lisp-mode-hook
#'(;; 3rd-party functionality

View file

@ -3,15 +3,13 @@
(def-package! ledger-mode
:mode "\\.ledger$"
:commands ledger-mode
:config
(setq ledger-clear-whole-transactions 1))
:config (setq ledger-clear-whole-transactions 1))
(def-package! evil-ledger
:when (featurep! :feature evil)
:after ledger-mode
:config
(add-hook 'ledger-mode-hook #'evil-ledger-mode))
:config (add-hook 'ledger-mode-hook #'evil-ledger-mode))
(def-package! flycheck-ledger

View file

@ -8,8 +8,9 @@
:group 'evil-org
(setq org-hide-emphasis-markers +org-pretty-mode)
(org-toggle-pretty-entities)
;; In case the above un-align tables
(org-table-map-tables 'org-table-align t))
(org-with-silent-modifications
;; In case the above un-align tables
(org-table-map-tables 'org-table-align t)))
;;;###autoload
(defun +org|realign-table-maybe ()

View file

@ -42,8 +42,6 @@
(ex! "grevert" #'git-gutter:revert-hunk)
;; Dealing with buffers
(evil-set-command-properties #'+workspace/cleanup :ex-bang t)
(ex! "clean[up]" #'+workspace/cleanup)
(ex! "k[ill]" #'doom/kill-this-buffer)
(ex! "k[ill]all" #'+hlissner:kill-all-buffers)

View file

@ -24,4 +24,4 @@ current project's root."
(defun +term/open-popup-in-project ()
"Open a terminal popup window in the root of the current project."
(interactive)
(+term/popup t))
(+term/open-popup t))