[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/annotate 4e23850efa 233/372: - Added file argument 'databa
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/annotate 4e23850efa 233/372: - Added file argument 'database-file-path' to 'annotate-switch-db'; |
Date: |
Fri, 4 Feb 2022 16:59:03 -0500 (EST) |
branch: elpa/annotate
commit 4e23850efae15b6725cd4ecd61b18d3b2f07b663
Author: cage <cage-invalid@invalid>
Commit: cage <cage-invalid@invalid>
- Added file argument 'database-file-path' to 'annotate-switch-db';
this could help people calling this function in a non interactive
way from their code;
- fixed some typos in documentation and comments.
---
Changelog | 7 +++++++
NEWS.org | 3 +++
annotate.el | 33 +++++++++++++++++++--------------
3 files changed, 29 insertions(+), 14 deletions(-)
diff --git a/Changelog b/Changelog
index 1fb758125c..101524003c 100644
--- a/Changelog
+++ b/Changelog
@@ -1,3 +1,10 @@
+2020-06-26
+ * annotate.el (annotate-switch-db)
+ - Added file argument 'database-file-path',
+ this could help people calling this function in a non interactive
+ way from their code;
+ - fixed some typos in documentation and comments.
+
2020-06-09 Bastian Bechtold, cage
* annotate.el (annotate-buffers-annotate-mode, annotate-switch-db)
- added functions to switch the database of annotations used for the
emacs session;
diff --git a/NEWS.org b/NEWS.org
index cbbce9065c..5d65662c4e 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -117,3 +117,6 @@
- 2020-06-09 V0.8.0 Bastian Bechtold, cage ::
The database of annotation can be changed using the command
~annotate-switch-db~.
+
+- 2020-06-26 V0.8.1 Bastian Bechtold, cage ::
+ Added file argument to ~annotate-switch-db~.
diff --git a/annotate.el b/annotate.el
index 84789fcc5d..a176abcf9e 100644
--- a/annotate.el
+++ b/annotate.el
@@ -7,7 +7,7 @@
;; Maintainer: Bastian Bechtold
;; URL: https://github.com/bastibe/annotate.el
;; Created: 2015-06-10
-;; Version: 0.8.0
+;; Version: 0.8.1
;; This file is NOT part of GNU Emacs.
@@ -55,7 +55,7 @@
;;;###autoload
(defgroup annotate nil
"Annotate files without changing them."
- :version "0.8.0"
+ :version "0.8.1"
:group 'text)
;;;###autoload
@@ -392,7 +392,7 @@ modified (for example a newline is inserted)."
(overlays-in (region-beginning)
(region-end)))))
(if annotations
- (message "Error: the region overlaps with at least an already
existings annotation")
+ (message "Error: the region overlaps with at least an already
existing annotation")
(create-new-annotation))))
(annotation
(annotate-change-annotation (point))
@@ -831,7 +831,7 @@ to 'maximum-width'."
(< (overlay-end x) (overlay-end y)))))
;; configure each annotation's properties and place it on the
;; the window. The actual position of the annotation (newline
- ;; or right marigin) is indicated by the value of the
+ ;; or right margin) is indicated by the value of the
;; variable: `annotate-annotation-position-policy'.
(dolist (ov overlays)
(let* ((face (cond
@@ -1206,7 +1206,7 @@ i.e. the first record is removed."
records-db))
(defun annotate-db-purge ()
- "Update datbase *on disk* removing all the records with empty
+ "Update database *on disk* removing all the records with empty
annotation."
(interactive)
(let ((db (annotate-db-clean-records (annotate-load-annotation-data))))
@@ -1249,7 +1249,7 @@ annotation."
record-filename
annotation-beginning
annotation-ending)
- "Remove from database `db-records' the annotation indentified by
+ "Remove from database `db-records' the annotation identified by
the triplets `record-filename', `annotation-beginning' and
`annotation-ending'; if such annotation does exists."
(with-matching-annotation-fns
@@ -1275,7 +1275,7 @@ annotation."
annotation-ending
replacing-text)
"Replace the text of annotation from database `db-records'
- indentified by the triplets `record-filename',
+ identified by the triplets `record-filename',
`annotation-beginning' and `annotation-ending'; if such
annotation does exists."
(with-matching-annotation-fns
@@ -1334,17 +1334,17 @@ annotation."
(defun annotate-annotation-prop-get (annotation property)
"Get property `property' from annotation `annotation'. If
-`annotation' does not pass `annotatonp' returns nil"
+`annotation' does not pass `annotationp' returns nil"
(annotate-ensure-annotation (annotation)
(overlay-get annotation property)))
(defun annotate-annotation-get-chain-position (annotation)
- "Get property's value that define position of this annootation
+ "Get property's value that define position of this annotation
in a chain of annotations"
(annotate-annotation-prop-get annotation annotate-prop-chain-position))
(defun annotate-annotation-chain-position (annotation pos)
- "Set property's value that define position of this annootation
+ "Set property's value that define position of this annotation
in a chain of annotations"
(overlay-put annotation annotate-prop-chain-position pos))
@@ -2165,7 +2165,7 @@ RE := [^[:space:]] ; as regular expression
ESCAPED-RE := DELIMITER
ANYTHING
DELIMITER
-ANYTHING := .* ; as a regualar expression
+ANYTHING := .* ; as a regular expression
AND := 'and'
OR := 'or'
NOT := 'not'
@@ -2289,7 +2289,7 @@ Arguments:
;; then we apply the filter function (see the docstring)
(let* ((escaped (annotate-summary-query-lexer-string
(annotate-summary-lexer)))
(unescaped (substring escaped 1 (1- (length escaped)))) ;
remove delimiters
- (matchp (funcall filter-fn unescaped annotation))) ;
apply the filter funcrion
+ (matchp (funcall filter-fn unescaped annotation))) ;
apply the filter function
;; and finally continue the parsing saving the results
;; of applying the filter-fn function
(operator escaped filter-fn annotation matchp)))
@@ -2501,11 +2501,15 @@ annotate minor mode active"
annotate-mode))))
(cl-remove-if-not #'annotate-mode-p all-buffers))))
-(cl-defun annotate-switch-db (&optional (force-load nil))
+(cl-defun annotate-switch-db (&optional (force-load nil) (database-file-path
nil))
"Ask the user for a new annotation database files, load it and
refresh all the annotations contained in each buffer where
annotate minor mode is active.
+if `database-file-path' is nil (the default) a prompt asking for
+a file containing database is presented to the user, otherwise
+the value of this argument is used.
+
If `force-load' is non nil no prompt asking user for confirmation
about loading the new file is shown.
@@ -2513,7 +2517,8 @@ Note: this function will attempt to load (compile and
eval/execute) the content of the file as it was elisp source
code, always use load files from trusted sources!"
(interactive)
- (let ((new-db (read-file-name "Database file location: ")))
+ (let ((new-db (or database-file-path
+ (read-file-name "Database file location: "))))
(when (not (annotate-string-empty-p new-db))
(if (file-exists-p new-db)
(let* ((confirm-message "Loading elisp file from untrusted source
may results in severe security problems. Load %S? [y/N] ")
- [nongnu] elpa/annotate 818f66f4a3 203/372: Merge pull request #58 from cage2/master, (continued)
- [nongnu] elpa/annotate 818f66f4a3 203/372: Merge pull request #58 from cage2/master, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate de116813be 211/372: Merge branch 'master' into rethink-multiline-annotations, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 30f639c524 212/372: - fixed return value of 'maybe-force-newline-policy'., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate ece50f65fe 220/372: - fixed managing return value of "(get-text-property changed-face-pos 'face)", ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate b25fb1ccab 224/372: - Increased version to 0.7.0., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate a6097f6326 237/372: - updated NEWS, Changelog and version., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate abe23338cb 235/372: - ensured that the modified status of as buffer is not modified by the local, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 8481eaf0c2 245/372: - signalled an error when annotating a region and it overlaps with an existing annotation., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate dadc57bb3e 231/372: - reverted the version number to 0.8.0;, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate a02755056e 244/372: - changed occurrence of 'annotate-load-annotation-data' to 'annotate-load-annotation-data-ignore-errors'., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 4e23850efa 233/372: - Added file argument 'database-file-path' to 'annotate-switch-db';,
ELPA Syncer <=
- [nongnu] elpa/annotate 2687e123cd 243/372: - added signalling 'annotate-load-annotation-data' to:, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 13c4fcbc4f 250/372: - made 'annotate-load-annotation-data-ignore-errors' ignore all errors;, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 4cc32fc2fb 256/372: Merge pull request #78 from cage2/master, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 6543d3b1c0 259/372: - fixed indentation., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 8ec9e0ea37 253/372: - increased version., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate c42686bab5 271/372: - allow overwriting (even partial) of annotations., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 9b824d23ec 267/372: - updated Changelog and NEWS.org., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate e015655f62 255/372: - fixed version number contained in code top comment., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 2bf7a7c1ac 254/372: Merge pull request #77 from cage2/signalling-errors, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate bd31608f50 260/372: - added command 'annotate-summary-of-file-from-current-pos', ELPA Syncer, 2022/02/04