GNU bug report logs - #75884
29.4; Dash character "-" appears as diff when it is the leading character in a line in a patch

Previous Next

Package: emacs;

Reported by: Husain Alshehhi <husain <at> alshehhi.io>

Date: Mon, 27 Jan 2025 03:41:02 UTC

Severity: minor

Tags: confirmed

Found in version 29.4

Fixed in version 31.1

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 75884 in the body.
You can then email your comments to 75884 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#75884; Package emacs. (Mon, 27 Jan 2025 03:41:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Husain Alshehhi <husain <at> alshehhi.io>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 27 Jan 2025 03:41:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Husain Alshehhi <husain <at> alshehhi.io>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.4; Dash character "-" appears as diff when it is the leading
 character in a line in a patch
Date: Sun, 26 Jan 2025 21:39:35 -0600
diff-mode does not handle a patch very well. In particular, if a patch
contains the commit message, and if the commit message contains a dash
character "-" at the beginning of a line, diff-mode interprets this as a
diff rather than part of the commit message.

To replicate this bug: copy the following in a file (e.g. test.patch),
open it in diff-mode, and you will see that the line "- unordered lists"
shows up in `diff-indicator-removed' face:

--8<---------------cut here---------------start------------->8---
From: me <at> example.com
Date: Thu, 01 Jan 2025 00:00:00 -0000
Subject: [PATCH] Adding a comment

This is a commit to test emacs mode for displaying dash "-" character
such as:

- unordered lists        << This will be displayed as a diff.
- with multiple items    << So will this.

Emacs shows unordered lists as part of the diff because they start with
"-".
---
 main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/main.c b/main.c
index 5df43ae..43b62fa 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,5 @@
 int main() {
+  // adding a comment.
   printf("hello world");
   return 0;
 }
-- 

2.47.1
--8<---------------cut here---------------end--------------->8---

See
https://lists.gnu.org/archive/html/help-gnu-emacs/2025-01/msg00229.html
for reference.


In GNU Emacs 29.4 (build 2, x86_64-suse-linux-gnu, GTK+ Version 3.24.43,
cairo version 1.18.2)
System Description: openSUSE Tumbleweed

Configured using:
 'configure --disable-build-details --without-pop --with-mailutils
 --with-native-compilation --without-hesiod --with-gameuser=:games
 --with-kerberos --with-kerberos5 --with-file-notification=inotify
 --with-modules --enable-autodepend --prefix=/usr
 --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share
 --localstatedir=/var --sharedstatedir=/var/lib
 --libexecdir=/usr/libexec --with-file-notification=yes
 --libdir=/usr/lib64
 --enable-locallisppath=/usr/share/emacs/29.4/site-lisp:/usr/share/emacs/site-lisp
 --with-x --with-xim --with-sound --with-xpm --with-jpeg --with-tiff
 --with-gif --with-png --with-rsvg --with-dbus --with-webp --with-xft
 --with-imagemagick --without-gpm --with-x-toolkit=gtk3 --with-pgtk
 --with-toolkit-scroll-bars --x-includes=/usr/include
 --x-libraries=/usr/lib64 --with-libotf --with-m17n-flt --with-cairo
 --with-xwidgets --build=x86_64-suse-linux --with-dumping=pdumper
 'CFLAGS=-O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3
 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables
 -fstack-clash-protection -Werror=return-type -flto=auto -g
 -D_GNU_SOURCE -DGDK_DISABLE_DEPRECATION_WARNINGS
 -DGLIB_DISABLE_DEPRECATION_WARNINGS -pipe -Wno-pointer-sign
 -Wno-unused-variable -Wno-unused-label -fno-optimize-sibling-calls
 -DPDMP_BASE='\''"emacs-wayland"'\''' LDFLAGS=-Wl,-O2'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ
IMAGEMAGICK JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES
NATIVE_COMP NOTIFY INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3
THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM XWIDGETS GTK3 ZLIB

Important settings:
  value of $LC_NUMERIC: POSIX
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=local
  locale-coding-system: utf-8-unix

Major mode: Article

Minor modes in effect:
  org-roam-db-autosync-mode: t
  global-git-commit-mode: t
  magit-auto-revert-mode: t
  shell-dirtrack-mode: t
  global-corfu-mode: t
  corfu-mode: t
  vertico-mode: t
  which-key-mode: t
  override-global-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  buffer-read-only: 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:
/home/husain/.emacs.d/elpa/compat-29.1.4.2/compat hides 
/usr/share/emacs/site-lisp/compat
/home/husain/.emacs.d/elpa/compat-29.1.4.2/compat-29 hides 
/usr/share/emacs/site-lisp/compat-29
/home/husain/.emacs.d/elpa/compat-29.1.4.2/compat-28 hides 
/usr/share/emacs/site-lisp/compat-28
/home/husain/.emacs.d/elpa/compat-29.1.4.2/compat-27 hides 
/usr/share/emacs/site-lisp/compat-27
/home/husain/.emacs.d/elpa/compat-29.1.4.2/compat-26 hides 
/usr/share/emacs/site-lisp/compat-26
/home/husain/.emacs.d/elpa/compat-29.1.4.2/compat-25 hides 
/usr/share/emacs/site-lisp/compat-25
/home/husain/.emacs.d/elpa/transient-20230919.2146/transient hides 
/usr/share/emacs/29.4/lisp/transient
/home/husain/.emacs.d/elpa/jsonrpc-1.0.24/jsonrpc hides 
/usr/share/emacs/29.4/lisp/jsonrpc
/home/husain/.emacs.d/elpa/use-package-20230426.2324/use-package hides 
/usr/share/emacs/29.4/lisp/use-package/use-package
/home/husain/.emacs.d/elpa/use-package-20230426.2324/use-package-lint 
hides /usr/share/emacs/29.4/lisp/use-package/use-package-lint
/home/husain/.emacs.d/elpa/use-package-20230426.2324/use-package-jump 
hides /usr/share/emacs/29.4/lisp/use-package/use-package-jump
/home/husain/.emacs.d/elpa/use-package-20230426.2324/use-package-ensure 
hides /usr/share/emacs/29.4/lisp/use-package/use-package-ensure
/home/husain/.emacs.d/elpa/use-package-20230426.2324/use-package-diminish 
hides /usr/share/emacs/29.4/lisp/use-package/use-package-diminish
/home/husain/.emacs.d/elpa/use-package-20230426.2324/use-package-delight 
hides /usr/share/emacs/29.4/lisp/use-package/use-package-delight
/home/husain/.emacs.d/elpa/use-package-20230426.2324/use-package-core 
hides /usr/share/emacs/29.4/lisp/use-package/use-package-core
/home/husain/.emacs.d/elpa/use-package-20230426.2324/use-package-bind-key 
hides /usr/share/emacs/29.4/lisp/use-package/use-package-bind-key
/home/husain/.emacs.d/elpa/bind-key-20230203.2004/bind-key hides 
/usr/share/emacs/29.4/lisp/use-package/bind-key
/home/husain/.emacs.d/elpa/eglot-1.17/eglot hides 
/usr/share/emacs/29.4/lisp/progmodes/eglot
/home/husain/.emacs.d/elpa/eldoc-1.15.0/eldoc hides 
/usr/share/emacs/29.4/lisp/emacs-lisp/eldoc

Features:
(mailalias mailclient dabbrev mm-archive misearch multi-isearch shadow
bbdb-message emacsbug mule-util smiley gnus-cite message-view-patch
mail-extr textsec uni-scripts idna-mapping ucs-normalize uni-confusable
textsec-check gnus-bcklg gnus-async sort gnus-ml disp-table
cello-light-theme ef-cherie-theme ef-themes consult nndraft nnmh
nnmaildir bbdb-gnus nnnil gnus-agent gnus-srvr gnus-score score-mode
nnvirtual gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime gnutls
dig nntp gnus-cache gnus-sum gnus-group gnus-undo gnus-start gnus-dbus
dbus gnus-cloud nnimap nnmail mail-source utf7 nnoo parse-time gnus-spec
gnus-int gnus-range gnus-win org-roam-protocol org-protocol
org-roam-migrate org-roam-log org-roam-mode org-roam-capture org-roam-id
org-roam-node org-roam-db emacsql-sqlite-builtin sqlite org-roam-utils
org-roam-compat org-roam org-capture org-attach emacsql-sqlite
emacsql-sqlite-common emacsql emacsql-compiler elfeed-show elfeed-search
vc-git vc-dispatcher elfeed-csv elfeed elfeed-curl elfeed-log elfeed-db
elfeed-lib url-queue xml-query erc-goodies erc iso8601 erc-backend
erc-networks erc-common erc-compat erc-loaddefs bbdb-mua bbdb-com bbdb
bbdb-site timezone gnus nnheader range org-noter org-noter-djvu
org-noter-nov nov recentf tree-widget shr pixel-fill kinsoku url-file
svg xml esxml-query dom org-noter-pdf org-noter-core pdf-tools cus-edit
cus-load wid-edit pdf-view magit-bookmark bookmark pp jka-compr
pdf-cache pdf-info tq pdf-util pdf-macs image-mode exif ledger-mode
ledger-check ledger-texi ledger-test ledger-sort ledger-report
ledger-reconcile ledger-occur ledger-fonts ledger-fontify ledger-state
ledger-complete ledger-schedule ledger-init ledger-xact ledger-post
ledger-exec ledger-navigate eshell esh-cmd esh-ext esh-opt esh-proc
esh-io esh-arg esh-module esh-groups esh-util files-x ledger-context
ledger-commodities ledger-regex scad-mode ox-gfm htmlize ob-latex ox-odt
rng-loc rng-uri rng-parse rng-match rng-dt rng-util rng-pttrn nxml-parse
nxml-ns nxml-enc xmltok nxml-util ox-md ox-latex ox-icalendar ox-html
table ox-ascii ox-publish ox org-habit org-agenda org-element
org-persist xdg org-id org-refile org ob ob-tangle ob-ref ob-lob
ob-table org-macro org-src ob-comint org-pcomplete org-list org-footnote
org-faces org-entities noutline outline ob-emacs-lisp org-table org-keys
org-loaddefs find-func avl-tree ol oc ob-exp ob-core org-cycle org-fold
org-fold-core org-compat ob-eval org-version org-macs link-hint
goto-addr avy cal-menu calendar cal-loaddefs ediff ediff-merg ediff-mult
ediff-wind ediff-diff ediff-help ediff-init ediff-util git-link
magit-submodule magit-blame magit-stash magit-reflog magit-bisect
magit-push magit-pull magit-fetch magit-clone magit-remote magit-commit
magit-sequence magit-notes magit-worktree magit-tag magit-merge
magit-branch magit-reset magit-files magit-refs magit-status magit
magit-repos magit-apply magit-wip magit-log which-func imenu magit-diff
smerge-mode diff diff-mode git-commit log-edit message sendmail
yank-media puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg
rfc6068 epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse
rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev
mail-utils gmm-utils mailheader pcvs-util add-log magit-core
magit-autorevert autorevert filenotify magit-margin magit-transient
magit-process with-editor time-date shell pcomplete server magit-mode
transient magit-git magit-base magit-section format-spec cursor-sensor
crm dash edmacro kmacro sqlformat reformatter go-mode find-file ffap
thingatpt etags fileloop generator xref project scala-mode
scala-mode-prettify-symbols scala-mode-imenu scala-mode-map
scala-mode-fontlock scala-mode-indent scala-mode-paragraph
scala-mode-syntax scala-mode-lib typescript-mode cc-mode cc-fonts
cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs
compile text-property-search comint ansi-osc ring yaml-mode ansi-color
exec-path-from-shell corfu orderless vertico compat diminish which-key
use-package use-package-ensure use-package-delight use-package-diminish
use-package-bind-key bind-key use-package-core finder-inf comp comp-cstr
warnings icons rx cl-extra help-mode ispell bbdb-autoloads
corfu-autoloads diminish-autoloads ef-themes-autoloads eglot-autoloads
eldoc-autoloads elfeed-autoloads emacs-everywhere-autoloads
embark-consult-autoloads consult-autoloads embark-autoloads
exec-path-from-shell-autoloads f-autoloads ggtags-autoloads
git-link-autoloads go-mode-autoloads htmlize-autoloads jsonrpc-autoloads
ledger-mode-autoloads link-hint-autoloads marginalia-autoloads
markdown-mode-autoloads magit-autoloads git-commit-autoloads
modus-themes-autoloads nov-autoloads orderless-autoloads
org-noter-autoloads org-roam-autoloads magit-section-autoloads
emacsql-autoloads ox-gfm-autoloads pdf-tools-autoloads request-autoloads
scad-mode-autoloads scala-mode-autoloads show-font-autoloads
sqlformat-autoloads reformatter-autoloads standard-themes-autoloads
tablist-autoloads transient-autoloads treemacs-autoloads
posframe-autoloads ht-autoloads hydra-autoloads pfuture-autoloads
ace-window-autoloads avy-autoloads s-autoloads dash-autoloads
typescript-mode-autoloads use-package-autoloads bind-key-autoloads
vertico-autoloads w3m-load w3m-autoloads which-key-autoloads
with-editor-autoloads info compat-autoloads yaml-mode-autoloads
auctex-autoloads tex-site package browse-url url url-proxy url-privacy
url-expand url-methods url-history url-cookie generate-lisp-file
url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq
eieio eieio-core cl-macs password-cache json subr-x map byte-opt gv
bytecomp byte-compile url-vars cl-loaddefs cl-lib rmc delsel lpr
easy-mmode pcase iso-transl tooltip cconv eldoc paren electric uniquify
ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/pgtk-win
pgtk-win term/common-win pgtk-dnd 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 inotify dynamic-setting
system-font-setting font-render-setting cairo gtk pgtk lcms2 multi-tty
make-network-process native-compile emacs)

Memory information:
((conses 16 1306461 97685)
 (symbols 48 47318 18)
 (strings 32 522080 13600)
 (string-bytes 1 26474941)
 (vectors 16 262284)
 (vector-slots 8 3657817 148039)
 (floats 8 1262 501)
 (intervals 56 4819 450)
 (buffers 984 34))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75884; Package emacs. (Sat, 08 Feb 2025 09:34:02 GMT) Full text and rfc822 format available.

Message #8 received at 75884 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Husain Alshehhi <husain <at> alshehhi.io>, Dmitry Gutov <dmitry <at> gutov.dev>,
 Juri Linkov <juri <at> linkov.net>, Sean Whitton <spwhitton <at> spwhitton.name>
Cc: 75884 <at> debbugs.gnu.org
Subject: Re: bug#75884: 29.4;
 Dash character "-" appears as diff when it is the leading character
 in a line in a patch
Date: Sat, 08 Feb 2025 11:32:41 +0200
> Date: Sun, 26 Jan 2025 21:39:35 -0600
> From: Husain Alshehhi <husain <at> alshehhi.io>
> 
> diff-mode does not handle a patch very well. In particular, if a patch
> contains the commit message, and if the commit message contains a dash
> character "-" at the beginning of a line, diff-mode interprets this as a
> diff rather than part of the commit message.
> 
> To replicate this bug: copy the following in a file (e.g. test.patch),
> open it in diff-mode, and you will see that the line "- unordered lists"
> shows up in `diff-indicator-removed' face:

