Commit 56a209e9 authored by Duncan Bayne's avatar Duncan Bayne

SyncThing, mu4e, ics

parent 501067d6
emacs.d/99-personal.el
emacs.d/9?-*.el
emacs.d/ac-comphist.dat
emacs.d/bbdb
.emacs.desktop*
......
......@@ -109,3 +109,12 @@
(interactive)
(let ((inhibit-read-only t))
(ansi-color-apply-on-region (point-min) (point-max))))
(defun utils:ensure-syncthing-running ()
"Ensures syncthing is running."
(interactive)
(if (not (member "*syncthing*" (utils:term-buffer-names)))
(progn
(utils:create-or-switch-to-term "syncthing")
(cd "~")
(term-send-raw-string "syncthing\n"))))
;;; alist.el --- utility functions for association list
;; Copyright (C) 1993,1994,1995,1996,1998,2000 Free Software Foundation, Inc.
;; Author: MORIOKA Tomohiko <tomo@m17n.org>
;; Keywords: alist
;; This file is part of GNU Emacs.
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 2, or (at
;; your option) any later version.
;; This program is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.
;;; Code:
;;;###autoload
(defun put-alist (key value alist)
"Set cdr of an element (KEY . ...) in ALIST to VALUE and return ALIST.
If there is no such element, create a new pair (KEY . VALUE) and
return a new alist whose car is the new pair and cdr is ALIST."
(let ((elm (assoc key alist)))
(if elm
(progn
(setcdr elm value)
alist)
(cons (cons key value) alist))))
;;;###autoload
(defun del-alist (key alist)
"Delete an element whose car equals KEY from ALIST.
Return the modified ALIST."
(let ((pair (assoc key alist)))
(if pair
(delq pair alist)
alist)))
;;;###autoload
(defun set-alist (symbol key value)
"Set cdr of an element (KEY . ...) in the alist bound to SYMBOL to VALUE."
(or (boundp symbol)
(set symbol nil))
(set symbol (put-alist key value (symbol-value symbol))))
;;;###autoload
(defun remove-alist (symbol key)
"Delete an element whose car equals KEY from the alist bound to SYMBOL."
(and (boundp symbol)
(set symbol (del-alist key (symbol-value symbol)))))
;;;###autoload
(defun modify-alist (modifier default)
"Store elements in the alist MODIFIER in the alist DEFAULT.
Return the modified alist."
(mapcar (function
(lambda (as)
(setq default (put-alist (car as)(cdr as) default))))
modifier)
default)
;;;###autoload
(defun set-modified-alist (symbol modifier)
"Store elements in the alist MODIFIER in an alist bound to SYMBOL.
If SYMBOL is not bound, set it to nil at first."
(if (not (boundp symbol))
(set symbol nil))
(set symbol (modify-alist modifier (eval symbol))))
;;; @ association-vector-list
;;;
;;;###autoload
(defun vassoc (key avlist)
"Search AVLIST for an element whose first element equals KEY.
AVLIST is a list of vectors.
See also `assoc'."
(while (and avlist
(not (equal key (aref (car avlist) 0))))
(setq avlist (cdr avlist)))
(and avlist
(car avlist)))
;;; @ end
;;;
(require 'product)
(product-provide (provide 'alist) (require 'apel-ver))
;;; alist.el ends here
;;; apel-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
(add-to-list 'load-path (or (file-name-directory #$) (car load-path)))
;;;### (autoloads nil "alist" "alist.el" (22505 50064 604186 823000))
;;; Generated autoloads from alist.el
(autoload 'put-alist "alist" "\
Set cdr of an element (KEY . ...) in ALIST to VALUE and return ALIST.
If there is no such element, create a new pair (KEY . VALUE) and
return a new alist whose car is the new pair and cdr is ALIST.
\(fn KEY VALUE ALIST)" nil nil)
(autoload 'del-alist "alist" "\
Delete an element whose car equals KEY from ALIST.
Return the modified ALIST.
\(fn KEY ALIST)" nil nil)
(autoload 'set-alist "alist" "\
Set cdr of an element (KEY . ...) in the alist bound to SYMBOL to VALUE.
\(fn SYMBOL KEY VALUE)" nil nil)
(autoload 'remove-alist "alist" "\
Delete an element whose car equals KEY from the alist bound to SYMBOL.
\(fn SYMBOL KEY)" nil nil)
(autoload 'modify-alist "alist" "\
Store elements in the alist MODIFIER in the alist DEFAULT.
Return the modified alist.
\(fn MODIFIER DEFAULT)" nil nil)
(autoload 'set-modified-alist "alist" "\
Store elements in the alist MODIFIER in an alist bound to SYMBOL.
If SYMBOL is not bound, set it to nil at first.
\(fn SYMBOL MODIFIER)" nil nil)
(autoload 'vassoc "alist" "\
Search AVLIST for an element whose first element equals KEY.
AVLIST is a list of vectors.
See also `assoc'.
\(fn KEY AVLIST)" nil nil)
;;;***
;;;### (autoloads nil "path-util" "path-util.el" (22505 50064 596186
;;;;;; 876000))
;;; Generated autoloads from path-util.el
(autoload 'add-path "path-util" "\
Add PATH to `load-path' if it exists under `default-load-path'
directories and it does not exist in `load-path'.
You can use following PATH styles:
load-path relative: \"PATH/\"
(it is searched from `default-load-path')
home directory relative: \"~/PATH/\" \"~USER/PATH/\"
absolute path: \"/HOO/BAR/BAZ/\"
You can specify following OPTIONS:
'all-paths search from `load-path'
instead of `default-load-path'
'append add PATH to the last of `load-path'
\(fn PATH &rest OPTIONS)" nil nil)
(autoload 'add-latest-path "path-util" "\
Add latest path matched by PATTERN to `load-path'
if it exists under `default-load-path' directories
and it does not exist in `load-path'.
If optional argument ALL-PATHS is specified, it is searched from all
of load-path instead of default-load-path.
\(fn PATTERN &optional ALL-PATHS)" nil nil)
(autoload 'get-latest-path "path-util" "\
Return latest directory in default-load-path
which is matched to regexp PATTERN.
If optional argument ALL-PATHS is specified,
it is searched from all of load-path instead of default-load-path.
\(fn PATTERN &optional ALL-PATHS)" nil nil)
(autoload 'file-installed-p "path-util" "\
Return absolute-path of FILE if FILE exists in PATHS.
If PATHS is omitted, `load-path' is used.
\(fn FILE &optional PATHS)" nil nil)
(defvar exec-suffix-list '("") "\
*List of suffixes for executable.")
(autoload 'exec-installed-p "path-util" "\
Return absolute-path of FILE if FILE exists in PATHS.
If PATHS is omitted, `exec-path' is used.
If suffixes is omitted, `exec-suffix-list' is used.
\(fn FILE &optional PATHS SUFFIXES)" nil nil)
(autoload 'module-installed-p "path-util" "\
Return t if module is provided or exists in PATHS.
If PATHS is omitted, `load-path' is used.
\(fn MODULE &optional PATHS)" nil nil)
;;;***
;;;### (autoloads nil "richtext" "richtext.el" (22505 50064 584186
;;;;;; 956000))
;;; Generated autoloads from richtext.el
(autoload 'richtext-encode "richtext" "\
\(fn FROM TO)" nil nil)
(autoload 'richtext-decode "richtext" "\
\(fn FROM TO)" nil nil)
;;;***
;;;### (autoloads nil nil ("apel-pkg.el" "apel-ver.el" "broken.el"
;;;;;; "calist.el" "emu.el" "filename.el" "install.el" "inv-23.el"
;;;;;; "invisible.el" "mcharset.el" "mcs-20.el" "mcs-e20.el" "mule-caesar.el"
;;;;;; "pccl-20.el" "pccl.el" "pces-20.el" "pces-e20.el" "pces.el"
;;;;;; "pcustom.el" "poe.el" "poem-e20.el" "poem-e20_3.el" "poem.el"
;;;;;; "product.el" "pym.el" "static.el") (22505 50064 608209 719000))
;;;***
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; End:
;;; apel-autoloads.el ends here
(define-package "apel" "20160427.152" "APEL (A Portable Emacs Library) provides support for portable Emacs Lisp programs" 'nil)
;; Local Variables:
;; no-byte-compile: t
;; End:
;;; apel-ver.el --- Declare APEL version.
;; Copyright (C) 1999, 2000, 2003, 2006 Free Software Foundation, Inc.
;; Author: Shuhei KOBAYASHI <shuhei@aqua.ocn.ne.jp>
;; Keiichi Suzuki <keiichi@nanap.org>
;; Keywords: compatibility
;; This file is part of APEL (A Portable Emacs Library).
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 2, or (at
;; your option) any later version.
;; This program is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program; see the file COPYING. If not, write to
;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.
;;; Commentary:
;; Put the following lines to each file of APEL package.
;;
;; (require 'product)
;; (product-provide (provide FEATURE) (require 'apel-ver))
;;; Code:
(require 'product) ; beware of circular dependency.
(provide 'apel-ver) ; these two files depend on each other.
(product-provide 'apel-ver
;; (product-define "APEL" nil '(9 23)) ; comment.
;; (product-define "APEL" nil '(10 0)) ; Released 24 December 1999
;; (product-define "APEL" nil '(10 1)) ; Released 20 January 2000
;; (product-define "APEL" nil '(10 2)) ; Released 01 March 2000
;; (product-define "APEL" nil '(10 3)) ; Released 30 December 2000
;; (product-define "APEL" nil '(10 4)) ; Released 04 October 2002
;; (product-define "APEL" nil '(10 5)) ; Released 06 June 2003
;; (product-define "APEL" nil '(10 6)) ; Released 05 July 2003
;; (product-define "APEL" nil '(10 7)) ; Released 14 February 2007
(product-define "APEL" nil '(10 8))
)
(defun apel-version ()
"Print APEL version."
(interactive)
(let ((product-info (product-string-1 'apel-ver t)))
(if (interactive-p)
(message "%s" product-info)
product-info)))
;;; @ End.
;;;
;;; apel-ver.el ends here
;;; broken.el --- Emacs broken facility information registry.
;; Copyright (C) 1998, 1999 Tanaka Akira <akr@jaist.ac.jp>
;; Author: Tanaka Akira <akr@jaist.ac.jp>
;; Keywords: emulation, compatibility, incompatibility, Mule
;; This file is part of APEL (A Portable Emacs Library).
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 2, or (at
;; your option) any later version.
;; This program is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.
;;; Code:
(require 'static)
(require 'poe)
(eval-and-compile
(defvar notice-non-obvious-broken-facility t
"If the value is t, non-obvious broken facility is noticed when
`broken-facility' macro is expanded.")
(defun broken-facility-internal (facility &optional docstring assertion)
"Declare that FACILITY emulation is broken if ASSERTION is nil."
(when docstring
(put facility 'broken-docstring docstring))
(put facility 'broken (not assertion)))
(defun broken-p (facility)
"t if FACILITY emulation is broken."
(get facility 'broken))
(defun broken-facility-description (facility)
"Return description for FACILITY."
(get facility 'broken-docstring))
)
(put 'broken-facility 'lisp-indent-function 1)
(defmacro broken-facility (facility &optional docstring assertion no-notice)
"Declare that FACILITY emulation is broken if ASSERTION is nil.
ASSERTION is evaluated statically.
FACILITY must be symbol.
If ASSERTION is not omitted and evaluated to nil and NO-NOTICE is nil,
it is noticed."
`(static-if ,assertion
(eval-and-compile
(broken-facility-internal ',facility ,docstring t))
(eval-when-compile
(when (and ',assertion (not ',no-notice)
notice-non-obvious-broken-facility)
(message "BROKEN FACILITY DETECTED: %s" ,docstring))
nil)
(eval-and-compile
(broken-facility-internal ',facility ,docstring nil))))
(put 'if-broken 'lisp-indent-function 2)
(defmacro if-broken (facility then &rest else)
"If FACILITY is broken, expand to THEN, otherwise (progn . ELSE)."
`(static-if (broken-p ',facility)
,then
,@else))
(put 'when-broken 'lisp-indent-function 1)
(defmacro when-broken (facility &rest body)
"If FACILITY is broken, expand to (progn . BODY), otherwise nil."
`(static-when (broken-p ',facility)
,@body))
(put 'unless-broken 'lisp-indent-function 1)
(defmacro unless-broken (facility &rest body)
"If FACILITY is not broken, expand to (progn . BODY), otherwise nil."
`(static-unless (broken-p ',facility)
,@ body))
(defmacro check-broken-facility (facility)
"Check FACILITY is broken or not. If the status is different on
compile(macro expansion) time and run time, warn it."
`(if-broken ,facility
(unless (broken-p ',facility)
(message "COMPILE TIME ONLY BROKEN FACILITY DETECTED: %s"
(or
',(broken-facility-description facility)
(broken-facility-description ',facility))))
(when (broken-p ',facility)
(message "RUN TIME ONLY BROKEN FACILITY DETECTED: %s"
(or
(broken-facility-description ',facility)
', (broken-facility-description facility))))))
;;; @ end
;;;
(require 'product)
(product-provide (provide 'broken) (require 'apel-ver))
;;; broken.el ends here
<
;;; calist.el --- Condition functions
;; Copyright (C) 1998 Free Software Foundation, Inc.
;; Copyright (C) 1999 Electrotechnical Laboratory, JAPAN.
;; Licensed to the Free Software Foundation.
;; Author: MORIOKA Tomohiko <tomo@m17n.org>
;; Keywords: condition, alist, tree
;; This file is part of APEL (A Portable Emacs Library).
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 2, or (at
;; your option) any later version.
;; This program is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.
;;; Code:
(eval-when-compile (require 'cl))
(require 'alist)
(defvar calist-package-alist nil)
(defvar calist-field-match-method-obarray nil)
(defun find-calist-package (name)
"Return a calist-package by NAME."
(cdr (assq name calist-package-alist)))
(defun define-calist-field-match-method (field-type function)
"Set field-match-method for FIELD-TYPE to FUNCTION."
(fset (intern (symbol-name field-type) calist-field-match-method-obarray)
function))
(defun use-calist-package (name)
"Make the symbols of package NAME accessible in the current package."
(mapatoms (lambda (sym)
(if (intern-soft (symbol-name sym)
calist-field-match-method-obarray)
(signal 'conflict-of-calist-symbol
(list (format "Conflict of symbol %s" sym)))
(if (fboundp sym)
(define-calist-field-match-method
sym (symbol-function sym))
)))
(find-calist-package name)))
(defun make-calist-package (name &optional use)
"Create a new calist-package."
(let ((calist-field-match-method-obarray (make-vector 7 0)))
(set-alist 'calist-package-alist name
calist-field-match-method-obarray)
(use-calist-package (or use 'standard))
calist-field-match-method-obarray))
(defun in-calist-package (name)
"Set the current calist-package to a new or existing calist-package."
(setq calist-field-match-method-obarray
(or (find-calist-package name)
(make-calist-package name))))
(in-calist-package 'standard)
(defun calist-default-field-match-method (calist field-type field-value)
(let ((s-field (assoc field-type calist)))
(cond ((null s-field)
(cons (cons field-type field-value) calist)
)
((eq field-value t)
calist)
((equal (cdr s-field) field-value)
calist))))
(define-calist-field-match-method t (function calist-default-field-match-method))
(defsubst calist-field-match-method (field-type)
(symbol-function
(or (intern-soft (if (symbolp field-type)
(symbol-name field-type)
field-type)
calist-field-match-method-obarray)
(intern-soft "t" calist-field-match-method-obarray))))
(defsubst calist-field-match (calist field-type field-value)
(funcall (calist-field-match-method field-type)
calist field-type field-value))
(defun ctree-match-calist (rule-tree alist)
"Return matched condition-alist if ALIST matches RULE-TREE."
(if (null rule-tree)
alist
(let ((type (car rule-tree))
(choices (cdr rule-tree))
default)
(catch 'tag
(while choices
(let* ((choice (car choices))
(choice-value (car choice)))
(if (eq choice-value t)
(setq default choice)
(let ((ret-alist (calist-field-match alist type (car choice))))
(if ret-alist
(throw 'tag
(if (cdr choice)
(ctree-match-calist (cdr choice) ret-alist)
ret-alist))
))))
(setq choices (cdr choices)))
(if default
(let ((ret-alist (calist-field-match alist type t)))
(if ret-alist
(if (cdr default)
(ctree-match-calist (cdr default) ret-alist)
ret-alist))))
))))
(defun ctree-match-calist-partially (rule-tree alist)
"Return matched condition-alist if ALIST matches RULE-TREE."
(if (null rule-tree)
alist
(let ((type (car rule-tree))
(choices (cdr rule-tree))
default)
(catch 'tag
(while choices
(let* ((choice (car choices))
(choice-value (car choice)))
(if (eq choice-value t)
(setq default choice)
(let ((ret-alist (calist-field-match alist type (car choice))))
(if ret-alist
(throw 'tag
(if (cdr choice)
(ctree-match-calist-partially
(cdr choice) ret-alist)
ret-alist))
))))
(setq choices (cdr choices)))
(if default
(let ((ret-alist (calist-field-match alist type t)))
(if ret-alist
(if (cdr default)
(ctree-match-calist-partially (cdr default) ret-alist)