emacs-diffs
[Top][All Lists]
Advanced

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

feature/pgtk 5b97b98: Merge branch 'master' of git.sv.gnu.org:/srv/git/e


From: Yuuki Harano
Subject: feature/pgtk 5b97b98: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtk
Date: Wed, 5 May 2021 06:50:52 -0400 (EDT)

branch: feature/pgtk
commit 5b97b98daa7f61311c3662beecbeca7037505992
Merge: 704b765 58b0bcd
Author: Yuuki Harano <masm+github@masm11.me>
Commit: Yuuki Harano <masm+github@masm11.me>

    Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtk
---
 admin/make-tarball.txt    |  1 +
 doc/lispref/compile.texi  |  8 ++---
 doc/misc/autotype.texi    |  2 +-
 doc/misc/gnus.texi        | 11 ++++++
 etc/NEWS                  | 36 ++++++++++++--------
 etc/tutorials/TUTORIAL.es |  2 +-
 lisp/bookmark.el          | 59 +++++++++++++++++++++++++++++++-
 lisp/emacs-lisp/comp.el   | 13 ++++---
 lisp/emacs-lisp/elp.el    | 30 ++++++++---------
 lisp/emacs-lisp/pp.el     |  6 ++--
 lisp/epa.el               |  5 ++-
 lisp/files.el             | 25 ++++++++------
 lisp/gnus/nnimap.el       | 26 ++++++++++----
 lisp/image.el             |  4 +--
 lisp/jka-compr.el         |  2 +-
 lisp/progmodes/cc-defs.el | 12 +++----
 lisp/progmodes/project.el | 11 +++---
 src/buffer.c              |  9 +++--
 src/callproc.c            | 13 +++++--
 src/gtkutil.c             |  2 --
 src/indent.c              |  5 +++
 src/nsterm.m              | 36 ++++++++++++--------
 src/verbose.mk.in         |  2 +-
 src/xfns.c                |  9 +++--
 src/xterm.c               | 86 +++++++++++++++++++++++++++++++----------------
 test/lisp/files-tests.el  | 24 +++++++------
 26 files changed, 295 insertions(+), 144 deletions(-)

diff --git a/admin/make-tarball.txt b/admin/make-tarball.txt
index 2f763a5..ae007d76 100644
--- a/admin/make-tarball.txt
+++ b/admin/make-tarball.txt
@@ -268,6 +268,7 @@ The pages to update are:
 emacs.html (for a new major release, a more thorough update is needed)
 history.html
 add the new NEWS file as news/NEWS.xx.y
+Copy new etc/MACHINES to MACHINES and CONTRIBUTE to CONTRIBUTE
 
 For every new release, a banner is displayed on top of the emacs.html
 page.  Uncomment and the release banner in emacs.html.  Keep it on the
diff --git a/doc/lispref/compile.texi b/doc/lispref/compile.texi
index 6624234..bf42004 100644
--- a/doc/lispref/compile.texi
+++ b/doc/lispref/compile.texi
@@ -361,7 +361,7 @@ it does nothing.  It always returns @var{function}.
   These features permit you to write code to be evaluated during
 compilation of a program.
 
-@defspec eval-and-compile body@dots{}
+@defmac eval-and-compile body@dots{}
 This form marks @var{body} to be evaluated both when you compile the
 containing code and when you run it (whether compiled or not).
 
@@ -386,9 +386,9 @@ If functions are defined programmatically (with @code{fset} 
say), then
 @code{eval-and-compile} can be used to have that done at compile-time
 as well as run-time, so calls to those functions are checked (and
 warnings about ``not known to be defined'' suppressed).
-@end defspec
+@end defmac
 
-@defspec eval-when-compile body@dots{}
+@defmac eval-when-compile body@dots{}
 This form marks @var{body} to be evaluated at compile time but not when
 the compiled program is loaded.  The result of evaluation by the
 compiler becomes a constant which appears in the compiled program.  If
