emacs-diffs
[Top][All Lists]
Advanced

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

master 62d7ddb: Merge from origin/emacs-28


From: Stefan Kangas
Subject: master 62d7ddb: Merge from origin/emacs-28
Date: Fri, 26 Nov 2021 01:17:26 -0500 (EST)

branch: master
commit 62d7ddb57c3db8f1e5cb20c6d82566b644faaa8c
Merge: 09c28ca cfaf681
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>

    Merge from origin/emacs-28
    
    cfaf681d3d ; * src/emacs.c (main): Add commentary about command-line ...
    4d16a2f737 Fix pdf generation with Texinfo 6.7
    a22c9a34bd Fix 'posn-at-point' near some overlays
    d1aa552d11 ; * CONTRIBUTE: No cleanups on release branches, even in d...
    588caf0b27 * lisp/repeat.el (repeat-post-hook): Add check symbolp rep...
---
 CONTRIBUTE               |  4 +++-
 doc/lispref/display.texi |  4 ++--
 lisp/repeat.el           |  2 +-
 src/emacs.c              | 33 +++++++++++++++++++++++++++++++++
 src/xdisp.c              | 20 ++++++++++++++++++--
 5 files changed, 57 insertions(+), 6 deletions(-)

diff --git a/CONTRIBUTE b/CONTRIBUTE
index 8295a8e..5740004 100644
--- a/CONTRIBUTE
+++ b/CONTRIBUTE
@@ -342,7 +342,9 @@ Documentation fixes (in doc strings, in manuals, in NEWS, 
and in
 comments) should always go to the release branch, if the documentation
 to be fixed exists and is relevant to the release-branch codebase.
 Doc fixes are always considered "safe" -- even when a release branch
-is in feature freeze, it can still receive doc fixes.
+is in feature freeze, it can still receive doc fixes.  However, this
+rule is limited to fixing real problems in the documentation; cleanups
+and stylistic changes are excluded.
 
 When you know that the change will be difficult to merge to the
 master (e.g., because the code on master has changed a lot), you can
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index 6742f0e..0bdbc06 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -2052,14 +2052,14 @@ means hide the excess parts of @var{string} with a 
@code{display} text
 property (@pxref{Display Property}) showing the ellipsis, instead of
 actually truncating the string.
 
-@group
 @example
+@group
 (truncate-string-to-width "\tab\t" 12 4)
      @result{} "ab"
 (truncate-string-to-width "\tab\t" 12 4 ?\s)
      @result{} "    ab  "
-@end example
 @end group
+@end example
 
 This function uses @code{string-width} and @code{char-width} to find
 the suitable truncation point when @var{string} is too wide, so it
diff --git a/lisp/repeat.el b/lisp/repeat.el
index 4dcd353..32ffb18 100644
--- a/lisp/repeat.el
+++ b/lisp/repeat.el
@@ -416,7 +416,7 @@ See `describe-repeat-maps' for a list of all repeatable 
commands."
                          (and (symbolp real-this-command)
                               (get real-this-command 'repeat-map)))))
         (when rep-map
-          (when (boundp rep-map)
+          (when (and (symbolp rep-map) (boundp rep-map))
             (setq rep-map (symbol-value rep-map)))
           (let ((map (copy-keymap rep-map)))
 
diff --git a/src/emacs.c b/src/emacs.c
index 7ae52b1..4734faf 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -1356,6 +1356,39 @@ main (int argc, char **argv)
   init_standard_fds ();
   atexit (close_output_streams);
 
+  /* Command-line argument processing.
+
+     The arguments in the argv[] array are sorted in the descending
+     order of their priority as defined in the standard_args[] array
+     below.  Then the sorted arguments are processed from the highest
+     to the lowest priority.  Each command-line argument that is
+     recognized by 'main', if found in argv[], causes skip_args to be
+     incremented, effectively removing the processed argument from the
+     command line.
+
+     Then init_cmdargs is called, and conses a list of the unprocessed
+     command-line arguments, as strings, in 'command-line-args'.  It
+     ignores all the arguments up to the one indexed by skip_args, as
+     those were already processed.
+
+     The arguments in 'command-line-args' are further processed by
+     startup.el, functions 'command-line' and 'command-line-1'.  The
+     first of them handles the arguments which need to be processed
+     before loading the user init file and initializing the
+     window-system.  The second one processes the arguments that are
+     related to the GUI system, like -font, -geometry, and -title, and
+     then processes the rest of arguments whose priority is below
+     those that are related to the GUI system.  The arguments
+     porcessed by 'command-line' are removed from 'command-line-args';
+     the arguments processed by 'command-line-1' aren't, they are only
+     removed from 'command-line-args-left'.
+
+     'command-line-1' emits an error message for any argument it
+     doesn't recognize, so any command-line arguments processed in C
+     below whose priority is below the GUI system related switches
+     should be explicitly recognized, ignored, and removed from
+     'command-line-args-left' in 'command-line-1'.  */
+
   sort_args (argc, argv);
   argc = 0;
   while (argv[argc]) argc++;
diff --git a/src/xdisp.c b/src/xdisp.c
index b7fd224..d6b53ea 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -2001,7 +2001,17 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int 
*x, int *y,
            }
 
          *x = top_x;
-         *y = max (top_y + max (0, it.max_ascent - it.ascent), window_top_y);
+         /* The condition below is a heuristic fix for the situation
+            where move_it_to stops just after finishing the display
+            of a fringe bitmap, which resets it.ascent to zero, and
+            thus causes Y to be offset by it.max_ascent.  */
+         if (it.ascent == 0 && it.what == IT_IMAGE
+             && it.method != GET_FROM_IMAGE
+             && it.image_id < 0
+             && it.max_ascent > 0)
+           *y = max (top_y, window_top_y);
+         else
+           *y = max (top_y + max (0, it.max_ascent - it.ascent), window_top_y);
          *rtop = max (0, window_top_y - top_y);
          *rbot = max (0, bottom_y - it.last_visible_y);
          *rowh = max (0, (min (bottom_y, it.last_visible_y)
@@ -2029,7 +2039,13 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int 
*x, int *y,
          RESTORE_IT (&it2, &it2, it2data);
          move_it_to (&it2, charpos, -1, -1, -1, MOVE_TO_POS);
          *x = it2.current_x;
-         *y = it2.current_y + it2.max_ascent - it2.ascent;
+         if (it2.ascent == 0 && it2.what == IT_IMAGE
+             && it2.method != GET_FROM_IMAGE
+             && it2.image_id < 0
+             && it2.max_ascent > 0)
+           *y = it2.current_y;
+         else
+           *y = it2.current_y + it2.max_ascent - it2.ascent;
          *rtop = max (0, -it2.current_y);
          *rbot = max (0, ((it2.current_y + it2.max_ascent + it2.max_descent)
                           - it.last_visible_y));



reply via email to

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