[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] scratch/rfc-mode 3ef663203b 51/52: Consistently use spaces for
From: |
Stefan Monnier |
Subject: |
[nongnu] scratch/rfc-mode 3ef663203b 51/52: Consistently use spaces for indentation |
Date: |
Wed, 12 Oct 2022 16:29:21 -0400 (EDT) |
branch: scratch/rfc-mode
commit 3ef663203b157e7c5b2cd3c425ec8fbe7977a24c
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Nicolas Martyanoff <khaelin@gmail.com>
Consistently use spaces for indentation
Also set the file-local value for `indent-tabs-mode' so that going
forward different people will no longer use different indentation
styles.
---
rfc-mode.el | 55 +++++++++++++++++++++++++++++--------------------------
1 file changed, 29 insertions(+), 26 deletions(-)
diff --git a/rfc-mode.el b/rfc-mode.el
index 70c356b9a2..65baebea30 100644
--- a/rfc-mode.el
+++ b/rfc-mode.el
@@ -90,9 +90,9 @@ mode that displays candidates \"vertically\" like `helm' does.
`ivy-mode' is a popular choice. `fido-mode' in combination
with `icomplete-vertical-mode' should also work well."
:type '(choice (const read-number)
- (const completing-read)
- (const helm)
- function))
+ (const completing-read)
+ (const helm)
+ function))
(defcustom rfc-mode-use-original-buffer-names nil
"Whether RFC document buffers should have the name of the document file.
@@ -186,10 +186,10 @@ If nil (the default) then use e.g. *rfc21*, otherwise use
e.g. rfc21.txt."
"Move point to SECTION if it exists, otherwise don't move point.
Returns t if section is found, nil otherwise."
(let ((curpos (point))
- (case-fold-search nil))
+ (case-fold-search nil))
(goto-char (point-min))
(if (re-search-forward (concat "^" section) (point-max) t)
- (progn (beginning-of-line) t)
+ (progn (beginning-of-line) t)
(goto-char curpos)
nil)))
@@ -199,9 +199,9 @@ Returns t if section is found, nil otherwise."
(let ((case-fold-search nil)
(start (point)))
(if (looking-at rfc-mode-title-regexp)
- (forward-line 1))
+ (forward-line 1))
(if (re-search-forward rfc-mode-title-regexp (point-max) t n)
- (beginning-of-line)
+ (beginning-of-line)
(goto-char (point-max))
;; The last line doesn't belong to any section.
(forward-line -1))
@@ -213,9 +213,9 @@ Returns t if section is found, nil otherwise."
(interactive "p")
(let ((case-fold-search nil))
(if (looking-at rfc-mode-title-regexp)
- (forward-line -1))
+ (forward-line -1))
(if (re-search-backward rfc-mode-title-regexp (point-min) t n)
- (beginning-of-line)
+ (beginning-of-line)
(goto-char (point-min)))))
;;;###autoload
@@ -244,14 +244,14 @@ Offer the number at point as default."
(pcase rfc-mode-browse-input-function
('read-number
(display-buffer (rfc-mode--document-buffer
- (read-number "View RFC document: "
- (rfc-mode--integer-at-point)))))
+ (read-number "View RFC document: "
+ (rfc-mode--integer-at-point)))))
('helm
(if (and (require 'helm nil t)
- (fboundp 'helm))
- (helm :buffer "*helm rfc browser*"
- :sources (rfc-mode-browser-helm-sources
- rfc-mode-index-entries))
+ (fboundp 'helm))
+ (helm :buffer "*helm rfc browser*"
+ :sources (rfc-mode-browser-helm-sources
+ rfc-mode-index-entries))
(user-error "Helm has to be installed explicitly")))
('completing-read
(let* ((default (rfc-mode--integer-at-point))
@@ -265,16 +265,16 @@ Offer the number at point as default."
rfc-mode-index-entries))
(choice (completing-read "View RFC document: "
cands nil nil nil nil default))
- (number (or (and (string-match "\\`RFC\\([0-9]+\\)" choice)
- (string-to-number (match-string 1 choice)))
- (ignore-errors (string-to-number choice)))))
+ (number (or (and (string-match "\\`RFC\\([0-9]+\\)" choice)
+ (string-to-number (match-string 1 choice)))
+ (ignore-errors (string-to-number choice)))))
(unless number
- (user-error
+ (user-error
"%s doesn't match a completion candidate and is not a number"
- choice))
+ choice))
(display-buffer (rfc-mode--document-buffer number))))
(_ (display-buffer (rfc-mode--document-buffer
- (funcall rfc-mode-browse-input-function))))))
+ (funcall rfc-mode-browse-input-function))))))
;;;###autoload
(define-derived-mode rfc-mode special-mode "rfc-mode"
@@ -486,11 +486,11 @@ The buffer is created if it does not exist."
(save-excursion
(skip-chars-backward "0-9")
(and (looking-at "[0-9]")
- (string-to-number
- (buffer-substring-no-properties
- (point)
- (progn (skip-chars-forward "0-9")
- (point)))))))
+ (string-to-number
+ (buffer-substring-no-properties
+ (point)
+ (progn (skip-chars-forward "0-9")
+ (point)))))))
(defun rfc-mode--fetch-document (suffix document-path)
"Ensure an RFC document with SUFFIX exists at DOCUMENT-PATH.
@@ -531,4 +531,7 @@ For example: \"RFC3401, RFC3402 ,RFC 3403\"."
(provide 'rfc-mode)
+;; Local Variables:
+;; indent-tabs-mode: nil
+;; End:
;;; rfc-mode.el ends here
- [nongnu] scratch/rfc-mode f766c141ac 22/52: introduce a custom variable to use original buffer names, (continued)
- [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, 2022/10/12
- [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 <=
- [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