summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/test.yml40
-rw-r--r--.mailmap1
-rw-r--r--.travis.yml24
-rw-r--r--Makefile9
-rw-r--r--README.org2
-rw-r--r--bog-tests.el2
-rw-r--r--bog.el51
7 files changed, 78 insertions, 51 deletions
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
new file mode 100644
index 0000000..77e5628
--- /dev/null
+++ b/.github/workflows/test.yml
@@ -0,0 +1,40 @@
+name: CI
+on: [push, pull_request]
+permissions: {}
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+
+ strategy:
+ matrix:
+ emacs_version:
+ - 24.3
+ - 24.4
+ - 24.5
+ - 25.1
+ - 25.2
+ - 25.3
+ - 26.1
+ - 26.2
+ - 26.3
+ - 27.1
+ - 27.2
+ - 28.1
+ - 28.2
+ - 29.1
+ - 29.2
+ - release-snapshot
+ - snapshot
+
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ persist-credentials: false
+
+ - uses: purcell/setup-emacs@master
+ with:
+ version: ${{ matrix.emacs_version }}
+
+ - run: make all
+ - run: make test
diff --git a/.mailmap b/.mailmap
new file mode 100644
index 0000000..e20438f
--- /dev/null
+++ b/.mailmap
@@ -0,0 +1 @@
+<basil@contovou.net> <contovob@tcd.ie>
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index bb28881..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,24 +0,0 @@
-sudo: false
-language: generic
-env:
- global:
- - CURL="curl -fsSkL --retry 9 --retry-delay 9"
- - GHRAW="https://raw.githubusercontent.com"
- matrix:
- - EMACS_VERSION=26.3
- - EMACS_VERSION=master
- allow_failures:
- - env: EMACS_VERSION=master
-
-install:
- - $CURL -O https://github.com/npostavs/emacs-travis/releases/download/bins/emacs-bin-${EMACS_VERSION}.tar.gz
- - tar -xaf emacs-bin-${EMACS_VERSION}.tar.gz -C /
- - export EMACS=/tmp/emacs/bin/emacs
-
-script:
- make test EMACS=${EMACS}
-
-notifications:
- email:
- on_success: never
- on_failure: always
diff --git a/Makefile b/Makefile
index d85bb40..23330e5 100644
--- a/Makefile
+++ b/Makefile
@@ -19,5 +19,10 @@ clean:
bog-autoloads.el: bog.el
@$(BATCH) -L . --eval \
- "(let (make-backup-files) \
- (update-file-autoloads \"$(CURDIR)/$<\" t \"$(CURDIR)/$@\"))"
+ "(let* ((default-directory (file-name-as-directory \"$(CURDIR)\")) \
+ (target (expand-file-name \"$@\")) \
+ (excludes (list \"bog-tests.el\")) \
+ (make-backup-files nil)) \
+ (if (fboundp (quote loaddefs-generate)) \
+ (loaddefs-generate default-directory target excludes) \
+ (update-file-autoloads \"$<\" t target)))"
diff --git a/README.org b/README.org
index c6c1e9b..e8b50ce 100644
--- a/README.org
+++ b/README.org
@@ -2,7 +2,7 @@
#+options: toc:nil
#+startup: showall
-[[https://travis-ci.org/kyleam/bog][https://travis-ci.org/kyleam/bog.svg]]
+[[https://github.com/kyleam/bog/actions/workflows/test.yml][https://github.com/kyleam/bog/actions/workflows/test.yml/badge.svg]]
[[https://melpa.org/#/bog][https://melpa.org/packages/bog-badge.svg]]
Bog is a system for taking research notes in [[https://orgmode.org/][Org mode]]. It adds a few
diff --git a/bog-tests.el b/bog-tests.el
index 01c7f08..066c05f 100644
--- a/bog-tests.el
+++ b/bog-tests.el
@@ -1,7 +1,7 @@
;;; bog-tests.el --- Tests for Bog -*- lexical-binding: t -*-
;; Copyright (C) 2013-2016 Kyle Meyer <kyle@kyleam.com>
-;; Copyright (C) 2020 Basil L. Contovounesios <contovob@tcd.ie>
+;; Copyright (C) 2020 Basil L. Contovounesios <basil@contovou.net>
;; Author: Kyle Meyer <kyle@kyleam.com>
diff --git a/bog.el b/bog.el
index acb8047..d8b04c1 100644
--- a/bog.el
+++ b/bog.el
@@ -1,12 +1,12 @@
;;; bog.el --- Extensions for research notes in Org mode -*- lexical-binding: t -*-
;; Copyright (C) 2013-2016 Kyle Meyer <kyle@kyleam.com>
-;; Copyright (C) 2020 Basil L. Contovounesios <contovob@tcd.ie>
+;; Copyright (C) 2020-2023 Basil L. Contovounesios <basil@contovou.net>
;; Author: Kyle Meyer <kyle@kyleam.com>
;; URL: https://github.com/kyleam/bog
;; Keywords: bib, outlines
-;; Version: 1.3.2
+;; Version: 1.3.3
;; Package-Requires: ((cl-lib "0.5"))
;; This program is free software; you can redistribute it and/or modify
@@ -517,15 +517,12 @@ If NO-CONTEXT is non-nil, immediately fall back."
"List citekeys that appear in notes but don't have a heading.
With prefix argument FILE, include only orphan citekeys from that
file."
- (interactive (list (and current-prefix-arg
- (bog-read-note-file-name))))
- (let ((files (or (and file (list file))
- (bog-notes)))
- (heading-cks (bog-all-heading-citekeys))
- (bufname "*Bog orphan citekeys*"))
- (with-current-buffer (get-buffer-create bufname)
+ (interactive (and current-prefix-arg
+ (list (bog-read-note-file-name))))
+ (let ((files (if file (list file) (bog-notes)))
+ (heading-cks (bog-all-heading-citekeys)))
+ (with-current-buffer (get-buffer-create "*Bog orphan citekeys*")
(erase-buffer)
- (insert "\n")
(dolist (file files)
(let* ((text-cks (bog-non-heading-citekeys-in-file file))
(nohead-cks (bog--set-difference text-cks heading-cks)))
@@ -533,11 +530,15 @@ file."
(insert (format "* %s\n\n%s\n\n"
(file-name-nondirectory file)
(mapconcat #'identity nohead-cks "\n"))))))
- (org-mode)
- (bog-mode 1)
- (bog--outline-show-all)
- (goto-char (point-min)))
- (pop-to-buffer bufname)))
+ (if (> (buffer-size) 0)
+ (progn
+ (org-mode)
+ (bog-mode)
+ (bog--outline-show-all)
+ (goto-char (point-min))
+ (pop-to-buffer (current-buffer)))
+ (kill-buffer)
+ (message "No orphans found")))))
(defun bog-list-duplicate-heading-citekeys (&optional clear-cache)
"List citekeys that have more than one heading.
@@ -554,7 +555,7 @@ is only active if `bog-use-citekey-cache' is non-nil)."
(kill-buffer bufname)))
(with-current-buffer (get-buffer-create bufname)
(erase-buffer)
- (insert (mapconcat #'identity dup-cks "\n"))
+ (insert (mapconcat #'identity dup-cks "\n") ?\n)
(org-mode)
(bog-mode 1)
(goto-char (point-min)))
@@ -795,7 +796,6 @@ Generate a file name with the form
(with-current-buffer (get-buffer-create "*Bog orphan files*")
(erase-buffer)
(setq default-directory bog-root-directory)
- (insert ?\n)
(with-syntax-table bog-citekey-syntax-table
(dolist (ck-file (bog-all-citekey-files))
(let ((base-name (file-name-nondirectory ck-file))
@@ -808,7 +808,7 @@ Generate a file name with the form
(file-relative-name ck-file)))))))
(goto-char (point-min))
(org-mode)
- (if (/= (buffer-size) 1)
+ (if (> (buffer-size) 0)
(pop-to-buffer (current-buffer))
(message "No orphans found")
(kill-buffer)))))
@@ -976,8 +976,7 @@ instead of citekeys from file names in `bog-bib-directory'."
(with-current-buffer (get-buffer-create orphan-bufname)
(erase-buffer)
(setq default-directory bog-root-directory)
- (insert ?\n)
- (insert (mapconcat #'identity orphans "\n"))
+ (insert (mapconcat #'identity orphans "\n") ?\n)
(goto-char (point-min))
(org-mode)
(pop-to-buffer (current-buffer)))
@@ -1033,6 +1032,12 @@ Groups are specified by `bog-citekey-web-search-groups'."
;;; Notes-related
+;; `org-show-context' is obsolete as of Org 9.6.
+(defalias 'bog--fold-show-context
+ (if (fboundp 'org-fold-show-context)
+ #'org-fold-show-context
+ 'org-show-context))
+
;;;###autoload
(defun bog-goto-citekey-heading-in-notes (&optional no-context)
"Find citekey heading in notes.
@@ -1063,7 +1068,7 @@ buffer, the narrowing is removed."
(> marker (point-max)))
(widen))
(goto-char marker)
- (org-show-context))))
+ (bog--fold-show-context))))
(defun bog--find-citekey-heading-in-buffer (citekey &optional pos-only)
"Return the marker of heading for CITEKEY.
@@ -1333,7 +1338,7 @@ With argument ARG, do it ARG times."
(re-search-forward bog-citekey-format nil t))
(unless (org-at-heading-p)
(setq arg (1- arg))))))
- (org-show-context)))
+ (bog--fold-show-context)))
;;;###autoload
(defun bog-previous-non-heading-citekey (&optional arg)
@@ -1348,7 +1353,7 @@ With argument ARG, do it ARG times."
(unless (org-at-heading-p)
(setq arg (1- arg)))))
(skip-syntax-backward "w"))
- (org-show-context))
+ (bog--fold-show-context))
;;;###autoload
(defun bog-jump-to-topic-heading ()