unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Is there a nXhtml untag element function?
@ 2007-08-05 19:53 andylech
  2007-08-07 10:34 ` Lennart Borgman (gmail)
  0 siblings, 1 reply; 5+ messages in thread
From: andylech @ 2007-08-05 19:53 UTC (permalink / raw)
  To: help-gnu-emacs


I recently switched back to GNU Emacs after I found out about EmacsW32
and nXhtml.

I like both a lot but one of the things that drives me crazy about
nXhtml is that there doesn't seem to be anything like sgml-untag-
element from PSGML.  All it does is remove the start and end tags
around the current element, but I would think it has to be one of the
most important functions in any HTML/XHTML editing package.  I've
looked all over and I can't find anything like it.

Has anybody else found a solution to this problem?

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

* Re: Is there a nXhtml untag element function?
  2007-08-05 19:53 Is there a nXhtml untag element function? andylech
@ 2007-08-07 10:34 ` Lennart Borgman (gmail)
  2007-08-07 23:51   ` Lennart Borgman (gmail)
  0 siblings, 1 reply; 5+ messages in thread
From: Lennart Borgman (gmail) @ 2007-08-07 10:34 UTC (permalink / raw)
  To: andylech; +Cc: help-gnu-emacs

andylech wrote:
> I recently switched back to GNU Emacs after I found out about EmacsW32
> and nXhtml.
> 
> I like both a lot but one of the things that drives me crazy about
> nXhtml is that there doesn't seem to be anything like sgml-untag-
> element from PSGML.  All it does is remove the start and end tags
> around the current element, but I would think it has to be one of the
> most important functions in any HTML/XHTML editing package.  I've
> looked all over and I can't find anything like it.

Thanks for your suggestion. I will take a look at it as soon as I can.

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

* Re: Is there a nXhtml untag element function?
  2007-08-07 10:34 ` Lennart Borgman (gmail)
@ 2007-08-07 23:51   ` Lennart Borgman (gmail)
  2007-08-08 17:03     ` Andy Lech
  0 siblings, 1 reply; 5+ messages in thread
From: Lennart Borgman (gmail) @ 2007-08-07 23:51 UTC (permalink / raw)
  To: andylech; +Cc: help-gnu-emacs

Lennart Borgman (gmail) wrote:
> andylech wrote:
>> I recently switched back to GNU Emacs after I found out about EmacsW32
>> and nXhtml.
>>
>> I like both a lot but one of the things that drives me crazy about
>> nXhtml is that there doesn't seem to be anything like sgml-untag-
>> element from PSGML.  All it does is remove the start and end tags
>> around the current element, but I would think it has to be one of the
>> most important functions in any HTML/XHTML editing package.  I've
>> looked all over and I can't find anything like it.
> 
> Thanks for your suggestion. I will take a look at it as soon as I can.


I have added the function nxml-untag-element and bound it to

   C-c -

as in psgml. I noticed there was a function in psgml to rename tags too. 
  nxml-untag-element is supposed to take care of that too by selecting 
the old element.

Andy, could you please test the latest beta at

   http://ourcomments.org/Emacs/DL/elisp/nxhtml/beta/

and tell me how it works for you?

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