@@ -434,7 +434,7 @@ with other versions of Emacs.
 Lisp idiom @code{(eval-when (compile eval) @dots{})}.  Elsewhere, the
 Common Lisp @samp{#.} reader macro (but not when interpreting) is closer
 to what @code{eval-when-compile} does.
-@end defspec
+@end defmac
 
 @node Compiler Errors
 @section Compiler Errors
diff --git a/doc/misc/autotype.texi b/doc/misc/autotype.texi
index 72ba736..5f9dc01 100644
--- a/doc/misc/autotype.texi
+++ b/doc/misc/autotype.texi
@@ -579,7 +579,7 @@ table:
 @vindex skeleton-transformation
 Insert string or character.  Literal strings and characters are passed through
 @code{skeleton-transformation} when that is non-@code{nil}.
-@item @code{?\n}
+@item @code{\n}
 @c ??? something seems very wrong here.
 Insert a newline and align under current line, but not if this is the
 last element of a skeleton and the newline would be inserted at end of
diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi
index 869bb27..a31411e 100644
--- a/doc/misc/gnus.texi
+++ b/doc/misc/gnus.texi
@@ -14515,6 +14515,17 @@ names.  If your IMAP mailboxes are called something 
like @samp{INBOX}
 and @samp{INBOX.Lists.emacs}, but you'd like the nnimap group names to
 be @samp{INBOX} and @samp{Lists.emacs}, you should enable this option.
 
+@item nnimap-keepalive-intervals
+By default, nnimap will send occasional @samp{NOOP} (keepalive)
+commands to the server, to keep the connection alive.  This option
+governs how often that happens.  It is a cons of two integers,
+representing seconds: first how often to run the keepalive check, and
+the second how many seconds of user inactivity are required to
+actually send the command.  The default, @code{(900 . 300)}, means run
+the check every fifteen minutes and, if the user has been inactive for
+five minutes, send the keepalive command.  Set to @code{nil} to
+disable keepalive commands altogether.
+
 @end table
 
 
diff --git a/etc/NEWS b/etc/NEWS
index c2db98a..8f4a683 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1082,16 +1082,6 @@ defaulting to active region when used interactively.
 ** The old non-SMIE indentation of 'sh-mode' has been removed.
 
 ---
-** The 'list-bookmark' menu is now based on 'tabulated-list-mode'.
-The interactive bookmark list will now benefit from features in
-'tabulated-list-mode' like sorting columns or changing column width.
-
-Support for the optional "inline" header line, allowing for a header
-without using 'header-line-format', has been dropped.  Consequently,
-the variables 'bookmark-bmenu-use-header-line' and
-'bookmark-bmenu-inline-header-height' are now declared obsolete.
-
----
 ** The sb-image.el library is now marked obsolete.
 This file was a compatibility kludge which is no longer needed.
 
@@ -1114,6 +1104,28 @@ To customize obsolete user options, use 
'customize-option' or
 They will be used automatically instead of the old icons.  If Emacs is
 built without SVG support, the old icons will be used instead.
 
+** Bookmarks
+
+*** Bookmarks can now be targets for new tabs.
+When the bookmark.el library is loaded, a customize choice is added
+to 'tab-bar-new-tab-choice' for new tabs to show the bookmark list.
+
+---
+*** The 'list-bookmarks' menu is now based on 'tabulated-list-mode'.
+The interactive bookmark list will now benefit from features in
+'tabulated-list-mode' like sorting columns or changing column width.
+
+Support for the optional "inline" header line, allowing for a header
+without using 'header-line-format', has been dropped.  Consequently,
+the variables 'bookmark-bmenu-use-header-line' and
+'bookmark-bmenu-inline-header-height' are now declared obsolete.
+
+---
+*** New user option 'bookmark-fontify'.
+If non-nil, setting a bookmark will colorize the current line with
+'bookmark-face'.
+
+
 ** Edebug
 
 *** Obsoletions
@@ -2194,10 +2206,6 @@ The width now depends of the width of the window, but 
will never be
 wider than the length of the longest buffer name, except that it will
 never be narrower than 19 characters.
 
-*** Bookmarks can now be targets for new tabs.
-When the bookmark.el library is loaded, a customize choice is added
-to 'tab-bar-new-tab-choice' for new tabs to show the bookmark list.
-
 ---
 *** Movement commands in 'gomoku-mode' are fixed.
 'gomoku-move-sw' and 'gomoku-move-ne' now work correctly, and
diff --git a/etc/tutorials/TUTORIAL.es b/etc/tutorials/TUTORIAL.es
index 0bd0614..a92604c 100644
--- a/etc/tutorials/TUTORIAL.es
+++ b/etc/tutorials/TUTORIAL.es
@@ -1091,7 +1091,7 @@ ayuda, y entonces teclear C-x 1.
 
 Aquí hay algunas otras opciones útiles de C-h:
 
-   C-h x       Describe un comando.  Usted teclea el nombre de la
+   C-h x       Describe un comando.  Usted teclea el nombre del
                comando.
 
 >> Intente teclear C-h x previous-line <Return>.
diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index 98797a0..3b75190 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -167,12 +167,34 @@ A non-nil value may result in truncated bookmark names."
   "Time before `bookmark-bmenu-search' updates the display."
   :type  'number)
 
+(defcustom bookmark-fontify t
+  "Whether to colorize a bookmarked line.
+If non-nil, setting a bookmark will colorize the current line with
+`bookmark-face'."
+  :type  'boolean
+  :version "28.1")
+
 ;; FIXME: No longer used.  Should be declared obsolete or removed.
 (defface bookmark-menu-heading
   '((t (:inherit font-lock-type-face)))
   "Face used to highlight the heading in bookmark menu buffers."
   :version "22.1")
 
+(defface bookmark-face
+  '((((class grayscale)
+      (background light))
+     :background "DimGray")
+    (((class grayscale)
+      (background dark))
+     :background "LightGray")
+    (((class color)
+      (background light))
+     :foreground "White" :background "DarkOrange1")
+    (((class color)
+      (background dark))
+     :foreground "Black" :background "DarkOrange1"))
+  "Face used to highlight current line."
+  :version "28.1")
 
 ;;; No user-serviceable parts beyond this point.
 
@@ -427,6 +449,30 @@ In other words, return all information but the name."
 (defvar bookmark-history nil
   "The history list for bookmark functions.")
 
+(defun bookmark--fontify ()
+  "Apply a colorized overlay to the bookmarked location.
+See user option `bookmark-fontify'."
+  (let ((bm (make-overlay (point-at-bol)
+                          (min (point-max) (1+ (point-at-eol))))))
+    (overlay-put bm 'category 'bookmark)
+    (overlay-put bm 'face 'bookmark-face)))
+
+(defun bookmark--unfontify (bm)
+  "Remove a bookmark's colorized overlay.
+BM is a bookmark as returned from function `bookmark-get-bookmark'.
+See user option `bookmark-fontify'."
+  (let ((filename (assq 'filename bm))
+        (pos      (assq 'position bm))
+        overlays found temp)
+    (when filename (setq filename (expand-file-name (cdr filename))))
+    (when pos (setq pos (cdr pos)))
+    (dolist (buf (buffer-list))
+      (with-current-buffer buf
+        (when (equal filename buffer-file-name)
+          (setq overlays (overlays-at pos))
+          (while (and (not found) (setq temp (pop overlays)))
+            (when (eq 'bookmark (overlay-get temp 'category))
+              (delete-overlay (setq found temp)))))))))
 
 (defun bookmark-completing-read (prompt &optional default)
   "Prompting with PROMPT, read a bookmark name in completion.
@@ -825,7 +871,9 @@ still there, in order, if the topmost one is ever deleted."
 
            ;; Ask for an annotation buffer for this bookmark
            (when bookmark-use-annotations
-             (bookmark-edit-annotation str))))
+             (bookmark-edit-annotation str))
+           (when bookmark-fontify
+             (bookmark--fontify))))
     (setq bookmark-yank-point nil)
     (setq bookmark-current-buffer nil)))
 