I also see the final "--" line in that face, FWIW.

Dmitry, Juri, Sean: any comments or suggestions?

> 
> --8<---------------cut here---------------start------------->8---
> From: me <at> example.com
> Date: Thu, 01 Jan 2025 00:00:00 -0000
> Subject: [PATCH] Adding a comment
> 
> This is a commit to test emacs mode for displaying dash "-" character
> such as:
> 
> - unordered lists        << This will be displayed as a diff.
> - with multiple items    << So will this.
> 
> Emacs shows unordered lists as part of the diff because they start with
> "-".
> ---
>   main.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/main.c b/main.c
> index 5df43ae..43b62fa 100644
> --- a/main.c
> +++ b/main.c
> @@ -1,4 +1,5 @@
>   int main() {
> +  // adding a comment.
>     printf("hello world");
>     return 0;
>   }
> -- 
> 
> 2.47.1
> --8<---------------cut here---------------end--------------->8---
> 
> See
> https://lists.gnu.org/archive/html/help-gnu-emacs/2025-01/msg00229.html
> for reference.
> 
> 
> In GNU Emacs 29.4 (build 2, x86_64-suse-linux-gnu, GTK+ Version 3.24.43,
> cairo version 1.18.2)
> System Description: openSUSE Tumbleweed
> 
> Configured using:
>   'configure --disable-build-details --without-pop --with-mailutils
>   --with-native-compilation --without-hesiod --with-gameuser=:games
>   --with-kerberos --with-kerberos5 --with-file-notification=inotify
>   --with-modules --enable-autodepend --prefix=/usr
>   --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share
>   --localstatedir=/var --sharedstatedir=/var/lib
>   --libexecdir=/usr/libexec --with-file-notification=yes
>   --libdir=/usr/lib64
>   --enable-locallisppath=/usr/share/emacs/29.4/site-lisp:/usr/share/emacs/site-lisp
>   --with-x --with-xim --with-sound --with-xpm --with-jpeg --with-tiff
>   --with-gif --with-png --with-rsvg --with-dbus --with-webp --with-xft
>   --with-imagemagick --without-gpm --with-x-toolkit=gtk3 --with-pgtk
>   --with-toolkit-scroll-bars --x-includes=/usr/include
>   --x-libraries=/usr/lib64 --with-libotf --with-m17n-flt --with-cairo
>   --with-xwidgets --build=x86_64-suse-linux --with-dumping=pdumper
>   'CFLAGS=-O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3
>   -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables
>   -fstack-clash-protection -Werror=return-type -flto=auto -g
>   -D_GNU_SOURCE -DGDK_DISABLE_DEPRECATION_WARNINGS
>   -DGLIB_DISABLE_DEPRECATION_WARNINGS -pipe -Wno-pointer-sign
>   -Wno-unused-variable -Wno-unused-label -fno-optimize-sibling-calls
>   -DPDMP_BASE='\''"emacs-wayland"'\''' LDFLAGS=-Wl,-O2'
> 
> Configured features:
> ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ
> IMAGEMAGICK JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES
> NATIVE_COMP NOTIFY INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3
> THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM XWIDGETS GTK3 ZLIB
> 
> Important settings:
>    value of $LC_NUMERIC: POSIX
>    value of $LANG: en_US.UTF-8
>    value of $XMODIFIERS: @im=local
>    locale-coding-system: utf-8-unix
> 
> Major mode: Article
> 
> Minor modes in effect:
>    org-roam-db-autosync-mode: t
>    global-git-commit-mode: t
>    magit-auto-revert-mode: t
>    shell-dirtrack-mode: t
>    global-corfu-mode: t
>    corfu-mode: t
>    vertico-mode: t
>    which-key-mode: t
>    override-global-mode: t
>    tooltip-mode: t
>    global-eldoc-mode: t
>    show-paren-mode: t
>    electric-indent-mode: t
>    mouse-wheel-mode: t
>    file-name-shadow-mode: t
>    global-font-lock-mode: t
>    font-lock-mode: t
>    buffer-read-only: 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:
> /home/husain/.emacs.d/elpa/compat-29.1.4.2/compat hides 
> /usr/share/emacs/site-lisp/compat
> /home/husain/.emacs.d/elpa/compat-29.1.4.2/compat-29 hides 
> /usr/share/emacs/site-lisp/compat-29
> /home/husain/.emacs.d/elpa/compat-29.1.4.2/compat-28 hides 
> /usr/share/emacs/site-lisp/compat-28
> /home/husain/.emacs.d/elpa/compat-29.1.4.2/compat-27 hides 
> /usr/share/emacs/site-lisp/compat-27
> /home/husain/.emacs.d/elpa/compat-29.1.4.2/compat-26 hides 
> /usr/share/emacs/site-lisp/compat-26
> /home/husain/.emacs.d/elpa/compat-29.1.4.2/compat-25 hides 
> /usr/share/emacs/site-lisp/compat-25
> /home/husain/.emacs.d/elpa/transient-20230919.2146/transient hides 
> /usr/share/emacs/29.4/lisp/transient
> /home/husain/.emacs.d/elpa/jsonrpc-1.0.24/jsonrpc hides 
> /usr/share/emacs/29.4/lisp/jsonrpc
> /home/husain/.emacs.d/elpa/use-package-20230426.2324/use-package hides 
> /usr/share/emacs/29.4/lisp/use-package/use-package
> /home/husain/.emacs.d/elpa/use-package-20230426.2324/use-package-lint 
> hides /usr/share/emacs/29.4/lisp/use-package/use-package-lint
> /home/husain/.emacs.d/elpa/use-package-20230426.2324/use-package-jump 
> hides /usr/share/emacs/29.4/lisp/use-package/use-package-jump
> /home/husain/.emacs.d/elpa/use-package-20230426.2324/use-package-ensure 
> hides /usr/share/emacs/29.4/lisp/use-package/use-package-ensure
> /home/husain/.emacs.d/elpa/use-package-20230426.2324/use-package-diminish 
> hides /usr/share/emacs/29.4/lisp/use-package/use-package-diminish
> /home/husain/.emacs.d/elpa/use-package-20230426.2324/use-package-delight 
> hides /usr/share/emacs/29.4/lisp/use-package/use-package-delight
> /home/husain/.emacs.d/elpa/use-package-20230426.2324/use-package-core 
> hides /usr/share/emacs/29.4/lisp/use-package/use-package-core
> /home/husain/.emacs.d/elpa/use-package-20230426.2324/use-package-bind-key 
> hides /usr/share/emacs/29.4/lisp/use-package/use-package-bind-key
> /home/husain/.emacs.d/elpa/bind-key-20230203.2004/bind-key hides 
> /usr/share/emacs/29.4/lisp/use-package/bind-key
> /home/husain/.emacs.d/elpa/eglot-1.17/eglot hides 
> /usr/share/emacs/29.4/lisp/progmodes/eglot
> /home/husain/.emacs.d/elpa/eldoc-1.15.0/eldoc hides 
> /usr/share/emacs/29.4/lisp/emacs-lisp/eldoc
> 
> Features:
> (mailalias mailclient dabbrev mm-archive misearch multi-isearch shadow
> bbdb-message emacsbug mule-util smiley gnus-cite message-view-patch
> mail-extr textsec uni-scripts idna-mapping ucs-normalize uni-confusable
> textsec-check gnus-bcklg gnus-async sort gnus-ml disp-table
> cello-light-theme ef-cherie-theme ef-themes consult nndraft nnmh
> nnmaildir bbdb-gnus nnnil gnus-agent gnus-srvr gnus-score score-mode
> nnvirtual gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime gnutls
> dig nntp gnus-cache gnus-sum gnus-group gnus-undo gnus-start gnus-dbus
> dbus gnus-cloud nnimap nnmail mail-source utf7 nnoo parse-time gnus-spec
> gnus-int gnus-range gnus-win org-roam-protocol org-protocol
> org-roam-migrate org-roam-log org-roam-mode org-roam-capture org-roam-id
> org-roam-node org-roam-db emacsql-sqlite-builtin sqlite org-roam-utils
> org-roam-compat org-roam org-capture org-attach emacsql-sqlite
> emacsql-sqlite-common emacsql emacsql-compiler elfeed-show elfeed-search
> vc-git vc-dispatcher elfeed-csv elfeed elfeed-curl elfeed-log elfeed-db
> elfeed-lib url-queue xml-query erc-goodies erc iso8601 erc-backend
> erc-networks erc-common erc-compat erc-loaddefs bbdb-mua bbdb-com bbdb
> bbdb-site timezone gnus nnheader range org-noter org-noter-djvu
> org-noter-nov nov recentf tree-widget shr pixel-fill kinsoku url-file
> svg xml esxml-query dom org-noter-pdf org-noter-core pdf-tools cus-edit
> cus-load wid-edit pdf-view magit-bookmark bookmark pp jka-compr
> pdf-cache pdf-info tq pdf-util pdf-macs image-mode exif ledger-mode
> ledger-check ledger-texi ledger-test ledger-sort ledger-report
> ledger-reconcile ledger-occur ledger-fonts ledger-fontify ledger-state
> ledger-complete ledger-schedule ledger-init ledger-xact ledger-post
> ledger-exec ledger-navigate eshell esh-cmd esh-ext esh-opt esh-proc
> esh-io esh-arg esh-module esh-groups esh-util files-x ledger-context
> ledger-commodities ledger-regex scad-mode ox-gfm htmlize ob-latex ox-odt
> rng-loc rng-uri rng-parse rng-match rng-dt rng-util rng-pttrn nxml-parse
> nxml-ns nxml-enc xmltok nxml-util ox-md ox-latex ox-icalendar ox-html
> table ox-ascii ox-publish ox org-habit org-agenda org-element
> org-persist xdg org-id org-refile org ob ob-tangle ob-ref ob-lob
> ob-table org-macro org-src ob-comint org-pcomplete org-list org-footnote
> org-faces org-entities noutline outline ob-emacs-lisp org-table org-keys
> org-loaddefs find-func avl-tree ol oc ob-exp ob-core org-cycle org-fold
> org-fold-core org-compat ob-eval org-version org-macs link-hint
> goto-addr avy cal-menu calendar cal-loaddefs ediff ediff-merg ediff-mult
> ediff-wind ediff-diff ediff-help ediff-init ediff-util git-link
> magit-submodule magit-blame magit-stash magit-reflog magit-bisect
> magit-push magit-pull magit-fetch magit-clone magit-remote magit-commit
> magit-sequence magit-notes magit-worktree magit-tag magit-merge
> magit-branch magit-reset magit-files magit-refs magit-status magit
> magit-repos magit-apply magit-wip magit-log which-func imenu magit-diff
> smerge-mode diff diff-mode git-commit log-edit message sendmail
> yank-media puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg
> rfc6068 epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse
> rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev
> mail-utils gmm-utils mailheader pcvs-util add-log magit-core
> magit-autorevert autorevert filenotify magit-margin magit-transient
> magit-process with-editor time-date shell pcomplete server magit-mode
> transient magit-git magit-base magit-section format-spec cursor-sensor
> crm dash edmacro kmacro sqlformat reformatter go-mode find-file ffap
> thingatpt etags fileloop generator xref project scala-mode
> scala-mode-prettify-symbols scala-mode-imenu scala-mode-map
> scala-mode-fontlock scala-mode-indent scala-mode-paragraph
> scala-mode-syntax scala-mode-lib typescript-mode cc-mode cc-fonts
> cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs
> compile text-property-search comint ansi-osc ring yaml-mode ansi-color
> exec-path-from-shell corfu orderless vertico compat diminish which-key
> use-package use-package-ensure use-package-delight use-package-diminish
> use-package-bind-key bind-key use-package-core finder-inf comp comp-cstr
> warnings icons rx cl-extra help-mode ispell bbdb-autoloads
> corfu-autoloads diminish-autoloads ef-themes-autoloads eglot-autoloads
> eldoc-autoloads elfeed-autoloads emacs-everywhere-autoloads
> embark-consult-autoloads consult-autoloads embark-autoloads
> exec-path-from-shell-autoloads f-autoloads ggtags-autoloads
> git-link-autoloads go-mode-autoloads htmlize-autoloads jsonrpc-autoloads
> ledger-mode-autoloads link-hint-autoloads marginalia-autoloads
> markdown-mode-autoloads magit-autoloads git-commit-autoloads
> modus-themes-autoloads nov-autoloads orderless-autoloads
> org-noter-autoloads org-roam-autoloads magit-section-autoloads
> emacsql-autoloads ox-gfm-autoloads pdf-tools-autoloads request-autoloads
> scad-mode-autoloads scala-mode-autoloads show-font-autoloads
> sqlformat-autoloads reformatter-autoloads standard-themes-autoloads
> tablist-autoloads transient-autoloads treemacs-autoloads
> posframe-autoloads ht-autoloads hydra-autoloads pfuture-autoloads
> ace-window-autoloads avy-autoloads s-autoloads dash-autoloads
> typescript-mode-autoloads use-package-autoloads bind-key-autoloads
> vertico-autoloads w3m-load w3m-autoloads which-key-autoloads
> with-editor-autoloads info compat-autoloads yaml-mode-autoloads
> auctex-autoloads tex-site package browse-url url url-proxy url-privacy
> url-expand url-methods url-history url-cookie generate-lisp-file
> url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq
> eieio eieio-core cl-macs password-cache json subr-x map byte-opt gv
> bytecomp byte-compile url-vars cl-loaddefs cl-lib rmc delsel lpr
> easy-mmode pcase iso-transl tooltip cconv eldoc paren electric uniquify
> ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/pgtk-win
> pgtk-win term/common-win pgtk-dnd 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 inotify dynamic-setting
> system-font-setting font-render-setting cairo gtk pgtk lcms2 multi-tty
> make-network-process native-compile emacs)
> 
> Memory information:
> ((conses 16 1306461 97685)
>   (symbols 48 47318 18)
>   (strings 32 522080 13600)
>   (string-bytes 1 26474941)
>   (vectors 16 262284)
>   (vector-slots 8 3657817 148039)
>   (floats 8 1262 501)
>   (intervals 56 4819 450)
>   (buffers 984 34))
> 
> 
> 
> 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75884; Package emacs. (Sat, 08 Feb 2025 12:29:02 GMT) Full text and rfc822 format available.

