Add note about Emacs integration in README #172
No reviewers
Labels
No Label
blocked: dependency
blocked: info-needed
bug
duplicate
enhancement
fixed in HEAD
help wanted
hs:arrows
hs:brackets
hs:classes
hs:comments
hs:do-notation
hs:guards
hs:lists
hs:operators
hs:patterns
hs:records
hs:types
invalid
language extension support
layouting
needs confirmation
priority: high
priority: low
question
revisit before next release
wontfix
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: hexagoxel/brittany#172
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "emacs-editor-support"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
Thanks for the great tool! I've been using it for a while and I think it does an excellent job. Using it from Emacs is straightforward. I made a change to README file to reflect my setting.
A note: when I hit "save" the editor also removed some trailing white spaces. Please let me know if it is a problem and I'll redo the change to exclude those.
Why not use stuff like
shell-command-on-region
? i.e. send the Emacs buffer through stdin instead of the file through CLI, so that you don't have to save before formatting, and so you can format only a region.shell-command-on-region
is totally fine when you want to format a region. And I used to have that function as well.However, I found that in most cases I just want the whole file to be always formatted. I type in a few lines, hit the keys to verify the result and continue writing. I also have that function hooked on buffer save. And since formatting is idempotent there's no harm to run that multiple times, I think.
@disya2 Right but there must surely be something like
shell-command-on-region
that applies to the whole file? It just seems wrong to work on the file level when the user is working on the buffer level.Note that haskell-mode provides
haskell-mode-stylish-buffer
andhaskell-mode-buffer-apply-command
which don't require a save. I haveI don't use emacs, so I have no comment on how good of an approach this is. Still, I'd prefer to not drop the proposed code entirely if it works, and nobody has bothered to write something better yet, even if it has flaws.
I propose to put the code snippet in a separate file in the docs folder, together with a note of potential downsides, and add a link to this from the readme, under the emacs header.
@disya2 thanks for proposing this. Even though you closed this, would you be fine with the above?
Pull request closed