[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/annotate a1be01d886 134/372: - try to guess the actual fil
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/annotate a1be01d886 134/372: - try to guess the actual file name of an info document when showing |
Date: |
Fri, 4 Feb 2022 16:58:34 -0500 (EST) |
branch: elpa/annotate
commit a1be01d8862b94c247c7dbd898e98d723a5c2d03
Author: cage <cage-invalid@invalid>
Commit: cage <cage-invalid@invalid>
- try to guess the actual file name of an info document when showing
text sippet in summary window.
---
annotate.el | 40 +++++++++++++++++++++++++++++++---------
1 file changed, 31 insertions(+), 9 deletions(-)
diff --git a/annotate.el b/annotate.el
index fa8f1432ec..afe4ccaca7 100644
--- a/annotate.el
+++ b/annotate.el
@@ -148,6 +148,16 @@ major mode is a member of this list (space separated
entries)."
"The message to warn the user that file has been modified and
an annotations could not be restored")
+(defconst annotate-error-summary-win-filename-invalid
+ "Error: File not found or in an unsupported format"
+ "The message to warn the user that file can not be show in
+ summary window because does not exist or is in an unsupported
+ format.")
+
+(defconst annotate-valid-info-extensions
+ '(".info.gz" ".gz")
+ "The valid extension for files that contains info document")
+
(defcustom annotate-search-region-lines-delta 2
"When the annotated file is out of sync with its annotation
database the software looks for annotated text in the region with
@@ -1224,16 +1234,28 @@ The searched interval can be customized setting the
variable:
'action
'annotate-summary-button-pressed
'type
'annotate-summary-button)
(insert "\n\n"))
+ (guess-filename (filename)
+ (if (file-exists-p filename)
+ filename
+ (let ((found nil))
+ (dolist (extension
annotate-valid-info-extensions)
+ (let ((filename-maybe (concat filename
extension)))
+ (when (file-exists-p filename-maybe)
+ (setf found filename-maybe))))
+ found)))
(build-snippet (filename annotation-begin annotation-end)
- (with-temp-buffer
- (insert-file-contents filename
- nil
- (1- annotation-begin)
- (1- annotation-end))
- (save-match-data
- (replace-regexp-in-string "[\r\n]"
- " "
- (buffer-string)))))
+ (let ((guessed-filename (guess-filename
filename)))
+ (if guessed-filename
+ (with-temp-buffer
+ (insert-file-contents guessed-filename
+ nil
+ (1-
annotation-begin)
+ (1- annotation-end))
+ (save-match-data
+ (replace-regexp-in-string "[\r\n]"
+ " "
+
(buffer-string))))
+ annotate-error-summary-win-filename-invalid)))
(db-empty-p (dump)
(cl-every (lambda (a)
(cl-every 'null
- [nongnu] elpa/annotate cb8de5081a 078/372: Merge pull request #42 from cage2/master, (continued)
- [nongnu] elpa/annotate cb8de5081a 078/372: Merge pull request #42 from cage2/master, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 80e6b31c78 084/372: - fixed docstring., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 519aab08ba 100/372: - added a better handling of characters with width > 1., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate d07e406251 097/372: - changed prefix for annotation in summary window., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate cf76d79c00 074/372: - fixed docstring., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 3341c23e5f 038/372: don't annotate or save empty regions, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 242104e55a 108/372: - changed functions name, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 55e318b172 124/372: - fixed reference to a non-existent variable in the procedure that, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 08f520f09a 119/372: - try to elaborate more a function goal., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 354653496d 115/372: - added a bit of (very simple) heuristic to place annotation in the, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate a1be01d886 134/372: - try to guess the actual file name of an info document when showing,
ELPA Syncer <=
- [nongnu] elpa/annotate 16e0346481 128/372: - prevent showing of summary window if metadata contains no annotations at all., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 6ceeb44774 133/372: - removed check for buffer file name in funcion called just before a, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate db9e064342 132/372: - added features: annotate info documents., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 4bcecdc875 156/372: - replaced 'splitted-annotation' with 'multiline-annotation'., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 4fde80fe79 168/372: - updated software version number in the comment on top of the source code;, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 696f4ee0cd 167/372: Merge pull request #55 from cage2/update-doc, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate a59cc2c6b2 172/372: - when 'delete' button from a summary window is activated redraw and, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 412053cefc 173/372: - [bugfix] When a window is resized ensure that the sizes are, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 41e85c8435 176/372: - increased version number;, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate cc4292cce4 181/372: - moved the test for 'limit' up in the lambda of the filtering, ELPA Syncer, 2022/02/04