General code cleanup

This commit is contained in:
Henrik Lissner 2016-03-23 11:51:29 -04:00
parent d655fc853f
commit 41e4cc919e
4 changed files with 11 additions and 11 deletions

View file

@ -61,10 +61,10 @@ automatically renamed to the project name.")
(add-hook 'focus-out-hook 'narf|wg-autosave-disable) (add-hook 'focus-out-hook 'narf|wg-autosave-disable)
(add-hook 'focus-in-hook 'narf|wg-autosave-enable) (add-hook 'focus-in-hook 'narf|wg-autosave-enable)
;; Don't mess with the modeline! ;; Seriously, don't mess with the modeline! `wg-mode-line-display-on' isn't enough
(advice-add 'wg-change-modeline :override 'ignore) (advice-add 'wg-change-modeline :override 'ignore)
;; Don't remember popup windows ;; Don't remember popup and neotree windows
(add-hook! kill-emacs (add-hook! kill-emacs
(narf/popup-close-all) (narf/popup-close-all)
(when (and (featurep 'neotree) (neo-global--window-exists-p)) (when (and (featurep 'neotree) (neo-global--window-exists-p))

View file

@ -145,21 +145,16 @@
(use-package nlinum (use-package nlinum
:commands nlinum-mode :commands nlinum-mode
:preface :preface
(defface linum-highlight-face '((t (:inherit linum))) "Face for line highlights")
(defvar narf--hl-nlinum-overlay nil) (defvar narf--hl-nlinum-overlay nil)
(defvar narf--hl-nlinum-line nil) (defvar narf--hl-nlinum-line nil)
(defvar nlinum-format "%4d ") (defvar nlinum-format "%4d ")
(defface linum-highlight-face '((t (:inherit linum))) "Face for line highlights")
(setq linum-format "%3d ") (setq linum-format "%3d ")
:init :init
(defun narf|nlinum-enable () (defun narf|nlinum-enable ()
(nlinum-mode +1) (nlinum-mode +1)
(add-hook 'post-command-hook 'narf|nlinum-hl-line t)) (add-hook 'post-command-hook 'narf|nlinum-hl-line t))
(defun narf|nlinum-disable ()
(nlinum-mode -1)
(remove-hook 'post-command-hook 'narf|nlinum-hl-line)
(narf|nlinum-unhl-line))
(add-hook! (add-hook!
(markdown-mode prog-mode scss-mode web-mode conf-mode) (markdown-mode prog-mode scss-mode web-mode conf-mode)
'narf|nlinum-enable) 'narf|nlinum-enable)
@ -320,8 +315,7 @@ anzu to be enabled."
;; TODO mode-line-iedit-face default face ;; TODO mode-line-iedit-face default face
(spaceline-define-segment *iedit (spaceline-define-segment *iedit
"Show the number of matches and what match you're on (or after). Requires "Show the number of matches and what match you're on (or after). Requires iedit."
iedit."
(let ((this-oc (iedit-find-current-occurrence-overlay)) (let ((this-oc (iedit-find-current-occurrence-overlay))
(length (or (ignore-errors (length iedit-occurrences-overlays)) 0))) (length (or (ignore-errors (length iedit-occurrences-overlays)) 0)))
(format " %s/%s " (format " %s/%s "

View file

@ -7,5 +7,11 @@
(narf|nlinum-disable) (narf|nlinum-disable)
(narf|nlinum-enable))) (narf|nlinum-enable)))
;;;###autoload
(defun narf|nlinum-disable ()
(nlinum-mode -1)
(remove-hook 'post-command-hook 'narf|nlinum-hl-line)
(narf|nlinum-unhl-line))
(provide 'defuns-nlinum) (provide 'defuns-nlinum)
;;; defuns-nlinum.el ends here ;;; defuns-nlinum.el ends here

View file

@ -29,7 +29,7 @@
;;;###autoload (autoload 'narf:workgroup-new "defuns-workgroup" nil t) ;;;###autoload (autoload 'narf:workgroup-new "defuns-workgroup" nil t)
(evil-define-command narf:workgroup-new (bang name &optional silent) (evil-define-command narf:workgroup-new (bang name &optional silent)
"Create a new workgroup. If BANG, clone the current one to it." "Create a new workgroup. If BANG, overwrite any workgroup named NAME."
(interactive "<!><a>") (interactive "<!><a>")
(unless name (unless name
(setq name (format "#%s" (1+ (length (wg-workgroup-list)))))) (setq name (format "#%s" (1+ (length (wg-workgroup-list))))))