From 6320d065e82b9462824895f55b75d8ee9be468e7 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Sun, 15 Sep 2024 02:49:21 +0300 Subject: dashboard: Remove graph. * Creating & maintaining a graph using text characters is unnecessary. --- gnosis-dashboard.el | 57 ----------------------------------------------------- 1 file changed, 57 deletions(-) diff --git a/gnosis-dashboard.el b/gnosis-dashboard.el index 23a04f7..3b96348 100644 --- a/gnosis-dashboard.el +++ b/gnosis-dashboard.el @@ -143,63 +143,6 @@ Skips days where no note was reviewed." do (setq total (+ total entry))) (/ total (max (length (remove 0 entries)) 1)))) -;; TODO: Add more conds & faces -(defun gnosis-dashboard--graph-propertize (string num) - "Propertize STRING depending on the NUM of reviews." - (cond ((= num 0) - (propertize string 'face 'shadow)) - ((> num 0) - (propertize string 'face 'font-lock-constant-face)))) - -(defun gnosis-dashboard--add-padding (str-length) - "Add padding for STR-LENGTH." - (let ((padding (/ (- (window-width) str-length) 2))) - (make-string padding ?\s))) - -(defun gnosis-dashboard-reviews-graph (dates &optional ) - "Insert graph for month DATES. - -Optionally, use when using multiple months." - (let ((count 0) - (row 0) - (start-column (current-column)) - (end-column nil)) - (cl-loop for day in dates - when (= count 0) - do (let ((current-column (current-column))) - (and (< (move-to-column start-column) start-column) - ;; Add spaces to reach start-column. - (insert (make-string (- start-column current-column) ?\s)))) - (insert " ") - do (end-of-line) - (insert (gnosis-dashboard--graph-propertize (format "[%s] " (if (= day 0) "-" "x")) day)) - (cl-incf count) - when (= count 7) - do - (setq end-column (current-column)) - (setq count 0) - (insert " ") - (cl-incf row) - (end-of-line) - (when (and (/= (forward-line 1) 0) (eobp)) - (insert "\n") - (forward-line 0))) - (insert (make-string (- end-column (current-column)) ?\s)) - (insert " "))) -;; TODO: Refactor this! -(defun gnosis-dashboard-month-overview (&optional num) - "Insert review graph for MONTHS." - (gnosis-insert-separator) - (let* ((point (point)) - (month (car (calendar-current-date)))) - (insert (gnosis-dashboard--add-padding (min (* (max num 1) 50) (window-width)))) - (while (<= month (+ (car (calendar-current-date)) num)) - ;; (insert (format "%d" month)) - (gnosis-dashboard-reviews-graph (gnosis-dashboard-month-reviews month)) - (goto-char point) - (end-of-line) - (cl-incf month)))) - (defun gnosis-dashboard-output-note (id) "Output contents for note with ID, formatted for gnosis dashboard." (cl-loop for item in (append (gnosis-select '[main options answer tags type] 'notes `(= id ,id) t) -- cgit v1.2.3 From a542549906530ca8c88002988db97590373008f4 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Sun, 15 Sep 2024 02:50:41 +0300 Subject: Fix docstring typos --- gnosis.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gnosis.el b/gnosis.el index 9b71a76..bad0973 100644 --- a/gnosis.el +++ b/gnosis.el @@ -1193,7 +1193,8 @@ Valid cloze formats include: (defun gnosis-cloze-extract-answers (nested-lst) "Extract cloze answers for string clozes inside the NESTED-LST. -This function should be used in combination with `gnosis-cloze-extract-answers'." +This function should be used in combination with +`gnosis-cloze-extract-contents'." (mapcar (lambda (lst) (mapcar (lambda (str) (replace-regexp-in-string "::\\(.*\\)" "" str)) @@ -1203,7 +1204,8 @@ This function should be used in combination with `gnosis-cloze-extract-answers'. (defun gnosis-cloze-extract-hints (nested-lst) "Extract cloze hints for string clozes inside the NESTED-LST. -This function should be used in combination with `gnosis-cloze-extract-answers'." +This function should be used in combination with +`gnosis-cloze-extract-contents'." (mapcar (lambda (lst) (mapcar (lambda (str) (when (string-match "::\\(.*\\)" str) -- cgit v1.2.3 From 5b3094c34bc835d3427a08c46c691ae8f967ebcd Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Sun, 15 Sep 2024 02:50:55 +0300 Subject: New function: delete-activity-log. * Delete all activity log entries. --- gnosis.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gnosis.el b/gnosis.el index bad0973..71c232d 100644 --- a/gnosis.el +++ b/gnosis.el @@ -1695,6 +1695,12 @@ If NEW? is non-nil, increment new notes log by 1." (gnosis-update 'activity-log `(= reviewed-total ,inc-total) `(= date ',date)) (and new? (gnosis-update 'activity-log `(= reviewed-new ,inc-new) `(= date ',date))))) +(defun gnosis-delete-activity-log () + "Delete all activity log entries." + (interactive) + (when (y-or-n-p "Delete activity log?") + (emacsql gnosis-db [:delete :from activity-log]))) + (defun gnosis-review-note (id) "Start review for note with value of id ID, if note is unsuspended. -- cgit v1.2.3 From 4041ef532d462a41410b8d11299ad14a79bf86e8 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Thu, 19 Sep 2024 17:08:35 +0300 Subject: doc: Update manual & git repo sources * Add mirrors --- doc/gnosis.org | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/gnosis.org b/doc/gnosis.org index 9d0efb9..19416ab 100644 --- a/doc/gnosis.org +++ b/doc/gnosis.org @@ -30,10 +30,13 @@ learning environment tailored to each specific topic/subject. #+texinfo: @noindent This manual is written for Gnosis version {{{stable-version}}}, released on {{{release-date}}}. -+ Official manual: ++ Manual: + + + (Mirror) + Git repositories: + + + (Mirror) + + (Mirror) #+texinfo: @insertcopying -- cgit v1.2.3 From 28b4067319bb10fc208c1066ef306779419a5a2b Mon Sep 17 00:00:00 2001 From: Gabriel <172639817+gs-101@users.noreply.github.com> Date: Thu, 19 Sep 2024 08:25:38 -0300 Subject: doc: New section: Interactions with other software. * Add new sections for gnosis interactions with other software. * Add interactions documentation with emacs-no-literring. * Restracture sections. --- doc/gnosis.org | 71 +++++++++++++++++++++++++++++++++------------------------- 1 file changed, 41 insertions(+), 30 deletions(-) diff --git a/doc/gnosis.org b/doc/gnosis.org index 19416ab..8054009 100644 --- a/doc/gnosis.org +++ b/doc/gnosis.org @@ -188,7 +188,6 @@ difference of at most one character edit. To demonstrate, 'example' and 'examples' will be recognized as similar, considering that the latter involves just one additional character." - * Gnosis Algorithm Each gnosis note has a gnosis score, which is a list of 3 values, @@ -241,35 +240,6 @@ it's next review date will be on the same date. + You can edit a note after review by pressing ~e~ + Open =gnosis-dashboard= with =M-x gnosis-dashboard=, find the note you want to edit and press ~e~ -* Sync between devices - -Gnosis uses git to maintain data integrity and facilitate -synchronization across devices. - -You will need to configure your remote manually. - -Example: - -#+begin_src bash - cd ~/.emacs.d/gnosis # default location for gnosis - git init # After completing your first review session, a git repo should have been initialized automatically. - git remote add origin - git push --set-upstream origin master -#+end_src - - -You can interactively use =gnosis-vc-push= & =gnosis-vc-pull=. As the -name suggests, they rely on =vc= to work properly. - -Depending on your setup, =vc= might require an external package for -the ssh passphrase dialog, such as ~x11-ssh-askpass~. - -To automatically push changes after a review session, add this to your configuration: -#+begin_src emacs-lisp -(setf gnosis-vc-auto-push t) -(gnosis-vc-pull) ;; Run vc-pull for gnosis on startup -#+end_src - * Configuring Note Types ** Custom Note Types Each gnosis note type has an /interactive/ function, named @@ -303,3 +273,44 @@ testing. To exit the testing environment, rerun =M-x gnosis-test-start= and then enter =n= (no) at the prompt "Start development env?" + +* Sync between devices + +Gnosis uses git to maintain data integrity and facilitate +synchronization across devices. + +You will need to configure your remote manually. + +Example: + +#+begin_src bash + cd ~/.emacs.d/gnosis # default location for gnosis, no-littering is ~/.emacs.d/var/gnosis + git init # After completing your first review session, a git repo should have been initialized automatically. + git remote add origin + git push --set-upstream origin master +#+end_src + + +You can interactively use =gnosis-vc-push= & =gnosis-vc-pull=. As the +name suggests, they rely on =vc= to work properly. + +Depending on your setup, =vc= might require an external package for +the ssh passphrase dialog, such as ~x11-ssh-askpass~. + +To automatically push changes after a review session, add this to your configuration: +#+begin_src emacs-lisp +(setf gnosis-vc-auto-push t) +(gnosis-vc-pull) ;; Run vc-pull for gnosis on startup +#+end_src + +* Interactions with other software +** emacs-no-littering + +If you are a user of [[https://github.com/emacscollective/no-littering][emacs-no-littering]], you can theme Gnosis to fit +its standards by adding the following snippet to your configuration: + +#+begin_src emacs-lisp +(setq gnosis-dir (no-littering-expand-var-file-name "gnosis/")) +#+end_src + +This sets =gnosis-dir= to =~/.emacs.d/var/gnosis=, in line with the folders of other packages. -- cgit v1.2.3 From 17418b16f6fe6ac0b8e976f20c4f6fda42b4a025 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Sat, 21 Sep 2024 08:53:27 +0300 Subject: New function: dashboard-enable-mode. * Enables gnosis-dashboard-mode, when in a valid buffer. --- gnosis-dashboard.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gnosis-dashboard.el b/gnosis-dashboard.el index 3b96348..8d06c31 100644 --- a/gnosis-dashboard.el +++ b/gnosis-dashboard.el @@ -383,6 +383,13 @@ When called with called with a prefix, unsuspend all notes of deck." gnosis-dashboard--selected-ids nil) (display-line-numbers-mode 0)) +(defun gnosis-dashboard-enable-mode () + "Enable `gnosis-dashboard-mode'. + +This should only be enabled in a gnosis dashboard buffer." + (when (string= (buffer-name) gnosis-dashboard-buffer-name) + (gnosis-dashboard-mode))) + (cl-defun gnosis-dashboard--search (&optional dashboard-type (note-ids nil)) "Display gnosis dashboard. -- cgit v1.2.3 From e40c28790923f6ce9854fd5e1019b566ff547490 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Sat, 21 Sep 2024 08:54:03 +0300 Subject: [fix] Update dashboard buffer names & issues with dashboard-mode. * Only enable gnosis-dashboard-mode in a buffer with gnosis-dashboard-buffer-name. --- gnosis-dashboard.el | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/gnosis-dashboard.el b/gnosis-dashboard.el index 8d06c31..a4332cd 100644 --- a/gnosis-dashboard.el +++ b/gnosis-dashboard.el @@ -62,6 +62,8 @@ (defvar gnosis-dashboard-note-ids nil "Store note ids for dashboard.") +(defvar gnosis-dashboard-buffer-name "*Gnosis Dashboard*") + (defvar gnosis-dashboard-search-value nil "Store search value.") @@ -194,8 +196,8 @@ Skips days where no note was reviewed." (defun gnosis-dashboard-output-notes (note-ids) "Return NOTE-IDS contents on gnosis dashboard." (cl-assert (listp note-ids) t "`note-ids' must be a list of note ids.") - (pop-to-buffer-same-window "*gnosis-dashboard*") - (gnosis-dashboard-mode) + (pop-to-buffer-same-window gnosis-dashboard-buffer-name) + (gnosis-dashboard-enable-mode) (gnosis-dashboard-notes-mode) (setf tabulated-list-format `[("Main" ,(/ (window-width) 4) t) ("Options" ,(/ (window-width) 6) t) @@ -276,8 +278,8 @@ Skips days where no note was reviewed." (defun gnosis-dashboard-output-tags (&optional tags) "Format gnosis dashboard with output of TAGS." (let ((tags (or tags (gnosis-get-tags--unique)))) - (pop-to-buffer-same-window "*gnosis-dashboard*") - (gnosis-dashboard-mode) + (pop-to-buffer-same-window gnosis-dashboard-buffer-name) + (gnosis-dashboard-enable-mode) (gnosis-dashboard-tags-mode) (setf gnosis-dashboard--current '(:type 'tags)) (setq tabulated-list-format [("Name" 35 t) @@ -312,8 +314,8 @@ Skips days where no note was reviewed." (defun gnosis-dashboard-output-decks () "Return deck contents for gnosis dashboard." - (pop-to-buffer-same-window "*gnosis-dashboard*") - (gnosis-dashboard-mode) + (pop-to-buffer-same-window gnosis-dashboard-buffer-name) + (gnosis-dashboard-enable-mode) (gnosis-dashboard-decks-mode) (setq tabulated-list-format [("Name" 15 t) ("Total Notes" 10 gnosis-dashboard-sort-total-notes)]) @@ -378,6 +380,7 @@ When called with called with a prefix, unsuspend all notes of deck." (define-derived-mode gnosis-dashboard-mode tabulated-list-mode "Gnosis Dashboard" "Major mode for displaying Gnosis dashboard." :keymap gnosis-dashboard-mode-map + :interactive nil (setq tabulated-list-padding 2 tabulated-list-sort-key nil gnosis-dashboard--selected-ids nil) @@ -494,7 +497,7 @@ DASHBOARD-TYPE: either 'Notes' or 'Decks' to display the respective dashboard." "Test function to create an editable field and a search button." (interactive) (delete-other-windows) - (let ((buffer-name "*Gnosis Dashboard*") + (let ((buffer-name gnosis-dashboard-buffer-name) (due-notes (gnosis-review-get-due-notes))) (when (get-buffer buffer-name) (kill-buffer buffer-name)) ;; Kill the existing buffer if it exists @@ -543,7 +546,7 @@ DASHBOARD-TYPE: either 'Notes' or 'Decks' to display the respective dashboard." (widget-setup)) (pop-to-buffer-same-window buffer) (goto-char (point-min)) - (gnosis-dashboard-mode) + (gnosis-dashboard-enable-mode) (gnosis-dashboard-menu)))) (provide 'gnosis-dashboard) -- cgit v1.2.3 From c246c3abb1674e1dfd6190406781a723f25f5cc7 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Sun, 6 Oct 2024 08:18:25 +0300 Subject: Remove custom review keybindings. --- gnosis.el | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/gnosis.el b/gnosis.el index 71c232d..2b4ddbc 100644 --- a/gnosis.el +++ b/gnosis.el @@ -115,19 +115,6 @@ When nil, the image will be displayed at its original size." :type 'integer :group 'gnosis) -(defcustom gnosis-review-keybindings - '((?n . "next") - (?o . "override") - (?s . "suspend") - (?e . "edit") - (?q . "quit")) - "List of action bindings for `gnosis-review-actions'. - -Each element should be a list of a single character (the key), -a string describing the action." - :type '(alist :key-type character :value-type string) - :group 'gnosis) - (defvar gnosis-images-dir (expand-file-name "images" gnosis-dir) "Gnosis images directory.") -- cgit v1.2.3 From 3a9be993adeba9aafc5b8cc4ea03a025ad48505e Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Sun, 6 Oct 2024 08:19:18 +0300 Subject: Remove validate-actions-keys function. * Custom review keybindings will not be supported anymore. --- gnosis.el | 7 ------- 1 file changed, 7 deletions(-) diff --git a/gnosis.el b/gnosis.el index 2b4ddbc..73cdebd 100644 --- a/gnosis.el +++ b/gnosis.el @@ -1789,13 +1789,6 @@ be called with new SUCCESS value plus NOTE & NOTE-COUNT." (gnosis-display-next-review note success) (gnosis-review-actions success note note-count)) -(defun gnosis-validate-actions-keys () - "Ensure all actions in `gnosis-review-actions-keys` are valid." - (let ((valid-actions '("next" "override" "suspend" "edit" "quit"))) - (dolist (entry gnosis-review-keybindings) - (cl-assert (member (cdr entry) valid-actions) nil - "Invalid action: %s" (cdr entry))))) - (defun gnosis-review-actions (success note note-count) "Specify action during review of note. -- cgit v1.2.3 From bf7cf6ee59a56f64e5f3c23fd1601ce9aac3d79b Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Sun, 6 Oct 2024 08:20:31 +0300 Subject: Rename function delete-activity-log to history-clear. * All function that have edit history will be written with -history-. --- gnosis.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnosis.el b/gnosis.el index 73cdebd..08689ab 100644 --- a/gnosis.el +++ b/gnosis.el @@ -1682,10 +1682,10 @@ If NEW? is non-nil, increment new notes log by 1." (gnosis-update 'activity-log `(= reviewed-total ,inc-total) `(= date ',date)) (and new? (gnosis-update 'activity-log `(= reviewed-new ,inc-new) `(= date ',date))))) -(defun gnosis-delete-activity-log () +(defun gnosis-history-clear () "Delete all activity log entries." (interactive) - (when (y-or-n-p "Delete activity log?") + (when (y-or-n-p "Delete all activity log?") (emacsql gnosis-db [:delete :from activity-log]))) (defun gnosis-review-note (id) -- cgit v1.2.3 From b83de5ab8410ce9cfbd6cf41bcb05803ac021c16 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Sun, 6 Oct 2024 08:23:16 +0300 Subject: Clarify comments & Use polytonic Greek for Athens (Ἀθήνα). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gnosis.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnosis.el b/gnosis.el index 08689ab..03a9fc8 100644 --- a/gnosis.el +++ b/gnosis.el @@ -1694,7 +1694,7 @@ If NEW? is non-nil, increment new notes log by 1." DATE: Date to log the note review on the activity-log." (when (gnosis-suspended-p id) (message "Suspended note with id: %s" id) - (sit-for 0.3)) ;; this should only occur in testing/dev cases + (sit-for 0.3)) ;; this should only occur in testing (let* ((type (gnosis-get 'type 'notes `(= id ,id))) (func-name (intern (format "gnosis-review-%s" (downcase type))))) (if (fboundp func-name) @@ -2532,7 +2532,7 @@ If STRING-SECTION is nil, apply FACE to the entire STRING." :question "Which one is the capital of Greece?" :choices '("Athens" "Sparta" "Rome" "Berlin") :correct-answer 1 - :extra "Athens (Αθήνα) is the largest city of Greece & one of the world's oldest cities, with it's recorded history spanning over 3,500 years." + :extra "Athens (Ἀθήνα) is the largest city of Greece & one of the world's oldest cities, with it's recorded history spanning over 3,500 years." :tags note-tags) (gnosis-add-note--cloze :deck deck-name :note "GNU Emacs is an extensible editor created by {{c1::Richard}} {{c1::Stallman}} in {{c2::1984::year}}" -- cgit v1.2.3 From 0ce218ddce66dcc0d42c30bc62c94dbf093d155a Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Sun, 6 Oct 2024 08:25:37 +0300 Subject: [Rewrite] review-actions using read-char-choice. * read-multiple-choice locks emacs. Using read-char-choice user can now switch buffers during review. --- gnosis.el | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/gnosis.el b/gnosis.el index 03a9fc8..c85c9cc 100644 --- a/gnosis.el +++ b/gnosis.el @@ -1797,18 +1797,21 @@ NOTE: Note ID NOTE-COUNT: Total notes reviewed To customize the keybindings, adjust `gnosis-review-keybindings'." - (gnosis-validate-actions-keys) - (let* ((choices (mapcar (lambda (pair) - (list (car pair) (cdr pair))) - gnosis-review-keybindings)) - (choice (car (read-multiple-choice "Note actions" choices))) - (action (alist-get choice gnosis-review-keybindings))) - (pcase action - ("next" (gnosis-review-result note success)) - ("override" (gnosis-review-action--override success note note-count)) - ("suspend" (gnosis-review-action--suspend success note note-count)) - ("edit" (gnosis-review-action--edit success note note-count)) - ("quit" (gnosis-review-action--quit success note))))) + (let* ((choice + (read-char-choice + (format "Action: %sext gnosis, %sverride result, %suspend note, %sdit note, %suit review session" + (propertize "n" 'face 'match) + (propertize "o" 'face 'match) + (propertize "s" 'face 'match) + (propertize "e" 'face 'match) + (propertize "q" 'face 'match)) + '(?n ?o ?s ?e ?q)))) + (pcase choice + (?n (gnosis-review-result note success)) + (?o (gnosis-review-action--override success note note-count)) + (?s (gnosis-review-action--suspend success note note-count)) + (?e (gnosis-review-action--edit success note note-count)) + (?q (gnosis-review-action--quit success note))))) (defun gnosis-review-session (notes &optional due note-count) "Start review session for NOTES. -- cgit v1.2.3 From fd1315830e3aedf5d7cedc8410ec4f4bc2b781f0 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Sun, 6 Oct 2024 08:34:02 +0300 Subject: Update docs & version bump to 0.4.4. --- doc/gnosis.info | 154 +++++++++++++++++++++++++++++++++++--------------------- doc/gnosis.org | 4 +- doc/gnosis.texi | 94 ++++++++++++++++++++++------------ gnosis.el | 9 ++-- 4 files changed, 165 insertions(+), 96 deletions(-) diff --git a/doc/gnosis.info b/doc/gnosis.info index b57f067..252fe79 100644 --- a/doc/gnosis.info +++ b/doc/gnosis.info @@ -1,4 +1,4 @@ -This is gnosis.info, produced by .texi2any-real version 7.1 from +This is gnosis.info, produced by .texi2any-real version 7.1.1 from gnosis.texi. INFO-DIR-SECTION Emacs misc features @@ -19,10 +19,15 @@ learning environment tailored to each specific topic/subject. This manual is written for Gnosis version 0.4.2, released on 2024-09-5. - • Official manual: + • Manual: • + • (Mirror) • Git repositories: • + • (Mirror) + • + + (Mirror) * Menu: @@ -32,8 +37,9 @@ This manual is written for Gnosis version 0.4.2, released on 2024-09-5. * Customization:: * Gnosis Algorithm:: * Editing notes:: -* Sync between devices:: * Configuring Note Types:: +* Sync between devices:: +* Interactions with other software:: -- The Detailed Node Listing -- @@ -61,6 +67,10 @@ Configuring Note Types * Custom Note Types:: * Development:: +Interactions with other software + +* emacs-no-littering:: +  File: gnosis.info, Node: Introduction, Next: Adding notes, Prev: Top, Up: Top @@ -336,7 +346,7 @@ next interval value: 0 days (0), 1 day later (1), 2 days later (2), and successful reviews, it's next review date will be on the same date.  -File: gnosis.info, Node: Editing notes, Next: Sync between devices, Prev: Gnosis Algorithm, Up: Top +File: gnosis.info, Node: Editing notes, Next: Configuring Note Types, Prev: Gnosis Algorithm, Up: Top 6 Editing notes *************** @@ -348,38 +358,9 @@ File: gnosis.info, Node: Editing notes, Next: Sync between devices, Prev: Gno note you want to edit and press ‘e’  -File: gnosis.info, Node: Sync between devices, Next: Configuring Note Types, Prev: Editing notes, Up: Top - -7 Sync between devices -********************** - -Gnosis uses git to maintain data integrity and facilitate -synchronization across devices. - - You will need to configure your remote manually. - - Example: - - cd ~/.emacs.d/gnosis # default location for gnosis - git init # After completing your first review session, a git repo should have been initialized automatically. - git remote add origin - git push --set-upstream origin master - - You can interactively use ‘gnosis-vc-push’ & ‘gnosis-vc-pull’. As -the name suggests, they rely on ‘vc’ to work properly. - - Depending on your setup, ‘vc’ might require an external package for -the ssh passphrase dialog, such as ‘x11-ssh-askpass’. - - To automatically push changes after a review session, add this to -your configuration: - (setf gnosis-vc-auto-push t) - (gnosis-vc-pull) ;; Run vc-pull for gnosis on startup - - -File: gnosis.info, Node: Configuring Note Types, Prev: Sync between devices, Up: Top +File: gnosis.info, Node: Configuring Note Types, Next: Sync between devices, Prev: Editing notes, Up: Top -8 Configuring Note Types +7 Configuring Note Types ************************ * Menu: @@ -390,7 +371,7 @@ File: gnosis.info, Node: Configuring Note Types, Prev: Sync between devices,  File: gnosis.info, Node: Custom Note Types, Next: Development, Up: Configuring Note Types -8.1 Custom Note Types +7.1 Custom Note Types ===================== Each gnosis note type has an _interactive_ function, named @@ -418,7 +399,7 @@ prompted to enter anything for ‘extra’ & ‘images’.  File: gnosis.info, Node: Development, Prev: Custom Note Types, Up: Configuring Note Types -8.2 Development +7.2 Development =============== To make development and customization easier, gnosis comes with @@ -428,30 +409,87 @@ for testing. To exit the testing environment, rerun ‘M-x gnosis-test-start’ and then enter ‘n’ (no) at the prompt "Start development env?" + +File: gnosis.info, Node: Sync between devices, Next: Interactions with other software, Prev: Configuring Note Types, Up: Top + +8 Sync between devices +********************** + +Gnosis uses git to maintain data integrity and facilitate +synchronization across devices. + + You will need to configure your remote manually. + + Example: + + cd ~/.emacs.d/gnosis # default location for gnosis, no-littering is ~/.emacs.d/var/gnosis + git init # After completing your first review session, a git repo should have been initialized automatically. + git remote add origin + git push --set-upstream origin master + + You can interactively use ‘gnosis-vc-push’ & ‘gnosis-vc-pull’. As +the name suggests, they rely on ‘vc’ to work properly. + + Depending on your setup, ‘vc’ might require an external package for +the ssh passphrase dialog, such as ‘x11-ssh-askpass’. + + To automatically push changes after a review session, add this to +your configuration: + (setf gnosis-vc-auto-push t) + (gnosis-vc-pull) ;; Run vc-pull for gnosis on startup + + +File: gnosis.info, Node: Interactions with other software, Prev: Sync between devices, Up: Top + +9 Interactions with other software +********************************** + +* Menu: + +* emacs-no-littering:: + + +File: gnosis.info, Node: emacs-no-littering, Up: Interactions with other software + +9.1 emacs-no-littering +====================== + +If you are a user of emacs-no-littering +(https://github.com/emacscollective/no-littering), you can theme Gnosis +to fit its standards by adding the following snippet to your +configuration: + + (setq gnosis-dir (no-littering-expand-var-file-name "gnosis/")) + + This sets ‘gnosis-dir’ to ‘~/.emacs.d/var/gnosis’, in line with the +folders of other packages. +  Tag Table: -Node: Top250 -Node: Introduction1341 -Node: Adding notes2354 -Node: Note Types2765 -Node: Cloze2983 -Node: MC-Cloze (Under development)4145 -Node: MCQ5133 -Node: Basic Type5571 -Node: Double5847 -Node: y-or-n6113 -Node: Customization6515 -Node: Image size6700 -Node: Typos | String Comparison6986 -Node: Gnosis Algorithm7761 -Node: Anagnosis Event8408 -Node: Proto9149 -Node: Editing notes9916 -Node: Sync between devices10308 -Node: Configuring Note Types11335 -Node: Custom Note Types11525 -Node: Development12735 +Node: Top252 +Node: Introduction1674 +Node: Adding notes2687 +Node: Note Types3098 +Node: Cloze3316 +Node: MC-Cloze (Under development)4478 +Node: MCQ5466 +Node: Basic Type5904 +Node: Double6180 +Node: y-or-n6446 +Node: Customization6848 +Node: Image size7033 +Node: Typos | String Comparison7319 +Node: Gnosis Algorithm8094 +Node: Anagnosis Event8741 +Node: Proto9482 +Node: Editing notes10249 +Node: Configuring Note Types10643 +Node: Custom Note Types10855 +Node: Development12065 +Node: Sync between devices12484 +Node: Interactions with other software13569 +Node: emacs-no-littering13774  End Tag Table diff --git a/doc/gnosis.org b/doc/gnosis.org index 8054009..c912ca6 100644 --- a/doc/gnosis.org +++ b/doc/gnosis.org @@ -4,8 +4,8 @@ #+language: en #+options: ':t toc:nil author:t email:t num:t #+startup: content -#+macro: stable-version 0.4.2 -#+macro: release-date 2024-09-5 +#+macro: stable-version 0.4.4 +#+macro: release-date 2024-10-06 #+macro: file @@texinfo:@file{@@$1@@texinfo:}@@ #+macro: space @@texinfo:@: @@ #+macro: kbd @@texinfo:@kbd{@@$1@@texinfo:}@@ diff --git a/doc/gnosis.texi b/doc/gnosis.texi index e5cc81f..4816566 100644 --- a/doc/gnosis.texi +++ b/doc/gnosis.texi @@ -35,16 +35,22 @@ This manual is written for Gnosis version 0.4.2, released on 2024-09-5. @itemize @item -Official manual: +Manual: @itemize @item @uref{https://elpa.nongnu.org/nongnu/doc/gnosis.html} +@item +@uref{https://thanosapollo.org/projects/gnosis/} (Mirror) @end itemize @item Git repositories: @itemize @item @uref{https://git.thanosapollo.org/gnosis} +@item +@uref{https://codeberg.org/thanosapollo/emacs-gnosis} (Mirror) +@item +@uref{https://git.savannah.gnu.org/cgit/emacs/nongnu.git/?h=elpa/gnosis} (Mirror) @end itemize @end itemize @@ -59,8 +65,9 @@ Git repositories: * Customization:: * Gnosis Algorithm:: * Editing notes:: -* Sync between devices:: * Configuring Note Types:: +* Sync between devices:: +* Interactions with other software:: @detailmenu --- The Detailed Node Listing --- @@ -89,6 +96,10 @@ Configuring Note Types * Custom Note Types:: * Development:: +Interactions with other software + +* emacs-no-littering:: + @end detailmenu @end menu @@ -350,36 +361,6 @@ Open @samp{gnosis-dashboard} with @samp{M-x gnosis-dashboard}, find the note you @end itemize @end itemize -@node Sync between devices -@chapter Sync between devices - -Gnosis uses git to maintain data integrity and facilitate -synchronization across devices. - -You will need to configure your remote manually. - -Example: - -@example -cd ~/.emacs.d/gnosis # default location for gnosis -git init # After completing your first review session, a git repo should have been initialized automatically. -git remote add origin -git push --set-upstream origin master -@end example - - -You can interactively use @samp{gnosis-vc-push} & @samp{gnosis-vc-pull}. As the -name suggests, they rely on @samp{vc} to work properly. - -Depending on your setup, @samp{vc} might require an external package for -the ssh passphrase dialog, such as @code{x11-ssh-askpass}. - -To automatically push changes after a review session, add this to your configuration: -@lisp -(setf gnosis-vc-auto-push t) -(gnosis-vc-pull) ;; Run vc-pull for gnosis on startup -@end lisp - @node Configuring Note Types @chapter Configuring Note Types @@ -425,4 +406,53 @@ testing. To exit the testing environment, rerun @samp{M-x gnosis-test-start} and then enter @samp{n} (no) at the prompt ``Start development env?'' +@node Sync between devices +@chapter Sync between devices + +Gnosis uses git to maintain data integrity and facilitate +synchronization across devices. + +You will need to configure your remote manually. + +Example: + +@example +cd ~/.emacs.d/gnosis # default location for gnosis, no-littering is ~/.emacs.d/var/gnosis +git init # After completing your first review session, a git repo should have been initialized automatically. +git remote add origin +git push --set-upstream origin master +@end example + + +You can interactively use @samp{gnosis-vc-push} & @samp{gnosis-vc-pull}. As the +name suggests, they rely on @samp{vc} to work properly. + +Depending on your setup, @samp{vc} might require an external package for +the ssh passphrase dialog, such as @code{x11-ssh-askpass}. + +To automatically push changes after a review session, add this to your configuration: +@lisp +(setf gnosis-vc-auto-push t) +(gnosis-vc-pull) ;; Run vc-pull for gnosis on startup +@end lisp + +@node Interactions with other software +@chapter Interactions with other software + +@menu +* emacs-no-littering:: +@end menu + +@node emacs-no-littering +@section emacs-no-littering + +If you are a user of @uref{https://github.com/emacscollective/no-littering, emacs-no-littering}, you can theme Gnosis to fit +its standards by adding the following snippet to your configuration: + +@lisp +(setq gnosis-dir (no-littering-expand-var-file-name "gnosis/")) +@end lisp + +This sets @samp{gnosis-dir} to @samp{~/.emacs.d/var/gnosis}, in line with the folders of other packages. + @bye diff --git a/gnosis.el b/gnosis.el index c85c9cc..c2dbb5b 100644 --- a/gnosis.el +++ b/gnosis.el @@ -5,7 +5,7 @@ ;; Author: Thanos Apollo ;; Keywords: extensions ;; URL: https://thanosapollo.org/projects/gnosis -;; Version: 0.4.4-dev +;; Version: 0.4.4 ;; Package-Requires: ((emacs "27.2") (emacsql "4.0.1") (compat "29.1.4.2") (transient "0.7.2")) @@ -2571,10 +2571,11 @@ If STRING-SECTION is nil, apply FACE to the entire STRING." :group 'gnosis :lighter nil (setq gnosis-due-notes-total (length (gnosis-review-get-due-notes))) - (if gnosis-modeline-mode + (if (and gnosis-modeline-mode gnosis-due-notes-total) (progn - (add-to-list 'global-mode-string '(:eval - (format " G:%d" gnosis-due-notes-total))) + (add-to-list 'global-mode-string + '(:eval + (format " G:%d" gnosis-due-notes-total) 'face 'warning)) (force-mode-line-update)) (setq global-mode-string (seq-remove (lambda (item) -- cgit v1.2.3