From ffe2df238c5c7ca7093d89324e9078ccaac01984 Mon Sep 17 00:00:00 2001 From: Amin Bandali Date: Thu, 26 Oct 2023 21:52:58 -0400 Subject: Various updates from adelita --- .emacs.d/init.el | 51 ++++++++++++++++++++++++++++++++++++++++ .emacs.d/lisp/bandali-gnus.el | 4 ++++ .emacs.d/lisp/bandali-message.el | 1 + .emacs.d/lisp/ffs/ffs.el | 32 ++++++++++++++----------- 4 files changed, 74 insertions(+), 14 deletions(-) (limited to '.emacs.d') diff --git a/.emacs.d/init.el b/.emacs.d/init.el index c3c9d1e..0d8852b 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -913,7 +913,58 @@ for all frames." (add-to-list 'load-path (b/lisp "ffs")) (run-with-idle-timer 0.5 nil #'require 'ffs) (with-eval-after-load 'ffs + (setq ffs-default-face-height 250) (global-set-key (kbd "C-c f s") #'ffs)) +(add-hook 'ffs-start-hook + (lambda () + (mapc + (lambda (mode) (funcall mode 1)) ; enable + '(ffs--no-mode-line-minor-mode + ffs--no-cursor-minor-mode)) + (mapc + (lambda (mode) (funcall mode -1)) ; disable + '(show-paren-local-mode + display-battery-mode + display-fill-column-indicator-mode + flyspell-mode + tool-bar-mode + menu-bar-mode + scroll-bar-mode)) + (fringe-mode 0))) +(add-hook 'ffs-quit-hook + (lambda () + (mapc + (lambda (mode) (funcall mode -1)) ; disable + '(ffs--no-mode-line-minor-mode + ffs--no-cursor-minor-mode)) + (mapc + (lambda (mode) (funcall mode 1)) ; enable + '(show-paren-local-mode + display-battery-mode + display-fill-column-indicator-mode + flyspell-mode + tool-bar-mode + menu-bar-mode + scroll-bar-mode)) + (fringe-mode nil))) + +;; (defun my-display-centered-paragraph (text) +;; (let* ((buffer (get-buffer-create "*demo*")) +;; (window (display-buffer buffer))) +;; (with-current-buffer buffer +;; (with-selected-window window +;; (let ((inhibit-read-only t) +;; (window-height (window-body-height window t)) +;; content-height) +;; (delete-region (point-min) (point-max)) +;; (insert text) +;; (set-window-start window (point-min)) +;; (unless (looking-back "\n$") +;; (insert "\n")) +;; (setq content-height (cdr (posn-x-y (posn-at-point)))) +;; (goto-char (point-min)) +;; (insert (propertize "\n" 'line-height +;; (/ (- window-height content-height) 2)))))))) (add-to-list 'load-path (b/lisp "debian-el")) (run-with-idle-timer 0.5 nil #'require 'debian-el) diff --git a/.emacs.d/lisp/bandali-gnus.el b/.emacs.d/lisp/bandali-gnus.el index b771b78..04b1202 100644 --- a/.emacs.d/lisp/bandali-gnus.el +++ b/.emacs.d/lisp/bandali-gnus.el @@ -96,6 +96,10 @@ (from ".+-\\(owner\\|bounces\\)@\\(non\\)?gnu\\.org" "listmod") ;; gnu (list ".*<\\(.*\\)\\.\\(non\\)?gnu\\.org>.*" "l.\\1") + ;; board-eval + (| + (list ".*<.*\\.board-eval\\.fsf\\.org>.*" "l.board-eval") + (from ".*@board-eval\\.fsf\\.org" "l.board-eval")) ;; fsf (list ".*<\\(.*\\)\\.fsf\\.org>.*" "l.\\1") ;; cfarm diff --git a/.emacs.d/lisp/bandali-message.el b/.emacs.d/lisp/bandali-message.el index 3ea8643..f9f0873 100644 --- a/.emacs.d/lisp/bandali-message.el +++ b/.emacs.d/lisp/bandali-message.el @@ -50,6 +50,7 @@ message-elide-ellipsis "[...]\n" ;; message-cite-style 'message-cite-style-bandali message-citation-line-format "%N writes:\n" + ;; message-citation-line-format "On %a, %d %b %Y, %N wrote:\n" message-citation-line-function 'message-insert-formatted-citation-line message-confirm-send t message-fill-column 70 diff --git a/.emacs.d/lisp/ffs/ffs.el b/.emacs.d/lisp/ffs/ffs.el index 99f2097..043fcb4 100644 --- a/.emacs.d/lisp/ffs/ffs.el +++ b/.emacs.d/lisp/ffs/ffs.el @@ -1,6 +1,6 @@ ;;; ffs.el --- Form Feed Slides mode -*- lexical-binding: t; -*- -;; Copyright (C) 2022 Amin Bandali +;; Copyright (c) 2022-2023 Amin Bandali ;; Author: Amin Bandali ;; Version: 0.1.0 @@ -58,6 +58,16 @@ during the ffs presentation." :type '(choice (const nil) (integer :value 300))) +(defcustom ffs-start-hook nil + "Hooks to perform when starting presenting." + :group 'ffs + :type 'hook) + +(defcustom ffs-quit-hook nil + "Hooks to perform when quitting presenting." + :group 'ffs + :type 'hook) + (defcustom ffs-edit-buffer-name "*ffs-edit*" "The name of the ffs-edit buffer used when editing a slide." :group 'ffs @@ -206,17 +216,13 @@ speaker notes buffer (if any)." "Start the presentation." (interactive) (ffs-minor-mode 1) - (ffs--no-mode-line-minor-mode 1) - (ffs--no-cursor-minor-mode 1) (when (integerp ffs-default-face-height) (setq-local ffs--old-default-face-height (face-attribute 'default :height)) (face-remap-add-relative 'default :height ffs-default-face-height)) - (show-paren-local-mode -1) - (display-battery-mode -1) - (flyspell-mode -1) + (run-hooks 'ffs-start-hook) (narrow-to-page)) (defun ffs-quit () @@ -227,11 +233,7 @@ speaker notes buffer (if any)." (when (integerp ffs-default-face-height) (face-remap-add-relative 'default :height ffs--old-default-face-height)) - (show-paren-local-mode 1) - (display-battery-mode 1) - (flyspell-mode 1) - (ffs--no-mode-line-minor-mode -1) - (ffs--no-cursor-minor-mode -1) + (run-hooks 'ffs-quit-hook) (if n (progn (goto-char (point-min)) @@ -248,6 +250,7 @@ slide will be added above/before the current slide, and if it is current slide. The logic is implemented in `ffs-edit-done'." (interactive) (let* ((b (current-buffer)) + (fc fill-column) (m major-mode) (n (buffer-narrowed-p)) (s (if add-above-or-below ; if we are adding a new slide @@ -264,7 +267,8 @@ current slide. The logic is implemented in `ffs-edit-done'." (set-buffer-modified-p nil) (setq-local ffs--edit-source-buffer b - ffs--new-location add-above-or-below) + ffs--new-location add-above-or-below + fill-column fc) (message (substitute-command-keys "Edit, then use `\\[ffs-edit-done]' \ to apply your changes or `\\[ffs-edit-discard]' to discard them.")))) @@ -302,11 +306,11 @@ to apply your changes or `\\[ffs-edit-discard]' to discard them.")))) ((eq l 'add-above) (backward-page) (insert (format "\n%s " s)) - (setq f #'ffs-previous-slide)) + (setq f #'ffs-goto-previous)) ((eq l 'add-below) (forward-page) (insert (format "\n%s " s)) - (setq f #'ffs-next-slide)) + (setq f #'ffs-goto-next)) ((null l) (narrow-to-page) (delete-region (point-min) (point-max)) -- cgit v1.2.3-60-g2f50