GNU bug report logs - #25555
25.1.91; smerge-keep-current -vs- empty change

Previous Next

Package: emacs;

Reported by: Tom Tromey <tom <at> tromey.com>

Date: Fri, 27 Jan 2017 13:49:01 UTC

Severity: normal

Found in version 25.1.91

Done: Tom Tromey <tom <at> tromey.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 25555 in the body.
You can then email your comments to 25555 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#25555; Package emacs. (Fri, 27 Jan 2017 13:49:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tom Tromey <tom <at> tromey.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 27 Jan 2017 13:49:01 GMT) Full text and rfc822 format available.

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

From: Tom Tromey <tom <at> tromey.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.1.91; smerge-keep-current -vs- empty change
Date: Fri, 27 Jan 2017 06:48:17 -0700
I'm using smerge to fix up some files after a rebase.

I have a change that looks like:

<<<<<<< 9f33cac3f07100fe4835ade224e10f3ce58affdc
=======
... lots of stuff here
>>>>>>> Bug 1060419 - make log_print use Printf.h, r?froydnj


I want to use smerge to keep the original change -- which is empty.
However C-c ^ RET (aka smerge-keep-current) on either the "<<<"
or "===" line says:

smerge-keep-current: Not inside a version

Tom


In GNU Emacs 25.1.91.3 (x86_64-unknown-linux-gnu, GTK+ Version 3.20.9)
 of 2017-01-27 built on pokyo
Repository revision: f87e6256c014434024793f02e4b51052357724c0
Windowing system distributor 'Fedora Project', version 11.0.11804000
System Description:	Fedora release 24 (Twenty Four)

Configured using:
 'configure --prefix=/home/tromey/Emacs/install
 --with-file-notifications=no'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND DBUS GCONF GSETTINGS NOTIFY
LIBSELINUX GNUTLS LIBXML2 FREETYPE LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS
GTK3 X11

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

Major mode: C++/l

Minor modes in effect:
  bug-reference-prog-mode: t
  erc-spelling-mode: t
  erc-truncate-mode: t
  diff-auto-refine-mode: t
  flyspell-mode: t
  which-function-mode: t
  projectile-global-mode: t
  projectile-mode: t
  erc-notify-mode: t
  erc-notifications-mode: t
  erc-services-mode: t
  erc-list-mode: t
  erc-menu-mode: t
  erc-autojoin-mode: t
  erc-ring-mode: t
  erc-networks-mode: t
  erc-pcomplete-mode: t
  erc-track-mode: t
  erc-track-minor-mode: t
  erc-match-mode: t
  erc-netsplit-mode: t
  erc-hl-nicks-mode: t
  erc-button-mode: t
  erc-fill-mode: t
  erc-stamp-mode: t
  erc-irccontrols-mode: t
  erc-noncommands-mode: t
  erc-move-to-prompt-mode: t
  erc-readonly-mode: t
  savehist-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  auto-fill-function: tromey-c++-do-auto-fill
  transient-mark-mode: t
  abbrev-mode: t

Recent messages:
C-c C-g is undefined
^ runs the command self-insert-command
C-c ^ a runs the command smerge-keep-all
smerge-keep-current: Not inside a version
Mark set
C-c ^ C-g is undefined
Mark set [2 times]
smerge-keep-current: Not inside a version [2 times]
Quit
Type C-x 1 to delete the help window.

Load-path shadows:
/home/tromey/.emacs.d/elpa/bubbles-0.5/bubbles hides /home/tromey/Emacs/install/share/emacs/25.1.91/lisp/play/bubbles

