bug#72866: [PATCH] Add ediff-copy-all-X-to-Y functions

2024-09-01 Thread Paul Nelson
> > This patch binds functions in Ediff that copy all changes from one
> > buffer to another, without having to manually go through each
> > difference.  Any feedback welcome.
>
> Can you describe situation(s) where these commands will be useful?

I use Ediff to merge documents outside of git, like when
working with someone over email or using a computer program to
refactor code.  Sometimes all changes go one way, say from B to A.
The standard workflow then involves pressing "n" to review and "b" to
apply each change.  When the changes turn out to be mundane, this
leads to repetitive "n b" keystrokes.  The proposed patch allows a
more efficient process: rapidly review with "n", then apply all at
once using "C-c C-b".

>
> I think all we need to install this is a suitable NEWS entry.
>
> Thanks.

I've updated the patch with a NEWS entry (formatted to the best of my
ability), together with updates to the Ediff manual and the internal
help system.  Happy to revise further if I missed anything.

Thanks, best,

Paul
From 70cb106941e10fee1e0946928b4ade7f599dfd41 Mon Sep 17 00:00:00 2001
From: Paul Nelson 
Date: Thu, 29 Aug 2024 07:50:27 +0200
Subject: [PATCH] Add ediff-copy-all-X-to-Y functions

* lisp/vc/ediff-util.el (ediff--copy-all):
(ediff-copy-all-A-to-B):
(ediff-copy-all-B-to-A):
(ediff-copy-all-A-to-C):
(ediff-copy-all-B-to-C):
(ediff-copy-all-C-to-A):
(ediff-copy-all-C-to-B): New functions.
(ediff-setup-keymap): Bind them.

* doc/misc/ediff.texi (Quick Help Commands): Document them.

* lisp/vc/ediff-help.el (ediff-long-help-message-compare3):
(ediff-long-help-message-compare2):
(ediff-long-help-message-narrow2):
(ediff-long-help-message-word-mode):
(ediff-long-help-message-merge): Mention them.

* etc/NEWS (Lisp Changes in Emacs 31.1): Mention them.
---
 doc/misc/ediff.texi   | 21 ++
 etc/NEWS  | 17 +++
 lisp/vc/ediff-help.el | 66 +--
 lisp/vc/ediff-util.el | 64 +
 4 files changed, 135 insertions(+), 33 deletions(-)

diff --git a/doc/misc/ediff.texi b/doc/misc/ediff.texi
index 749025c870b..5cdd4e8388f 100644
--- a/doc/misc/ediff.texi
+++ b/doc/misc/ediff.texi
@@ -539,6 +539,27 @@ Quick Help Commands
 Copies the difference region from buffer C to buffer B@.
 The command @kbd{rb} undoes this.
 
+@item C-c C-a
+@itemx C-c C-b
+@itemx C-c C-a C-b
+@itemx C-c C-a C-c
+@itemx C-c C-b C-a
+@itemx C-c C-b C-c
+@itemx C-c C-c C-a
+@itemx C-c C-c C-b
+@kindex C-c C-a
+@kindex C-c C-b
+@kindex C-c C-a C-b
+@kindex C-c C-a C-c
+@kindex C-c C-b C-a
+@kindex C-c C-b C-c
+@kindex C-c C-c C-a
+@kindex C-c C-c C-b
+Behaves like the above commands, but copies @emph{all} difference
+regions from one buffer to another.  For instance, @kbd{C-c C-a} copies
+all changes from buffer A to buffer B (in a 2-way diff) or to buffer C
+(in a merge).
+
 @item p
 @itemx @key{DEL}
 @kindex p
diff --git a/etc/NEWS b/etc/NEWS
index f10f9ae4d65..dbee66ea978 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -121,6 +121,23 @@ A new ':authorizable t' parameter has been added to 'dbus-call-method'
 and 'dbus-call-method-asynchronously' to allow the user to interactively
 authorize the invoked D-Bus method (e.g., via polkit).
 

