Subject: bug#75996: 31.0.50; occur-edit-mode fails with context lines

From: Paul Nelson <[email-masked]>
Date: Sat, 01 Feb 2025 19:51:58 +0100

Steps to reproduce:

1. emacs -Q

2. Create a buffer with two lines, such as:

a
b

3. From the starting of the buffer, search for "a" (C-s a) and run occur
with one line of context (C-1 M-s o).

4. In the *Occur* buffer, press e to edit occur-edit-mode.

5. Try to edit the context line containing "b".

=> occur-after-change-function: Wrong type argument: markerp, nil

The broader issue is that edits made to context lines (other than those
with matches) don't propagate to the buffer after C-c C-c.

I'd be happy to try to fix this, but wanted to check if it's a known
issue.  I wasn't able to find to find it in the bug tracker.

In GNU Emacs 31.0.50 (build 6, aarch64-apple-darwin24.1.0, NS
 appkit-2575.20 Version 15.1.1 (Build 24B91)) of 2024-12-19 built on
 d51735
Repository revision: c19dd8e9d6c54080426623129a824e5bb2fcf7be
Repository branch: master
Windowing system distributor 'Apple', version 10.3.2575
System Description:  macOS 15.1.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: ELisp/d

Minor modes in effect:
  outline-minor-mode: t
  windmove-mode: t
  recentf-mode: t
  repeat-mode: t
  display-time-mode: t
  save-place-mode: t
  global-auto-revert-mode: t
  minibuffer-depth-indicate-mode: t
  electric-pair-mode: t
  override-global-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  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
  abbrev-mode: t

Load-path shadows:
None found.

Features:
(cus-edit cus-start cus-load foldout noutline outline pp shadow sort
mail-extr compile comint ansi-osc ansi-color ring emacsbug message
mailcap yank-media puny dired dired-loaddefs rfc822 mml mml-sec
password-cache epa derived epg rfc6068 epg-config gnus-util mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils
windmove shortdoc text-property-search help-fns radix-tree time-date
misearch multi-isearch pcase recentf tree-widget wid-edit repeat time
saveplace autorevert filenotify mb-depth elec-pair comp comp-cstr
warnings icons subr-x comp-run comp-common rx edmacro kmacro byte-opt
cl-extra help-mode use-package-ensure cl-seq use-package-bind-key
bind-key use-package-core bytecomp byte-compile cl-macs gv vc-git
diff-mode track-changes easy-mmode files-x vc-dispatcher cl-loaddefs
cl-lib rmc iso-transl tooltip cconv eldoc paren electric uniquify
ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/ns-win ns-win
ucs-normalize mule-util term/common-win tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu
timer select scroll-bar mouse jit-lock font-lock syntax font-core
term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads xwidget-internal dbusbind
kqueue cocoa ns lcms2 multi-tty make-network-process tty-child-frames
native-compile emacs)

Memory information:
((conses 16 205089 34367) (symbols 48 22794 7) (strings 32 56777 1968)
 (string-bytes 1 1381256) (vectors 16 20937)
 (vector-slots 8 262566 14647) (floats 8 120 26) (intervals 56 771 0)
 (buffers 992 19))