Samir Jindel | 5 Jul 2012 07:44
Favicon

evil-forward-char

Hello,


    In evil-mode, the evil-forward-char command restricts movement to the current line and does not allow highlighting the newline, in parallel with the behavior of vim. However, I have observed that even if I bind a key directly to forward-char in evil-mode, I still can not move to the next line or select the newline, though forward-char does work as expected if I leave evil-mode. Is there some way I re-enable the default behavior of forward-char in evil-mode?

Thanks.
_______________________________________________
implementations-list mailing list
implementations-list <at> lists.ourproject.org
https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list
Michael Markert | 5 Jul 2012 09:00
Gravatar

Re: evil-forward-char

Hi Samir,

On Thu, Jul 05 2012 (07:44), Samir Jindel <sjindel <at> tagged.com> wrote: 
> Is there some way I re-enable the default behavior of forward-char in
> evil-mode?

It seems to me you are looking for `evil-cross-lines'.

,----[ C-h v evil-cross-lines RET ]
| evil-cross-lines is a variable defined in `evil-vars.el'.
| Its value is t
| Original value was nil
| 
| Documentation:
| Whether motions may cross newlines.
| 
| You can customize this variable.
`----

This won't enable the "default behavior" of `forward-char' but $l
results in the cursor being at the first char of the next line.

Michael
_______________________________________________
implementations-list mailing list
implementations-list <at> lists.ourproject.org
https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list
York Zhao | 9 Jul 2012 02:14
Picon

Confused by what command is "dot repeatable"

Hi,

I still find myself confused by the "dot repeating" in Evil. I have many
commands, some of them are "automatically" dot repeatable but others are not.
For example, I have these two commands:

(defun foo ()
  (interactive)

  ...

  (kill-region beg end)

  ...

  (insert ...)

  ...)

(defun bar ()
  (interactive)

  ...
  (insert ...))

I don't see any essential difference between these two commands, except that
`foo' was being executed in org-mode while `bar' in c++-mode. And I have no idea
why command "foo" is dot repeatable but "bar" is not. I had tried using

