unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Andreas Roehler <andreas.roehler@online.de>
Subject: Re: how do I make html-mode break on <br> tags?
Date: Sun, 23 Jul 2006 10:42:14 +0200	[thread overview]
Message-ID: <e9vcgj$bbl$1@online.de> (raw)
In-Reply-To: bqrhxahv.fsf@cfl.rr.com

Gene Cash wrote:

> How the hell do I get html-mode to break on <br> tags?
> 
> I've dicked around with paragraph-start and paragraph-separate
> for hours with no luck. The docs don't explain anywhere how the
> fill algorithm decides to break paragraphs.
> 
> I'd like
> 
> <br>blah blah blah blah<br>blah blah blah blah<br>blah blah
> blah blah<br>
> 
> to turn into:
> 
> <br>
> blah blah blah blah<br>
> blah blah blah blah<br>
> blah blah blah blah<br>
> 
> when I hit M-q
> 
> -gc
> 
> 
;; Don't no, if it's the best way, just one.

(defun newline-after-html-break ()
  "Insert a newline after any <br> in html source code"
  (interactive "*")
  (save-excursion 
    (goto-char (point-min))
    (while (re-search-forward "<br>" nil 'move 1)
      (replace-match "<br>\n"))))


(define-key html32-mode-map (kbd "M-q") 'newline-after-html-break)


;; Tried this, but it doesn't work. Any ideas?


;; (defun set-paragraph-function ()
;;   " "
;;   (interactive)
;;   (if (eq major-mode 'html32-mode)
;;       (setq fill-paragraph-function 'newline-after-html-break)))

__
Andreas Roehler

       reply	other threads:[~2006-07-23  8:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bqrhxahv.fsf@cfl.rr.com>
2006-07-23  8:42 ` Andreas Roehler [this message]
     [not found]   ` <y7uk0wxq.fsf@cfl.rr.com>
2006-07-23 23:11     ` how do I make html-mode break on <br> tags? Jay Belanger
2006-07-24  7:48       ` Andreas Roehler
     [not found]       ` <mzayzh4c.fsf@cfl.rr.com>
2006-07-25 13:03         ` Chris McMahan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='e9vcgj$bbl$1@online.de' \
    --to=andreas.roehler@online.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).