(buffer-name))
(set-window-dedicated-p window flag))
-(defun esy/bump (tag-prefix)
- (interactive (list "v"))
- (require 'lisp-mnt)
- (require 'magit-apply)
- (let ((date (format-time-string "%F" (current-time)))
- (current-version (save-excursion (lm-header "package-version"))))
- (unless current-version
- (user-error "No Package-Version Elisp header found"))
- (let ((next-version (mapconcat #'number-to-string
- (pcase (version-to-list
- current-version)
- (`(,major ,minor ,patch)
- (list major (1+ minor) patch)))
- ".")))
- (with-current-buffer (find-file "NEWS.org")
- (goto-char (point-min))
- (re-search-forward (concat "^\\(" org-outline-regexp "\\)") nil t)
- (beginning-of-line)
- (if (looking-at (rx "* Version "
- (group-n 1
- (+ digit) "."
- (+ digit) "."
- (+ digit))
- " in development"))
- (progn
- (setq next-version (match-string-no-properties 1))
- (end-of-line)
- (delete-char -14)
- (insert "on " date)
- (forward-char 2))
- (insert "* Version " next-version " on " date "\n\n")))
- (lm-header "package-version")
- (delete-region (point) (pos-eol))
- (insert next-version)
- (vc-print-root-log)
- (find-file-other-window "NEWS.org")
- (named-let loop ()
- (recursive-edit)
- (unless (y-or-n-p "OK to stage, commit and tag the new version?")
- (loop)))
- (unless (= (call-process "git" nil nil nil
- "add" (buffer-file-name) "NEWS.org")
- 0)
- (error "Git add failed"))
- (unless (= (call-process "git" nil nil nil
- "commit" "-m"
- (concat "Announce recent changes "
- "in NEWS.org "
- "and bump version to "
- next-version))
- 0)
- (error "Git commit failed"))
- (unless (= (call-process "git" nil nil nil
- "tag" "-s" "-m"
- (concat "Release version "
- next-version)
- (concat tag-prefix next-version))
- 0)
- (error "Git tag failed")))))
-
;;; Ensure scripts ran with `executable-interpret' are executable
(with-eval-after-load 'executable