+** Ediff now supports copying all changes between buffers at once.
+New commands have been added to Ediff to copy all changes from one buffer
+to another in a single operation:
+
+- 'C-c C-a' copies all changes from buffer A to buffer B (in 2-way diff)
+  or to buffer C (in 3-way diff or merge).
+- 'C-c C-b' copies all changes from buffer B to buffer A (in 2-way diff)
+  or to buffer C (in 3-way diff or merge).
+- 'C-c C-a C-b' copies all changes from buffer A to buffer B.
+- 'C-c C-b C-a' copies all changes from buffer B to buffer A.
+- 'C-c C-a C-c' copies all changes from buffer A to buffer C.
+- 'C-c C-b C-c' copies all changes from buffer B to buffer C.
+- 'C-c C-c C-a' copies all changes from buffer C to buffer A.
+- 'C-c C-c C-b' copies all changes from buffer C to buffer B.
+
+
 
 * Changes in Emacs 31.1 on Non-Free Operating Systems
 
diff --git a/lisp/vc/ediff-help.el b/lisp/vc/ediff-help.el
index 56e1ec80c5c..1078322a816 100644
--- a/lisp/vc/ediff-help.el
+++ b/lisp/vc/ediff-help.el
@@ -46,13 +46,13 @@ ediff-long-help-message-tail
 (defconst ediff-long-help-message-compare3
   "
 p,DEL -previous diff | | -vert/horiz split   | xy -copy buf X's region to Y
-n,SPC -next diff | h -highlighting   | rx -restore buf X's old diff
-j -jump to diff  | @ -auto-refinement|  * -refine current region
-   gx -goto X's point|## -ignore whitespace  |  ! -update diff regions
-  C-l -recenter  |#c -ignore case|
-  v/V -scroll up/dn  | #f/#h -focus/hide r

bug#72866: [PATCH] Add ediff-copy-all-X-to-Y functions

2024-09-04 Thread Paul Nelson
Hi Robert,

> The functionality seems useful. I wonder if it makes more sense to
> have them triggered by the prefix arg, eg "C-u b", "C-u a b",
> etc. rather than having to keep Ctrl pressed.
>
> Robert
> --

Many thanks for your suggestion.  I agree that this is a more elegant
approach, which also admits a simpler implementation.  I've attached
my revised patch.  Any further feedback welcome.

Thanks, best,

Paul


0001-Add-Ediff-feature-for-copying-all-differences.patch
Description: Binary data


bug#72866: [PATCH] Add ediff-copy-all-X-to-Y functions

2024-09-04 Thread Paul Nelson
Thanks Robert, I've implemented your suggestions.

I hope someone will check that I've used "+++" correctly in NEWS,
affirming that I updated the documentation -- hopefully I didn't miss
anything.

Any other comments welcome.

Paul


0001-Add-Ediff-feature-for-copying-all-differences.patch
Description: Binary data


bug#73037: 31.0.50; fullscreen tooltips break after loading pdf-tools on MacOS

2024-09-05 Thread Paul Nelson
I've tested the following setups:

(1) Emacs master, pdf-tools 1.1.0
(2) Emacs 29.4, pdf-tools 1.1.0

The issue appears with (1) but not (2), so I figured I'd report it as
a bug with Emacs rather than pdf-tools, but would welcome other
suggestions.

Steps to reproduce:

1. Install pdf-tools (e.g., via list-packages)

2. Emacs -Q

3. Evaluate the following:

(package-initialize)
(use-package pdf-tools
  :config
  (pdf-tools-install :no-query))

4. Visit any pdf file.

These steps put Emacs in a state where tooltips behave badly: when the
current frame is fullscreen (via (toggle-frame-fullscreen)), tooltips
display in a separate fullscreen frame rather than as a child frame.

All tooltips are affected, not just those produced by pdf-tools.  For
example, (x-show-tip "This is a tooltip." (selected-frame) nil 5)
triggers the issue, as does mousing over any link in *Help*.



In GNU Emacs 31.0.50 (build 4, aarch64-apple-darwin23.6.0, NS
 appkit-2487.70 Version 14.6.1 (Build 23G93)) of 2024-09-05 built on
 d51735
Repository revision: df57e44a08fd5c7dc159254a40f5d2e4d008e8df
Repository branch: master
Windowing system distributor 'Apple', version 10.3.2487
System Description:  macOS 14.6.1

Configured using:
 'configure --with-ns --with-native-compilation --with-tree-sitter
 --with-gif --with-png --with-jpeg --with-rsvg --with-tiff
 --with-imagemagick --with-x-toolkit=gtk3 --with-xwidgets'

Configured features:
ACL DBUS GLIB GNUTLS IMAGEMAGICK LCMS2 LIBXML2 MODULES NATIVE_COMP
NOTIFY KQUEUE NS PDUMPER PNG RSVG SQLITE3 THREADS TOOLKIT_SCROLL_BARS
TREE_SITTER WEBP XIM XWIDGETS ZLIB

Important settings:
  value of $LC_CTYPE: UTF-8
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Text

Minor modes in effect:
  pdf-occur-global-minor-mode: t
  repeat-mode: t
  override-global-mode: t
  recentf-mode: t
  display-time-mode: t
  save-place-mode: t
  global-auto-revert-mode: t
  minibuffer-depth-indicate-mode: t
  electric-pair-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  tab-bar-history-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  minibuffer-regexp-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
/Users/au710211/.emacs.d/elpa/lispy-20230314.1738/elpa hides
/Users/au710211/.emacs.d/elpa/ivy-20240405.2019/elpa
/Users/au710211/.emacs.d/elpa/editorconfig-20240318.2049/editorconfig
hides 
/Users/au710211/gnu-emacs/nextstep/Emacs.app/Contents/Resources/lisp/editorconfig
/Users/au710211/.emacs.d/elpa/which-key-20240423.1320/which-key hides
/Users/au710211/gnu-emacs/nextstep/Emacs.app/Contents/Resources/lisp/which-key
/Users/au710211/.emacs.d/elpa/editorconfig-20240318.2049/editorconfig-core
hides 
/Users/au710211/gnu-emacs/nextstep/Emacs.app/Contents/Resources/lisp/editorconfig-core
/Users/au710211/.emacs.d/elpa/editorconfig-20240318.2049/editorconfig-conf-mode
hides 
/Users/au710211/gnu-emacs/nextstep/Emacs.app/Contents/Resources/lisp/editorconfig-conf-mode
/Users/au710211/.emacs.d/elpa/ef-themes-1.7.0/theme-loaddefs hides
/Users/au710211/gnu-emacs/nextstep/Emacs.app/Contents/Resources/lisp/theme-loaddefs
/Users/au710211/.emacs.d/elpa/transient-20240421.1737/transient hides
/Users/au710211/gnu-emacs/nextstep/Emacs.app/Contents/Resources/lisp/transient
/Users/au710211/.emacs.d/elpa/editorconfig-20240318.2049/editorconfig-core-handle
hides 
/Users/au710211/gnu-emacs/nextstep/Emacs.app/Contents/Resources/lisp/editorconfig-core-handle
/Users/au710211/.emacs.d/elpa/editorconfig-20240318.2049/editorconfig-fnmatch
hides 
/Users/au710211/gnu-emacs/nextstep/Emacs.app/Contents/Resources/lisp/editorconfig-fnmatch

Features:
(shadow sort mail-extr emacsbug magit-base magit-section cursor-sensor
crm dash compat etags fileloop generator xref shortdoc help-fns
radix-tree mm-archive misearch multi-isearch package-vc lisp-mnt
network-stream url-cache url-http url-auth url-gw nsm
display-line-numbers add-log vc-hg vc-git diff-mode track-changes vc-bzr
vc-src vc-sccs vc-svn vc-cvs vc-rcs log-view pcvs-util vc vc-dispatcher
dired-aux ol-eww eww xdg url-queue mm-url ol-rmail ol-mhe ol-irc ol-info
ol-gnus nnselect gnus-art mm-uu mml2015 mm-view mml-smime smime gnutls
dig gnus-sum shr pixel-fill kinsoku url-file svg dom gnus-group
gnus-undo gnus-start gnus-dbus dbus xml gnus-cloud nnimap nnmail
mail-source utf7 nnoo parse-time gnus-spec gnus-int gnus-range message
sendmail yank-media puny rfc822 mml mml-sec epa derived epg rfc6068
epg-config mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047
rfc2045 ietf-drums mailabbrev gmm-utils mailheader gnus-win gnus
nnheader gnus-util mail-utils range mm-util mail-prsvr ol-docview
ol-bibtex bibtex iso8601 ol-bbdb ol-w3m ol-doi org-link-doi org-capture
org-refile pdf-sync pdf-ann

bug#73037: 31.0.50; fullscreen tooltips break after loading pdf-tools on MacOS

2024-09-12 Thread Paul Nelson
Thanks, will do.