* Re: Is there a nXhtml untag element function?
  2007-08-07 23:51   ` Lennart Borgman (gmail)
@ 2007-08-08 17:03     ` Andy Lech
  2007-08-08 22:51       ` Lennart Borgman (gmail)
  0 siblings, 1 reply; 5+ messages in thread
From: Andy Lech @ 2007-08-08 17:03 UTC (permalink / raw)
  To: Lennart Borgman (gmail); +Cc: help-gnu-emacs


[-- Attachment #1.1: Type: text/plain, Size: 1276 bytes --]

Thank you for getting out an update so quickly.  It works but there is a
problem with undo when nxml-untag-select = yes (or Ask with yes).

Here's what happened:

1.  Upgraded to Emacs-22-CvsP070523-EmacsW32-1.54 and
nxhtml-1.04-070808-01_46_58.  (Thought I had the latest EmacsW32 but I was
wrong.)
2.  Created this simple file:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <title>Testing nxml-untag-element</title>
  </head>

  <body>
    <h1>Testing nxml-untag-element</h1>

    <b><u>Bold and underlined</u></b>
  </body>
</html>

3.  Called nxml-untag-element inside the H1 tag and it removed the start and
end tags correctly.
4.  Called undo and it restored the H1 start tag but not the end tag.
5.  Repeated 3 and 4 on the U tag inside the B tag.  Should have done the
same thing and it did.
6.  Looked at the help for nxml-untag-element and found nxml-untag-select.
7.  Set nxml-untag-select to no
8.  Repeated 3 and 4.  This time it did restore the end tag.

Leaving nxml-untag-select = no works fine for my purposes, but let me know
when you have an update or need more beta testing.

Thanks again,
Andy

[-- Attachment #1.2: Type: text/html, Size: 1837 bytes --]

[-- Attachment #2: Type: text/plain, Size: 152 bytes --]

_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

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

* Re: Is there a nXhtml untag element function?
  2007-08-08 17:03     ` Andy Lech
@ 2007-08-08 22:51       ` Lennart Borgman (gmail)
  0 siblings, 0 replies; 5+ messages in thread
From: Lennart Borgman (gmail) @ 2007-08-08 22:51 UTC (permalink / raw)
  To: Andy Lech; +Cc: help-gnu-emacs

Andy Lech wrote:
> 
> Thank you for getting out an update so quickly.  It works but there is a 
> problem with undo when nxml-untag-select = yes (or Ask with yes).
> 
> Here's what happened:
> 
> 1.  Upgraded to Emacs-22-CvsP070523-EmacsW32-1.54 and 
> nxhtml-1.04-070808-01_46_58.  (Thought I had the latest EmacsW32 but I 
> was wrong.)
> 2.  Created this simple file:
> 
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> 
> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
>   <head>
>     <title>Testing nxml-untag-element</title>
>   </head>
> 
>   <body>
>     <h1>Testing nxml-untag-element</h1>
> 
>     <b><u>Bold and underlined</u></b>
>   </body>
> </html>
> 
> 3.  Called nxml-untag-element inside the H1 tag and it removed the start 
> and end tags correctly.
> 4.  Called undo and it restored the H1 start tag but not the end tag.
> 5.  Repeated 3 and 4 on the U tag inside the B tag.  Should have done 
> the same thing and it did.
> 6.  Looked at the help for nxml-untag-element and found nxml-untag-select.
> 7.  Set nxml-untag-select to no
> 8.  Repeated 3 and 4.  This time it did restore the end tag.
> 
> Leaving nxml-untag-select = no works fine for my purposes, but let me 
> know when you have an update or need more beta testing.


Thanks for testing and for the report Andy, but I think that is the way 
undo works:

   undo is an interactive compiled Lisp function in `simple.el'.
   It is bound to C-z, C-_, <undo>, C-/, <menu-bar> <edit> <undo>.
   (undo &optional arg)

   Undo some previous changes.
   Repeat this command to undo more changes.
   A numeric argument serves as a repeat count.

   In Transient Mark mode when the mark is active, only undo changes within
   the current region.  Similarly, when not in Transient Mark mode, just 
M-x universal-argument
   as an argument limits undo to changes within the current region.

So just deselect the region and do undo after that.

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

end of thread, other threads:[~2007-08-08 22:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-05 19:53 Is there a nXhtml untag element function? andylech
2007-08-07 10:34 ` Lennart Borgman (gmail)
2007-08-07 23:51   ` Lennart Borgman (gmail)
2007-08-08 17:03     ` Andy Lech
2007-08-08 22:51       ` Lennart Borgman (gmail)

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).