@@ -1094,6 +1142,14 @@ and then show any annotations for this bookmark."
     (if win (set-window-point win (point))))
   ;; FIXME: we used to only run bookmark-after-jump-hook in
   ;; `bookmark-jump' itself, but in none of the other commands.
+  (when bookmark-fontify
+    (let ((overlays (overlays-at (point)))
+          temp found)
+      (while (and (not found) (setq temp (pop overlays)))
+        (when (eq 'bookmark (overlay-get temp 'category))
+          (setq found t)))
+      (unless found
+        (bookmark--fontify))))
   (run-hooks 'bookmark-after-jump-hook)
   (if bookmark-automatically-show-annotations
       ;; if there is an annotation for this bookmark,
@@ -1357,6 +1413,7 @@ probably because we were called from there."
   (bookmark-maybe-historicize-string bookmark-name)
   (bookmark-maybe-load-default-file)
   (let ((will-go (bookmark-get-bookmark bookmark-name 'noerror)))
+    (bookmark--unfontify will-go)
     (setq bookmark-alist (delq will-go bookmark-alist))
     ;; Added by db, nil bookmark-current-bookmark if the last
     ;; occurrence has been deleted
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index 0ebaccb..297c1f7 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -3944,11 +3944,14 @@ display a message."
                                 source-file)
                                (comp-accept-and-process-async-output process)
                                (ignore-errors (delete-file temp-file))
-                               (when (and load1
-                                          (zerop (process-exit-status 
process)))
-                                 (native-elisp-load
-                                  (comp-el-to-eln-filename source-file1)
-                                  (eq load1 'late)))
+                               (let ((eln-file (comp-el-to-eln-filename
+                                                source-file1)))
+                                 (when (and load1
+                                            (zerop (process-exit-status
+                                                    process))
+                                            (file-exists-p eln-file))
+                                   (native-elisp-load eln-file
+                                                      (eq load1 'late))))
                                (comp-run-async-workers))
                              :noquery (not comp-async-query-on-exit))))
               (puthash source-file process comp-async-compilations))
diff --git a/lisp/emacs-lisp/elp.el b/lisp/emacs-lisp/elp.el
index 411ea2a..2ee19a3 100644
--- a/lisp/emacs-lisp/elp.el
+++ b/lisp/emacs-lisp/elp.el
@@ -1,7 +1,6 @@
 ;;; elp.el --- Emacs Lisp Profiler  -*- lexical-binding: t -*-
 
-;; Copyright (C) 1994-1995, 1997-1998, 2001-2021 Free Software
-;; Foundation, Inc.
+;; Copyright (C) 1994-2021 Free Software Foundation, Inc.
 
 ;; Author: Barry A. Warsaw
 ;; Maintainer: emacs-devel@gnu.org
@@ -30,8 +29,8 @@
 ;; hacks those functions so that profiling information is recorded
 ;; whenever they are called.  To print out the current results, use
 ;; M-x elp-results.  If you want output to go to standard-output
-;; instead of a separate buffer, setq elp-use-standard-output to
-;; non-nil.  With elp-reset-after-results set to non-nil, profiling
+;; instead of a separate buffer, set `elp-use-standard-output' to
+;; non-nil.  With `elp-reset-after-results' set to non-nil, profiling
 ;; information will be reset whenever the results are displayed.  You
 ;; can also reset all profiling info at any time with M-x
 ;; elp-reset-all.
@@ -40,12 +39,12 @@
 ;; the package follows the GNU coding standard of a common textual
 ;; prefix.  Use M-x elp-instrument-package for this.
 ;;
-;; If you want to sort the results, set elp-sort-by-function to some
+;; If you want to sort the results, set `elp-sort-by-function' to some
 ;; predicate function.  The three most obvious choices are predefined:
-;; elp-sort-by-call-count, elp-sort-by-average-time, and
-;; elp-sort-by-total-time.  Also, you can prune from the output, all
+;; `elp-sort-by-call-count', `elp-sort-by-average-time', and
+;; `elp-sort-by-total-time'.  Also, you can prune from the output, all
 ;; functions that have been called fewer than a given number of times
-;; by setting elp-report-limit.
+;; by setting `elp-report-limit'.
 ;;
 ;; Elp can instrument byte-compiled functions just as easily as
 ;; interpreted functions, but it cannot instrument macros.  However,
@@ -95,11 +94,11 @@
 
 ;; Note that there are plenty of factors that could make the times
 ;; reported unreliable, including the accuracy and granularity of your
-;; system clock, and the overhead spent in lisp calculating and
+;; system clock, and the overhead spent in Lisp calculating and
 ;; recording the intervals.  I figure the latter is pretty constant,
 ;; so while the times may not be entirely accurate, I think they'll
 ;; give you a good feel for the relative amount of work spent in the
-;; various lisp routines you are profiling.  Note further that times
+;; various Lisp routines you are profiling.  Note further that times
 ;; are calculated using wall-clock time, so other system load will
 ;; affect accuracy too.
 
