all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* multi-line paragraph separator
@ 2007-09-05 15:07 Mirko
  2007-09-08 11:08 ` Daniel Jensen
  0 siblings, 1 reply; 2+ messages in thread
From: Mirko @ 2007-09-05 15:07 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

I am writing a mode to help navigate results of literature searches.
I would like to redefine the paragraph as a beginning of a new
citation.  The problem is that because of the file format, I need a
regexp to look at two or more lines to determine a start of a
paragraph.  Here are the details:

In this file, citations are separated by two blank lines.  A single
blank line separates the citation header (title, authors, publication
info) from the abstract.  The header and the abstract start in column
5.  Here is an example (the blank lines are marked with "<" -- these
characters are not present in the file, and my comments in CAPITALS)


    PREVIOUS CITATION ABSTRACT .....
    cantilever models can provide a fast and reliable understanding of
    the mechanical deflection properties of microfabricated SiO2
    cantilevers.  FOLLOWED BY TWO BLANK LINES
<
<
    Porous silicon fuel cells for micro power generation THIS IS THE
HEADER OF THE NEXT CITATION
    Kuan-Lun Chu, Mark A Shannon and Richard I Masel
    2007 J. Micromech. Microeng. 17 S243-S249
    Abstract:  http://www.iop.org/EJ/abstract/-alert=33505/0960-1317/17/9/S06
    Full text PDF: http://www.iop.org/EJ/article/-alert=33505/0960-1317/17/9/S06/jmm7_9_s06.pdf
<
    The objective of this paper is to report the recent progress in
the FOLLOWED BY ITS ABSTRACT
    development of porous silicon fuel cells for micro power
    generation. Previous work has demonstrated that an acid loaded

I tried by redefining the paragraph-start and paragraph-separate as
  (make-local-variable 'paragraph-start)
  (setq paragraph-start "\\f\\f|    ")
  (make-local-variable 'paragraph-separate)
  (setq paragraph-separate "\\f$\\f$")
but that did not work.

Is that even possible?

Thanks,

Mirko

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

* Re: multi-line paragraph separator
  2007-09-05 15:07 multi-line paragraph separator Mirko
@ 2007-09-08 11:08 ` Daniel Jensen
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Jensen @ 2007-09-08 11:08 UTC (permalink / raw)
  To: help-gnu-emacs

Mirko <mvukovic@nycap.rr.com> writes:

> I tried by redefining the paragraph-start and paragraph-separate as
>   (make-local-variable 'paragraph-start)
>   (setq paragraph-start "\\f\\f|    ")
>   (make-local-variable 'paragraph-separate)
>   (setq paragraph-separate "\\f$\\f$")
> but that did not work.

Those are not well-formed regular expressions. For example, \f is not a
special construct, it's the same as f. You probably meant to write
"\f\f", but they are two formfeed characters, not newlines. You can use
"\n\n" to match two newline characters. I hope this helps.

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

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

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-05 15:07 multi-line paragraph separator Mirko
2007-09-08 11:08 ` Daniel Jensen

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.