(evil-declare-change-repeat 'bar)

but still, "bar" is not "dot" repeatable. I'm confused by what has made "foo"
repeatable. I don't have time to look deeply in the repeat system in Evil so I
would appreciate it if someone could give me some quick answer to my question.

Thanks,
York
York Zhao | 12 Jul 2012 18:18
Picon

Re: Confused by what command is "dot repeatable"

> Hi,
>
> I still find myself confused by the "dot repeating" in Evil. I have many
> commands, some of them are "automatically" dot repeatable but others are not.
> For example, I have these two commands:
>
> (defun foo ()
>   (interactive)
>
>   ...
>
>   (kill-region beg end)
>
>   ...
>
>   (insert ...)
>
>   ...)
>
>
> (defun bar ()
>   (interactive)
>
>   ...
>   (insert ...))
>
> I don't see any essential difference between these two commands, except that
> `foo' was being executed in org-mode while `bar' in c++-mode. And I have no idea
> why command "foo" is dot repeatable but "bar" is not. I had tried using
>
> (evil-declare-change-repeat 'bar)
>
> but still, "bar" is not "dot" repeatable. I'm confused by what has made "foo"
> repeatable. I don't have time to look deeply in the repeat system in Evil so I
> would appreciate it if someone could give me some quick answer to my question.
>
> Thanks,
> York

Anybody?
Frank Fischer | 13 Jul 2012 09:21
Picon

Re: Confused by what command is "dot repeatable"

Hi York,

sorry for not answering immediately, but I've been on a business trip
last weak and had simply no time. The same will be true for large
parts of the next few months so please excuse if responses take some
time. I'll always try to answer as soon as possible.

On 2012-07-12, York Zhao <gtdplatform <at> gmail.com> wrote:
>> Hi,
>>
>> I still find myself confused by the "dot repeating" in Evil. I have
>> many commands, some of them are "automatically" dot repeatable but
>> others are not. For example, I have these two commands:
>>
>> (defun foo ()
>>   (interactive)
>>
>>   ...
>>
>>   (kill-region beg end)
>>
>>   ...
>>
>>   (insert ...)
>>
>>   ...)
>>
>>
>> (defun bar ()
>>   (interactive)
>>
>>   ...
>>   (insert ...))

I'm not sure what the problem is. I've just tried the following example

(defun bar ()
  (interactive)
  (save-excursion (insert "abc")))

(define-key evil-normal-state-map (kbd "C-q") 'bar)

and then in some empty buffer (after :new) 'C-q .' resulting in the
buffer content "abcabc" as expected.

Note that currently repeating only works for commands bound to
some key-bindings, calling them via M-x COMMAND RET may fail.

So please provide a complete example (full function definition, key
sequences, ...), preferably starting from a fresh emacs instance, that
demonstrates the problem. Otherwise it is really hard to isolate the
problem.

>> I don't see any essential difference between these two commands,
>> except that `foo' was being executed in org-mode while `bar' in
>> c++-mode. And I have no idea why command "foo" is dot repeatable
>> but "bar" is not. I had tried using

The mode *should* not make difference ...

>> (evil-declare-change-repeat 'bar)
>>
>> but still, "bar" is not "dot" repeatable. I'm confused by what has
>> made "foo" repeatable. I don't have time to look deeply in the
>> repeat system in Evil so I would appreciate it if someone could
>> give me some quick answer to my question.

The repeat system is always triggered by pre-command-hooks,
post-command-hooks and sometimes after-change-functions. Maybe some calls
in the body of "bar" confuse the system (something like
call-interactively could do, possibly others), but without an example
it's hard to give a definite answer.

Bye,
Frank
York Zhao | 13 Jul 2012 21:31
Picon

Re: Confused by what command is "dot repeatable"

> sorry for not answering immediately, but I've been on a business trip
> last weak and had simply no time. The same will be true for large
> parts of the next few months so please excuse if responses take some
> time. I'll always try to answer as soon as possible.

Really appreciate that you have taken your valuable time to answer my question,
and your answer have been very useful so far.

> Note that currently repeating only works for commands bound to
> some key-bindings, calling them via M-x COMMAND RET may fail.

Yes, you are right, I never binded these functions to any key, I used "M-x". And
if I bind my command "bar" to a key the dot repeating works. What I still don't
understand however, is that "M-x foo" is dot repeatable but not "M-x bar".

> So please provide a complete example (full function definition, key
> sequences, ...), preferably starting from a fresh emacs instance, that
> demonstrates the problem. Otherwise it is really hard to isolate the
> problem.

Here's the scenario:

First, in "scratch" buffer, input the following:

(defun york-bar ()
  (interactive)
  (save-excursion
    (insert "printf(\"checkpoint\")")))

Type "C-M-x" to instrument the command `york-bar'.

Then open a file in c++-mode and "M-x york-bar", "printf()" function
call gets inserted.

Hit ".", but nothing wouldn't get inserted again.

> The mode *should* not make difference ...

Yes, I've tried "M-x york-bar" in an org-mode buffer and got the same results.

On the other hand, the command `york-foo' which is dot repeatable even when
being executed by "M-x", is way more complicated, I have tried to isolate it but
failed, it had been tightly "connected" with my other part of configuration
files (huge).

The bottom line is, however, `york-bar' is dot repeatable if having it binded to
some key. Thanks again for the help.

York
Keshav Kini | 16 Jul 2012 04:12
Picon
Gravatar

evil-mode has led my cursor to the dark side!

Hi,

evil-mode is so evil that it has stained my cursor black, as black as
the soul of evil-mode!

I upgraded to Emacs 24.1 from 23.4, and I noticed a new Themes feature,
so I set up the "tsdh-dark" theme, only to find that my cursor is now
black, even though the background color is a dark gray. At first I
thought some of my old customizations might have been conflicting with
the theming, but after cleaning up my ~/.emacs as follows, I found the
cursor remained black.

    ; specify packages for el-get
    (setq my-packages
          '(column-marker
            cython-mode
            evil
            evil-surround
            haskell-mode
            python-mode
            undo-tree))

    (setq evil-want-C-u-scroll t)
    ; load el-get
    (add-to-list 'load-path "~/.emacs.d/el-get/el-get")
    (unless (require 'el-get nil t)
      (with-current-buffer
          (url-retrieve-synchronously
           "https://raw.github.com/dimitri/el-get/master/el-get-install.el")
        (end-of-buffer)
        (eval-print-last-sexp)))
    (el-get 'sync my-packages)

    ; evil settings
    (evil-mode 1)
    (define-key evil-normal-state-map ",l" 'whitespace-mode)

    ; column markers
    (add-hook 'python-mode-hook '(lambda () (interactive) (column-marker-1 73) (column-marker-2 80)))
    (add-hook 'rst-mode-hook '(lambda () (interactive) (column-marker-1 73)))

    ; load Japanese input
    (require 'mozc)
    (setq default-input-method "japanese-mozc")

    ; setup smtpmail
    ; [redacted]

    ; start daemon
    (server-start)

    (custom-set-variables
     ;; custom-set-variables was added by Custom.
     ;; If you edit it by hand, you could mess it up, so be careful.
     ;; Your init file should contain only one such instance.
     ;; If there is more than one, they won't work right.
     '(custom-enabled-themes (quote (tsdh-dark)))
     '(evil-want-C-u-scroll t)
     '(file-precious-flag t)
     '(indent-tabs-mode nil))
    (custom-set-faces
     ;; custom-set-faces was added by Custom.
     ;; If you edit it by hand, you could mess it up, so be careful.
     ;; Your init file should contain only one such instance.
     ;; If there is more than one, they won't work right.
     '(default ((t (:width semi-condensed)))))

Then I suspected that the theme was just badly designed. But on a hunch,
I tried commenting out the line "(evil-mode 1)", and restarted
Emacs. The cursor was white! And running "M-x evil-mode" made it black
again.

How can I fix this? Is it a bug in evil-mode, or am I just doing
something wrong?

-Keshav
Barry OReilly | 16 Jul 2012 17:23
Picon

Re: Confused by what command is "dot repeatable"

I defined york-bar the same as you and invoked M-x york-bar while in
normal state.  Then I did the . command and entered the elisp debugger
because of error:

Debugger entered--Lisp error: (void-variable p)
  eval(p nil)
  eval-last-sexp-1(nil)
  eval-last-sexp(nil)
  call-interactively(eval-last-sexp nil nil)
  execute-kbd-macro([115 101 120])
  evil-execute-repeat-info(([115 101 120]))
  evil-execute-repeat-info-with-count(nil ([115 101 120]))
  evil-repeat(nil nil)
  call-interactively(evil-repeat nil nil)

If I try to exit Emacs (such as clicking the Frame's close), the
minibuffer simply reports: "After 0 kbd macro iterations: Symbol's
function definition is void: t".  Only when I exit the debugger am I
able to quit Emacs.

I discovered that if I have an edit in the repeat ring, I witness the
behavior York describes instead of the the elisp errors.  I pasted the
york-bar from my web browser using X11, so it didn't go into the
repeat ring.

On 7/13/12, York Zhao <gtdplatform <at> gmail.com> wrote:
>> sorry for not answering immediately, but I've been on a business trip
>> last weak and had simply no time. The same will be true for large
>> parts of the next few months so please excuse if responses take some
>> time. I'll always try to answer as soon as possible.
>
> Really appreciate that you have taken your valuable time to answer my
> question,
> and your answer have been very useful so far.
>
>> Note that currently repeating only works for commands bound to
>> some key-bindings, calling them via M-x COMMAND RET may fail.
>
> Yes, you are right, I never binded these functions to any key, I used "M-x".
> And
> if I bind my command "bar" to a key the dot repeating works. What I still
> don't
> understand however, is that "M-x foo" is dot repeatable but not "M-x bar".
>
>> So please provide a complete example (full function definition, key
>> sequences, ...), preferably starting from a fresh emacs instance, that
>> demonstrates the problem. Otherwise it is really hard to isolate the
>> problem.
>
> Here's the scenario:
>
> First, in "scratch" buffer, input the following:
>
> (defun york-bar ()
>   (interactive)
>   (save-excursion
>     (insert "printf(\"checkpoint\")")))
>
> Type "C-M-x" to instrument the command `york-bar'.
>
> Then open a file in c++-mode and "M-x york-bar", "printf()" function
> call gets inserted.
>
> Hit ".", but nothing wouldn't get inserted again.
>
>> The mode *should* not make difference ...
>
> Yes, I've tried "M-x york-bar" in an org-mode buffer and got the same
> results.
>
> On the other hand, the command `york-foo' which is dot repeatable even when
> being executed by "M-x", is way more complicated, I have tried to isolate it
> but
> failed, it had been tightly "connected" with my other part of configuration
> files (huge).
>
> The bottom line is, however, `york-bar' is dot repeatable if having it
> binded to
> some key. Thanks again for the help.
>
> York
>
> _______________________________________________
> implementations-list mailing list
> implementations-list <at> lists.ourproject.org
> https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list
>
Keshav Kini | 16 Jul 2012 08:36
Picon
Gravatar

evil-mode has led my cursor to the dark side!

Hi,

evil-mode is so evil that it has stained my cursor black, as black as
the soul of evil-mode!

I upgraded to Emacs 24.1 from 23.4, and I noticed a new Themes feature,
so I set up the "tsdh-dark" theme, only to find that my cursor is now
black, even though the background color is a dark gray. At first I
thought some of my old customizations might have been conflicting with
the theming, but after cleaning up my ~/.emacs as follows, I found the
cursor remained black.

    ; specify packages for el-get
    (setq my-packages
          '(column-marker
            cython-mode
            evil
            evil-surround
            haskell-mode
            python-mode
            undo-tree))

    (setq evil-want-C-u-scroll t)
    ; load el-get
    (add-to-list 'load-path "~/.emacs.d/el-get/el-get")
    (unless (require 'el-get nil t)
      (with-current-buffer
          (url-retrieve-synchronously
           "https://raw.github.com/dimitri/el-get/master/el-get-install.el")
        (end-of-buffer)
        (eval-print-last-sexp)))
    (el-get 'sync my-packages)

    ; evil settings
    (evil-mode 1)
    (define-key evil-normal-state-map ",l" 'whitespace-mode)

    ; column markers
    (add-hook 'python-mode-hook '(lambda () (interactive) (column-marker-1 73) (column-marker-2 80)))
    (add-hook 'rst-mode-hook '(lambda () (interactive) (column-marker-1 73)))

    ; load Japanese input
    (require 'mozc)
    (setq default-input-method "japanese-mozc")

    ; setup smtpmail
    ; [redacted]

    ; start daemon
    (server-start)

    (custom-set-variables
     ;; custom-set-variables was added by Custom.
     ;; If you edit it by hand, you could mess it up, so be careful.
     ;; Your init file should contain only one such instance.
     ;; If there is more than one, they won't work right.
     '(custom-enabled-themes (quote (tsdh-dark)))
     '(evil-want-C-u-scroll t)
     '(file-precious-flag t)
     '(indent-tabs-mode nil))
    (custom-set-faces
     ;; custom-set-faces was added by Custom.
     ;; If you edit it by hand, you could mess it up, so be careful.
     ;; Your init file should contain only one such instance.
     ;; If there is more than one, they won't work right.
     '(default ((t (:width semi-condensed)))))

Then I suspected that the theme was just badly designed. But on a hunch,
I tried commenting out the line "(evil-mode 1)", and restarted
Emacs. The cursor was white! And running "M-x evil-mode" made it black
again.

How can I fix this? Is it a bug in evil-mode, or am I just doing
something wrong?

-Keshav
Keshav Kini | 16 Jul 2012 08:59
Picon
Gravatar

[gmane.emacs.vim-emulation] evil-mode has led my cursor to the dark side!


Hi,

Um, I'm not sure why, but the following message doesn't seem to be
getting through to the mailing list when I send it via the Gmane NNTP
gateway, so I'm sending it through my normal SMTP server instead.

-Keshav

Picon Gravatar
From: Keshav Kini <keshav.kini <at> gmail.com>
Subject: evil-mode has led my cursor to the dark side!
Newsgroups: gmane.emacs.vim-emulation
Date: 2012-07-16 02:12:22 GMT
Hi,

evil-mode is so evil that it has stained my cursor black, as black as
the soul of evil-mode!

I upgraded to Emacs 24.1 from 23.4, and I noticed a new Themes feature,
so I set up the "tsdh-dark" theme, only to find that my cursor is now
black, even though the background color is a dark gray. At first I
thought some of my old customizations might have been conflicting with
the theming, but after cleaning up my ~/.emacs as follows, I found the
cursor remained black.

    ; specify packages for el-get
    (setq my-packages
          '(column-marker
            cython-mode
            evil
            evil-surround
            haskell-mode
            python-mode
            undo-tree))

    (setq evil-want-C-u-scroll t)
    ; load el-get
    (add-to-list 'load-path "~/.emacs.d/el-get/el-get")
    (unless (require 'el-get nil t)
      (with-current-buffer
          (url-retrieve-synchronously
           "https://raw.github.com/dimitri/el-get/master/el-get-install.el")
        (end-of-buffer)
        (eval-print-last-sexp)))
    (el-get 'sync my-packages)

    ; evil settings
    (evil-mode 1)
    (define-key evil-normal-state-map ",l" 'whitespace-mode)

    ; column markers
    (add-hook 'python-mode-hook '(lambda () (interactive) (column-marker-1 73) (column-marker-2 80)))
    (add-hook 'rst-mode-hook '(lambda () (interactive) (column-marker-1 73)))

    ; load Japanese input
    (require 'mozc)
    (setq default-input-method "japanese-mozc")

    ; setup smtpmail
    ; [redacted]

    ; start daemon
    (server-start)

    (custom-set-variables
     ;; custom-set-variables was added by Custom.
     ;; If you edit it by hand, you could mess it up, so be careful.
     ;; Your init file should contain only one such instance.
     ;; If there is more than one, they won't work right.
     '(custom-enabled-themes (quote (tsdh-dark)))
     '(evil-want-C-u-scroll t)
     '(file-precious-flag t)
     '(indent-tabs-mode nil))
    (custom-set-faces
     ;; custom-set-faces was added by Custom.
     ;; If you edit it by hand, you could mess it up, so be careful.
     ;; Your init file should contain only one such instance.
     ;; If there is more than one, they won't work right.
     '(default ((t (:width semi-condensed)))))

Then I suspected that the theme was just badly designed. But on a hunch,
I tried commenting out the line "(evil-mode 1)", and restarted
Emacs. The cursor was white! And running "M-x evil-mode" made it black
again.

How can I fix this? Is it a bug in evil-mode, or am I just doing
something wrong?

-Keshav
_______________________________________________
implementations-list mailing list
implementations-list <at> lists.ourproject.org
https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list

Gmane