all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* going back in time
@ 2010-07-26 18:43 Andrea Crotti
  2010-07-26 19:09 ` Štěpán Němec
  2010-07-26 20:08 ` Andreas Röhler
  0 siblings, 2 replies; 11+ messages in thread
From: Andrea Crotti @ 2010-07-26 18:43 UTC (permalink / raw)
  To: help-gnu-emacs

I was just wondering if there could be kind of undo operation for higher
level problems.

For example now I just installed ruby-tests.el from emacswiki, which (I
saw too late) unfortunately has some "global-set-keys" with combinations
that normally I use for other things.

Is there any way to revert back to the last global state (it might be
useful also in other cases of cours)?
Thanks




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: going back in time
       [not found] <mailman.7.1280169840.16726.help-gnu-emacs@gnu.org>
@ 2010-07-26 18:49 ` Andreas Politz
  0 siblings, 0 replies; 11+ messages in thread
From: Andreas Politz @ 2010-07-26 18:49 UTC (permalink / raw)
  To: help-gnu-emacs

Andrea Crotti <andrea.crotti.0@gmail.com> writes:

> I was just wondering if there could be kind of undo operation for higher
> level problems.
>
> For example now I just installed ruby-tests.el from emacswiki, which (I
> saw too late) unfortunately has some "global-set-keys" with combinations
> that normally I use for other things.
>
> Is there any way to revert back to the last global state (it might be
> useful also in other cases of cours)?
> Thanks

Making a deep copy of the obarray at some defined points in time may be
all that it needs.

-ap


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: going back in time
  2010-07-26 18:43 going back in time Andrea Crotti
@ 2010-07-26 19:09 ` Štěpán Němec
  2010-07-26 19:33   ` Eric Abrahamsen
  2010-07-26 19:58   ` Andrea Crotti
  2010-07-26 20:08 ` Andreas Röhler
  1 sibling, 2 replies; 11+ messages in thread
From: Štěpán Němec @ 2010-07-26 19:09 UTC (permalink / raw)
  To: Andrea Crotti; +Cc: help-gnu-emacs

Andrea Crotti <andrea.crotti.0@gmail.com> writes:

> I was just wondering if there could be kind of undo operation for higher
> level problems.
>
> For example now I just installed ruby-tests.el from emacswiki, which (I
> saw too late) unfortunately has some "global-set-keys" with combinations
> that normally I use for other things.
>
> Is there any way to revert back to the last global state (it might be
> useful also in other cases of cours)?

No (other than redoing your original bindings yourself, obviously).
And if a package unconditionally/irreversibly adds global bindings, you
can safely say it's badly written and complain to its author. That's
what modes and keymaps are for.

Štěpán



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: going back in time
  2010-07-26 19:09 ` Štěpán Němec
@ 2010-07-26 19:33   ` Eric Abrahamsen
  2010-07-27 12:22     ` Štěpán Němec
  2010-07-26 19:58   ` Andrea Crotti
  1 sibling, 1 reply; 11+ messages in thread
From: Eric Abrahamsen @ 2010-07-26 19:33 UTC (permalink / raw)
  To: help-gnu-emacs

Štěpán Němec <stepnem@gmail.com> writes:

> Andrea Crotti <andrea.crotti.0@gmail.com> writes:
>
>> I was just wondering if there could be kind of undo operation for higher
>> level problems.
>>
>> For example now I just installed ruby-tests.el from emacswiki, which (I
>> saw too late) unfortunately has some "global-set-keys" with combinations
>> that normally I use for other things.
>>
>> Is there any way to revert back to the last global state (it might be
>> useful also in other cases of cours)?
>
> No (other than redoing your original bindings yourself, obviously).
> And if a package unconditionally/irreversibly adds global bindings, you
> can safely say it's badly written and complain to its author. That's
> what modes and keymaps are for.

Out of curiosity, does unload-feature also unload that feature's
keybindings? How would a package author provide keybindings in
reversible way?

Eric

>
> Štěpán




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: going back in time
  2010-07-26 19:09 ` Štěpán Němec
  2010-07-26 19:33   ` Eric Abrahamsen
@ 2010-07-26 19:58   ` Andrea Crotti
  2010-07-27 12:14     ` Štěpán Němec
  2010-07-27 12:16     ` Štěpán Němec
  1 sibling, 2 replies; 11+ messages in thread
From: Andrea Crotti @ 2010-07-26 19:58 UTC (permalink / raw)
  To: help-gnu-emacs


>
> No (other than redoing your original bindings yourself, obviously).
> And if a package unconditionally/irreversibly adds global bindings, you
> can safely say it's badly written and complain to its author. That's
> what modes and keymaps are for.
>
> Štěpán

