summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/files.el6
-rw-r--r--lisp/progmodes/xref.el2
-rw-r--r--lisp/vc/vc.el20
3 files changed, 15 insertions, 13 deletions
diff --git a/lisp/files.el b/lisp/files.el
index 503f7fca72a..059fdbbe371 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -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)))
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index 8d8e7ab208e..13a1600594f 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -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
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 132278e8230..c5584188b31 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -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.