aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--emacs/.emacs.d/init/ycp-buffer.el2
-rw-r--r--emacs/.emacs.d/init/ycp-markup.el7
-rw-r--r--emacs/.emacs.d/lisp/my/my-emms.el24
-rw-r--r--emacs/.emacs.d/lisp/my/my-utils.el12
-rwxr-xr-xmisc/bin/git-annex-picard.sh6
-rwxr-xr-xmisc/bin/org-a-sync.el45
6 files changed, 83 insertions, 13 deletions
diff --git a/emacs/.emacs.d/init/ycp-buffer.el b/emacs/.emacs.d/init/ycp-buffer.el
index 6a560ea..78f5a66 100644
--- a/emacs/.emacs.d/init/ycp-buffer.el
+++ b/emacs/.emacs.d/init/ycp-buffer.el
@@ -235,6 +235,4 @@
"C-M-<mouse-5>" #'my-decrease-default-face-height)
)
-(setq large-file-warning-threshold 15000000)
-
(provide 'ycp-buffer)
diff --git a/emacs/.emacs.d/init/ycp-markup.el b/emacs/.emacs.d/init/ycp-markup.el
index 68b5459..a53d542 100644
--- a/emacs/.emacs.d/init/ycp-markup.el
+++ b/emacs/.emacs.d/init/ycp-markup.el
@@ -144,5 +144,12 @@
(add-to-list 'auto-mode-alist '("\\.html\\'" . htmlv-mode))
)
+;;; lilypond
+(add-to-list 'load-path "/usr/share/emacs/site-lisp")
+(autoload 'LilyPond-mode "lilypond-mode" "LilyPond Editing Mode" t)
+(add-to-list 'auto-mode-alist '("\\.ly\\'" . LilyPond-mode))
+(add-to-list 'auto-mode-alist '("\\.ily\\'" . LilyPond-mode))
+(add-hook 'LilyPond-mode-hook (lambda () (turn-on-font-lock)))
+
(provide 'ycp-markup)
;;; ycp-markup.el ends here
diff --git a/emacs/.emacs.d/lisp/my/my-emms.el b/emacs/.emacs.d/lisp/my/my-emms.el
index 91065a2..0e7243a 100644
--- a/emacs/.emacs.d/lisp/my/my-emms.el
+++ b/emacs/.emacs.d/lisp/my/my-emms.el
@@ -376,6 +376,7 @@ artist/album/track."
(my-emms-playlist-make-buffer-name
my-emms-favourites-playlist)))
+(require 'my-utils)
;;; random album in emms
(defun my-emms-current-album-name ()
(file-name-directory (my-emms-get-current-track-name)))
@@ -414,17 +415,18 @@ artist/album/track."
We put a low weight on discovery album, currently any directory
under /zzz-seren/."
(let ((album
- (elt my-emms-albums-cache (random (length my-emms-albums-cache)))))
+ (elt my-emms-albums-cache (my-random
+ (length my-emms-albums-cache)))))
(while (and (string-match "/zzz-seren/" album)
- (>= (random 100) 4))
+ (>= (my-random 100) 4))
(setq album
- (elt my-emms-albums-cache (random (length my-emms-albums-cache)))))
+ (elt my-emms-albums-cache (my-random (length my-emms-albums-cache)))))
album))
(defun my-emms-playlist-random-album ()
(interactive)
(with-current-emms-playlist
- (goto-line (1+ (random (count-lines (point-min) (point-max)))))
+ (goto-line (1+ (my-random (count-lines (point-min) (point-max)))))
(let ((album-name (my-emms-playlist-album-name-at-point)))
(goto-char (point-min))
(search-forward album-name)
@@ -526,13 +528,13 @@ Override `emms-mode-line-playlist-current' to incorporate wide chars."
(defun my-emms-playlist-random-group ()
(interactive)
(with-current-emms-playlist
- (let ((random-line (1+ (random (count-lines (point-min) (point-max))))))
- (goto-line random-line)
- (pcase-let ((`(,group-start . ,group-end) (my-emms-playlist-group-bounds)))
- (message "my-emms-playlist-random-group: (%d, %d)" random-line group-start)
- (goto-line group-start)
- (my-emms-playlist-mark-bounds group-end)
- (emms-playlist-mode-play-current-track)))))
+ (let ((random-line (1+ (my-random (count-lines (point-min) (point-max))))))
+ (goto-line random-line)
+ (pcase-let ((`(,group-start . ,group-end) (my-emms-playlist-group-bounds)))
+ (message "my-emms-playlist-random-group: (%d, %d)" random-line group-start)
+ (goto-line group-start)
+ (my-emms-playlist-mark-bounds group-end)
+ (emms-playlist-mode-play-current-track)))))
;;; TODO: mark bounds if and only if the currently played is out of
;;; the existing overlay.
diff --git a/emacs/.emacs.d/lisp/my/my-utils.el b/emacs/.emacs.d/lisp/my/my-utils.el
index 05ca2e6..8e0d184 100644
--- a/emacs/.emacs.d/lisp/my/my-utils.el
+++ b/emacs/.emacs.d/lisp/my/my-utils.el
@@ -503,4 +503,16 @@ With optional N, search in the Nth line from point."
(cond ((equal name "MIT") "expat")
(t name)))
+(defun my-random (limit)
+ (string-to-number
+ (calc-eval "$1 % $2" nil
+ (calc-eval
+ (with-temp-buffer
+ (set-buffer-multibyte nil)
+ (call-process "head" "/dev/urandom" t nil "-c"
+ (format "%d" (/ 256 8)))
+ (let ((f (apply-partially #'format "%02x")))
+ (concat "16#" (mapconcat f (buffer-string) "")))))
+ limit)))
+
(provide 'my-utils)
diff --git a/misc/bin/git-annex-picard.sh b/misc/bin/git-annex-picard.sh
new file mode 100755
index 0000000..de14399
--- /dev/null
+++ b/misc/bin/git-annex-picard.sh
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+set -eu
+git annex get "$1"
+git annex unlock "$1"
+picard "$1"
diff --git a/misc/bin/org-a-sync.el b/misc/bin/org-a-sync.el
new file mode 100755
index 0000000..7123f04
--- /dev/null
+++ b/misc/bin/org-a-sync.el
@@ -0,0 +1,45 @@
+#!/bin/emacs --script
+
+(add-to-list 'load-path (locate-user-emacs-file "lisp/my"))
+(require 'org-agenda)
+(require 'my-package)
+(my-read-local-config)
+(my-setq-from-local my-org-agenda-and-next-export-files)
+(my-setq-from-local org-agenda-files)
+
+(progn
+ (setq org-todo-keywords
+ '((sequence "TODO(t)" "DOIN(i)" "WAIT(w)" "|"
+ "DONE(d)" "OBSO(o)" "DUPL(u)")))
+ (setq org-closed-keep-when-no-todo t)
+ (setq org-enforce-todo-dependencies t
+ org-enforce-todo-checkbox-dependencies nil)
+ (setq org-use-fast-todo-selection 'expert)
+ (setq org-agenda-custom-commands
+ `(("A" "Agenda and next"
+ ((agenda ""
+ ((org-agenda-span 32)
+ ;; only works when `org-agenda-start-on-weekday'
+ ;; is nil
+ (org-agenda-start-day "-2d")))
+ (tags-todo "PRIORITY=\"A\"" nil))
+ nil
+ ,my-org-agenda-and-next-export-files
+ )))
+ (setq large-file-warning-threshold nil)
+ (setq org-agenda-todo-ignore-time-comparison-use-seconds t)
+ (setq org-agenda-todo-ignore-deadlines 'all)
+ (setq org-agenda-todo-ignore-scheduled 'all)
+ (setq org-agenda-todo-ignore-with-date 'all)
+ (setq org-agenda-todo-ignore-timestamp 'all)
+ (setq org-agenda-tags-todo-honor-ignore-options t)
+ (setq org-agenda-sticky t)
+ (setq org-agenda-inhibit-startup t)
+ (setq org-agenda-skip-deadline-if-done nil)
+ (setq org-agenda-skip-scheduled-if-done nil)
+ (setq org-agenda-skip-timestamp-if-done t)
+ (setq org-agenda-start-on-weekday nil)
+ )
+
+(let ((make-backup-files nil))
+ (call-interactively 'org-store-agenda-views))