Merge from origin/emacs-27
91c16acbe2
(origin/emacs-27) Improve doc string of 'files--message'c3be58a8f5
(emacs-27) Improve vc--add-line, vc--remove-regexp9ea9ac9a61
Apply the 'xref-group' property properly
This commit is contained in:
commit
43d97f17b8
3 changed files with 15 additions and 13 deletions
|
@ -2166,9 +2166,9 @@ If that fails, try to open it with `find-file-literally'
|
|||
(* total-free-memory 1024)))))))))
|
||||
|
||||
(defun files--message (format &rest args)
|
||||
"Like `message', except sometimes don't print to minibuffer.
|
||||
If the variable `save-silently' is non-nil, the message is not
|
||||
displayed on the minibuffer."
|
||||
"Like `message', except sometimes don't show the message text.
|
||||
If the variable `save-silently' is non-nil, the message will not
|
||||
be visible in the echo area."
|
||||
(apply #'message format args)
|
||||
(when save-silently (message nil)))
|
||||
|
||||
|
|
|
@ -814,7 +814,7 @@ GROUP is a string for decoration purposes and XREF is an
|
|||
for line-format = (and max-line-width
|
||||
(format "%%%dd: " max-line-width))
|
||||
do
|
||||
(xref--insert-propertized '(face xref-file-header 'xref-group t)
|
||||
(xref--insert-propertized '(face xref-file-header xref-group t)
|
||||
group "\n")
|
||||
(cl-loop for (xref . more2) on xrefs do
|
||||
(with-slots (summary location) xref
|
||||
|
|
|
@ -1460,20 +1460,22 @@ Argument BACKEND is the backend you are using."
|
|||
;; Subroutine for `vc-git-ignore' and `vc-hg-ignore'.
|
||||
(defun vc--add-line (string file)
|
||||
"Add STRING as a line to FILE."
|
||||
(with-temp-buffer
|
||||
(insert-file-contents file)
|
||||
(with-current-buffer (find-file-noselect file)
|
||||
(goto-char (point-min))
|
||||
(unless (re-search-forward (concat "^" (regexp-quote string) "$") nil t)
|
||||
(goto-char (point-max))
|
||||
(insert (concat "\n" string))
|
||||
(write-region (point-min) (point-max) file))))
|
||||
(unless (bolp) (insert "\n"))
|
||||
(insert string "\n")
|
||||
(save-buffer))))
|
||||
|
||||
(defun vc--remove-regexp (regexp file)
|
||||
"Remove all matching for REGEXP in FILE."
|
||||
(with-temp-buffer
|
||||
(insert-file-contents file)
|
||||
(while (re-search-forward regexp nil t)
|
||||
(replace-match ""))
|
||||
(write-region (point-min) (point-max) file)))
|
||||
(if (file-exists-p file)
|
||||
(with-current-buffer (find-file-noselect file)
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward regexp nil t)
|
||||
(replace-match ""))
|
||||
(save-buffer))))
|
||||
|
||||
(defun vc-checkout (file &optional rev)
|
||||
"Retrieve a copy of the revision REV of FILE.
|
||||
|
|
Loading…
Add table
Reference in a new issue