* Similar key bindings for moving among tags in sgml and nxml modes?
@ 2009-11-26 0:16 Lennart Borgman
2009-11-26 0:44 ` Miles Bader
0 siblings, 1 reply; 4+ messages in thread
From: Lennart Borgman @ 2009-11-26 0:16 UTC (permalink / raw)
To: Emacs-Devel devel
I have these routines for moving between tags. I saw now that there
are rather similar sgm functions. Could we please add the same key
bindings to nxml-mode that are used in sgml modes for these?
The first two corresponds to sgml-skip-element-forward/backward.
I do not know the corresponding functions for the last two.
;;; Convenient moving by tags:
(eval-after-load 'nxml-mode
'(progn
(define-key nxml-mode-map [C-M-left] 'nxml-backward-element)
(define-key nxml-mode-map [C-M-right] 'nxml-forward-element)
(define-key nxml-mode-map [C-M-up] 'nxml-backward-up-element)
(define-key nxml-mode-map [C-M-down] 'nxml-down-element)))
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Similar key bindings for moving among tags in sgml and nxml modes?
2009-11-26 0:16 Similar key bindings for moving among tags in sgml and nxml modes? Lennart Borgman
@ 2009-11-26 0:44 ` Miles Bader
2009-11-26 1:32 ` Lennart Borgman
2009-11-27 17:07 ` Gilaras Drakeson
0 siblings, 2 replies; 4+ messages in thread
From: Miles Bader @ 2009-11-26 0:44 UTC (permalink / raw)
To: Lennart Borgman; +Cc: Emacs-Devel devel
Lennart Borgman <lennart.borgman@gmail.com> writes:
> I have these routines for moving between tags. I saw now that there
> are rather similar sgm functions. Could we please add the same key
> bindings to nxml-mode that are used in sgml modes for these?
No, adding different key bindings is the wrong way. The right way is to
make emacs sexp-movement commands (which are even already bound globally
to the keys you suggest) work properly in nxml-mode .
... and in fact, that's already supported!
Just do: (setq nxml-sexp-element-flag t)
[I think that should even be the default, but what do I know...]
-Miles
--
Idiot, n. A member of a large and powerful tribe whose influence in human
affairs has always been dominant and controlling.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Similar key bindings for moving among tags in sgml and nxml modes?
2009-11-26 0:44 ` Miles Bader
@ 2009-11-26 1:32 ` Lennart Borgman
2009-11-27 17:07 ` Gilaras Drakeson
1 sibling, 0 replies; 4+ messages in thread
From: Lennart Borgman @ 2009-11-26 1:32 UTC (permalink / raw)
To: Miles Bader; +Cc: Emacs-Devel devel
On Thu, Nov 26, 2009 at 1:44 AM, Miles Bader <miles@gnu.org> wrote:
> Lennart Borgman <lennart.borgman@gmail.com> writes:
>> I have these routines for moving between tags. I saw now that there
>> are rather similar sgm functions. Could we please add the same key
>> bindings to nxml-mode that are used in sgml modes for these?
>
> No, adding different key bindings is the wrong way. The right way is to
> make emacs sexp-movement commands (which are even already bound globally
> to the keys you suggest) work properly in nxml-mode .
>
> ... and in fact, that's already supported!
>
> Just do: (setq nxml-sexp-element-flag t)
>
> [I think that should even be the default, but what do I know...]
Thanks. I forgot that flag. I agree it should be on by default.
I think you are right that using the sexp movement is the best. But
what about html-mode/sgml-mode then? Is there also some flag to set to
get this behaviour?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Similar key bindings for moving among tags in sgml and nxml modes?
2009-11-26 0:44 ` Miles Bader
2009-11-26 1:32 ` Lennart Borgman
@ 2009-11-27 17:07 ` Gilaras Drakeson
1 sibling, 0 replies; 4+ messages in thread
From: Gilaras Drakeson @ 2009-11-27 17:07 UTC (permalink / raw)
To: emacs-devel
...
> No, adding different key bindings is the wrong way. The right way is to
> make emacs sexp-movement commands (which are even already bound globally
> to the keys you suggest) work properly in nxml-mode .
>
> ... and in fact, that's already supported!
>
> Just do: (setq nxml-sexp-element-flag t)
>
> [I think that should even be the default, but what do I know...]
In addition, I would vote for paredit keybindings, too.
--
Gilaras
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-11-27 17:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-26 0:16 Similar key bindings for moving among tags in sgml and nxml modes? Lennart Borgman
2009-11-26 0:44 ` Miles Bader
2009-11-26 1:32 ` Lennart Borgman
2009-11-27 17:07 ` Gilaras Drakeson
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).