emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master d0f910c 3/3: Merge from origin/emacs-26


From: Paul Eggert
Subject: [Emacs-diffs] master d0f910c 3/3: Merge from origin/emacs-26
Date: Thu, 12 Oct 2017 16:50:57 -0400 (EDT)

branch: master
commit d0f910cbf862db2a89d56e6414c93a93e46e202b
Merge: a346d5b 59b5dc6
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    Merge from origin/emacs-26
    
    59b5dc60d6 Fix this-command-keys for "M-x foo" commands
    2f4bd2fbda Let rename-file rename dirs across filesystems
    413978727c Simplify Flymake user documentation
    6ff18c3995 * etc/NEWS: Mention the new version of Org.
    b78332c3c6 Don't use (format "%s" ...) for string copying (Bug#28774)
    078fb7f6df Make frame-list-z-order on NS match Windows behaviour (bug...
    
    # Conflicts:
    #   etc/NEWS
---
 doc/misc/flymake.texi     | 166 ++++++++++++++++------------------------------
 lisp/ido.el               |   2 +-
 lisp/progmodes/flymake.el |  31 ++++-----
 src/fileio.c              |  14 +++-
 src/keyboard.c            |  15 ++++-
 src/nsfns.m               |  11 +--
 6 files changed, 101 insertions(+), 138 deletions(-)

diff --git a/doc/misc/flymake.texi b/doc/misc/flymake.texi
index d89a555..05d879d 100644
--- a/doc/misc/flymake.texi
+++ b/doc/misc/flymake.texi
@@ -52,8 +52,6 @@ modify this GNU manual.''
 @end ifnottex
 
 @menu
-* Overview of Flymake::
-* Installing Flymake::
 * Using Flymake::
 * Extending Flymake::
 * The legacy Proc backend::
@@ -61,50 +59,57 @@ modify this GNU manual.''
 * Index::
 @end menu
 
address@hidden Overview of Flymake
address@hidden Overview
address@hidden Using Flymake
address@hidden Using Flymake
 @cindex overview of flymake
address@hidden using flymake
 
 Flymake is a universal on-the-fly buffer checker implemented as an
-Emacs minor mode.  When enabled, Flymake visually annotates the buffer
-with diagnostic information coming from one or more different sources,
-or @dfn{backends}.
+Emacs minor minor.  To use Flymake, you must first activate
address@hidden by using the command @kbd{flymake-mode}.
 
-Flymake annotates the buffer by highlighting problematic buffer
-regions with a special space.  It displays an overall buffer status in
-the mode line containing totals for different types of diagnostics.
-
address@hidden and @code{flymake-goto-prev-error} are
-commands that allow easy navigation to the next/previous erroneous
-line, respectively.  If might be a good idea to map them to @kbd{M-n}
-and @kbd{M-p} in @code{flymake-mode}, by adding to your init file:
+When enabled, Flymake collects information about problems in the
+buffer, called @dfn{diagnostics}, from one or more different sources,
+or @dfn{backends}, and then visually annotates the buffer by
+highlighting problematic buffer regions with a special face.
 
address@hidden
-(define-key flymake-mode-map (kbd "M-n") 'flymake-goto-next-error)
-(define-key flymake-mode-map (kbd "M-p") 'flymake-goto-prev-error)
address@hidden lisp
+It also displays an overall buffer status in the mode line containing
+totals for different types of diagnostics.
 
 Syntax check is done ``on-the-fly''.  It is started whenever
 
 @itemize @bullet
 @item
 @code{flymake-mode} is started, unless
address@hidden is nil.
address@hidden is nil;
 
 @item
 a newline character is added to the buffer, unless
address@hidden is nil.
address@hidden is nil;
 
 @item
 some changes were made to the buffer more than @code{0.5} seconds ago
 (the delay is configurable in @code{flymake-no-changes-timeout}).
 @end itemize
 
+Syntax check can also be started manually by typing the @kbd{M-x
+flymake-start @key{RET}} command.
+
address@hidden and @code{flymake-goto-prev-error} are
+commands that allow easy navigation to the next/previous erroneous
+line, respectively.  If might be a good idea to map them to @kbd{M-n}
+and @kbd{M-p} in @code{flymake-mode}, by adding to your init file:
+
address@hidden
+(define-key flymake-mode-map (kbd "M-n") 'flymake-goto-next-error)
+(define-key flymake-mode-map (kbd "M-p") 'flymake-goto-prev-error)
address@hidden lisp
+
 Flymake is a universal syntax checker in the sense that it's easily
 extended to support new backends (@pxref{Extending Flymake}).
 
-Historically, Flymake used to accept diagnostics from a single, albeit
-reasonably flexible, backend.
+Historically, Flymake used to accept diagnostics from a single
+backend, albeit a reasonably flexible one.
 
 This backend isn't (yet) obsolete, and so is still available as a
 fallback and active by default (@pxref{The legacy Proc backend}).  It works by
@@ -114,105 +119,45 @@ background, passing it a temporary file which is a copy 
of the current
 buffer, and parsing the output for known error/warning message
 patterns.
 
address@hidden Installing Flymake
address@hidden Installing
address@hidden installing flymake
-
-Flymake is included with Emacs and its main commands, like
address@hidden, are autoloaded.  This means there is usually
-nothing to do by way of installation.
-
address@hidden Using Flymake
address@hidden Using Flymake
address@hidden using flymake
-
 @menu
-* Flymake mode::
-* Running the syntax check::
-* Navigating to error lines::   @c * Viewing error messages::
 * Syntax check statuses::
 * Backend exceptions::
 * Customizable variables::
 @end menu
 
address@hidden Flymake mode
address@hidden Flymake mode
address@hidden flymake-mode
address@hidden activating flymake-mode
-
-Flymake is an Emacs minor mode.  To use Flymake, you
-must first activate @code{flymake-mode} by using the command
address@hidden
-
-Instead of manually activating @code{flymake-mode}, you can configure
-Emacs to automatically enable @code{flymake-mode} upon opening any
-file for which syntax check is possible.  To do so, place the following
-line in your @file{~/.emacs}:
-
address@hidden
-(add-hook 'find-file-hook 'flymake-find-file-hook)
address@hidden lisp
-
address@hidden Running the syntax check
address@hidden Running the syntax check
address@hidden manually starting syntax check
address@hidden syntax check, start manually
-
address@hidden flymake-start
-When @code{flymake-mode} is active, syntax check is started
-automatically on any of the three conditions mentioned in
address@hidden of Flymake}.  Syntax check can also be started manually
-by typing the @kbd{M-x flymake-start @key{RET}} command.
-
address@hidden Navigating to error lines
address@hidden Navigating to error lines
address@hidden navigating to error lines
-
-After syntax check is completed, lines for which at least one error or
-warning has been reported are highlighted, and the total number of errors
-and warning is shown in the mode line.  Use the following functions to
-navigate the highlighted lines:
-
address@hidden @code
address@hidden flymake-goto-next-error
address@hidden flymake-goto-next-error
-Moves point to the next erroneous line, if any.
-
address@hidden flymake-goto-prev-error
address@hidden flymake-goto-prev-error
-Moves point to the previous erroneous line.
address@hidden table
-
-If the user option @code{flymake-wrap-around} is active
-(@pxref{Customizable variables}), these functions treat diagnostics
-as a linked list.  Therefore, @code{flymake-goto-next-error} will go
-to the first diagnostic when invoked in the end of the buffer.
-
 @node Syntax check statuses
 @section Syntax check statuses
 @cindex Syntax check statuses
 
-While enabled, Flymake displays its status in the mode line.
+When enabled, Flymake displays its status in the mode line, which
+provides a visual summary of diagnostic collection.  It may also hint
+at certain exceptional situations encountered when communicating with
+backends.
+
 The following statuses are defined:
 
 @multitable @columnfractions 0.25 0.75
address@hidden address@hidden @var{nwarnings} ...]
address@hidden Normal operation. @var{nerrors} and @var{nwarnings} are, 
respectively,
+the total number of errors and warnings found during the last buffer
+check, for all backends. They may be followed by other totals for
+other types of diagnostics (@pxref{Flymake error types}).
+
 @item @code{Wait}
address@hidden  Some flymake backends haven't reported since the last time they
-where questioned.
address@hidden  Some Flymake backends haven't reported since the last time they
+where questioned.  It is reasonable to assume that this is a temporary
+delay and Flymake will resume normal operation soon.
 
 @item @code{!}
address@hidden All the configured Flymake backends have disabled themselves.
-Left-clicking Flymake's mode line indicator pops up a menu listing the
-option to visit Flymake's log buffer.  In this buffer these situations
-can be investigated.
address@hidden All the configured Flymake backends have disabled themselves: 
Flymake
+cannot annotate the buffer and action from the user is needed to
+investigate and remedy the situation (@pxref{Backend exceptions}).
 
 @item @code{?}
address@hidden There are no configured Flymake backends in
address@hidden
address@hidden There are no applicable Flymake backends for this buffer, thus 
Flymake
+cannot annotate it.  To fix this, a user may look to extending Flymake
+and add a new backend (@pxref{Extending Flymake}).
 
address@hidden @emph{[nerrors nwarnings]}
address@hidden Normal operation, number of errors/warnings found by the syntax
-check process.
 @end multitable
 
 @node Backend exceptions
@@ -223,8 +168,9 @@ check process.
 @cindex backends, disabled
 Some backends may take longer than others to respond or complete, and
 some may decide to @emph{disable} themselves if they are not suitable
-for the current buffer.  A disabled backend is not tried again for
-future checks of the current buffer.
+for the current buffer or encounter some unavoidable problem.  A
+disabled backend is not tried again for future checks of the current
+buffer.
 
 @findex flymake-reporting-backends
 @findex flymake-running-backends
@@ -240,10 +186,12 @@ disabled backend list, so that they will be tried again 
in the next check.
 
 @cindex logging
 @cindex flymake logging
-Flymake also uses a simple logging facility for indicating important points
-in the control flow.  The logging facility sends logging messages to
-the @file{*Flymake log*} buffer.  The information logged can be used for
-resolving various problems related to Flymake.
+Flymake also uses a simple logging facility for indicating important
+points in the control flow.  The logging facility sends logging
+messages to the @file{*Flymake log*} buffer.  The information logged
+can be used for resolving various problems related to Flymake.  For
+convenience, a shortcut to this buffer can be found in Flymake's menu,
+accessible from the top menu bar or just left of the status indicator.
 
 @vindex warning-minimum-log-level
 @vindex warning-minimum-level
diff --git a/lisp/ido.el b/lisp/ido.el
index 47cbcb6..4f1e36b 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -4701,7 +4701,7 @@ Modified from `icomplete-completions'."
     (if (and ido-use-faces comps)
        (let* ((fn (ido-name (car comps)))
               (ln (length fn)))
-         (setq first (format "%s" fn))
+         (setq first (copy-sequence fn))
          (put-text-property 0 ln 'face
                             (if (= (length comps) 1)
                                  (if ido-incomplete-regexp
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index e4c6a38..8c9c4b2 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -878,11 +878,11 @@ Do it only if `flymake-no-changes-timeout' is non-nil."
     (flymake-log :warning "Turned on in `flymake-find-file-hook'")))
 
 (defun flymake-goto-next-error (&optional n filter interactive)
-  "Go to Nth next Flymake error in buffer matching FILTER.
-Interactively, always move to the next error.  With a prefix arg,
-skip any diagnostics with a severity less than `:warning'.
+  "Go to Nth next Flymake diagnostic that matches FILTER.
+Interactively, always move to the next diagnostic.  With a prefix
+arg, skip any diagnostics with a severity less than `:warning'.
 
-If `flymake-wrap-around' is non-nil and no more next errors,
+If `flymake-wrap-around' is non-nil and no more next diagnostics,
 resumes search from top.
 
 FILTER is a list of diagnostic types found in
@@ -933,12 +933,13 @@ applied."
                          ""))))))
 
 (defun flymake-goto-prev-error (&optional n filter interactive)
-  "Go to Nth previous Flymake error in buffer matching FILTER.
-Interactively, always move to the previous error.  With a prefix
-arg, skip any diagnostics with a severity less than `:warning'.
+  "Go to Nth previous Flymake diagnostic that matches FILTER.
+Interactively, always move to the previous diagnostic.  With a
+prefix arg, skip any diagnostics with a severity less than
+`:warning'.
 
-If `flymake-wrap-around' is non-nil and no more previous errors,
-resumes search from bottom.
+If `flymake-wrap-around' is non-nil and no more previous
+diagnostics, resumes search from bottom.
 
 FILTER is a list of diagnostic types found in
 `flymake-diagnostic-types-alist', or nil, if no filter is to be
@@ -953,13 +954,13 @@ applied."
 ;;;
 (easy-menu-define flymake-menu flymake-mode-map "Flymake"
   `("Flymake"
-    [ "Go to next error"      flymake-goto-next-error t ]
-    [ "Go to previous error"  flymake-goto-prev-error t ]
-    [ "Check now"             flymake-start t ]
-    [ "Go to log buffer"      flymake-switch-to-log-buffer t ]
-    [ "Show error buffer"     flymake-show-diagnostics-buffer t ]
+    [ "Go to next problem"      flymake-goto-next-error t ]
+    [ "Go to previous problem"  flymake-goto-prev-error t ]
+    [ "Check now"               flymake-start t ]
+    [ "List all problems"       flymake-show-diagnostics-buffer t ]
     "--"
-    [ "Turn off Flymake"      flymake-mode t ]))
+    [ "Go to log buffer"        flymake-switch-to-log-buffer t ]
+    [ "Turn off Flymake"        flymake-mode t ]))
 
 (defvar flymake--mode-line-format `(:eval (flymake--mode-line-format)))
 
diff --git a/src/fileio.c b/src/fileio.c
index d8ecccd..ca21b0a 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -2261,7 +2261,7 @@ This is what happens in interactive use with M-x.  */)
   (Lisp_Object file, Lisp_Object newname, Lisp_Object ok_if_already_exists)
 {
   Lisp_Object handler;
-  Lisp_Object encoded_file, encoded_newname, symlink_target;
+  Lisp_Object encoded_file, encoded_newname;
 
   file = Fexpand_file_name (file, Qnil);
 
@@ -2335,12 +2335,22 @@ This is what happens in interactive use with M-x.  */)
   if (rename_errno != EXDEV)
     report_file_errno ("Renaming", list2 (file, newname), rename_errno);
 
+  struct stat file_st;
   bool dirp = !NILP (Fdirectory_name_p (file));
+  if (!dirp)
+    {
+      if (lstat (SSDATA (encoded_file), &file_st) != 0)
+       report_file_error ("Renaming", list2 (file, newname));
+      dirp = S_ISDIR (file_st.st_mode) != 0;
+    }
   if (dirp)
     call4 (Qcopy_directory, file, newname, Qt, Qnil);
   else
     {
-      symlink_target = Ffile_symlink_p (file);
+      Lisp_Object symlink_target
+       = (S_ISLNK (file_st.st_mode)
+          ? emacs_readlinkat (AT_FDCWD, SSDATA (encoded_file))
+          : Qnil);
       if (!NILP (symlink_target))
        Fmake_symbolic_link (symlink_target, newname, ok_if_already_exists);
       else
diff --git a/src/keyboard.c b/src/keyboard.c
index ee353d2..7ddd6b9 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -10055,7 +10055,12 @@ Internal use only.  */)
 
   this_command_key_count = 0;
   this_single_command_key_start = 0;
-  int key0 = SREF (keys, 0);
+
+  int charidx = 0, byteidx = 0;
+  int key0;
+  FETCH_STRING_CHAR_ADVANCE (key0, keys, charidx, byteidx);
+  if (CHAR_BYTE8_P (key0))
+    key0 = CHAR_TO_BYTE8 (key0);
 
   /* Kludge alert: this makes M-x be in the form expected by
      novice.el.  (248 is \370, a.k.a. "Meta-x".)  Any better ideas?  */
@@ -10064,7 +10069,13 @@ Internal use only.  */)
   else
     add_command_key (make_number (key0));
   for (ptrdiff_t i = 1; i < SCHARS (keys); i++)
-    add_command_key (make_number (SREF (keys, i)));
+    {
+      int key_i;
+      FETCH_STRING_CHAR_ADVANCE (key_i, keys, charidx, byteidx);
+      if (CHAR_BYTE8_P (key_i))
+       key_i = CHAR_TO_BYTE8 (key_i);
+      add_command_key (make_number (key_i));
+    }
   return Qnil;
 }
 
diff --git a/src/nsfns.m b/src/nsfns.m
index ba36362..c8a41f5 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -1476,13 +1476,8 @@ ns_window_is_ancestor (NSWindow *win, NSWindow 
*candidate)
 DEFUN ("ns-frame-list-z-order", Fns_frame_list_z_order,
        Sns_frame_list_z_order, 0, 1, 0,
        doc: /* Return list of Emacs' frames, in Z (stacking) order.
-The optional argument TERMINAL specifies which display to ask about.
-TERMINAL should be either a frame or a display name (a string).  If
-omitted or nil, that stands for the selected frame's display.  Return
-nil if TERMINAL contains no Emacs frame.
-
-As a special case, if TERMINAL is non-nil and specifies a live frame,
-return the child frames of that frame in Z (stacking) order.
+If TERMINAL is non-nil and specifies a live frame, return the child
+frames of that frame in Z (stacking) order.
 
 Frames are listed from topmost (first) to bottommost (last).  */)
   (Lisp_Object terminal)
@@ -1492,8 +1487,6 @@ Frames are listed from topmost (first) to bottommost 
(last).  */)
 
   if (FRAMEP (terminal) && FRAME_LIVE_P (XFRAME (terminal)))
     parent = [FRAME_NS_VIEW (XFRAME (terminal)) window];
-  else if (!NILP (terminal))
-    return Qnil;
 
   for (NSWindow *win in [[NSApp orderedWindows] reverseObjectEnumerator])
     {



reply via email to

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