[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/reformatter 48bcae5856 06/81: Doc fixes
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/reformatter 48bcae5856 06/81: Doc fixes |
Date: |
Tue, 5 Sep 2023 04:03:32 -0400 (EDT) |
branch: elpa/reformatter
commit 48bcae58567cac257df92f44e9e1e5975a3eff5a
Author: Steve Purcell <steve@sanityinc.com>
Commit: Steve Purcell <steve@sanityinc.com>
Doc fixes
See #1
---
README.md | 20 +++++++++++++-------
reformatter.el | 17 +++++++++++------
2 files changed, 24 insertions(+), 13 deletions(-)
diff --git a/README.md b/README.md
index ac5782a282..5bc7817490 100644
--- a/README.md
+++ b/README.md
@@ -13,14 +13,12 @@ In its initial release it supports only reformatters which
can read
from stdin and write to stdout, but a more versatile interface will
be provided as development continues.
-As an example, let's define a reformat command that applies the
-"dhall format" command. We'll assume that we've already defined a
+As an example, let's define a reformat command that applies the "dhall
+format" command. We'll assume here that we've already defined a
variable `dhall-command` which holds the string name or path of the
dhall executable:
```el
-;;;###autoload (autoload 'dhall-format "current-file" nil t)
-;;;###autoload (autoload 'dhall-format-on-save-mode "current-file" nil t)
(reformatter-define dhall-format
:program dhall-command
:args '("format")
@@ -29,8 +27,7 @@ dhall executable:
The `reformatter-define` macro expands to code which generates both
the `dhall-format` interactive command and a local minor mode called
-`dhall-format-on-save-mode`. The example above includes autoloads
-which will be useful to library authors.
+`dhall-format-on-save-mode`.
The generated minor mode allows idiomatic per-directory or per-file
customisation, via the "modes" support baked into Emacs' file-local
@@ -40,12 +37,21 @@ above example might add the following to a project-specific
```el
((dhall-mode
- (mode . dhall-format-on-save-mode)))
+ (mode . dhall-format-on-save)))
```
See the documentation for `reformatter-define`, which provides a
number of options for customising the generated code.
+Library authors might like to provide autoloads for the generated
+code, e.g.:
+
+```el
+;;;###autoload (autoload 'dhall-format "current-file" nil t)
+;;;###autoload (autoload 'dhall-format-on-save-mode "current-file" nil t)
+```
+
+
## Rationale
I contribute to a number of Emacs programming language modes and
diff --git a/reformatter.el b/reformatter.el
index 61aa974285..d0fe2df679 100644
--- a/reformatter.el
+++ b/reformatter.el
@@ -33,20 +33,17 @@
;; be provided as development continues.
;; As an example, let's define a reformat command that applies the
-;; "dhall format" command. We'll assume that we've already defined a
+;; "dhall format" command. We'll assume here that we've already defined a
;; variable `dhall-command' which holds the string name or path of the
;; dhall executable:
-;; ;;;###autoload (autoload 'dhall-format "current-file" nil t)
-;; ;;;###autoload (autoload 'dhall-format-on-save-mode "current-file" nil
t)
;; (reformatter-define dhall-format
;; :program dhall-command
;; :args '("format"))
;; The `reformatter-define' macro expands to code which generates both
;; the `dhall-format' interactive command and a local minor mode
-;; called `dhall-format-on-save-mode'. The example above includes
-;; autoloads which will be useful to library authors.
+;; called `dhall-format-on-save-mode'
;; The generated minor mode allows idiomatic per-directory or per-file
;; customisation, via the "modes" support baked into Emacs' file-local
@@ -55,11 +52,17 @@
;; .dir-locals.el file:
;; ((dhall-mode
-;; (mode . dhall-format-on-save-mode)))
+;; (mode . dhall-format-on-save)))
;; See the documentation for `reformatter-define', which provides a
;; number of options for customising the generated code.
+;; Library authors might like to provide autoloads for the generated
+;; code, e.g.:
+
+;; ;;;###autoload (autoload 'dhall-format "current-file" nil t)
+;; ;;;###autoload (autoload 'dhall-format-on-save-mode "current-file" nil
t)
+
;;; Code:
(eval-when-compile
(require 'cl-lib))
@@ -151,6 +154,8 @@ DISPLAY-ERRORS, shows a buffer if the formatting fails."
(if (eq retcode 0)
(progn
(insert-file-contents out-file nil nil nil t)
+ ;; In future this might be made optional, or a
user-provided
+ ;; ":after" form could be inserted for execution
(whitespace-cleanup))
(if display-errors
(display-buffer error-buffer)
- [nongnu] elpa/reformatter 028dae00dd 30/81: Merge pull request #4 from peterwvj/patch-1, (continued)
- [nongnu] elpa/reformatter 028dae00dd 30/81: Merge pull request #4 from peterwvj/patch-1, ELPA Syncer, 2023/09/05
- [nongnu] elpa/reformatter 7e41f1a397 33/81: Use replace-buffer-contents when available and not broken, ELPA Syncer, 2023/09/05
- [nongnu] elpa/reformatter 2ff029f84b 64/81: Display error message in error buffer if call-process signals, ELPA Syncer, 2023/09/05
- [nongnu] elpa/reformatter 7c5452bf31 69/81: Update tests to used suffixed commands only, ELPA Syncer, 2023/09/05
- [nongnu] elpa/reformatter 130205bbe2 68/81: Remove the catch-all alias: users should make their own defalias as needed, ELPA Syncer, 2023/09/05
- [nongnu] elpa/reformatter e6c23cd52d 58/81: Update CI config to specify nix-path, ELPA Syncer, 2023/09/05
- [nongnu] elpa/reformatter 113ddd51bd 74/81: Add dependabot config, ELPA Syncer, 2023/09/05
- [nongnu] elpa/reformatter 1cbf7225b0 76/81: Merge pull request #40 from purcell/dependabot/github_actions/cachix/install-nix-action-22, ELPA Syncer, 2023/09/05
- [nongnu] elpa/reformatter 1af1371f71 78/81: chore(deps): bump actions/checkout from 2 to 4, ELPA Syncer, 2023/09/05
- [nongnu] elpa/reformatter 7cf8b5d71e 08/81: Note about absence of "gensym", ELPA Syncer, 2023/09/05
- [nongnu] elpa/reformatter 48bcae5856 06/81: Doc fixes,
ELPA Syncer <=
- [nongnu] elpa/reformatter 0aea1debd1 05/81: package-lint fixes, primarily renaming define-formatter, ELPA Syncer, 2023/09/05
- [nongnu] elpa/reformatter 664fa96fd0 24/81: Add/update comments, ELPA Syncer, 2023/09/05
- [nongnu] elpa/reformatter d0d58c4eef 01/81: Initial commit, ELPA Syncer, 2023/09/05
- [nongnu] elpa/reformatter 9c6c239371 04/81: Generate a separate custom variable for the mode lighter, ELPA Syncer, 2023/09/05
- [nongnu] elpa/reformatter 9478d6ca2d 19/81: Fix -on-save-mode docstring, ELPA Syncer, 2023/09/05
- [nongnu] elpa/reformatter 466740b40a 17/81: Link to example of using reformatter in a user config, ELPA Syncer, 2023/09/05
- [nongnu] elpa/reformatter c684c0b30f 10/81: Add links to usages in the wild, ELPA Syncer, 2023/09/05
- [nongnu] elpa/reformatter 2c85cd76e5 03/81: Always output :keymap and :lighter minor mode arguments, ELPA Syncer, 2023/09/05
- [nongnu] elpa/reformatter 6484d45a87 07/81: Only support string mode lighters, ELPA Syncer, 2023/09/05
- [nongnu] elpa/reformatter 123d192fb0 16/81: Use https for sanityinc.com link, ELPA Syncer, 2023/09/05