Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix to signature losing "="s when file is renamed. #207

Merged
merged 1 commit into from Jan 1, 2024

Conversation

wlharvey4
Copy link
Contributor

Four file renaming commands may lose spaces (denoted by the "=" in existing filenames) when the user renames the file:

  1. denote-rename-file
  2. denote-dired-rename-files
  3. denote-dired-rename-marked-files-with-keywords
  4. denote-rename-file-using-front-matter

This is caused by the function denote-sluggify-signature, which calls (indirectly) denote--slug-no-punct, which removes, among many other characters, all "="s, which represent spaces. These spaces are thus lost even if the user does not change the signature.

To remedy this situation, all "="s are turned into spaces before being sent to denote--slug-no-punct, as spaces are not removed by this function. The function denote--slug-put-equals turns these spaces into "="s at the end of the file-renaming operation.

Four file renaming commands may lose spaces (denoted by the "="
in existing filenames) when the user renames the file:

1. denote-rename-file
2. denote-dired-rename-files
3. denote-dired-rename-marked-files-with-keywords
4. denote-rename-file-using-front-matter

This is caused by the function `denote-sluggify-signature`, which
calls (indirectly) `denote--slug-no-punct`, which removes, among
many other characters, all "="s, which represent spaces.  These
spaces are thus lost even if the user does not change the
signature.

To remedy this situation, all "="s are turned into spaces before
being sent to `denote--slug-no-punct`, as spaces are not removed
by this function.  The function `denote--slug-put-equals` turns
these spaces into "="s at the end of the file-renaming operation.
@jeanphilippegg jeanphilippegg mentioned this pull request Dec 25, 2023
@protesilaos protesilaos merged commit 688d075 into protesilaos:main Jan 1, 2024
@protesilaos
Copy link
Owner

Merged. Thank you!

protesilaos added a commit that referenced this pull request Jan 1, 2024
The change is within the ~15 line limit and so Wesley Harvey does not
need to assign copyright to the Free Software Foundation.

That commit was done in pull request 207 on the GitHub mirror:
<#207>.
@protesilaos
Copy link
Owner

Oh, and a Happy New Year!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants