Merge branch 'main' of git.sr.ht:~marcuskammer/emacs.d

This commit is contained in:
Marcus Kammer 2024-07-29 11:19:11 +02:00
commit 635172f6e9
3 changed files with 18 additions and 16 deletions

View file

@ -34,11 +34,11 @@ Uses `mk/hyperspec-dir-locations' to find the directory."
;; Stop SLIME's REPL from grabbing DEL,
;; which is annoying when backspacing over a '('
(defun override-slime-repl-bindings-with-paredit ()
(define-key slime-repl-mode-map
(read-kbd-macro paredit-backward-delete-key) nil))
;; (defun override-slime-repl-bindings-with-paredit ()
;; (define-key slime-repl-mode-map
;; (read-kbd-macro paredit-backward-delete-key) nil))
(add-hook 'slime-repl-mode-hook 'override-slime-repl-bindings-with-paredit)
;; (add-hook 'slime-repl-mode-hook 'override-slime-repl-bindings-with-paredit)
(setq common-lisp-hyperspec-symbol-table
(concat common-lisp-hyperspec-root "Data/Map_Sym.txt"))
@ -380,8 +380,7 @@ Uses `mk/hyperspec-dir-locations' to find the directory."
(ielm-mode . paredit-mode)
(lisp-mode . paredit-mode)
(lisp-interaction-mode . paredit-mode)
(scheme-mode . paredit-mode)
(slime-repl-mode . paredit-mode))
(scheme-mode . paredit-mode))
:bind (:map paredit-mode-map
("M-s" . nil)
("C-M-s" . paredit-splice-sexp)))

View file

@ -82,6 +82,7 @@
("https://drewdevault.com/blog/index.xml" blog programming computer)
("https://www.inverse.com/rss" culture magazin journalism)
("https://inkppl.com/en/rss.xml" tattoo magazin people culture)
("https://novaramedia.com/feed/" politics capitalism climate left media)
))
(setq elfeed-search-filter "@7-day-ago +unread")
(let ((feeds (expand-file-name "~/feeds.el")))

View file

@ -24,11 +24,12 @@
:init (auto-insert-mode 1)
:config
(setq auto-insert-query nil)
(setq auto-insert-alist
(append '((("\\.lisp\\'" . "Lisp header")
nil
";;;; -*- mode: common-lisp; coding: utf-8; -*-\n"))
auto-insert-alist)))
(let ((new-templates '((("\\.sh\\'" . "Shell script header") nil "#!/bin/bash\n# -*- mode: shell-script; coding: utf-8; -*-\n")
(("\\.js\\'" . "JavaScript header") nil "#!/usr/bin/env node\n// -*- mode: js; coding: utf-8; -*-\n")
(("\\.css\\'" . "CSS header") nil "/* -*- mode: css; coding: utf-8; -*-\n * Dependencies: none\n */\n")
(("\\.html\\'" . "HTML header") nil "<!-- -*- mode: web; coding: utf-8; -*- -->\n")
(("\\.lisp\\'" . "Lisp header") nil ";;;; -*- mode: common-lisp; coding: utf-8; -*-\n"))))
(setq auto-insert-alist (nconc new-templates auto-insert-alist))))
(use-package tramp
:ensure nil
@ -391,13 +392,17 @@
:config
(when (eq system-type 'windows-nt)
(setq gptel-use-curl t))
(setq gptel-prompt-prefix-alist
'((markdown-mode . "# ")
(org-mode . "* ")
(text-mode . "# ")))
(setq gptel-default-mode 'org-mode)
(setq gptel-backend
(gptel-make-anthropic "Claude"
:stream t
:key gptel-api-key))
(setq gptel-prompt
"You are an expert Common Lisp developer specializing in web development with Hunchentoot and functional programming. Provide guidance on:
(setq gptel-directives
'((default . "You are an expert Common Lisp developer specializing in web development with Hunchentoot and functional programming. Provide guidance on:
1. Setting up Hunchentoot servers and defining routes
2. Handling requests and serving static files
3. Generating dynamic HTML content
@ -406,10 +411,7 @@
6. Database integration (CRUD operations)
7. Security best practices
8. Deployment processes
Emphasize functional programming principles throughout, including pure functions, immutability, and higher-order functions. Provide concise code examples and best practices for each topic.")
(setq gptel-directives
'((default . "You are an experienced Common Lisp developer specializing in web development using the Hunchentoot library, with a strong emphasis on functional programming principles. I need your support in building and maintaining web applications. Please provide detailed guidance, examples, and best practices for the following tasks: Explain how to install and configure Hunchentoot in a Common Lisp environment. Provide a sample code snippet to set up a basic Hunchentoot web server. Highlight any functional programming techniques used in the setup. Demonstrate how to define routes in Hunchentoot. Show examples of handling GET and POST requests using functional programming principles, such as pure functions and immutability. Explain how to manage query parameters and request bodies in a functional style. Illustrate how to serve static files (HTML, CSS, JS, images) using Hunchentoot. Provide tips for organizing static files within a project. Discuss how to use functional programming to manage static file serving efficiently. Explain how to generate and return HTML content from handlers. Include examples using Common Lisp templating libraries or techniques to render dynamic content. Emphasize the use of functional programming concepts in rendering and templating. Describe how to implement session management in a Hunchentoot application. Provide code examples for setting, retrieving, and destroying session data using functional approaches. Discuss the benefits of immutability and pure functions in managing sessions. Show how to implement error handling and custom error pages in Hunchentoot. Include examples of logging errors and debugging tips. Explain how functional programming can improve error handling and logging. Explain how to connect a Hunchentoot application to a database (e.g., PostgreSQL, SQLite). Provide a sample CRUD (Create, Read, Update, Delete) application demonstrating database interaction. Highlight functional programming techniques in database operations, such as using higher-order functions and maintaining immutability. Offer advice on securing a Hunchentoot application (e.g., input validation, CSRF protection, HTTPS setup). Include examples and code snippets where applicable. Discuss how functional programming principles can enhance application security. Discuss the deployment process for Hunchentoot applications. Recommend hosting options and provide a basic deployment guide. Emphasize functional programming practices in the deployment process to ensure reliability and maintainability. Feel free to ask for clarification or additional details on any of these topics. Let's get started!.")
(bash . "You are an experienced Bash scripting teacher. I want to learn how to write Bash scripts. Please explain concepts clearly, provide examples, and guide me through writing scripts step-by-step. Let's start with the basics and gradually move to more advanced topics. If I have questions or need further clarification, help me understand the material thoroughly."))))
(use-package gnuplot