]> git.eshelyaron.com Git - dotfiles.git/commitdiff
Update configuration
authorEshel Yaron <me@eshelyaron.com>
Mon, 4 Jul 2022 07:14:00 +0000 (10:14 +0300)
committerEshel Yaron <me@eshelyaron.com>
Mon, 4 Jul 2022 07:14:00 +0000 (10:14 +0300)
.emacs.d/esy.org

index 077168d0bfef096ad0ebc39072f65fe4b3fdbd7c..c6c043a678f6e68524d035024ebd07cb13ce37c9 100644 (file)
@@ -28,8 +28,11 @@ configuration]] is also published on my website.
 This file was last updated at:
 
 #+begin_src emacs-lisp :tangle no :exports results
-  (format-time-string "%d-%m-%Y" (file-attribute-modification-time
-                                  (file-attributes esy/source-path)))
+  (format-time-string
+   "%d-%m-%Y"
+   (file-attribute-modification-time
+    (file-attributes
+     esy/source-path)))
 #+end_src
 
 ** Current source control revision
@@ -271,6 +274,15 @@ For a list of available frame parameters, see [[info:elisp#Frame Parameters][eli
   (put 'suspend-frame 'disabled t)
 #+end_src
 
+** Variable pitch font
+:PROPERTIES:
+:CUSTOM_ID: variable-pitch-font
+:END:
+
+#+begin_src emacs-lisp
+  (set-face-font 'variable-pitch "Iosevka Etoile-13")
+#+end_src
+
 ** More display settings
 :PROPERTIES:
 :CUSTOM_ID: display-goodies
@@ -583,6 +595,18 @@ refiling directly into deeper headings as well.
         '(("P" (list project-current))))
 #+end_src
 
+** Open files (with =C-c C-o=) in Emacs
+  :PROPERTIES:
+  :CUSTOM_ID: org-file-apps-t-emacs
+  :CreatedAt: <2022-06-10 Fri>
+  :CapturedAt:
+  :CapturedAs: Emacs configuration fragment
+  :END:
+
+#+begin_src emacs-lisp
+  (setq org-file-apps '((t . emacs)))
+#+end_src
+
 * Email settings
 :PROPERTIES:
 :CUSTOM_ID: email
@@ -846,6 +870,8 @@ refiling directly into deeper headings as well.
 :END:
 
 #+begin_src emacs-lisp
+  (with-eval-after-load 'dired
+    (setq dired-dwim-target t))
   (add-hook 'dired-mode-hook #'all-the-icons-dired-mode)
 #+end_src
 
@@ -1317,6 +1343,11 @@ does in the shell.
   (add-hook 'after-init-hook #'display-battery-mode)
 #+end_src
 
+* Text mode and derivatives
+#+begin_src emacs-lisp
+  (add-hook 'text-mode-hook #'flyspell-mode)
+#+end_src
+
 * Programming
 :PROPERTIES:
 :CUSTOM_ID: programming
@@ -1565,13 +1596,13 @@ without asking each time.
     (logos--mode 'flymake-mode -1))
 
   (with-eval-after-load 'olivetti
-    (setq olivetti-body-width 80))
+    (setq olivetti-body-width 90))
 
   (with-eval-after-load 'logos
     (setq-default logos-olivetti               t
                   logos-hide-fringe            t
                   logos-scroll-lock            t
-                  logos-variable-pitch         nil
+                  logos-variable-pitch         t
                   logos-buffer-read-only       t
                   logos-hide-mode-line         t
                   logos-hide-buffer-boundaries t)
@@ -1588,6 +1619,43 @@ without asking each time.
     (logos-focus-mode 'toggle))
 #+end_src
 
+* =shell= customizations
+:PROPERTIES:
+:CUSTOM_ID: shell
+:END:
+
+** Kill =shell= buffers on exit
+Kill =M-x shell= buffers automatically when the shell process
+terminates, e.g. when pressing =C-d=.
+
+#+begin_src emacs-lisp
+  (setq shell-kill-buffer-on-exit t)
+#+end_src
+
+** Restart async shell process                                     :cmd:kbd:
+:PROPERTIES:
+:CUSTOM_ID: shell-restart-process
+:CreatedAt: <2022-07-01 Fri>
+:CapturedAt:
+:CapturedAs: Emacs configuration fragment
+:END:
+
+#+begin_src emacs-lisp
+  (defun shell-restart-process ()
+    "Restart process of `shell-mode' buffer."
+    (interactive)
+    (let* ((proc (get-buffer-process (current-buffer)))
+           (pid  (process-id proc))
+           (cmd  (caddr (process-command proc))))
+      (message "%s" cmd)
+      (delete-process proc)
+      (async-shell-command cmd)))
+
+  (with-eval-after-load 'shell
+    (keymap-set shell-mode-map "C-c C-k" #'shell-restart-process))
+#+end_src
+
+
 * Misc. settings
 :PROPERTIES:
 :CUSTOM_ID: misc
@@ -1624,31 +1692,32 @@ Add the timezones of places of interest to the list of clocks shown by
     (add-to-list 'zoneinfo-style-world-list '("Europe/Amsterdam" "Amsterdam")))
 #+end_src
 
-** =shell= customizations
+** Restart async shell process in =process-menu-mode=    :cmd:kbd:
 :PROPERTIES:
-:CUSTOM_ID: shell
-:CreatedAt: <2022-06-10 Fri>
-:CapturedAt: [[file:~/inbox.org::*Followup on this mail from Adam][Followup on this mail from Adam]]
+:CUSTOM_ID: process-menu-restart-process
+:CreatedAt: <2022-07-01 Fri>
+:CapturedAt:
 :CapturedAs: Emacs configuration fragment
 :END:
 
-Kill =M-x shell= buffers automatically when the shell process
-terminates, e.g. when pressing =C-d=.
-
 #+begin_src emacs-lisp
-  (setq shell-kill-buffer-on-exit t)
-#+end_src
-
-** Open files (with =C-c C-o=) in Emacs
-  :PROPERTIES:
-  :CUSTOM_ID: org-file-apps-t-emacs
-  :CreatedAt: <2022-06-10 Fri>
-  :CapturedAt:
-  :CapturedAs: Emacs configuration fragment
-  :END:
-
-#+begin_src emacs-lisp
-  (setq org-file-apps '((t . emacs)))
+  (defun process-menu-restart-process ()
+    "Restart process at point in a `list-processes' buffer."
+    (interactive)
+    (let* ((pos (point))
+           (pid (tabulated-list-get-id))
+           (ent (tabulated-list-get-entry))
+           (cmd (combine-and-quote-strings
+                 (seq-drop (split-string-shell-command (seq-elt ent 6))
+                           2))))
+      (delete-process pid)
+      (async-shell-command cmd)
+      (revert-buffer)))
+
+  (with-eval-after-load 'simple
+    (keymap-set process-menu-mode-map
+                "r"
+                #'process-menu-restart-process))
 #+end_src
 
 * Elisp Footer