[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote c3feb9a0ec 250/355: Remove superfluous when
From: |
ELPA Syncer |
Subject: |
[elpa] externals/denote c3feb9a0ec 250/355: Remove superfluous when |
Date: |
Sun, 26 Jun 2022 23:58:29 -0400 (EDT) |
branch: externals/denote
commit c3feb9a0ec1f61e975877b6e4477a34e67987461
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Remove superfluous when
The diff is mostly indentation. The very first 'when' was just moved
inside the subsequent 'when-let*'
---
denote-dired.el | 56 ++++++++++++++++++++++++++++----------------------------
1 file changed, 28 insertions(+), 28 deletions(-)
diff --git a/denote-dired.el b/denote-dired.el
index 099faabca5..0436eb46e2 100644
--- a/denote-dired.el
+++ b/denote-dired.el
@@ -313,35 +313,35 @@ replace what isn't there."
The FILE, TITLE, and KEYWORDS are passed from the renaming
command and are used to construct a new front matter block if
appropriate."
- (when (denote-dired--edit-front-matter-p file)
- (when-let* ((id (denote-retrieve--filename-identifier file))
- (date (denote-retrieve--value-date file))
- (filetype (denote-dired--filetype-heuristics file))
- (new-front-matter (denote--file-meta-header title date
keywords id filetype)))
- (let (old-front-matter front-matter-delimiter)
- (with-current-buffer (find-file-noselect file)
- (save-excursion
- (save-restriction
- (widen)
- (goto-char (point-min))
- (setq front-matter-delimiter
(denote-dired--front-matter-search-delimiter filetype))
- (when front-matter-delimiter
- (setq old-front-matter
- (buffer-substring-no-properties
- (point-min)
- (progn front-matter-delimiter (point)))))))
- (when (and old-front-matter
- (y-or-n-p
- (format "%s\n%s\nReplace front matter?"
- (propertize old-front-matter 'face 'error)
- (propertize new-front-matter 'face 'success))))
- (delete-region (point-min) front-matter-delimiter)
+ (when-let* ((denote-dired--edit-front-matter-p file)
+ (id (denote-retrieve--filename-identifier file))
+ (date (denote-retrieve--value-date file))
+ (filetype (denote-dired--filetype-heuristics file))
+ (new-front-matter (denote--file-meta-header title date keywords
id filetype)))
+ (let (old-front-matter front-matter-delimiter)
+ (with-current-buffer (find-file-noselect file)
+ (save-excursion
+ (save-restriction
+ (widen)
(goto-char (point-min))
- (insert new-front-matter)
- ;; FIXME 2022-06-16: Instead of `delete-blank-lines', we
- ;; should check if we added any new lines and delete only
- ;; those.
- (delete-blank-lines)))))))
+ (setq front-matter-delimiter
(denote-dired--front-matter-search-delimiter filetype))
+ (when front-matter-delimiter
+ (setq old-front-matter
+ (buffer-substring-no-properties
+ (point-min)
+ (progn front-matter-delimiter (point)))))))
+ (when (and old-front-matter
+ (y-or-n-p
+ (format "%s\n%s\nReplace front matter?"
+ (propertize old-front-matter 'face 'error)
+ (propertize new-front-matter 'face 'success))))
+ (delete-region (point-min) front-matter-delimiter)
+ (goto-char (point-min))
+ (insert new-front-matter)
+ ;; FIXME 2022-06-16: Instead of `delete-blank-lines', we
+ ;; should check if we added any new lines and delete only
+ ;; those.
+ (delete-blank-lines))))))
;;;; Extra fontification
- [elpa] externals/denote dcf8739474 261/355: Improve valid note test (revise ecaaa6b, 8e5899d), (continued)
- [elpa] externals/denote dcf8739474 261/355: Improve valid note test (revise ecaaa6b, 8e5899d), ELPA Syncer, 2022/06/27
- [elpa] externals/denote 83d53afae4 245/355: Improve dired revert-buffer post rename, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 8e5899d90e 260/355: Match only files that start with ID in file search, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 341cd28b5a 266/355: Fix bug with 'default-directory' reset, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 0f149afba2 264/355: Simplify how temp buffer contents are returned, ELPA Syncer, 2022/06/27
- [elpa] externals/denote d8ef0a0c7c 282/355: EXPERIMENTAL Add buttonization for all links, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 843fb30dff 301/355: Answer FAQ about sorting files, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 47a9024b00 252/355: BREAKING update the .dir-locals.el sample, ELPA Syncer, 2022/06/27
- [elpa] externals/denote bd14f8a813 293/355: REMOVE denote-link-register-ol-hyperlink variable, ELPA Syncer, 2022/06/27
- [elpa] externals/denote a611e08ec1 285/355: Clarify that linking still needs some updates, ELPA Syncer, 2022/06/27
- [elpa] externals/denote c3feb9a0ec 250/355: Remove superfluous when,
ELPA Syncer <=
- [elpa] externals/denote 662a71d051 330/355: Remove development note about links, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 3b2db33812 322/355: Remove development note about backlinks, ELPA Syncer, 2022/06/27
- [elpa] externals/denote ed75652925 341/355: Remove the ref card from the manual, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 8394280f95 317/355: Refine regexp for front-matter date extraction, ELPA Syncer, 2022/06/27
- [elpa] externals/denote b25235e93e 331/355: Add header links to the mailing list, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 26069e8612 029/355: Add todo about alternative to seq-remove, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 418a21dccb 052/355: Tweak file and defgroup descriptions, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 20a915672e 056/355: Remove interactive-only from 'denote', ELPA Syncer, 2022/06/27
- [elpa] externals/denote 0519be74a9 121/355: Add PROOF-OF-CONCEPT denote-link-backlinks, ELPA Syncer, 2022/06/27
- [elpa] externals/denote a107fbf5d7 120/355: Make minor tweaks in the manual, ELPA Syncer, 2022/06/27