File: init.el

package info (click to toggle)
python-docutils 0.22%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 11,448 kB
  • sloc: python: 53,302; lisp: 14,475; xml: 1,807; javascript: 1,032; makefile: 102; sh: 96
file content (31 lines) | stat: -rw-r--r-- 1,081 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
;; Initialize tests  -*- lexical-binding: t -*-

(defun init-rst-ert (&optional with-buffer)
  "Initialize tests.
Prepare for buffer using tests if WITH-BUFFER."
  (when with-buffer
    (add-to-list 'load-path ".")
    (load "ert-buffer" nil t)
    (if (equal (car load-path) ".")
	(setq load-path (cdr load-path))))

  (add-to-list 'load-path "..")
  (load "rst.el" nil t)
  (if (equal (car load-path) "..")
      (setq load-path (cdr load-path)))

  ;; Emacs 24 should have a patch in `testcover-after` declaring a
  ;; `gv-expander'.
  (if (< emacs-major-version 24)
      ;; Define a setf-method for `testcover-after' so `ert' tests can be run
      ;; without problems.
      (defsetf testcover-after (idx val) (store)
	(list 'progn
	      (list 'testcover-after idx val)
	      ;; FIXME: Though it solves the problem it is not really correct
	      ;;        because `val' is only a temporary variable here.
	      (list 'setf val store)))))

;; Clean up `load-path' if set caller just to load this file.
(if (equal (car load-path) ".")
    (setq load-path (cdr load-path)))