[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] scratch/rfc-mode 918d38f901 24/52: compute the index path dynam
From: |
Stefan Monnier |
Subject: |
[nongnu] scratch/rfc-mode 918d38f901 24/52: compute the index path dynamically |
Date: |
Wed, 12 Oct 2022 16:29:19 -0400 (EDT) |
branch: scratch/rfc-mode
commit 918d38f90169d5cb5ef8382185bcc895a7a3871d
Author: Nicolas Martyanoff <khaelin@gmail.com>
Commit: Nicolas Martyanoff <khaelin@gmail.com>
compute the index path dynamically
This way it will work as expected if rfc-mode-index-path is modified after
the
mode is loaded.
close #4
---
rfc-mode.el | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/rfc-mode.el b/rfc-mode.el
index f0cfbddc3f..515dda64c7 100644
--- a/rfc-mode.el
+++ b/rfc-mode.el
@@ -83,9 +83,6 @@ Assume RFC documents are named as e.g. rfc21.txt,
rfc-index.txt."
;;; Misc variables:
-(defvar rfc-mode-index-path (concat rfc-mode-directory "rfc-index.txt")
- "The path of the file containing the index of all RFC documents.")
-
(defvar rfc-mode-index-entries nil
"The list of entries in the RFC index.")
@@ -136,15 +133,15 @@ Assume RFC documents are named as e.g. rfc21.txt,
rfc-index.txt."
"Reload the RFC document index from its original file."
(interactive)
(setq rfc-mode-index-entries
- (rfc-mode-read-index-file rfc-mode-index-path)))
+ (rfc-mode-read-index-file (rfc-mode-index-path))))
(defun rfc-mode-browse ()
"Browse through all RFC documents referenced in the index using Helm."
(interactive)
- (rfc-mode--fetch-document "-index" rfc-mode-index-path)
+ (rfc-mode--fetch-document "-index" (rfc-mode-index-path))
(unless rfc-mode-index-entries
(setq rfc-mode-index-entries
- (rfc-mode-read-index-file rfc-mode-index-path)))
+ (rfc-mode-read-index-file (rfc-mode-index-path))))
(helm :buffer "*helm rfc browser*"
:sources (rfc-mode-browser-helm-sources rfc-mode-index-entries)))
@@ -267,6 +264,11 @@ ENTRY is a RFC index entry in the browser."
(rfc-mode-read number)))
;;; Index utils:
+
+(defun rfc-mode-index-path ()
+ "Return he path of the file containing the index of all RFC documents."
+ (concat rfc-mode-directory "rfc-index.txt"))
+
(defun rfc-mode-read-index-file (path)
"Read an RFC index file at PATH and return a list of entries."
(with-temp-buffer
- [nongnu] scratch/rfc-mode e7d9e2f4cb 12/52: add melpa badges to readme, (continued)
- [nongnu] scratch/rfc-mode e7d9e2f4cb 12/52: add melpa badges to readme, Stefan Monnier, 2022/10/12
- [nongnu] scratch/rfc-mode 55d28321b4 26/52: 1.2.0, Stefan Monnier, 2022/10/12
- [nongnu] scratch/rfc-mode e34df2b983 46/52: Free rfc-mode-browse of the dependency on Helm, Stefan Monnier, 2022/10/12
- [nongnu] scratch/rfc-mode 408bd186c8 49/52: Use closures instead of quoted lambda lists, Stefan Monnier, 2022/10/12
- [nongnu] scratch/rfc-mode a734721104 52/52: rfc-mode: Simplify the code by fetching&reading more lazily, Stefan Monnier, 2022/10/12
- [nongnu] scratch/rfc-mode 8fbf469c9b 19/52: improve function name and docstring, Stefan Monnier, 2022/10/12
- [nongnu] scratch/rfc-mode d4ca95b973 37/52: Add changelog entries for the next version, Stefan Monnier, 2022/10/12
- [nongnu] scratch/rfc-mode ec4269cc91 38/52: fix backtab key name, Stefan Monnier, 2022/10/12
- [nongnu] scratch/rfc-mode 02546beecf 39/52: v1.3.0, Stefan Monnier, 2022/10/12
- [nongnu] scratch/rfc-mode bec092989b 30/52: Add imenu support for rfc-mode, Stefan Monnier, 2022/10/12
- [nongnu] scratch/rfc-mode 918d38f901 24/52: compute the index path dynamically,
Stefan Monnier <=
- [nongnu] scratch/rfc-mode 4454af644e 13/52: update version tag, Stefan Monnier, 2022/10/12
- [nongnu] scratch/rfc-mode 088d81002e 04/52: make checkdoc happy, Stefan Monnier, 2022/10/12
- [nongnu] scratch/rfc-mode 88e6577a0e 27/52: update the readme regarding document download, Stefan Monnier, 2022/10/12
- [nongnu] scratch/rfc-mode 234890d3a8 23/52: Use expand-file-name instead of concat, Stefan Monnier, 2022/10/12
- [nongnu] scratch/rfc-mode 8aff885877 07/52: fix formatting escape sequence, Stefan Monnier, 2022/10/12
- [nongnu] scratch/rfc-mode 9ec648cdf7 14/52: cosmetic, Stefan Monnier, 2022/10/12
- [nongnu] scratch/rfc-mode 622ce988a8 06/52: add missing requires, Stefan Monnier, 2022/10/12
- [nongnu] scratch/rfc-mode 5cdf7172e3 11/52: Merge pull request #1 from riscy/master, Stefan Monnier, 2022/10/12
- [nongnu] scratch/rfc-mode e1a255fb59 32/52: Explain the meaning of rfc-mode-use-original-buffer-names better, Stefan Monnier, 2022/10/12
- [nongnu] scratch/rfc-mode 5a8a3a238e 29/52: Make the rfc-mode-map inherit from special-mode-map, Stefan Monnier, 2022/10/12