Features:
(shadow mail-hist eieio-opt speedbar sb-image ezimage dframe emacsbug
smerge-mode git-rebase-mode gnus-html url-cache mm-url flow-fill
git-commit-mode derived log-edit pcvs-util term/xterm xterm copyright
misearch multi-isearch add-log bug-reference cc-mode cc-fonts cc-guess
cc-menus cc-cmds erc-spelling erc-truncate url-http url url-proxy
url-privacy url-history url-auth url-cookie url-domsuf url-gw url-expand
url-methods bbdb-gui bbdb-hooks bbdb-rmail rmailsum rmail vc-mtn vc-hg
vc-git diff-mode vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs sort
gnus-cite smiley shr-color url-util url-parse url-vars shr dom
browse-url mm-archive gnus-bcklg gnus-async qp gnus-ml disp-table
gnus-topic nndraft nnmh nnfolder utf-7 bbdb-gnus bbdb-snarf mail-extr
bbdb-com network-stream nsm starttls gnus-agent gnus-srvr gnus-score
score-mode nnvirtual gnus-msg nntp gnus-cache gnus-registry registry
eieio-compat eieio-base gnus-art mm-uu mml2015 mm-view mml-smime smime
dig mailcap gnus-sum gnus-group gnus-undo smtpmail sendmail gnus-start
gnus-cloud nnimap nnmail mail-source tls gnutls utf7 netrc nnoo
parse-time gnus-spec gnus-int gnus-range message idna rfc822 mml mml-sec
epg mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045
ietf-drums mailabbrev gmm-utils mailheader gnus-win gnus gnus-ems
nnheader mail-utils flyspell ispell diminish appt diary-lib
diary-loaddefs cal-menu calendar cal-loaddefs which-func imenu edmacro
kmacro projectile grep compile ibuf-ext ibuffer minimap autorevert
filenotify desktop frameset cus-start cus-load erc-notify
erc-desktop-notifications notifications dbus xml erc-services erc-list
erc-menu erc-join erc-ring erc-networks erc-pcomplete pcomplete
erc-track erc-match erc-netsplit erc-hl-nicks easy-mmode color
erc-button erc-fill erc-stamp wid-edit erc-goodies erc erc-backend
erc-compat format-spec auth-source cl-seq eieio gnus-util mm-util
help-fns mail-prsvr password-cache thingatpt pp status dired-aux dired-x
dired warnings advice vc-dir ewoc vc vc-dispatcher flycheck json map
find-func rx subr-x dash cc-styles cc-align cc-engine cc-vars cc-defs
bbdb cl timezone ange-ftp comint ansi-color ring server savehist
finder-inf bbdb-autoloads dwarf-mode-autoloads eieio-core cl-macs
lisppaste-autoloads pydoc-info-autoloads info-look weblogger-autoloads
info package epg-config seq byte-opt gv bytecomp byte-compile cl-extra
help-mode easymenu cconv cl-loaddefs pcase cl-lib time-date mule-util
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt
fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register
page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock
font-lock syntax facemenu font-core frame cl-generic 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 charscript case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote dbusbind inotify dynamic-setting
system-font-setting font-render-setting move-toolbar gtk x-toolkit x
multi-tty make-network-process emacs)

Memory information:
((conses 16 2558550 1048482)
 (symbols 48 104945 1)
 (miscs 40 24265 2936)
 (strings 32 1221955 378296)
 (string-bytes 1 55754709)
 (vectors 16 102146)
 (vector-slots 8 1892301 171245)
 (floats 8 901 569)
 (intervals 56 10813 3481)
 (buffers 976 314)
 (heap 1024 241396 127693))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25555; Package emacs. (Sat, 09 Sep 2017 23:23:01 GMT) Full text and rfc822 format available.

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

From: Tom Tromey <tom <at> tromey.com>
To: Tom Tromey <tom <at> tromey.com>
Cc: 25555 <at> debbugs.gnu.org
Subject: Re: bug#25555: 25.1.91; smerge-keep-current -vs- empty change
Date: Sat, 09 Sep 2017 17:22:28 -0600
This patch fixes the problem for me.

Tom

commit 55289e4ce3adb27a6c03cc42783265cf4d680f25
Author: Tom Tromey <tom <at> tromey.com>
Date:   Sat Sep 9 17:20:43 2017 -0600

    Allow smerge-keep-current to work for empty hunks
    
    Bug#25555
    * lisp/vc/smerge-mode.el (smerge-get-current): Allow point to be at
    match-end.
    * test/lisp/vc/smerge-mode-tests.el: New file.

diff --git a/lisp/vc/smerge-mode.el b/lisp/vc/smerge-mode.el
index f94f8a6..302adfe 100644
--- a/lisp/vc/smerge-mode.el
+++ b/lisp/vc/smerge-mode.el
@@ -725,7 +725,7 @@ smerge-get-current
   (let ((i 3))
     (while (or (not (match-end i))
 	       (< (point) (match-beginning i))
-	       (>= (point) (match-end i)))
+	       (> (point) (match-end i)))
       (cl-decf i))
     i))
 
diff --git a/test/lisp/vc/smerge-mode-tests.el b/test/lisp/vc/smerge-mode-tests.el
new file mode 100644
index 0000000..204a4b9
--- /dev/null
+++ b/test/lisp/vc/smerge-mode-tests.el
@@ -0,0 +1,34 @@
+;; Copyright (C) 2017  Free Software Foundation, Inc
+
+;; Maintainer: emacs-devel <at> gnu.org
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
+
+;;; Code:
+
+(require 'smerge-mode)
+
+(ert-deftest smerge-mode-test-empty-hunk ()
+  "Regression test for bug #25555"
+  (with-temp-buffer
+    (insert "<<<<<<< one\n")
+    (save-excursion
+      (insert "=======\nLLL\n>>>>>>> end\n"))
+    (smerge-mode)
+    (smerge-keep-current)
+    (should (equal (buffer-substring (point-min) (point-max)) ""))))
+
+(provide 'smerge-mode-tests)




Reply sent to Tom Tromey <tom <at> tromey.com>:
You have taken responsibility. (Tue, 19 Sep 2017 02:27:02 GMT) Full text and rfc822 format available.

Notification sent to Tom Tromey <tom <at> tromey.com>:
bug acknowledged by developer. (Tue, 19 Sep 2017 02:27:02 GMT) Full text and rfc822 format available.

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

From: Tom Tromey <tom <at> tromey.com>
To: 25555-done <at> debbugs.gnu.org
Subject: done
Date: Mon, 18 Sep 2017 20:17:40 -0600
Fix checked in.

Tom




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 17 Oct 2017 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 7 years and 305 days ago.

Previous Next


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