summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorCraig Jennings <craigmartinjennings@gmail.com>2024-04-11 17:29:10 -0500
committerCraig Jennings <craigmartinjennings@gmail.com>2024-04-11 17:29:10 -0500
commit43e1f37c02f216a36312876d56a8f313aabcf07a (patch)
treeea694f58737db225b5ac75beacb50a5d01515ad4 /modules
parent84c0963ec2096148932ec4ce8529a029cf930121 (diff)
additional bug fixing
- stray cj/bookmark-set-and-save references replaced with bookmark-set - added warning level for errors - added an alternate elpa-mirrors location (git repos shouldn't be added inside a git repo) - added default font size to "Berkeley Only" and the default in fontaine - updated eww to search using frog find for readability - fixed typo on comments in user-constants - moved easy hugo configuration higher for easier accessibility - move "insert around" function to custom functions
Diffstat (limited to 'modules')
-rw-r--r--modules/calibredb-epub-config.el2
-rw-r--r--modules/custom-functions.el51
-rw-r--r--modules/eww-config.el9
-rw-r--r--modules/font-config.el5
-rw-r--r--modules/help-utils.el2
-rw-r--r--modules/org-capture-config.el10
-rw-r--r--modules/pdf-config.el2
-rw-r--r--modules/test-code.el59
-rw-r--r--modules/user-constants.el4
9 files changed, 85 insertions, 59 deletions
diff --git a/modules/calibredb-epub-config.el b/modules/calibredb-epub-config.el
index 4b794cd3..11aca93d 100644
--- a/modules/calibredb-epub-config.el
+++ b/modules/calibredb-epub-config.el
@@ -44,7 +44,7 @@
;; :hook (nov-mode . cj/nov-apply-preferences)
:bind
(:map nov-mode-map
- ("m" . cj/bookmark-set-and-save)
+ ("m" . bookmark-set)
("b" . bookmark-bmenu-list)
("r" . nov-render-document)
("l" . recenter-top-bottom)
diff --git a/modules/custom-functions.el b/modules/custom-functions.el
index 414d3108..345ebd08 100644
--- a/modules/custom-functions.el
+++ b/modules/custom-functions.el
@@ -238,7 +238,54 @@ User is prompted for the optional descriptor."
(unless (bolp) (insert "\n"))
(insert "```\n")
(goto-char start)
- (insert (concat "```" lang "\n")))))
+ (insert (concat "```" lang "\n")))))
+
+;; ------------------------ Insert Around Word Or Region -----------------------
+
+(defun cj/insert-around-word-or-region ()
+ "Prompt for a string, insert it before and after the word at point or selected region."
+ (interactive)
+ (let ((str (read-string "Enter a string: "))
+ (regionp (use-region-p)))
+ (save-excursion
+ (if regionp
+ (let ((beg (region-beginning))
+ (end (region-end)))
+ (goto-char end)
+ (insert str)
+ (goto-char beg)
+ (insert str))
+ (if (thing-at-point 'word)
+ (let ((bounds (bounds-of-thing-at-point 'word)))
+ (goto-char (cdr bounds))
+ (insert str)
+ (goto-char (car bounds))
+ (insert str))
+ (message "Can't insert around. No word at point and no region selected."))))))
+
+(global-set-key (kbd "C-; i a") 'cj/insert-around-word-or-region)
+;; ------------------------ Insert Around Word Or Region -----------------------
+
+(defun cj/insert-around-word-or-region ()
+ "Prompt for a string, insert it before and after the word at point or selected region."
+ (interactive)
+ (let ((str (read-string "Enter a string: "))
+ (regionp (use-region-p)))
+ (save-excursion
+ (if regionp
+ (let ((beg (region-beginning))
+ (end (region-end)))
+ (goto-char end)
+ (insert str)
+ (goto-char beg)
+ (insert str))
+ (if (thing-at-point 'word)
+ (let ((bounds (bounds-of-thing-at-point 'word)))
+ (goto-char (cdr bounds))
+ (insert str)
+ (goto-char (car bounds))
+ (insert str))
+ (message "Can't insert around. No word at point and no region selected."))))))
;; -------------------- Append To Lines In Region Or Buffer --------------------
;; append characters to the end of all lines in the region or the whole buffer.
@@ -536,6 +583,8 @@ Uses `sortable-time-format' for the formatting the date/time."
(global-set-key (kbd "C-; b m") 'cj/move-buffer-and-file)
;; copy link to source file
(global-set-key (kbd "C-; b l") 'cj/copy-link-to-source-file)
+;; insert around
+(global-set-key (kbd "C-; i a") 'cj/insert-around-word-or-region)
(provide 'custom-functions)
;;; custom-functions.el ends here.
diff --git a/modules/eww-config.el b/modules/eww-config.el
index f0ee51a6..3476d068 100644
--- a/modules/eww-config.el
+++ b/modules/eww-config.el
@@ -17,12 +17,13 @@
("i" . eww-toggle-images)
("o" . eww-open-in-new-buffer))
:config
- (setq shr-use-colors nil) ;; respect colors in the html
- (setq shr-bullet "• ") ;; unordered lists use bullet glyph
+ (setq shr-use-colors nil) ;; respect colors in the html
+ (setq shr-bullet "• ") ;; unordered lists use bullet glyph
(setq shr-folding-mode t)
- (setq eww-search-prefix "https://duckduckgo.com/html?q=") ;; use Duck Duck Go as search engine
+ (setq eww-search-prefix "http://frogfind.com/?q=") ;; use Frog Find as search engine
+ ;; (setq eww-search-prefix "https://duckduckgo.com/html?q=") ;; use Duck Duck Go as search engine
(setq url-cookie-file "~/.local/share/cookies.txt")
- (setq url-privacy-level '(email agent lastloc))) ;; don't send any info listed here
+ (setq url-privacy-level '(email agent lastloc))) ;; don't send any info listed here
(provide 'eww-config)
;;; eww-config.el ends here
diff --git a/modules/font-config.el b/modules/font-config.el
index fc9d8b18..9df45c48 100644
--- a/modules/font-config.el
+++ b/modules/font-config.el
@@ -24,7 +24,8 @@
:variable-pitch-family "Hack Nerd Font Mono")
(Berkeley-Only
:default-family "Berkeley Mono"
- :variable-pitch-family "Berkeley Mono")
+ :default-height 120
+ :variable-pitch-family "Berkeley Mono")
(Merriweather-Only
:default-family "Merriweather"
:variable-pitch-family "Merriweather")
@@ -58,7 +59,7 @@
(t ;; shared fallback properties go here
:default-family "Berkeley Mono"
:default-weight regular
- :default-height 110
+ :default-height 120
:fixed-pitch-family nil ;; falls back to :default-family
:fixed-pitch-weight nil ;; falls back to :default-weight
:fixed-pitch-height 1.0
diff --git a/modules/help-utils.el b/modules/help-utils.el
index 199e6815..d6301782 100644
--- a/modules/help-utils.el
+++ b/modules/help-utils.el
@@ -42,7 +42,7 @@
:ensure nil ;; built-in
:bind
(:map Info-mode-map
- ("m" . cj/bookmark-set-and-save) ;; note:overrides menu selection
+ ("m" . bookmark-set) ;; note:overrides menu selection
("M" . Info-menu)) ;; so menu selection goes here
:preface
(defun open-with-info-mode ()
diff --git a/modules/org-capture-config.el b/modules/org-capture-config.el
index 3cdb45fd..8feab2bf 100644
--- a/modules/org-capture-config.el
+++ b/modules/org-capture-config.el
@@ -2,7 +2,7 @@
;;; Commentary:
;; Customizations related to org-capture and org-refile is here.
-;; This includes 'org-webpage-clipper' functionality.
+;; This includes 'cj/org-webpage-clipper' functionality.
;; To ensure the code below is only loaded after org-mode, all code is wrapped in an
;; eval-after-load function.
@@ -17,7 +17,7 @@
;; Saves a copy of the page eww is visiting in the 'articles'-file for offline
;; reading. In other words, it's a "Poor Man's Pocket/Instapaper"
- (defun org-webpage-clipper ()
+ (defun cj/org-webpage-clipper ()
"Capture a web page for later viewing in an org-file.
Encodes all links and marks that may interfere with org mode
display, then inserts the content into a file for later offline use.
@@ -26,7 +26,7 @@ This is meant to be used in coordination with an org-capture-template.
Example Template:
,@
-(\"w\" \"Website\" plain (function org-webpage-clipper)
+(\"w\" \"Website\" plain (function cj/org-webpage-clipper)
\"* %a\\nArticle Link: %L\\nCaptured On: %U\\n\\n\" :immediate-finish t)
'@"
(interactive)
@@ -98,8 +98,8 @@ Intended to be called within an org capture template."
"* TODO %?%(if (string= \"%i\" \"\") \"\" \"\n#+BEGIN_QUOTE\n%i\n#+END_QUOTE\")\n[[%:link][%:description]]\nCaptured On: %U"
:prepend t)
- ("w" "Website" plain
- (function org-webpage-clipper)
+ ("w" "Web Page Clipper" plain
+ (function cj/org-webpage-clipper)
"* %a\nArticle Link: %L\nCaptured On: %U\n\n" :immediate-finish t)))
) ;; end with-eval-after-load 'org
diff --git a/modules/pdf-config.el b/modules/pdf-config.el
index 518f3883..911140f2 100644
--- a/modules/pdf-config.el
+++ b/modules/pdf-config.el
@@ -18,7 +18,7 @@
:bind
(:map pdf-view-mode-map
("M" . pdf-view-midnight-minor-mode)
- ("m" . cj/bookmark-set-and-save)
+ ("m" . bookmark-set)
("z" . (lambda () (interactive) (cj/open-file-with-command "zathura")))
("e" . (lambda () (interactive) (cj/open-file-with-command "evince")))
("j" . pdf-view-next-line-or-next-page)
diff --git a/modules/test-code.el b/modules/test-code.el
index 85e7bce6..6c4fadcd 100644
--- a/modules/test-code.el
+++ b/modules/test-code.el
@@ -29,6 +29,23 @@
:config
(setf yeetube-mpv-disable-video nil))
+;; --------------------------------- Easy Hugo ---------------------------------
+
+(use-package easy-hugo
+ :defer .5
+ :init
+ (setq easy-hugo-basedir "~/code/cjennings.net/")
+ (setq easy-hugo-url "https://cjennings.net")
+ (setq easy-hugo-sshdomain "cjennings.net")
+ (setq easy-hugo-root "/var/www/cjennings/")
+ (setq easy-hugo-previewtime "300")
+ (setq easy-hugo-postdir "content")
+ (setq easy-hugo-server-flags "-D")
+ (setq easy-hugo-default-ext ".md")
+ :bind ("C-c H" . easy-hugo)
+ :config
+ (easy-hugo-enable-menu))
+
;; --------------------------------- Recording ---------------------------------
@@ -78,51 +95,9 @@ otherwise use the default location in `cj/recording-location'."
(setq cj/ffmpeg-process nil)
(message "Stopped recording process.")))
-;; ------------------------ Insert Around Word Or Region -----------------------
-
-(defun cj/insert-around-word-or-region ()
- "Prompt for a string, insert it before and after the word at point or selected region."
- (interactive)
- (let ((str (read-string "Enter a string: "))
- (regionp (use-region-p)))
- (save-excursion
- (if regionp
- (let ((beg (region-beginning))
- (end (region-end)))
- (goto-char end)
- (insert str)
- (goto-char beg)
- (insert str))
- (if (thing-at-point 'word)
- (let ((bounds (bounds-of-thing-at-point 'word)))
- (goto-char (cdr bounds))
- (insert str)
- (goto-char (car bounds))
- (insert str))
- (message "Can't insert around. No word at point and no region selected."))))))
-
-(global-set-key (kbd "C-; i a") 'cj/insert-around-word-or-region)
-
-;; --------------------------------- Easy Hugo ---------------------------------
-
-(use-package easy-hugo
- :defer .5
- :init
- (setq easy-hugo-basedir "~/code/cjennings.net/")
- (setq easy-hugo-url "https://cjennings.net")
- (setq easy-hugo-sshdomain "cjennings.net")
- (setq easy-hugo-root "/var/www/cjennings/")
- (setq easy-hugo-previewtime "300")
- (setq easy-hugo-postdir "content")
- (setq easy-hugo-server-flags "-D")
- (setq easy-hugo-default-ext ".md")
- :bind ("C-c H" . easy-hugo)
- :config
- (easy-hugo-enable-menu))
;; -------------------------------- Google This --------------------------------
-;; BUG: Fix warnings and errors thrown
(use-package google-this
:load-path "~/code/emacs-google-this/"
:defer 1
diff --git a/modules/user-constants.el b/modules/user-constants.el
index f42389d5..269ea540 100644
--- a/modules/user-constants.el
+++ b/modules/user-constants.el
@@ -9,7 +9,7 @@
;; ------------------------ Directory And File Constants -----------------------
-## DIRECTORIES
+;; DIRECTORIES
(defconst emacs-init-file (concat user-emacs-directory "init.el")
"The location of Emacs's main init file.")
@@ -34,7 +34,7 @@
(defconst snippets-dir (concat sync-dir "snippets/")
"The location of ya-snippet snippets.")
-### FILES
+;; FILES
(defvar schedule-file (concat sync-dir "schedule.org")
"The location of the org file containing scheduled events.")