unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#19039: 24.3; latex-mode paragraph-separate of \pagebreak[0]
@ 2014-11-13 11:40 Kevin Ryde
  2016-03-09  6:06 ` Marcin Borkowski
  2019-09-30  1:33 ` Stefan Kangas
  0 siblings, 2 replies; 4+ messages in thread
From: Kevin Ryde @ 2014-11-13 11:40 UTC (permalink / raw)
  To: 19039

[-- Attachment #1: Type: text/plain, Size: 603 bytes --]

In latex-mode it'd be good if \pagebreak[0] was a paragraph separator,
as for example

Blah blah         \ pagagraph
blah blah.        /
\pagebreak[0]
\begin{align}
...

An unconditional \pagebreak is already a separator, but not when an
optional arg [0] or [3] etc.

Perhaps digits and brackets like below.  Only some of the "space" "skip"
and "page" commands matched take optional args like this, but allowing
for all shouldn't hurt.

2014-11-12  Kevin Ryde  <user42_kevin@yahoo.com.au>

	* textmodes/tex-mode.el (latex-mode): In paragraph-separate allow
	optional argument [0] etc for \pagebreak[0]


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: tex-mode.el.diff --]
[-- Type: text/x-diff, Size: 856 bytes --]

--- tex-mode.el.orig	2014-05-06 10:44:16.000000000 +1000
+++ tex-mode.el	2014-11-13 07:41:23.523888672 +1100
@@ -1116,6 +1116,7 @@
   ;; A line containing just $$ is treated as a paragraph separator.
   ;; A line starting with $$ starts a paragraph,
   ;; but does not separate paragraphs if it has more stuff on it.
+  ;; For \pagebreak allow latex optional arg like \pagebreak[2]
   (setq paragraph-start
 	(concat "[ \t]*\\(\\$\\$\\|"
 		"\\\\[][]\\|"
@@ -1137,7 +1138,7 @@
 					      "noindent" "newpage" "footnote"
 					      "marginpar" "parbox" "caption"))
 		"\\|\\$\\$\\|[a-z]*\\(space\\|skip\\|page[a-z]*\\)"
