;;; packages.el --- my Emacs packages -*- lexical-binding: t; -*- (use-package scule :load-path "~/src/scule.el/" :bind-keymap ("M-c" . scule-map) :init ;; Use M-u for prefix keys (keymap-global-set "M-u" #'universal-argument) (keymap-set universal-argument-map "M-u" #'universal-argument-more)) (use-package frowny :load-path "~/src/frowny.el/" :hook ((jabber-chat-mode . frowny-mode))) (use-package hippie-completing-read :load-path "~/src/hippie-completing-read.el/" :bind (("M-/" . hippie-completing-read))) (use-package mode-line-bell :load-path "~/src/mode-line-bell.el/" :config (setq mode-line-bell-flash-time 0.25) (mode-line-bell-mode)) (use-package titlecase :load-path "~/src/titlecase.el/" :preface (defun +titlecase-sentence-style-dwim (&optional arg) "Titlecase a sentence. With prefix ARG, toggle the value of `titlecase-downcase-sentences' before sentence-casing." (interactive "P") (let ((titlecase-downcase-sentences (if arg (not titlecase-downcase-sentences) titlecase-downcase-sentences))) (titlecase-dwim 'sentence))) (defun +titlecase-org-headings () (interactive) (require 'org) (save-excursion (goto-char (point-min)) ;; See also `org-map-tree'. I'm not using that function because I want to ;; skip the first headline. A better solution would be to patch ;; `titlecase-line' to ignore org-mode metadata (TODO cookies, tags, etc). (let ((level (funcall outline-level)) (org-special-ctrl-a/e t)) (while (and (progn (outline-next-heading) (> (funcall outline-level) level)) (not (eobp))) (titlecase-region (progn (org-beginning-of-line) (point)) (progn (org-end-of-line) (point))))))) :config (with-eval-after-load 'scule (keymap-set scule-map "M-t" #'titlecase-dwim))) ;;; Jabber (use-package jabber :load-path "~/src/jabber.el" :defer t :bind-keymap (("C-c j" . jabber-global-keymap)) :preface nil (setq-default jabber-chat-buffer-format "*%n*" jabber-browse-buffer-format "*%n*" jabber-groupchat-buffer-format "*%n*" jabber-muc-private-buffer-format "*%n*") :custom-face (jabber-activity-face ((t :inherit jabber-chat-prompt-foreign :foreground unspecified :weight normal))) (jabber-activity-personal-face ((t :inherit jabber-chat-prompt-local :foreground unspecified :weight bold))) (jabber-chat-prompt-local ((t :inherit minibuffer-prompt :foreground unspecified :weight normal :slant italic))) (jabber-chat-prompt-foreign ((t :inherit warning :foreground unspecified :weight normal))) (jabber-chat-prompt-system ((t :inherit font-lock-doc-face :foreground unspecified))) (jabber-rare-time-face ((t :inherit font-lock-comment-face :foreground unspecified :underline nil))) :config (require 'jabber-httpupload nil t) (setopt jabber-auto-reconnect t jabber-last-read-marker "~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~" jabber-muc-decorate-presence-patterns '(("\\( enters the room ([^)]+)\\| has left the chatroom\\)$" . nil) ("Mode #.*" . jabber-muc-presence-dim) ("." . jabber-muc-presence-dim)) jabber-activity-make-strings #'jabber-activity-make-strings-shorten jabber-rare-time-format (format " - - - - - %%H:%d %%F" (let ((min (string-to-number (format-time-string "%M")))) (* 5 (floor min 5)))) jabber-muc-header-line-format '(" " jabber-muc-topic)) (setopt jabber-groupchat-prompt-format "%n. " jabber-chat-local-prompt-format "%n. " jabber-chat-foreign-prompt-format "%n. " jabber-muc-private-foreign-prompt-format "%g/%n. ") (keymap-global-set "C-c C-SPC" #'jabber-activity-switch-to) (map-keymap (lambda (key command) (define-key jabber-global-keymap (vector (+ key #x60)) command)) jabber-global-keymap) (keymap-global-set "C-x C-j" #'dired-jump) (add-hook 'jabber-post-connect-hooks #'jabber-enable-carbons) (remove-hook 'jabber-alert-muc-hooks 'jabber-muc-echo) (remove-hook 'jabber-alert-presence-hooks 'jabber-presence-echo) (add-hook 'jabber-chat-mode-hook 'visual-line-mode) (add-hook 'jabber-chat-mode-hook (defun jabber-no-position () (setq-local mode-line-position nil))) (add-hook 'jabber-alert-muc-hooks (defun jabber@highlight-acdw (&optional _ _ buf _ _) (when buf (with-current-buffer buf (let ((regexp (rx word-boundary "acdw" ; maybe get from the config? word-boundary))) (hi-lock-unface-buffer regexp) (highlight-regexp regexp 'jabber-chat-prompt-local)))))) (when (fboundp 'jabber-chat-update-focus) (add-hook 'window-configuration-change-hook #'jabber-chat-update-focus)))