emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 6c6d06c 1/4: Merge from origin/emacs-27


From: Glenn Morris
Subject: master 6c6d06c 1/4: Merge from origin/emacs-27
Date: Tue, 1 Dec 2020 10:54:52 -0500 (EST)

branch: master
commit 6c6d06c3ee67ae876ade7f4a032da928ffeeb41f
Merge: 496d1fc 9939c43
Author: Glenn Morris <rgm@gnu.org>
Commit: Glenn Morris <rgm@gnu.org>

    Merge from origin/emacs-27
    
    9939c435c1 Return the correct suffix in eww-make-unique-file-name
    17fa17be3d Save bookmarks by using `write-file' (bug#12507)
    2cdf1fd261 Fix filing messages when 'rmail-output-reset-deleted-flag'...
    a72db8ab8b Make file copying in tramp-gvfs more robust
    f31cacd1ff Revert "Fix incorrect handling of module runtime and envir...
    cdc632fbe6 Fix incorrect handling of module runtime and environment p...
    c9160bda78 CC Mode: Fix error in cache handling.  This fixes bug #43481
---
 lisp/bookmark.el            | 27 ++++++++++++++++++++++++++-
 lisp/mail/rmailout.el       |  2 +-
 lisp/net/eww.el             |  2 +-
 lisp/net/tramp-gvfs.el      | 25 +++++++++++++++++--------
 lisp/progmodes/cc-engine.el |  2 +-
 5 files changed, 46 insertions(+), 12 deletions(-)

diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index d703458..b9bdbe8 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 49531ea..cfde335 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 0c43fc6..ce49e32 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 40a7cbb..7970488 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 252eec1..5e2ce71 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]