]> git.donarmstrong.com Git - lib.git/blobdiff - emacs_el/configuration/don-configuration.org
add flycheck
[lib.git] / emacs_el / configuration / don-configuration.org
index c1ee1c1f57150fac5fdc94e9d82bc5cbbbcb8ce3..6235cc871256b51bf0d5be3082728b4e4bd7ee6a 100644 (file)
@@ -1,4 +1,5 @@
 #+PROPERTY: header-args:emacs-lisp :tangle don-configuration.el
+#+OPTIONS: auto-id:f
 * Load debugger
 
 # if for some reason, things get pear-shaped, we want to be able to
@@ -7,6 +8,25 @@
 #+BEGIN_SRC emacs-lisp
 (setq debug-on-event 'siguser2)
 #+END_SRC
+* Paths
+** Update PATH
+#+BEGIN_SRC emacs-lisp
+  (add-to-list 'exec-path '"/usr/local/bin")
+  (add-to-list 'exec-path '"~/bin/")
+#+END_SRC
+** Add library paths
+#+BEGIN_SRC emacs-lisp
+(eval-when-compile
+  (let ((default-directory "~/var/emacs/elpa"))
+    (normal-top-level-add-subdirs-to-load-path))
+  )
+(add-to-list 'load-path '"~/lib/emacs_el/")
+(let ((default-directory "~/lib/emacs_el/"))
+  (normal-top-level-add-subdirs-to-load-path))
+(let ((default-directory "~/var/emacs/elpa"))
+  (normal-top-level-add-subdirs-to-load-path))
+(setq package-user-dir "~/var/emacs/elpa")
+#+END_SRC
 * Initial startup stuff
 ** Disable startup screen
 #+BEGIN_SRC emacs-lisp
 #+END_SRC
 * Package management
 ** package repositories and package manager
-Borrowed from https://github.com/nilcons/emacs-use-package-fast/ to
-load  [[https://github.com/jwiegley/use-package/][use-package]] even faster
-#+BEGIN_SRC emacs-lisp
-  (eval-and-compile
-    ;; add /etc/ssl/ca-global/ca-certificates.crt so that we can
-    ;; download packages when we're on Debian hosts which chop down the
-    ;; list of available certificates
-    (require 'gnutls)
-    (add-to-list 'gnutls-trustfiles "/etc/ssl/ca-global/ca-certificates.crt")
-    (setq package-enable-at-startup nil)
-    (setq package--init-file-ensured t)
-    (setq package-user-dir "~/var/emacs/elpa")
-    (setq package-archives '(("gnu" . "https://elpa.gnu.org/packages/")
-                             ("melpa" . "https://melpa.org/packages/")
-                             ("org" . "http://orgmode.org/elpa/")))
-    (setq use-package-verbose (not (bound-and-true-p byte-compile-current-file))))
-  (mapc #'(lambda (add) (add-to-list 'load-path add))
-    (eval-when-compile
-      (package-initialize)
-      (unless (package-installed-p 'use-package)
-        (package-refresh-contents)
-        (package-install 'use-package))
-      (let ((package-user-dir-real (file-truename package-user-dir)))
-        ;; The reverse is necessary, because outside we mapc
-        ;; add-to-list element-by-element, which reverses.
-        (nreverse (apply #'nconc
-                 ;; Only keep package.el provided loadpaths.
-                 (mapcar #'(lambda (path)
-                     (if (string-prefix-p package-user-dir-real path)
-                         (list path)
-                       nil))
-                     load-path))))))
-
-  ;;; fix up info paths for packages
-  (with-eval-after-load "info"
-    (info-initialize)
-    (dolist (dir (directory-files package-user-dir))
-      (let ((fdir (concat (file-name-as-directory package-user-dir) dir)))
-        (unless (or (member dir '("." ".." "archives" "gnupg"))
-                    (not (file-directory-p fdir))
-                    (not (file-exists-p (concat (file-name-as-directory fdir) "dir"))))
-          (add-to-list 'Info-directory-list fdir)))))
-
-
-  (eval-when-compile
-    (require 'use-package))
-  (require 'bind-key)
-  (require 'diminish)
+#+BEGIN_SRC emacs-lisp
+  (require 'use-package)
+(require 'gnutls)
+  (add-to-list 'gnutls-trustfiles "/etc/ssl/ca-global/ca-certificates.crt")
+  (setq package-enable-at-startup nil)
+  (setq package--init-file-ensured t)
+  (setq package-user-dir "~/var/emacs/elpa")
+  (setq package-archives '(("gnu" . "https://elpa.gnu.org/packages/")
+                          ("melpa" . "https://melpa.org/packages/")
+                          ("org" . "http://orgmode.org/elpa/")))
+  (setq use-package-verbose (not (bound-and-true-p byte-compile-current-file)))
+
 #+END_SRC
 ** Paradox
 #+BEGIN_SRC emacs-lisp
@@ -84,18 +68,6 @@ load  [[https://github.com/jwiegley/use-package/][use-package]] even faster
     (setq paradox-github-token t) ; I don't want to be prompted about this integration
     )
 #+END_SRC
-* Paths
-** Update PATH
-#+BEGIN_SRC emacs-lisp
-  (add-to-list 'exec-path '"/usr/local/bin")
-  (add-to-list 'exec-path '"~/bin/")
-#+END_SRC
-** Add library paths
-
-#+BEGIN_SRC emacs-lisp
-  (add-to-list 'load-path '"~/lib/emacs_el/")
-  (add-to-list 'load-path '"~/lib/emacs_el/magit-annex")
-#+END_SRC
 * Disable custom-vars
 #+BEGIN_SRC emacs-lisp
   ;; Set the custom file to /dev/null and don't bother to load it
@@ -169,6 +141,36 @@ load  [[https://github.com/jwiegley/use-package/][use-package]] even faster
     )
 
 #+END_SRC
+
+** Flycheck
+#+begin_src emacs-lisp :tangle yes
+(use-package flycheck
+  :ensure t
+  :diminish ðŸ¦‹
+  :if (version<= "24.4" emacs-version)
+  :commands flycheck-mode
+  :hook ((prog-mode . flycheck-mode)
+         )
+)
+;; Other pkgs
+(use-package flycheck-tip
+  :ensure t
+  :commands 'flycheck-tip-cycle
+  :after flycheck
+  :bind (:map flycheck-mode-map
+              ("C-c C-n" . flycheck-tip-cycle)))
+
+(use-package flycheck-package
+  :ensure t)
+
+(use-package flycheck-checkpatch
+  :ensure t
+  :config (flycheck-checkpatch-setup)
+  :config (setq flycheck-checkers (delete 'checkpatch
+  flycheck-checkers))
+  :config (add-to-list 'flycheck-checkers 'checkpatch t))
+#+end_src  
+
 ** Flymake
 #+begin_src emacs-lisp :tangle yes
   (use-package flymake
@@ -1327,9 +1329,6 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori
     )
 #+END_SRC
 ** Multiple Cursors
-   :PROPERTIES:
-   :ID:       6fcf218b-a762-4c37-9339-a8202ddeb544
-   :END:
 [[https://github.com/magnars/multiple-cursors.el][Multiple Cursors]]
 #+BEGIN_SRC emacs-lisp
   (use-package multiple-cursors
@@ -1836,22 +1835,27 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori
   (setq org-use-fast-todo-selection t)
   (setq org-treat-S-cursor-todo-selection-as-state-change nil)
 
-  ; create function to create headlines in file. This comes from
-  ; http://stackoverflow.com/questions/13340616/assign-ids-to-every-entry-in-org-mode
-  (defun my/org-add-ids-to-headlines-in-file ()
-    "Add ID properties to all headlines in the current file which
-  do not already have one."
-    (interactive)
-    (org-map-entries 'org-id-get-create))
-  (defun dla/org-update-ids-to-headlines-in-file ()
-    "Add or replace ID properties to all headlines in the current file 
-  (or narrowed region)."
-    (interactive)
-    (org-map-entries '(lambda () (org-id-get-create t))))
-  ; if we wanted to do this to every buffer, do the following:
-  (add-hook 'org-mode-hook
-            (lambda ()
-              (add-hook 'before-save-hook 'my/org-add-ids-to-headlines-in-file nil 'local)))
+; create function to create headlines in file. This comes from
+; http://stackoverflow.com/questions/13340616/assign-ids-to-every-entry-in-org-mode
+(defun my/org-add-ids-to-headlines-in-file ()
+  "Add ID properties to all headlines in the current file which
+do not already have one."
+  (interactive)
+  (save-excursion
+    (widen)
+    (goto-char (point-min))
+    (when (not (re-search-forward "^#\\+OPTIONS:.*auto-id:f" (point-max) t))
+      (org-map-entries 'org-id-get-create))))
+(defun dla/org-update-ids-to-headlines-in-file ()
+  "Add or replace ID properties to all headlines in the current file 
+(or narrowed region)."
+  (interactive)
+
+  (org-map-entries '(lambda () (org-id-get-create t))))
+; if we wanted to do this to every buffer, do the following:
+(add-hook 'org-mode-hook
+          (lambda ()
+            (add-hook 'before-save-hook 'my/org-add-ids-to-headlines-in-file nil 'local)))
 #+END_SRC
 ** Org ID locations
 #+BEGIN_SRC emacs-lisp
@@ -2103,9 +2107,6 @@ Maildir, or by Message-ID."
 
 #+END_SRC
 ** LaTeX configuration
-   :PROPERTIES:
-   :ID:       7135ba17-6a50-4eed-84ca-b90afa5b12f8
-   :END:
 #+BEGIN_SRC emacs-lisp
 (use-package ox-extra
   :config