This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun org-agenda-subtree-or-region (prefix) | |
"Display an agenda view for the current subtree or region. | |
With prefix, display only TODO-keyword items." | |
(interactive "p") | |
(let (header) | |
(if (use-region-p) | |
(progn | |
(setq header "Region") | |
(put 'org-agenda-files 'org-restrict (list (buffer-file-name (current-buffer)))) | |
(setq org-agenda-restrict (current-buffer)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;;;;; Fix Helm org tag completion | |
;; From Anders Johansson <https://groups.google.com/d/msg/emacs-helm/tA6cn6TUdRY/G1S3TIdzBwAJ> | |
;; This works great! He posted it on 3 Mar 2016, on a thread that was | |
;; started in Oct 2013. He also posted this message on 2 Apr 2014, | |
;; maybe an earlier attempt at a solution: | |
;; <http://article.gmane.org/gmane.emacs.orgmode/84495> I've just | |
;; tidied it up a bit and adjusted the prompt. | |
(add-to-list 'helm-completing-read-handlers-alist '(org-capture . aj/org-completing-read-tags)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun org-read-structure-template () | |
"Read org-mode structure template with completion. Returns template string." | |
(let* ((templates (map 'list 'second org-structure-template-alist)) | |
(prefixes (map 'list (lambda (tp) | |
;; Get template and pre-whitespace prefix for completion | |
(reverse (s-match (rx (group | |
(1+ (not (any "\n" space)))) | |
(1+ anything)) | |
tp))) | |
templates)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun ap/comment-dwiw (prefix) | |
"Add/remove comments from code. | |
With prefix, uncomment region or remove commented lines. | |
More specifically: | |
With active region: | |
* With prefix: Uncomment region. | |
* Without prefix: Comment/uncomment region. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
# | |
# Brad's el-ghetto do-our-storage-stacks-lie?-script | |
# | |
sub usage { | |
die <<'END'; | |
Usage: diskchecker.pl -s <server[:port]> verify <file> | |
diskchecker.pl -s <server[:port]> create <file> <size_in_MB> | |
diskchecker.pl -l [port] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun my-filter-current-buffer (program &rest args) | |
(let* ((stdout-buffer (generate-new-buffer " stdout")) | |
(ret (apply 'call-process-region (point-min) (point-max) program | |
nil (list stdout-buffer) nil args))) | |
(when (zerop ret) | |
(let ((output (with-current-buffer stdout-buffer | |
(buffer-string)))) | |
(erase-buffer) | |
(insert output))) | |
(kill-buffer stdout-buffer))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*.enex |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; Fira code | |
;; This works when using emacs --daemon + emacsclient | |
(add-hook 'after-make-frame-functions (lambda (frame) (set-fontset-font t '(#Xe100 . #Xe16f) "Fira Code Symbol"))) | |
;; This works when using emacs without server/client | |
(set-fontset-font t '(#Xe100 . #Xe16f) "Fira Code Symbol") | |
;; I haven't found one statement that makes both of the above situations work, so I use both for now | |
(defconst fira-code-font-lock-keywords-alist | |
(mapcar (lambda (regex-char-pair) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// createshortcut.js -- ++pentadactyl | |
// @Author: eric.zou ([email protected]) | |
// @License: GPL (see http://www.gnu.org/licenses/gpl.txt) | |
// @Created: Tue 29 Nov 2011 01:24:05 PM CST | |
// @Last Change: Tue 29 Nov 2011 02:23:36 PM CST | |
// @Revision: 41 | |
// @Description: | |
// @Usage: | |
// @TODO: | |
// @CHANGES: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This 1) adjusts the Mozilla mozconfig.gtk file according | |
to the comments in it, and 2) removes a directory from | |
the debian/firefox.install.in file that comes up empty | |
when building with Gtk2, which then causes the package | |
build to fail due to trying to include files from an | |
empty directory (don't ask me why the gtk2 directory | |
is empty when built with Gtk2). | |
--- | |
build/unix/mozconfig.gtk | 25 +------------------------ | |
debian/firefox.install.in | 1 - |