Yes of course it's not easy, but I think there could be something like
(save-global-excursion
        command

which could first save the global configuration and then execute a
command.

Would it maybe be too slow?
At least the global key mapping and variable values I think it could be done...




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: going back in time
  2010-07-26 18:43 going back in time Andrea Crotti
  2010-07-26 19:09 ` Štěpán Němec
@ 2010-07-26 20:08 ` Andreas Röhler
  2010-07-29 13:55   ` Andrea Crotti
  2010-07-29 13:55   ` Andrea Crotti
  1 sibling, 2 replies; 11+ messages in thread
From: Andreas Röhler @ 2010-07-26 20:08 UTC (permalink / raw)
  To: help-gnu-emacs

Am 26.07.2010 20:43, schrieb Andrea Crotti:
> I was just wondering if there could be kind of undo operation for higher
> level problems.
>
> For example now I just installed

have my emacs-init under RCS, so its easily reverted, should some 
strange error occur

  ruby-tests.el from emacswiki, which (I
> saw too late) unfortunately has some "global-set-keys" with combinations
> that normally I use for other things.

if it's just some keys, why not change them inside ruby-tests.el?

Andreas

>
> Is there any way to revert back to the last global state (it might be
> useful also in other cases of cours)?
> Thanks
>
>
>




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: going back in time
  2010-07-26 19:58   ` Andrea Crotti
@ 2010-07-27 12:14     ` Štěpán Němec
  2010-07-27 12:16     ` Štěpán Němec
  1 sibling, 0 replies; 11+ messages in thread
From: Štěpán Němec @ 2010-07-27 12:14 UTC (permalink / raw)
  To: Andrea Crotti; +Cc: help-gnu-emacs

Andrea Crotti <andrea.crotti.0@gmail.com> writes:

>>
>> No (other than redoing your original bindings yourself, obviously).
>> And if a package unconditionally/irreversibly adds global bindings, you
>> can safely say it's badly written and complain to its author. That's
>> what modes and keymaps are for.
>>
>> Štěpán
>
> Yes of course it's not easy, but I think there could be something like
> (save-global-excursion
>         command
>
> which could first save the global configuration and then execute a
> command.
>
> Would it maybe be too slow?
> At least the global key mapping and variable values I think it could be
> done...

Why don't you just try it?

(setq bkp-global-map (copy-seq global-map))
  ...
  GO CRAZY
  ...
(setq global-map bkp-global-map)

(Note that I have no idea if it will even work as expected for keymaps;
your backup may still share some structure with the original; not sure.
You might try `copy-tree'.)

Same with other variables.

  Štěpán



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: going back in time
  2010-07-26 19:58   ` Andrea Crotti
  2010-07-27 12:14     ` Štěpán Němec
@ 2010-07-27 12:16     ` Štěpán Němec
  1 sibling, 0 replies; 11+ messages in thread
From: Štěpán Němec @ 2010-07-27 12:16 UTC (permalink / raw)
  To: Andrea Crotti; +Cc: help-gnu-emacs


(Actually there is `copy-keymap', too, but the caveat still applies.)



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: going back in time
  2010-07-26 19:33   ` Eric Abrahamsen
@ 2010-07-27 12:22     ` Štěpán Němec
  0 siblings, 0 replies; 11+ messages in thread
From: Štěpán Němec @ 2010-07-27 12:22 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: help-gnu-emacs

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> Štěpán Němec <stepnem@gmail.com> writes:
>
>> Andrea Crotti <andrea.crotti.0@gmail.com> writes:
>>> Is there any way to revert back to the last global state (it might be
>>> useful also in other cases of cours)?
>>
>> No (other than redoing your original bindings yourself, obviously).
>> And if a package unconditionally/irreversibly adds global bindings, you
>> can safely say it's badly written and complain to its author. That's
>> what modes and keymaps are for.
>
> Out of curiosity, does unload-feature also unload that feature's
> keybindings? How would a package author provide keybindings in
> reversible way?

(info "(elisp)Unloading")

I don't think it does. The problem is not unloading, but restoring the
original bindings. The package could provide a FEATURE-unload-function
which would restore the bindings previously saved (which would also have
to be done manually). But as I said, I can't think of a legitimate
reason for a package to mess with global-map. If you think defining a
mode and a keymap for the functionality you provide is unnecessary, just
define the commands and put some keybinding recommendations into a
commentary.

Štěpán



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: going back in time
  2010-07-26 20:08 ` Andreas Röhler
@ 2010-07-29 13:55   ` Andrea Crotti
  2010-07-29 13:55   ` Andrea Crotti
  1 sibling, 0 replies; 11+ messages in thread
From: Andrea Crotti @ 2010-07-29 13:55 UTC (permalink / raw)
  To: help-gnu-emacs


>
> if it's just some keys, why not change them inside ruby-tests.el?
>
> Andreas

Of course it's not a specific problem, it was more a curiosity...
Also my configuration is under revision control, BUT I still should
restart emacs, which is bad ;)

Is there something like
- "reset everything as if it were just booted" without rebooting it?




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: going back in time
  2010-07-26 20:08 ` Andreas Röhler
  2010-07-29 13:55   ` Andrea Crotti
@ 2010-07-29 13:55   ` Andrea Crotti
  1 sibling, 0 replies; 11+ messages in thread
From: Andrea Crotti @ 2010-07-29 13:55 UTC (permalink / raw)
  To: help-gnu-emacs


>
> if it's just some keys, why not change them inside ruby-tests.el?
>
> Andreas

Of course it's not a specific problem, it was more a curiosity...
Also my configuration is under revision control, BUT I still should
restart emacs, which is bad ;)

Is there something like
- "reset everything as if it were just booted" without rebooting it?




^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-07-29 13:55 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-26 18:43 going back in time Andrea Crotti
2010-07-26 19:09 ` Štěpán Němec
2010-07-26 19:33   ` Eric Abrahamsen
2010-07-27 12:22     ` Štěpán Němec
2010-07-26 19:58   ` Andrea Crotti
2010-07-27 12:14     ` Štěpán Němec
2010-07-27 12:16     ` Štěpán Němec
2010-07-26 20:08 ` Andreas Röhler
2010-07-29 13:55   ` Andrea Crotti
2010-07-29 13:55   ` Andrea Crotti
     [not found] <mailman.7.1280169840.16726.help-gnu-emacs@gnu.org>
2010-07-26 18:49 ` Andreas Politz

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.