@@ -404,15 +403,15 @@ original definition, use \\[elp-restore-function] or 
\\[elp-restore-all]."
 (defvar elp-et-len nil)
 
 (defun elp-sort-by-call-count (vec1 vec2)
-  ;; sort by highest call count.  See `sort'.
+  "Predicate to sort by highest call count.  See `sort'."
   (>= (aref vec1 0) (aref vec2 0)))
 
 (defun elp-sort-by-total-time (vec1 vec2)
-  ;; sort by highest total time spent in function. See `sort'.
+  "Predicate to sort by highest total time spent in function. See `sort'."
   (>= (aref vec1 1) (aref vec2 1)))
 
 (defun elp-sort-by-average-time (vec1 vec2)
-  ;; sort by highest average time spent in function. See `sort'.
+  "Predicate to sort by highest average time spent in function. See `sort'."
   (>= (aref vec1 2) (aref vec2 2)))
 
 (defsubst elp-pack-number (number width)
@@ -470,13 +469,13 @@ original definition, use \\[elp-restore-function] or 
\\[elp-restore-all]."
   "Keymap used on the function name column." )
 
 (defun elp-results-jump-to-definition (&optional event)
-  "Jump to the definition of the function under the point."
+  "Jump to the definition of the function at point."
   (interactive (list last-nonmenu-event))
   (if event (posn-set-point (event-end event)))
   (find-function (get-text-property (point) 'elp-symname)))
 
 (defun elp-output-insert-symname (symname)
-  ;; Insert SYMNAME with text properties.
+  "Insert SYMNAME with text properties."
   (insert (propertize symname
                      'elp-symname (intern symname)
                      'keymap elp-results-symname-map
@@ -587,7 +586,6 @@ displayed."
   "Un-instrument before unloading a function."
   (elp-restore-function (cdr x)))
 
-
 (provide 'elp)
 
 ;;; elp.el ends here
diff --git a/lisp/emacs-lisp/pp.el b/lisp/emacs-lisp/pp.el
index 2fd4724..0bf774d 100644
--- a/lisp/emacs-lisp/pp.el
+++ b/lisp/emacs-lisp/pp.el
@@ -139,7 +139,7 @@ Also add the value to the front of the list in the variable 
`values'."
   (pp-display-expression (macroexpand-1 expression) "*Pp Macroexpand Output*"))
 
 (defun pp-last-sexp ()
-  "Read sexp before point.  Ignores leading comment characters."
+  "Read sexp before point.  Ignore leading comment characters."
   (with-syntax-table emacs-lisp-mode-syntax-table
     (let ((pt (point)))
       (save-excursion
@@ -159,7 +159,7 @@ Also add the value to the front of the list in the variable 
`values'."
 ;;;###autoload
 (defun pp-eval-last-sexp (arg)
   "Run `pp-eval-expression' on sexp before point.
-With argument, pretty-print output into current buffer.
+With ARG, pretty-print output into current buffer.
 Ignores leading comment characters."
   (interactive "P")
   (if arg
@@ -172,7 +172,7 @@ Ignores leading comment characters."
 ;;;###autoload
 (defun pp-macroexpand-last-sexp (arg)
   "Run `pp-macroexpand-expression' on sexp before point.
-With argument, pretty-print output into current buffer.
+With ARG, pretty-print output into current buffer.
 Ignores leading comment characters."
   (interactive "P")
   (if arg
diff --git a/lisp/epa.el b/lisp/epa.el
index bbfa2c1..2698b39 100644
--- a/lisp/epa.el
+++ b/lisp/epa.el
@@ -333,7 +333,10 @@ If ARG is non-nil, mark the key."
     (insert
      (propertize
       (concat "  " (epa--button-key-text key))
-      'epa-key key))
+      'epa-key key
+      ;; Allow TAB to tab to the key.
+      'button t
+      'category t))
     (insert "\n")))
 
 (defun epa--list-keys (name secret &optional doc)
diff --git a/lisp/files.el b/lisp/files.el
index 8e8fbac..16ebe74 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -2537,21 +2537,20 @@ unless NOMODES is non-nil."
     (let* (not-serious
           (msg
            (cond
-            ((not warn) nil)
             ((and error (file-exists-p buffer-file-name))
              (setq buffer-read-only t)
              "File exists, but cannot be read")
             ((and error (file-symlink-p buffer-file-name))
              "Symbolic link that points to nonexistent file")
             ((not buffer-read-only)
-             (if (and warn
-                      ;; No need to warn if buffer is auto-saved
-                      ;; under the name of the visited file.
-                      (not (and buffer-file-name
-                                auto-save-visited-file-name))
-                      (file-newer-than-file-p (or buffer-auto-save-file-name
-                                                  (make-auto-save-file-name))
-                                              buffer-file-name))
+             (if (and
+                   ;; No need to warn if buffer is auto-saved
+                  ;; under the name of the visited file.
+                  (not (and buffer-file-name
+                            auto-save-visited-file-name))
+                  (file-newer-than-file-p (or buffer-auto-save-file-name
+                                              (make-auto-save-file-name))
+                                          buffer-file-name))
                  (format "%s has auto save data; consider M-x 
recover-this-file"
                          (file-name-nondirectory buffer-file-name))
                (setq not-serious t)
@@ -2565,7 +2564,7 @@ unless NOMODES is non-nil."
              (setq buffer-read-only nil)
              (unless (file-directory-p default-directory)
                "Use M-x make-directory RET RET to create the directory and its 
parents")))))
-      (when msg
+      (when (and warn msg)
        (message "%s" msg)
        (or not-serious (sit-for 1 t))))
     (when (and auto-save-default (not noauto))
@@ -7439,7 +7438,11 @@ only these files will be asked to be saved."
         ;; might be bound to different file name handlers, we still
         ;; need this.
         (saved-file-name-handler-alist file-name-handler-alist)
-        file-name-handler-alist
+        (inhibit-file-name-handlers
+         (cons 'file-name-non-special
+               (and (eq inhibit-file-name-operation operation)
+                    inhibit-file-name-handlers)))
+        (inhibit-file-name-operation operation)
         ;; Some operations respect file name handlers in
         ;; `default-directory'.  Because core function like
         ;; `call-process' don't care about file name handlers in
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index 8990b2b..570be49 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -136,6 +136,16 @@ will fetch all parts that have types that match that 
string.  A
 likely value would be \"text/\" to automatically fetch all
 textual parts.")
 
+(defvoo nnimap-keepalive-intervals (cons (* 60 15)
+                                         (* 60 5))
+  "Configuration for the nnimap keepalive timer.
+The value is a cons of two integers (each representing a number
+of seconds): the first is how often to run the keepalive
+function, the second is the seconds of inactivity required to
+send the actual keepalive command.
+
+Set to nil to disable keepalive commands altogether.")
+
 (defgroup nnimap nil
   "IMAP for Gnus."
   :group 'gnus)
@@ -405,15 +415,16 @@ during splitting, which may be slow."
       nil)))
 
 (defun nnimap-keepalive ()
-  (let ((now (current-time)))
+  (let ((now (current-time))
+        ;; Set this so we don't wait for a response.
+        (nnimap-streaming t))
     (dolist (buffer nnimap-process-buffers)
       (when (buffer-live-p buffer)
        (with-current-buffer buffer
          (when (and nnimap-object
                     (nnimap-last-command-time nnimap-object)
                     (time-less-p
-                     ;; More than five minutes since the last command.
-                     (* 5 60)
+                     (cdr nnimap-keepalive-intervals)
                      (time-subtract
                       now
                       (nnimap-last-command-time nnimap-object))))
@@ -448,9 +459,12 @@ during splitting, which may be slow."
     port))
 
 (defun nnimap-open-connection-1 (buffer)
-  (unless nnimap-keepalive-timer
-    (setq nnimap-keepalive-timer (run-at-time (* 60 15) (* 60 15)
-                                             #'nnimap-keepalive)))
+  (unless (or nnimap-keepalive-timer
+              (null nnimap-keepalive-intervals))
+    (setq nnimap-keepalive-timer (run-at-time
+                                  (car nnimap-keepalive-intervals)
+                                  (car nnimap-keepalive-intervals)
+                                 #'nnimap-keepalive)))
   (with-current-buffer (nnimap-make-process-buffer buffer)
     (let* ((coding-system-for-read 'binary)
           (coding-system-for-write 'binary)
diff --git a/lisp/image.el b/lisp/image.el
index 643f9dd..ee15294 100644
--- a/lisp/image.el
+++ b/lisp/image.el
@@ -875,9 +875,7 @@ do not check N is within the range of frames present in the 
image."
       (setq n (min n (1- (car (plist-get (cdr image)
                                          :animate-multi-frame-data)))))))
   (plist-put (cdr image) :index n)
-  (when-let ((window
-              (get-buffer-window (plist-get (cdr image) :animate-buffer) t)))
-    (force-window-update window)))
+  (force-window-update (plist-get (cdr image) :animate-buffer)))
 
 (defun image-animate-get-speed (image)
   "Return the speed factor for animating IMAGE."
diff --git a/lisp/jka-compr.el b/lisp/jka-compr.el
index a622364..2f98c8d 100644
--- a/lisp/jka-compr.el
+++ b/lisp/jka-compr.el
@@ -659,7 +659,7 @@ It is not recommended to set this variable permanently to 
anything but nil.")
   "Uninstall jka-compr.
 This removes the entries in `file-name-handler-alist' and `auto-mode-alist'
 and `inhibit-local-variables-suffixes' that were added
-by `jka-compr-installed'."
+by `jka-compr-install'."
   ;; Delete from inhibit-local-variables-suffixes what jka-compr-install added.
   (mapc
      (lambda (x)
diff --git a/lisp/progmodes/cc-defs.el b/lisp/progmodes/cc-defs.el
index 0229232..5d93435 100644
--- a/lisp/progmodes/cc-defs.el
+++ b/lisp/progmodes/cc-defs.el
@@ -1653,8 +1653,7 @@ with value CHAR in the region [FROM to)."
   ;; determined by and angle bracket; or (ii) is inside a macro whose start
   ;; isn't POINT-MACRO-START doesn't count as a finishing position.
   (declare (debug t))
-  `(let ((here (point))
-        (pos (scan-lists ,from 1 1)))
+  `(let ((pos (scan-lists ,from 1 1)))
      (while (eq (char-before pos) ?>)
        (setq pos (scan-lists pos 1 1)))
      pos))
@@ -1664,8 +1663,7 @@ with value CHAR in the region [FROM to)."
   ;; determined by an angle bracket; or (ii) is inside a macro whose start
   ;; isn't POINT-MACRO-START doesn't count as a finishing position.
   (declare (debug t))
-  `(let ((here (point))
-        (pos (scan-lists ,from 1 -1)))
+  `(let ((pos (scan-lists ,from 1 -1)))
      (while (eq (char-before pos) ?<)
        (setq pos (scan-lists pos 1 1))
        (setq pos (scan-lists pos 1 -1)))
@@ -1676,8 +1674,7 @@ with value CHAR in the region [FROM to)."
   ;; determined by and angle bracket; or (ii) is inside a macro whose start
   ;; isn't POINT-MACRO-START doesn't count as a finishing position.
   (declare (debug t))
-  `(let ((here (point))
-        (pos (scan-lists ,from -1 1)))
+  `(let ((pos (scan-lists ,from -1 1)))
      (while (eq (char-after pos) ?<)
        (setq pos (scan-lists pos -1 1)))
      pos))
@@ -1687,8 +1684,7 @@ with value CHAR in the region [FROM to)."
   ;; determined by and angle bracket; or (ii) is inside a macro whose start
   ;; isn't POINT-MACRO-START doesn't count as a finishing position.
   (declare (debug t))
-  `(let ((here (point))
-        (pos (scan-lists ,from -1 -1)))
+  `(let ((pos (scan-lists ,from -1 -1)))
      (while (eq (char-after pos) ?>)
        (setq pos (scan-lists pos -1 1))
        (setq pos (scan-lists pos -1 -1)))
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index d47d9d7..3382713 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -1120,11 +1120,14 @@ current project, it will be killed."
 
 (defun project--buffer-list (pr)
   "Return the list of all buffers in project PR."
-  (let (bufs)
+  (let ((remote-project-p (file-remote-p (project-root pr)))
+        bufs)
     (dolist (buf (buffer-list))
-      (when (equal pr
-                   (with-current-buffer buf
-                     (project-current)))
+      (when (and (let ((remote (file-remote-p (buffer-local-value 
'default-directory buf))))
+                   (if remote-project-p remote (not remote)))
+                 (equal pr
+                        (with-current-buffer buf
+                          (project-current))))
         (push buf bufs)))
     (nreverse bufs)))
 
diff --git a/src/buffer.c b/src/buffer.c
index 9e417bf..df302db 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -5673,9 +5673,12 @@ Linefeed indents to this column in Fundamental mode.  
*/);
   DEFVAR_PER_BUFFER ("tab-width", &BVAR (current_buffer, tab_width),
                     Qintegerp,
                     doc: /* Distance between tab stops (for display of tab 
characters), in columns.
-NOTE: This controls the display width of a TAB character, and not
-the size of an indentation step.
-This should be an integer greater than zero.  */);
+This controls the width of a TAB character on display.
+The value should be a positive integer.
+Note that this variable doesn't necessarily affect the size of the
+indentation step.  However, if the major mode's indentation facility
+inserts one or more TAB characters, this variable will affect the
+indentation step as well, even if `indent-tabs-mode' is non-nil.  */);
 
   DEFVAR_PER_BUFFER ("ctl-arrow", &BVAR (current_buffer, ctl_arrow), Qnil,
                     doc: /* Non-nil means display control chars with uparrow.
diff --git a/src/callproc.c b/src/callproc.c
index 5aa2cba..e44e243 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -276,6 +276,9 @@ usage: (call-process PROGRAM &optional INFILE DESTINATION 
DISPLAY &rest ARGS)  *
   else
     infile = build_string (NULL_DEVICE);
 
+  /* Remove "/:" from INFILE.  */
+  infile = remove_slash_colon (infile);
+
   encoded_infile = ENCODE_FILE (infile);
 
   filefd = emacs_open (SSDATA (encoded_infile), O_RDONLY, 0);
@@ -439,9 +442,15 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int 
filefd,
   current_dir = encode_current_directory ();
 
   if (STRINGP (error_file))
-    error_file = ENCODE_FILE (error_file);
+    {
+      error_file = remove_slash_colon (error_file);
+      error_file = ENCODE_FILE (error_file);
+    }
   if (STRINGP (output_file))
-    output_file = ENCODE_FILE (output_file);
+    {
+      output_file = remove_slash_colon (output_file);
+      output_file = ENCODE_FILE (output_file);
+    }
 
   display_p = INTERACTIVE && nargs >= 4 && !NILP (args[3]);
 
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 81033b2..7760c8e 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -93,8 +93,6 @@ typedef struct pgtk_output xp_output;
   gtk_font_selection_dialog_set_font_name (x, y)
 #endif
 
-#define gdk_window_get_geometry(w, a, b, c, d) \
-  gdk_window_get_geometry (w, a, b, c, d, 0)
 #define gtk_box_new(ori, spacing)                                       \
   ((ori) == GTK_ORIENTATION_HORIZONTAL                                  \
    ? gtk_hbox_new (FALSE, (spacing)) : gtk_vbox_new (FALSE, (spacing)))
diff --git a/src/indent.c b/src/indent.c
index 6246b54..de6b489 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -1967,9 +1967,13 @@ line_number_display_width (struct window *w, int *width, 
int *pixel_width)
       struct it it;
       struct text_pos startpos;
       bool saved_restriction = false;
+      struct buffer *old_buf = current_buffer;
       ptrdiff_t count = SPECPDL_INDEX ();
       SET_TEXT_POS_FROM_MARKER (startpos, w->start);
       void *itdata = bidi_shelve_cache ();
+
+      /* Make sure W's buffer is the current one.  */
+      set_buffer_internal_1 (XBUFFER (w->contents));
       /* We want to start from window's start point, but it could be
         outside the accessible region, in which case we widen the
         buffer temporarily.  It could even be beyond the buffer's end
@@ -1998,6 +2002,7 @@ line_number_display_width (struct window *w, int *width, 
int *pixel_width)
       *pixel_width = it.lnum_pixel_width;
       if (saved_restriction)
        unbind_to (count, Qnil);
+      set_buffer_internal_1 (old_buf);
       bidi_unshelve_cache (itdata, 0);
     }
 }
diff --git a/src/nsterm.m b/src/nsterm.m
index 6e7ab12..bb20886 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -7303,16 +7303,34 @@ not_in_argv (NSString *arg)
 
   NSTRACE ("[EmacsView viewDidResize]");
 
+#ifdef NS_DRAW_TO_BUFFER
+  /* If the buffer size doesn't match the view's backing size, destroy
+     the buffer and let it be recreated at the correct size later.  */
+  if ([self wantsUpdateLayer] && surface)
+    {
+      NSRect surfaceRect = {{0, 0}, [surface getSize]};
+      NSRect frameRect = [[self window] convertRectToBacking:frame];
+
+      if (!NSEqualRects (frameRect, surfaceRect))
+        {
+          [surface release];
+          surface = nil;
+
+          [self setNeedsDisplay:YES];
+        }
+    }
+#endif
+
   neww = (int)NSWidth (frame);
   newh = (int)NSHeight (frame);
   oldw = FRAME_PIXEL_WIDTH (emacsframe);
   oldh = FRAME_PIXEL_HEIGHT (emacsframe);
 
   /* Don't want to do anything when the view size hasn't changed. */
-  if ((oldh == newh && oldw == neww)
-      || (emacsframe->new_size_p
-          && newh == emacsframe->new_height
-          && neww == emacsframe->new_width))
+  if (emacsframe->new_size_p
+      ? (newh == emacsframe->new_height
+         && neww == emacsframe->new_width)
+      : (oldh == newh && oldw == neww))
     {
       NSTRACE_MSG ("No change");
       return;
@@ -7321,16 +7339,6 @@ not_in_argv (NSString *arg)
   NSTRACE_SIZE ("New size", NSMakeSize (neww, newh));
   NSTRACE_SIZE ("Original size", NSMakeSize (oldw, oldh));
 
-#ifdef NS_DRAW_TO_BUFFER
-  if ([self wantsUpdateLayer])
-    {
-      [surface release];
-      surface = nil;
-
-      [self setNeedsDisplay:YES];
-    }
-#endif
-
   change_frame_size (emacsframe, neww, newh, false, YES, false);
 
   SET_FRAME_GARBAGED (emacsframe);
diff --git a/src/verbose.mk.in b/src/verbose.mk.in
index 085a05a..50d6ea3 100644
--- a/src/verbose.mk.in
+++ b/src/verbose.mk.in
@@ -38,7 +38,7 @@ ifeq ($(HAVE_NATIVE_COMP),yes)
 ifeq ($(NATIVE_DISABLED),1)
 AM_V_ELC = @echo "  ELC     " $@;
 else
-AM_V_ELC = @echo "  ELC+ELN     " $@;
+AM_V_ELC = @echo "  ELC+ELN " $@;
 endif
 else
 AM_V_ELC = @echo "  ELC     " $@;
diff --git a/src/xfns.c b/src/xfns.c
index 2c95065..782e0a4 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -1608,13 +1608,15 @@ x_set_menu_bar_lines (struct frame *f, Lisp_Object 
value, Lisp_Object oldval)
 
 /* Set the number of lines used for the tab bar of frame F to VALUE.
    VALUE not an integer, or < 0 means set the lines to zero.  OLDVAL
-   is the old number of tab bar lines.  This function changes the
+   is the old number of tab bar lines.  This function may change the
    height of all windows on frame F to match the new tab bar height.
-   The frame's height doesn't change.  */
+   The frame's height may change if frame_inhibit_implied_resize was
+   set accordingly.  */
 
 static void
 x_set_tab_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
 {
+  int olines = FRAME_TAB_BAR_LINES (f);
   int nlines;
 
   /* Treat tab bars like menu bars.  */
@@ -1627,7 +1629,8 @@ x_set_tab_bar_lines (struct frame *f, Lisp_Object value, 
Lisp_Object oldval)
   else
     nlines = 0;
 
-  x_change_tab_bar_height (f, nlines * FRAME_LINE_HEIGHT (f));
+  if (nlines != olines && (olines == 0 || nlines == 0))
+    x_change_tab_bar_height (f, nlines * FRAME_LINE_HEIGHT (f));
 }
 
 
diff --git a/src/xterm.c b/src/xterm.c
index 189e3a4..9edaed9 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -8178,6 +8178,12 @@ handle_one_xevent (struct x_display_info *dpyinfo,
 
              f->output_data.x->has_been_visible = true;
              inev.ie.kind = DEICONIFY_EVENT;
+#if defined USE_GTK && defined HAVE_GTK3
+             /* If GTK3 wants to impose some old size here (Bug#24526),
+                tell it that the current size is what we want.  */
+             xg_frame_set_char_size
+               (f, FRAME_PIXEL_WIDTH (f), FRAME_PIXEL_HEIGHT (f));
+#endif
              XSETFRAME (inev.ie.frame_or_window, f);
            }
          else if (!not_hidden && !FRAME_ICONIFIED_P (f))
@@ -8232,33 +8238,36 @@ handle_one_xevent (struct x_display_info *dpyinfo,
           if (!FRAME_VISIBLE_P (f))
             {
               block_input ();
-              SET_FRAME_VISIBLE (f, 1);
-              SET_FRAME_ICONIFIED (f, false);
-              if (FRAME_X_DOUBLE_BUFFERED_P (f))
+             /* The following two are commented out to avoid that a
+                plain invisible frame gets reported as iconified.  That
+                problem occurred first for Emacs 26 and is described in
+                
https://lists.gnu.org/archive/html/emacs-devel/2017-02/msg00133.html.  */
+/**          SET_FRAME_VISIBLE (f, 1); **/
+/**          SET_FRAME_ICONIFIED (f, false); **/
+
+             if (FRAME_X_DOUBLE_BUFFERED_P (f))
                 font_drop_xrender_surfaces (f);
               f->output_data.x->has_been_visible = true;
               SET_FRAME_GARBAGED (f);
               unblock_input ();
             }
           else if (FRAME_GARBAGED_P (f))
-            {
+           {
 #ifdef USE_GTK
-              /* Go around the back buffer and manually clear the
-                 window the first time we show it.  This way, we avoid
-                 showing users the sanity-defying horror of whatever
-                 GtkWindow is rendering beneath us.  We've garbaged
-                 the frame, so we'll redraw the whole thing on next
-                 redisplay anyway.  Yuck.  */
-              x_clear_area1 (
-                FRAME_X_DISPLAY (f),
-                FRAME_X_WINDOW (f),
-                event->xexpose.x, event->xexpose.y,
-                event->xexpose.width, event->xexpose.height,
-                0);
+             /* Go around the back buffer and manually clear the
+                window the first time we show it.  This way, we avoid
+                showing users the sanity-defying horror of whatever
+                GtkWindow is rendering beneath us.  We've garbaged
+                the frame, so we'll redraw the whole thing on next
+                redisplay anyway.  Yuck.  */
+             x_clear_area1 (FRAME_X_DISPLAY (f),
+                            FRAME_X_WINDOW (f),
+                            event->xexpose.x, event->xexpose.y,
+                            event->xexpose.width, event->xexpose.height,
+                            0);
              x_clear_under_internal_border (f);
 #endif
-            }
-
+           }
 
           if (!FRAME_GARBAGED_P (f))
             {
@@ -8351,7 +8360,8 @@ handle_one_xevent (struct x_display_info *dpyinfo,
                            the frame was deleted.  */
         {
          bool visible = FRAME_VISIBLE_P (f);
-          /* While a frame is unmapped, display generation is
+
+         /* While a frame is unmapped, display generation is
              disabled; you don't want to spend time updating a
              display that won't ever be seen.  */
           SET_FRAME_VISIBLE (f, 0);
@@ -8426,11 +8436,20 @@ handle_one_xevent (struct x_display_info *dpyinfo,
                x_set_z_group (f, Qbelow, Qnil);
            }
 
-          SET_FRAME_VISIBLE (f, 1);
-          SET_FRAME_ICONIFIED (f, false);
-          f->output_data.x->has_been_visible = true;
+         if (not_hidden)
+           {
+             SET_FRAME_VISIBLE (f, 1);
+             SET_FRAME_ICONIFIED (f, false);
+#if defined USE_GTK && defined HAVE_GTK3
+             /* If GTK3 wants to impose some old size here (Bug#24526),
+                tell it that the current size is what we want.  */
+             xg_frame_set_char_size
+               (f, FRAME_PIXEL_WIDTH (f), FRAME_PIXEL_HEIGHT (f));
+#endif
+             f->output_data.x->has_been_visible = true;
+           }
 
-          if (iconified)
+          if (not_hidden && iconified)
             {
               inev.ie.kind = DEICONIFY_EVENT;
               XSETFRAME (inev.ie.frame_or_window, f);
@@ -8808,10 +8827,16 @@ handle_one_xevent (struct x_display_info *dpyinfo,
       goto OTHER;
 
     case FocusIn:
+#ifndef USE_GTK
       /* Some WMs (e.g. Mutter in Gnome Shell), don't unmap
          minimized/iconified windows; thus, for those WMs we won't get
          a MapNotify when unminimizing/deconifying.  Check here if we
-         are deconizing a window (Bug42655). */
+         are deiconizing a window (Bug42655).
+
+        But don't do that on GTK since it may cause a plain invisible
+        frame get reported as iconified, compare
+        https://lists.gnu.org/archive/html/emacs-devel/2017-02/msg00133.html.
+        That is fixed above but bites us here again.  */
       f = any;
       if (f && FRAME_ICONIFIED_P (f))
        {
@@ -8821,6 +8846,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
           inev.ie.kind = DEICONIFY_EVENT;
           XSETFRAME (inev.ie.frame_or_window, f);
         }
+#endif /* USE_GTK */
 
       x_detect_focus_change (dpyinfo, any, event, &inev.ie);
       goto OTHER;
@@ -11823,12 +11849,14 @@ x_make_frame_visible (struct frame *f)
     poll_suppress_count = old_poll_suppress_count;
 #endif
 
-    if (CONSP (frame_size_history))
-      frame_size_history_plain
-       (f, build_string ("x_make_frame_visible"));
+    if (!FRAME_VISIBLE_P (f))
+      {
+       if (CONSP (frame_size_history))
+         frame_size_history_plain
+           (f, build_string ("x_make_frame_visible"));
 
-    if (! FRAME_VISIBLE_P (f))
-      x_wait_for_event (f, MapNotify);
+       x_wait_for_event (f, MapNotify);
+      }
   }
 }
 
diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el
index 3371657..921e2c8 100644
--- a/test/lisp/files-tests.el
+++ b/test/lisp/files-tests.el
@@ -302,12 +302,15 @@ be $HOME."
                     (file-name-unquote temporary-file-directory))))))
 
 (ert-deftest files-tests-file-name-non-special--subprocess ()
-  "Check that Bug#25949 is fixed."
-  (skip-unless (executable-find "true"))
-  (let ((default-directory (file-name-quote temporary-file-directory)))
-    (should (zerop (process-file "true")))
-    (should (processp (start-file-process "foo" nil "true")))
-    (should (zerop (shell-command "true")))))
+  "Check that Bug#25949 and Bug#48177 are fixed."
+  (skip-unless (and (executable-find "true") (file-exists-p null-device)))
+  (let ((default-directory (file-name-quote temporary-file-directory))
+        (true (file-name-quote (executable-find "true")))
+        (null (file-name-quote null-device)))
+    (should (zerop (process-file true null `((:file ,null) ,null))))
+    (should (processp (start-file-process "foo" nil true)))
+    (should (zerop (shell-command true)))
+    (should (processp (make-process :name "foo" :command `(,true))))))
 
 (defmacro files-tests--with-advice (symbol where function &rest body)
   (declare (indent 3))
@@ -715,9 +718,8 @@ unquoted file names."
           (file (file-name-nondirectory tmpfile))
           (nospecial-file (file-name-nondirectory nospecial)))
       (should-not (string-equal file nospecial-file))
-      (should-not (equal (file-name-all-completions
-                          nospecial-file nospecial-tempdir)
-                         (file-name-all-completions file tmpdir)))
+      (should (equal (file-name-all-completions nospecial-file 
nospecial-tempdir)
+                     (file-name-all-completions file tmpdir)))
       (should (equal (file-name-all-completions file nospecial-tempdir)
                      (file-name-all-completions file tmpdir)))
       (should (equal (file-name-all-completions nospecial-file tmpdir)
@@ -759,8 +761,8 @@ unquoted file names."
           (file (file-name-nondirectory tmpfile))
           (nospecial-file (file-name-nondirectory nospecial)))
       (should-not (string-equal file nospecial-file))
-      (should-not (equal (file-name-completion nospecial-file 
nospecial-tempdir)
-                         (file-name-completion file tmpdir)))
+      (should (equal (file-name-completion nospecial-file nospecial-tempdir)
+                     (file-name-completion file tmpdir)))
       (should (equal (file-name-completion file nospecial-tempdir)
                      (file-name-completion file tmpdir)))
       (should (equal (file-name-completion nospecial-file tmpdir)



reply via email to

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