[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 1de6a86: Merge from origin/emacs-28
From: |
Stefan Kangas |
Subject: |
master 1de6a86: Merge from origin/emacs-28 |
Date: |
Sun, 21 Nov 2021 05:35:21 -0500 (EST) |
branch: master
commit 1de6a86553c15905066a93e5b761e1825f23015a
Merge: 539ee61 0dd3883
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>
Merge from origin/emacs-28
0dd3883def Update to Org 9.5-72-gc5d6656
e3d5337970 Fix mouse handling with several TTY frames on MS-Windows
7e437af413 Fix temacs invocation from outside of the 'src' directory
0fbfd4253e ; Avoid byte-compilation warnings in edmacro.el
c22c988b1f Fix mouse events on tab bar or tool bar when 'track-mouse'...
354c834fba Fix `browse-url-interactive-arg' for certain kinds of events
# Conflicts:
# lisp/mouse.el
---
lisp/edmacro.el | 6 +++++
lisp/mouse-drag.el | 2 ++
lisp/mouse.el | 6 ++++-
lisp/net/browse-url.el | 3 ++-
lisp/org/org-goto.el | 67 ++++++++++++++++++++++++------------------------
lisp/org/org-version.el | 2 +-
lisp/org/ox-icalendar.el | 6 +++++
src/emacs.c | 11 ++++++++
src/keyboard.c | 25 +++++++++---------
src/w32inevt.c | 3 +++
10 files changed, 82 insertions(+), 49 deletions(-)
diff --git a/lisp/edmacro.el b/lisp/edmacro.el
index b3118b0..29900a9 100644
--- a/lisp/edmacro.el
+++ b/lisp/edmacro.el
@@ -601,6 +601,12 @@ This function assumes that the events can be stored in a
string."
(setf (aref seq i) (logand (aref seq i) 127))))
seq)
+;; These are needed in a --without-x build.
+(defvar mouse-wheel-down-event)
+(defvar mouse-wheel-up-event)
+(defvar mouse-wheel-right-event)
+(defvar mouse-wheel-left-event)
+
(defun edmacro-fix-menu-commands (macro &optional noerror)
(if (vectorp macro)
(let (result)
diff --git a/lisp/mouse-drag.el b/lisp/mouse-drag.el
index ecfb359..0cdba6b 100644
--- a/lisp/mouse-drag.el
+++ b/lisp/mouse-drag.el
@@ -282,6 +282,8 @@ To test this function, evaluate:
(setq window-last-row (- (window-height) 2)
window-last-col (- (window-width) 2))
(track-mouse
+ ;; Set 'track-mouse' to something neither nil nor t (Bug#51794).
+ (setq track-mouse 'drag-dragging)
(while (progn
(setq event (read--potential-mouse-event)
end (event-end event)
diff --git a/lisp/mouse.el b/lisp/mouse.el
index 3128b39..3ab9fbc 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -1630,7 +1630,11 @@ The region will be defined with mark and point."
(goto-char (nth 1 range)))
(setf (terminal-parameter nil 'mouse-drag-start) start-event)
- (setq track-mouse t)
+ ;; Set 'track-mouse' to something neither nil nor t, so that mouse
+ ;; events are not reported to have happened on the tool bar or the
+ ;; tab bar, as that breaks drag events that originate on the window
+ ;; body below these bars; see make_lispy_position and bug#51794.
+ (setq track-mouse 'drag-tracking)
(set-transient-map
(let ((map (make-sparse-keymap)))
diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el
index 687bf6c..f85f5f6 100644
--- a/lisp/net/browse-url.el
+++ b/lisp/net/browse-url.el
@@ -737,7 +737,8 @@ position clicked before acting.
This function returns a list (URL NEW-WINDOW-FLAG)
for use in `interactive'."
(let ((event (elt (this-command-keys) 0)))
- (and (listp event) (mouse-set-point event)))
+ (when (mouse-event-p event)
+ (mouse-set-point event)))
(list (read-string prompt (or (and transient-mark-mode mark-active
;; rfc2396 Appendix E.
(replace-regexp-in-string
diff --git a/lisp/org/org-goto.el b/lisp/org/org-goto.el
index 0a3470f..352bf9f 100644
--- a/lisp/org/org-goto.el
+++ b/lisp/org/org-goto.el
@@ -203,40 +203,39 @@ When nil, you can use these keybindings to navigate the
buffer:
"Let the user select a location in current buffer.
This function uses a recursive edit. It returns the selected
position or nil."
- (org-no-popups
- (let ((isearch-mode-map org-goto-local-auto-isearch-map)
- (isearch-hide-immediately nil)
- (isearch-search-fun-function
- (lambda () #'org-goto--local-search-headings))
- (help (or help org-goto-help)))
- (save-excursion
- (save-window-excursion
- (delete-other-windows)
- (and (get-buffer "*org-goto*") (kill-buffer "*org-goto*"))
- (pop-to-buffer-same-window
- (condition-case nil
- (make-indirect-buffer (current-buffer) "*org-goto*" t)
- (error (make-indirect-buffer (current-buffer) "*org-goto*" t))))
- (let (temp-buffer-show-function temp-buffer-show-hook)
- (with-output-to-temp-buffer "*Org Help*"
- (princ (format help (if org-goto-auto-isearch
- " Just type for auto-isearch."
- " n/p/f/b/u to navigate, q to quit.")))))
- (org-fit-window-to-buffer (get-buffer-window "*Org Help*"))
- (org-overview)
- (setq buffer-read-only t)
- (if (and (boundp 'org-goto-start-pos)
- (integer-or-marker-p org-goto-start-pos))
- (progn (goto-char org-goto-start-pos)
- (when (org-invisible-p)
- (org-show-set-visibility 'lineage)))
- (goto-char (point-min)))
- (let (org-special-ctrl-a/e) (org-beginning-of-line))
- (message "Select location and press RET")
- (use-local-map org-goto-map)
- (recursive-edit)))
- (kill-buffer "*org-goto*")
- (cons org-goto-selected-point org-goto-exit-command))))
+ (let ((isearch-mode-map org-goto-local-auto-isearch-map)
+ (isearch-hide-immediately nil)
+ (isearch-search-fun-function
+ (lambda () #'org-goto--local-search-headings))
+ (help (or help org-goto-help)))
+ (save-excursion
+ (save-window-excursion
+ (delete-other-windows)
+ (and (get-buffer "*org-goto*") (kill-buffer "*org-goto*"))
+ (pop-to-buffer-same-window
+ (condition-case nil
+ (make-indirect-buffer (current-buffer) "*org-goto*" t)
+ (error (make-indirect-buffer (current-buffer) "*org-goto*" t))))
+ (let (temp-buffer-show-function temp-buffer-show-hook)
+ (with-output-to-temp-buffer "*Org Help*"
+ (princ (format help (if org-goto-auto-isearch
+ " Just type for auto-isearch."
+ " n/p/f/b/u to navigate, q to quit.")))))
+ (org-fit-window-to-buffer (get-buffer-window "*Org Help*"))
+ (org-overview)
+ (setq buffer-read-only t)
+ (if (and (boundp 'org-goto-start-pos)
+ (integer-or-marker-p org-goto-start-pos))
+ (progn (goto-char org-goto-start-pos)
+ (when (org-invisible-p)
+ (org-show-set-visibility 'lineage)))
+ (goto-char (point-min)))
+ (let (org-special-ctrl-a/e) (org-beginning-of-line))
+ (message "Select location and press RET")
+ (use-local-map org-goto-map)
+ (recursive-edit)))
+ (kill-buffer "*org-goto*")
+ (cons org-goto-selected-point org-goto-exit-command)))
;;;###autoload
(defun org-goto (&optional alternative-interface)
diff --git a/lisp/org/org-version.el b/lisp/org/org-version.el
index 6427f30..77b1cf4 100644
--- a/lisp/org/org-version.el
+++ b/lisp/org/org-version.el
@@ -11,7 +11,7 @@ Inserted by installing Org mode or when a release is made."
(defun org-git-version ()
"The Git version of Org mode.
Inserted by installing Org or when a release is made."
- (let ((org-git-version "release_9.5-68-g77e2ec"))
+ (let ((org-git-version "release_9.5-72-gc5d6656"))
org-git-version))
(provide 'org-version)
diff --git a/lisp/org/ox-icalendar.el b/lisp/org/ox-icalendar.el
index 9170059..081a283 100644
--- a/lisp/org/ox-icalendar.el
+++ b/lisp/org/ox-icalendar.el
@@ -280,6 +280,7 @@ re-read the iCalendar file.")
(footnote-definition . ignore)
(footnote-reference . ignore)
(headline . org-icalendar-entry)
+ (inner-template . org-icalendar-inner-template)
(inlinetask . ignore)
(planning . ignore)
(section . ignore)
@@ -805,6 +806,11 @@ END:VALARM\n"
;;;; Template
+(defun org-icalendar-inner-template (contents _)
+ "Return document body string after iCalendar conversion.
+CONTENTS is the transcoded contents string."
+ contents)
+
(defun org-icalendar-template (contents info)
"Return complete document string after iCalendar conversion.
CONTENTS is the transcoded contents string. INFO is a plist used
diff --git a/src/emacs.c b/src/emacs.c
index 63f2a39..ad409c2 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -2334,6 +2334,17 @@ Using an Emacs configured with --with-x-toolkit=lucid
does not have this problem
/* Unless next switch is -nl, load "loadup.el" first thing. */
if (! no_loadup)
Vtop_level = list2 (Qload, build_string ("loadup.el"));
+
+#ifdef HAVE_NATIVE_COMP
+ /* If we are going to load stuff in a non-initialized Emacs,
+ update the value of native-comp-eln-load-path, so that the
+ *.eln files will be found if they are there. */
+ if (!NILP (Vtop_level) && !temacs)
+ Vnative_comp_eln_load_path =
+ Fcons (Fexpand_file_name (XCAR (Vnative_comp_eln_load_path),
+ Vinvocation_directory),
+ Qnil);
+#endif
}
/* Set up for profiling. This is known to work on FreeBSD,
diff --git a/src/keyboard.c b/src/keyboard.c
index 3722ba1..982854c 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -5103,19 +5103,20 @@ make_lispy_position (struct frame *f, Lisp_Object x,
Lisp_Object y,
#endif
)
{
- /* FIXME: While track_mouse is non-nil, we do not report this
+ /* While 'track-mouse' is neither nil nor t, do not report this
event as something that happened on the tool or tab bar since
- that would break mouse dragging operations that originate from
- an ordinary window beneath and expect the window to auto-scroll
- as soon as the mouse cursor appears above or beneath it
- (Bug#50993). Since this "fix" might break track_mouse based
- operations originating from the tool or tab bar itself, such
- operations should set track_mouse to some special value that
- would be recognized by the following check.
-
- This issue should be properly handled by 'mouse-drag-track' and
- friends, so the below is only a temporary workaround. */
- if (NILP (track_mouse))
+ that would break mouse drag operations that originate from an
+ ordinary window beneath that bar and expect the window to
+ auto-scroll as soon as the mouse cursor appears above or
+ beneath it (Bug#50993). We do allow reports for t, because
+ applications may have set 'track-mouse' to t and still expect a
+ click on the tool or tab bar to get through (Bug#51794).
+
+ FIXME: This is a preliminary fix for the bugs cited above and
+ awaits a solution that includes a convention for all special
+ values of 'track-mouse' and their documentation in the Elisp
+ manual. */
+ if (NILP (track_mouse) || EQ (track_mouse, Qt))
posn = EQ (window_or_frame, f->tab_bar_window) ? Qtab_bar : Qtool_bar;
/* Kludge alert: for mouse events on the tab bar and tool bar,
keyboard.c wants the frame, not the special-purpose window
diff --git a/src/w32inevt.c b/src/w32inevt.c
index 9a69b32..894bc3a 100644
--- a/src/w32inevt.c
+++ b/src/w32inevt.c
@@ -470,6 +470,9 @@ do_mouse_event (MOUSE_EVENT_RECORD *event,
DWORD but_change, mask, flags = event->dwEventFlags;
int i;
+ /* Mouse didn't move unless MOUSE_MOVED says it did. */
+ SELECTED_FRAME ()->mouse_moved = 0;
+
switch (flags)
{
case MOUSE_MOVED: