General refactor & cleanup

This commit is contained in:
Henrik Lissner 2017-06-14 21:03:20 +02:00
parent 633e693cab
commit 816df321a5
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
15 changed files with 34 additions and 41 deletions

View file

@ -25,7 +25,8 @@
(autoload 'goto-last-change "goto-chg")
(autoload 'goto-last-change-reverse "goto-chg")
(def-package! evil :demand t
(def-package! evil
:demand t
:init
(setq evil-want-C-u-scroll t
evil-want-visual-char-semi-exclusive t

View file

@ -1,16 +1,16 @@
;;; feature/workspaces/config.el -*- lexical-binding: t; -*-
;; `persp-mode' gives me workspaces, a workspace-restricted `buffer-list', and
;; file-based session persistence. I had used workgroups2 before this, but
;; abandoned it because of its instability and impact on performance.
;; `persp-mode' has proven faster and more reliable (and it's still maintained).
;; file-based session persistence. I used workgroups2 before this, but abandoned
;; it because it was unstable and slow; `persp-mode' is neither (and still
;; maintained).
;;
;; By default, sessions are auto-saved, but not auto-loaded. Use :ss or
;; By default, sessions are autosaved, but not autoloaded. Use :ss or
;; `+workspace/save-session' to save, and :sl or `+workspace/load-session' to
;; load the last autosaved session. You can give sessions a custom name so they
;; can be loaded much later.
;; can be loaded later.
;;
;; Note: persp-mode requires `workgroups' for file persistence in Emacs 24.4.
;; FYI persp-mode requires `workgroups' for file persistence in Emacs 24.4.
(defvar +workspaces-load-session-hook nil
"A hook that runs when persp loads a new session.")

View file

@ -26,8 +26,7 @@
(user-error "Not an org buffer"))
(org-save-outline-visibility nil
(let ((attachments '())
element
file)
element)
(when (and (file-directory-p org-attach-directory)
(> (length (file-expand-wildcards (expand-file-name "*" org-attach-directory))) 0))
(save-excursion

View file

@ -1,10 +1,10 @@
;;; lang/org/autoload/evil.el -*- lexical-binding: t; -*-
;;;###autoload (autoload '+org:capture "lang/org/autoload/evil" nil t)
(evil-define-operator +org:capture (&optional beg end bang)
(evil-define-operator +org:capture (&optional beg end)
"Send a selection to `doom/org-capture'."
:move-point nil :type inclusive
(interactive "<r><!>")
(interactive "<r>")
(org-capture-string
(when (and (evil-visual-state-p) beg end)
(buffer-substring beg end))))

View file

@ -155,8 +155,7 @@ fragments, opening links, or refreshing images."
(interactive)
(let* ((scroll-pt (window-start))
(context (org-element-context))
(type (org-element-type context))
(value (org-element-property :value context)))
(type (org-element-type context)))
(cond
((memq type '(planning timestamp))
(org-follow-timestamp-link))

View file

@ -1,7 +1,7 @@
;;; lang/org/autoload/util.el -*- lexical-binding: t; -*-
;;;###autoload
(defun +org-get-property (name &optional file)
(defun +org-get-property (name &optional _file) ; TODO Add FILE
"Get a propery from an org file."
(save-excursion
(goto-char 1)

View file

@ -388,7 +388,7 @@
(IS-LINUX "xdg-open \"%s\"")))))
;; Remove highlights on ESC
(defun +org|remove-occur-highlights (&rest args)
(defun +org|remove-occur-highlights ()
(when (derived-mode-p 'org-mode)
(org-remove-occur-highlights)
t))

View file

@ -631,7 +631,7 @@
:n "SPC" #'vc-annotate-show-log-revision-at-line
:n "]]" #'vc-annotate-next-revision
:n "[[" #'vc-annotate-prev-revision
:n [tab] #'vc-annotate-toggle-annotation-visibility
:n "TAB" #'vc-annotate-toggle-annotation-visibility
:n "RET" #'vc-annotate-find-revision-at-line))

View file

@ -10,7 +10,6 @@
(t
(pass))))
;;;###autoload
(defun +pass-get-field (entry fields)
(if-let (data (if (listp entry) entry (auth-pass-parse-entry entry)))
@ -25,12 +24,11 @@
;;;###autoload
(defun +pass-get-secret (entry)
(password-store-get entry))
(+pass-get-field entry 'secret))
(defun +pass-ivy-action--open-url (entry)
(if-let (url (+pass-get-field entry +pass-url-fields))
(and (or (string-prefix-p "http://" url)
(string-prefix-p "https://" url)
(and (or (string-match-p "https?://" url)
(error "Field for %s doesn't look like an url" item))
(browse-url url))
(error "Username not found.")))

View file

@ -103,8 +103,9 @@ whose dimensions may not be fully initialized by the time this is run."
(with-current-buffer (doom-fallback-buffer)
(read-only-mode +1)
(+doom-dashboard-mode)
(setq fringe-indicator-alist (cl-loop for (car . _cdr) in fringe-indicator-alist
collect (cons car nil)))
(setq fringe-indicator-alist
(cl-loop for (car . _cdr) in fringe-indicator-alist
collect (cons car nil)))
(erase-buffer)
(let* ((window (get-buffer-window (doom-fallback-buffer)))
(+doom-dashboard--width (window-width window))

View file

@ -71,7 +71,7 @@
"Ensure the fringe settings are maintained on popup restore."
(neo-global--when-window
(doom--neotree-no-fringes)))
(add-hook 'doom-popup-mode-hook #'+doom|neotree-fix-popup nil t)))
(add-hook 'doom-popup-mode-hook #'+doom|neotree-fix-popup)))
(def-package! solaire-mode