-		"\\>\\)[ \t]*\\($\\|%\\)\\)"))
+		"\\>\\)[][0-9 \t]*\\($\\|%\\)\\)"))
   (set (make-local-variable 'imenu-create-index-function)
        'latex-imenu-create-index)
   (set (make-local-variable 'tex-face-alist) tex-latex-face-alist)

[-- Attachment #3: Type: text/plain, Size: 1078 bytes --]





In GNU Emacs 24.3.1 (i586-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2014-10-17 on x86-csail-01, modified by Debian
Windowing system distributor `The X.Org Foundation', version 11.0.11601000
Configured using:
 `configure '--build' 'i586-linux-gnu' '--build' 'i586-linux-gnu'
 '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib'
 '--localstatedir=/var/lib' '--infodir=/usr/share/info'
 '--mandir=/usr/share/man' '--with-pop=yes'
 '--enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.3/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.3/site-lisp:/usr/share/emacs/site-lisp'
 '--with-crt-dir=/usr/lib/i386-linux-gnu' '--with-x=yes'
 '--with-x-toolkit=lucid' '--with-toolkit-scroll-bars' '--without-gconf'
 '--without-gsettings' 'build_alias=i586-linux-gnu' 'CFLAGS=-g -O2
 -fstack-protector-strong -Wformat -Werror=format-security -Wall'
 'LDFLAGS=-Wl,-z,relro' 'CPPFLAGS=-D_FORTIFY_SOURCE=2''

Important settings:
  value of $LANG: en_AU.utf8
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

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

* bug#19039: 24.3; latex-mode paragraph-separate of \pagebreak[0]
  2014-11-13 11:40 bug#19039: 24.3; latex-mode paragraph-separate of \pagebreak[0] Kevin Ryde
@ 2016-03-09  6:06 ` Marcin Borkowski
  2019-09-30  1:33 ` Stefan Kangas
  1 sibling, 0 replies; 4+ messages in thread
From: Marcin Borkowski @ 2016-03-09  6:06 UTC (permalink / raw)
  To: Kevin Ryde; +Cc: 19039

On 2014-11-13, at 22:40, Kevin Ryde <user42_kevin@yahoo.com.au> wrote:

> In latex-mode it'd be good if \pagebreak[0] was a paragraph separator,
> as for example
>
> Blah blah         \ pagagraph
> blah blah.        /
> \pagebreak[0]
> \begin{align}
> ...
>
> An unconditional \pagebreak is already a separator, but not when an
> optional arg [0] or [3] etc.
>
> Perhaps digits and brackets like below.  Only some of the "space" "skip"
> and "page" commands matched take optional args like this, but allowing
> for all shouldn't hurt.
>
> 2014-11-12  Kevin Ryde  <user42_kevin@yahoo.com.au>
>
> 	* textmodes/tex-mode.el (latex-mode): In paragraph-separate allow
> 	optional argument [0] etc for \pagebreak[0]

This simple patch looks reasonable to me.  Could someone either install
it or tell the OP if he should do something more with it?

Best,

-- 
Marcin





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

* bug#19039: 24.3; latex-mode paragraph-separate of \pagebreak[0]
  2014-11-13 11:40 bug#19039: 24.3; latex-mode paragraph-separate of \pagebreak[0] Kevin Ryde
  2016-03-09  6:06 ` Marcin Borkowski
@ 2019-09-30  1:33 ` Stefan Kangas
  2019-10-30 21:37   ` Stefan Kangas
  1 sibling, 1 reply; 4+ messages in thread
From: Stefan Kangas @ 2019-09-30  1:33 UTC (permalink / raw)
  To: Kevin Ryde; +Cc: 19039

Kevin Ryde <user42_kevin@yahoo.com.au> writes:

> In latex-mode it'd be good if \pagebreak[0] was a paragraph separator,
> as for example
>
> Blah blah         \ pagagraph
> blah blah.        /
> \pagebreak[0]
> \begin{align}
> ...
>
> An unconditional \pagebreak is already a separator, but not when an
> optional arg [0] or [3] etc.
>
> Perhaps digits and brackets like below.  Only some of the "space" "skip"
> and "page" commands matched take optional args like this, but allowing
> for all shouldn't hurt.

I think this patch looks reasonable, and it seems to be working from my
testing.  Are there any objections to installing it?

Best regards,
Stefan Kangas





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

* bug#19039: 24.3; latex-mode paragraph-separate of \pagebreak[0]
  2019-09-30  1:33 ` Stefan Kangas
@ 2019-10-30 21:37   ` Stefan Kangas
  0 siblings, 0 replies; 4+ messages in thread
From: Stefan Kangas @ 2019-10-30 21:37 UTC (permalink / raw)
  To: Kevin Ryde; +Cc: 19039

close 19039 27.1
thanks

Stefan Kangas <stefan@marxist.se> writes:

> Kevin Ryde <user42_kevin@yahoo.com.au> writes:
>
>> In latex-mode it'd be good if \pagebreak[0] was a paragraph separator,
>> as for example
>>
>> Blah blah         \ pagagraph
>> blah blah.        /
>> \pagebreak[0]
>> \begin{align}
>> ...
>>
>> An unconditional \pagebreak is already a separator, but not when an
>> optional arg [0] or [3] etc.
>>
>> Perhaps digits and brackets like below.  Only some of the "space" "skip"
>> and "page" commands matched take optional args like this, but allowing
>> for all shouldn't hurt.
>
> I think this patch looks reasonable, and it seems to be working from my
> testing.  Are there any objections to installing it?

No objections within a couple of weeks.  Now pushed to master as commit
94b8153eaa.

Best regards,
Stefan Kangas





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

end of thread, other threads:[~2019-10-30 21:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-13 11:40 bug#19039: 24.3; latex-mode paragraph-separate of \pagebreak[0] Kevin Ryde
2016-03-09  6:06 ` Marcin Borkowski
2019-09-30  1:33 ` Stefan Kangas
2019-10-30 21:37   ` Stefan Kangas

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