Fixed a stray paren
And fixed some warnings in the resulting code.
This commit is contained in:
parent
ffe662ced0
commit
809a542e6d
1 changed files with 12 additions and 9 deletions
|
@ -18,6 +18,8 @@ A literate programming configuration file for extending the Journaling capabilit
|
|||
;;
|
||||
;; This file is not part of GNU Emacs.
|
||||
;;
|
||||
;;; Commentary:
|
||||
;;
|
||||
;; *NB:* Do not edit this file. Instead, edit the original literate file at:
|
||||
;; ~/other/hamacs/org-journaling.org
|
||||
;; And tangle the file to recreate this one.
|
||||
|
@ -81,7 +83,7 @@ $0
|
|||
And the code to connect that template to those files:
|
||||
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(ha-auto-insert-file (rx "journal/" (regexp org-journal-rx)) "journal"))
|
||||
(ha-auto-insert-file (rx "journal/" (regexp org-journal-rx)) "journal")
|
||||
#+END_SRC
|
||||
|
||||
Note that when I create a new journal entry, I want a title that should insert a date to match the file's name, not necessarily the current date (see below).
|
||||
|
@ -122,6 +124,7 @@ Capturing a task (that when uncompleted, would then spillover to following days)
|
|||
|
||||
#+begin_src emacs-lisp
|
||||
(defun org-journal-find-location ()
|
||||
"Create or load a new journal buffer. Used for `org-capture'."
|
||||
(org-journal-new-entry)
|
||||
(goto-char (point-max)))
|
||||
|
||||
|
@ -166,6 +169,8 @@ Given this splitter function, we create a function that takes some sort of opera
|
|||
|
||||
#+begin_src emacs-lisp
|
||||
(defun find-file-number-change (f)
|
||||
"Return a filename based on applying F to current buffer.
|
||||
Where F would be something like `1+' or `1-'."
|
||||
(let* ((filename (buffer-file-name))
|
||||
(parts (split-string-with-number
|
||||
(file-name-base filename)))
|
||||
|
@ -181,20 +186,18 @@ And this allows us to create two simple functions that can load the "next" and "
|
|||
|
||||
#+begin_src emacs-lisp
|
||||
(defun find-file-increment ()
|
||||
"Takes the current buffer, and loads the file that is 'one
|
||||
more' than the file contained in the current buffer. This
|
||||
requires that the current file contain a number that can be
|
||||
incremented."
|
||||
"Load file that is _one more_ than the file in current buffer.
|
||||
This requires that the current file contain a number that can be
|
||||
incremented."
|
||||
(interactive)
|
||||
(find-file (find-file-number-change '1+)))
|
||||
#+end_src
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(defun find-file-decrement ()
|
||||
"Takes the current buffer, and loads the file that is 'one
|
||||
less' than the file contained in the current buffer. This
|
||||
requires that the current file contain a number that can be
|
||||
decremented."
|
||||
"Load file that is _one less_ than the file in current buffer.
|
||||
This requires that the current file contain a number that can be
|
||||
decremented."
|
||||
(interactive)
|
||||
(find-file (find-file-number-change '1-)))
|
||||
#+end_src
|
||||
|
|
Loading…
Reference in a new issue