From caedd92eef8fe47c3925c12d8e81be911556b38b Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Fri, 11 Jan 2013 01:16:41 +0100 Subject: Update files --- site/code_vault.org | 49 ------------------------------------------------- 1 file changed, 49 deletions(-) delete mode 100644 site/code_vault.org (limited to 'site/code_vault.org') diff --git a/site/code_vault.org b/site/code_vault.org deleted file mode 100644 index 394bee1..0000000 --- a/site/code_vault.org +++ /dev/null @@ -1,49 +0,0 @@ -#+TITLE: Code Vault - -Here we have some code snippets that I no longer (intend to) use, but -might still need (to look at) at some point in time. - -* Jabber urgency and libnotify - - This piece of code sends a message through ~libnotify~ and sets a - window urgency hint when a new message is received. - - #+BEGIN_SRC emacs-lisp -(defvar jabber-activity-jids-count 0) - -(defun jabber-urgency-hint () - (let ((count (length jabber-activity-jids))) - (unless (= jabber-activity-jids-count count) - (if (zerop count) - (x-urgency-hint (selected-frame) nil) - (x-urgency-hint (selected-frame) t)) - (setq jabber-activity-jids-count count)))) - -(defun libnotify-jabber-notify (from buf text proposed-alert) - "(jabber.el hook) Notify of new Jabber chat messages via libnotify" - (when (or jabber-message-alert-same-buffer - (not (memq (selected-window) (get-buffer-window-list buf)))) - (if (jabber-muc-sender-p from) - (notify-send (format "(PM) %s" - (jabber-jid-displayname - (jabber-jid-user from))) - (format "%s: %s" (jabber-jid-resource from) text))) - (notify-send (format "%s: " (jabber-jid-displayname from)) - (format "%.20s" text)))) - -(add-hook 'jabber-activity-update-hook 'jabber-urgency-hint) -(add-hook 'jabber-alert-message-hooks 'libnotify-jabber-notify) - #+END_SRC - -* Show symbol instead of ~lambda~ - - #+BEGIN_SRC emacs-lisp -(defun oni:pretty-lambdas () - "Show a lambda sign where the world `lambda' is found." - (font-lock-add-keywords - nil `(("(?\\(\\\\)[ :]" - (0 (progn - (compose-region (match-beginning 1) - (match-end 1) - ?λ))))))) - #+END_SRC -- cgit v1.2.3-54-g00ecf