Comments (7)
Thinking about it a bit more, I think pulling save into the lowest-level-but-still-public-API rewrite function is probably not the right play - better to just empower composition.
So for point 2 above, I now recommend the return value approach - just allowing the caller to know after the call if the rewrite happened is more flexible than pulling the save into the rewrite.
from denote.
You are right. The coupling is not ideal.
In my fork of the code (not announced yet elsewhere), I have made the options denote-rename-confirmations
and denote-save-buffers
control how the renaming commands confirm and save buffers. All renaming commands will respect those variables. None will have any optional parameters anymore regarding that.
denote-rename-confirmations
will default to '(add-front-matter rewrite-front-matter modify-file-name)
and denote-save-buffers
to nil
.
In the release notes for version 2.3.0, Prot has expressed a wish to wait until late April for new features.
I plan on making the pull requests to include everything that can be included back from my fork into Denote.
But first, there will be 2 other pull requests that will come before this one: I will first add denote-forced-*
variables to help in customizing denote commands and then I will submit a refactor of all renaming commands to remove all code duplication and enhance their flexibility. It will be very easy for developers as well as users to define their own custom renaming commands.
It will be very easy to have separate renaming commands for all file name components (or multiple).
This is all done already in my fork. I will make it public this weekend, but I will do the pull requests in May!
from denote.
Yeah, the idea is to wait a bit for new features or more fundamental changes so that we can fix obvious bugs. Once we are sure that users are okay with what they have, we resume the work. A more fine-grained control over these confirmations is a good idea.
from denote.
Yep, I saw that in the release notes and totally respect that - I'm raising this now because this could be seen as a bug, and point 1 of my proposal as the fix.
Consider: if I hadn't read the changelog and checked the docstrings of functions I use, I wouldn't have realized that code which I wrote+tested+trusted to only save when deemed safe by my checks would now suddenly start saving files in other situations as well.
Personally, I don't mind - I already protected myself from this by proactively thoroughly checking the change log* and immediately adjusting my code. Cool, no data loss happened, no bad feelings.
But I think users would have been justified in expecting that the meaning/effect of a parameter named "no confirm" in a public API function wouldn't get promoted to "no confirm and save".
On the other hand, if you've got one or two users who prefer the new behavior, maybe that's more representative of a typical user. And the odds of serious data loss from this are probably low? So I'm not saying that you definitely should treat this as a bug, I'm just suggesting to think about it.
* Speaking of, thank you very much for that thorough change log! I know those are really hard to write even in basic form, and yours is both thorough and has an impressive degree of polish.
from denote.
I just merged the contribution of @jeanphilippegg which should fix this issue. Please check.
from denote.
@protesilaos thanks! I just read over most of that change, and it looks good to me.
from denote.
Thank you!
from denote.
Related Issues (20)
- Prevent newline between front matter and templates HOT 2
- question: why IDENTIFIER and not ID HOT 2
- New fontification is not limited to Denote files HOT 3
- Identifier showing up in keyword section when creating/renaming denote files HOT 2
- Ignored Files Regexp HOT 9
- Denote disappears after doom emacs is restarted HOT 2
- Dynamic block is not working HOT 3
- Nested dynamic blocks breaks the update functionality HOT 4
- denote-journal-extras-new-or-existing-entry creates new file every time HOT 9
- Merging 2 notes into 1 HOT 3
- denote-file-prompt shouldn't match archive files ? HOT 3
- denote-add-links doesn't use titles as descriptions inside silos HOT 9
- Denote seems to interfere with magit on Emacs 29.3 HOT 2
- Show entries in Calendar HOT 1
- Rename existing files after changes to denote-file-name-components-order? HOT 3
- markdown links in org files are opened in an external app HOT 4
- `denote-rename-buffer-mode` breaks Org capture detection HOT 6
- Support using functions in `denote-templates` HOT 4
- Title as first element causes shell problems due to leading `--` HOT 6
- Proposal: add frontmatter normalization functions HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from denote.