emacs-evil / evil-ediff

Make ediff a little more evil

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

C-z is not listed in the ediff control panel

duianto opened this issue · comments

The evil-ediff key binding: C-z isn't listed in the ediff control panel, even though it's defined in the
evil-ediff-adjust-help function, below to the other evil-ediff keys that are listed in the ediff control panel.

(" z/q -suspend/quit " . "C-z/q -quit/suspend ")))

"quit" and "suspend" are swapped in the suggested C-z addition.

The "scroll up/dn" and "scroll lt/rt" entries:

                      ("  </> -scroll lt/rt  " . "zh/zl -scroll lt/rt  ")
                      ("  v/V -scroll up/dn  " . "C-u/d -scroll up/dn  ")

are also flipped compared with how they are shown in the ediff control panel,
../emacs-w64-25.1-O2/share/emacs/25.1/lisp/vc/ediff-help.el:

  v/V -scroll up/dn  | #f/#h -focus/hide regions | wx -save buf X
  </> -scroll lt/rt  |     X -read-only in buf X | wd -save diff output

System Info 💻

  • OS: windows-nt
  • Emacs: 25.1.1
  • Spacemacs: 0.200.7
  • Spacemacs branch: develop (rev. eef1a87e)
  • Graphic display: t
  • Distribution: spacemacs
  • Editing style: vim
  • Completion: helm
  • Layers:
((markdown :variables markdown-live-preview-engine 'vmd)
 auto-completion chrome emacs-lisp git helm html markdown org)
  • System configuration features: XPM JPEG TIFF GIF PNG RSVG SOUND DBUS NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS

Thanks. I fixed the suspend/quit thing.

I'm not sure what you mean by the scroll keys being flipped. C-u scrolls up the same way that it does in a regular buffer, for example.

Sorry for being unclear, the scroll keys work as expected, they are just listed in the opposite order.

In the file: https://github.com/justbur/evil-ediff/blob/master/evil-ediff.el#L82
the first scroll command is </> -scroll lt/rt:

                      ("  </> -scroll lt/rt  " . "zh/zl -scroll lt/rt  ")
                      ("  v/V -scroll up/dn  " . "C-u/d -scroll up/dn  ")

But in ../emacs-w64-25.1-O2/share/emacs/25.1/lisp/vc/ediff-help.el on line 57,
(I found an online version that matches the local version:
https://github.com/emacs-mirror/emacs/blob/master/lisp/vc/ediff-help.el#L57)

there are 5 defconst definitions where the first scroll command is v/V -scroll up/dn:
(defconst ediff-long-help-message-compare3
(defconst ediff-long-help-message-compare2
(defconst ediff-long-help-message-narrow2
(defconst ediff-long-help-message-word-mode

  v/V -scroll up/dn  | #f/#h -focus/hide regions | wx -save buf X
  </> -scroll lt/rt  |     X -read-only in buf X | wd -save diff output

(defconst ediff-long-help-message-merge

  v/V -scroll up/dn  |     X -read-only in buf X | wx -save buf X
  </> -scroll lt/rt  |     m -wide display       | wd -save diff output

Problem

There might be a risk of confusion if one jumps back and forth between the files while modifying the listings for the scroll commands, so it's probably better if they are listed in the same order.

Solution

The scroll commands look like this with v/V -scroll up/dn at the top:

                      ("    h -highlighting  " . "    H -highlighting  ")
                      ("  v/V -scroll up/dn  " . "C-u/d -scroll up/dn  ")
                      ("  </> -scroll lt/rt  " . "zh/zl -scroll lt/rt  ")
                      ("  z/q -suspend/quit"   . "C-z/q -suspend/quit")))

Thanks for fixing the C-z key not showing up, i thought that the issue might have been the 2 spaces after the search term z/q -suspend/quit , but then i saw that the h -highlight search term only has 2 spaces after it, but the ediff control panel listing has 7 spaces after it, so i got confused.

I guess that if a listing has one or more spaces after it, then the search term will find it even if it searches for less trailing spaces. But if there are no spaces after a listing z/q -suspend/quit, then the search term can't have spaces after it either.

I hope that made some sense.

Are you just talking about the order that they show up in in evil-ediff-adjust-help? I don't mind doing that, but it shouldn't affect what the user sees. See the latest commit.

Yes just the order in the (defun evil-ediff-adjust-help () function.
Thanks.