Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
178932de
Commit
178932de
authored
Nov 10, 2000
by
Stefan Monnier
Browse files
(fill-indent-according-to-mode): New var.
(fill-region-as-paragraph): Use it.
parent
4301cf66
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
6 deletions
+30
-6
lisp/ChangeLog
lisp/ChangeLog
+15
-0
lisp/textmodes/fill.el
lisp/textmodes/fill.el
+15
-6
No files found.
lisp/ChangeLog
View file @
178932de
2000-11-10 Stefan Monnier <monnier@cs.yale.edu>
* textmodes/fill.el (fill-indent-according-to-mode): New var.
(fill-region-as-paragraph): Use it.
* textmodes/tex-mode.el (standard-latex-block-names): Add "math".
(latex-mode): Tweak tex-*-(head|trail)er regexps.
Tweak paragraph regexps to allow a leading [ \t]*.
(tex-latex-block): Insert a newline if necessary.
(latex-insert-item): Only insert a newline if necessary.
(tex-guess-main-file): New function.
(tex-main-file): Use it. Add arg `realfile'. Trim `.tex'.
Set tex-main-file if TeX-master is provided.
(tex-latex-indent-syntax-table): Map ( and ) to punctuation.
2000-11-10 Gerd Moellmann <gerd@gnu.org>
* startup.el (command-line): Set the default tooltip-mode
...
...
lisp/textmodes/fill.el
View file @
178932de
...
...
@@ -120,6 +120,9 @@ This function is used when `adaptive-fill-regexp' does not match."
:type
'function
:group
'fill
)
(
defvar
fill-indent-according-to-mode
nil
"Whether or not filling should try to use the major mode's indentation."
)
(
defun
current-fill-column
()
"Return the fill-column to use for this line.
The fill-column to use for a buffer is stored in the variable `fill-column',
...
...
@@ -193,7 +196,7 @@ Remove indentation from each line."
(
defun
fill-common-string-prefix
(
s1
s2
)
"Return the longest common prefix of strings S1 and S2, or nil if none."
(
let
((
cmp
(
compare-strings
s1
nil
nil
s2
nil
nil
)))
(
if
(
eq
cmp
t
)
(
if
(
eq
cmp
t
)
s1
(
setq
cmp
(
1-
(
abs
cmp
)))
(
unless
(
zerop
cmp
)
...
...
@@ -380,10 +383,10 @@ space does not end a sentence, so don't break a line there."
(
backward-char
1
)
(
setq
oneleft
t
)))
(
setq
to
(
point
))
;;;
;; If there was no newline, and there is text in the paragraph, then
;;;
;; create a newline.
;;;
(if (and (not oneleft) (> to from-plus-indent))
;
;; (newline))
;;
;; If there was no newline, and there is text in the paragraph, then
;;
;; create a newline.
;;
(if (and (not oneleft) (> to from-plus-indent))
;; (newline))
(
goto-char
from-plus-indent
))
(
if
(
not
(
>
to
(
point
)))
...
...
@@ -642,7 +645,13 @@ space does not end a sentence, so don't break a line there."
;; Give newline the properties of the space(s) it replaces
(set-text-properties (1- (point)) (point)
(text-properties-at (point)))
(indent-to-left-margin)
(if (or fill-prefix
(not fill-indent-according-to-mode)
(memq indent-line-function
;; Brain dead "
indenting
" functions.
'(indent-relative-maybe indent-relative)))
(indent-to-left-margin)
(indent-according-to-mode))
;; Insert the fill prefix after indentation.
;; Set prefixcol so whitespace in the prefix won't get lost.
(and fill-prefix (not (equal fill-prefix ""))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment