From 1433a3916049615cc3ab4880939b3842c9242c29 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 12 Oct 2021 18:40:17 -0500 Subject: totally unhelpful commit message ;) --- init.el | 43 ++++++++++++------------------ lisp/acdw-modeline.el | 72 ++++++++++++++++++++++++++++----------------------- lisp/acdw-org.el | 3 ++- 3 files changed, 58 insertions(+), 60 deletions(-) diff --git a/init.el b/init.el index a5b77ba..e25e73f 100644 --- a/init.el +++ b/init.el @@ -515,7 +515,12 @@ "Setup eww bookmark integration." (setq-local bookmark-make-record-function #'bookmark-eww--make))) - (:bind "b" #'bookmark-set + (:bind "RET" (defun eww/browse-url (arg) + (interactive "P") + (if-let ((url (thing-at-point 'url))) + (browse-url url) + (call-interactively #'acdw/link-hint-open-link))) + "b" #'bookmark-set "B" #'bookmark-jump "M-n" nil "M-p" nil)) @@ -525,6 +530,9 @@ (add-hook 'after-save-hook #'executable-make-buffer-file-executable-if-script-p)) +(setup elec-pair + (electric-pair-mode +1)) + (setup files (:option auto-save-file-name-transforms `((".*" ,(acdw/dir "auto-save/" t) t)) auto-save-list-file-prefix (acdw/dir "auto-save-list/.saves-" t) @@ -978,8 +986,7 @@ specific to most general, they are these: shr-max-width fill-column shr-max-image-proportion 0.6 shr-image-animate t - shr-discard-aria-hidden t - shr-folding-mode t)) + shr-discard-aria-hidden t)) (setup text (:hook turn-on-auto-fill @@ -1235,7 +1242,11 @@ specific to most general, they are these: lui-fill-remove-face-from-newline nil) (:hook #'visual-fill-column-mode - #'visual-line-mode) + #'visual-line-mode + #'enable-lui-track) + + (:face lui-time-stamp-face + ((t :inherit font-lock-comment-face))) (:local-set visual-fill-column-extra-text-width (cons acdw-irc/left-margin 0) @@ -1247,9 +1258,7 @@ specific to most general, they are these: nyan-mode nil line-number-mode nil column-number-mode nil - file-percentage-mode nil) - - (:hook #'enable-lui-track))) + file-percentage-mode nil))) (setup (:straight (consult :host github @@ -1533,6 +1542,7 @@ See also `crux-reopen-as-root-mode'." (:hook #'reading-mode) (:local-set shr-max-image-proportion 0.9 shr-width nil + shr-max-width nil fill-column 0) ;; see https://irreal.org/blog/?p=8885 (:bind "SPC" (defun elfeed-scroll-up-command (&optional arg) @@ -2293,25 +2303,6 @@ the default is \"/\"." (:also-load eldoc) (eldoc-add-command 'paredit-backward-delete 'paredit-close-round)) -;; (setup (:straight paredit) -;; (:bind "DEL" #'paredit-backward-delete -;; "C-" #'paredit-backward-kill-word -;; "M-w" #'paredit-copy-as-kill -;; "RET" #'paredit-newline) - -;; (:unbind "M-s" ; paredit-splice-sexp -;; "C-j" ; paredit-newline (rebound to RET) -;; ) - -;; (:hook-into emacs-lisp-mode -;; ielm-mode sly-repl-mode -;; lisp-mode -;; lisp-interaction-mode -;; scheme-mode) - -;; (:also-load eldoc) -;; (eldoc-add-command 'paredit-backward-delete 'paredit-close-round)) - (setup (:straight paren-face) (:hook-into emacs-lisp-mode ielm-mode sly-repl-mode diff --git a/lisp/acdw-modeline.el b/lisp/acdw-modeline.el index adfcb44..d9b1c8b 100644 --- a/lisp/acdw-modeline.el +++ b/lisp/acdw-modeline.el @@ -33,13 +33,18 @@ Otherwise, cdr should be a function that takes two points (see `count-words')." (defun acdw-modeline/buffer-name () ; gonsie "Display the buffer name in a face reflecting its modified status." - (propertize (concat (format " %-20s" (truncate-string 20 (buffer-name) "~"))) - 'face 'bold - ;; (if (buffer-modified-p) - ;; 'font-lock-warning-face - ;; 'font-lock-type-face) - 'help-echo (or (buffer-file-name) - (buffer-name)))) + (propertize + (concat + (format " %-20s" + (truncate-string 20 + (string-trim (buffer-name) "*" "*") + "~"))) + 'face 'bold + ;; (if (buffer-modified-p) + ;; 'font-lock-warning-face + ;; 'font-lock-type-face) + 'help-echo (or (buffer-file-name) + (buffer-name)))) (defun acdw-modeline/erc () "ERC indicator for the modeline." @@ -90,31 +95,32 @@ Otherwise, cdr should be a function that takes two points (see `count-words')." (defun acdw-modeline/modified () ; modified from `simple-modeline' "Displays a color-coded buffer modification/read-only indicator in the mode-line." - (if (not (string-match-p "\\*.*\\*" (buffer-name))) - (let* ((read-only (and buffer-read-only (buffer-file-name))) - (modified (buffer-modified-p))) - (propertize - (concat " " - (cond - ((derived-mode-p 'special-mode - 'lui-mode) - "~") - (read-only "=") - (modified "+") - (t "-"))) - 'help-echo (format - (concat "Buffer is %s and %smodified\n" - "mouse-1: Toggle read-only status.") - (if read-only "read-only" "writable") - (if modified "" "not ")) - 'local-map (purecopy (simple-modeline-make-mouse-map - 'mouse-1 - (lambda (event) - (interactive "e") - (with-selected-window - (posn-window (event-start event)) - (read-only-mode 'toggle))))) - 'mouse-face 'mode-line-highlight)))) + (let* ((read-only (and buffer-read-only (buffer-file-name))) + (modified (buffer-modified-p))) + (propertize + (concat " " + (cond + ((string-match-p "\\*.*\\*" (buffer-name)) + "*") + ((derived-mode-p 'special-mode + 'lui-mode) + "~") + (read-only "=") + (modified "+") + (t "-"))) + 'help-echo (format + (concat "Buffer is %s and %smodified\n" + "mouse-1: Toggle read-only status.") + (if read-only "read-only" "writable") + (if modified "" "not ")) + 'local-map (purecopy (simple-modeline-make-mouse-map + 'mouse-1 + (lambda (event) + (interactive "e") + (with-selected-window + (posn-window (event-start event)) + (read-only-mode 'toggle))))) + 'mouse-face 'mode-line-highlight))) (defun acdw-modeline/narrowed () "Display an indication if the buffer is narrowed." @@ -195,7 +201,7 @@ is, if point < mark." (defun acdw-modeline/wc () "Display current `wc-buffer-stats'." (when (bound-and-true-p wc-mode) - (or wc-buffer-stats " [w]"))) + (format "%8s" (or (cadr wc-buffer-stats) "[w]")))) (defun acdw-modeline/winum () "Show the `winum' number of the current window in the modeline. diff --git a/lisp/acdw-org.el b/lisp/acdw-org.el index a1558a2..f0a1d49 100644 --- a/lisp/acdw-org.el +++ b/lisp/acdw-org.el @@ -465,7 +465,8 @@ probably abandon it at some point for a better solution (see: (save-excursion (save-match-data (widen) - (while (not (org-entry-is-todo-p)) + (while (not (or (org-entry-is-todo-p) + (org-entry-is-done-p))) ;; TODO: need a better error message (org-previous-visible-heading 1)) (org-narrow-to-subtree)))) -- cgit 1.4.1-21-gabe81