emacs-diffs
[Top][All Lists]
Advanced

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

feature/android 61a38b470de: Merge remote-tracking branch 'origin/master


From: Po Lu
Subject: feature/android 61a38b470de: Merge remote-tracking branch 'origin/master' into feature/android
Date: Sun, 2 Jul 2023 20:06:51 -0400 (EDT)

branch: feature/android
commit 61a38b470de2f9796ccf8273eca09622abc43368
Merge: 2baf2c5fd9a a5bf0ae6614
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Merge remote-tracking branch 'origin/master' into feature/android
---
 lisp/calendar/todo-mode.el   | 26 +++++++-------------
 lisp/emacs-lisp/bytecomp.el  |  4 ++++
 lisp/progmodes/cperl-mode.el |  4 +++-
 lisp/progmodes/eglot.el      |  2 +-
 lisp/progmodes/sh-script.el  |  7 ++++--
 lisp/xml.el                  |  2 +-
 src/xdisp.c                  | 56 ++++++++++++++++++++++++++++++++++++++++++--
 7 files changed, 77 insertions(+), 24 deletions(-)

diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el
index ad18e8f035e..56b0943d303 100644
--- a/lisp/calendar/todo-mode.el
+++ b/lisp/calendar/todo-mode.el
@@ -1463,6 +1463,10 @@ the archive of the file moved to, creating it if it does 
not exist."
                        (point-max)))
                 (content (buffer-substring-no-properties beg end))
                 (counts (cdr (assoc cat todo-categories))))
+           ;; Restore display of selected category, so internal file
+           ;; structure is not visible if user is prompted to choose a new
+           ;; category name in target file.
+           (todo-category-select)
            ;; Move the category to the new file.  Also update or create
            ;; archive file if necessary.
            (with-current-buffer
@@ -1525,7 +1529,8 @@ the archive of the file moved to, creating it if it does 
not exist."
            ;; last category, delete the file.  Also handle archive file
            ;; if necessary.
            (let ((buffer-read-only nil))
-             (remove-overlays beg end)
+             (widen)
+              (remove-overlays beg end)
              (delete-region beg end)
              (goto-char (point-min))
              ;; Put point after todo-categories sexp.
@@ -2856,7 +2861,8 @@ section in the category moved to."
                 (while done-items
                   (let ((buffer-read-only nil))
                    (todo-insert-with-overlays (pop done-items)))
-                  (todo-forward-item)))
+                  (todo-item-end)
+                 (forward-line)))
               ;; If only done items were moved, move point to the top
               ;; one, otherwise, move point to the top moved todo item.
               (goto-char here)
@@ -5296,21 +5302,7 @@ changes you have made in the order of the categories.
     ;; legitimate place to insert an item.  But skip this space if
     ;; count > 1, since that should only stop on an item.
     (when (and not-done (todo-done-item-p) (not count))
-      ;; (if (or (not count) (= count 1))
-         (re-search-backward "^$" start t))));)
-    ;; The preceding sexp is insufficient when buffer is not narrowed,
-    ;; since there could be no done items in this category, so the
-    ;; search puts us on first todo item of next category.  Does this
-    ;; ever happen?  If so:
-    ;; (let ((opoint) (point))
-    ;;   (forward-line -1)
-    ;;   (when (or (not count) (= count 1))
-    ;;         (cond ((looking-at (concat "^" (regexp-quote 
todo-category-beg)))
-    ;;                (forward-line -2))
-    ;;               ((looking-at (concat "^" (regexp-quote 
todo-category-done)))
-    ;;                (forward-line -1))
-    ;;               (t
-    ;;                (goto-char opoint)))))))
+      (re-search-backward "^$" start t))))
 
 (defun todo-backward-item (&optional count)
   "Move point up to start of item with next higher priority.
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 99202185d8d..262c658e258 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -5060,6 +5060,10 @@ binding slots have been popped."
           (byte-compile-warn-x
            condition "`condition-case' condition should not be quoted: %S"
            condition))
