Елена | 2 Sep 06:17 2014

Есть проблемы с сайтом? Мы поможем!

ТОЛЬКО ДО 15 сентяюря 2014 года!

1. Хостинг и домен в зоне RU на ваше имя на 1 год
2. Наполнение сайта текстом и фото (предоставляется заказчиком)
3. Форма отправки сообщений и карта проезда
4. Красивая фотогалерея
5. Создание 6-8 страниц сайта

Заказать сайт

(812) 981-72-40
(952) 368-65-21

info <at> el-sites.ru

Skype: el.sites


Если Вы хотите отписаться от рассылки, нажмите здесь
implementations-list mailing list
implementations-list <at> lists.ourproject.org
Tad Ashlock | 24 Aug 16:29 2014

Issues Integrating Other Modes With Evil-Mode

I'm attempting to integrate org-mode with evil-mode.  I'm aware of the existing evil-org-mode, but what I'm attempting is much deeper.  Rather than just adding some evil keybindings to some org functions, I want
 the basic evil operations to work on org files.  That is, evil-mode operators, commands, and motions are org-aware.

I see that when evil-mode is in the normal state:

* the user presses 'x', which is bound to evil-delete-char
* evil-delete-char calls evil-delete
* evil-delete calls Emacs's delete-region to perform the deletion

When my new evil-org-mode (a minor mode) is active, I need evil-delete-char to call org-delete-char to perform the deletion.  Not directly, of course.  The following seems to work.

(defun evil-org-delete-region (beg end)
  (let ((N (- end beg)))
      (goto-char beg)
      (org-delete-char N))))

