This file details the Debian specific changes to Emacs.

Some of the patches referred to below may follow DEP-3 format
(https://dep-team.pages.debian.net/deps/dep3/).

* Those who prefer the old-style scrollbars can edit debian/rules

  If you prefer the old-style, non-toolkit scrollbars, just edit
  debian/rules to add --without-toolkit-scrollbars where indicated and
  rebuild.

* Prefer /usr/share/info/emacs/
Emacs prefers /usr/share/info/emacs to /usr/share/info.

The value of Info-default-directory-list has been augmented via
lisp/info.el to include /usr/share/info/emacs before /usr/share/info.

Patch: 0001-Prefer-usr-share-info-emacs.patch

* Run debian-startup and set debian-emacs-flavor
Emacs runs debian-startup and sets debian-emacs-flavor.

* Emacs runs debian-startup during the startup process unless
  site-run-file is false.

* The global variable debian-emacs-flavor is bound to 'emacs.

Author: Rob Browning <rlb@defaultvalue.org>

Patch: 0002-Run-debian-startup-and-set-debian-emacs-flavor.patch

* Remove files that appear to be incompatible with the DFSG
Files that appear to be incompatible with the DFSG have been removed.

A number of files have been removed from this package because their
licenses are not compatible with the Debian Free Software Guidelines
(DFSG), or because it wasn't completely clear that their licenses are
compatible.

In particular, all of the files which are covered under the GFDL and
have invariant sections have been removed in accordance with this
General Resolution: http://www.debian.org/vote/2006/vote_001.

The files that have been removed, but still appear to be
distributable, have been moved to packages in Debian's non-free
section.

Author: Rob Browning <rlb@defaultvalue.org>
Added-by: Rob Browning <rlb@defaultvalue.org>
Status: new

Patch: 0003-Remove-files-that-appear-to-be-incompatible-with-the.patch

* Adjust documentation references for Debian
Various documentation references have been adjusted for Debian.

References to /usr/local/... have been changed to /usr/... as
appropriate, etc.

Patch: 0004-Adjust-documentation-references-for-Debian.patch

* Modify the output of (version) to indicate Debian modifications
The output of (version) has been modified to indicate Debian modifications.

Author: Rob Browning <rlb@defaultvalue.org>
Added-by: Rob Browning <rlb@defaultvalue.org>

Patch: 0005-Modify-the-output-of-version-to-indicate-Debian-modi.patch

* Don't try to build src/macuvs.h (via IVD_Sequences.txt)
These are OS X specific, and were removed for now, due to uncertainty
over the licensing.

Patch: 0006-Don-t-try-to-build-src-macuvs.h-via-IVD_Sequences.tx.patch

* Kill gpg agent in package-test.el to avoid a race
package-test.el should no longer fail during clean up.

* Previously a delete-directories call raced with the gpg agent's own
  cleanup process (presumably triggered by the first deletion of one of
  the agent's sockets).  As a result, it looks like the agent might
  delete one of its sockets after delete-directories had decided to
  delete the socket, but before it made the attempt, causing an
  exception.

* To fix the problem, explicitly ask gpg-connect-agent to kill the agent
  before attempting to delete the gnupg home directory, and then delete
  via "rm -rf" to ignore any vanishing files.

Patch: 0007-Kill-gpg-agent-in-package-test.el-to-avoid-a-race.patch

* Mark vc-bzr-test-fauilt-bzr-autoloads as unstable for now
Currently the test fails like this:

  Running 3 tests (2018-12-17 12:17:43-0600)
     passed  1/3  vc-bzr-test-bug9726
  Mark set
  Press C-c C-c when you are done editing.
  Enter a change comment.  Type C-c C-c when done
     passed  2/3  vc-bzr-test-bug9781
  Falling back on "slow" status detection ((file-missing "Opening input file" "No such file or directory" "/tmp/vc-bzr-testVlgmsb/bzr/.bzr/checkout/dirstate"))
  Error: (error "Running bzr status --no-classify loaddefs.el...FAILED (status 3)")
  Warnings in `bzr' output: bzr: ERROR: invalid header line: ''

  Error: (error "Running bzr status --no-classify loaddefs.el...FAILED (status 3)")
  Warnings in `bzr' output: bzr: ERROR: invalid header line: ''

  Test vc-bzr-test-faulty-bzr-autoloads backtrace:
    logand(nil 128)
    vc-mode-line("/tmp/vc-bzr-testVlgmsb/bzr/loaddefs.el" Bzr)
    vc-refresh-state()
    run-hooks(find-file-hook)
    after-find-file(t t)
    find-file-noselect-1(#<buffer loaddefs.el> "/tmp/vc-bzr-testVlgmsb/b
    find-file-noselect("/tmp/vc-bzr-testVlgmsb/bzr/loaddefs.el")
    autoload-find-generated-file()
    update-directory-autoloads("/tmp/vc-bzr-testVlgmsb/bzr/")
    (progn (update-directory-autoloads default-directory) t)
    (setq value-35 (progn (update-directory-autoloads default-directory)
    (unwind-protect (setq value-35 (progn (update-directory-autoloads de
    (if (unwind-protect (setq value-35 (progn (update-directory-autoload
    (let (form-description-36) (if (unwind-protect (setq value-35 (progn
    (let ((value-35 (gensym "ert-form-evaluation-aborted-"))) (let (form
    (progn (call-process vc-bzr-program nil nil nil "init") (let ((temp-
    (unwind-protect (progn (call-process vc-bzr-program nil nil nil "ini
    (let* ((homedir (make-temp-file "vc-bzr-test" t)) (bzrdir (expand-fi
    (lambda nil (let* ((fn-30 (function executable-find)) (args-31 (cond
    ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test
    ert-run-test(#s(ert-test :name vc-bzr-test-faulty-bzr-autoloads :doc
    ert-run-or-rerun-test(#s(ert--stats :selector (not (or (tag :expensi
    ert-run-tests((not (or (tag :expensive-test) (tag :unstable))) #f(co
    ert-run-tests-batch((not (or (tag :expensive-test) (tag :unstable)))
    ert-run-tests-batch-and-exit((not (or (tag :expensive-test) (tag :un
    eval((ert-run-tests-batch-and-exit '(not (or (tag :expensive-test) (
    command-line-1(("-L" ":/home/locke/tmp/main-26.1/debian/build-src/te
    command-line()
    normal-top-level()
  Test vc-bzr-test-faulty-bzr-autoloads condition:
      (wrong-type-argument number-or-marker-p nil)
     FAILED  3/3  vc-bzr-test-faulty-bzr-autoloads

  Ran 3 tests, 2 results as expected, 1 unexpected (2018-12-17 12:17:46-0600)

  1 unexpected results:
     FAILED  vc-bzr-test-faulty-bzr-autoloads

Patch: 0008-Mark-vc-bzr-test-fauilt-bzr-autoloads-as-unstable-fo.patch

* pdumper: set DUMP_RELOC_ALIGNMENT_BITS=1 for m68k
Before the change builds would fail like this:

  (...)
  Loading /<<BUILDDIR>>/emacs-27.1+1/debian/build-src/lisp/vc/vc-hooks.el (source)...
  Loading /<<BUILDDIR>>/emacs-27.1+1/debian/build-src/lisp/vc/ediff-hook.el (source)...
  Loading /<<BUILDDIR>>/emacs-27.1+1/debian/build-src/lisp/uniquify.el (source)...
  Loading /<<BUILDDIR>>/emacs-27.1+1/debian/build-src/lisp/electric.el (source)...
  Loading /<<BUILDDIR>>/emacs-27.1+1/debian/build-src/lisp/emacs-lisp/eldoc.el (source)...
  Loading /<<BUILDDIR>>/emacs-27.1+1/debian/build-src/lisp/cus-start.el (source)...
  Loading /<<BUILDDIR>>/emacs-27.1+1/debian/build-src/lisp/tooltip.el (source)...
  Finding pointers to doc strings...
  Finding pointers to doc strings...done
  Dumping under the name bootstrap-emacs.pdmp
  dumping fingerprint: 7b5c59c589dc151eb1e4269bd83fbe809616b5cb9bb5c80014d5b560b391dfb6
  dump relocation out of range

[rlb@defaultvalue.org: create commit message]

Origin: debian
Bug: https://bugs.gnu.org/44531
Bug-Debian: http://bugs.debian.org/1019130
Forwarded: not-needed

Patch: 0009-pdumper-set-DUMP_RELOC_ALIGNMENT_BITS-1-for-m68k.patch

* Mark test-undo-region as unstable
It is repeatedly failing on Debian's arch:all autobuilders, though
seemingly nowhere else:

     passed  40/44  simple-transpose-subr (0.000396 sec)
  Test test-undo-region backtrace:
    signal(ert-test-failed (((should (= (length (delq nil (undo-make-sel
    ert-fail(((should (= (length (delq nil (undo-make-selective-list 1 9
    #f(compiled-function () #<bytecode 0x52f126616d2cdbd>)()
    ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test
    ert-run-test(#s(ert-test :name test-undo-region :documentation nil :
    ert-run-or-rerun-test(#s(ert--stats :selector ... :tests ... :test-m
    ert-run-tests((not (or (tag :expensive-test) (tag :unstable))) #f(co
    ert-run-tests-batch((not (or (tag :expensive-test) (tag :unstable)))
    ert-run-tests-batch-and-exit((not (or (tag :expensive-test) (tag :un
    command-line-1(("-L" ":/<<PKGBUILDDIR>>/debian/build
    command-line()
    normal-top-level()
  Test test-undo-region condition:
      (ert-test-failed
       ((should
         (=
  	(length ...)
  	2))
        :form
        (= 3 2)
        :value nil))
     FAILED  41/44  test-undo-region (0.000185 sec)

Patch: 0010-Mark-test-undo-region-as-unstable.patch

* Mark flaky test process-tests/multiple-threads-waiting as unstable
It times out:

     passed  22/28  process-tests/fd-setsize-no-crash/make-serial-process (0.021449 sec)
  make[5]: *** [Makefile:182: src/process-tests.log] Error 134
    GEN      src/regex-emacs-tests.log
    GEN      src/search-tests.log
    GEN      src/syntax-tests.log
    GEN      src/textprop-tests.log
    GEN      src/thread-tests.log
    GEN      src/timefns-tests.log
    GEN      src/undo-tests.log
    GEN      src/xdisp-tests.log
    GEN      src/xfaces-tests.log
    GEN      src/xml-tests.log
  make[5]: Leaving directory '/<<PKGBUILDDIR>>/debian/build-gtk/test'
  make[4]: [Makefile:335: check-doit] Error 2 (ignored)

  SUMMARY OF TEST RESULTS
  -----------------------
  Files examined: 375
  Ran 5408 tests, 28 failed to run, 5273 results as expected, 0 unexpected, 135 skipped
  1 files did not finish:
    src/process-tests.log
  make[4]: *** [Makefile:336: check-doit] Error 2

Patch: 0011-Mark-flaky-test-process-tests-multiple-threads-waiti.patch

* Add 'inhibit-native-compilation'
The following upstream patch has been backported:

  Add new variable 'inhibit-native-compilation'

  * lisp/startup.el (normal-top-level): Set
  inhibit-native-compilation from environment variable.

  * lisp/emacs-lisp/comp.el (comp-trampoline-compile): Don't write
  trampolines to disk.

  * lisp/progmodes/elisp-mode.el
  (emacs-lisp-native-compile-and-load): Adjust.

  * src/comp.c (syms_of_comp): New variable
  inhibit-native-compilation.
  (maybe_defer_native_compilation): Use it.

Origin: upstream, commit: 5fec9182dbeffa88cef6651d8c798ef9665d6681
Forwarded: not-needed

Patch: 0012-Add-inhibit-native-compilation.patch

* Rename to 'inhibit-automatic-native-compilation'
The following upstream patch has been backported:

  Rename to inhibit-automatic-native-compilation

  * src/comp.c (maybe_defer_native_compilation):
  (syms_of_comp):
  * lisp/startup.el (inhibit-native-compilation):
  (normal-top-level):
  * lisp/progmodes/elisp-mode.el (emacs-lisp-native-compile-and-load):
  * lisp/emacs-lisp/comp.el (comp-trampoline-compile): Rename
  inhibit-native-compilation to inhibit-automatic-native-compilation.

Origin: upstream, commit f97993ee667f9be7589825f3a4fbc095d6944ec6
Forwarded: not-needed

Patch: 0013-Rename-to-inhibit-automatic-native-compilation.patch

* Patch project-vc-recognizes-git test for Debian build
Patch: 0014-Patch-project-vc-recognizes-git-test-for-Debian-buil.patch

* Change native-comp-async-jobs-number default to 1
Patch: 0015-Change-native-comp-async-jobs-number-default-to-1.patch

* Change native-comp-async-report-warnings-errors to silent
We have had numerous bug reports across packages about this bothering
users.

Patch: 0016-Change-native-comp-async-report-warnings-errors-to-s.patch

* Mark dired-test-bug27243-02 as unstable for now
This appears to be a known issue:

  https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27243#64
  https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27243#115

Sample failure:

  Test dired-test-bug27243-02 backtrace:
    signal(ert-test-failed (((should (eq (point) pt1)) :form (eq 176 179
    ert-fail(((should (eq (point) pt1)) :form (eq 176 179) :value nil))
    #f(compiled-function () #<bytecode -0xdd3f9b8b64b2928>)()
    ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test
    ert-run-test(#s(ert-test :name dired-test-bug27243-02 :documentation
    ert-run-or-rerun-test(#s(ert--stats :selector (not ...) :tests [...
    ert-run-tests((not (or (tag :expensive-test) (tag :unstable))) #f(co
    ert-run-tests-batch((not (or (tag :expensive-test) (tag :unstable)))
    ert-run-tests-batch-and-exit((not (or (tag :expensive-test) (tag :un
    command-line-1(("-L" ":/<<PKGBUILDDIR>>/debian/
    command-line()
    normal-top-level()
  Test dired-test-bug27243-02 condition:
      (ert-test-failed
       ((should
         (eq
          (point)
          pt1))
        :form
        (eq 176 179)
        :value nil))
     FAILED   5/16  dired-test-bug27243-02 (0.010115 sec) at ../../build-src/test/lisp/dired-tests.el:189

Bug: https://debbugs.gnu.org/27243
Forwarded: not-needed

Patch: 0017-Mark-dired-test-bug27243-02-as-unstable-for-now.patch

* Fix eldoc warning in patch adding debian-emacs-flavor
Forwarded: not-needed
Closes: #1095133

Patch: 0018-Fix-eldoc-warning-in-patch-adding-debian-emacs-flavo.patch

* Boost BASE_PURESIZE to fix build on certain archs
Patch: 0019-Boost-BASE_PURESIZE-to-fix-build-on-certain-archs.patch

* Disable server-tests/server-force-stop/keeps-frames on riscv64
This test often hangs on the Debian buildds.
It simply fails on a porterbox, at least for the emacs-nox phase
of the build, though seemingly not the emacs-lucid phase.

Patch: 0020-Disable-server-tests-server-force-stop-keeps-frames-.patch

* Disable emacs-module-tests.el
This regularly causes Emacs to FTBFS.

Patch: 0021-Disable-emacs-module-tests.el.patch

* Add public interfaces for accessing builtin package info (Bug#78844)
The following upstream patch has been backported:

  Add public interfaces for accessing builtin package info (Bug#78844)

  * lisp/emacs-lisp/package.el (package-builtin-packages)
  (package-builtin-package-version): New functions.
  * doc/lispref/package.texi: Add a section 'Package Information' with
  documentation for the new functions.
  * etc/NEWS: Add entry for 'package-versioned-builtin-packages' and
  'package-builtin-package-version'.

Origin: upstream, commit 5c75ec6ae52a5b06ad0424ce805f5ea0432b6e90
Forwarded: not-needed

Patch: 0022-Add-public-interfaces-for-accessing-builtin-package-.patch

* The shr-test/zoom image test should now work with libxml2 2.14+

This upstream patch has been added to fix the problem:

commit 462a541db904405ede8446c48ba0c71ad41c544d
Author: Eli Zaretskii <eliz@gnu.org>
Date:   Thu Jul 17 19:34:50 2025 +0300

   ; * test/lisp/net/shr-tests.el (shr-test/zoom-image): Fix <img> (bug#79041).

Patch: 0023-test-lisp-net-shr-tests.el-shr-test-zoom-image-Fix-i.patch

* Mark esh-proc-test/kill-pipeline as unstable for now
Currently fails on at least s390x from time to time. It doesn't take
long to  reproduce via

  (set -ex; while true; do make lisp/eshell/esh-proc-tests EMACS_TEST_VERBOSE=true; done)

from debian/build-lucid/test/. The failure looks like this:

     passed   3/24  esh-proc-test/exit-status/with-stderr-pipe (0.101971 sec)
  Test esh-proc-test/kill-pipeline backtrace:
    signal(ert-test-failed (((should (string-match-p (rx bos (32 (or "in
    ert-fail(((should (string-match-p (rx bos (32 (or "interrupt" (seq "
    (if (unwind-protect (setq value-154 (apply fn-152 args-153)) (setq f
    (let (form-description-156) (if (unwind-protect (setq value-154 (app
    (let ((value-154 'ert-form-evaluation-aborted-155)) (let (form-descr
    (let* ((fn-152 #'string-match-p) (args-153 (condition-case err (list
    (let ((output-start (eshell-beginning-of-output))) (eshell-kill-proc
    (let ((ert--infos (cons (cons "Command logs: " #'eshell-get-debug-lo
    (save-current-buffer (set-buffer eshell-buffer) (let ((ert--infos (c
    (unwind-protect (save-current-buffer (set-buffer eshell-buffer) (let
    (let ((eshell-buffer (eshell t))) (unwind-protect (save-current-buff
    (let ((process-environment (cons "HISTFILE" process-environment)) (e
    (progn (let ((process-environment (cons "HISTFILE" process-environme
    (unwind-protect (progn (let ((process-environment (cons "HISTFILE" p
    (let* ((coding-system-for-write nil) (temp-file (file-name-as-direct
    (save-current-buffer (let* ((coding-system-for-write nil) (temp-file
    #f(lambda () [t] (let ((value-145 (gensym "ert-form-evaluation-abort
    #f(compiled-function () #<bytecode 0xadfd76a69b57547>)()
    handler-bind-1(#f(compiled-function () #<bytecode 0xadfd76a69b57547>
    ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test
    ert-run-test(#s(ert-test :name esh-proc-test/kill-pipeline :document
    ert-run-or-rerun-test(#s(ert--stats :selector ... :tests ... :test-m
    ert-run-tests((not (or (tag :unstable) (tag :nativecomp))) #f(compil
    ert-run-tests-batch((not (or (tag :unstable) (tag :nativecomp))))
    ert-run-tests-batch-and-exit((not (or (tag :unstable) (tag :nativeco
    eval((ert-run-tests-batch-and-exit '(not (or (tag :unstable) (tag :n
    command-line-1(("-L" ":/home/rlb/emacs/debian/build-src/test" "-l" "
    command-line()
    normal-top-level()
  Test esh-proc-test/kill-pipeline condition:
      Command logs: command: "sh -c 'while true; do echo y; sleep 1; done' | sh -c 'while true; do read NAME; done'"

                    ----------------------------------------
                    [process] started external process `sh'

                    /usr/bin/sh -c while\ true\;\ do\ read\ NAME\;\ done
                    ----------------------------------------
                    [process] started external process `sh<1>'

                    /usr/bin/sh -c while\ true\;\ do\ echo\ y\;\ sleep\ 1\;\ done
                    ----------------------------------------
                    [process] received output from process `sh<1>'

                    y

                    ----------------------------------------
                    [process] forwarding output from process `sh<1>'

                    y

                    ----------------------------------------
                    [process] sentinel for external process `sh<1>': "killed
                    "
                    ----------------------------------------
                    [process] i/o busy for process `sh<1>'
                    ----------------------------------------
                    [process] sentinel for external process `sh-stderr': "finished
                    "
                    ----------------------------------------
                    [process] finished external process `sh-stderr'
                    ----------------------------------------
                    [process] sentinel for external process `sh': "killed
                    "
                    ----------------------------------------
                    [process] finished external process `sh'
      (ert-test-failed
       ((should
         (string-match-p (rx bos ... eos)
                        (buffer-substring-no-properties output-start ...)))
        :form
        (string-match-p "\\`\\(?:\\(?:interrupt\\|killed.*\\)\n\\)?\\'"
                       "/home/rlb/emacs/debian/build-lucid/test $ sh -c 'while true; do echo y; sleep 1; done' | sh -c 'while true; do read NAME; done'\n")
        :value nil))
     FAILED   4/24  esh-proc-test/kill-pipeline (0.003864 sec) at ../../build-src/test/lisp/eshell/esh-proc-tests.el:300
  Error running timer: (error "Selecting deleted buffer")
     passed   5/24  esh-proc-test/kill-pipeline-head (0.102912 sec)
     passed   6/24  esh-proc-test/kill-process/background-prompt (0.001595 sec)
  [sleep]+ Done (/usr/bin/sleep 100)
     passed   7/24  esh-proc-test/kill-process/foreground-only (0.203248 sec)
     passed   8/24  esh-proc-test/kill-process/redirect-message (0.001616 sec)
     passed   9/24  esh-proc-test/output/remote-redirect (0.160153 sec)

Patch: 0024-Mark-esh-proc-test-kill-pipeline-as-unstable-for-now.patch

* An SVG-related security vulnerability has been fixed (CVE-2026-6861)
This vulnerability, a memory corruption issue, could occur when Emacs
processed specially crafted SVG (Scalable Vector Graphics)
CSS (Cascading Style Sheets) data. A local user could exploit this by
convincing a victim to open a malicious SVG file, which might lead to a
denial of service (DoS) or potentially information disclosure.

Patch: 0025-src-image.c-svg_load_image-Fix-off-by-one-mistake-bu.patch

* The bytecomp-tests--dest-mountpoint should now only run
where bwrap works.

It doesn't, in some environments, like a Debian sbuild unshare.

Patch: 0026-bytecomp-tests-dest-mountpoint-only-run-test-if-bwra.patch

* Tree-sitter 0.26 is now supported
Patch: 0027-Support-Tree-sitter-version-0.26-and-later.patch

* Tree-sitter 0.26 queries are now supported
From the upstream NEWS: Tree-sitter query predicate :equal, :match, and
:pred are deprecated Use :eq?, :match?, :pred? instead.  The change is
because newer tree-sitter library mandates query predicates to end with
question mark.  Emacs will transparently converts :equal, :match and
:pred to :eq?, :match? and :pred?, respectively, so existing queries
still work fine with latest tree-sitter library.  Predicate :equal is
changed to :eq? to better follow tree-sitter’s convention.  Also, the
:match?  predicates can now take the regexp as either the first or
second argument, so it works with both tree-sitter convention (regexp
arg second) and Emacs convention (regexp arg first).

Patch: 0028-Change-tree-sitter-query-predicate-names-bug-79687.patch

* Some of the proced-tests are now skipped
They were hanging on the buildds and locally, so as with darwin
upstream, we now skip them too.

Patch: 0029-Skip-some-proced-tests-that-appear-to-be-hanging.patch


Local variables:
coding: utf-8
mode: outline
mode: emacs-news
paragraph-separate: "[   ^L]"
end:
