Skip to content

Instantly share code, notes, and snippets.

@cvmat
cvmat / mute.patch
Created July 17, 2014 17:36
mute/unmute for twittering-mode
diff -r 6635d63ea4fa twittering-mode.el
--- a/twittering-mode.el Mon Apr 21 02:05:19 2014 +0900
+++ b/twittering-mode.el Fri Jul 18 02:32:01 2014 +0900
@@ -5586,6 +5586,18 @@
Valid key symbols in ARGS-ALIST:
username -- the username who the message is sent to.
status -- the sent message.
+mute -- Mute a user.
+ Valid key symbols in ARGS-ALIST:
+ user-id -- the user-id that will be muted.
@cvmat
cvmat / twmode-exclude-pattern.patch
Created March 30, 2014 16:13
A patch for adding a filtering function to twittering-mode.
# HG changeset patch
# Parent 05a3cec6c0d2e8b3305e51788f923c69c343bfe3
diff --git a/twittering-mode.el b/twittering-mode.el
--- a/twittering-mode.el
+++ b/twittering-mode.el
@@ -639,6 +639,36 @@
(defvar twittering-relative-retrieval-count-alist '()
"An alist for counting retrieval of primary timelines.")
@cvmat
cvmat / url-with-https-via-proxy.el
Last active December 21, 2015 04:38
An advice that enables url.el to connect a server with the HTTPS protocol via a HTTP proxy.
;;
;; If the OpenSSL executable is compiled with the patch in
;; http://rt.openssl.org/Ticket/Display.html?id=2651&user=guest&pass=guest ,
;; the executable can connect a server via a HTTP proxy.
;; With the below code, the url.el library may connect a server with
;; the HTTPS protocol via a HTTP proxy.
;;
;;
;; Register a proxy for the "https" scheme from the environment
diff -r fabdaa984fad twittering-mode.el
--- a/twittering-mode.el Sat Jun 15 23:41:42 2013 +0900
+++ b/twittering-mode.el Sun Jun 16 12:46:55 2013 +0900
@@ -4774,10 +4774,7 @@
(let ((other-spec (twittering-get-timeline-spec-for-buffer buffer))
(other-spec-string
(twittering-get-timeline-spec-string-for-buffer buffer)))
- (when (and
- (twittering-timeline-spec-depending-on-p other-spec spec)
- ;; The hook has been alreadly invoked for `spec'.
@cvmat
cvmat / firefox-open.sh
Last active January 15, 2016 01:39
A script invoking Firefox on Cygwin.
#! /bin/sh
# Confirm that the script is invoked from a Windows session,
# not a SSH session.
if [ -z "$SESSIONNAME" ] ; then
exit;
fi
alias firefox='/cygdrive/c/Program\ Files\ \(x86\)/Mozilla\ Firefox/firefox.exe'
;;;; Commands for displaying information related to a status
(defun twittering-display-user-information (&optional pos)
(interactive)
(let* ((pos (or pos (point)))
(status (twittering-find-status (twittering-get-id-at pos)))
(name (or (cdr (assq 'user-name status)) ""))
(screen-name (or (cdr (assq 'user-screen-name status)) ""))
(location (or (cdr (assq 'user-location status)) ""))
(url (or (cdr (assq 'user-url status)) ""))
(description (or (cdr (assq 'user-description status)) "")))
@cvmat
cvmat / gist:3845049
Created October 6, 2012 14:23
Open PDF and DVI files with external program
(defadvice find-file (around disable-doc-view (filename &optional wildcards) activate)
(cond
((string-match "\\.\\(?:PDF\\|DVI\\|pdf\\|dvi\\)\\'" filename)
(let ((process-connection-type nil))
(start-process "" nil "/usr/bin/xdg-open" filename)))
(t
ad-do-it)))
@cvmat
cvmat / eval-after-autoload-func.el
Last active October 9, 2015 13:18
Function version of `eval-after-autoload-if-found'
;;
;; function version of `eval-after-autoload-if-found'
;;
;; Example with after-body.
;; (eval-after-autoload-if-found
;; '(cycle-buffer cycle-buffer-backward) "cycle-buffer" nil t nil
;; '((setq cycle-buffer-allow-visible t)
;; (setq cycle-buffer-show-length 12)
;; (setq cycle-buffer-show-format '(" <(%s)>" . " %s"))))
;; Example without after-body.
@cvmat
cvmat / eval-after-autoload.el
Created August 28, 2012 16:00
macro for autoload and eval-after-load
;;
;; Example with after-body.
;; (eval-after-autoload-if-found
;; '(cycle-buffer cycle-buffer-backward) "cycle-buffer" nil t nil
;; (setq cycle-buffer-allow-visible t)
;; (setq cycle-buffer-show-length 12)
;; (setq cycle-buffer-show-format '(" <(%s)>" . " %s")))
;;
;; Example without after-body.
;; (eval-after-autoload-if-found 'smooth-scrolling "smooth-scrolling" nil t)
@cvmat
cvmat / twittering-org.el
Created August 15, 2012 07:47
Twittering-mode and org-mode integration
(org-add-link-type "twitter" 'twittering-org:open)
(add-hook 'org-store-link-functions 'twittering-org:store-link)
(defun twittering-org:open (id-str)
(twittering-visit-timeline (concat ":single/" id-str)))
(defun twittering-org:store-link ()
"Store a link to a tweet."
(when (and (twittering-buffer-p) (twittering-get-id-at))
(let ((status (twittering-find-status (twittering-get-id-at))))
(apply 'org-store-link-props