(evil-define-operator evil-org-delete-char (beg end type register)
  "Delete next character."
  :motion evil-forward-char
  (interactive "<R><x>")
  (cl-letf (((symbol-function 'delete-region) #'(lambda (beg end) (evil-org-delete-region beg end))))
    (evil-delete beg end type register)))

(define-key evil-org-mode-map [remap evil-delete-char] #'evil-org-delete-char)

Essentially, I remap evil-delete-char to evil-org-delete-char.  This new function temporarily redefines delete-region to be evil-org-delete-region, which, in turn, calls org-delete-char.  Then the subsequent cal
l to evil-delete will call org-delete-char with no changes to the evil-mode source code.  Great!  But...

(1) This approach gets more complicated for other evil-mode functions.

    * For example, evil-org-delete-backward-char-and-join requires more indirection in order to restore the function-cell value of delete-backward-char, because that's what the org-mode function needs to call.

    * Remapping a remapped binding doesn't chain.  And it appears that remapping a binding in my minor mode doesn't override the remapped binding that evil-mode does.  For example, if I remap delete-backward-cha
r in evil-org-mode, the evil-mode (insert state) binding (evil-delete-backward-char-and-join) still gets called.

    * I can't figure out how to intercept operators like "dd" (delete whole line), in order to override their low-level Emacs calls.

(2) This approach isn't composable.  That is, another minor mode could not integrate with evil-mode while evil-org-mode is active.


(1) Is there a good, clean, composable, way of doing what I'm trying to do?

(2) If not, is there an acceptable change that could be made to evil-mode to support what I'm trying to do?  A change that improves the ability to integrate with evil-mode in general, not just for my purpose?

If the answer to question (1) is 'no', I'm thinking the answer to question (2) might be something along the lines of replacing evil-mode's calls to fundamental Emacs text manipulation commands (like delete-regio
n) with (abnormal) hooks.  Each hook would default to being the command currently being called directly, but could be made buffer local and modified by another mode to support awareness of the buffer's contents.
  This would also allow, in theory, multiple modes to hook into the actions.  Although I can't quite picture how this would work cleanly in practice.

Thank you,
implementations-list mailing list
implementations-list <at> lists.ourproject.org
Linus Arver | 9 Aug 17:17 2014

cursor: make underlying letter bold


In GVim, when I move my cursor around in normal mode, the letter
underneath the cursor position becomes bolded.

Is there a simple way to do the same thing in Evil? Or, is this is more
of a syntax highlighting issue?

While I'm not a Lisp expert, I can see that my request involves
`evil-set-cursor` in evil-common.el...

Bob Nnamtrop | 30 Jul 18:46 2014

Include underscore in word

This seems like a trivial question but a lot of searching has not produced an answer. I'm trying to make the change from viper to evil. One thing that surprises me is the underscores are not considered part of a work for various word commands (e.g, w, cw, etc). I tried vim and they are considered part of the word and in viper they are as well. I find the choice in evil strange. Is there a way to make underscores part of words in evil?

implementations-list mailing list
implementations-list <at> lists.ourproject.org
Linus Arver | 26 Jul 18:56 2014

visual selection and X primary behavior

Hello all,

In regular Emacs (with Evil mode turned on, of course), I can (1) do
visual selection of a region, and it will automatically copy that
selection into the X primary selection buffer. This way, I can simply do
SHIFT+INSERT in another X program (e.g., Firefox) and I will paste the
selection that way. Conversely, I can (2) SHIFT+INSERT into Emacs/Evil
(in Insert mode), and it will paste whatever is in the X primary buffer.

However, behavior (1) does not work in terminal-mode Emacs (`emacs
-nw`), although behavior (2) works as expected. I have tried to work
around this by using my `"+y` macro which is enabled with

    (define-key evil-normal-state-map ",y" "\"+y")

in my .emacs, but it fails with the message

    After 0 kbd macro iterations: X selection unavailable for this frame

. Is this a bug in Evil or is it something in Emacs itself?

Gulshan Singh | 1 Jul 08:06 2014

Vim Movement


I'm wondering how if it's possible emulate Vim word movement using the same M-f and M-b bindings in Emacs? I've currently done this:

(global-set-key (kbd "M-f") 'evil-forward-word-begin)
(global-set-key (kbd "M-b") 'evil-backward-word-end)

That's decent, but I think that actual Vim movement uses the evil-forward-word-end and evil-backward-word-begin methods as well. How can I do this?
implementations-list mailing list
implementations-list <at> lists.ourproject.org
Johann Klähn | 27 Jun 14:26 2014

evil: work on support for ]p, [p (adjust indent on paste)

Hi there,
I would like to work on a patch to add support for ]p and [p to evil. I have some working code (see below) to adjust the indent after a call to evil-paste-after / evil-paste-before, but I would appreciate tips on how to integrate this with existing evil code (especially so that ]p will be a single undo step, that evil-paste-pop still works, …).

All the best,

(defun get-common-indent-in-region (start end)
  (setq end (copy-marker end))
      (let (indentation)
          (goto-char start)
          (or (bolp) (forward-line 1))
          (while (< (point) end)
            (skip-chars-forward " \t")
            (setq indentation
                  (cons (current-column) indentation))
            (forward-line 1)))
        (apply #'min indentation))
    (move-marker end nil)))

(defun my-evil-adjust-indent-afer-paste ()

  (unless (memq last-command
    (error "Previous command was not a line-wise evil-paste: %s" last-command))

  (let* ((start (evil-get-marker ?\[))
         (end (evil-get-marker ?\]))
         (common (get-common-indent-in-region start end))
             ((eq last-command 'evil-paste-before)
              (goto-char end)
              (forward-line 1))
              (goto-char start)
              (forward-line -1)))
            (skip-chars-forward " \t")
    (indent-rigidly start end (- this common))))
implementations-list mailing list
implementations-list <at> lists.ourproject.org
Justin M. Keyes | 7 Jun 09:45 2014

binding to "cp" without breaking "c"


I'm trying to bind a command to the "unused namespace" that happens to
start with "c". By "unused namespace" I mean things like "cp" or "co"
for which there is no valid text object or motion. In Vim, you can
bind "cow" and it does not affect the behavior of "cdw", "ciw", etc,
because "o" is not defined as a text object. For example, in
unimpaired.vim[1], "cow" toggles word-wrap. I would like to do this in
emacs evil, so I tried:

    (define-key evil-normal-state-map (kbd "c o w") 'toggle-truncate-lines)

It reports "eval-region: Key sequence c p w starts with non-prefix key
c". But I don't want to unbind "c" because then I can't use the
evil-change operator.

I tried defining a custom operator, but after looking at the evil
source code I couldn't figure out how to hook into evil-change to
preserve its behavior while listening for "o" and then routing it
somewhere else.

It seems like I'm missing something, I would think this is a common
task, but I haven't found any posts that address this.

Thanks for evil, it's superb!

[1] https://github.com/tpope/vim-unimpaired

Justin M. Keyes
Ed Kostas | 6 Jun 10:26 2014

In Evil, Ctrl-o is not working like in Vim

When I press Ctrl-o in insert state, then press :w, Evil remains in normal
state after executing the colon command.  

When I press Ctrl-o in Vim, then the :w command, the command is 
executed and Vim returns to the insert state.

In other words, in Vim, Ctrl-o executes one command and remains
in insert state. In Evil, it remains in Normal state after executing the 

It would be fine if Ctrl-o had exactly the same behaviour in Evil and
in Vim. Is there any reason for this not being so?
Dima Gorbik | 2 Jun 08:01 2014

Opening a new line in evil-mode

Hello all,

Please take a look at the following piece of code:

(goto-char (point-max))
(insert "\n”)

In normal state of evil-mode goto-char moves the cursor to the end of line visually, but it points before the
last symbol, not after. Although the example above works just fine — it works as if the cursor is pointing
after the last symbol so the last symbol is not carried to the next line which is a correct behavior. I wonder
how evil determines that it needs to insert after the last symbol, not before.

The reason I ask about this is because I am trying to understand why hitting enter in haskell-mode repl in
normal state in evil-mode puts the last symbol of the current line on the next line. It looks like (insert
"\n") is invoked in a callback and evil doesn't know that it needs to maintain the compatibility.

Stefan Monnier | 30 May 17:46 2014

Including Evil in GNU ELPA

I remember asking this a few years ago, but somehow I can't seem to find
the answer.  So here it is again: I think it would be great to include
Evil in the GNU ELPA archive.

Would Evil's maintainers be interested in doing so?  If yes, then please
get in touch with me, so we can work out the details (which mostly have
to do with copyright paperwork, since we have the same policy for GNU
ELPA as for Emacs, to make it easy to move code between the two).