diff --git a/lisp/dashboard/dashboard-pkg.el b/lisp/dashboard/dashboard-pkg.el index bf3703b1..805b67c9 100644 --- a/lisp/dashboard/dashboard-pkg.el +++ b/lisp/dashboard/dashboard-pkg.el @@ -1,10 +1,10 @@ ;; -*- no-byte-compile: t; lexical-binding: nil -*- -(define-package "dashboard" "20250521.900" +(define-package "dashboard" "20250708.57" "A startup screen extracted from Spacemacs." '((emacs "27.1")) :url "https://github.com/emacs-dashboard/emacs-dashboard" - :commit "f07661b39bec3683cf9edb7b1c58f6e658b6f764" - :revdesc "f07661b39bec" + :commit "8c2cf0cfde4f5dac8c477f755380fffef6824108" + :revdesc "8c2cf0cfde4f" :keywords '("startup" "screen" "tools" "dashboard") :authors '(("Rakan Al-Hneiti" . "rakan.alhneiti@gmail.com")) :maintainers '(("Jen-Chieh" . "jcs090218@gmail.com") diff --git a/lisp/dashboard/dashboard-widgets.el b/lisp/dashboard/dashboard-widgets.el index b25e78e8..6d341055 100644 --- a/lisp/dashboard/dashboard-widgets.el +++ b/lisp/dashboard/dashboard-widgets.el @@ -798,25 +798,20 @@ Argument IMAGE-PATH path to the image." (goto-char (point-max)) (when-let* ((banner (dashboard-choose-banner dashboard-startup-banner))) (insert "\n") + (when (display-graphic-p) (insert "\n")) (let ((start (point)) buffer-read-only text-width - image-spec - (graphic-mode (display-graphic-p))) - (when graphic-mode (insert "\n")) + image-spec) ;; If specified, insert a text banner. (when-let* ((txt (plist-get banner :text))) - (if (file-exists-p txt) - (insert-file-contents txt) - (save-excursion (insert txt))) - (unless (text-properties-at 0 txt) - (put-text-property (point) (point-max) 'face 'dashboard-text-banner)) - (setq text-width 0) - (while (not (eobp)) - (let ((line-length (- (line-end-position) (line-beginning-position)))) - (when (< text-width line-length) - (setq text-width line-length))) - (forward-line 1))) + (save-excursion + (if (file-exists-p txt) + (insert-file-contents txt) + (insert txt))) + (put-text-property start (point-max) 'face 'dashboard-text-banner) + (setq text-width (dashboard--find-max-width start (point-max))) + (goto-char (point-max))) ;; If specified, insert an image banner. When displayed in a graphical frame, this will ;; replace the text banner. (when-let* ((img (plist-get banner :image))) diff --git a/lisp/dashboard/dashboard.el b/lisp/dashboard/dashboard.el index 5cbd7a77..d735afcd 100644 --- a/lisp/dashboard/dashboard.el +++ b/lisp/dashboard/dashboard.el @@ -12,8 +12,8 @@ ;;; License: GPLv3 ;; ;; Created: October 05, 2016 -;; Package-Version: 20250521.900 -;; Package-Revision: f07661b39bec +;; Package-Version: 20250708.57 +;; Package-Revision: 8c2cf0cfde4f ;; Keywords: startup, screen, tools, dashboard ;; Package-Requires: ((emacs "27.1")) diff --git a/lisp/diff-hl/diff-hl-pkg.el b/lisp/diff-hl/diff-hl-pkg.el index 40c821da..10f2de1f 100644 --- a/lisp/diff-hl/diff-hl-pkg.el +++ b/lisp/diff-hl/diff-hl-pkg.el @@ -1,11 +1,11 @@ ;; -*- no-byte-compile: t; lexical-binding: nil -*- -(define-package "diff-hl" "20250613.2144" +(define-package "diff-hl" "20250710.145" "Highlight uncommitted changes using VC." '((cl-lib "0.2") (emacs "26.1")) :url "https://github.com/dgutov/diff-hl" - :commit "830b05253ba8f35b80448e5de2201aecb6943840" - :revdesc "830b05253ba8" + :commit "08243a6e0b681c34eb4e4abf1d1c4c1b251ce91e" + :revdesc "08243a6e0b68" :keywords '("vc" "diff") :authors '(("Dmitry Gutov" . "dmitry@gutov.dev")) :maintainers '(("Dmitry Gutov" . "dmitry@gutov.dev"))) diff --git a/lisp/diff-hl/diff-hl.el b/lisp/diff-hl/diff-hl.el index 8b7749fb..7e8bb891 100644 --- a/lisp/diff-hl/diff-hl.el +++ b/lisp/diff-hl/diff-hl.el @@ -5,8 +5,8 @@ ;; Author: Dmitry Gutov ;; URL: https://github.com/dgutov/diff-hl ;; Keywords: vc, diff -;; Package-Version: 20250613.2144 -;; Package-Revision: 830b05253ba8 +;; Package-Version: 20250710.145 +;; Package-Revision: 08243a6e0b68 ;; Package-Requires: ((cl-lib "0.2") (emacs "26.1")) ;; This file is part of GNU Emacs. @@ -389,7 +389,13 @@ It can be a relative expression as well, such as \"HEAD^\" with Git, or (let* ((file buffer-file-name) (backend (vc-backend file))) (when backend - (let ((state (vc-state file backend))) + (let ((state (vc-state file backend)) + ;; Workaround for debbugs#78946. + ;; This is fiddly, but we basically allow the thread to start, while + ;; prohibiting the async process call inside. + ;; That still makes it partially async. + (diff-hl-update-async (and diff-hl-update-async + (not (eq window-system 'ns))))) (cond ((diff-hl-modified-p state) (diff-hl-changes-from-buffer @@ -923,6 +929,7 @@ Pops up a diff buffer that can be edited to choose the changes to stage." (file buffer-file-name) (dest-buffer (get-buffer-create "*diff-hl-stage-some*")) (orig-buffer (current-buffer)) + (diff-hl-update-async nil) ;; FIXME: If the file name has double quotes, these need to be quoted. (file-base (file-name-nondirectory file))) (with-current-buffer dest-buffer @@ -965,14 +972,18 @@ Pops up a diff buffer that can be edited to choose the changes to stage." (defun diff-hl-stage-finish () (interactive) - (let ((count 0)) - (when (diff-hl-stage-diff diff-hl-stage--orig) + (let ((count 0) + (orig-buffer diff-hl-stage--orig)) + (when (diff-hl-stage-diff orig-buffer) (save-excursion (goto-char (point-min)) (while (re-search-forward diff-hunk-header-re-unified nil t) (cl-incf count))) (message "Staged %d hunks" count) - (bury-buffer)))) + (bury-buffer) + (unless diff-hl-show-staged-changes + (with-current-buffer orig-buffer + (diff-hl-update)))))) (defvar diff-hl-command-map (let ((map (make-sparse-keymap))) @@ -1027,7 +1038,7 @@ The value of this variable is a mode line template as in (add-hook 'text-scale-mode-hook 'diff-hl-maybe-redefine-bitmaps nil t)) (remove-hook 'after-save-hook 'diff-hl-update t) (remove-hook 'after-change-functions 'diff-hl-edit t) - (remove-hook 'find-file-hook 'diff-hl-update t) + (remove-hook 'find-file-hook 'diff-hl-update-once t) (remove-hook 'after-revert-hook 'diff-hl-after-revert t) (remove-hook 'magit-revert-buffer-hook 'diff-hl-update t) (remove-hook 'magit-not-reverted-hook 'diff-hl-update t) diff --git a/lisp/flycheck-posframe/flycheck-posframe-pkg.el b/lisp/flycheck-posframe/flycheck-posframe-pkg.el new file mode 100644 index 00000000..7c96d236 --- /dev/null +++ b/lisp/flycheck-posframe/flycheck-posframe-pkg.el @@ -0,0 +1,11 @@ +;; -*- no-byte-compile: t; lexical-binding: nil -*- +(define-package "flycheck-posframe" "20220715.133" + "Show flycheck error messages using posframe.el." + '((flycheck "0.24") + (emacs "26") + (posframe "0.7.0")) + :url "https://github.com/alexmurray/flycheck-posframe" + :commit "19896b922c76a0f460bf3fe8d8ebc2f9ac9028d8" + :revdesc "19896b922c76" + :authors '(("Alex Murray" . "murray.alex@gmail.com")) + :maintainers '(("Alex Murray" . "murray.alex@gmail.com"))) diff --git a/lisp/flycheck-posframe/flycheck-posframe.el b/lisp/flycheck-posframe/flycheck-posframe.el new file mode 100644 index 00000000..c1077fcd --- /dev/null +++ b/lisp/flycheck-posframe/flycheck-posframe.el @@ -0,0 +1,256 @@ +;;; flycheck-posframe.el --- Show flycheck error messages using posframe.el + +;; Copyright (C) 2021 Alex Murray + +;; Author: Alex Murray +;; Maintainer: Alex Murray +;; URL: https://github.com/alexmurray/flycheck-posframe +;; Package-Version: 20220715.133 +;; Package-Revision: 19896b922c76 +;; Package-Requires: ((flycheck "0.24") (emacs "26") (posframe "0.7.0")) + +;; This file is not part of GNU Emacs. + +;; This program is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; Show flycheck error messages using posframe.el + +;;;; Setup + +;; (with-eval-after-load 'flycheck +;; (require 'flycheck-posframe) +;; (add-hook 'flycheck-mode-hook #'flycheck-posframe-mode)) + +;;; Code: +(require 'flycheck) +(require 'posframe) + +(defgroup flycheck-posframe nil + "Display Flycheck errors in tooltips using posframe.el." + :prefix "flycheck-posframe-" + :group 'flycheck + :link '(url-link :tag "Github" "https://github.com/alexmurray/flycheck-posframe")) + +(defcustom flycheck-posframe-position 'point-bottom-left-corner + "Where to position the flycheck-posframe frame." + :group 'flycheck-posframe + :type '(choice + (const :tag "Center of the frame" frame-center) + (const :tag "Centered at the top of the frame" frame-top-center) + (const :tag "Left corner at the top of the frame" frame-top-left-corner) + (const :tag "Right corner at the top of the frame" frame-top-right-corner) + (const :tag "Left corner at the bottom of the frame" frame-bottom-left-corner) + (const :tag "Right corner at the bottom of the frame" frame-bottom-right-corner) + (const :tag "Center of the window" window-center) + (const :tag "Left corner at the top of the window" window-top-left-corner) + (const :tag "Right corner at the top of the window" window-top-right-corner) + (const :tag "Left corner at the bottom of the window" window-bottom-left-corner) + (const :tag "Right corner at the bottom of the window" window-bottom-right-corner) + (const :tag "Top left corner of point" point-top-left-corner) + (const :tag "Bottom left corner of point" point-bottom-left-corner)) + :package-version '(flycheck-posframe . "0.6")) + +(defcustom flycheck-posframe-border-width 0 + "Width of the border for a flycheck-posframe frame." + :group 'flycheck-posframe + :type 'integer + :package-version '(flycheck-posframe . "0.6")) + +(defcustom flycheck-posframe-border-use-error-face nil + "If non-nil, `flycheck-posframe-border-face' will be overriden by the foreground of the highest error level face." + :group 'flycheck-posframe + :type 'boolean + :package-version '(flycheck-posframe . "0.7")) + +(defcustom flycheck-posframe-prefix "\u27a4 " + "String to be displayed before every default message in posframe." + :group 'flycheck-posframe + :type 'string + :package-version '(flycheck-posframe . "0.3")) + +(defcustom flycheck-posframe-info-prefix flycheck-posframe-prefix + "String to be displayed before every info message in posframe." + :group 'flycheck-posframe + :type 'string + :package-version '(flycheck-posframe . "0.3")) + +(defcustom flycheck-posframe-warning-prefix flycheck-posframe-prefix + "String to be displayed before every warning message in posframe." + :group 'flycheck-posframe + :type 'string + :package-version '(flycheck-posframe . "0.3")) + +(defcustom flycheck-posframe-error-prefix flycheck-posframe-prefix + "String to be displayed before every error message in posframe." + :group 'flycheck-posframe + :type 'string + :package-version '(flycheck-posframe . "0.1")) + +(defface flycheck-posframe-face + '((t :inherit default)) + "The default face to use for displaying messages in posframe." + :group 'flycheck-posframe + :package-version '(flycheck-posframe . "0.2")) + +(defface flycheck-posframe-info-face + '((t :inherit flycheck-posframe-face)) + "The face to use for displaying info messages in posframe." + :group 'flycheck-posframe + :package-version '(flycheck-posframe . "0.3")) + +(defface flycheck-posframe-warning-face + '((t :inherit flycheck-posframe-face)) + "The face to use for displaying warning messages in posframe." + :group 'flycheck-posframe + :package-version '(flycheck-posframe . "0.3")) + +(defface flycheck-posframe-error-face + '((t :inherit flycheck-posframe-face)) + "The face to use for displaying warning messages in posframe." + :group 'flycheck-posframe + :package-version '(flycheck-posframe . "0.3")) + +(defface flycheck-posframe-background-face + '((t)) + "The background color of the flycheck-posframe frame. +Only the `background' is used in this face." + :group 'flycheck-posframe + :package-version '(flycheck-posframe . "0.4")) + +(defface flycheck-posframe-border-face + '((t)) + "The border color of the flycheck-posframe frame. +Only the `foreground' is used in this face." + :group 'flycheck-posframe + :package-version '(flycheck-posframe . "0.6")) + +(defvar flycheck-posframe-buffer "*flycheck-posframe-buffer*" + "The posframe buffer name use by flycheck-posframe.") + +(defvar flycheck-posframe-old-display-function nil + "The former value of `flycheck-display-errors-function'.") + +(defvar flycheck-posframe-last-position nil + "Last position for which a flycheck posframe was displayed.") + +(defun flycheck-posframe-check-position () + "Update `flycheck-posframe-last-position', returning t if there was no change." + (equal flycheck-posframe-last-position + (setq flycheck-posframe-last-position + (list (current-buffer) (buffer-modified-tick) (point))))) + +(defcustom flycheck-posframe-inhibit-functions nil + "Functions to inhibit display of flycheck posframe." + :type 'hook + :group 'flycheck-posframe) + +(defun flycheck-posframe-get-prefix-for-error (err) + "Return the prefix which should be used to display ERR." + (pcase (flycheck-error-level err) + ('info flycheck-posframe-info-prefix) + ('warning flycheck-posframe-warning-prefix) + ('error flycheck-posframe-error-prefix) + (_ flycheck-posframe-prefix))) + +(defun flycheck-posframe-get-face-for-error (err) + "Return the face which should be used to display ERR." + (pcase (flycheck-error-level err) + ('info 'flycheck-posframe-info-face) + ('warning 'flycheck-posframe-warning-face) + ('error 'flycheck-posframe-error-face) + (_ 'flycheck-posframe-face))) + +(defun flycheck-posframe-highest-error-level-face (errs) + "Return the face corresponding to the highest error level from ERRS." + (flycheck-posframe-get-face-for-error (cl-reduce + (lambda (err1 err2) (if (flycheck-error-level-< err1 err2) err2 err1)) + errs))) + +(defun flycheck-posframe-format-error (err) + "Formats ERR for display." + (propertize (concat + (flycheck-posframe-get-prefix-for-error err) + (flycheck-error-format-message-and-id err)) + 'face + `(:inherit ,(flycheck-posframe-get-face-for-error err))) ) + +(defun flycheck-posframe-format-errors (errors) + "Formats ERRORS messages for display." + (let ((messages (sort + (mapcar #'flycheck-posframe-format-error + (delete-dups errors)) + 'string-lessp))) + (mapconcat 'identity messages "\n"))) + +(defun flycheck-posframe-hidehandler (_info) + "Hide posframe if position has changed since last display." + (not (flycheck-posframe-check-position))) + +(defun flycheck-posframe-show-posframe (errors) + "Display ERRORS, using posframe.el library." + (posframe-hide flycheck-posframe-buffer) + (when (and errors + (not (run-hook-with-args-until-success 'flycheck-posframe-inhibit-functions))) + (let ((poshandler (intern (format "posframe-poshandler-%s" flycheck-posframe-position)))) + (unless (functionp poshandler) + (setq poshandler nil)) + (flycheck-posframe-check-position) + (posframe-show + flycheck-posframe-buffer + :string (flycheck-posframe-format-errors errors) + :background-color (face-background 'flycheck-posframe-background-face nil t) + :position (point) + :internal-border-width flycheck-posframe-border-width + :internal-border-color (face-foreground (if flycheck-posframe-border-use-error-face + (flycheck-posframe-highest-error-level-face errors) + 'flycheck-posframe-border-face) nil t) + :poshandler poshandler + :hidehandler #'flycheck-posframe-hidehandler)))) + +;;;###autoload +(defun flycheck-posframe-configure-pretty-defaults () + "Configure some nicer settings for prettier display." + (setq flycheck-posframe-warning-prefix "\u26a0 ") + (setq flycheck-posframe-error-prefix "\u274c ") + (set-face-attribute 'flycheck-posframe-warning-face nil :inherit 'warning) + (set-face-attribute 'flycheck-posframe-error-face nil :inherit 'error)) + +;;;###autoload +(define-minor-mode flycheck-posframe-mode + "A minor mode to show Flycheck error messages in a posframe." + :lighter nil + :group 'flycheck-posframe + (cond + ;; Use our display function and remember the old one but only if we haven't + ;; yet configured it, to avoid activating twice. + ((and flycheck-posframe-mode + (not (eq flycheck-display-errors-function + #'flycheck-posframe-show-posframe))) + (setq-local flycheck-posframe-old-display-function + flycheck-display-errors-function) + (setq-local flycheck-display-errors-function + #'flycheck-posframe-show-posframe)) + ;; Reset the display function and remove ourselves from all hooks but only + ;; if the mode is still active. + ((and (not flycheck-posframe-mode) + (eq flycheck-display-errors-function + #'flycheck-posframe-show-posframe)) + (setq-local flycheck-display-errors-function + flycheck-posframe-old-display-function) + (setq-local flycheck-posframe-old-display-function nil)))) + +(provide 'flycheck-posframe) +;;; flycheck-posframe.el ends here diff --git a/lisp/magit/git-rebase.el b/lisp/magit/git-rebase.el index 486b0422..dbcb8535 100644 --- a/lisp/magit/git-rebase.el +++ b/lisp/magit/git-rebase.el @@ -321,6 +321,10 @@ region is active, act on all lines touched by the region." (abbrev))) (defvar git-rebase-line-regexps + ;; 1: action, 2: option, 3: target, 4: "#", 5: description. + ;; + ;; [[# ] ] + ;; fixup [-C|-c] [[# ] ] `((commit . ,(concat (regexp-opt '("d" "drop" "e" "edit" @@ -331,7 +335,8 @@ region is active, act on all lines touched by the region." "r" "reword" "s" "squash") "\\(?1:") - " \\(?3:[^ \n]+\\) ?\\(?4:.*\\)")) + " \\(?3:[^ \n]+\\)" + "\\(?: \\(?4:# \\)?\\(?5:.*\\)\\)?")) (exec . "\\(?1:x\\|exec\\) \\(?3:.*\\)") (bare . ,(concat (regexp-opt '("b" "break" "noop") "\\(?1:") " *$")) @@ -339,11 +344,14 @@ region is active, act on all lines touched by the region." "t" "reset" "u" "update-ref") "\\(?1:") - " \\(?3:[^ \n]+\\) ?\\(?4:.*\\)")) + " \\(?3:[^ \n]+\\)" + "\\(?: \\(?4:# \\)?\\(?5:.*\\)\\)?")) + ;; merge [-C | -c ]