[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] scratch/rfc-mode 3a7afa19e7 08/52: make some functions private
From: |
Stefan Monnier |
Subject: |
[nongnu] scratch/rfc-mode 3a7afa19e7 08/52: make some functions private |
Date: |
Wed, 12 Oct 2022 16:29:18 -0400 (EDT) |
branch: scratch/rfc-mode
commit 3a7afa19e7f5718bca90176096254c94619d2c58
Author: Nicolas Martyanoff <khaelin@gmail.com>
Commit: Nicolas Martyanoff <khaelin@gmail.com>
make some functions private
---
rfc-mode.el | 40 ++++++++++++++++++++--------------------
1 file changed, 20 insertions(+), 20 deletions(-)
diff --git a/rfc-mode.el b/rfc-mode.el
index 35acf78f13..a89f11538a 100644
--- a/rfc-mode.el
+++ b/rfc-mode.el
@@ -116,7 +116,7 @@
(defun rfc-mode-read (number)
"Read the RFC document NUMBER."
(interactive "nRFC number: ")
- (switch-to-buffer (rfc-mode-document-buffer number)))
+ (switch-to-buffer (rfc-mode--document-buffer number)))
(defun rfc-mode-reload-index ()
"Reload the RFC document index from its original file."
@@ -227,22 +227,22 @@ ENTRIES is a list of RFC index entries in the browser."
"Create a Helm candidate for ENTRY.
ENTRY is a RFC index entry in the browser."
- (let* ((ref (rfc-mode-pad-string
+ (let* ((ref (rfc-mode--pad-string
(format "RFC%d" (plist-get entry :number)) 7))
- (title (rfc-mode-pad-string
+ (title (rfc-mode--pad-string
(plist-get entry :title)
rfc-mode-browser-entry-title-width))
(status (or (plist-get entry :status) ""))
(obsoleted-by (plist-get entry :obsoleted-by))
(obsoletep (> (length obsoleted-by) 0))
(string (format "%s %s %s"
- (rfc-mode-highlight-string
+ (rfc-mode--highlight-string
ref 'rfc-mode-browser-ref-face)
- (rfc-mode-highlight-string
+ (rfc-mode--highlight-string
title (if obsoletep
'rfc-mode-browser-title-obsolete-face
'rfc-mode-browser-title-face))
- (rfc-mode-highlight-string
+ (rfc-mode--highlight-string
status 'rfc-mode-browser-status-face))))
(cons string entry)))
@@ -288,33 +288,33 @@ ENTRY is a RFC index entry in the browser."
(plist-put entry :status (downcase (match-string 1 string))))
(when (string-match "(Obsoletes \\([^)]+\\))" string)
(plist-put entry :obsoletes
- (rfc-mode-parse-rfc-refs (match-string 1 string))))
+ (rfc-mode--parse-rfc-refs (match-string 1 string))))
(when (string-match "(Obsoleted by \\([^)]+\\))" string)
(plist-put entry :obsoleted-by
- (rfc-mode-parse-rfc-refs (match-string 1 string))))
+ (rfc-mode--parse-rfc-refs (match-string 1 string))))
(when (string-match "(Updates \\([^)]+\\))" string)
(plist-put entry :updates
- (rfc-mode-parse-rfc-refs (match-string 1 string))))
+ (rfc-mode--parse-rfc-refs (match-string 1 string))))
(when (string-match "(Updated by \\([^)]+\\))" string)
(plist-put entry :updated-by
- (rfc-mode-parse-rfc-refs (match-string 1 string))))
+ (rfc-mode--parse-rfc-refs (match-string 1 string))))
entry)))
;;; Document utils
-(defun rfc-mode-document-buffer-name (number)
+(defun rfc-mode--document-buffer-name (number)
"Return the buffer name for the RFC document NUMBER."
(concat "*rfc" (number-to-string number) "*"))
-(defun rfc-mode-document-path (number)
+(defun rfc-mode--document-path (number)
"Return the absolute path of the RFC document NUMBER."
(concat rfc-mode-directory "rfc" (number-to-string number) ".txt"))
-(defun rfc-mode-document-buffer (number)
+(defun rfc-mode--document-buffer (number)
"Return a buffer visiting the RFC document NUMBER.
The buffer is created if it does not exist."
- (let* ((buffer-name (rfc-mode-document-buffer-name number))
- (document-path (rfc-mode-document-path number)))
+ (let* ((buffer-name (rfc-mode--document-buffer-name number))
+ (document-path (rfc-mode--document-path number)))
(find-file document-path)
(rename-buffer buffer-name)
(rfc-mode)
@@ -322,25 +322,25 @@ The buffer is created if it does not exist."
;;; Misc utils
-(defun rfc-mode-parse-rfc-ref (string)
+(defun rfc-mode--parse-rfc-ref (string)
"Parse a reference to a RFC document from STRING.
For example: \"RFC 2822\"."
(when (string-match "^RFC *\\([0-9]+\\)" string)
(string-to-number (match-string 1 string))))
-(defun rfc-mode-parse-rfc-refs (string)
+(defun rfc-mode--parse-rfc-refs (string)
"Parse a list of references to RFC documents from STRING.
For example: \"RFC3401, RFC3402 ,RFC 3403\"."
- (seq-remove #'null (mapcar #'rfc-mode-parse-rfc-ref
+ (seq-remove #'null (mapcar #'rfc-mode--parse-rfc-ref
(split-string string "," t " +"))))
-(defun rfc-mode-pad-string (string width)
+(defun rfc-mode--pad-string (string width)
"Pad STRING with spaces to WIDTH characters."
(truncate-string-to-width string width 0 ?\s))
-(defun rfc-mode-highlight-string (string face)
+(defun rfc-mode--highlight-string (string face)
"Highlight STRING using FACE."
(put-text-property 0 (length string) 'face face string)
string)
- [nongnu] scratch/rfc-mode 622ce988a8 06/52: add missing requires, (continued)
- [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
- [nongnu] scratch/rfc-mode f766c141ac 22/52: introduce a custom variable to use original buffer names, Stefan Monnier, 2022/10/12
- [nongnu] scratch/rfc-mode 476bff817d 42/52: Don't turn the beginning of every page into a button, Stefan Monnier, 2022/10/12
- [nongnu] scratch/rfc-mode 6e41dcd82f 43/52: Autoload rfc-mode-browse, Stefan Monnier, 2022/10/12
- [nongnu] scratch/rfc-mode e21fb7e134 05/52: fix comment, Stefan Monnier, 2022/10/12
- [nongnu] scratch/rfc-mode c550aa0530 03/52: v1.0.0, Stefan Monnier, 2022/10/12
- [nongnu] scratch/rfc-mode ff7a36b810 44/52: Offer number at point as default in rfc-mode-read, Stefan Monnier, 2022/10/12
- [nongnu] scratch/rfc-mode 3a7afa19e7 08/52: make some functions private,
Stefan Monnier <=
- [nongnu] scratch/rfc-mode ea349f3441 41/52: Improve doc-strings, Stefan Monnier, 2022/10/12
- [nongnu] scratch/rfc-mode 0f95e3f79b 21/52: fix mode detection regexp, Stefan Monnier, 2022/10/12
- [nongnu] scratch/rfc-mode 8587416c21 40/52: Add prefix argument support to rfc-mode-read, Stefan Monnier, 2022/10/12
- [nongnu] scratch/rfc-mode 3ef663203b 51/52: Consistently use spaces for indentation, Stefan Monnier, 2022/10/12
- [nongnu] scratch/rfc-mode b885d6bd2b 50/52: Fix completing-read default argument, Stefan Monnier, 2022/10/12
- [nongnu] scratch/rfc-mode 21c966a02c 47/52: update changelog, Stefan Monnier, 2022/10/12
- [nongnu] scratch/rfc-mode 697158dc0f 45/52: Extract rfc-mode--integer-at-point from rfc-mode-read, Stefan Monnier, 2022/10/12
- [nongnu] scratch/rfc-mode 5d0c8096b2 48/52: * rfc-mode.el: Explicitly load cl-lib dependency., Stefan Monnier, 2022/10/12