Message #11 received at 75884 <at> debbugs.gnu.org (full text, mbox):

From: Sean Whitton <spwhitton <at> spwhitton.name>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Husain Alshehhi <husain <at> alshehhi.io>, Dmitry Gutov <dmitry <at> gutov.dev>,
 75884 <at> debbugs.gnu.org, Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#75884: 29.4; Dash character "-" appears as diff when it is
 the leading character in a line in a patch
Date: Sat, 08 Feb 2025 12:28:42 +0000
Hello,

On Sat 08 Feb 2025 at 11:32am +02, Eli Zaretskii wrote:

>> Date: Sun, 26 Jan 2025 21:39:35 -0600
>> From: Husain Alshehhi <husain <at> alshehhi.io>
>>
>> diff-mode does not handle a patch very well. In particular, if a patch
>> contains the commit message, and if the commit message contains a dash
>> character "-" at the beginning of a line, diff-mode interprets this as a
>> diff rather than part of the commit message.
>>
>> To replicate this bug: copy the following in a file (e.g. test.patch),
>> open it in diff-mode, and you will see that the line "- unordered lists"
>> shows up in `diff-indicator-removed' face:
>
> I also see the final "--" line in that face, FWIW.
>
> Dmitry, Juri, Sean: any comments or suggestions?

For patches generated by git, indeed, anything before the first hunk
should not be fontified as though it were a patch.

Similarly we should look for a "-- " line at the end of the message and
treat it as an e-mail signature.

But one question I immediately have is how much of this is Git-specific.
Is there some specification of the unified diff format anywhere?

Could there be non-Git unidifed diffs this would break?

-- 
Sean Whitton




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75884; Package emacs. (Sat, 08 Feb 2025 18:05:02 GMT) Full text and rfc822 format available.

Message #14 received at 75884 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Sean Whitton <spwhitton <at> spwhitton.name>
Cc: Husain Alshehhi <husain <at> alshehhi.io>, Dmitry Gutov <dmitry <at> gutov.dev>,
 Eli Zaretskii <eliz <at> gnu.org>, 75884 <at> debbugs.gnu.org
Subject: Re: bug#75884: 29.4; Dash character "-" appears as diff when it is
 the leading character in a line in a patch
Date: Sat, 08 Feb 2025 19:58:23 +0200
> For patches generated by git, indeed, anything before the first hunk
> should not be fontified as though it were a patch.
>
> Similarly we should look for a "-- " line at the end of the message and
> treat it as an e-mail signature.

Completely agree.

> But one question I immediately have is how much of this is Git-specific.
> Is there some specification of the unified diff format anywhere?
>
> Could there be non-Git unidifed diffs this would break?

There is already some Git-specific code in diff-mode that depends
on 'diff-buffer-type' being equal to 'git' such as in
'diff-prev-line-if-patch-separator'.  This could be used
also to exclude font-locking from header (anything until
the first line , i.e. `(re-search-forward "^diff --git" nil t)`)
and footer (anything after `(looking-at "^-- $")`).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75884; Package emacs. (Sat, 08 Feb 2025 21:15:02 GMT) Full text and rfc822 format available.

Message #17 received at 75884 <at> debbugs.gnu.org (full text, mbox):

From: Sean Whitton <spwhitton <at> spwhitton.name>
To: Juri Linkov <juri <at> linkov.net>
Cc: Husain Alshehhi <husain <at> alshehhi.io>, Dmitry Gutov <dmitry <at> gutov.dev>,
 Eli Zaretskii <eliz <at> gnu.org>, 75884 <at> debbugs.gnu.org
Subject: Re: bug#75884: 29.4; Dash character "-" appears as diff when it is
 the leading character in a line in a patch
Date: Sat, 08 Feb 2025 21:14:44 +0000
Hello,

On Sat 08 Feb 2025 at 07:58pm +02, Juri Linkov wrote:

>> For patches generated by git, indeed, anything before the first hunk
>> should not be fontified as though it were a patch.
>>
>> Similarly we should look for a "-- " line at the end of the message and
>> treat it as an e-mail signature.
>
> Completely agree.
>
>> But one question I immediately have is how much of this is Git-specific.
>> Is there some specification of the unified diff format anywhere?
>>
>> Could there be non-Git unidifed diffs this would break?
>
> There is already some Git-specific code in diff-mode that depends
> on 'diff-buffer-type' being equal to 'git' such as in
> 'diff-prev-line-if-patch-separator'.  This could be used
> also to exclude font-locking from header (anything until
> the first line , i.e. `(re-search-forward "^diff --git" nil t)`)
> and footer (anything after `(looking-at "^-- $")`).

Okay.  Then I think we know what is needed here.

-- 
Sean Whitton




Severity set to 'minor' from 'normal' Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Tue, 11 Feb 2025 07:16:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75884; Package emacs. (Sat, 22 Feb 2025 09:27:02 GMT) Full text and rfc822 format available.

Message #22 received at 75884 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Sean Whitton <spwhitton <at> spwhitton.name>
Cc: husain <at> alshehhi.io, dmitry <at> gutov.dev, 75884 <at> debbugs.gnu.org,
 juri <at> linkov.net
Subject: Re: bug#75884: 29.4; Dash character "-" appears as diff when it is
 the leading character in a line in a patch
Date: Sat, 22 Feb 2025 11:25:53 +0200
Ping! Can we make some progress here?

> From: Sean Whitton <spwhitton <at> spwhitton.name>
> Cc: Husain Alshehhi <husain <at> alshehhi.io>,  Dmitry Gutov <dmitry <at> gutov.dev>,
>   Eli Zaretskii <eliz <at> gnu.org>,  75884 <at> debbugs.gnu.org
> Date: Sat, 08 Feb 2025 21:14:44 +0000
> 
> Hello,
> 
> On Sat 08 Feb 2025 at 07:58pm +02, Juri Linkov wrote:
> 
> >> For patches generated by git, indeed, anything before the first hunk
> >> should not be fontified as though it were a patch.
> >>
> >> Similarly we should look for a "-- " line at the end of the message and
> >> treat it as an e-mail signature.
> >
> > Completely agree.
> >
> >> But one question I immediately have is how much of this is Git-specific.
> >> Is there some specification of the unified diff format anywhere?
> >>
> >> Could there be non-Git unidifed diffs this would break?
> >
> > There is already some Git-specific code in diff-mode that depends
> > on 'diff-buffer-type' being equal to 'git' such as in
> > 'diff-prev-line-if-patch-separator'.  This could be used
> > also to exclude font-locking from header (anything until
> > the first line , i.e. `(re-search-forward "^diff --git" nil t)`)
> > and footer (anything after `(looking-at "^-- $")`).
> 
> Okay.  Then I think we know what is needed here.
> 
> -- 
> Sean Whitton
> 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75884; Package emacs. (Sat, 22 Feb 2025 11:53:02 GMT) Full text and rfc822 format available.

Message #25 received at 75884 <at> debbugs.gnu.org (full text, mbox):

From: Sean Whitton <spwhitton <at> spwhitton.name>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: husain <at> alshehhi.io, dmitry <at> gutov.dev, 75884 <at> debbugs.gnu.org,
 juri <at> linkov.net
Subject: Re: bug#75884: 29.4; Dash character "-" appears as diff when it is
 the leading character in a line in a patch
Date: Sat, 22 Feb 2025 19:52:15 +0800
Hello,

On Sat 22 Feb 2025 at 11:25am +02, Eli Zaretskii wrote:

> Ping! Can we make some progress here?

Someone needs to implement it.  It's not a trivial amount of work.

It's also not a high priority issue, IMO.

-- 
Sean Whitton




Added tag(s) confirmed. Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Sun, 23 Feb 2025 05:42:02 GMT) Full text and rfc822 format available.

Reply sent to Stefan Kangas <stefankangas <at> gmail.com>:
You have taken responsibility. (Mon, 03 Mar 2025 17:58:03 GMT) Full text and rfc822 format available.

Notification sent to Husain Alshehhi <husain <at> alshehhi.io>:
bug acknowledged by developer. (Mon, 03 Mar 2025 17:58:03 GMT) Full text and rfc822 format available.

Message #32 received at 75884-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Sean Whitton <spwhitton <at> spwhitton.name>
Cc: husain <at> alshehhi.io, dmitry <at> gutov.dev, Eli Zaretskii <eliz <at> gnu.org>,
 75884-done <at> debbugs.gnu.org, juri <at> linkov.net
Subject: Re: bug#75884: 29.4; Dash character "-" appears as diff when it is
 the leading character in a line in a patch
Date: Mon, 3 Mar 2025 09:56:53 -0800
Version: 31.1

Sean Whitton <spwhitton <at> spwhitton.name> writes:

> Hello,
>
> On Sat 22 Feb 2025 at 11:25am +02, Eli Zaretskii wrote:
>
>> Ping! Can we make some progress here?
>
> Someone needs to implement it.  It's not a trivial amount of work.
>
> It's also not a high priority issue, IMO.

This should now be fixed on master.  Please test.

I'm closing this bug report for now.  We can reopen if there is anything
more to do here.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75884; Package emacs. (Sun, 09 Mar 2025 06:14:02 GMT) Full text and rfc822 format available.

Message #35 received at 75884 <at> debbugs.gnu.org (full text, mbox):

From: Sean Whitton <spwhitton <at> spwhitton.name>
To: 75884 <at> debbugs.gnu.org
Cc: husain <at> alshehhi.io, stefankangas <at> gmail.com
Subject: Re: bug#75884: 29.4; Dash character "-" appears as diff when it is
 the leading character in a line in a patch
Date: Sun, 09 Mar 2025 14:13:34 +0800
Hello,

On Mon 03 Mar 2025 at 09:56am -08, Stefan Kangas wrote:

> Version: 31.1
>
> Sean Whitton <spwhitton <at> spwhitton.name> writes:
>
>> Hello,
>>
>> On Sat 22 Feb 2025 at 11:25am +02, Eli Zaretskii wrote:
>>
>>> Ping! Can we make some progress here?
>>
>> Someone needs to implement it.  It's not a trivial amount of work.
>>
>> It's also not a high priority issue, IMO.
>
> This should now be fixed on master.  Please test.
>
> I'm closing this bug report for now.  We can reopen if there is anything
> more to do here.

LGTM.  Thanks, Stefan.

-- 
Sean Whitton




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75884; Package emacs. (Thu, 13 Mar 2025 02:06:02 GMT) Full text and rfc822 format available.

Message #38 received at 75884-done <at> debbugs.gnu.org (full text, mbox):

From: "Husain Alshehhi" <husain <at> alshehhi.io>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: dmitry <at> gutov.dev, Eli Zaretskii <eliz <at> gnu.org>, juri <at> linkov.net,
 75884-done <at> debbugs.gnu.org, Sean Whitton <spwhitton <at> spwhitton.name>
Subject: Re: bug#75884: 29.4; Dash character "-" appears as diff when it is
 the leading character in a line in a patch
Date: Wed, 12 Mar 2025 21:05:03 -0500
Stefan Kangas <stefankangas <at> gmail.com> writes:

> This should now be fixed on master.  Please test.
>
> I'm closing this bug report for now.  We can reopen if there is anything
> more to do here.

Thank you Stefan. I tested the fix on few patches and it works as
expected. Thank you again for your work!

-- 
Husain




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 10 Apr 2025 11:24:15 GMT) Full text and rfc822 format available.

This bug report was last modified 83 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.