summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/bookmark.el27
-rw-r--r--lisp/mail/rmailout.el2
-rw-r--r--lisp/net/eww.el2
-rw-r--r--lisp/net/tramp-gvfs.el25
-rw-r--r--lisp/progmodes/cc-engine.el2
5 files changed, 46 insertions, 12 deletions
diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index d703458aa11..b9bdbe86d69 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -1483,7 +1483,32 @@ for a file, defaulting to the file defined by variable
((eq 'nospecial bookmark-version-control) version-control)
(t t))))
(condition-case nil
- (write-region (point-min) (point-max) file)
+ ;; There was a stretch of time (about 15 years) when we
+ ;; used `write-region' below instead of `write-file',
+ ;; before going back to `write-file' again. So if you're
+ ;; considering changing it to `write-region', please see
+ ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=12507.
+ ;; That bug tells the story of how we first started using
+ ;; `write-region' in 2005...
+ ;;
+ ;; commit a506054af7cd86a63fda996056c09310966f32ef
+ ;; Author: Karl Fogel <kfogel@red-bean.com>
+ ;; AuthorDate: Sat Nov 12 20:30:22 2005 +0000
+ ;;
+ ;; (bookmark-write-file): Don't visit the
+ ;; destination file, just write the data to it
+ ;; using write-region. This is similar to
+ ;; 2005-05-29T08:36:26Z!rms@gnu.org of saveplace.el,
+ ;; but with an additional change to avoid visiting
+ ;; the file in the first place.
+ ;;
+ ;; ...and of how further inquiry led us to investigate (in
+ ;; 2012 and then again in 2020) and eventually decide that
+ ;; matching the saveplace.el change doesn't make sense for
+ ;; bookmark.el. Therefore we reverted to `write-file',
+ ;; which means numbered backups may now be created,
+ ;; depending on `bookmark-version-control' as per above.
+ (write-file file)
(file-error (message "Can't write %s" file)))
(setq bookmark-file-coding-system coding-system-for-write)
(kill-buffer (current-buffer))
diff --git a/lisp/mail/rmailout.el b/lisp/mail/rmailout.el
index 49531eab91e..cfde335b54f 100644
--- a/lisp/mail/rmailout.el
+++ b/lisp/mail/rmailout.el
@@ -579,7 +579,7 @@ from a non-Rmail buffer. In this case, COUNT is ignored."
(progn
(if rmail-delete-after-output
(rmail-delete-message))
- (if (> count 0)
+ (if (>= count 0)
(let ((msgnum rmail-current-message))
(rmail-next-message 1)
(eq rmail-current-message (1+ msgnum)))))
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 0c43fc609a2..ce49e32601b 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -1832,7 +1832,7 @@ Use link at point if there is one, else the current page's URL."
(suffix ""))
(when (string-match "\\`\\(.*\\)\\([.][^.]+\\)" file)
(setq stem (match-string 1 file)
- suffix (match-string 2)))
+ suffix (match-string 2 file)))
(while (file-exists-p (expand-file-name file directory))
(setq file (format "%s(%d)%s" stem count suffix))
(setq count (1+ count)))
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
index 40a7cbbce19..7970488b40d 100644
--- a/lisp/net/tramp-gvfs.el
+++ b/lisp/net/tramp-gvfs.el
@@ -1020,14 +1020,23 @@ file names."
(with-tramp-progress-reporter
v 0 (format "%s %s to %s" msg-operation filename newname)
(unless
- (apply
- #'tramp-gvfs-send-command v gvfs-operation
- (append
- (and (eq op 'copy) (or keep-date preserve-uid-gid)
- '("--preserve"))
- (list
- (tramp-gvfs-url-file-name filename)
- (tramp-gvfs-url-file-name newname))))
+ (and (apply
+ #'tramp-gvfs-send-command v gvfs-operation
+ (append
+ (and (eq op 'copy) (or keep-date preserve-uid-gid)
+ '("--preserve"))
+ (list
+ (tramp-gvfs-url-file-name filename)
+ (tramp-gvfs-url-file-name newname))))
+ ;; Some backends do not return a proper error
+ ;; code in case of direct copy/move. Apply sanity checks.
+ (or (not equal-remote)
+ (tramp-gvfs-send-command
+ v "gvfs-info" (tramp-gvfs-url-file-name newname))
+ (eq op 'copy)
+ (not (tramp-gvfs-send-command
+ v "gvfs-info"
+ (tramp-gvfs-url-file-name filename)))))
(if (or (not equal-remote)
(and equal-remote
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 252eec138c1..5e2ce71f536 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -3148,7 +3148,7 @@ comment at the start of cc-engine.el for more info."
((nth 7 s) 'c++)
(t 'c)))
(setq start (nth 8 s))
- (unless end
+ (unless (and end (>= end here))
(setq s1 (parse-partial-sexp here (point-max)
nil ; TARGETDEPTH
nil ; STOPBEFORE