Fundamental mode and undo-tree-mode
Hello list, When I open a file with an unrecognized extension, my Emacs opens it in Fundamental mode (which is what I want). I have Evil enabled with (require 'evil) (evil-mode 1) but the file's buffer does not have undo-tree-mode enabled. I have to manually enable it with M-x undo-tree-mode . I tried adding (global-undo-tree-mode) in my ~/.emacs, but I get nothing. I also tried adding (add-hook 'evil-after-load-hook (lambda () (undo-tree-mode) ) ) but it doesn't help. If I set my emacs' default major mode to text-mode, then undo-tree gets enabled and everything works, but I don't want to use this workaround. I also tried deleting all of my ~/.emacs except for these lines (require 'evil) (evil-mode 1) , but I still get the same behavior. Interestingly, the *Messages* buffer has undo-tree-mode enabled with this same configuration. Does anyone have the same issues with Fundamental Mode + Undo Tree Mode when opening a file? -L
I have this after loading Evil at init.el top level: (require 'undo-tree) (global-undo-tree-mode 1) Evil makes the same call if undo-tree is available on the load-path, so it's not necessary. On Mon, Dec 30, 2013 at 3:49 PM, Linus Arver <[email protected]> wrote:
Hello list,
When I open a file with an unrecognized extension, my Emacs opens it in Fundamental mode (which is what I want). I have Evil enabled with
(require 'evil) (evil-mode 1)
but the file's buffer does not have undo-tree-mode enabled. I have to manually enable it with
M-x undo-tree-mode
. I tried adding
(global-undo-tree-mode)
in my ~/.emacs, but I get nothing. I also tried adding
(add-hook 'evil-after-load-hook (lambda () (undo-tree-mode) ) )
but it doesn't help. If I set my emacs' default major mode to text-mode, then undo-tree gets enabled and everything works, but I don't want to use this workaround. I also tried deleting all of my ~/.emacs except for these lines
(require 'evil) (evil-mode 1)
, but I still get the same behavior. Interestingly, the *Messages* buffer has undo-tree-mode enabled with this same configuration.
Does anyone have the same issues with Fundamental Mode + Undo Tree Mode when opening a file?
-L
_______________________________________________ implementations-list mailing list [email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list
undo-tree-mode should be loaded if 'evil/lib' was added to load path... I added in init.el something like this: (add-to-list 'load-path "~/.emacs.d/evil/lib") (add-to-list 'load-path "~/.emacs.d/evil") (require 'evil) (evil-mode 1) Just curious, anyone knows is it possible to directly use Emacs redo facility without undo-tree-mode? I'm trying to put my Emacs on diet, especially dumping those libraries I rarely use (undo very much, redo from time to time). Currently, after I do (global-undo-tree-mode 0) Emacs will perform only one redo and spit: "Symbol's function definition is void: redo". Any ideas? Thanks. Sanel On Mon, 30 Dec 2013 16:01:45 -0500 Barry OReilly <[email protected]> wrote:
I have this after loading Evil at init.el top level:
(require 'undo-tree) (global-undo-tree-mode 1)
Evil makes the same call if undo-tree is available on the load-path, so it's not necessary.
On Mon, Dec 30, 2013 at 3:49 PM, Linus Arver <[email protected]> wrote:
Hello list,
When I open a file with an unrecognized extension, my Emacs opens it in Fundamental mode (which is what I want). I have Evil enabled with
(require 'evil) (evil-mode 1)
but the file's buffer does not have undo-tree-mode enabled. I have to manually enable it with
M-x undo-tree-mode
. I tried adding
(global-undo-tree-mode)
in my ~/.emacs, but I get nothing. I also tried adding
(add-hook 'evil-after-load-hook (lambda () (undo-tree-mode) ) )
but it doesn't help. If I set my emacs' default major mode to text-mode, then undo-tree gets enabled and everything works, but I don't want to use this workaround. I also tried deleting all of my ~/.emacs except for these lines
(require 'evil) (evil-mode 1)
, but I still get the same behavior. Interestingly, the *Messages* buffer has undo-tree-mode enabled with this same configuration.
Does anyone have the same issues with Fundamental Mode + Undo Tree Mode when opening a file?
-L
_______________________________________________ implementations-list mailing list [email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list
Am 31.12.2013 01:26, schrieb Sanel Zukan:
Currently, after I do (global-undo-tree-mode 0) Emacs will perform only one redo and spit: "Symbol's function definition is void: redo".
Evil only binds to `redo` not to any specific undo-tree function (undo-tree remaps `redo` to `undo-tree-redo` or so). This function is also available from other packages, i.e. `redo` or `redo+` (IIRC the latter is preferable nowadays, available from Emacswiki). AFAIK no `redo` function is available in plain Emacs. However, if `undo-tree` is available Evil will load it. This is questionable, of course. Frank
On 12/31/13, Frank Fischer wrote:
Evil only binds to `redo` not to any specific undo-tree function (undo-tree remaps `redo` to `undo-tree-redo` or so). This function is also available from other packages, i.e. `redo` or `redo+` (IIRC the latter is preferable nowadays, available from Emacswiki). AFAIK no `redo` function is available in plain Emacs.
However, if `undo-tree` is available Evil will load it. This is questionable, of course.
Thanks for explaining it. Still wrapping around my head Emacs default undo/redo system, so I was thinking, does it make sense to make 'redo' behaves like default Emacs version, when undo-tree-mode was disabled? If I got it right, 'redo' will be the same as 'undo'?
Frank
Best, Sanel
Am 01.01.2014 14:18, schrieb Sanel Zukan:
Thanks for explaining it. Still wrapping around my head Emacs default undo/redo system, so I was thinking, does it make sense to make 'redo' behaves like default Emacs version, when undo-tree-mode was disabled?
If I got it right, 'redo' will be the same as 'undo'?
Yes. And that's why it's probably not a good idea to use 'undo' for 'redo' if the latter is not available. It's just unexpected. (Indeed, why should there be a redo command at all if it's the same as undo?) But maybe the error message could be improved so that it tells the user that either 'redo' or 'undo-tree' should be installed (and activated). Frank
On Mon, Dec 30, 2013 at 04:01:45PM -0500, Barry OReilly wrote:
I have this after loading Evil at init.el top level:
(require 'undo-tree) (global-undo-tree-mode 1)
Evil makes the same call if undo-tree is available on the load-path, so it's not necessary.
I'm sorry, I don't quite understand what you're trying to say. I don't have those lines in my .emacs, and I am using the latest Evil. My problem is that undo-tree is loaded, but disabled when I open a file with an unrecognized extension (e.g., a file named "foo", but not "foo.txt"). Again, the strange thing is that undo-tree is enabled on the *Messages* buffer, but disabled (turned off) in the "foo" buffer. -L
On Mon, Dec 30, 2013 at 3:49 PM, Linus Arver <[email protected]> wrote:
Hello list,
When I open a file with an unrecognized extension, my Emacs opens it in Fundamental mode (which is what I want). I have Evil enabled with
(require 'evil) (evil-mode 1)
but the file's buffer does not have undo-tree-mode enabled. I have to manually enable it with
M-x undo-tree-mode
. I tried adding
(global-undo-tree-mode)
in my ~/.emacs, but I get nothing. I also tried adding
(add-hook 'evil-after-load-hook (lambda () (undo-tree-mode) ) )
but it doesn't help. If I set my emacs' default major mode to text-mode, then undo-tree gets enabled and everything works, but I don't want to use this workaround. I also tried deleting all of my ~/.emacs except for these lines
(require 'evil) (evil-mode 1)
, but I still get the same behavior. Interestingly, the *Messages* buffer has undo-tree-mode enabled with this same configuration.
Does anyone have the same issues with Fundamental Mode + Undo Tree Mode when opening a file?
-L
_______________________________________________ implementations-list mailing list [email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list
_______________________________________________ implementations-list mailing list [email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list
Am 04.01.2014 02:13, schrieb Linus Arver:
On Mon, Dec 30, 2013 at 04:01:45PM -0500, Barry OReilly wrote:
I have this after loading Evil at init.el top level:
(require 'undo-tree) (global-undo-tree-mode 1)
Evil makes the same call if undo-tree is available on the load-path, so it's not necessary.
I'm sorry, I don't quite understand what you're trying to say. I don't have those lines in my .emacs, ...
That's exactly what Barry wanted to say, you don't need these lines because Evil executes them anyway.
My problem is that undo-tree is loaded, but disabled when I open a file with an unrecognized extension (e.g., a file named "foo", but not "foo.txt").
Again, the strange thing is that undo-tree is enabled on the *Messages* buffer, but disabled (turned off) in the "foo" buffer.
This is expected. Undo-tree (like Evil) is a minor-mode that is automatically enabled in each buffer if the corresponding "globalized minor mode" (namely global-undo-tree-mode) is enabled. This is realised by some special change-major-mode-hook and after-change-major-mode-hook hooks. However, if a new buffer is started in fundamental-mode these hooks are not run (in contrast to any other major-mode), that's why the local undo-tree-mode never gets a chance to be activated. The same is true for Evil. However, unlike undo-tree Evil adds a few additional hacks to overcome this problem. That's why Evil gets activated in fundamental-mode buffers and undo-tree does not. So if you want undo-tree to be enabled in all buffers in which Evil is enabled, the simplest solution is probably to do so directly: (add-hook 'evil-local-mode-hook 'turn-on-undo-tree-mode) Best regards, Frank
On Sat, Jan 04, 2014 at 09:40:16AM +0100, Frank Fischer wrote:
Am 04.01.2014 02:13, schrieb Linus Arver:
My problem is that undo-tree is loaded, but disabled when I open a file with an unrecognized extension (e.g., a file named "foo", but not "foo.txt").
Again, the strange thing is that undo-tree is enabled on the *Messages* buffer, but disabled (turned off) in the "foo" buffer.
This is expected. Undo-tree (like Evil) is a minor-mode that is automatically enabled in each buffer if the corresponding "globalized minor mode" (namely global-undo-tree-mode) is enabled. This is realised by some special change-major-mode-hook and after-change-major-mode-hook hooks. However, if a new buffer is started in fundamental-mode these hooks are not run (in contrast to any other major-mode), that's why the local undo-tree-mode never gets a chance to be activated. The same is true for Evil.
However, unlike undo-tree Evil adds a few additional hacks to overcome this problem. That's why Evil gets activated in fundamental-mode buffers and undo-tree does not.
So if you want undo-tree to be enabled in all buffers in which Evil is enabled, the simplest solution is probably to do so directly:
(add-hook 'evil-local-mode-hook 'turn-on-undo-tree-mode)
Thank you very much for the explanation. I just tested your line of code and undo-tree does get enabled in new buffers. I'm starting to think now that this should be the default Evil behavior, as Evil requires undo-tree to function properly (i.e., it does not make sense to have Evil enabled without undo-tree-mode, when undo-tree is available). -L
Am 05.01.2014 07:25, schrieb Linus Arver:
Thank you very much for the explanation. I just tested your line of code and undo-tree does get enabled in new buffers.
I'm starting to think now that this should be the default Evil behavior, as Evil requires undo-tree to function properly (i.e., it does not make sense to have Evil enabled without undo-tree-mode, when undo-tree is available).
Sounds reasonable. Changed in the latest commit. Frank
I'm starting to think now that this should be the default Evil behavior, as Evil requires undo-tree to function properly (i.e., it does not make sense to have Evil enabled without undo-tree-mode, when undo-tree is available).
I wasn't aware Evil doesn't function properly without undo-tree. That is a bug I would think.
Am 05.01.2014 17:47, schrieb Barry OReilly:
I'm starting to think now that this should be the default Evil behavior, as Evil requires undo-tree to function properly (i.e., it does not make sense to have Evil enabled without undo-tree-mode, when undo-tree is available).
I wasn't aware Evil doesn't function properly without undo-tree. That is a bug I would think.
Well, it *does* function properly ... only that a few functions are not available, in particular 'redo' and the ex command ':undolist'. Other than this undo-tree is not required. Frank
participants (4)
-
Barry OReilly -
Frank Fischer -
Linus Arver -
Sanel Zukan