+        (when (and (consp condition) (memq :success condition))
+          (byte-compile-warn-x
+           condition
+           "`:success' must be the first element of a `condition-case' 
handler"))
         (unless (consp condition) (setq condition (list condition)))
         (dolist (c condition)
           (unless (and c (symbolp c))
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index 8d1773701bd..0a3982efd2b 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -1363,7 +1363,9 @@ place.")
                ,cperl--ws*-rx
                (or "," "=" "||=" "//=" ")"))
     "A rx sequence for the begin of a signature with initializers.
-Initializers can contain almost all Perl constructs and thus can not be 
covered by regular expressions.  This sequence captures enough to distinguish a 
signature from a prototype.")
+Initializers can contain almost all Perl constructs and thus can
+not be covered by regular expressions.  This sequence captures
+enough to distinguish a signature from a prototype.")
 
   (defconst cperl--package-rx
     `(sequence (group "package")
diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index 897cf3bc93e..f09c348143d 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -3212,7 +3212,7 @@ for which LSP on-type-formatting should be requested."
            parameter
          (when (zerop i)
            (goto-char (elt parlabel 0))
-           (search-backward "(" nil t)
+           (skip-syntax-backward "^w")
            (add-face-text-property (point-min) (point)
                                    'font-lock-function-name-face))
          ;; ...perhaps highlight it in the formals list
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index a305c35c5f8..cfc10878922 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -864,10 +864,13 @@ See `sh-feature'.")
           ("\\${?\\([[:alpha:]_][[:alnum:]_]*\\|[0-9]+\\|[$*_]\\)" 1
             font-lock-variable-name-face))
     (rpm sh-append rpm2
-        ("%{?\\(\\sw+\\)"  1 font-lock-keyword-face))
+        ("^\\s-*%\\(\\sw+\\)" 1 font-lock-keyword-face)
+        
("%{?\\([!?]*[[:alpha:]_][[:alnum:]_]*\\|[0-9]+\\|[%*#]\\*?\\|!?-[[:alpha:]]\\*?\\)"
+         1 font-lock-variable-name-face))
     (rpm2 sh-append shell
          ("^Summary:\\(.*\\)$" (1 font-lock-doc-face t))
-         ("^\\(\\sw+\\):"  1 font-lock-variable-name-face)))
+         ("^\\(\\sw+\\)\\((\\(\\sw+\\))\\)?:" (1 font-lock-variable-name-face)
+          (3 font-lock-string-face nil t))))
   "Default expressions to highlight in Shell Script modes.  See `sh-feature'.")
 
 (defvar sh-font-lock-keywords-var-1
diff --git a/lisp/xml.el b/lisp/xml.el
index 9095653416e..5a7501dcf41 100644
--- a/lisp/xml.el
+++ b/lisp/xml.el
@@ -265,7 +265,7 @@ See also `xml-get-attribute-or-nil'."
                                      "\\)*\"\\|'\\(?:[^%&']\\|"
                                      xml-pe-reference-re "\\|"
                                      xml-reference-re "\\)*'\\)"))
-) ; End of `eval-when-compile'
+) ; End of `eval-and-compile'
 
 
 ;; [75] ExternalID ::= 'SYSTEM' S SystemLiteral
diff --git a/src/xdisp.c b/src/xdisp.c
index d928e9562d2..43c628b73d8 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -1194,6 +1194,7 @@ static void get_cursor_offset_for_mouse_face (struct 
window *w,
 #endif /* HAVE_WINDOW_SYSTEM */
 
 static void produce_special_glyphs (struct it *, enum display_element_type);
+static void pad_mode_line (struct it *, bool);
 static void show_mouse_face (Mouse_HLInfo *, enum draw_glyphs_face);
 static bool coords_in_mouse_face_p (struct window *, int, int);
 static void reset_box_start_end_flags (struct it *);
@@ -28877,7 +28878,11 @@ display_string (const char *string, Lisp_Object 
lisp_string, Lisp_Object face_st
        {
          /* Add truncation mark, but don't do it if the line is
             truncated at a padding space.  */
-         if (it_charpos < it->string_nchars)
+         /* Need to do the below for the last string character as
+            well, since it could be a double-width character, in
+            which case the previous character ends before
+            last_visible_x.  Thus, comparison with <=, not <.  */
+         if (it_charpos <= it->string_nchars)
            {
              if (!FRAME_WINDOW_P (it->f))
                {
@@ -28885,6 +28890,18 @@ display_string (const char *string, Lisp_Object 
lisp_string, Lisp_Object face_st
 
                  if (it->current_x > it->last_visible_x)
                    {
+                     /* This flag is true if we are displaying mode
+                        line, false for header-line or tab-line.  */
+                     bool mode_line_p = false;
+
+                     /* ROW->mode_line_p is true if we display mode
+                        line or header-line or tab-line.  */
+                     if (row->mode_line_p)
+                       {
+                         struct window *w = it->w;
+                         if (row == MATRIX_MODE_LINE_ROW (w->desired_matrix))
+                           mode_line_p = true;
+                       }
                      if (!row->reversed_p)
                        {
                          for (ii = row->used[TEXT_AREA] - 1; ii > 0; --ii)
@@ -28902,7 +28919,10 @@ display_string (const char *string, Lisp_Object 
lisp_string, Lisp_Object face_st
                      for (n = row->used[TEXT_AREA]; ii < n; ++ii)
                        {
                          row->used[TEXT_AREA] = ii;
-                         produce_special_glyphs (it, IT_TRUNCATION);
+                         if (row->mode_line_p)
+                           pad_mode_line (it, mode_line_p);
+                         else
+                           produce_special_glyphs (it, IT_TRUNCATION);
                        }
                    }
                  produce_special_glyphs (it, IT_TRUNCATION);
@@ -31728,6 +31748,38 @@ produce_special_glyphs (struct it *it, enum 
display_element_type what)
   it->nglyphs = temp_it.nglyphs;
 }
 
+/* Produce padding glyphs for mode/header/tab-line whose text needs to
+   be truncated.  This is used when the last visible character leaves
+   one or more columns till the window edge, but the next character is
+   wider than that number of columns, and therefore cannot fit on the
+   line.  We then replace these columns with the appropriate padding
+   character: '-' for the mode line and SPC for the other two.  That's
+   because these lines should not show the usual truncation glyphs
+   there.  This function is only used on TTY frames.  */
+static void
+pad_mode_line (struct it *it, bool mode_line_p)
+{
+  struct it temp_it;
+  GLYPH glyph;
+
+  eassert (!FRAME_WINDOW_P (it->f));
+  temp_it = *it;
+  temp_it.object = Qnil;
+  memset (&temp_it.current, 0, sizeof temp_it.current);
+
+  SET_GLYPH (glyph, mode_line_p ? '-' : ' ', it->base_face_id);
+
+  temp_it.dp = NULL;
+  temp_it.what = IT_CHARACTER;
+  temp_it.c = temp_it.char_to_display = GLYPH_CHAR (glyph);
+  temp_it.face_id = GLYPH_FACE (glyph);
+  temp_it.len = CHAR_BYTES (temp_it.c);
+
+  PRODUCE_GLYPHS (&temp_it);
+  it->pixel_width = temp_it.pixel_width;
+  it->nglyphs = temp_it.nglyphs;
+}
+
 #ifdef HAVE_WINDOW_SYSTEM
 
 /* Calculate line-height and line-spacing properties.



reply via email to

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